Guide on ScriptDev2's Event AI DB script

From Project Skyfire
Jump to navigation Jump to search

Event AI Tables

creature_ai_scripts

creature_ai_summons

creature_ai_texts

custom_texts

Event AI Guide

(spacer)

If you have any questions regarding EventAI, please direct them Here. Of course, it is a good idea to thoroughly study this guide and take a look at your own database tables before asking questions. If you're truly stumped by something, then come and ask a question.

(spacer)

Now on to the fun stuff...

Starting with revision 220, ScriptDev2 has implemented a DB-based scripting design that allows the use of a database (MySQL only right now) to specify the actions that a creature script will do. The script is called eventAI and will be so called throughout the rest of this guide. A basic eventAI script works with and requires only two pieces of information: What to do and When to do it. The first piece of information (the What) will be referred to as the action. Currently, a single eventAI script entry can have up to three actions. The second piece of information (the When) will be referred to as the event. Anyone that wants to create entries for the eventAI script needs to answer the two questions above. Throughout the script's lifecycle, it will continually perform the actions given when a defined event happens. Some events will only occur once while others can be timed so that they occur at a specified interval.

Now that the basic idea of the script has been explained, let's get down to the fun details. For convenience, reference tables will be provided at the end of this article that will contain short descriptions for fast lookup. Here will be included longer and more thorough descriptions. We shall first start out with what events are currently defined by the eventAI script. An event can use up to three different parameters and these parameters control different things depending on the event. If a parameter isn't specifically named for the event, it will not be used for that event.

One more thing: event AI can support phases. A "phase" is just a way to group certain events + actions together so that the creature will perform certain actions based on what event it is currently on. The way the phase system works in event AI is that for every event added, it needs to be specified under which phases the event SHOULD NOT occur. This is a bit confusing at first, so let's look at it more closely. A creature can have more than one phase, up to a max of 32 different phases (with the first one being phase 0, and last one being phase 31). How the phase selection field works is that it contains a 32bit number. Each bit in the number represents a possible phase, with the bit in the least significant position signifying phase 0 and the most significant bit signifying phase 31. The default value of zero in this field has no bits set and since the field controls when the event should NOT trigger, it would then mean that the event will always be triggered independent of the current phase the creature is in. Therefore, if you want to specify what phases the event should occur in, you need to add up all of the corresponding bits for all the other phases where the event shouldn't trigger in (confusing...yes).

For example, let's say that a certain creature using event AI will have a max of four phases. We are then dealing with a 4 bit number in this field. Let's further say that that certain creature has an event that will only trigger in its third phase (a timed spell cast for instance). Then the field should contain all of the phases the event SHOULDN'T be triggered in...then out of the four bits, we leave the third bit alone (off) and turn on all of the other bits so we get 1011 which is equal to 11, so we put in 11 as the inverse phase mask for the event entry. As another example, let's say that the same creature previously mentioned has another event that is only triggered in the first and fourth phases. This would mean that we need to ignore the second and third phases, so our bitmask would be 0110 which is equal to 6 so we put in 6 for this event's inverse phase mask field. Please note that both examples were tailored for a creature with four and only four phases. If you decide to add more phases later on, you will have to redefine all of the nonzero bitmasks for all of the mob's events.

Every event also has a chance field that controls the chance of that event actually occurring. Using a value of 0 in this field will make the event never occur. Values are from 0 to 100.


Common Questions

  1. My NPCs aren't executing their scripts in dungeons!
    1. Scroll down this page nearly to the bottom until you reach "Event Flags" - You'll see that the event_flags field needs to have a 2 or a 3 added to it, depending on whether it's for a raid or a Heroic instance, respectively. Most people forget this, and it won't work without the extra 2 or 3 added to the value already in that field.
  1. Does something have to be hostile for it to interact with me?
    1. No. It would be the first thought, as the most common type of event is 0, "In combat," but anything marked "OOC" ("Out of Combat") will work wonderfully for anything with faction 35. (friendly to everyone.) Look into event_type 1 and 10 for your solution.
  1. Can EventAI interact with Game Objects?
    1. Not really. The closest anyone has come out of casual experience (At least since 8/9/09) is to cast a spell which has been reconfigured via the Spell scripts table. That may be possible. Check the spell_scripts table action type 11, 12, and 13. They may be what you are looking for.


Event Explanations


  • 0 = EVENT_T_TIMER: COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4).
    • Parameter 1: InitialMin
    • Parameter 2: InitialMax
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 1 = EVENT_T_TIMER_OOC: OUT OF COMBAT - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4).
    • Parameter 1: InitialMin
    • Parameter 2: InitialMax
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 2 = EVENT_T_HP: Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
    • Parameter 1: HPMax% (Note: Max goes before Min here. Don't get confused.)
    • Parameter 2: HPMin%
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 3 = EVENT_T_MANA: Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
    • Parameter 1: ManaMax%
    • Parameter 2: ManaMin%
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 4 = EVENT_T_AGGRO: Expires upon initial aggro (does not repeat).
  • 5 = EVENT_T_KILL: Expires upon killing a player. Will repeat every (Param1) and (Param2).
    • Parameter 1: RepeatMin
    • Parameter 2: RepeatMax
  • 6 = EVENT_T_DEATH: Expires upon Death.
  • 7 = EVENT_T_EVADE: Expires upon creature EnterEvadeMode().
  • 8 = EVENT_T_SPELLHIT: Expires upon Spell hit. If (param1) is set will only expire on that spell. If (param2) will only expire on spells of that school. Will repeat every (Param3) and (Param4) .
    • Parameter 1: SpellID
    • Parameter 2: School
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 9 = EVENT_T_RANGE: Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4) .
    • Parameter 1: MinDist
    • Parameter 2: MaxDist
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 10 = EVENT_T_OOC_LOS: Expires when a unit moves within distance (MaxAllowedRange) of a creature. If (Param1) is zero it will expire only when unit is hostile, friendly otherwise (Param1 = 1), depends generally on faction. Will repeat every (Param3) and (Param4). Does not expire when the creature is in combat.
    • Parameter 1: Hostile-or-Not
    • Parameter 2: MaxAllowedRange
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 11 = EVENT_T_SPAWNED: Expires at initial spawn and at creature respawn (useful for setting ranged movement type)
  • 12 = EVENT_T_TARGET_HP: Expires when Current Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4) .
    • Parameter 1: HPMax%
    • Parameter 2: HPMin%
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 13 = EVENT_T_TARGET_CASTING: Expires when the player is casting a spell. Will repeat every (Param1) and (Param2) .
    • Parameter 1: RepeatMin
    • Parameter 2: RepeatMax
  • 14 = EVENT_T_FRIENDLY_HP: Expires when a friendly unit in radius(param2) has at least (param1) hp missing. Will repeat every (Param3) and (Param4) .
    • Parameter 1: HPDeficit
    • Parameter 2: Radius
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 15 = EVENT_T_FRIENDLY_IS_CC: Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4) .
    • Parameter 1: DispelType
    • Parameter 2: Radius
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 16 = EVENT_T_MISSING_BUFF: Expires when a friendly unit is missing aura's given by spell (param1) within radius (param2). Will repeat every (Param3) and (Param4) .
    • Parameter 1: SpellId
    • Parameter 2: Radius
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 17 = EVENT_T_SUMMONED_UNIT: Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
    • Parameter 1: CreatureId
    • Parameter 2: RepeatMin
    • Parameter 3: RepeatMax
  • 18 = EVENT_T_TARGET_MANA:
    • Parameter 1: ManaMax%
    • Parameter 2: ManaMin%
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 21 = EVENT_T_REACHED_HOME: Expires when creature reach it's home(spawn) location after Evade.
  • 22 = EVENT_T_RECEIVE_EMOTE: Expires when creature receive emote with text emote id(enum TextEmotes). Condition can be defined. If set, then most conditions has additional value (see table enum ConditionType below.)
    • Parameter 1: EmoteId
    • Parameter 2: Condition
    • Parameter 3: CondValue1
    • Parameter 4: CondValue2
  • 23 = EVENT_T_BUFFED: Expires when creature have spell (Param1) auras applied stack greater or equal provided in Param2 amount. Will repeat every (Param3) and (Param4).
    • Parameter 1: SpellId
    • Parameter 2: AmmountInStack
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 24 = EVENT_T_TARGET_BUFFED: Expires when target unit have spell (Param1) auras applied stack greater or equal provided in (Param2) amount. Will repeat every (Param3) and (Param4).
    • Parameter 1: SpellId
    • Parameter 2: AmmountInStack
    • Parameter 3: RepeatMin
    • Parameter 4: RepeatMax
  • 25 = EVENT_T_SUMMONED_JUST_DIED: Expires after creature with entry = (Param1) dies. Expires for all spawns if (Param1) = 0. Will repeat every (Param2) and (Param3).
    • Parameter 1: CreatureId
    • Parameter 2: RepeatMin
    • Parameter 3: RepeatMax
  • 26 = EVENT_T_SUMMONED_JUST_DESPAWN: Expires before creature with entry = (Param1) is despawned. Expires for all spawns if (Param1) = 0. Will repeat every (Param2) and (Param3).
    • Parameter 1: CreatureId
    • Parameter 2: RepeatMin
    • Parameter 3: RepeatMax


Now that all of the supported events have been listed and described, we shall now move on to the actions that can be performed. Each event can take up to three actions. The actions will all be performed when the event is triggered and they will be performed in the order that they have been defined. This means that, for a certain event, action 1 will be performed first, followed by action 2, then lastly by action 3. Just like event definitions, each action can use up to three different parameters but not all actions will use all three parameters. If a parameter isn't mentioned for an action, then that action does not need that parameter.

Before we start to list and explain the different actions that can be taken, we must first look at how the eventAI targeting system works. Due to technical reasons in how targetting is handled, the eventAI script cannot target anything or anyone that is not in its threat list or is not the scripted creature itself. It also can't currently target anyone specific in its threat list except by their position in the threat list. However, even then it can only target specifically the current victim, the second unit in its threat list, and the last unit in its threat list. It can also target units in its threat list at random and has two options for that: anyone in its threat list at random, or anyone in its threat list excluding the unit with the most threat. Aside from all of those external targets, the script can always target itself. More information on the target types can be found in the reference tables at the end of this guide.

One last note before we start looking at individual actions is about the texts. The eventAI script has support for localized text entries. Therefore, you can define what the mob will say in more than one language all in another table and the script will show the corresponding localized text to the corresponding client (english text to enUS/enGB clients, german text to deDE clients, etc). All of the localized text entries will have a unique text ID assigned to them and it is that text ID that will be used by any actions that require textual input.

Action Explanations


  • 0 = ACTION_T_NONE: Does nothing!
  • 1 = ACTION_T_SAY: Displays the -TextId as defined. In case -TextId2 and optionally -TextId3, the output will be randomized. Type text are defined in the creature_ai_texts table (say, yell, whisper, etc) along with other options for the text. All values are required to be negative.
    • Parameter 1: The entry of the text that the NPC should use from creature_ai_texts table. Optionally a entry from other tables can be used (such as custom_texts).Entry are required to be negative and exist in a *_texts-table. The type text to be displayed are defined in the texts-table itself (Say, Yell, Whisper, Emote Text, Boss Whisper, Boss Emote)Other options are also to be defined in the texts-table, such as a sound to be heard with the text and the language used in output (common, dwarvish, etc).In case this entry has a localized version of the text, the localized text will be displayed in client that support this locale.
    • Parameter 2: Optional. TextId can be defined in addition. The same apply to this as explained above, however eventAI will randomize between the two.
    • Parameter 3: Optional, if Parameter 2 exist. In this case, eventAI will randomize between three.
  • 2 = ACTION_T_SET_FACTION: Change faction for creature.
    • Parameter 1: FactionId of the desired faction. If param1==0, creature will revert to default faction.
  • 3 = ACTION_T_MORPH_TO_ENTRY_OR_MODEL: Set model from creature_template.entry(param1) OR set explicit modelId(param2). If param1 AND param2 both 0, demorph and revert to default model for creature.
    • Parameter 1: CreatureEntry of the npc.
    • Parameter 2: ModelId that needs to be changed to.


  • 4 = ACTION_T_SOUND: When activated, the creature will play the specified sound.
    • Parameter 1: The sound ID to be played. Sound IDs are contained in the DBC files.
  • 5 = ACTION_T_EMOTE: When activated, the creature will perform a visual emote. Unlike a text emote, a visual emote is one where the creature will actually move or perform a gesture.
    • Parameter 1: The emote ID that the creature should perform. Emote IDs are also contained in the DBC but they can be found in the mangos source as well.
  • 6 = ACTION_T_RANDOM_SAY: UNUSED
  • 7 = ACTION_T_RANDOM_YELL: UNUSED
  • 8 = ACTION_T_RANDOM_TEXTEMOTE: UNUSED
  • 9 = ACTION_T_RANDOM_SOUND: Similar to the ACTION_T_SOUND action, when this action is activated, it will choose at random a sound to play. This action needs all three parameters to be filled and it will pick a random entry from the three. NOTE: (1)
    • Parameter 1: The sound ID to be played as choice one.
    • Parameter 2: The sound ID to be played as choice two.
    • Parameter 3: The sound ID to be played as choice three.
  • 10 = ACTION_T_RANDOM_EMOTE: Similar to the ACTION_T_EMOTE action, when this action is activated, it will choose at random an emote ID to emote visually. This action needs all three parameters to be filled and it will pick a random entry from the three. NOTE: (1)
    • Parameter 1: The emote ID that the creature should perform as choice one.
    • Parameter 2: The emote ID that the creature should perform as choice two.
    • Parameter 3: The emote ID that the creature should perform as choice three.
  • 11 = ACTION_T_CAST: When activated, the creature will cast a spell specified by a spell ID on a target specified by the target type.
    • Parameter 1: The spell ID to use for the cast. The value used in this field needs to be a valid spell ID.
    • Parameter 2: The target type defining who the creature should cast on. The value in this field needs to be a valid target type as specified in the reference tables below.
    • Parameter 3: This field can only be 0 or 1. If it is 1, then the spell cast will interrupt any spells that are already in the progress of being casted; otherwise if the creature is already casting a spell and this field is 0, then this action will be skipped.
  • 12 = ACTION_T_SUMMON: When activated, the creature will summon another creature at the same spot as itself that will attack the specified target.
    • Parameter 1: The creature template ID to be summoned. The value here needs to be a valid creature template ID.
    • Parameter 2: The target type defining who the summoned creature will attack. The value in this field needs to be a valid target type as specified in the reference tables below. NOTE: Using target type 0 will cause the summoned creature to not attack anyone.
    • Parameter 3: The duration until the summoned creature should be unsummoned. The value in this field is in milliseconds or 0. If zero, then the creature will not be unsummoned until it leaves combat.
  • 13 = ACTION_T_THREAT_SINGLE_PCT: When activated, this action will modify the threat of a target in the creature's threat list by the specified percent.
    • Parameter 1: Threat percent that should be modified. The value in this field can range from -100 to +100. If it is negative, threat will be taken away and if positive, threat will be added.
    • Parameter 2: The target type defining on whom the threat change should occur. The value in this field needs to be a valid target type as specified in the reference tables below.
  • 14 = ACTION_T_THREAT_ALL_PCT: When activated, this action will modify the threat for everyone in the creature's threat list by the specified percent.
    • Parameter 1: The percent that should be used in modifying everyone's threat in the creature's threat list. The value here can range from -100 to +100. NOTE: Using -100 will cause the creature to reset everyone's threat to 0 so that everyone has the same amount of threat. It does NOT make any changes as to who is in the threat list.
  • 15 = ACTION_T_QUEST_EVENT: When activated, this action will satisfy the external completion requirement for the quest for the specified target defined by the target type. This action can only be used with player targets so it must be ensured that the target type will point to a player.
    • Parameter 1: The quest template ID. The value here must be a valid quest template ID. Furthermore, the quest should have SpecialFlags | 2 as it would need to be completed by an external event which is the activation of this action.
    • Parameter 2: The target type defining whom the quest should be completed for. The value in this field needs to be a valid target type as specified in the reference tables below.
  • 16 = ACTION_T_CASTCREATUREGO: When activated, this action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature.
    • Parameter 1: The quest template ID. The value here must be a valid quest template ID.
    • Parameter 2: The spell ID to use to simulate the cast. The value used in this field needs to be a valid spell ID.
    • Parameter 3: The target type defining whom the quest credit should be given to. The value in this field needs to be a valid target type as specified in the reference tables below.
  • 17 = ACTION_T_SET_UNIT_FIELD: This probably can be no longer used!

When activated, this action can change the target's unit field values. More information on the field value indeces can be found at Character data page.

    • Parameter 1: The index of the field number to be changed. Use Character data page for a list of indeces and what they control. Note that a creature shares the same indeces with a player except for the PLAYER_* ones.
    • Parameter 2: The new value to be put in the field.
    • Parameter 3: The target type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below.
  • 18 = ACTION_T_SET_UNIT_FLAG: When activated, this action changes the target's flags by adding (turning on) more flags. For example, this action can make the creature unattackable/unselectable if the right flags are used.
    • Parameter 1: The flag(s) to be set. Multiple flags can be set by using bitwise-OR on them (adding them together).
    • Parameter 2: The target type defining for whom the flags should be changed. The value in this field needs to be a valid target type as specified in the reference tables below.
  • 19 = ACTION_T_REMOVE_UNIT_FLAG: When activated, this action changes the target's flags by removing (turning off) flags. For example, this action can make the creature normal after it was unattackable/unselectable if the right flags are used.
    • Parameter 1: The flag(s) to be removed. Multiple flags can be set by using bitwise-OR on them (adding them together).
    • Parameter 2: The target type defining for whom the flags should be changed. The value in this field needs to be a valid target type as specified in the reference tables below.
  • 20 = ACTION_T_AUTO_ATTACK: This action controls whether or not the creature should stop or start the auto melee attack.
    • Parameter 1: If zero, then the creature will stop its melee attacks. If non-zero, then the creature will either continue its melee attacks (the action would then have no effect) or it will start its melee attacks on the target with the top threat if its melee attacks were previously stopped.
  • 21 = ACTION_T_COMBAT_MOVEMENT: This action controls whether or not the creature will always move towards its target.
    • Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before.
    • Parameter 2: If non-zero and creature in combat, then stop melee combat state (if Param1 = 0) or start melee combat state (if Param1 != 0) will be sent.
  • 22 = ACTION_T_SET_PHASE: When activated, this action sets the creature's event to the specified value.
    • Parameter 1: The new phase to set the creature in. This number must be an integer between 0 and 31 inclusive.
  • 23 = ACTION_T_INC_PHASE: When activated, this action will increase (or decrease) the current creature's phase.
    • Parameter 1: The number of phases to increase or decrease. Use negative values to decrease the current phase. After increasing or decreasing the phase by this action, the current phase must not be lower than 0 or exceed 31.
  • 24 = ACTION_T_EVADE: When activated, the creature will immediately exit out of combat, clear its threat list, and move back to its spawn point. Basically, this action will reset the whole encounter.
  • 25 = ACTION_T_FLEE: When activated, the creature will try to flee from combat. Currently this is done by it casting a fear-like spell on itself called "Run Away".
  • 26 = ACTION_T_QUEST_EVENT_ALL: This action does the same thing as the ACTION_T_QUEST_EVENT does but it does it for all players in the creature's threat list. Note that if a player is not in its threat list for whatever reason, he/she won't get the quest completed.
    • Parameter 1: The quest ID to finish for everyone.
  • 27 = ACTION_T_CASTCREATUREGO_ALL: This action does the same thing as the ACTION_T_CASTCREATUREGO does but it does it for all players in the creature's threat list. Note that if a player is not in its threat list for whatever reason, he/she won't receive the cast emulation.
    • Parameter 1: The quest template ID.
    • Parameter 2: The spell ID used to simulate the cast.
  • 28 = ACTION_T_REMOVEAURASFROMSPELL: This action will remove all auras from a specific spell from the target.
    • Parameter 1: The target type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below.
    • Parameter 2: The spell ID whose auras will be removed.
  • 29 = ACTION_T_RANGED_MOVEMENT: This action changes the movement type generator to ranged type using the specified values for angle and distance. Note that specifying zero angle and distance will make it just melee instead.
    • Parameter 1: The distance the mob should keep between it and its target.
    • Parameter 2: The angle the mob should use.
  • 30 = ACTION_T_RANDOM_PHASE: Randomly sets the phase to one from the three parameter choices. NOTE: (1)
    • Parameter 1: A possible random phase choice.
    • Parameter 2: A possible random phase choice.
    • Parameter 3: A possible random phase choice.
  • 31 = ACTION_T_RANDOM_PHASE_RANGE: Randomly sets the phase between a range of phases controlled by the parameters.
    • Parameter 1: The minimum of the phase range.
    • Parameter 2: The maximum of the phase range. The number here must be greater than the one in parameter 1.
  • 32 = ACTION_T_SUMMON: Summons a creature using the data specified in the separate summons table.
    • Parameter 1: The creature template ID to be summoned. The value here needs to be a valid creature template ID.
    • Parameter 2: The target type defining who the summoned creature will attack. The value in this field needs to be a valid target type as specified in the reference tables below. NOTE: Using target type 0 will cause the summoned creature to not attack anyone.
    • Parameter 3: The summon ID from the creature_ai_texts table controlling the position (and spawntime) where the summoned mob should be spawned at.
  • 33 = ACTION_T_KILLED_MONSTER: When activated, this action will call KilledMonster() function for the player. It can be used to give creature credit for killing a creature (note that it can be ANY creature including certain quest specific triggers). In general if the quest is set to be accompished on different creatures (e.g. "Credit" templates).
    • Parameter 1: The creature template ID. The value here must be a valid creature template ID.
    • Parameter 2: The target type defining whom the quest kill count should be given to. The value in this field needs to be a valid target type as specified in the reference tables below.
  • 34 = ACTION_T_SET_INST_DATA: Sets data for the instance. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned.
    • Parameter 1: The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script.
    • Parameter 2: The value to put at that field index. The number here must be a valid 32 bit number.
  • 35 = ACTION_T_SET_INST_DATA64: Sets GUID (64 bits) data for the instance based on the target. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned.
    • Parameter 1: The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script.
    • Parameter 2: The target type to use to get the GUID that will be stored at the field index. The value in this field needs to be a valid target type as specified in the reference tables below.
  • 36 = ACTION_T_UPDATE_TEMPLATE: This function temporarily changes creature entry to new entry, display is changed, loot is changed, but AI is not changed. At respawn creature will be reverted to original entry.
    • Parameter 1: The creature template ID. The value here must be a valid creature template ID.
    • Parameter 2: Use model_id from team : Alliance(0) or Horde (1).
  • 37 = ACTION_T_DIE: Kills the creature
  • 38 = ACTION_T_ZONE_COMBAT_PULSE: Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances.
  • 39 = ACTION_T_CALL_FOR_HELP: Call any friendly creatures (if its not in combat/etc) in radius attack creature target.
    • Parameter 1: Radius from creature.
  • 40 = ACTION_T_SET_SHEATH: Let set sheath state for creature (0-no weapon show (not used mostly by creatures), 1-melee weapon show, 2-ranged weapon show)
    • Parameter 1: Sheath state of the creature.
  • 41 = ACTION_T_FORCE_DESPAWN: Despawns the creature.
    • Parameter 1: Delay in ms. 0 for instant despawn.
  • 42 = ACTION_T_SET_INVINCIBILITY_HP_LEVEL: Sets minimum health level that NPC can reach (NPC will not go below this value)
    • Parameter 1: Minimum health level.
    • Parameter 2: Format of Parameter 1. If (Param2) == 0, (Param1) means exact HP value. Otherwise (Param1) means percent (0 - 100) of creature's max HP.
  • 43 = ACTION_T_MOUNT_TO_ENTRY_OR_MODEL: Creature mounts into a entry OR modelId. Or 0 for both to unmount.
  • 97 = ACTION_T_SET_PHASE_MASK: Makes the npc enter in a phase_mask. The phase_mask can be taken from spells. For example, a spell who have (Aura #261) (4) = phasemask = 4
    • Parameter 1: Phase Mask.
  • 98 = ACTION_T_SET_STAND_STATE: Changes the NPC's Stand State.
    • Parameter 1: Stand State.
  • 99 = ACTION_T_MOVE_RANDOM_POINT: Moves the NPC to a random point.
    • Parameter 1: Radius. Determines the range in which the random point can be.
  • 100 = ACTION_T_SET_VISIBILITY: Changes the NPC's visibility.
    • Parameter 1: Visibility State.
  • 101 = ACTION_T_SET_ACTIVE: Changes the NPC's active state.
    • Parameter 1: Active.
  • 102 = ACTION_T_SET_AGGRESSIVE: Changes the NPC's react state.
    • Parameter 1: React State. Can be Aggressive, Passive or Defensive.
  • 103 = ACTION_T_ATTACK_START_PULSE: Starts attacking nearest target in given radius
    • Parameter 1: Radius.
  • 104 = ACTION_T_SUMMON_GO: Summons a GO at the current NPC's position.
    • Parameter 1: GO Entry.
    • Parameter 2: Despawn Time.


(1) = Use -1 to specify that if this param is picked to do nothing. Random is constant between actions within an event. So if you have a random Yell and a random Sound they will match up (ex: param2 with param2)

Reference Tables


All of the events, actions, and target types are summarized in tabular format for convenience purposes and fast lookup. NU = Not Used; * - optional

Events

ID Name Param 1 Param 2 Param 3 Param 4 Description
0 EVENT_T_TIMER InitialMin InitialMax RepeatMin RepeatMax COMBAT ONLY - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4).
1 EVENT_T_TIMER_OOC InitialMin InitialMax RepeatMin RepeatMax OUT OF COMBAT - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4).
2 EVENT_T_HP HPMax% HPMin% RepeatMin RepeatMax Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
3 EVENT_T_MANA ManaMax% ManaMin% RepeatMin RepeatMax Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
4 EVENT_T_AGGRO n/a n/a n/a n/a Expires upon initial aggro (does not repeat).
5 EVENT_T_KILL RepeatMin RepeatMax n/a n/a Expires upon killing a player. Will repeat every (Param1) and (Param2).
6 EVENT_T_DEATH n/a n/a n/a n/a Expires upon Death.
7 EVENT_T_EVADE n/a n/a n/a n/a Expires upon creature EnterEvadeMode().
8 EVENT_T_SPELLHIT SpellID School RepeatMin RepeatMax Expires upon Spell hit. If (param1) is set will only expire on that spell. If (param2) will only expire on spells of that school. Will repeat every (Param3) and (Param4) .
9 EVENT_T_RANGE MinDist MaxDist RepeatMin RepeatMax Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4) .
10 EVENT_T_OOC_LOS Hostile-or-Not MaxAllowedRange RepeatMin RepeatMax Expires when a unit moves within distance (MaxAllowedRange) of a creature. If (Param1) is zero it will expire only when unit is hostile, friendly otherwise (Param1 = 1), depends generally on faction. Will repeat every (Param3) and (Param4). Does not expire when the creature is in combat.
11 EVENT_T_SPAWNED n/a n/a n/a n/a Expires at initial spawn and at creature respawn (useful for setting ranged movement type)
12 EVENT_T_TARGET_HP HPMax% HPMin% RepeatMin RepeatMax Expires when Current Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4) .
13 EVENT_T_TARGET_CASTING RepeatMin RepeatMax n/a n/a Expires when the player is casting a spell. Will repeat every (Param1) and (Param2) .
14 EVENT_T_FRIENDLY_HP HPDeficit Radius RepeatMin RepeatMax Expires when a friendly unit in radius(param2) has at least (param1) hp missing. Will repeat every (Param3) and (Param4) .
15 EVENT_T_FRIENDLY_IS_CC DispelType Radius RepeatMin RepeatMax Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4) .
16 EVENT_T_MISSING_BUFF SpellId Radius RepeatMin RepeatMax Expires when a friendly unit is missing aura's given by spell (param1) within radius (param2). Will repeat every (Param3) and (Param4) .
17 EVENT_T_SUMMONED_UNIT CreatureId RepeatMin RepeatMax n/a Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
18 EVENT_T_TARGET_MANA ManaMax% ManaMin% RepeatMin RepeatMax
21 EVENT_T_REACHED_HOME n/a n/a n/a n/a Expires when creature reach it's home(spawn) location after Evade.
22 EVENT_T_RECEIVE_EMOTE EmoteId Condition CondValue1 CondValue2 Expires when creature receive emote with text emote id(enum TextEmotes). Condition can be defined. If set, then most conditions has additional value (see enum ConditionType)
23 EVENT_T_BUFFED SpellId AmmountInStack RepeatMin RepeatMax Expires when creature have spell (Param1) auras applied stack greater or equal provided in Param2 amount. Will repeat every (Param3) and (Param4).
24 EVENT_T_TARGET_BUFFED SpellId AmmountInStack RepeatMin RepeatMax Expires when target unit have spell (Param1) auras applied stack greater or equal provided in Param2 amount. Will repeat every (Param3) and (Param4).
25 EVENT_T_SUMMONED_JUST_DIED CreatureId RepeatMin RepeatMax n/a Expires after creature with entry = (Param1) dies. Expires for all spawns if (Param1) = 0. Will repeat every (Param2) and (Param3).
26 EVENT_T_SUMMONED_JUST_DESPAWN CreatureId RepeatMin RepeatMax n/a Expires after creature with entry = (Param1) is despawned. Expires for all spawns if (Param1) = 0. Will repeat every (Param2) and (Param3).


Actions

ID Name Param 1 Param 2 Param 3 Description
1 ACTION_T_SAY -TextId1, -TextId2, -TextId3 Displays the -TextId as defined. In case -TextId2 and optionally -TextId3, the output will be randomized. Type text are defined in the text table itself(say, yell, whisper, etc) along with other options for the text. All values are required to be negative.
2 ACTION_T_SET_FACTION FactionId UNUSED UNUSED Change faction for creature. If param1==0, creature will revert to default faction.
3 ACTION_T_MORPH_TO_ENTRY_OR_MODEL CreatureEntry ModelId UNUSED Set model from creature_template.entry (param1) OR set explicit modelId(param2). If param1 AND param2 both 0, demorph and revert to default model for creature.
4 ACTION_T_SOUND Sound ID NU NU Creature plays sound
5 ACTION_T_EMOTE Emote ID NU NU Creature does visual emote
6 ACTION_T_RANDOM_SAY UNUSED UNUSED UNUSED UNUSED
7 ACTION_T_RANDOM_YELL UNUSED UNUSED UNUSED UNUSED
8 ACTION_T_RANDOM_TEXTEMOTE UNUSED UNUSED UNUSED UNUSED
9 ACTION_T_RANDOM_SOUND Sound ID 1 Sound ID 2 Sound ID 3 Picks a sound ID at random and plays it; -1 = action skipped if chosen. See SoundEntries.dbc
10 ACTION_T_RANDOM_EMOTE Emote ID 1 Emote ID 2 Emote ID 3 Picks an emote ID at random and does visual emote; -1 = action skipped if chosen
11 ACTION_T_CAST Spell ID T-Type Cast Flag Casts spell on a target with specified cast flags (see table below).
12 ACTION_T_SUMMON Creature ID T-Type Duration* Summons a creature at itself for a given duration (infinite if zero) that will attack a target.
13 ACTION_T_THREAT_SINGLE_PCT Threat % T-Type NU Modifies the target's threat by a percent
14 ACTION_T_THREAT_ALL_PCT Threat % NU NU Modifies everyone's threat by a percent
15 ACTION_T_QUEST_EVENT Quest ID T-Type NU Satisfies external script objective for a quest for the target (must be a player)
16 ACTION_T_CASTCREATUREGO Quest ID Spell ID T-Type Emulates spell cast on the creature for the target (must be a player)
17 ACTION_T_SET_UNIT_FIELD Index Value T-Type Sets unit field at the index to the value given for the target
18 ACTION_T_SET_UNIT_FLAG Flag(s) T-Type NU Sets flag(s) on the target
19 ACTION_T_REMOVE_UNIT_FLAG Flag(s) T-Type NU Removes flag(s) from the target
20 ACTION_T_AUTO_ATTACK Boolean NU NU If 0, stops auto melee; else continues/starts it
21 ACTION_T_COMBAT_MOVEMENT Boolean Boolean NU If Param 1 == 0, stops/prevents combat movement; else starts/enables it. If Param 2 != 0 and creature in combat, stop melee combat state (if Param1 == 0) or start melee combat state (if Param1 != 0) will be sent.
22 ACTION_T_SET_PHASE Phase # NU NU Sets current phase to number given
23 ACTION_T_INC_PHASE Number NU NU Increments (or decrements) the phase by given number.
24 ACTION_T_EVADE NU NU NU Force creature reset. Exit combat + lose threat
25 ACTION_T_FLEE NU NU NU Force creature to flee from combat
26 ACTION_T_QUEST_EVENT_ALL Quest ID NU NU Satisfies external objective for a quest for all players in threat list
27 ACTION_T_CASTCREATUREGO_ALL Quest ID Spell ID NU Emulates spell cast on creature for all players in threat list
28 ACTION_T_REMOVEAURASFROMSPELL T-Type Spell ID NU Removes all auras from a spell ID from the target.
29 ACTION_T_RANGED_MOVEMENT Distance Angle NU Uses ranged movement generator keeping the creature at a distance.
30 ACTION_T_RANDOM_PHASE Phase 1 Phase 2 Phase 3 Randomly chooses a phase from the list of three phases.
31 ACTION_T_RANDOM_PHASE_RANGE Min Phase Max Phase NU Chooses a random phase in the range specified.
32 ACTION_T_SUMMON Creature ID T-Type Summon ID Summons a creature at the coords specified for the given summon id that will attack a target.
33 ACTION_T_KILLED_MONSTER Creature ID T-Type NU Simulates a kill for a mob of ID given for the player from the target type.
34 ACTION_T_SET_INST_DATA Field Value NU Sets new value for the field given in the instance script.
35 ACTION_T_SET_INST_DATA64 Field T-Type NU Stores target's GUID at the field given in the instance script.
36 ACTION_T_UPDATE_TEMPLATE Entry Fraction NU Temporarily changes creature entry to new entry.
37 ACTION_T_DIE NU NU NU Kills the creature.
38 ACTION_T_ZONE_COMBAT_PULSE NU NU NU Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances.
39 ACTION_T_CALL_FOR_HELP Radius NU NU Call any friendly creatures (if its not in combat/etc) in radius attack creature target.
40 ACTION_T_SET_SHEATH Sheath NU NU Let set sheath state for creature (0-no weapon show (not used mostly by creatures), 1-melee weapon show, 2-ranged weapon show)
41 ACTION_T_FORCE_DESPAWN Despawn in ms. 0 for instant NU NU Despawns the creature
42 ACTION_T_SET_INVINCIBILITY_HP_LEVEL Min Health Boolean NU Set minimum health level for creature before it becomes invincible. If (Param2) == 0, Min Health is flat value, otherwise it is % of max HP.
43 ACTION_T_MOUNT_TO_ENTRY_OR_MODEL Creature ID ModelId NU Mounts creature. Use creature entry or model id. Or 0 for both to unmount.
97 ACTION_T_SET_PHASE_MASK Phase Mask NU NU Makes the npc enter in a phase_mask. The phase_mask can be taken from spells. For example, a spell who have (Aura #261) (4) = phasemask = 4
98 ACTION_T_SET_STAND_STATE Stand State NU NU Changes the npc's Stand State.
99 ACTION_T_MOVE_RANDOM_POINT Radius NU NU Moves the npc to a random point. Radius determines the range in that can be the random point.
100 ACTION_T_SET_VISIBILITY Visibility State NU NU Changes the npc's visibility.
101 ACTION_T_SET_ACTIVE Active NU NU Changes the npc's active state.
102 ACTION_T_SET_AGGRESSIVE React State NU NU Changes the npc's react state. Can be Aggressive, Passive or Defensive.
103 ACTION_T_ATTACK_START_PULSE Radius NU NU Starts attacking nearest target in given radius.
104 ACTION_T_SUMMON_GO GO Entry Despawn Time NU Summons a GO at the current npc's position.


Target Types (T-Type)

ID Name Description
0 TARGET_T_SELF Targets itself
1 TARGET_T_HOSTILE Targets the current victim (usually the one with the most threat)
2 TARGET_T_HOSTILE_SECOND_AGGRO Targets the unit with the second greatest threat in the threat list
3 TARGET_T_HOSTILE_LAST_AGGRO Targets the unit with the least threat in the threat list
4 TARGET_T_HOSTILE_RANDOM Targets a random unit from the threat list
5 TARGET_T_HOSTILE_RANDOM_NOT_TOP Targets a random unit from the threat list excluding the one with the most threat
6 TARGET_T_ACTION_INVOKER Targets the unit that caused the event; for certain events only.


Cast Flags

Bit / Value* Name Description
0 / 1 CAST_INTURRUPT_PREVIOUS Interrupts any previous spell casting.
1 / 2 CAST_TRIGGERED Forces the cast to be instant and ignores any mana/reagents requirements.
2 / 4 CAST_FORCE_CAST Forces spell to cast even if the target is possibly out of range or the creature is possibly out of mana
3 / 8 CAST_NO_MELEE_IF_OOM Prevents creature from entering melee if out of mana or out of range
4 / 16 CAST_FORCE_TARGET_SELF Forces the target to cast this spell on itself
5 / 32 CAST_AURA_NOT_PRESENT Only casts the spell on the target if the target does not have the aura from that spell on itself already.


Condition Type (For Event_type 22)

Condition Value 1 Value 2* Description
0 None 0 0 Nothing.
1 Aura SpellID "effindex" If the SpellID's aura is on you.
2 Item ItemID Amount If you have the item in your inventory.
3 Item Equipped ItemId Amount If you have the item equipped on your character.
4 Zone ID ZoneID 0 Taken from AreaTable.dbc.
5 Reputation FactionID Minimum Rank Taken from FactionTemplate.dbc. Exalted is 42000.
6 Team Team# 0 In "Team#" use 469 if alliance, 67 if Horde.
7 Skill SkillID Min Amount Values taken from SkillLine.dbc.
8 Quest Rewarded QuestID 0 If you have already completed that QuestID.
9 Quest Taken QuestID 0 If you are currently on that QuestID.
12 Active Event EventID 0 This is not from your database. This value is from the DBC file enum HolidayIds.

* - If the value is listed as 0, then leave it as 0.


Event Flags

Bit / Value* Name Description
0 / 1 EFLAG_REPEATABLE Event repeats (Does not repeat if this flag is not set)
1 / 2 EFLAG_DIFFICULTY_0 Event only occurs in instance difficulty 0 (will not occur if not set)
2 / 4 EFLAG_DIFFICULTY_1 Event only occurs in instance difficulty 1 (will not occur if not set)
3 / 8 EFLAG_DIFFICULTY_2 Event only occurs in instance difficulty 2 (will not occur if not set)
4 / 16 EFLAG_DIFFICULTY_3 Event only occurs in instance difficulty 3 (will not occur if not set)
7 / 128 EFLAG_DEBUG_ONLY Event only occurs in debug build

* = Represents what the value in the field would be with no other additive flags. For help on Binary Addition, read the "Working With Phases" portion of the guide below.


React States

Value Name
0 REACT_PASSIVE
1 REACT_DEFENSIVE
2 REACT_AGGRESSIVE


Unit Visibility

Value Name
0 VISIBILITY_OFF -- absolute, not detectable, GM-like, can see all other.
1 VISIBILITY_ON
2 VISIBILITY_GROUP_STEALTH -- detect chance, seen and can see group members.
5 VISIBILITY_RESPAWN -- special totally not detectable visibility for force delete object at respawn command.


Unit Stand State

Value Name
0 UNIT_STAND_STATE_STAND
1 UNIT_STAND_STATE_SIT
2 UNIT_STAND_STATE_SIT_CHAIR
3 UNIT_STAND_STATE_SLEEP
4 UNIT_STAND_STATE_SIT_LOW_CHAIR
5 UNIT_STAND_STATE_SIT_MEDIUM_CHAIR
6 UNIT_STAND_STATE_SIT_HIGH_CHAIR
7 UNIT_STAND_STATE_DEAD
8 UNIT_STAND_STATE_KNEEL

(Spacer)

Summary for the meek

If you still don't understand what EventAI is, it's understandable. It's a very powerful table and can look confusing at first glance. I will elaborate on some of the concepts here.

The event_type field determines what you need to put into the event_param1 - event_param4 fields. If your event_type is 0, (In-combat.) your parameters will need to be lengths of time (in milliseconds) in which the action will take place. If your event_type is 6, (on death) we won't need any parameters, as the condition has no possible parameters to work with. Death is death. We can't define what kind of death it should be, so there are no parameters necessary.


Working with Phases

Working with phases requires a certain amount of math. You will have to know a few things before we begin.

  1. You should have an idea of how many phases the NPC will have.
  2. You will have to know Binary Addition. Don't worry, I'll show you how to do it.

- Binary Addition -

  • 0110 = 6 (base 10)
  • 0111 = 7 (base 10)
  • ____ = __
  • 1101 = 13 (base 10)


  • 06 05 04 03 02 01 00 <-- The place values. (PhaseID)
  • 32 16 08 04 02 01 00 <-- Note how it doubles in size. This is what you add (phase_mask).

_

  • _1 __ 1 __ 1
  • 04 + 02 + 01 = 07.

_

  • _1 __ 0 __ 1 __ 1 __ 0 <-- Note how place 1, 2, and 4 are 1, but place 3 is not.
  • 08 + 04 + 02 + 01 = 11.

So you add 1, 2, and 8 together to get 11. You do not add the 4, because its bit was a 0.

__ __ __

Now back to Phases.

The overall concept (not method, just yet!) of a phase, is a "section" of activities that the NPC will act on. Hypothetically speaking, if a boss uses Attack "X" only when above 50% health, and only uses attack "Y" only when below 50% health, the boss will be using two different phases.

The concept: The "event_inverse_phase_mask" field is the field controlling phase information. Read the following sentence very carefully and memorize it. The number in this field represents the phases that this action will not be initiated in, including up to and less than the NPC's total number of phases. Keep this in the back of your head. The reason for this is because this number also casually tells the script how many phases the NPC has. It's surprisingly ingenious.


This is where the Binary Addition comes into play. Suppose your NPC has three phases. It will start off in phase 1. (*) It will remain in phase 1 unless specifically told to by Action Types 22, 23, 30, and 31, which control phases mid-game once the script is already running.

* (I should mention right here that anything with an event_inverse_phase_mask of 0 will happen in all phases.)

Suppose we wanted to have an attack that is only used in the NPC's first phase. You know that the NPC will have three phases. You would set up the attack as usual, but in the event_inverse_phase_mask field, you would put a 6. Why the six? Let's take a look.

We have three phases. We will represent these like this:

  • _3__2__1__<-- Represents the Phase Number and the bit.
  • 04 02 01

Phase 1's bit is 1. Phase 2's bit is 2. Phase 3's bit is 4. (If we had a phase 4, it would be 8, and phase 5 would be 16, etc.) To get 6, we have added the 2 and the 4 from the 2nd and 3rd phases. As was mentioned above, the number that goes into that field represents the bitmask of the phases that the action will not take place in.

Quick Phase Reference

This list is for an easy reference of what phase equates to what number, if you're not very phase-savvy. The "Value" column is what goes into the "event_inverse_phase_mask" field. The "Phase" column indicates the phase number that the hypothetical mob or boss is in that the event WILL happen in. This field relies on the next field, the "Max Phases" field. That is the amount of total phases the mob has. (I.e. my boss has 2 phases, or my boss has 4 phases.) Then there is a description field for any numerical work involved. It is the least important field, and can safely be ignored.

Remember, anything with "0" as a phase will occur in all phases. It is 0 by default.

Again, this is based on the following number patterns:

00 + 01 + 02 + 03 + 04 + 05 + 06 + 07 + 008 - Represents Phases.

00 + 01 + 02 + 04 + 08 + 16 + 32 + 64 + 128 - The numerical representations of those phases.

And, once again, how this works, is:

  1. You look at the total number of phases. Suppose it's 3.
  2. You cover up all the numbers to the right of phase 3, which corresponds to the 04 right below it.
  3. Then you decide which phase you want the event to occur in.
  4. Then you look at all other phases, and add up the number beneath them.
  5. The number you come up with goes in the "Value" field below in that chart, and what will go into the event_inverse_phase_mask field. Remember, the Phase column represents the phases that the event WILL occur in, for the purposes of this chart, whereas the value of the event_inverse_phase_mask represents the the combined bitwise values of the phases it will not occur in. Be careful not to confuse them. To get the value of that field, again, the number in the "value" column is what you're looking for.


Value Phase Max Phases Description
2 1 2 2
1 2 2 1
Value Phase Max Phases Description
6 1 3 2+4
5 2 3 1+4
3 3 3 1+2
4 1+2 3 4
1 2+3 3 1
2 1+3 3 2
Value Phase Max Phases Description
14 1 4 2+4+8
13 2 4 1+4+8
11 3 4 1+2+8
7 4 4 1+2+4
12 1+2 4 4+8
10 1+3 4 2+8
6 1+4 4 2+4
9 2+3 4 1+8
5 2+4 4 1+4
3 3+4 4 1+2
8 1+2+3 4 8
1 2+3+4 4 1
4 1+2+4 4 4
2 1+3+4 4 2
Value Phase Max Phases Description
30 1 5 2+4+8+16
29 2 5 1+4+8+16
27 3 5 1+2+8+16
23 4 5 1+2+4+16
15 5 5 1+2+4+8
28 1+2 5 4+8+16
26 1+3 5 2+8+16
22 1+4 5 2+4+16
20 1+5 5 2+4+8
25 2+3 5 1+8+16
21 2+4 5 1+4+16
13 2+5 5 1+4+8
19 3+4 5 1+2+16
11 3+5 5 1+2+8
7 4+5 5 1+2+4
24 1+2+3 5 8+16
17 2+3+4 5 1+16
3 3+4+5 5 1+2
6 1+4+5 5 2+4
12 1+2+5 5 4+8
10 1+3+5 5 2+8
9 2+3+5 5 1+8
16 1+2+3+4 5 16
1 2+3+4+5 5 1
2 1+3+4+5 5 2
4 1+2+4+5 5 4
8 1+2+3+5 5 8

The reference chart will only go down to 5 or so phases for now. There is no small limit on the amount of phases except for your patience, and possibly 255. (Unverified) If anyone wants to fill in the rest of the chart, many thanks will be due to the brave and bored soul who does it.


Reminder: Once again, if your creatures don't perform your actions within Dungeons, you need to add "1" to the current value of the "Event_flags" column.