[9500] More speel effects table cleanups in comments
[getmangos.git] / doc / EventAI.txt
blobd850d34ecd01857407465de378db045c41fa8912
1 ======================================================
2 EventAI Documentation: (Last Updated: January 8, 2010)
3 ======================================================
5 EventAI allows users to create new creature scripts entirely within the database.
7 For the AI to be used, you must first make sure to set AIname for each creature that should use this AI.
8 UPDATE creature_template SET AIName = 'EventAI' WHERE entry IN (...);
11 =========================================
12 Basic Structure of EventAI
13 =========================================
15 EventAI follows a basic IF (Event) then DO (Action) format.
16 Below is the list of current fields of the creature_ai_scripts table.
18 Field_Name                      Description
19 -------------------------------------------
20 id                              This value is merely an incrementing counter of the current Event number. Required for sql queries.
21 creature_id                     Creature ID which should trigger this event (This is from Creature_Template Table).
23 event_type                      The type of event (see "Event types" below)
24 event_inverse_phase_mask        Mask with phases this event should NOT trigger in*
25 event_chance                    Percentage chance of triggering the event (1 - 100)
26 event_flags                     Event flags (repeatable, ... (see below))
27 event_param1                    Variables for the event (depends on event_type)
28 event_param2                    Variables for the event (depends on event_type)
29 event_param3                    Variables for the event (depends on event_type)
30 event_param4                    Variables for the event (depends on event_type)
32 action1_type                    Action #1 to take when the Event occurs (see "Action types" below)
33 action1_param1                  Variables used by Action1 (depends on action_type)
34 action1_param2                  Variables used by Action1 (depends on action_type)
35 action1_param3                  Variables used by Action1 (depends on action_type)
37 action2_type                    Action #2 to take when the Event occurs (see "Action types" below)
38 action2_param1                  Variables used by Action1 (depends on action_type)
39 action2_param2                  Variables used by Action1 (depends on action_type)
40 action2_param3                  Variables used by Action1 (depends on action_type)
42 action3_type                    Action #3 to take when the Event occurs (see "Action types" below)
43 action3_param1                  Variables used by Action1 (depends on action_type)
44 action3_param2                  Variables used by Action1 (depends on action_type)
45 action3_param3                  Variables used by Action1 (depends on action_type)
47 All params are signed 32-bit values (+/- 2147483647). Time values are always in milliseconds.
48 In case of a percentage value, use value/100 (ie. param = 500 then that means 500%, -50 = -50%)
50 [*] Phase mask is a bitmask of phases which shouldn't trigger this event. (ie. Phase mask of value 12 (binary 1100) results in triggering this event in phases 0, 1 and all others with exception for phases 2 and 3 (counting from 0).
53 =========================================
54 Event Types
55 =========================================
57 A list of event types EventAI is able to handle.
58 Each event type has its own specific interpretation of the params that accompany it.
59 Params are always read in the ascending order (from Param1 to Param3).
60 Events will not repeat until the creature exits combat or unless EFLAG_REPEATABLE is set.
61 Some events such as EVENT_T_AGGRO, EVENT_T_DEATH, EVENT_T_SPAWNED, and EVENT_T_EVADE cannot repeat.
63 #   Internal name                Param usage                                             Description
64 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
65 0    EVENT_T_TIMER                  InitialMin, InitialMax, RepeatMin, RepeatMax            Expires at first between (Param1) and (Param2) and then will repeat between every (Param3) and (Param4),  EXPIRES ONLY IN COMBAT.
66 1    EVENT_T_TIMER_OOC              InitialMin, InitialMax, RepeatMin, RepeatMax            Expires at first between (Param1) and (Param2) and then will repeat between every (Param3) and (Param4),  EXPIRES ONLY OUT OF COMBAT.
67 2    EVENT_T_HP                     HPMax%, HPMin%, RepeatMin, RepeatMax                    Expires when the Creature's HP is between (Param1) and (Param2). Will repeat between every (Param3) and (Param4).
68 3    EVENT_T_MANA                   ManaMax%,ManaMin% RepeatMin, RepeatMax                  Expires once the Creature's Mana% is between (Param1) and (Param2). Will repeat between every (Param3) and (Param4).
69 4    EVENT_T_AGGRO                  NONE                                                    Expires ONLY upon the Creature's INITIAL Aggro at the Start of Combat (Does NOT Repeat).
70 5    EVENT_T_KILL                   RepeatMin, RepeatMax                                    Expires upon Killing a Player. Will repeat between (Param1) and (Param2).
71 6    EVENT_T_DEATH                  NONE                                                    Expires upon the Creature's Death. (This Triggers At The Moment The Creature Dies)
72 7    EVENT_T_EVADE                  NONE                                                    Expires at the moment the Creature EnterEvadeMode().
73 8    EVENT_T_SPELLHIT               SpellID, Schoolmask, RepeatMin, RepeatMax               Expires upon a Spell Hit on the Creature. When (param1) is set, it is the specific Spell ID used as the trigger. With (param2) specified, the expiration is limited to specific spell schools (-1 for all). Will repeat every (Param3) and (Param4). Only A Spell ID or Spell School may be Specified but NOT both.
74 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 between every (Param3) and (Param4).
75 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.
76 11   EVENT_T_SPAWNED                NONE                                                    Expires on initial spawn and on creature respawn (useful for setting ranged movement type).
77 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).
78 13   EVENT_T_TARGET_CASTING         RepeatMin, RepeatatMax                                  Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2).
79 14   EVENT_T_FRIENDLY_HP            HPDeficit, Radius, RepeatMin, RepeatMax                 Expires when a friendly unit in radius has at least (Param1) HP missing. Will repeat every (Param3) and (Param4).
80 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).
81 16   EVENT_T_MISSING_BUFF           SpellId, Radius, RepeatMin, RepeatMax                   Expires when a friendly unit is missing aura(s) given by a spell (Param1) within radius (Param2). Will repeat every (Param3) and (Param4).
82 17   EVENT_T_SUMMONED_UNIT          CreatureId, RepeatMin, RepeatMax                        Expires after creature with entry = (Param1) is spawned (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3).
83 18   EVENT_T_TARGET_MANA            ManaMax%, ManaMin%, RepeatMin, RepeatMax                Expires when current target's Mana is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
84 21   EVENT_T_REACHED_HOME           NONE                                                    Expires when a creature reaches it's home (spawn) location after evade.
85 22   EVENT_T_RECEIVE_EMOTE          EmoteId, Condition, CondValue1, CondValue2              Expires when a creature receives an emote with emote text id (enum TextEmotes) in (Param1). Conditions can be defined (Param2) with optional values (Param3,Param4), see enum ConditionType.
86 23   EVENT_T_BUFFED                 SpellID, AmmountInStack, RepeatMin, RepeatMax           Expires when a creature has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4).
87 24   EVENT_T_TARGET_BUFFED          SpellID, AmmountInStack, RepeatMin, RepeatMax           Expires when a target unit has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4).
88 25   EVENT_T_SUMMONED_JUST_DIED     CreatureId, RepeatMin, RepeatMax                        Expires after creature with entry = (Param1) is die (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3).
89 26   EVENT_T_SUMMONED_JUST_DESPAWN  CreatureId, RepeatMin, RepeatMax                        Expires before creature with entry = (Param1) is despawn (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3).
92 =========================================
93 Action Types
94 =========================================
96 A list of action types that EventAI can handle.
97 Each event type has its own specific interpretation of it's params, like every event type.
98 For all ACTION_T_RANDOM, When a Particular Param is selected for the Event... The SAME Param # is selected for all 3 actions.
100 #    Internal name                          Param usage                     Description
101 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
102 0    ACTION_T_NONE                          No Action                       Does nothing.
103 1    ACTION_T_TEXT                          -TextId1, -TextId2, -TextId3    Simply displays the specified -TextId. When -TextId2 and -TextId3 are specified, the selection will be randomized. Text types are defined, along with other options for the text, in a table below. All values needs to be negative.
104 2    ACTION_T_SET_FACTION                   FactionId                       Changes faction for a creature. When param1 is zero, creature will revert to it's default faction.
105 3    ACTION_T_MORPH_TO_ENTRY_OR_MODEL       CreatureEntry, ModelId          Set either model from creature_template.entry (Param1) OR explicit modelId (Param2). If (Param1) AND (Param2) are both 0, demorph and revert to the default model.
106 4    ACTION_T_SOUND                         SoundId                         Plays a sound
107 5    ACTION_T_EMOTE                         EmoteId                         Does an emote
108 6    ACTION_T_RANDOM_SAY                    UNUSED                          UNUSED
109 7    ACTION_T_RANDOM_YELL                   UNUSED                          UNUSED
110 8    ACTION_T_RANDOM_TEXTEMOTE              UNUSED                          UNUSED
111 9    ACTION_T_RANDOM_SOUND                  SoundId1, SoundId2, SoundId3    Plays a random sound *
112 10   ACTION_T_RANDOM_EMOTE                  EmoteId1, EmoteId2, EmoteId3    Emotes a random emote *
113 11   ACTION_T_CAST                          SpellId, Target, CastFlags      Casts spell (Param1) on a target (Param2) using cast flags (specified below).
114 12   ACTION_T_SUMMON                        CreatureID, Target, Duration    Summons a creature (Param1) for (Param3) duration and orders it to attach (Param2) target. Spawns on top of current creature.
115 13   ACTION_T_THREAT_SINGLE_PCT             Threat%, Target                 Modifies a threat by (Param1) percent on a target (Param2).
116 14   ACTION_T_THREAT_ALL_PCT                Threat%                         Modifies a threat by (Param1) on all targets in the threat list (using -100% here will result in full aggro dump).
117 15   ACTION_T_QUEST_EVENT                   QuestID, Target                 Calls AreaExploredOrEventHappens with (Param1) for a target in (Param2).
118 16   ACTION_T_QUEST_CASTCREATUREGO          CreatureID, SpellId, Target     Sends CastCreatureOrGo for a creature specified by CreatureId (Param1) with provided spell id (Param2) for a target in (Param3).
119 17   ACTION_T_SET_UNIT_FIELD                Field_Number, Value, Target     Sets a unit field (Param1) to provided value (Param2) on a target in (Param3).
120 18   ACTION_T_SET_UNIT_FLAG                 Flags, Target                   Sets flag (flags can be used together to modify multiple flags at once) on a target (Param2).
121 19   ACTION_T_REMOVE_UNIT_FLAG              Flags, Target                   Removes flag on a target (Param2).
122 20   ACTION_T_AUTO_ATTACK                   AllowAutoAttack                 Stop melee attack when (Param1) is zero, otherwise continue attacking / allow melee attack.
123 21   ACTION_T_COMBAT_MOVEMENT               AllowCombatMovement             Stop combat based movement when (Param1) is zero, otherwise continue/allow combat based movement (targeted movement generator).
124 22   ACTION_T_SET_PHASE                     Phase                           Sets the current phase to (Param1).
125 23   ACTION_T_INC_PHASE                     Value                           Increments the phase by (Param1). May be negative to decrement, but should not be zero.
126 24   ACTION_T_EVADE                         No Params                       Forces the creature to evade, wiping all threat and dropping combat.
127 25   ACTION_T_FLEE_FOR_ASSIST               No Params                       Causes the creature to flee for assistence (often at low health).
128 26   ACTION_T_QUEST_EVENT_ALL               QuestId                         Calls GroupEventHappens with (Param1). Only used if it's _expected_ event should call quest completion for all players in a current party.
129 27   ACTION_T_CASTCREATUREGO_ALL            QuestId, SpellId                Calls CastedCreatureOrGo for all players on the threat list with quest id specified in (Param1) and spell id in (Param2).
130 28   ACTION_T_REMOVEAURASFROMSPELL          Target, Spellid                 Removes all auras on a target (Param1) caused by a spell (Param2).
131 29   ACTION_T_RANGED_MOVEMENT               Distance, Angle                 Changes the movement generator to a ranged type. (note: default melee type can still be set by using 0 as angle and 0 as distance).
132 30   ACTION_T_RANDOM_PHASE                  PhaseId1, PhaseId2, PhaseId3    Sets a phase to a specified id(s)*
133 31   ACTION_T_RANDOM_PHASE_RANGE            PhaseMin, PhaseMax              Sets a phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). PhaseMax must be greater than PhaseMin.
134 32   ACTION_T_SUMMON                        CreatureID, Target, SummonID    Summons a creature (Param1) to attack target (Param2) at location specified by EventAI_Summons (Param3).
135 33   ACTION_T_KILLED_MONSTER                CreatureID, Target              Calls KilledMonster (Param1) for a target (Param2).
136 34   ACTION_T_SET_INST_DATA                 Field, Data                     Calls ScriptedInstance::SetData with field (Param1) and data (Param2).
137 35   ACTION_T_SET_INST_DATA64               Field, Target                   Calls ScriptedInstance::SetData64 with field (Param1) and target's GUID (Param2).
138 36   ACTION_T_UPDATE_TEMPLATE               TemplateId, Team                Changes a creature's template to (Param1) with team = Alliance or Horde when (Param2) is either false or true respectively.
139 37   ACTION_T_DIE                           No Params                       Kills the creature
140 38   ACTION_T_ZONE_COMBAT_PULSE             No Params                       Puts all players within an instance into combat with the creature. Only works when a creature is already in combat. Doesn't work outside instances.
141 39   ACTION_T_CALL_FOR_HELP                 Radius                          Call any friendly out-of-combat creatures in a radius (Param1) to attack current creature's target.
142 40   ACTION_T_SET_SHEATH                    Sheath                          Sets sheath state for a creature (0 = no weapon, 1 = melee weapon, 2 = ranged weapon).
143 41   ACTION_T_FORCE_DESPAWN                 Delay                           Despawns the creature, if delay = 0 immediate otherwise will despawn after delay time set in Param1 (in ms).
144 42   ACTION_T_SET_INVINCIBILITY_HP_LEVEL    HP_Level, HP_Percent            Set min. health level for creature that can be set at damage as flat value or percent from max health
146 * = Use -1 where the param is expected to do nothing. Random constant is generated for each event, so if you have a random yell and a random sound, they will be linked up with each other (ie. param2 with param2).
149 =========================================
150 Event Types
151 =========================================
152 Note:
153 COMBAT ONLY - Means that this event will only trigger durring combat.
154 OUT OF COMBAT ONLY - Means that this event will only trigger while out of combat.
155 BOTH - This event can trigger both in and out of combat.
157 Events that do not have lables on them are events that are directly involved with the in and out of combat state.
159 ------------------
160 0 = EVENT_T_TIMER:
161 ------------------
162 Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire
163 Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
164 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
165 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
167 COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
168 This is commonly used for spells that repeat cast during combat (Simulate Spell Cooldown).
170 ----------------------
171 1 = EVENT_T_TIMER_OOC:
172 ----------------------
173 Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire
174 Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
175 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
176 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
178 OUT OF COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
179 This is commonly used for events that occur and repeat outside of combat.
181 ---------------
182 2 = EVENT_T_HP:
183 ---------------
184 Parameter 1: HPMax% - Maximum HP% That this Event will Expire
185 Parameter 2: HPMin% - Minimum HP% That this Event will Expire
186 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
187 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
189 BOTH - Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
190 This is commonly used for events that trigger at a specific HP% (Such as Heal/Enrage Spells or NPC's that Flee).
192 -----------------
193 3 = EVENT_T_MANA:
194 -----------------
195 Parameter 1: ManaMax% - Maximum Mana% That this Event will Expire
196 Parameter 2: ManaMin% - Minimum Mana% That this Event will Expire
197 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
198 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
200 BOTH - Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
201 This is commonly used for events where an NPC low on Mana will do something (Such as stop casting spells and switch to melee).
203 ------------------
204 4 = EVENT_T_AGGRO:
205 ------------------
206 This Event Expires upon initial aggro (does not repeat).
208 -----------------
209 5 = EVENT_T_KILL:
210 -----------------
211 Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire
212 Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire
214 COMBAT ONLY! - Expires upon killing a player. Will repeat every (Param1) and (Param2).
215 This Event Expires upon killing a player. It is commonly used for NPC's who yell or do something after killing a player.
217 ------------------
218 6 = EVENT_T_DEATH:
219 ------------------
220 This Event Expires upon Death of the Scripted NPC.
221 This is commonly used for NPC's who have a yell on death or cast some kind if summon spell when they die.
223 ------------------
224 7 = EVENT_T_EVADE:
225 ------------------
226 This Event Expires upon the creature EnterEvadeMode().
227 This is commonly used for NPC's who use phases, allows you to reset their phase to 0 upon evade to prevent possible strange behavior.
229 ---------------------
230 8 = EVENT_T_SPELLHIT:
231 ---------------------
232 Parameter 1: SpellID - The Spell ID that will trigger the event to occur (NOTE: If you use Spell School as the trigger set this value to 0)
233 Parameter 2: School - Spell School to trigger the event (NOTE: If you use a SpellID then set this value to -1) - *See Below for Spell School Bitmask Values*
234 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
235 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
237 BOTH - Expires upon Spell hit. If (param1) is set will only expire on that spell OR If (param2) is set it will only expire on spells of that school. Will repeat every (Param3) and (Param4).
238 This Event is commonly used for NPC's who can do special things when you cast a spell (Or specific spell) on them.
240 (Name ==> School ==> School Bitmask Values)
241 -------------------------------------------
242 SPELL_SCHOOL_NORMAL = 0 ==> 1
243 SPELL_SCHOOL_HOLY   = 1 ==> 2
244 SPELL_SCHOOL_FIRE   = 2 ==> 4
245 SPELL_SCHOOL_NATURE = 3 ==> 8
246 SPELL_SCHOOL_FROST  = 4 ==> 16
247 SPELL_SCHOOL_SHADOW = 5 ==> 32
248 SPELL_SCHOOL_ARCANE = 6 ==> 64
249 Use These Bitmask Values For Schoolmask (Param2) or Any Combinations Of These Schoolmasks for Multiple Schools.
251 ------------------
252 9 = EVENT_T_RANGE:
253 ------------------
254 Parameter 1: MinDist - This Distance is the Minimum Distance between the NPC and it's target to allow this Event to Expire
255 Parameter 2: MaxDist - This Distance is the Maximum Distance between the NPC and it's target to allow this Event to Expire
256 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
257 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
259 COMBAT ONLY! - Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4).
260 This Event is commonly used for NPC's who have Ranged Combat and will Throw/Shoot between a certian distance.
262 ---------------------
263 10 = EVENT_T_OOC_LOS:
264 ---------------------
265 Parameter 1: Hostile-or-Not   - This will expire if Unit are hostile. If Param1=1 it will only expire if Unit are not Hostile(generally determined by faction)
266 Parameter 2: MaxAllowedRange  - Expires when a Unit moves within this distance to creature
267 Parameter 3: RepeatMin        - Minimum Time used to calculate Random Repeat Expire
268 Parameter 4: RepeatMax        - Maximum Time used to calculate Random Repeat Expire
270 OUT OF COMBAT!
271 This Event is commonly used for NPC's who do something or say something to you when you walk past them Out of Combat.
273 ---------------------
274 11 = EVENT_T_SPAWNED:
275 ---------------------
276 Expires at initial spawn and at creature respawn.
277 This Event is commonly used for setting ranged movement type or Summoning a Pet on Spawn
278 Parameter 1: 0: works always, 1: works on map in Parameter 2, 2: works on zone/subzone in Parameter 2
279 Parameter 2: depends on Parameter 1: for 1 it is map ID, for 2 it is area ID to check
281 -----------------------
282 12 = EVENT_T_TARGET_HP:
283 -----------------------
284 Parameter 1: HPMax% - Maximum HP% That this Event will Expire
285 Parameter 2: HPMin% - Minimum HP% That this Event will Expire
286 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
287 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
289 COMBAT ONLY! - Expires when Current NPC's Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
290 This Event is commonly used for NPC's who have a special ability (Like Execute) that only casts when a Player HP is low.
292 ----------------------------
293 13 = EVENT_T_TARGET_CASTING:
294 ----------------------------
295 Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire
296 Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire
298 COMBAT ONLY! - Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2).
299 This event is commonly used for NPC's who will cast a counter spell when their target starts to cast a spell.
301 -------------------------
302 14 = EVENT_T_FRIENDLY_HP:
303 -------------------------
304 Parameter 1: HPDeficit - This is the Amount of HP Missing from Full HP to trigger this event (You would need to calculate the amount of HP the event happens and subtract that from Full HP Value to get this number)
305 Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies (Faction is Friendly To) for the missing amount of HP in Param1.
306 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
307 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
309 COMBAT ONLY! - Expires when a friendly unit in radius(param2) has at least (param1) hp missing. Will repeat every (Param3) and (Param4).
310 This is commonly used when an NPC in Combat will heal a nearby Friendly NPC in Combat with a Heal/Renew Spell.
312 ----------------------------
313 15 = EVENT_T_FRIENDLY_IS_CC:
314 ----------------------------
315 Parameter 1: DispelType - Dispel Type to trigger the event - *See Below for Dispel Bitmask Values*
316 Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies being Crowd Controlled
317 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
318 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
320 COMBAT ONLY! - Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4).
321 This is commonly used for NPC's who can come to the resule of other Friendly NPC's if being Crowd Controlled
323 --------------------------
324 16 = EVENT_T_MISSING_BUFF:
325 --------------------------
326 Parameter 1: SpellId - This is the SpellID That the Aura Check will look for (If it is missing this Aura)
327 Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies (Faction is Friendly To) for the missing Aura.
328 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
329 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
331 BOTH - Expires when a friendly unit is missing aura's given by spell (param1) within radius (param2). Will repeat every (Param3) and (Param4).
332 This is commonly used for NPC's who watch friendly units for a debuff to end so they can recast it on them again.
334 ---------------------------
335 17 = EVENT_T_SUMMONED_UNIT:
336 ---------------------------
337 Parameter 1: CreatureId - The CreatureID that the NPC is watching to spawn to trigger this event
338 Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire
339 Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire
341 BOTH - Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
342 This is commonly used for NPC's who will do something special once another NPC is summoned. Usually used is Complex Scripts or Special Events.
344 ---------------------------
345 21 = EVENT_T_REACHED_HOME:
346 ---------------------------
347 Expires only when creature has returned to it's home location after Evade. Out of combat event.
348 Most commonly used to cast spells that can not be casted in EVENT_T_EVADE and other effects that does not fit in while still running back to spawn/home location.
350 ---------------------------
351 22 = EVENT_T_RECEIVE_EMOTE:
352 ---------------------------
353 Expires only when creature receive emote from player. Valid text emote id's are in Mangos source (enum TextEmotes)
354 Event does not require any conditions to process, however many are ecpected to have condition.
356 ---------------------------
357 23 = EVENT_T_BUFFED       :
358 ---------------------------
359 Parameter 1: SpellId - This is the SpellID That the Aura Check will look for
360 Parameter 2: Amount -  This is the amount of SpellID's auras at creature required for event expire.
361 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
362 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
364 ---------------------------
365 24 = EVENT_T_TARGET_BUFFED:
366 ---------------------------
367 Parameter 1: SpellId - This is the SpellID That the Aura Check will look for
368 Parameter 2: Amount -  This is the amount of SpellID's auras at target unit required for event expire.
369 Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
370 Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
372 EventAI use conditions from available in Mangos (enum ConditionType)
373 Current implemented conditions:
374 CONDITION_NONE (0)            0            0
375 CONDITION_AURA (1)            spell_id     effindex
376 CONDITION_ITEM (2)            item_id      count
377 CONDITION_ITEM_EQUIPPED (3)   item_id      count
378 CONDITION_ZONEID (4)          zone_id      0
379 CONDITION_REPUTATION_RANK (5) faction_id   min_rank
380 CONDITION_TEAM (6)            player_team  0 (469-Alliance / 67-Horde)
381 CONDITION_SKILL (7)           skill_id     min_skill_value
382 CONDITION_QUESTREWARDED (8)   quest_id     0, if quest are rewarded
383 CONDITION_QUESTTAKEN (9)      quest_id     0, while quest active(incomplete)
384 CONDITION_ACTIVE_EVENT (12)   event_id     0, note this is id from dbc, also defined in Mangos source(enum HolidayIds) NOT id of game_event in database
386 ---------------------------
387 25 = EVENT_T_SUMMONED_JUST_DIED:
388 ---------------------------
389 Parameter 1: CreatureId - The CreatureID that the NPC is watching die to trigger this event
390 Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire
391 Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire
393 BOTH - Expires after creature with entry(Param1) is die or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
394 This is commonly used for NPC's who will do something special once another NPC is die. Usually used is Complex Scripts or Special Events.
396 ---------------------------
397 26 = EVENT_T_SUMMONED_JUST_DESPAWN:
398 ---------------------------
399 Parameter 1: CreatureId - The CreatureID that the NPC is watching despawn to trigger this event
400 Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire
401 Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire
403 BOTH - Expires before creature with entry(Param1) is dwspawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
404 This is commonly used for NPC's who will do something special once another NPC is despawn. Usually used is Complex Scripts or Special Events.
405 NOTE: called before despawn happens, so summoned creature still in world at expire moment.
407 =========================================
408 Action Types
409 =========================================
411 ------------------
412 1 = ACTION_T_TEXT:
413 ------------------
414 Parameter 1: The entry of the text that the NPC should use from eventai_texts table. Optionally a entry from other tables can be used (such as custom_texts).
415              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)
416              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).
417              In case this entry has a localized version of the text, the localized text will be displayed in client that support this locale.
419 Parameter 2: Optional. TextId can be defined in addition. The same apply to this as explained above, however eventAI will randomize between the two.
420 Parameter 3: Optional, if Parameter 2 exist. In this case, eventAI will randomize between three.
422 Read at bottom for documentation of creature_ai_texts-table.
424 ------------------
425 2 = ACTION_T_SET_FACTION:
426 ------------------
427 Parameter 1: FactionId from Faction.dbc OR 0. Changes faction for creature. If 0, creature will revert to it's default faction if previously changed.
429 -----------------------
430 3 = ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
431 -----------------------
432 Parameter 1: Creature entry from creature_template. Action will then change to the model this creature are using.
433 Parameter 2: If parameter 1 is 0, then this modelId will be used (in case parameter 1 exist, parameter 2 will not be used)
435 If both parameter 1 and 2 is 0, the creature will DeMorph, and use it's default model.
437 -------------------
438 4 = ACTION_T_SOUND:
439 -------------------
440 Parameter 1: The Sound ID to be played. (Sound IDs are contained in the DBC files.)
442 The creature will play the specified sound.
443 This is commonly used for Bosses who Yell and then also have a Voice for the same thing.
445 -------------------
446 5 = ACTION_T_EMOTE:
447 -------------------
448 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).
450 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.
451 This is commonly used for NPC's who may perform a special action (Salute, Roar, ect...). Not all player emotes work for creature models.
453 ------------------------
454 6 = ACTION_T_RANDOM_SAY:
455 ------------------------
456 UNUSED       Can be reused to create new action type
458 -------------------------
459 7 = ACTION_T_RANDOM_YELL:
460 -------------------------
461 UNUSED       Can be reused to create new action type
463 ------------------------------
464 8 = ACTION_T_RANDOM_TEXTEMOTE:
465 ------------------------------
466 UNUSED       Can be reused to create new action type
468 --------------------------
469 9 = ACTION_T_RANDOM_SOUND:
470 --------------------------
471 Parameter 1: The Sound ID to be played as Random Choice #1.
472 Parameter 2: The Sound ID to be played as Random Choice #2.
473 Parameter 3: The Sound ID to be played as Random Choice #3.
475 Similar to the ACTION_T_SOUND action, it will choose at random a sound to play.
477 ---------------------------
478 10 = ACTION_T_RANDOM_EMOTE:
479 ---------------------------
480 Parameter 1: The Emote ID to be played as Random Choice #1.
481 Parameter 2: The Emote ID to be played as Random Choice #2.
482 Parameter 3: The Emote ID to be played as Random Choice #3.
484 Similar to the ACTION_T_EMOTE action, it will choose at random an Emote to Visually Perform.
486 -------------------
487 11 = ACTION_T_CAST:
488 -------------------
489 Parameter 1: SpellId - The Spell ID to use for the NPC to cast. The value used in this field needs to be a valid Spell ID.
490 Parameter 2: Target - The Target Type defining who the creature should cast the spell at. The value in this field needs to be a valid Target Type as specified in the reference tables below.
491 Parameter 3: CastFlags - See Table Below for Cast Flag Bitmask Values. If you are unsure what to set this value at leave it at 0.
493 The creature will cast a spell specified by a spell ID on a target specified by the target type.
494 This is commonly used for NPC's who cast spells.
496 ---------------------
497 12 = ACTION_T_SUMMON:
498 ---------------------
499 Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID.
500 Parameter 2: Target - The Target Type defining who the Summoned creature will attack once spawned. The value in this field needs to be a valid Target Type as specified in the reference tables below.
501 Parameter 3: Duration - The duration until the summoned creature should be unsummoned AFTER Combat ends. The value in this field is in milliseconds or 0.
503 The NPC will Summon another creature at the same spot as itself that will attack the specified target.
504 NOTE: Almost all Creature Summons have proper Summon Spells that should be used when possible. This Action is a powerful last resort option only to be used if nothing else works.
505 NOTE: Using Target Type 0 will cause the Summoned creature to not attack anyone.
506 NOTE: If Duration is set at 0, then the summoned creature will not despawn until it has died.
507 This is used as a manual way to force an NPC to Summon.
508 --------------------------------
509 13 = ACTION_T_THREAT_SINGLE_PCT:
510 --------------------------------
511 Parameter 1: Threat% - 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.
512 Parameter 2: Target - 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.
514 This action will modify the threat of a target in the creature's threat list by the specified percent.
515 This is commonly used to allow an NPC to adjust the Threat to a single player.
517 -----------------------------
518 14 = ACTION_T_THREAT_ALL_PCT:
519 -----------------------------
520 Parameter 1: Threat% - 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.
522 This action will modify the threat for everyone in the creature's threat list by the specified percent.
523 NOTE: Using -100 will cause the creature to reset everyone's threat to 0 so that everyone has the same amount of threat. It will NOT remove anyone from the threat list.
524 This is commonly used to allow an NPC to drop threat for all players to zero.
526 --------------------------
527 15 = ACTION_T_QUEST_EVENT:
528 --------------------------
529 Parameter 1: QuestID - 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.
530 Parameter 2: Target - 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.
532 This action will satisfy the external completion requirement for the quest for the specified target defined by the target type.
533 NOTE: This action can only be used with player targets so it must be ensured that the target type will point to a player.
534 This is commonly used for Quests where only ONE player will gain credit for the quest.
536 -----------------------------
537 16 = ACTION_T_CASTCREATUREGO:
538 -----------------------------
539 Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID.
540 Parameter 2: SpellID - The Spell ID to use to simulate the cast. The value used in this field needs to be a valid Spell ID.
541 Parameter 3: Target - 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.
543 This action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature.
544 This is commonly used for NPC's who have a special requirement to have a Spell cast on them to complete a quest.
546 -----------------------------
547 17 = ACTION_T_SET_UNIT_FIELD:
548 -----------------------------
549 Parameter 1: Field_Number - The index of the Field Number to be changed. Use (http://wiki.udbforums.org/index.php/Character_data) for a list of indeces and what they control. Creatures only contain the OBJECT_FIELD_* and UNIT_FIELD_* fields. They do not contain the PLAYER_FIELD_* fields.
550 Parameter 2: Value - The new value to be put in the field.
551 Parameter 3: Target - 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.
553 When activated, this action can change the target's unit field values. More information on the field value indeces can be found at (http://wiki.udbforums.org/index.php/Character_data)
555 ----------------------------
556 18 = ACTION_T_SET_UNIT_FLAG:
557 ----------------------------
558 Parameter 1: Flags - The flag(s) to be set. Multiple flags can be set by using bitwise-OR on them (adding them together).
559 Parameter 2: Target - 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.
561 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.
563 -------------------------------
564 19 = ACTION_T_REMOVE_UNIT_FLAG:
565 -------------------------------
566 Parameter 1: Flags - The flag(s) to be removed. Multiple flags can be set by using bitwise-OR on them (adding them together).
567 Parameter 2: Target - 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.
569 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.
571 --------------------------
572 20 = ACTION_T_AUTO_ATTACK:
573 --------------------------
574 Parameter 1: AllowAutoAttack - 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.
576 This action controls whether or not the creature should stop or start the auto melee attack.
577 NOTE: Developers have recommended using either 0 or 1 for the Param values (0 = Stop Melee, 1 = Start Melee).
578 This is commonly used in combination with EVENT_T_RANGE and ACTION_T_COMBAT_MOVEMENT for Ranged Combat for Mages and Spell Casters.
580 ------------------------------
581 21 = ACTION_T_COMBAT_MOVEMENT:
582 ------------------------------
583 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.
584 Parameter 2: If non-zero, then stop melee combat state (if param1=0) or start melee combat state (if param1!=0) and creature in combat with selected target.
586 This action controls whether or not the creature will always move towards its target.
587 NOTE: Developers have recommended using either 0 or 1 for the Param values. (0 = Stop Movement, 1 = Start Movement)
588 This is commonly used with EVENT_T_RANGE and ACTION_T_AUTO_ATTACK for NPC's who engage in Ranged Comabt (Either Spells or Ranged Attacks)
589 Parameter 2 specialy used for ranged combat proper client side visual show ranged weapon in proper state.
591 ------------------------
592 22 = ACTION_T_SET_PHASE:
593 ------------------------
594 Parameter 1: The new phase to set the creature in. This number must be an integer between 0 and 31. Numbers outside of that range will result in an error.
596 When activated, this action sets the creature's event to the specified value.
597 NOTE: The creature's current Phase is NOT reset at creature evade. You must manually set the phase back to 0 at EVENT_T_RESET.
598 NOTE: The value used for the Param is the actual Phase Number (Not The Event_Inverse_Phase_Mask)
599 This is commonly used for complex scripts with several phases and you need to switch to a different phase.
601 ------------------------
602 23 = ACTION_T_INC_PHASE:
603 ------------------------
604 Parameter 1: Value - The number of phases to increase or decrease. Use negative values to decrease the current phase.
606 When activated, this action will increase (or decrease) the current creature's phase.
607 NOTE: After increasing or decreasing the phase by this action, the current phase must NOT be lower than 0 or exceed 31.
608 This can be used instead of ACTION_T_SET_PHASE to change phases in scripts. Just a user friendly option for changing phases.
610 --------------------
611 24 = ACTION_T_EVADE:
612 --------------------
613 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.
614 NOTE: All Param Values Are 0 for this Action.
616 -------------------
617 25 = ACTION_T_FLEE_FOR_ASSIST:
618 -------------------
619 When activated, the creature will flee from combat for assistance from nearby NPC's if possible.
620 NOTE: All Param Values Are 0 for this Action.
622 ------------------------------
623 26 = ACTION_T_QUEST_EVENT_ALL:
624 ------------------------------
625 Parameter 1: QuestId - The quest ID to finish for everyone.
627 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.
628 NOTE: If a player is not in the NPC's threat list for whatever reason, he/she won't get the quest completed.
630 ---------------------------------
631 27 = ACTION_T_CASTCREATUREGO_ALL:
632 ---------------------------------
633 Parameter 1: QuestId - The quest template ID.
634 Parameter 2: SpellId - The spell ID used to simulate the cast.
636 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.
637 NOTE: If a player is not in its threat list for whatever reason, he/she won't receive the cast emulation.
639 -----------------------------------
640 28 = ACTION_T_REMOVEAURASFROMSPELL:
641 -----------------------------------
642 Parameter 1: Target - 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.
643 Parameter 2: SpellId - The spell ID whose auras will be removed.
645 This action will remove all auras from a specific spell from the target.
646 This is commonly used for NPC's who have an OOC Aura that is removed at combat start or a similar idea (Like Stealth or Shape Shift)
648 ------------------------------
649 29 = ACTION_T_RANGED_MOVEMENT:
650 ------------------------------
651 Parameter 1: Distance - The distance the mob should keep between it and its target.
652 Parameter 2: Angle - The angle the mob should use.
654 This action changes the movement type generator to ranged type using the specified values for angle and distance.
655 NOTE: Specifying zero angle and distance will make it just melee instead.
656 This is commonly used for NPC's who always attack at range and you can specify the distance they will maintain from the target.
658 ---------------------------
659 30 = ACTION_T_RANDOM_PHASE:
660 ---------------------------
661 Parameter 1: PhaseId1 - A possible random phase choice.
662 Parameter 2: PhaseId2 - A possible random phase choice.
663 Parameter 3: PhaseId3 - A possible random phase choice.
665 Randomly sets the phase to one from the three parameter choices.
666 NOTE: 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)
667 NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE.
668 This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have up to 3 phases used, otherwise use Action 31 for more then 3 phases.
670 ---------------------------------
671 31 = ACTION_T_RANDOM_PHASE_RANGE:
672 ---------------------------------
673 Parameter 1: PhaseMin - The minimum of the phase range.
674 Parameter 2: PhaseMax - The maximum of the phase range. The number here must be greater than PhaseMin.
676 Randomly sets the phase between a range of phases controlled by the parameters. Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax).
677 NOTE: PhaseMax must be greater than PhaseMin.
678 NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE.
679 This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have MORE then 3 phases used, otherwise use Action 30.
681 ---------------------
682 32 = ACTION_T_SUMMON:
683 ---------------------
684 Parameter 1: CreatureID - The creature template ID to be summoned. The value here needs to be a valid creature template ID.
685 Parameter 2: Target - 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.
686 Parameter 3: SummonID - The summon ID from the creature_ai_summons table controlling the position (and spawntime) where the summoned mob should be spawned at.
688 Summons creature (param1) to attack target (param2) at location specified by creature_ai_summons (param3).
689 NOTE: Param3 Value is the ID Value used for the entry used in creature_ai_summons for this action. You MUST have an creature_ai_summons entry to use this action.
690 This is commonly used for NPC's who need to Summon a creature at a specific location. (Normally used for complex events)
692 -----------------------------
693 33 = ACTION_T_KILLED_MONSTER:
694 -----------------------------
695 Parameter 1: CreatureID - The creature template ID. The value here must be a valid creature template ID.
696 Parameter 2: Target - 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.
698 When activated, this action will call KilledMonster() function for the player. It can be used to give creature credit for killing a creature. In general if the quest is set to be accompished on different creatures (e.g. "Credit" templates).
699 NOTE: It can be ANY creature including certain quest specific triggers
700 This is commonly used for giving the player Quest Credits for NPC kills (Many NPC's may use the same CreatureID for the Kill Credit)
702 ----------------------------
703 34 = ACTION_T_SET_INST_DATA:
704 ----------------------------
705 Parameter 1: Field - 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.
706 Parameter 2: Data - The value to put at that field index.
708 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.
709 This is commonly used to link an EventAI script with a existing Script Library C++ Script. You make make things happen like opening doors on specific events that happen.
711 Field Values:
712 These are located in there SD2 Instance File (Example: blackrock_depths.h) And Are Clearly Defined For Specific Events Scripted In The Instance.
714 Data Values:
715 NOT_STARTED   = 0
716 IN_PROGRESS   = 1
717 FAIL          = 2
718 DONE          = 3
719 SPECIAL       = 4
721 ------------------------------
722 35 = ACTION_T_SET_INST_DATA64:
723 ------------------------------
724 Parameter 1: Field - 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.
725 Parameter 2: Target - 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.
727 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.
728 Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID.
730 ------------------------------
731 36 = ACTION_T_UPDATE_TEMPLATE:
732 ------------------------------
733 Parameter 1: TemplateId - The creature template ID. The value here must be a valid creature template ID.
734 Parameter 2: Team - Use model_id from team : Alliance(0) or Horde (1).
736 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.
737 Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true
739 ------------------
740 37 = ACTION_T_DIE:
741 ------------------
742 Kills the creature
743 This is commonly used if you need to Instakill the creature for one reason or another.
745 --------------------------------
746 38 = ACTION_T_ZONE_COMBAT_PULSE:
747 --------------------------------
748 Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances.
750 ----------------------------
751 39 = ACTION_T_CALL_FOR_HELP:
752 ----------------------------
753 Parameter 1: Radius - All friendly (not only same faction) creatures will go to help
755 Call any friendly creatures (if its not in combat/etc) in radius attack creature target.
756 Mostly used when call to help more wide that normal aggro radius or auto-used call for assistance, and need apply at some event.
758 -------------------------
759 40   ACTION_T_SET_SHEATH:
760 -------------------------
761 Parameter 1: Set Sheath State
762 0 = SHEATH_STATE_UNARMED               Set No Weapon Displayed (Not Usually Used By Creatures)
763 1 = SHEATH_STATE_MELEE                 Set Melee Weapon Displayed
764 2 = SHEATH_STATE_RANGED                Set Ranged Weapon Displayed
766 Set Sheath State For NPC.
767 Note: SHEATH_STATE_RANGED case work in combat state only if combat not start as melee commands.
768 This possible setup by set at event AI start (single used EVENT_T_TIMER_OOC or set ACTION_T_COMBAT_MOVEMENT 0 for creature that prefered ranged attack)
770 ----------------------------
771 41   ACTION_T_FORCE_DESPAWN:
772 ----------------------------
773 Despawns The NPC with optional delay time (Works In or Out of Combat)
774 Parameter 1: Delay - Sets delay time until Despawn occurs after triggering the action. Time is in (ms).
776 -----------------------------------------
777 42   ACTION_T_SET_INVINCIBILITY_HP_LEVEL:
778 -----------------------------------------
779 Parameter 1: Minimum Health Level That NPC Can Reach (NPC Will Not Go Below This Value).
780 Parameter 2: Sets Format of Paramater 1 Value
781 0 = Sets Paramater 1 as an exact HP value
782 1 = Sets Paramater 1 as a HP Percent (0..100) of the creature's max health
784 =========================================
785 Target Types
786 =========================================
787 Below is the list of current Target types that EventAI can handle.
788 Target types are used by certain actions and may effect actions differently
790 #    Internal Name                         Description
791 ---------------------------------------------------
792 0    TARGET_T_SELF                      Self Cast
793 1    TARGET_T_HOSTILE                   Current Target (ie: Highest Aggro)
794 2    TARGET_T_HOSTILE_SECOND_AGGRO      Second Highest Aggro (Generaly used for Cleaves and some special attacks)
795 3    TARGET_T_HOSTILE_LAST_AGGRO        Dead Last on Aggro (no idea what this could be used for)
796 4    TARGET_T_HOSTILE_RANDOM            Random Target on The Threat List
797 5    TARGET_T_HOSTILE_RANDOM_NOT_TOP    Any Random Target Except Top Threat
798 6    TARGET_T_ACTION_INVOKER            Unit Who Caused This Event to Occur (only works for EVENT_T_AGGRO, EVENT_T_KILL, EVENT_T_DEATH, EVENT_T_SPELLHIT, EVENT_T_OOC_LOS, EVENT_T_FRIENDLY_HP)
800 =========================================
801 Cast Flags
802 =========================================
803 Below is the list of current Cast Flags that EventAI's spell casting can handle.
804 Cast flags are handled bitwise. Bit 0 is Interrupt Previous, bit 1 is triggered, etc.
805 So for example the number "3" (11 in Binary, selecting first 2 options) would mean that this cast has both CAST_INTURRUPT_PREVIOUS and CAST_TRIGGERED.
806 Another example: the number "5" (101 in Binary, selecting first and third options) would mean that this cast has CAST_INTURRUPT_PREVIOUS and CAST_FORCE_CAST.
808 #       Decimal     Internal Name                  Description
809 --------------------------------------------------------------
810 0       1           CAST_INTURRUPT_PREVIOUS        Interrupts any previous spell casting (basicaly makes sure that this spell goes off)
811 1       2           CAST_TRIGGERED                 Forces the spell to be instant cast and require no mana/reagents.
812 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
813 3       8           CAST_NO_MELEE_IF_OOM           Prevents creature from entering melee if out of mana or out of range
814 4       16          CAST_FORCE_TARGET_SELF         Forces the target to cast this spell on itself
815 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.
817 NOTE: You can add the numbers in the decimal column to combine flags.
818  For example if you wanted to use CAST_NO_MELEE_IF_OOM(8) and CAST_TRIGGERED(2) you would simply use 10 in the cast flags field (8 + 2 = 10).
820 =========================================
821 Event Flags
822 =========================================
823 Below is the list of current Event Flags that EventAI can handle. Event flags are handled bitwise.
825 #       Decimal   Internal Name                  Description
826 ------------------------------------------------------------
827 0       1         EFLAG_REPEATABLE               Event repeats (Does not repeat if this flag is not set)
828 1       2         EFLAG_DIFFICULTY_0             Event occurs in instance difficulty 0 (will not occur if not set)
829 2       4         EFLAG_DIFFICULTY_1             Event occurs in instance difficulty 1 (will not occur if not set)
830 3       8         EFLAG_DIFFICULTY_2             Event occurs in instance difficulty 2 (will not occur if not set)
831 4       16        EFLAG_DIFFICULTY_3             Event occurs in instance difficulty 3 (will not occur if not set)
832 5       32
833 6       64
834 7       128       EFLAG_DEBUG_ONLY              Prevents events from occuring on Release builds. Useful for testing new features.
836 NOTE: You can add the numbers in the decimal column to combine flags.
839 =========================================
840 Basic Structure of creature_ai_texts
841 =========================================
842 Below is a the list of current fields within the texts tables.
844 Field_Name            Description
845 -----------------------------------------------------------
846 entry                 This value is mearly an NEGATIVE identifier of the current text number. Required for sql queries. Valid range are -1 to -999999
847 content_default       This is the actual text presented in the default language (English).
849 content_loc1          This is the actual text presented in the Localization #1 Clients (Korean)
850 content_loc2          This is the actual text presented in the Localization #2 Clients (French)
851 content_loc3          This is the actual text presented in the Localization #3 Clients (German)
852 content_loc4          This is the actual text presented in the Localization #4 Clients (Chinese)
853 content_loc5          This is the actual text presented in the Localization #5 Clients (Taiwanese)
854 content_loc6          This is the actual text presented in the Localization #6 Clients (Spanish)
855 content_loc7          This is the actual text presented in the Localization #7 Clients (Spanish Mexico)
856 content_loc8          This is the actual text presented in the Localization #8 Clients (Russian)
858 sound                 This value is the Sound ID that corresponds to the actual text used.
859 type                  Variables used to define type of text (Say/Yell/TextEmote/Whisper).
860 language              This value is the Language that the text is native in.
861 emote                 Value from enum Emote. Only source of text will play this emote (not target, if target are defined in DoScriptText)
862 comment               This is a comment regarding the text entry
864 Note: Fields `content_loc1` to `content_loc8` are NULL values by default and are normally handled by seperate localization projects.
866 =========================================
867 Text Types (type)
868 =========================================
869 Below is the list of current Text types that texts tables can handle. These were previously seperate Actions before.
871 #    Internal Name                 Description
872 -----------------------------------------------------------
873 0    CHAT_TYPE_SAY                 This type sets the text to be displayed as a Say (Speech Bubble).
874 1    CHAT_TYPE_YELL                This type sets the text to be displayed as a Yell (Red Speech Bubble) and usually has a matching Sound ID.
875 2    CHAT_TYPE_TEXT_EMOTE          This type sets the text to be displayed as a text emote in orange in the chat log.
876 3    CHAT_TYPE_BOSS_EMOTE          This type sets the text to be displayed as a text emote in orange in the chat log (Used only for specific Bosses).
877 4    CHAT_TYPE_WHISPER             This type sets the text to be displayed as a whisper to the player in the chat log.
878 5    CHAT_TYPE_BOSS_WHISPER        This type sets the text to be displayed as a whisper to the player in the chat log (Used only for specific Bosses).
879 6    CHAT_TYPE_ZONE_YELL           Same as CHAT_TYPE_YELL but will display to all players in current zone.
881 =========================================
882 Language Types (language)
883 =========================================
884 Below is the list of current Language types that are allowed.
885 This is the Race Language that the text is native to (So it will display properly)
887 #    Internal Name                Description
888 -----------------------------------------------------------
889 0    UNIVERSAL                    Text in this language is understood by ALL Races.
890 1    ORCISH                       Text in this language is understood ONLY by Horde Races.
891 2    DARNASSIAN                   Text in this language is understood ONLY by the Night Elf Race.
892 3    TAURAHE                      Text in this language is understood ONLY by the Tauren Race.
893 6    DWARVISH                     Text in this language is understood ONLY by the Dwarf Race.
894 7    COMMON                       Text in this language is understood ONLY by Alliance Races.
895 8    DEMONIC                      Text in this language is understood ONLY by the Demon Race (Not Implimented).
896 9    TITAN                        This language was used by Sargeras to speak with other Titians (Not Implemented).
897 10   THALASSIAN                   Text in this language is understood ONLY by the Blood Elf Race.
898 11   DRACONIC                     Text in this language is understood ONLY by the Dragon Race.
899 12   KALIMAG                      Text will display as Kalimag (not readable by players, language of all elementals)
900 13   GNOMISH                      Text in this language is understood ONLY by the Gnome Race.
901 14   TROLL                        Text in this language is understood ONLY by the Troll Race.
902 33   GUTTERSPEAK                  Text in this language is understood ONLY by the Undead Race.
903 35   DRAENEI                      Text in this language is understood ONLY by the Draenai Race.
904 36   ZOMBIE                       (not currently used?)
905 37   GNOMISH BINARY               Binary language used by Alliance when drinking Binary Brew
906 38   GOBLIN BINARY                Binary language used by Horce when drinking Binary Brew