Sign in to follow this  

How to Set Creatures to Wander Randomly

Before typing out the rest of this post, I’d like to thank Tatsu of AC Web for posting, and resolving, his issue which taught me about this method of making creatures randomly wander. 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 be able to execute SQL queries on your database.

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

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


There are four fields in the creature table of the world database that we will be dealing with. The fields are as follows.

  1. spawndist – The distance, in yards, in which a creature can wander from it’s spawn point.
  2. MovementType – The type of movement of the creature. This should always be set to 1 to specify that the creature should wander randomly.
  3. id – The ID of the creature from the creature_template table.
  4. guid – The unique ID of a single creature. This can be found by selecting a creature in-game and using the .npc info command.

There are two, slightly, different queries which you can use, depending on what you wish to do. The first query will set all creatures, of the specified ID, to wander randomly in the specified spawndist radius. The second query will set a single creature, of the specified GUID, to wander randomly in the specified spawndist radius.

To use the queries, just replace 40 and 90201 with whichever values you require.

Query #1:.


Query #2:




Recommended Comments

The links in the tutorial above may be out of date. If they are, then you can most-likely find an up-to-date link to the blog here.

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