Sign in to follow this  

How to Setup Waypoints for an NPC


Before typing out the rest of this post, I’d like to thank Legion for giving me the idea to write this post. If you know of any additional information, notice an error, etc.. just comment and I’ll do my best to keep this post updated. In this post I will assume that you know enough to competently use the in-game commands on a TrinityCore server.

Just in case anyone wants to know what I’m running:

  • Windows 8, x64 — Home
  • Debian 7 x32 — Server
  • TrinityCore — Latest version as of 20/June/2015
  • WotLK 3.3.5a

Notes:

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.

  • .wp add ID – This command adds a new waypoint record to the database using the specified ID. It is recommended that you use the creature’s GUID as the ID. This prevents any errors that may occur from mix-matching IDs.
  • .wp event – I’m not entirely sure what this command is used for, nor have I had a use for it yet. If anyone knows, please comment below.
  • .wp load ID – This command will load (attach) the waypoint path specified by the ID to whichever NPC is selected when the command is executed.
  • .wp modify – I’m not entirely sure what this command is used for, nor have I had a use for it yet. If anyone knows, please comment below.
  • .wp reload ID – Whenever an existing waypoint path is altered, or a new waypoint path created, this command must be run to reload the waypoint path so that the server recognizes either the new points or the entire new path. This must be done before using .wp load ID.
  • .wp show on ID – Shows the waypoint path specified by the ID.
  • .wp show on – Shows the waypoint path loaded (attached) to the selected NPC.
  • .wp show off – Hides the currently visible waypoint path.
  • .wp info – Shows some information for the currently selected waypoint path.

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.

 

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

 


wAAACwAAAAAAQABAEACAkQBADs=



Recommended Comments

Let's say I wanted to make that every time a npc is spawned he follows a path(some waypoints), how could this be done?

Guess I should use smart_scripts?

Share this comment


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now