forked from cmangos/mangos-tbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventAI.txt
1274 lines (1056 loc) · 94.2 KB
/
EventAI.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
===========================================================================
MaNGOS EventAI (Creature_AI) Documentation: (Last Updated: June 25, 2018)
===========================================================================
EventAI allows users to create new creature scripts entirely within the database.
For the AI to be used, you must first make sure to set AIname for each creature that should use this AI.
UPDATE creature_template SET AIName = 'EventAI' WHERE entry IN (...);
Note: Edit in Spaces, not Tabs
=========================================
Basic Structure of EventAI
=========================================
EventAI follows a basic IF (Event) then DO (Action) format.
Below is the list of current fields of the creature_ai_scripts table.
Field_Name Description
-------------------------------------------
id This value is merely an incrementing counter of the current Event number. Required for sql queries. (ACID Standards: CreatureID+Additional 2 digit Incriment Starting with 01)
creature_id Creature ID which should trigger this event (This is entry value from `creature_template` table).
event_type The type of event you want to script. (see "Event Types" below for different values)
event_inverse_phase_mask Mask with phases this event should NOT trigger in* (See footnote for more details on using any other value then 0)
event_chance Percentage chance of triggering the event (1 - 100)
event_flags Event Flags (Used to select Repeatable or Dungeon Heroic Mode)... See "Event Flags" Below For Defined Values
event_param1 Variables for the event (depends on event_type)
event_param2 Variables for the event (depends on event_type)
event_param3 Variables for the event (depends on event_type)
event_param4 Variables for the event (depends on event_type)
event_param5 Variables for the event (depends on event_type)
event_param6 Variables for the event (depends on event_type)
action1_type Action #1 to take when the Event occurs (see "Action types" below)
action1_param1 Variables used by Action1 (depends on action_type)
action1_param2 Variables used by Action1 (depends on action_type)
action1_param3 Variables used by Action1 (depends on action_type)
action2_type Action #2 to take when the Event occurs (see "Action types" below)
action2_param1 Variables used by Action1 (depends on action_type)
action2_param2 Variables used by Action1 (depends on action_type)
action2_param3 Variables used by Action1 (depends on action_type)
action3_type Action #3 to take when the Event occurs (see "Action types" below)
action3_param1 Variables used by Action1 (depends on action_type)
action3_param2 Variables used by Action1 (depends on action_type)
action3_param3 Variables used by Action1 (depends on action_type)
All params are signed 32-bit values (+/- 2147483647). Time values are always in milliseconds.
In case of a percentage value, use value/100 (ie. param = 500 then that means 500%, -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 1 as Phase 0 = 1).
[*] Phase 0 is default so this will occur in all phases unless specified. (1101 = Triggers in Phase 1, 1011 = Triggers in Phase 2, 0111 = Triggers in Phase 3, 0011 = Triggers in Phase 2 and 3).
[*] Take Desired Binary Configuration and convert into Decimal and this is your event_inverse_phase_mask to use in your script.
=========================================
Event Types
=========================================
This is the list of available Event Types EventAI is able to handle.
Each event type has its own specific interpretation of the params that accompany it.
Params are always read in the ascending order (from Param1 to Param3).
NOTE: Events will not repeat until the creature exits combat or unless EFLAG_REPEATABLE value is set in Event Flags.
Some events such as EVENT_T_AGGRO, EVENT_T_DEATH, EVENT_T_SPAWNED, and EVENT_T_EVADE cannot repeat even if EFLAG_REPEATABLE value is set.
# Internal Name Event (Param1, Param2, Param3, Param4, Param5, Param6) Description
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0 EVENT_T_TIMER_IN_COMBAT InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then will repeat between every (Param3) and (Param4), EXPIRES ONLY IN COMBAT.
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 BUT NOT DURING EVADE.
2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when the NPC's HP% is between (Param1) and (Param2). Will repeat between every (Param3) and (Param4) If Event Conditions Are Still Met.
3 EVENT_T_MANA ManaMax%, ManaMin%, RepeatMin, RepeatMax Expires when the NPC's Mana% is between (Param1) and (Param2). Will repeat between every (Param3) and (Param4) If Event Conditions Are Still Met.
4 EVENT_T_AGGRO NONE Expires ONLY upon the NPC's INITIAL Aggro at the Start of Combat (Does NOT Repeat) and Only Resets on Spawn or Evade.
5 EVENT_T_KILL RepeatMin, RepeatMax, PlayerOnly, unused Expires upon Killing a Player. Will Repeat Check between (Param1) and (Param2). This Event Will Not Trigger Again Until Repeat Timer Expires. Param3 restricts trigger to players only.
6 EVENT_T_DEATH ConditionId, unused, unused, unused Expires on the NPC's Death. (This Triggers At The Moment The NPC Dies) Optionally if ConditionId is provided the event will only trigger if the condition returns true
7 EVENT_T_EVADE NONE Expires at the moment the Creature EnterEvadeMode() and Exits Combat.
8 EVENT_T_SPELLHIT SpellID, Schoolmask*, RepeatMin, RepeatMax Expires upon Spell Hit of the NPC. 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) and Spell ID value is ignored. Will repeat Event Conditions Check between every (Param3) and (Param4). Only A Spell ID or Spell School may be Specified but NOT both.
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) if Event Conditions Are Still Met.
10 EVENT_T_OOC_LOS NoHostile, MaxRange, RepeatMin, RepeatMax, PlayerOnly, ConditionId Expires when a unit moves within distance (MaxAllowedRange) of the NPC. If (Param1) is 0 it will expire only when unit is hostile, If (Param1) is 1 it will expire only when unit is friendly. This depends generally on faction relations. Will repeat every (Param3) and (Param4). Does NOT expire when the NPC is in combat.
11 EVENT_T_SPAWNED Condition, CondValue1, unused, unused Expires on initial spawn and respawn of the NPC if Condition is met (Useful for setting Ranged Movement/Summoning Pets/Applying Buffs).
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)If Event Conditions Are Still Met.
13 EVENT_T_TARGET_CASTING RepeatMin, RepeatatMax, unused, unused Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2) If Event Conditions Are Still Met.
14 EVENT_T_FRIENDLY_HP HPDeficit, Radius, RepeatMin, RepeatMax Expires when a friendly unit in (Radius) has at least (Param1) HP points missing. Will repeat every (Param3) and (Param4) If Event Conditions Are Still Met.
15 EVENT_T_FRIENDLY_IS_CC DispelType, Radius, RepeatMin, RepeatMax Expires when a friendly unit is crowd controlled within the given Radius (Param2). Will repeat every (Param3) and (Param4).
16 EVENT_T_FRIENDLY_MISSING_BUFF SpellId, Radius, RepeatMin, RepeatMax, InCombat Expires when a friendly unit is missing aura(s) given by a spell (Param1) within Radius (Param2). Will repeat every (Param3) and (Param4) If Event Conditions Are Still Met.
17 EVENT_T_SUMMONED_UNIT CreatureId, RepeatMin, RepeatMax, unused Expires after creature with entry = (Param1) is spawned (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3).
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) If Event Conditions Are Still Met.
21 EVENT_T_REACHED_HOME NONE Expires when a creature reaches it's home (spawn) location after evade. This is commonly used for NPC's who Stealth once reaching their Spawn Location
22 EVENT_T_RECEIVE_EMOTE EmoteId, ConditionId Expires when a creature receives an emote with emote text id ("enum TextEmotes" from SharedDefines.h in Mangos Source) in (Param1). Conditions are taken from table conditions.
23 EVENT_T_AURA 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) If Event Conditions Are Still Met.
24 EVENT_T_TARGET_AURA 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) If Event Conditions Are Still Met.
25 EVENT_T_SUMMONED_JUST_DIED CreatureId, RepeatMin, RepeatMax, unused Expires after creature with entry = (Param1) is die (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3).
26 EVENT_T_SUMMONED_JUST_DESPAWN CreatureId, RepeatMin, RepeatMax, unused Expires before creature with entry = (Param1) is despawn (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3).
27 EVENT_T_MISSING_AURA SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when a creature not has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4).
28 EVENT_T_TARGET_MISSING_AURA SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when a target unit not has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4).
29 EVENT_T_TIMER_GENERIC InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then will repeat between every (Param3) and (Param4).
30 EVENT_T_RECEIVE_AI_EVENT AIEventType, Sender-Entry, unused, unused Expires when the creature receives an AIEvent of type (Param1), sent by creature (Param2 != 0). If (Param2 = 0) then sent by any creature
31 EVENT_T_ENERGY EnergyMax%, EnergyMin%, RepeatMin, RepeatMax Expires when the NPC's Energy% is between (Param1) and (Param2). Will repeat between every (Param3) and (Param4) If Event Conditions Are Still Met.
32 EVENT_T_SELECT_ATTACKING_TARGET MinRange, MaxRange, RepeatMin, RepeatMax Deprecated use TARGET_T_NEAREST_AOE_TARGET - Expires when the NPC has a target in threat table further than Param1 and closer than Param2. First time happens after and will repeat after Param3 and Param4.
33 EVENT_T_FACING_TARGET BackOrFront, unused, RepeatMin, RepeatMax Expires when the NPC is in back (Param1=0) or in front (Param1=1) of its current target. Will repeat after Param3 and Param4.
34 EVENT_T_SPELLHIT_TARGET SpellID, Schoolmask, RepeatMin, RepeatMax Expires upon Spell Hit of the NPC. 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) and Spell ID value is ignored. Will repeat Event Conditions Check between every (Param3) and (Param4). Only A Spell ID or Spell School may be Specified but NOT both.
35 EVENT_T_DEATH_PREVENTED NONE Expires when Death prevention kicks in
36 EVENT_T_TARGET_NOT_REACHABLE NONE Expires when target is not reachable
=========================================
Action Types
=========================================
This is a list of action types that EventAI is able to handle.
Each event type has it's own specific interpretation of it's params, just like Events.
For all ACTION_T_RANDOM Actions, When a Particular Param is selected for the Event... The SAME Param # is selected for all 3 actions when Event is triggered.
# Internal Name Action (Param1, Param2, Param3) Description
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0 ACTION_T_NONE No Action Does nothing.
1 ACTION_T_TEXT -TextId1, -TextId2, -TextId3 Displays the specified -TextId. When -TextId2 and -TextId3 are specified, the selection will be Randomized between 1,2 or 3. Text ID's are defined, along with other options for the text, in creature_ai_texts table. Below is detailed Text Information. All text ID values for EventAI MUST be negative.
2 ACTION_T_SET_FACTION FactionId, Flags Changes faction for a creature. When param1 is zero, creature will revert to it's default faction. Flags will determine when faction is restored to default (evade, respawn etc)
3 ACTION_T_MORPH_TO_ENTRY_OR_MODEL CreatureEntry, ModelId Sets either model from creature_template.entry (Param1) OR explicit modelId (Param2) for the NPC. If (Param1) AND (Param2) are both 0, NPC will demorph and revert to the default model (as specified in creature_template).
4 ACTION_T_SOUND SoundId NPC Plays a specified Sound ID.
5 ACTION_T_EMOTE EmoteId NPC Does a specified Emote ID.
6 UNUSED UNUSED UNUSED
7 UNUSED UNUSED UNUSED
8 UNUSED UNUSED UNUSED
9 ACTION_T_RANDOM_SOUND SoundId1*, SoundId2*, SoundId3* NPC Plays a Random Sound ID (Random Selects Param1, Param2 or Param3)
10 ACTION_T_RANDOM_EMOTE EmoteId1*, EmoteId2*, EmoteId3* NPC Emotes a Random Emote ID (Random Selects Param1, Param2 or Param3)
11 ACTION_T_CAST SpellId, Target, CastFlags Casts spell (Param1) on a target (Param2) using cast flags (Param3) --> Specified Below
12 ACTION_T_SPAWN CreatureID, Target, Duration Summons a Creature ID (Param1) for (Param3) duration after Evade (In MS) and orders it to attack (Param2) target (specified below). Spawns on top of NPC who summons it.
13 ACTION_T_THREAT_SINGLE Threat, Target, IsDirect Modifies a threat by (Param1) on a target (Param2). If Param3 is 0, its percent modification, else direct value.
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).
15 ACTION_T_QUEST_EVENT QuestID, Target, RewardGroup Calls AreaExploredOrEventHappens with (Param1) for a target in (Param2). Param3 decides if award entire group (1 = yes, 0 = no).
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).
17 ACTION_T_SET_UNIT_FIELD Field_Number, Value, Target Sets a unit field (Param1) to provided value (Param2) on a target in (Param3).
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).
19 ACTION_T_REMOVE_UNIT_FLAG Flags, Target Removes flag on a target (Param2).
20 ACTION_T_AUTO_ATTACK AllowAutoAttack Stop melee attack when (Param1) is zero, otherwise continue attacking / allow melee attack.
21 ACTION_T_COMBAT_MOVEMENT AllowCombatMovement Stop combat based movement when (Param1) is zero, otherwise continue/allow combat based movement (targeted movement generator).
22 ACTION_T_SET_PHASE Phase Sets the current phase to (Param1).
23 ACTION_T_INC_PHASE Value Increments the phase by (Param1). May be negative to decrement, but should not be zero.
24 ACTION_T_EVADE No Params Forces the creature to evade, wiping all threat and dropping combat. Param1 - combat drop only
25 ACTION_T_FLEE_FOR_ASSIST No Params Causes the creature to flee for assistence (often at low health).
26 ACTION_T_QUEST_EVENT_ALL QuestId, UseThreatList Calls GroupEventHappens with (Param1). Only used if it's _expected_ event should call quest completion for all players in a current party. Can be used for the creature's threat list, for complex scripted events.
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).
28 ACTION_T_REMOVEAURASFROMSPELL Target, Spellid Removes all auras on a target (Param1) caused by a spell (Param2).
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).
30 ACTION_T_RANDOM_PHASE PhaseId1*, PhaseId2*, PhaseId3* Sets a phase to a specified id(s)
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.
32 ACTION_T_SUMMON_ID CreatureID, Target, SummonID Summons a creature (Param1) to attack target (Param2) at location specified by EventAI_Summons (Param3).
33 ACTION_T_KILLED_MONSTER CreatureID, Target Calls KilledMonster (Param1) for a target (Param2).
34 ACTION_T_SET_INST_DATA Field, Data Calls ScriptedInstance::SetData with field (Param1) and data (Param2).
35 ACTION_T_SET_INST_DATA64 Field, Target Calls ScriptedInstance::SetData64 with field (Param1) and target's GUID (Param2).
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.
37 ACTION_T_DIE No Params Kills the creature
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.
39 ACTION_T_CALL_FOR_HELP Radius Call any friendly out-of-combat creatures in a radius (Param1) to attack current creature's target.
40 ACTION_T_SET_SHEATH Sheath Sets sheath state for a creature (0 = no weapon, 1 = melee weapon, 2 = ranged weapon).
41 ACTION_T_FORCE_DESPAWN Delay Despawns the creature, if delay = 0 immediate otherwise will despawn after delay time set in Param1 (in ms).
42 ACTION_T_SET_DEATH_PREVENTION State 0-off/1-on
43 ACTION_T_MOUNT_TO_ENTRY_OR_MODEL CreatureEntry, ModelId Set mount model from creature_template.entry (Param1) OR explicit modelId (Param2). If (Param1) AND (Param2) are both 0, unmount.
44 ACTION_T_CHANCED_TEXT Chance, -TextId1, -TextId2 Deprecated use 54 - Displays by Chance (1..100) the specified -TextId. When -TextId2 is specified, the selection will be randomized. Text types are defined, along with other options for the text, in a table below. Param2 and Param3 needs to be negative.
45 ACTION_T_THROW_AI_EVENT EventType, Radius, Target Throws an AIEvent of type (Param1) to nearby friendly Npcs in range of (Param2), Invoker of event is Target
46 ACTION_T_SET_THROW_MASK EventTypeMask Marks for which AIEvents the npc will throw AIEvents on its own.
47 ACTION_T_SET_STAND_STATE StandState Set the unit stand state (Param1) of the current creature.
48 ACTION_T_CHANGE_MOVEMENT MovementType, WanderDistance Change the unit movement type (Param1). If the movement type is Random Movement (1), the WanderDistance (Param2) must be provided. If the movement type is Waypoint Movement (2), Param2 is PathId. Param3 is asDefault.
49 ACTION_T_REUSE
50 ACTION_T_SET_REACT_STATE ReactState Change react state of the creature
51 ACTION_T_PAUSE_WAYPOINTS DoPause Pause waypoints of creature
52 ACTION_T_INTERRUPT_SPELL SpellType - CurrentSpellTypes Interrupt spell in given slot for creature
53 ACTION_T_START_RELAY_SCRIPT RelayIDorTemplate, Target Launches dbscripts_on_relay script, either static one, or when param1 is < 0 then random one chosen from dbscript_random_templates
54 ACTION_T_TEXT_NEW TextId, Target, TemplateId Displays text, either static one or when param3 != 0, then random one chosen from dbscript_random_templates
55 ACTION_T_ATTACK_START Target Attacks targeted creature
56 ACTION_T_DESPAWN_GUARDIANS EntryId Despawns guardian with specified entry, or if 0 despawns all guardians
57 ACTION_T_SET_RANGED_MODE RangeModeType,chaseDistance Enables RangeModeType AI (0 off, 1 = caster, 2 = hunter), distance to chase at
58 ACTION_T_SET_WALK WalkSetting Enables Walk (0 off, 1 on) or enables chase walk (2 off, 3 on)
59 ACTION_T_SET_FACING Target, Reset Set 0, Reset 1
60 ACTION_T_SET_SPELL_SET SetId Set for possess
61 ACTION_T_SET_IMMOBILIZED_STATE Apply, CombatOnly CombatOnly is autoremoved on combat stop (death, evade, despawn)
62 ACTION_T_SET_DESPAWN_AGGREGATION Mask, Entry1, Entry2 Enable aggregation of guids for despawn on event (death, evade). To be used mostly on spawn.
63 ACTION_T_SET_IMMUNITY_SET SetId Immunity Set ID - creature_immunities
* = 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).
==============================================
Event Types: Expanded and Detailed Information
==============================================
Note:
COMBAT ONLY - Means that this event will only trigger durring combat.
OUT OF COMBAT ONLY - Means that this event will only trigger while out of combat.
BOTH - This event can trigger both in and out of combat.
Events that do not have lables on them are events that are directly involved with the in and out of combat state.
------------------
0 = EVENT_T_TIMER_IN_COMBAT:
------------------
Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire
Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
COMBAT ONLY - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
This is commonly used for spells that repeat cast during combat (Simulates Spell Cooldown).
----------------------
1 = EVENT_T_TIMER_OOC:
----------------------
Parameter 1: InitialMin - Minimum Time used to calculate Random Initial Event Expire
Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Event Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Event Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Event Expire
OUT OF COMBAT ONLY (Not while evading) - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
This is commonly used for events that occur and repeat outside of combat like random NPC Say or Random Emotes.
---------------
2 = EVENT_T_HP:
---------------
Parameter 1: HPMax% - Maximum HP% That will trigger this Event to Expire
Parameter 2: HPMin% - Minimum HP% That will trigger this Event to Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Event Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Event Expire
COMBAT ONLY - Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
This is commonly used for events that occur at a specific HP% Range (Such as Heal/Enrage Spells or NPC's that Flee).
NOTE: For Repeat Events the Repeat Timer ONLY Re-Check's Event Conditions to see If HP% Is Between Max and Min. If it is then Event will Expire again.
-----------------
3 = EVENT_T_MANA:
-----------------
Parameter 1: ManaMax% - Maximum Mana% That will trigger this Event to Expire
Parameter 2: ManaMin% - Minimum Mana% That will trigger this Event to Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Event Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Event Expire
COMBAT ONLY - Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
This is commonly used for events where an NPC low on Mana will do something (Such as stop casting spells and switch to melee).
------------------
4 = EVENT_T_AGGRO:
------------------
COMBAT ONLY - This Event Expires upon Initial Aggro (This Event does not occur again until NPC either Evades/Respawns and then Enters Combat Again).
-----------------
5 = EVENT_T_KILL:
-----------------
Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Event Expire
Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Event Expire
Parameter 3: PlayerOnly - Setting it to 1 will cause event only to trigger if the triggerer is a player.
COMBAT ONLY - Expires upon killing a unit. Will repeat every (Param1) and (Param2).
This Event Expires upon killing a player. It is commonly used for NPC's who yell or do something after killing a unit. Normally using a short repeating timer is advisable.
NOTE: For Repeat Events the Repeat Timer ONLY Re-Check's Event Conditions to see If another Kill has occured. So After Repeat Min/Max Kill Event can occur again.
------------------
6 = EVENT_T_DEATH:
------------------
Parameter 1: ConditionId - condition from Conditions table
BOTH - This Event Expires upon Death of the Scripted NPC. This is normally only used in combat though.
This is commonly used for NPC's who have a Yell or Spell Cast when they Die.
------------------
7 = EVENT_T_EVADE:
------------------
COMBAT ONLY - This Event Expires when the Scripted NPC Evades Combat (EnterEvadeMode).
This is commonly used for NPC's who use phases, allows you to reset their phase to 0 on evade to prevent possible strange behavior on Re-Aggro.
---------------------
8 = EVENT_T_SPELLHIT:
---------------------
Parameter 1: SpellID - The Spell ID that will trigger the Event to occur (NOTE: If you use Spell School as the trigger ALWAYS set this value to 0)
Parameter 2: School - Spell School to trigger the Event (NOTE: If you use a SpellID then ALWAYS set this value to -1) - *See Below for Spell School Bitmask Values*
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Event Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Event Expire
BOTH - Expires on Spellhit. If (param1) is set it will only expire on that SPECIFIC Spell OR If (param2) is set it will only expire on Spells of that School. Will repeat every (Param3) and (Param4).
This Event is commonly used for NPC's who can do special things when you cast a spell (Or specific spell) on them.
NOTE: For Repeat Events the Repeat Timer ONLY Re-Check's Event Conditions to see If another Spellhit has occured. So After Repeat Min/Max expires Spellhit Event can occur again.
(Name ==> School ==> School Bitmask Values)
-------------------------------------------
SPELL_SCHOOL_NORMAL = 0 ==> 1
SPELL_SCHOOL_HOLY = 1 ==> 2
SPELL_SCHOOL_FIRE = 2 ==> 4
SPELL_SCHOOL_NATURE = 3 ==> 8
SPELL_SCHOOL_FROST = 4 ==> 16
SPELL_SCHOOL_SHADOW = 5 ==> 32
SPELL_SCHOOL_ARCANE = 6 ==> 64
Use These Bitmask Values For Schoolmask (Param2) or Any Combinations Of These School Bitmasks for Multiple Schools.
------------------
9 = EVENT_T_RANGE:
------------------
Parameter 1: MinDist - This Distance is the Minimum Distance between the NPC and its target to allow this Event to Expire
Parameter 2: MaxDist - This Distance is the Maximum Distance between the NPC and its target to allow this Event to Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Event Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Event Expire
COMBAT ONLY - Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4).
This Event is commonly used for NPC's who have Ranged Combat and will Throw/Shoot between a certain distance.
---------------------
10 = EVENT_T_OOC_LOS:
---------------------
Parameter 1: NoHostile - This will expire if Unit are hostile. If Param1=1 it will only expire if Unit are not Hostile(generally determined by faction)
Parameter 2: MaxAllowedRange - Expires when a Unit moves within this distance to creature
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
Parameter 5: PlayerOnly - Expires only when a Player moves within distance
Parameter 6: ConditionId - Expires only when condition is fulfilled. Only use when other options are not usable since it is a bit more impactful performance wise!!!
OUT OF COMBAT ONLY
This Event is commonly used for NPC's who do something or say something to you when you walk past them Out of Combat.
---------------------
11 = EVENT_T_SPAWNED:
---------------------
Expires at initial spawn and at creature respawn.
This Event is commonly used for setting ranged movement type or Summoning a Pet on Spawn
Parameter 1: 0: works always, 1: works on map in Parameter 2, 2: works on zone/subzone in Parameter 2
Parameter 2: depends on Parameter 1: for 1 it is map ID, for 2 it is area ID to check
BOTH - Expires in or out of combat when the NPC Spawns
This Event is commonly used for NPC's who cast a spell or do something special when they spawn. This event is not repeatable so it is a one time event on Spawn.
-----------------------
12 = EVENT_T_TARGET_HP:
-----------------------
Parameter 1: HPMax% - Maximum HP% That this Event will Expire
Parameter 2: HPMin% - Minimum HP% That this Event will Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
COMBAT ONLY - Expires when Current NPC's Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
This Event is commonly used for NPC's who have a special ability (Like Execute) that only casts when a Player HP is low.
----------------------------
13 = EVENT_T_TARGET_CASTING:
----------------------------
Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire
COMBAT ONLY - Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2).
This event is commonly used for NPC's who will cast a counter spell when their target starts to cast a spell.
-------------------------
14 = EVENT_T_FRIENDLY_HP:
-------------------------
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)
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.
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
COMBAT ONLY - Expires when a friendly unit in radius(param2) has at least (param1) hp missing. Will repeat every (Param3) and (Param4).
This is commonly used when an NPC in Combat will heal a nearby Friendly NPC in Combat with a Heal/Renew Spell.
----------------------------
15 = EVENT_T_FRIENDLY_IS_CC:
----------------------------
Parameter 1: DispelType - Dispel Type to trigger the event - *See Below for Dispel Bitmask Values*
Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies being Crowd Controlled
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
COMBAT ONLY - Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4).
This is commonly used for NPC's who can come to the resule of other Friendly NPC's if being Crowd Controlled
-----------------------------------
16 = EVENT_T_FRIENDLY_MISSING_BUFF:
-----------------------------------
Parameter 1: SpellId - This is the SpellID That the Aura Check will look for (If it is missing this Aura)
Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Friendlies (Faction is Friendly To) for the missing Aura.
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
Parameter 5: InCombat - 0 - Only in combat. 1 - Anytime. 2 - Only out of combat.
BOTH - Expires when a friendly unit is missing aura's given by spell (param1) within radius (param2). Will repeat every (Param3) and (Param4).
This is commonly used for NPC's who watch friendly units for a debuff to end so they can recast it on them again.
---------------------------
17 = EVENT_T_SUMMONED_UNIT:
---------------------------
Parameter 1: CreatureId - The CreatureID that the NPC is watching to spawn to trigger this event
Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire
BOTH - Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
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.
---------------------------
18 = EVENT_T_TARGET_MANA:
---------------------------
Parameter 1: ManaMax% - Maximum Mana% That will trigger this Event to Expire
Parameter 2: ManaMin% - Minimum Mana% That will trigger this Event to Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
COMBAT ONLY - Expires once Mana% of current target is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
---------------------------
21 = EVENT_T_REACHED_HOME:
---------------------------
OUT OF COMBAT ONLY - Expires only when creature has returned to it's home location after Evade.
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.
---------------------------
22 = EVENT_T_RECEIVE_EMOTE:
---------------------------
Parameter 1: EmoteId - Valid text emote ID from Mangos source (SharedDefines.h - enum TextEmotes)
Parameter 2: ConditionId- Condition from table conditions
BOTH - Expires only when creature receive emote from player. Valid text emote id's are in Mangos source (SharedDefines.h - enum TextEmotes)
Event does not require any conditions to process, however many are expected to have condition.
---------------------------
23 = EVENT_T_AURA :
---------------------------
Parameter 1: SpellId - This is the SpellID That the Aura Check will look for
Parameter 2: Amount - This is the amount of SpellID's auras at creature required for event expire.
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
BOTH - 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) If Event Conditions Are Still Met.
---------------------------
24 = EVENT_T_TARGET_AURA:
---------------------------
Parameter 1: SpellId - This is the SpellID That the Aura Check will look for
Parameter 2: Amount - This is the amount of SpellID's auras at target unit required for event expire.
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
COMBAT ONLY - 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) If Event Conditions Are Still Met.
--------------------------------
25 = EVENT_T_SUMMONED_JUST_DIED:
--------------------------------
Parameter 1: CreatureId - The CreatureID that the NPC is watching die to trigger this event
Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire
BOTH - Expires after creature with entry(Param1) is die or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
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.
-----------------------------------
26 = EVENT_T_SUMMONED_JUST_DESPAWN:
-----------------------------------
Parameter 1: CreatureId - The CreatureID that the NPC is watching despawn to trigger this event
Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire
BOTH - Expires before creature with entry(Param1) is despawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) .
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.
NOTE: Called before despawn happens, so summoned creature is still in world at expire moment.
--------------------------
27 = EVENT_T_MISSING_BUFF:
--------------------------
Parameter 1: SpellId - This is the SpellID That the Aura Check will look for to be missing
Parameter 2: Amount - This is the amount or less of SpellID's auras at creature required for event expire.
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
BOTH - Expires when a creature not has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4).
---------------------------------
28 = EVENT_T_TARGET_MISSING_AURA:
---------------------------------
Parameter 1: SpellId - This is the SpellID That the Aura Check will look for to be missing
Parameter 2: Amount - This is the amount or less of SpellID's auras at creature required for event expire.
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
COMBAT ONLY - Expires when a target unit not has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4).
---------------------------
29 = EVENT_T_TIMER_GENERIC:
---------------------------
Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire
Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire
BOTH - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on.
------------------------------
30 = EVENT_T_RECEIVE_AI_EVENT:
------------------------------
Parameter 1: AIEventType - Only expire when an AIEvent of this type is received. Supported types see CreatureAI.h enum AIEventType
Parameter 2: Sender-Entry - If != 0 then only expire when the AIEvent is received from a creature of this entry
BOTH - Expires when the creature receives an AIEvent of type (Param1), sent by creature (Param2 != 0). If (Param2 = 0) then sent by any creature.
Note: This is the only EVENT where the target-type TARGET_T_EVENT_SENDER (10) is defined
-----------------
31 = EVENT_T_ENERGY:
-----------------
Parameter 1: EnergyMax% - Maximum Energy% That will trigger this Event to Expire
Parameter 2: EnergyMin% - Minimum Energy% That will trigger this Event to Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Event Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Event Expire
COMBAT ONLY - Expires once Energy% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4).
This is commonly used for events where an NPC low on Energy will do something (Such as stop casting spells and switch to melee).
-------------------------------------
32 = EVENT_T_SELECT_ATTACKING_TARGET:
-------------------------------------
Parameter 1: MinDist - This Distance is the Minimum Distance between the NPC and any hostile target to allow this Event to Expire
Parameter 2: MaxDist - This Distance is the Maximum Distance between the NPC and any hostile target to allow this Event to Expire
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Event Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Event Expire
COMBAT ONLY - Expires when a random hostile target is found in a distance greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4).
Note: This event will fill TARGET_T_EVENT_SPECIFIC with the target found
Deprecated - Issue with timers expiring when cast did not succeed is solved now and no need for this event
---------------------------
33 = EVENT_T_FACING_TARGET:
---------------------------
Parameter 1: BackOrFront - Define is the NPC must be in back (Parameter 1=0) or in front (Parameter 1=1) or its current target.
Parameter 2: Unused
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Event Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Event Expire
COMBAT ONLY - Expires when the NPC is facing the back (or front) of its current target. Will repeat every (Param3) and (Param4).
This is commonly used for events where a NPC needs to use abilities available only when facing its target's back/front (Such as rogues' backstab ability).
---------------------
34 = EVENT_T_SPELLHIT_TARGET:
---------------------
Parameter 1: SpellID - The Spell ID that will trigger the Event to occur (NOTE: If you use Spell School as the trigger ALWAYS set this value to 0)
Parameter 2: School - Spell School to trigger the Event (NOTE: If you use a SpellID then ALWAYS set this value to -1) - *See Below for Spell School Bitmask Values*
Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Event Expire
Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Event Expire
BOTH - Expires on SpellhitTarget. If (param1) is set it will only expire on that SPECIFIC Spell OR If (param2) is set it will only expire on Spells of that School. Will repeat every (Param3) and (Param4).
This Event is commonly used for NPC's who can do special things when you cast a spell (Or specific spell) on them.
NOTE: For Repeat Events the Repeat Timer ONLY Re-Check's Event Conditions to see If another Spellhit has occured. So After Repeat Min/Max expires Spellhit Event can occur again.
-----------------------------
35 = EVENT_T_DEATH_PREVENTED:
-----------------------------
Expires when death prevention kicks in. It expires once, and then death prevention has to be reset for it to happen again.
---------------------------------
36 = EVENT_T_TARGET_NOT_REACHABLE
---------------------------------
Expires when main aggro target is not reachable by ChaseMovementGenerator - example of usage is teleporting player to creature
(Name ==> School ==> School Bitmask Values)
-------------------------------------------
SPELL_SCHOOL_NORMAL = 0 ==> 1
SPELL_SCHOOL_HOLY = 1 ==> 2
SPELL_SCHOOL_FIRE = 2 ==> 4
SPELL_SCHOOL_NATURE = 3 ==> 8
SPELL_SCHOOL_FROST = 4 ==> 16
SPELL_SCHOOL_SHADOW = 5 ==> 32
SPELL_SCHOOL_ARCANE = 6 ==> 64
Use These Bitmask Values For Schoolmask (Param2) or Any Combinations Of These School Bitmasks for Multiple Schools.
=========================================
Action Types
=========================================
------------------
1 = ACTION_T_TEXT:
------------------
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).
Entry are required to be negative and exist in a *_texts-table. The type text to be displayed are defined in the texts-table itself (Say, Yell, Whisper, Emote Text, Boss Whisper, Boss Emote)
Other options are also to be defined in the texts-table, such as a sound to be heard with the text and the language used in output (common, dwarvish, etc).
In case this entry has a localized version of the text, the localized text will be displayed in client that support this locale.
Parameter 2: Optional. TextId can be defined in addition. The same apply to this as explained above, however eventAI will randomize between the two.
Parameter 3: Optional, if Parameter 2 exist. In this case, eventAI will randomize between three.
Read at bottom for documentation of creature_ai_texts-table.
-------------------------
2 = ACTION_T_SET_FACTION:
-------------------------
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.
Parameter 2: When Parameter 1 is not 0, flags can be used to restore default faction at certain events. Current supported, from enum TemporaryFactionFlags:
TEMPFACTION_NONE = 0x00, // A persistent faction change and will require manual change to default/another faction when changed once
TEMPFACTION_RESTORE_RESPAWN = 0x01, // Default faction will be restored at respawn
TEMPFACTION_RESTORE_COMBAT_STOP = 0x02, // ... at CombatStop() (happens at creature death, at evade or custom scripte among others)
TEMPFACTION_RESTORE_REACH_HOME = 0x04, // ... at reaching home in home movement (evade), if not already done at CombatStop()
-------------------------------------
3 = ACTION_T_MORPH_TO_ENTRY_OR_MODEL:
-------------------------------------
Parameter 1: Creature entry from creature_template. Action will then change to the model this creature are using.
Parameter 2: If parameter 1 is 0, then this modelId will be used (in case parameter 1 exist, parameter 2 will not be used)
If both parameter 1 and 2 is 0, the creature will DeMorph, and use it's default model.
-------------------
4 = ACTION_T_SOUND:
-------------------
Parameter 1: The Sound ID to be played. (Sound IDs are contained in the DBC files.)
The creature will play the specified sound.
This is commonly used for Bosses who Yell and then also have a Voice for the same thing.
-------------------
5 = ACTION_T_EMOTE:
-------------------
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).
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.
This is commonly used for NPC's who may perform a special action (Salute, Roar, ect...). Not all player emotes work for creature models.
------------------------
6 = ACTION_T_RANDOM_SAY:
------------------------
UNUSED Can be reused to create new action type
-------------------------
7 = ACTION_T_RANDOM_YELL:
-------------------------
UNUSED Can be reused to create new action type
------------------------------
8 = ACTION_T_RANDOM_TEXTEMOTE:
------------------------------
UNUSED Can be reused to create new action type
--------------------------
9 = ACTION_T_RANDOM_SOUND:
--------------------------
Parameter 1: The Sound ID to be played as Random Choice #1.
Parameter 2: The Sound ID to be played as Random Choice #2.
Parameter 3: The Sound ID to be played as Random Choice #3.
Similar to the ACTION_T_SOUND action, it will choose at random a sound to play.
---------------------------
10 = ACTION_T_RANDOM_EMOTE:
---------------------------
Parameter 1: The Emote ID to be played as Random Choice #1.
Parameter 2: The Emote ID to be played as Random Choice #2.
Parameter 3: The Emote ID to be played as Random Choice #3.
Similar to the ACTION_T_EMOTE action, it will choose at random an Emote to Visually Perform.
-------------------
11 = ACTION_T_CAST:
-------------------
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.
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.
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.
The creature will cast a spell specified by a spell ID on a target specified by the target type.
If the spell is normal cast, random target types will select only targets within LOS and in spell range
This is commonly used for NPC's who cast spells.
---------------------
12 = ACTION_T_SPAWN:
---------------------
Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID.
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.
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.
The NPC will Summon another cast flag 0 will work for you treature at the same spot as itself that will attack the specified target.
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.
NOTE: Using Target Type 0 will cause the Summoned creature to not attack anyone.
NOTE: If Duration is set at 0, then the summoned creature will not despawn until it has died.
This is used as a manual way to force an NPC to Summon.
NOTE: THIS ONLY WORKS IN COMBAT
--------------------------------
13 = ACTION_T_THREAT_SINGLE:
--------------------------------
Parameter 1: Threat - Threat value that should be used for modification.
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.
Parameter 3: IsDirect - If set to 0, threat value is used as percentage. When set to 1, the value is directly added to given target.
This action will modify the threat of a target in the creature's threat list by the specified amount.
This is commonly used to allow an NPC to adjust the Threat to a single player, either for spells which reduce by percentage or static amounts on spawn.
-----------------------------
14 = ACTION_T_THREAT_ALL_PCT:
-----------------------------
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.
This action will modify the threat for everyone in the creature's threat list by the specified percent.
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.
This is commonly used to allow an NPC to drop threat for all players to zero.
--------------------------
15 = ACTION_T_QUEST_EVENT:
--------------------------
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.
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.
Parameter 3: RewardGroup - Used to decide if entire group should be rewarded (1 = entire group, 0 = single target)
This action will satisfy the external completion requirement for the quest for the specified target defined by the target type.
NOTE: This action can only be used with player targets so it must be ensured that the target type will point to a player.
This is commonly used for Quests where only ONE player will gain credit for the quest.
-----------------------------
16 = ACTION_T_CASTCREATUREGO:
-----------------------------
Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID.
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.
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.
This action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature.
This is commonly used for NPC's who have a special requirement to have a Spell cast on them to complete a quest.
-----------------------------
17 = ACTION_T_SET_UNIT_FIELD:
-----------------------------
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.
Parameter 2: Value - The new value to be put in the field.
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.
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)
----------------------------
18 = ACTION_T_SET_UNIT_FLAG:
----------------------------
Parameter 1: Flags - The flag(s) to be set. Multiple flags can be set by using bitwise-OR on them (adding them together).
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.
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.
-------------------------------
19 = ACTION_T_REMOVE_UNIT_FLAG:
-------------------------------
Parameter 1: Flags - The flag(s) to be removed. Multiple flags can be set by using bitwise-OR on them (adding them together).
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.
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.
--------------------------
20 = ACTION_T_AUTO_ATTACK:
--------------------------
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.
This action controls whether or not the creature should stop or start the auto melee attack.
NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values (0 = Stop Melee, 1 = Start Melee).
This is commonly used in combination with EVENT_T_RANGE and ACTION_T_COMBAT_MOVEMENT for Ranged Combat for Mages and Spell Casters.
------------------------------
21 = ACTION_T_COMBAT_MOVEMENT:
------------------------------
Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before.
Parameter 2: If non-zero, then stop melee combat state (if param1=0) or start melee combat state (if param1!=0) and creature in combat with selected target.
This action controls whether or not the creature will always move towards its target.
NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values. (0 = Stop Movement, 1 = Start Movement)
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)
Parameter 2 specialy used for ranged combat proper client side visual show ranged weapon in proper state.
------------------------
22 = ACTION_T_SET_PHASE:
------------------------
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.
When activated, this action sets the creature's event to the specified value.
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.
NOTE: The value used for the Param is the actual Phase Number (Not The Event_Inverse_Phase_Mask)
This is commonly used for complex scripts with several phases and you need to switch to a different phase.
------------------------
23 = ACTION_T_INC_PHASE:
------------------------
Parameter 1: Value - The number of phases to increase or decrease. Use negative values to decrease the current phase.
When activated, this action will increase (or decrease) the current creature's phase.
NOTE: After increasing or decreasing the phase by this action, the current phase must NOT be lower than 0 or exceed 31.
This can be used instead of ACTION_T_SET_PHASE to change phases in scripts. Just a user friendly option for changing phases.
--------------------
24 = ACTION_T_EVADE:
--------------------
When activated, the creature will immediately exit out of combat, clear its threat list, and move back to its spawn point. Basically, this action will reset the whole encounter.
Parameter 1: CombatOnly - of true (1) only cancels combat and does not move home. Warning: only use this if sniff verifies to drop combat. Many cases do not.
-------------------
25 = ACTION_T_FLEE:
-------------------
When activated, the creature will flee from combat for assistance from nearby NPC's if possible.
NOTE: All Param Values Are 0 for this Action.
------------------------------
26 = ACTION_T_QUEST_EVENT_ALL:
------------------------------
Parameter 1: QuestId - The quest ID to finish for everyone.
Parameter 2: UseThreatList - Bool. If set to 1 (true), it will complete the QuestId for all the players in the threat list. If set to 0 (false), it will use the action invoker.
This action does the same thing as the ACTION_T_QUEST_EVENT does but it does it for all players in the creature's threat list.
NOTE: If a player is not in the NPC's threat list for whatever reason, he/she won't get the quest completed.
---------------------------------
27 = ACTION_T_CASTCREATUREGO_ALL:
---------------------------------
Parameter 1: QuestId - The quest template ID.
Parameter 2: SpellId - The spell ID used to simulate the cast.
This action does the same thing as the ACTION_T_CASTCREATUREGO does but it does it for all players in the creature's threat list.
NOTE: If a player is not in its threat list for whatever reason, he/she won't receive the cast emulation.
-----------------------------------
28 = ACTION_T_REMOVEAURASFROMSPELL:
-----------------------------------
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.
Parameter 2: SpellId - The spell ID whose auras will be removed.
This action will remove all auras from a specific spell from the target.
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)
------------------------------
29 = ACTION_T_RANGED_MOVEMENT:
------------------------------
Parameter 1: Distance - The distance the mob should keep between it and its target.
Parameter 2: Angle - The angle the mob should use.
This action changes the movement type generator to ranged type using the specified values for angle and distance.
NOTE: Specifying zero angle and distance will make it just melee instead.
This is commonly used for NPC's who always attack at range and you can specify the distance they will maintain from the target.
---------------------------
30 = ACTION_T_RANDOM_PHASE:
---------------------------
Parameter 1: PhaseId1 - A possible random phase choice.
Parameter 2: PhaseId2 - A possible random phase choice.
Parameter 3: PhaseId3 - A possible random phase choice.
Randomly sets the phase to one from the three parameter choices.
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)
NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE.
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.
---------------------------------
31 = ACTION_T_RANDOM_PHASE_RANGE:
---------------------------------
Parameter 1: PhaseMin - The minimum of the phase range.
Parameter 2: PhaseMax - The maximum of the phase range. The number here must be greater than PhaseMin.
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).
NOTE: PhaseMax must be greater than PhaseMin.
NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE.
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.
---------------------
32 = ACTION_T_SUMMON_ID:
---------------------
Parameter 1: CreatureID - The creature template ID to be summoned. The value here needs to be a valid creature template ID.
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.
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.
Summons creature (param1) to attack target (param2) at location specified by creature_ai_summons (param3).
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.
This is commonly used for NPC's who need to Summon a creature at a specific location. (Normally used for complex events)
-----------------------------
33 = ACTION_T_KILLED_MONSTER:
-----------------------------
Parameter 1: CreatureID - The creature template ID. The value here must be a valid creature template ID.
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.
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).
NOTE: It can be ANY creature including certain quest specific triggers
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)
----------------------------
34 = ACTION_T_SET_INST_DATA:
----------------------------
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.
Parameter 2: Data - The value to put at that field index.
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.
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.
Field Values:
These are located in there SD2 Instance File (Example: blackrock_depths.h) And Are Clearly Defined For Specific Events Scripted In The Instance.
Data Values:
NOT_STARTED = 0
IN_PROGRESS = 1
FAIL = 2
DONE = 3
SPECIAL = 4
------------------------------
35 = ACTION_T_SET_INST_DATA64:
------------------------------
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.
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.
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.
Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID.
------------------------------
36 = ACTION_T_UPDATE_TEMPLATE:
------------------------------
Parameter 1: TemplateId - The creature template ID. The value here must be a valid creature template ID.
Parameter 2: Team - Use model_id from team : Alliance(0) or Horde (1).
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.
Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true
------------------
37 = ACTION_T_DIE:
------------------
Kills the creature
This is commonly used if you need to Instakill the creature for one reason or another.
--------------------------------
38 = ACTION_T_ZONE_COMBAT_PULSE:
--------------------------------
Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances.
----------------------------
39 = ACTION_T_CALL_FOR_HELP:
----------------------------
Parameter 1: Radius - All friendly (not only same faction) creatures will go to help
Call any friendly creatures (if its not in combat/etc) in radius attack creature target.
Mostly used when call to help more wide that normal aggro radius or auto-used call for assistance, and need apply at some event.
-------------------------
40 ACTION_T_SET_SHEATH:
-------------------------
Parameter 1: Set Sheath State
0 = SHEATH_STATE_UNARMED Set No Weapon Displayed (Not Usually Used By Creatures)
1 = SHEATH_STATE_MELEE Set Melee Weapon Displayed
2 = SHEATH_STATE_RANGED Set Ranged Weapon Displayed
Set Sheath State For NPC.
Note: SHEATH_STATE_RANGED case work in combat state only if combat not start as melee commands.
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)
----------------------------
41 ACTION_T_FORCE_DESPAWN:
----------------------------
Despawns The NPC with optional delay time (Works In or Out of Combat)
Parameter 1: Delay - Sets delay time until Despawn occurs after triggering the action. Time is in (ms).
-----------------------------------------
42 ACTION_T_SET_DEATH_PREVENTION:
-----------------------------------------
Parameter 1: State for death prevention
0 = Turns off death prevention
1 = Turns on death prevention and resets triggering of death prevented
-----------------------------------------
43 ACTION_T_MOUNT_TO_ENTRY_OR_MODEL:
-----------------------------------------
Parameter 1, Optional: Set mount model from creature_template.entry
Parameter 2, Optional: Set mount model by explicit modelId
If (Param1) AND (Param2) are both 0, unmount.
---------------------------
44 = ACTION_T_CHANCED_TEXT:
---------------------------
Parameter 1: Chance with which a text will be displayed (must be between 1 and 99)
Parameter 2: 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).
Entry are required to be negative and exist in a *_texts-table. The type text to be displayed are defined in the texts-table itself (Say, Yell, Whisper, Emote Text, Boss Whisper, Boss Emote)
Other options are also to be defined in the texts-table, such as a sound to be heard with the text and the language used in output (common, dwarvish, etc).
In case this entry has a localized version of the text, the localized text will be displayed in client that support this locale.
Parameter 3: Optional TextId can be defined in addition. The same apply to this as explained above, however eventAI will randomize between the two.
Also remark that the chance also depends on the chance of the event. And remark that a chance of 100 is useless and in this case ACTION_T_TEXT should be used.
Read at bottom for documentation of creature_ai_texts-table.
-----------------------------
45 = ACTION_T_THROW_AI_EVENT:
-----------------------------
Parameter 1: EventType - What AIEvent to throw, supported types see CreatureAI.h enum AIEventType
Currently supported are:
AI_EVENT_JUST_DIED = 0, // Sender = Killed Npc, Invoker = Killer
AI_EVENT_CRITICAL_HEALTH = 1, // Sender = Hurt Npc, Invoker = DamageDealer - Expected to be sent by 10% health
AI_EVENT_LOST_HEALTH = 2, // Sender = Hurt Npc, Invoker = DamageDealer - Expected to be sent by 50% health
AI_EVENT_LOST_SOME_HEALTH = 3, // Sender = Hurt Npc, Invoker = DamageDealer - Expected to be sent by 90% health
AI_EVENT_GOT_FULL_HEALTH = 4, // Sender = Healed Npc, Invoker = Healer
AI_EVENT_CUSTOM_EVENTAI_A = 5, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
AI_EVENT_CUSTOM_EVENTAI_B = 6, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
AI_EVENT_GOT_CCED = 7, // Sender = CCed Npc, Invoker = Caster that CCed
AI_EVENT_CUSTOM_EVENTAI_C = 8, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
AI_EVENT_CUSTOM_EVENTAI_D = 9, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
AI_EVENT_CUSTOM_EVENTAI_E = 10, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
AI_EVENT_CUSTOM_EVENTAI_F = 11, // Sender = Npc that throws custom event, Invoker = TARGET_T_ACTION_INVOKER (if exists)
Parameter 2: Radius - Throw the AIEvent to nearby friendly creatures within this range
Parameter 3: Target - The thrown AIEvent uses selected target as Invoker
Each event, be it C++ or DB has 3 parties, Sender, Receiver and Invoker. Sender is EAI creature owner, Receiver is creatures found in radius, and Invoker is the one who triggered the event. Invoker can be specified
regardless of Sender/Receiver and this enables relaying target.
-----------------------------