root/trunk/src/bindings/scripts/docs/EventAI.txt @ 109

Revision 109, 47.0 kB (checked in by yumileroy, 17 years ago)

[svn] Update trinityscript to SD2 rev 700. Source: scriptdev2. Patch provided by SLG.

Original author: megamage
Date: 2008-10-25 11:40:10-05:00

Line 
1=========================================
2Event AI documentation
3=========================================
4
5Scriptdev2 Revision 220 introduces a new database defined AI named EventAI.
6This system allows users to create new creature scripts entierly within the Database.
7ScriptName must still be set to "mob_eventai" within the MaNGOS database creature_template.scriptname field.
8
9=========================================
10Basic Structure of EventAI
11=========================================
12Event AI follows a basic if (Event) then do {Action} format.
13Below is a the list of current fields within the Eventai_scripts table.
14
15(Field_Name                 Discription)
16id                          This value is mearly an incrementing counter of the current Event number. Required for sql queries.
17creature_id                 Creature id which this event should occur on.
18
19event_type                  Type of event (See Event Types below)
20event_inverse_phase_mask    Mask which phases this event should NOT trigger in*
21event_chance                Percent chance of this event occuring (1 - 100)
22event_flags                 Event flags such as if the event is repeatable (see below)
23event_param1                Variable for event (dependant on Event type)
24event_param2
25event_param3
26event_param4
27
28action1_type                First Type of Action to take when event occurs (See Action Types below)
29action1_param1              Variables used for Action1 (dependant on Action type)
30action1_param2
31action1_param3
32
33action2_type                Second Type of Action to take when event occurs (See Action Types below)
34action2_param1              Variables used for Action2 (dependant on Action type)
35action2_param2
36action2_param3
37
38action3_type                Third Type of Action to take when event occurs (See Action Types below)
39action3_param1              Variables used for Action3 (dependant on Action type)
40action3_param2
41action3_param3
42
43All params are signed 32 bit values (+/- 2147483647). If param specifies time then time is in milliseconds. If param specifies percentage then percentages are value/100 (ex: if param = 500 then that means 500%, -50 = -50%)
44
45*Phase mask is a bit mask of which phases this event should not trigger in. Example: Phase mask value of 12 (1100) would mean that this event would trigger 0, 1 and all other phases except for 2 and 3 (0 counts as the first phase).
46
47=========================================
48Event Types
49=========================================
50Below is the list of current Event types that EventAI can handle.
51Each event type has its own specific interpretation of the params that accompany it.
52Params are always read from Param1, then Param2, then Param3.
53Events will not repeat until the creature exits combat unless EFLAG_REPEATABLE is set. Some events such as EVENT_T_AGGRO, EVENT_T_DEATH, EVENT_T_SPAWNED, and EVENT_T_EVADE cannot repeat.
54
55#   Internal Name               Pamarm usage                                            Description
56-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
570    EVENT_T_TIMER               InitialMin, InitialMax, RepeatMin, RepeatMax            Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4).  but only in combat.
581    EVENT_T_TIMER_OOC           InitialMin, InitialMax, RepeatMin, RepeatMax            Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4).  but only out of combat.
592    EVENT_T_HP                  HPMax%, HPMin%, RepeatMin, RepeatMax                    Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
603    EVENT_T_MANA                ManaMax%,ManaMin% RepeatMin, RepeatMax                  Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
614    EVENT_T_AGGRO               NONE                                                    Expires upon initial aggro (does not repeat).
625    EVENT_T_KILL                RepeatMin, RepeatMax                                    Expires upon killing a player. Will repeat between every (Param1) and (Param2).
636    EVENT_T_DEATH               NONE                                                    Expires upon Death of the Creature.
647    EVENT_T_EVADE               NONE                                                    Expires upon creature EnterEvadeMode().
658    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 (-1 for all). Will repeat every (Param3) and (Param4) .
669    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) .
6710   EVENT_T_OOC_LOS             NoHostile, NoFriendly, RepeatMin, RepeatMax             Expires when a Player moves within visible distance to creature. Does not expire for Hostile Players if (Param1) is not 0. Does not expire for Friendly Players if (Param2) is not 0. Will repeat every (Param3) and (Param4) . Does not expire for creatures or pet or when the creature is in combat.
6811   EVENT_T_SPAWNED             NONE                                                    Expires at initial spawn and at creature respawn (useful for setting ranged movement type)
6912   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) .
7013   EVENT_T_TARGET_CASTING      RepeatMin, RepeatatMax                                  Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2) .
7114   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) .
7215   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) .
7316   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) .
7417   EVENT_T_SUMMONED_UNIT       CreatureId, RepeatMin, RepeatMax                        Expires after creature with entry = (param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
75
76=========================================
77Action Types
78=========================================
79Below is the list of current Action types that EventAI can handle.
80Each event type has its own specific interpretation of the params that accompany it.
81Params are always read from Param1, then Param2, then Param3.
82
83(#   Internal Name                     Param usage                     Discription)
840    ACTION_T_NONE                     No Action                       Does Nothing
851    ACTION_T_TEXT                     -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.
862    ACTION_T_YELL                                                     UNUSED
873    ACTION_T_TEXTEMOTE                                                UNUSED
884    ACTION_T_SOUND                    SoundId                         Plays Sound
895    ACTION_T_EMOTE                    EmoteId                         Does emote
906    ACTION_T_RANDOM_SAY                                               UNUSED
917    ACTION_T_RANDOM_YELL                                              UNUSED
928    ACTION_T_RANDOM_TEXTEMOTE                                         UNUSED
939    ACTION_T_RANDOM_SOUND             SoundId1, SoundId2, SoundId3    Plays random sound between 3 params*
9410   ACTION_T_RANDOM_EMOTE             EmoteId1, EmoteId2, EmoteId3    Emotes random emote between 3 params
9511   ACTION_T_CAST                     SpellId, Target, CastFlags      Casts spell (param1) on target type (param2). Uses Cast Flags (specified below target types)
9612   ACTION_T_SUMMON                   CreatureID, Target, Duration    Summons creature (param1) to attack target (param2) for (param3) duration. Spawns on top of current creature.
9713   ACTION_T_THREAT_SINGLE_PCT        Threat%, Target                 Modifies threat by (param1) on target type (param2)
9814   ACTION_T_THREAT_ALL_PCT           Threat%                         Modifies threat by (param1) on all targets (using -100% on all will result in full aggro dump)
9915   ACTION_T_QUEST_EVENT              QuestID, Target                 Calls AreaExploredOrEventHappens with (param1) for target type (Param2)
10016   ACTION_T_QUEST_CASTCREATUREGO     CreatureID, SpellId, Target     Sends CastCreatureOrGo for CreatureId (param1) with SpellId (param2) for target (param3)
10117   ACTION_T_SET_UNIT_FIELD           Field_Number, Value, Target     Sets Unit Field (param1) to Value (param2) on target type (param3)
10218   ACTION_T_SET_UNIT_FLAG            Flags, Target                   Sets flag (flags can be binary OR together to modify multiple flags at once) on for Target type (param2)
10319   ACTION_T_REMOVE_UNIT_FLAG         Flags, Target                   Removes flag (flags can be binary OR together to modify multiple flags at once) on for Target type (param2)
10420   ACTION_T_AUTO_ATTACK              AllowAutoAttack                 0 = stop melee attack, anything else means continue attacking/allow melee attacking
10521   ACTION_T_COMBAT_MOVEMENT          AllowCombatMovement             0 = stop combat based movement, anything else continue/allow combat based movement (targeted movement generator)
10622   ACTION_T_SET_PHASE                Phase                           Sets the current phase to (param1)
10723   ACTION_T_INC_PHASE                Value                           Increments the phase by (param1). May be negative to decrement phase but should not be 0.
10824   ACTION_T_EVADE                    No Params                       Forces the creature to evade. Wiping all threat and dropping combat.
10925   ACTION_T_FLEE                     No Params                       Causes the .creature to flee. Please use this action instead of directly casting this spell so we may change this when a more correct approach is found.
11026   ACTION_T_QUEST_EVENT_ALL          QuestId                         Calls GroupEventHappens with (param1). Only used if it's _expected_ event should complete for all players in current party
11127   ACTION_T_CASTCREATUREGO_ALL       QuestId, SpellId                Calls CastedCreatureOrGo for all players on the threat list with QuestID(Param1) and SpellId(Param2)
11228   ACTION_T_REMOVEAURASFROMSPELL     Target, Spellid                 Removes all auras on Target caused by Spellid
11329   ACTION_T_RANGED_MOVEMENT          Distance, Angle                 Changes the movement generator type to a ranged type. Note: Default melee type can still be done with this. Specify 0 angle and 0 distance.
11430   ACTION_T_RANDOM_PHASE             PhaseId1, PhaseId2, PhaseId3    Sets the phase to the id between 3 params*
11531   ACTION_T_RANDOM_PHASE_RANGE       PhaseMin, PhaseMax              Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). PhaseMax must be greater than PhaseMin.
11632   ACTION_T_SUMMON                   CreatureID, Target, SummonID    Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3).
11733   ACTION_T_KILLED_MONSTER           CreatureID, Target              Calls KilledMonster (param1) for target of type (param2)
11834   ACTION_T_SET_INST_DATA            Field, Data                     Calls ScriptedInstance::SetData with field (param1) and data (param2)
11935   ACTION_T_SET_INST_DATA64          Field, Target                   Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID.
12036   ACTION_T_UPDATE_TEMPLATE          TemplateId, Team                Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true
12137   ACTION_T_DIE                      No Params                       Kills the creature
12238   ACTION_T_ZONE_COMBAT_PULSE        No Params                       Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances.
123
124* = 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)
125
126=========================================
127Event Types
128=========================================
129Note:
130COMBAT ONLY - Means that this event will only trigger durring combat.
131OUT OF COMBAT ONLY - Means that this event will only trigger while out of combat.
132BOTH - This event can trigger both in and out of combat.
133
134Events that do not have lables on them are events that are directly involved with the in and out of combat state.
135
136------------------
1370 = EVENT_T_TIMER:
138------------------
139Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire
140Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
141Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
142Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
143
144COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
145This is commonly used for spells that repeat cast during combat (Simulate Spell Cooldown).
146
147----------------------
1481 = EVENT_T_TIMER_OOC:
149----------------------
150Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire
151Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
152Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
153Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
154
155OUT OF COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
156This is commonly used for events that occur and repeat outside of combat.
157
158---------------
1592 = EVENT_T_HP:
160---------------
161Parameter 1: HPMax% - Maximum HP% That this Event will Expire
162Parameter 2: HPMin% - Minimum HP% That this Event will Expire
163Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
164Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
165
166BOTH - Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
167This is commonly used for events that trigger at a specific HP% (Such as Heal/Enrage Spells or NPC's that Flee).
168
169-----------------
1703 = EVENT_T_MANA:
171-----------------
172Parameter 1: ManaMax% - Maximum Mana% That this Event will Expire
173Parameter 2: ManaMin% - Minimum Mana% That this Event will Expire
174Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
175Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
176
177BOTH - Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
178This is commonly used for events where an NPC low on Mana will do something (Such as stop casting spells and switch to melee).
179
180------------------
1814 = EVENT_T_AGGRO:
182------------------
183This Event Expires upon initial aggro (does not repeat).
184
185-----------------
1865 = EVENT_T_KILL:
187-----------------
188Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire
189Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire
190
191COMBAT ONLY! - Expires upon killing a player. Will repeat every (Param1) and (Param2).
192This Event Expires upon killing a player. It is commonly used for NPC's who yell or do something after killing a player.
193
194------------------
1956 = EVENT_T_DEATH:
196------------------
197This Event Expires upon Death of the Scripted NPC.
198This is commonly used for NPC's who have a yell on death or cast some kind if summon spell when they die.
199
200------------------
2017 = EVENT_T_EVADE:
202------------------
203This Event Expires upon the creature EnterEvadeMode().
204This is commonly used for NPC's who use phases, allows you to reset their phase to 0 upon evade to prevent possible strange behavior.
205
206---------------------
2078 = EVENT_T_SPELLHIT:
208---------------------
209Parameter 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)
210Parameter 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*
211Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
212Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
213
214BOTH - 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).
215This Event is commonly used for NPC's who can do special things when you cast a spell (Or specific spell) on them.
216
217------------------
2189 = EVENT_T_RANGE:
219------------------
220Parameter 1: MinDist - This Distance is the Minimum Distance between the NPC and it's target to allow this Event to Expire
221Parameter 2: MaxDist - This Distance is the Maximum Distance between the NPC and it's target to allow this Event to Expire
222Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
223Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
224
225COMBAT ONLY! - Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4).
226This Event is commonly used for NPC's who have Ranged Combat and will Throw/Shoot between a certian distance.
227
228---------------------
22910 = EVENT_T_OOC_LOS:
230---------------------
231Parameter 1: NoHostile - This Value is to Prevent this Action from Expiring When Caused by a Player/Creature Hostile to them (0 = Prevent Event from Expiring, 1 = Allow Event to Expire)
232Parameter 2: NoFriendly - This Value is to Prevent this Action from Expiring When Caused by a Player/Creature Friendly to them (0 = Prevent Event from Expiring, 1 = Allow Event to Expire)
233Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
234Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
235
236OUT OF COMBAT ONLY! - Expires when a Player moves within visible distance to the NPC. Does not expire for Hostile Players if (Param1) is not 0. Does not expire for Friendly Players if (Param2) is not 0. Will repeat every (Param3) and (Param4). Does not expire for creatures or pets when they are in combat.
237This Event is commonly used for NPC's who Do Something or Say Something when you walk past them Out of Combat.
238
239---------------------
24011 = EVENT_T_SPAWNED:
241---------------------
242Expires at initial spawn and at creature respawn.
243This Event is commonly used for setting ranged movement type or Summoning a Pet on Spawn
244
245-----------------------
24612 = EVENT_T_TARGET_HP:
247-----------------------
248Parameter 1: HPMax% - Maximum HP% That this Event will Expire
249Parameter 2: HPMin% - Minimum HP% That this Event will Expire
250Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
251Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
252
253COMBAT ONLY! - Expires when Current NPC's Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
254This Event is commonly used for NPC's who have a special ability (Like Execute) that only casts when a Player HP is low.
255
256----------------------------
25713 = EVENT_T_TARGET_CASTING:
258----------------------------
259Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire
260Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire
261
262COMBAT ONLY! - Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2).
263This event is commonly used for NPC's who will cast a counter spell when their target starts to cast a spell.
264
265-------------------------
26614 = EVENT_T_FRIENDLY_HP:
267-------------------------
268Parameter 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)
269Parameter 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.
270Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
271Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
272
273COMBAT ONLY! - Expires when a friendly unit in radius(param2) has at least (param1) hp missing. Will repeat every (Param3) and (Param4).
274This is commonly used when an NPC in Combat will heal a nearby Friendly NPC in Combat with a Heal/Renew Spell.
275
276----------------------------
27715 = EVENT_T_FRIENDLY_IS_CC:
278----------------------------
279Parameter 1: DispelType - Dispel Type to trigger the event - *See Below for Dispel Bitmask Values*
280Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies being Crowd Controlled
281Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
282Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
283
284COMBAT ONLY! - Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4).
285This is commonly used for NPC's who can come to the resule of other Friendly NPC's if being Crowd Controlled
286
287--------------------------
28816 = EVENT_T_MISSING_BUFF:
289--------------------------
290Parameter 1: SpellId - This is the SpellID That the Aura Check will look for (If it is missing this Aura)
291Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies (Faction is Friendly To) for the missing Aura.
292Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
293Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
294
295BOTH - Expires when a friendly unit is missing aura's given by spell (param1) within radius (param2). Will repeat every (Param3) and (Param4).
296This is commonly used for NPC's who watch friendly units for a debuff to end so they can recast it on them again.
297
298---------------------------
29917 = EVENT_T_SUMMONED_UNIT:
300---------------------------
301Parameter 1: CreatureId - The CreatureID that the NPC is watching to spawn to trigger this event
302Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire
303Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire
304
305BOTH - Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
306This is commonly used for NPC's who will do something special once another NPC is summoned. Usually used is Complex Scripts or Special Events.
307
308
309=========================================
310Action Types
311=========================================
312
313-----------------
3141 = ACTION_T_TEXT:
315-----------------
316Parameter 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).
317             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)
318             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).
319             In case this entry has a localized version of the text, the localized text will be displayed in client that support this locale.
320
321Parameter 2: Optional. TextId can be defined in addition. The same apply to this as explained above, however eventAI will randomize between the two.
322Parameter 3: Optional, if Parameter 2 exist. In this case, eventAI will randomize between three.
323
324------------------
3252 = ACTION_T_YELL:
326------------------
327UNUSED       Can be reused to create new action type
328
329-----------------------
3303 = ACTION_T_TEXTEMOTE:
331-----------------------
332UNUSED       Can be reused to create new action type
333
334-------------------
3354 = ACTION_T_SOUND:
336-------------------
337Parameter 1: The Sound ID to be played. (Sound IDs are contained in the DBC files.)
338
339The creature will play the specified sound.
340This is commonly used for Bosses who Yell and then also have a Voice for the same thing.
341
342-------------------
3435 = ACTION_T_EMOTE:
344-------------------
345Parameter 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).
346
347The 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.
348This is commonly used for NPC's who may perform a special action (Salute, Roar, ect...). Not all player emotes work for creature models.
349
350------------------------
3516 = ACTION_T_RANDOM_SAY:
352------------------------
353UNUSED       Can be reused to create new action type
354
355-------------------------
3567 = ACTION_T_RANDOM_YELL:
357-------------------------
358UNUSED       Can be reused to create new action type
359
360------------------------------
3618 = ACTION_T_RANDOM_TEXTEMOTE:
362------------------------------
363UNUSED       Can be reused to create new action type
364
365--------------------------
3669 = ACTION_T_RANDOM_SOUND:
367--------------------------
368Parameter 1: The Sound ID to be played as Random Choice #1.
369Parameter 2: The Sound ID to be played as Random Choice #2.
370Parameter 3: The Sound ID to be played as Random Choice #3.
371
372Similar to the ACTION_T_SOUND action, it will choose at random a sound to play.
373
374---------------------------
37510 = ACTION_T_RANDOM_EMOTE:
376---------------------------
377Parameter 1: The Emote ID to be played as Random Choice #1.
378Parameter 2: The Emote ID to be played as Random Choice #2.
379Parameter 3: The Emote ID to be played as Random Choice #3.
380
381Similar to the ACTION_T_EMOTE action, it will choose at random an Emote to Visually Perform.
382
383-------------------
38411 = ACTION_T_CAST:
385-------------------
386Parameter 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.
387Parameter 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.
388Parameter 3: CastFlags - See Table Below for Cast Flag Bitmask Values. If you are unsure what to set this value at leave it at 0.
389
390The creature will cast a spell specified by a spell ID on a target specified by the target type.
391This is commonly used for NPC's who cast spells.
392
393---------------------
39412 = ACTION_T_SUMMON:
395---------------------
396Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID.
397Parameter 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.
398Parameter 3: Duration - The duration until the summoned creature should be unsummoned AFTER Combat ends. The value in this field is in milliseconds or 0.
399
400The NPC will Summon another creature at the same spot as itself that will attack the specified target.
401NOTE: 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.
402NOTE: Using Target Type 0 will cause the Summoned creature to not attack anyone.
403NOTE: If Duration is set at 0, then the summoned creature will not despawn until it has died.
404This is used as a manual way to force an NPC to Summon.
405--------------------------------
40613 = ACTION_T_THREAT_SINGLE_PCT:
407--------------------------------
408Parameter 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.
409Parameter 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.
410
411This action will modify the threat of a target in the creature's threat list by the specified percent.
412This is commonly used to allow an NPC to adjust the Threat to a single player.
413
414-----------------------------
41514 = ACTION_T_THREAT_ALL_PCT:
416-----------------------------
417Parameter 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.
418
419This action will modify the threat for everyone in the creature's threat list by the specified percent.
420NOTE: 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.
421This is commonly used to allow an NPC to drop threat for all players to zero.
422
423--------------------------
42415 = ACTION_T_QUEST_EVENT:
425--------------------------
426Parameter 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.
427Parameter 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.
428
429This action will satisfy the external completion requirement for the quest for the specified target defined by the target type.
430NOTE: This action can only be used with player targets so it must be ensured that the target type will point to a player.
431This is commonly used for Quests where only ONE player will gain credit for the quest.
432
433-----------------------------
43416 = ACTION_T_CASTCREATUREGO:
435-----------------------------
436Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID.
437Parameter 2: SpellId - The Spell ID to use to simulate the cast. The value used in this field needs to be a valid Spell ID.
438Parameter 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.
439
440This action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature.
441This is commonly used for NPC's who have a special requirement to have a Spell cast on them to complete a quest.
442
443-----------------------------
44417 = ACTION_T_SET_UNIT_FIELD:
445-----------------------------
446Parameter 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.
447Parameter 2: Value - The new value to be put in the field.
448Parameter 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.
449
450When 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)
451
452----------------------------
45318 = ACTION_T_SET_UNIT_FLAG:
454----------------------------
455Parameter 1: Flags - The flag(s) to be set. Multiple flags can be set by using bitwise-OR on them (adding them together).
456Parameter 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.
457
458When 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.
459
460-------------------------------
46119 = ACTION_T_REMOVE_UNIT_FLAG:
462-------------------------------
463Parameter 1: Flags - The flag(s) to be removed. Multiple flags can be set by using bitwise-OR on them (adding them together).
464Parameter 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.
465
466When 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.
467
468--------------------------
46920 = ACTION_T_AUTO_ATTACK:
470--------------------------
471Parameter 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.
472
473This action controls whether or not the creature should stop or start the auto melee attack.
474NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values (0 = Stop Melee, 1 = Start Melee).
475This is commonly used in combination with EVENT_T_RANGE and ACTION_T_COMBAT_MOVEMENT for Ranged Combat for Mages and Spell Casters.
476
477------------------------------
47821 = ACTION_T_COMBAT_MOVEMENT:
479------------------------------
480Parameter 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.
481
482This action controls whether or not the creature will always move towards its target.
483NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values. (0 = Stop Movement, 1 = Start Movement)
484This 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)
485
486------------------------
48722 = ACTION_T_SET_PHASE:
488------------------------
489Parameter 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.
490
491When activated, this action sets the creature's event to the specified value.
492NOTE: The creature's current Phase is NOT reset at creature evade. You must manually set the phase back to 0 at EVENT_T_RESET.
493NOTE: The value used for the Param is the actual Phase Number (Not The Event_Inverse_Phase_Mask)
494This is commonly used for complex scripts with several phases and you need to switch to a different phase.
495
496------------------------
49723 = ACTION_T_INC_PHASE:
498------------------------
499Parameter 1: Value - The number of phases to increase or decrease. Use negative values to decrease the current phase.
500
501When activated, this action will increase (or decrease) the current creature's phase.
502NOTE: After increasing or decreasing the phase by this action, the current phase must NOT be lower than 0 or exceed 31.
503This can be used instead of ACTION_T_SET_PHASE to change phases in scripts. Just a user friendly option for changing phases.
504
505--------------------
50624 = ACTION_T_EVADE:
507--------------------
508When 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.
509NOTE: All Param Values Are 0 for this Action.
510
511-------------------
51225 = ACTION_T_FLEE:
513-------------------
514When 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". A Better Flee system is in Development but will take time before it is implimented.
515NOTE: All Param Values Are 0 for this Action.
516
517------------------------------
51826 = ACTION_T_QUEST_EVENT_ALL:
519------------------------------
520Parameter 1: QuestId - The quest ID to finish for everyone.
521
522This 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.
523NOTE: If a player is not in the NPC's threat list for whatever reason, he/she won't get the quest completed.
524
525---------------------------------
52627 = ACTION_T_CASTCREATUREGO_ALL:
527---------------------------------
528Parameter 1: QuestId - The quest template ID.
529Parameter 2: SpellId - The spell ID used to simulate the cast.
530
531This action does the same thing as the ACTION_T_CASTCREATUREGO does but it does it for all players in the creature's threat list.
532NOTE: If a player is not in its threat list for whatever reason, he/she won't receive the cast emulation.
533
534-----------------------------------
53528 = ACTION_T_REMOVEAURASFROMSPELL:
536-----------------------------------
537Parameter 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.
538Parameter 2: SpellId - The spell ID whose auras will be removed.
539
540This action will remove all auras from a specific spell from the target. 
541This 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)
542
543------------------------------
54429 = ACTION_T_RANGED_MOVEMENT:
545------------------------------
546Parameter 1: Distance - The distance the mob should keep between it and its target.
547Parameter 2: Angle - The angle the mob should use.
548
549This action changes the movement type generator to ranged type using the specified values for angle and distance.
550NOTE: Specifying zero angle and distance will make it just melee instead.
551This is commonly used for NPC's who always attack at range and you can specify the distance they will maintain from the target.
552
553---------------------------
55430 = ACTION_T_RANDOM_PHASE:
555---------------------------
556Parameter 1: PhaseId1 - A possible random phase choice.
557Parameter 2: PhaseId2 - A possible random phase choice.
558Parameter 3: PhaseId3 - A possible random phase choice.
559
560Randomly sets the phase to one from the three parameter choices.
561NOTE: 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)
562NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE.
563This 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.
564
565---------------------------------
56631 = ACTION_T_RANDOM_PHASE_RANGE:
567---------------------------------
568Parameter 1: PhaseMin - The minimum of the phase range.
569Parameter 2: PhaseMax - The maximum of the phase range. The number here must be greater than PhaseMin.
570
571Randomly sets the phase between a range of phases controlled by the parameters. Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax).
572NOTE: PhaseMax must be greater than PhaseMin.
573NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE.
574This 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.
575
576---------------------
57732 = ACTION_T_SUMMON:
578---------------------
579Parameter 1: CreatureID - The creature template ID to be summoned. The value here needs to be a valid creature template ID.
580Parameter 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.
581Parameter 3: SummonID - The summon ID from the eventai_summons table controlling the position (and spawntime) where the summoned mob should be spawned at.
582
583Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3).
584NOTE: Param3 Value is the ID Value used for the entry used in EventAI_Summons for this action. You MUST have an EventAI_Summons entry to use this action.
585This is commonly used for NPC's who need to Summon a creature at a specific location. (Normally used for complex events)
586
587-----------------------------
58833 = ACTION_T_KILLED_MONSTER:
589-----------------------------
590Parameter 1: CreatureID - The creature template ID. The value here must be a valid creature template ID.
591Parameter 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.
592
593When 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).
594NOTE: It can be ANY creature including certain quest specific triggers
595This is commonly used for giving the player Quest Credits for NPC kills (Many NPC's may use the same CreatureID for the Kill Credit)
596
597----------------------------
59834 = ACTION_T_SET_INST_DATA:
599----------------------------
600Parameter 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.
601Parameter 2: Data - The value to put at that field index.
602
603Sets 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.
604NOTE: Param1 Value is located in "def_<instance name>.h" SD2 File and Param2 value is generally found in the "sc_instance.h" file in SD2
605This is commonly used to link an ACID script with a SD2 C++ Script. You make make things happen like opening doors on specific events that happen. ACID Just triggers the C++ Script to function.
606
607------------------------------
60835 = ACTION_T_SET_INST_DATA64:
609------------------------------
610Parameter 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.
611Parameter 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.
612
613Sets 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.
614Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID.
615
616------------------------------
61736 = ACTION_T_UPDATE_TEMPLATE:
618------------------------------
619Parameter 1: TemplateId - The creature template ID. The value here must be a valid creature template ID.
620Parameter 2: Team - Use model_id from team : Alliance(0) or Horde (1).
621
622This 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.
623Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true
624
625------------------
62637 = ACTION_T_DIE:
627------------------
628Kills the creature
629This is commonly used if you need to Instakill the creature for one reason or another.
630
631--------------------------------
63238 = ACTION_T_ZONE_COMBAT_PULSE:
633--------------------------------
634Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances.
635
636
637=========================================
638Target Types
639=========================================
640Below is the list of current Target types that EventAI can handle.
641Target types are used by certain actions and may effect actions differently
642
643(#   Internal Name                      Discription)
6440    TARGET_T_SELF                      Self cast
6451    TARGET_T_HOSTILE                   Our current target (ie: highest aggro)
6462    TARGET_T_HOSTILE_SECOND_AGGRO      Second highest aggro (generaly used for cleaves and some special attacks)
6473    TARGET_T_HOSTILE_LAST_AGGRO        Dead last on aggro (no idea what this could be used for)
6484    TARGET_T_HOSTILE_RANDOM            Just any random target on our threat list
6495    TARGET_T_HOSTILE_RANDOM_NOT_TOP    Any random target except top threat
6506    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)
651
652=========================================
653Cast Flags
654=========================================
655Below is the list of current Cast Flags that EventAI's spell casting can handle.
656Cast flags are handled bitwise. Bit 0 is Interrupt Previous, bit 1 is triggered, etc.
657So 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.
658Another 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.
659
660(bit#   Decimal     Internal Name                  Discription)
6610       1           CAST_INTURRUPT_PREVIOUS        Interrupts any previous spell casting (basicaly makes sure that this spell goes off)
6621       2           CAST_TRIGGERED                 Forces the spell to be instant cast and require no mana/reagents.
6632       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
6643       8           CAST_NO_MELEE_IF_OOM           Prevents creature from entering melee if out of mana or out of range
6654       16          CAST_FORCE_TARGET_SELF         Forces the target to cast this spell on itself
6665       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.
667
668NOTE: You can add the numbers in the decimal column to combine flags.
669 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).
670
671=========================================
672Event Flags
673=========================================
674Below is the list of current Event Flags that EventAI can handle. Event flags are handled bitwise.
675
676(bit#   Decimal   Internal Name                  Discription)
6770       1         EFLAG_REPEATABLE               Event repeats (Does not repeat if this flag is not set)
6781       2         EFLAG_NORMAL                   Event occurs in Normal instance difficulty (will not occur in Normal if not set)
6792       4         EFLAG_HEROIC                   Event occurs in Heroic instance difficulty (will not occur in Heroic if not set)
6803       8
6814       16
6825       32
6836       64
6847       128        EFLAG_DEBUG_ONLY              Prevents events from occuring on Release builds of ScriptDev2. Useful for testing new features.
685
686NOTE: You can add the numbers in the decimal column to combine flags.
Note: See TracBrowser for help on using the browser.