Skip to content

Commit 5cc90ab

Browse files
committed
add movement radius as optional param to spawn_npc_command
1 parent 5d3dade commit 5cc90ab

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/plugins/commands/spawn-npc-command.plugin.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ const action: commandActionHandler = ({ player, args }) => {
2424
npcKey = npcDetails.gameId;
2525
}
2626

27+
const movementRadius: number = args.movementRadius as number;
28+
2729
const npc = new Npc(npcDetails ? npcDetails : npcKey,
2830
new NpcSpawn(npcDetails ? npcDetails.key : `unknown-${npcKey}`,
29-
player.position.clone(), 0, 'WEST'), player.instance);
31+
player.position.clone(), movementRadius, 'WEST'), player.instance);
3032

3133
activeWorld.registerNpc(npc);
3234
};
@@ -41,6 +43,11 @@ export default {
4143
{
4244
name: 'npcKey',
4345
type: 'either'
46+
},
47+
{
48+
name: 'movementRadius',
49+
type: 'number',
50+
defaultValue: 0
4451
}
4552
],
4653
handler: action

0 commit comments

Comments
 (0)