How to Setup Waypoints for an NPC

by Valkryst

Just in case anyone wants to know what Iā€™m running:


There are a number of waypoint-related commands and you may be wondering what they're all for even if we won't be using them in this tutorial. The commands are as follows.

Waypoint Creation Example:

For this example we require the GUID of the creature that will be set to the waypoint path that will be created. You can find the GUID by using the command .npc info while having an NPC selected. The GUID that we are using is listed as the DB GUID in the large section of information that shows up after the command.

As this is such a simple process, I will describe it step-by-step instead of writing it out as a paragraph. Whenever you see the acronym GUID in a command below, replace it with the GUID of the creature you are creating a waypoint for.

  1. Create a Macro and enter .wp add GUID. We will call this Macro #1.
  2. Create another Macro and enter .wp reload GUID on the first line and .wp load GUID on the second line. We will call this Macro #2.
  3. Add both Macros to your action bar.
  4. Make sure that the NPC is spawned at the starting position of the waypoint path, if it isn't, then spawn it at the correct location and return to step #1 and use the new GUID.
  5. Click Macro #1.
  6. Walk to the next point.
  7. Click Macro #1.
  8. Go back to step #6 until you reach the end of the waypoint path. When you reach this point, don't stop! You need to make a path back to the starting position.
  9. Walk to the next point.
  10. Click Macro #1.
  11. Go back to step #9 until you reach a point that is a straight line from the start of the waypoint path. From this point we are done creating the path as the creature will walk in a straight line back to the first waypoint in the waypoint path from the last waypoint in the waypoint path.
  12. Click Macro #2. Your NPC should begin to walk on the waypoint path. If the NPC does not begin walking on the waypoint path, try restarting the server.

After setting an NPC on a waypoint path, I always watch the NPC complete one full cycle of the path to make sure that it turned out as intended. Whenever the path is anything except for correct, I run the following query on my database and restart the server. This will erase the entire wapoint path and allow you to start from scratch.

        -- Replace GUID with the GUID of the creature
        -- that you created a waypoint path for.
        DELETE FROM waypoint_data WHERE id = GUID;

If you'd like to delete all unused waypoints at once, you can run the following query without modifying it.

        DELETE FROM waypoint_data WHERE (SELECT COUNT(1) FROM creature WHERE guid = < 1;