Difference between revisions of "How to Move Npcs"

From DSP Wiki
Jump to: navigation, search
(Initial format)
 
(= Making NPCs Movable)
Line 3: Line 3:
 
== Making NPCs Walkable ==
 
== Making NPCs Walkable ==
  
=== Making NPCs Movable ==
+
=== Making NPCs Movable ===
  
 
By default a npc will not be in the server update loop. This means the npc cannot move around.
 
By default a npc will not be in the server update loop. This means the npc cannot move around.
 +
 +
First find the id of the npc you want to update. Find your npc by looking in 'sql/npc_list.sql'. Search for your npcs name and copy the id.
 +
 +
npc_dummies currently uses the old npc format so you'll have to transform the npc id through this function: npcid + (4096 * zoneid) + 0x1000000).
 +
 +
Then put that inside a new row:
 +
 +
INSERT INTO `npc_dummies` VALUES('your_id_here');
 +
 +
Migrate the table and you're done.
  
 
== Examples ==
 
== Examples ==

Revision as of 22:24, 26 July 2013

Whats up? This will walk you through the process of making npcs and mobs move.

Making NPCs Walkable

Making NPCs Movable

By default a npc will not be in the server update loop. This means the npc cannot move around.

First find the id of the npc you want to update. Find your npc by looking in 'sql/npc_list.sql'. Search for your npcs name and copy the id.

npc_dummies currently uses the old npc format so you'll have to transform the npc id through this function: npcid + (4096 * zoneid) + 0x1000000).

Then put that inside a new row:

INSERT INTO `npc_dummies` VALUES('your_id_here');

Migrate the table and you're done.

Examples

NPC Example

Mob Example

Pathfind Interface

Pathfind Events

OnPath

OnMobRoamAction

OnMobRoam