TrinityCore
SmartScriptMgr.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRINITY_SMARTSCRIPTMGR_H
19#define TRINITY_SMARTSCRIPTMGR_H
20
21#include "DBCEnums.h"
22#include "Define.h"
23#include "ObjectGuid.h"
24#include "WaypointDefines.h"
25#include "advstd.h"
26#include <limits>
27#include <map>
28#include <string>
29#include <unordered_map>
30
31class WorldObject;
32enum SpellEffIndex : uint8;
34
36{
42 SMART_ESCORT_TARGETS = 0xFFFFFF
43};
44
46{
61
63};
64
66{
83};
84
86{
99};
100
102{
103 SMART_EVENT_UPDATE_IC = 0, // InitialMin, InitialMax, RepeatMin, RepeatMax
104 SMART_EVENT_UPDATE_OOC = 1, // InitialMin, InitialMax, RepeatMin, RepeatMax
105 SMART_EVENT_HEALTH_PCT = 2, // HPMin%, HPMax%, RepeatMin, RepeatMax
106 SMART_EVENT_MANA_PCT = 3, // ManaMin%, ManaMax%, RepeatMin, RepeatMax
107 SMART_EVENT_AGGRO = 4, // NONE
108 SMART_EVENT_KILL = 5, // CooldownMin0, CooldownMax1, playerOnly2, else creature entry3
109 SMART_EVENT_DEATH = 6, // NONE
110 SMART_EVENT_EVADE = 7, // NONE
111 SMART_EVENT_SPELLHIT = 8, // SpellID, School, CooldownMin, CooldownMax
112 SMART_EVENT_RANGE = 9, // MinDist, MaxDist, RepeatMin, RepeatMax
113 SMART_EVENT_OOC_LOS = 10, // HostilityMode, MaxRnage, CooldownMin, CooldownMax
114 SMART_EVENT_RESPAWN = 11, // type, MapId, ZoneId
115 SMART_EVENT_TARGET_HEALTH_PCT = 12, // UNUSED, DO NOT REUSE
116 SMART_EVENT_VICTIM_CASTING = 13, // RepeatMin, RepeatMax, spellid
117 SMART_EVENT_FRIENDLY_HEALTH = 14, // UNUSED, DO NOT REUSE
118 SMART_EVENT_FRIENDLY_IS_CC = 15, // Radius, RepeatMin, RepeatMax
119 SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax
120 SMART_EVENT_SUMMONED_UNIT = 17, // CreatureId(0 all), CooldownMin, CooldownMax
121 SMART_EVENT_TARGET_MANA_PCT = 18, // UNUSED, DO NOT REUSE
122 SMART_EVENT_ACCEPTED_QUEST = 19, // QuestID (0 = any), CooldownMin, CooldownMax
123 SMART_EVENT_REWARD_QUEST = 20, // QuestID (0 = any), CooldownMin, CooldownMax
125 SMART_EVENT_RECEIVE_EMOTE = 22, // EmoteId, CooldownMin, CooldownMax, condition, val1, val2, val3
126 SMART_EVENT_HAS_AURA = 23, // Param1 = SpellID, Param2 = Stack amount, Param3/4 RepeatMin, RepeatMax
127 SMART_EVENT_TARGET_BUFFED = 24, // Param1 = SpellID, Param2 = Stack amount, Param3/4 RepeatMin, RepeatMax
128 SMART_EVENT_RESET = 25, // Called after combat, when the creature respawn and spawn.
129 SMART_EVENT_IC_LOS = 26, // HostilityMode, MaxRnage, CooldownMin, CooldownMax
130 SMART_EVENT_PASSENGER_BOARDED = 27, // CooldownMin, CooldownMax
131 SMART_EVENT_PASSENGER_REMOVED = 28, // CooldownMin, CooldownMax
132 SMART_EVENT_CHARMED = 29, // onRemove (0 - on apply, 1 - on remove)
133 SMART_EVENT_CHARMED_TARGET = 30, // UNUSED, DO NOT REUSE
134 SMART_EVENT_SPELLHIT_TARGET = 31, // SpellID, School, CooldownMin, CooldownMax
135 SMART_EVENT_DAMAGED = 32, // MinDmg, MaxDmg, CooldownMin, CooldownMax
136 SMART_EVENT_DAMAGED_TARGET = 33, // MinDmg, MaxDmg, CooldownMin, CooldownMax
137 SMART_EVENT_MOVEMENTINFORM = 34, // MovementType(any), PointID
138 SMART_EVENT_SUMMON_DESPAWNED = 35, // Entry, CooldownMin, CooldownMax
141 SMART_EVENT_DATA_SET = 38, // Id, Value, CooldownMin, CooldownMax
142 SMART_EVENT_WAYPOINT_START = 39, // UNUSED, DO NOT REUSE
143 SMART_EVENT_WAYPOINT_REACHED = 40, // PointId(0any), pathID(0any)
148 SMART_EVENT_INSTANCE_PLAYER_ENTER = 45, // Team (0 any), CooldownMin, CooldownMax
149 SMART_EVENT_AREATRIGGER_ONTRIGGER = 46, // TriggerId(0 any)
155 SMART_EVENT_TEXT_OVER = 52, // GroupId from creature_text, creature entry who talks (0 any)
156 SMART_EVENT_RECEIVE_HEAL = 53, // MinHeal, MaxHeal, CooldownMin, CooldownMax
158 SMART_EVENT_WAYPOINT_PAUSED = 55, // PointId(0any), pathID(0any)
159 SMART_EVENT_WAYPOINT_RESUMED = 56, // PointId(0any), pathID(0any)
160 SMART_EVENT_WAYPOINT_STOPPED = 57, // PointId(0any), pathID(0any)
161 SMART_EVENT_WAYPOINT_ENDED = 58, // PointId(0any), pathID(0any)
163 SMART_EVENT_UPDATE = 60, // InitialMin, InitialMax, RepeatMin, RepeatMax
164 SMART_EVENT_LINK = 61, // INTERNAL USAGE, no params, used to link together multiple events, does not use any extra resources to iterate event lists needlessly
165 SMART_EVENT_GOSSIP_SELECT = 62, // menuID, actionID
167 SMART_EVENT_GOSSIP_HELLO = 64, // noReportUse (for GOs)
169 SMART_EVENT_EVENT_PHASE_CHANGE = 66, // UNUSED, DO NOT REUSE
170 SMART_EVENT_IS_BEHIND_TARGET = 67, // UNUSED, DO NOT REUSE
171 SMART_EVENT_GAME_EVENT_START = 68, // game_event.Entry
172 SMART_EVENT_GAME_EVENT_END = 69, // game_event.Entry
175 SMART_EVENT_ACTION_DONE = 72, // eventId (SharedDefines.EventId)
176 SMART_EVENT_ON_SPELLCLICK = 73, // clicker (unit)
177 SMART_EVENT_FRIENDLY_HEALTH_PCT = 74, // minHpPct, maxHpPct, repeatMin, repeatMax
178 SMART_EVENT_DISTANCE_CREATURE = 75, // guid, entry, distance, repeat
179 SMART_EVENT_DISTANCE_GAMEOBJECT = 76, // guid, entry, distance, repeat
180 SMART_EVENT_COUNTER_SET = 77, // id, value, cooldownMin, cooldownMax
182 SMART_EVENT_SCENE_TRIGGER = 79, // param_string : triggerName
185 SMART_EVENT_SUMMONED_UNIT_DIES = 82, // CreatureId(0 all), CooldownMin, CooldownMax
186 SMART_EVENT_ON_SPELL_CAST = 83, // SpellID, CooldownMin, CooldownMax
187 SMART_EVENT_ON_SPELL_FAILED = 84, // SpellID, CooldownMin, CooldownMax
188 SMART_EVENT_ON_SPELL_START = 85, // SpellID, CooldownMin, CooldownMax
191
192 SMART_EVENT_END = 88
194
196{
201 union
202 {
203 struct
204 {
210
211 struct
212 {
218
219 struct
220 {
226
227 struct
228 {
238
239 struct
240 {
245
246 struct
247 {
251
252 struct
253 {
258
259 struct
260 {
265
266 struct
267 {
273
274 struct
275 {
280
281 struct
282 {
287
288 struct
289 {
292
293 struct
294 {
299
300 struct
301 {
307
308 struct
309 {
312
313 struct
314 {
315 uint32 type;
316 uint32 id;
318
319 struct
320 {
321 uint32 id;
326
327 struct
328 {
332
333 struct
334 {
337
338 struct
339 {
342
343 struct
344 {
349
350 struct
351 {
352 uint32 id;
354
355 struct
356 {
360
361 struct
362 {
363 uint32 id;
365
366 struct
367 {
370
371 struct
372 {
376
377 struct
378 {
381
382 struct
383 {
386
387 struct
388 {
391
392 struct
393 {
396
397 struct
398 {
405
406 struct
407 {
413
414 struct
415 {
416 uint32 id;
421
422 struct
423 {
428
429 struct
430 {
437 };
438
439 std::string param_string;
440
442 {
443 Hostile = 0,
444 NotHostile = 1,
445 Any = 2,
446 End
447 };
448};
449
451{
457
459{
460 SMART_ACTION_NONE = 0, // No action
461 SMART_ACTION_TALK = 1, // groupID from creature_text, duration to wait before TEXT_OVER event is triggered, useTalkTarget (0/1) - use target as talk target
462 SMART_ACTION_SET_FACTION = 2, // FactionId (or 0 for default)
463 SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL = 3, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to demorph)
464 SMART_ACTION_SOUND = 4, // SoundId, onlySelf
467 SMART_ACTION_OFFER_QUEST = 7, // QuestID, directAdd
470 SMART_ACTION_RANDOM_EMOTE = 10, // EmoteId1, EmoteId2, EmoteId3...
471 SMART_ACTION_CAST = 11, // SpellId, CastFlags, TriggeredFlags
472 SMART_ACTION_SUMMON_CREATURE = 12, // CreatureID, summonType, duration in ms, attackInvoker, flags(SmartActionSummonCreatureFlags)
476 SMART_ACTION_SET_INGAME_PHASE_GROUP = 16, // phaseGroupId, apply
478 SMART_ACTION_SET_UNIT_FLAG = 18, // UNUSED, DO NOT REUSE
479 SMART_ACTION_REMOVE_UNIT_FLAG = 19, // UNUSED, DO NOT REUSE
480 SMART_ACTION_AUTO_ATTACK = 20, // AllowAttackState (0 = stop attack, anything else means continue attacking)
481 SMART_ACTION_ALLOW_COMBAT_MOVEMENT = 21, // AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
483 SMART_ACTION_INC_EVENT_PHASE = 23, // Value (may be negative to decrement phase, should not be 0)
484 SMART_ACTION_EVADE = 24, // toRespawnPosition (0 = Move to RespawnPosition, 1 = Move to last stored home position)
488 SMART_ACTION_REMOVEAURASFROMSPELL = 28, // Spellid (0 removes all auras), charges (0 removes aura)
489 SMART_ACTION_FOLLOW = 29, // Distance (0 = default), Angle (0 = default), EndCreatureEntry, credit, creditType (0monsterkill, 1event)
490 SMART_ACTION_RANDOM_PHASE = 30, // PhaseId1, PhaseId2, PhaseId3...
491 SMART_ACTION_RANDOM_PHASE_RANGE = 31, // PhaseMin, PhaseMax
494 SMART_ACTION_SET_INST_DATA = 34, // Field, Data, Type (0 = SetData, 1 = SetBossState)
497 SMART_ACTION_DIE = 37, // No Params
499 SMART_ACTION_CALL_FOR_HELP = 39, // Radius, With Emote
500 SMART_ACTION_SET_SHEATH = 40, // Sheath (0-unarmed, 1-melee, 2-ranged)
502 SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue(+pct, -flat)
503 SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL = 43, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to dismount)
504 SMART_ACTION_SET_INGAME_PHASE_ID = 44, // PhaseId, apply
505 SMART_ACTION_SET_DATA = 45, // Field, Data (only creature @todo)
510 SMART_ACTION_SUMMON_GO = 50, // GameObjectID, DespawnTime in s
513 SMART_ACTION_WP_START = 53, // run/walk, pathID, canRepeat, quest, despawntime
515 SMART_ACTION_WP_STOP = 55, // despawnTime, quest, fail?
516 SMART_ACTION_ADD_ITEM = 56, // itemID, count
517 SMART_ACTION_REMOVE_ITEM = 57, // itemID, count
518 SMART_ACTION_INSTALL_AI_TEMPLATE = 58, // UNUSED, DO NOT REUSE
521 SMART_ACTION_SET_SWIM = 61, // UNUSED, DO NOT REUSE
522 SMART_ACTION_TELEPORT = 62, // mapID,
523 SMART_ACTION_SET_COUNTER = 63, // id, value, reset (0/1)
527 SMART_ACTION_CREATE_TIMED_EVENT = 67, // id, InitialMin, InitialMax, RepeatMin(only if it repeats), RepeatMax(only if it repeats), chance
529 SMART_ACTION_MOVE_TO_POS = 69, // PointId, transport, disablePathfinding, ContactDistance
530 SMART_ACTION_ENABLE_TEMP_GOBJ = 70, // despawnTimer (sec)
531 SMART_ACTION_EQUIP = 71, // entry, slotmask slot1, slot2, slot3 , only slots with mask set will be sent to client, bits are 1, 2, 4, leaving mask 0 is defaulted to mask 7 (send all), slots1-3 are only used if no entry is set
535 SMART_ACTION_ADD_AURA = 75, // UNUSED, DO NOT REUSE
536 SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT = 76, // UNUSED, DO NOT REUSE
537 SMART_ACTION_RESET_SCRIPT_BASE_OBJECT = 77, // UNUSED, DO NOT REUSE
539 SMART_ACTION_SET_RANGED_MOVEMENT = 79, // Distance, angle
540 SMART_ACTION_CALL_TIMED_ACTIONLIST = 80, // ID (overwrites already running actionlist), stop after combat?(0/1), timer update type(0-OOC, 1-IC, 2-ALWAYS)
544 SMART_ACTION_SIMPLE_TALK = 84, // groupID, can be used to make players say groupID, Text_over event is not triggered, whisper can not be used (Target units will say the text)
545 SMART_ACTION_SELF_CAST = 85, // spellID, castFlags
546 SMART_ACTION_CROSS_CAST = 86, // spellID, castFlags, CasterTargetType, CasterTarget param1, CasterTarget param2, CasterTarget param3, ( + the origonal target fields as Destination target), CasterTargets will cast spellID on all Targets (use with caution if targeting multiple * multiple units)
553 SMART_ACTION_SEND_GO_CUSTOM_ANIM = 93, // UNUSED, DO NOT REUSE
554 SMART_ACTION_SET_DYNAMIC_FLAG = 94, // UNUSED, DO NOT REUSE
555 SMART_ACTION_ADD_DYNAMIC_FLAG = 95, // UNUSED, DO NOT REUSE
556 SMART_ACTION_REMOVE_DYNAMIC_FLAG = 96, // UNUSED, DO NOT REUSE
557 SMART_ACTION_JUMP_TO_POS = 97, // SpeedXY, SpeedZ, Gravity, UseDefaultGravity, PointId, ContactDistance
558 SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId
563 SMART_ACTION_SET_ROOT = 103, // off/on
564 SMART_ACTION_SET_GO_FLAG = 104, // UNUSED, DO NOT REUSE
565 SMART_ACTION_ADD_GO_FLAG = 105, // UNUSED, DO NOT REUSE
566 SMART_ACTION_REMOVE_GO_FLAG = 106, // UNUSED, DO NOT REUSE
567 SMART_ACTION_SUMMON_CREATURE_GROUP = 107, // Group, attackInvoker
568 SMART_ACTION_SET_POWER = 108, // PowerType, newPower
569 SMART_ACTION_ADD_POWER = 109, // PowerType, newPower
570 SMART_ACTION_REMOVE_POWER = 110, // PowerType, newPower
571 SMART_ACTION_GAME_EVENT_STOP = 111, // GameEventId
572 SMART_ACTION_GAME_EVENT_START = 112, // GameEventId
573 SMART_ACTION_START_CLOSEST_WAYPOINT = 113, // wp1, wp2, wp3, wp4, wp5, wp6, wp7
574 SMART_ACTION_MOVE_OFFSET = 114, // PointId
575 SMART_ACTION_RANDOM_SOUND = 115, // soundId1, soundId2, soundId3, soundId4, soundId5, onlySelf
577 SMART_ACTION_DISABLE_EVADE = 117, // 0/1 (1 = disabled, 0 = enabled)
579 SMART_ACTION_SET_CAN_FLY = 119, // UNUSED, DO NOT REUSE
580 SMART_ACTION_REMOVE_AURAS_BY_TYPE = 120, // UNUSED, DO NOT REUSE
581 SMART_ACTION_SET_SIGHT_DIST = 121, // UNUSED, DO NOT REUSE
582 SMART_ACTION_FLEE = 122, // UNUSED, DO NOT REUSE
583 SMART_ACTION_ADD_THREAT = 123, // +threat, -threat
585 SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT = 125, // id min range, id max range
586 SMART_ACTION_REMOVE_ALL_GAMEOBJECTS = 126, // UNUSED, DO NOT REUSE
587 SMART_ACTION_PAUSE_MOVEMENT = 127, // MovementSlot (default = 0, active = 1, controlled = 2), PauseTime (ms), Force
588 SMART_ACTION_PLAY_ANIMKIT = 128, // id, type (0 = oneShot, 1 = aiAnim, 2 = meleeAnim, 3 = movementAnim)
589 SMART_ACTION_SCENE_PLAY = 129, // sceneId
591 SMART_ACTION_SPAWN_SPAWNGROUP = 131, // Group ID, min secs, max secs, spawnflags
592 SMART_ACTION_DESPAWN_SPAWNGROUP = 132, // Group ID, min secs, max secs, spawnflags
593 SMART_ACTION_RESPAWN_BY_SPAWNID = 133, // spawnType, spawnId
594 SMART_ACTION_INVOKER_CAST = 134, // spellID, castFlags
595 SMART_ACTION_PLAY_CINEMATIC = 135, // entry, cinematic
596 SMART_ACTION_SET_MOVEMENT_SPEED = 136, // movementType, speedInteger, speedFraction
597 SMART_ACTION_PLAY_SPELL_VISUAL_KIT = 137, // spellVisualKitId, kitType (unknown values, copypaste from packet dumps), duration
598 SMART_ACTION_OVERRIDE_LIGHT = 138, // zoneId, overrideLightID, transitionMilliseconds
599 SMART_ACTION_OVERRIDE_WEATHER = 139, // zoneId, weatherId, intensity
600 SMART_ACTION_SET_AI_ANIM_KIT = 140, // DEPRECATED, DO REUSE (it was never used in any branch, treat as free action id)
603 SMART_ACTION_CREATE_CONVERSATION = 143, // conversation_template.id
607 SMART_ACTION_ACTIVATE_GAMEOBJECT = 147, // GameObjectActions
609 SMART_ACTION_BECOME_PERSONAL_CLONE_FOR_PLAYER = 149, // summonType 1-8, duration in ms
610 SMART_ACTION_TRIGGER_GAME_EVENT = 150, // eventId, useSaiTargetAsGameEventSource
611 SMART_ACTION_DO_ACTION = 151, // actionId
612 SMART_ACTION_END = 152
614
616{
617 None = 0,
618 PersonalSpawn = 1,
619 PreferUnit = 2,
620
622};
623
625
627{
629
630 union
631 {
632 struct
633 {
638
639 struct
640 {
644
645 struct
646 {
649
650 struct
651 {
655
656 struct
657 {
663
664 struct
665 {
668
669 struct
670 {
673
674 struct
675 {
679
680 struct
681 {
684
685 struct
686 {
689
690 struct
691 {
697
698 struct
699 {
707
708 struct
709 {
714 uint32 flags; // SmartActionSummonCreatureFlags
717
718 struct
719 {
723
724 struct
725 {
729
730 struct
731 {
734
735 struct
736 {
739
740 struct
741 {
744
745 struct
746 {
750
751 struct
752 {
757
758 struct
759 {
766
767 struct
768 {
771
772 struct
773 {
777
778 struct
779 {
782
783 struct
784 {
787 uint32 type;
789
790 struct
791 {
794
795 struct
796 {
800
801 struct
802 {
806
807 struct
808 {
811
812 struct
813 {
817
818 struct
819 {
823
824 struct
825 {
829
830 struct
831 {
835
836 struct
837 {
839 uint32 data;
841
842 struct
843 {
846
847 struct
848 {
851
852 struct
853 {
858
859 struct
860 {
863
864 struct
865 {
866 uint32 id;
868
869 struct
870 {
871 SAIBool run; // unused defined by waypoint_path
876 // uint32 reactState; DO NOT REUSE
878
879 struct
880 {
883
884 struct
885 {
890
891 struct
892 {
896
897 struct
898 {
899 SAIBool run;
901
902 struct
903 {
906
907 struct
908 {
911
912 struct
913 {
918
919 struct
920 {
921 uint32 id;
923
924 struct
925 {
926 uint32 id;
933
934 struct
935 {
938
939 struct
940 {
947
948 struct
949 {
952
953 struct
954 {
956 uint32 type;
958
959 struct
960 {
962 uint32 type;
964
965 struct
966 {
967 uint32 id;
971
972 struct
973 {
976
977 struct
978 {
982
983 struct
984 {
989
990 struct
991 {
999
1000 struct
1001 {
1004
1005 struct
1006 {
1009
1010 struct
1011 {
1017
1018 struct
1019 {
1023
1024 struct
1025 {
1026 uint32 state;
1028
1029 struct
1030 {
1031 uint32 id;
1033
1034 struct
1035 {
1037 uint32 angle;
1039
1040 struct
1041 {
1044
1045 struct
1046 {
1049
1050 struct
1051 {
1052 uint32 state;
1054
1055 struct
1056 {
1060
1061 struct
1062 {
1066
1067 struct
1068 {
1069 uint32 id;
1071
1072 struct
1073 {
1074 uint32 id;
1076
1077 struct
1078 {
1081
1082 struct
1083 {
1086
1087 struct
1088 {
1093
1094 struct
1095 {
1099
1100 struct
1101 {
1104
1105 struct
1106 {
1112
1113 struct
1114 {
1115 uint32 id;
1118
1119 struct
1120 {
1124
1125 struct
1126 {
1129 SAIBool force;
1131
1132 struct
1133 {
1137
1138 struct
1139 {
1141 uint32 type;
1143
1144 struct
1145 {
1148
1149 struct
1150 {
1151 uint32 entry;
1153
1154 struct
1155 {
1160
1161 struct
1162 {
1167
1168 struct
1169 {
1175
1176 struct
1177 {
1178 uint32 zoneId;
1182
1183 struct
1184 {
1187
1188 struct
1189 {
1192
1193 struct
1194 {
1197
1198 struct
1199 {
1200 uint32 id;
1202
1203 struct
1204 {
1207
1208 struct
1209 {
1212
1213 struct
1214 {
1217
1218 struct
1219 {
1223
1224 struct
1225 {
1226 uint32 id;
1228
1229 struct
1230 {
1231 uint32 type;
1234
1235 struct
1236 {
1240
1241 struct
1242 {
1245
1248
1249 struct
1250 {
1259 };
1260};
1261
1263{
1268};
1269
1271{
1273 SMART_TARGET_SELF = 1, // Self cast
1274 SMART_TARGET_VICTIM = 2, // Our current target (ie: highest aggro)
1275 SMART_TARGET_HOSTILE_SECOND_AGGRO = 3, // Second highest aggro, maxdist, playerOnly, powerType + 1
1276 SMART_TARGET_HOSTILE_LAST_AGGRO = 4, // Dead last on aggro, maxdist, playerOnly, powerType + 1
1277 SMART_TARGET_HOSTILE_RANDOM = 5, // Just any random target on our threat list, maxdist, playerOnly, powerType + 1
1278 SMART_TARGET_HOSTILE_RANDOM_NOT_TOP = 6, // Any random target except top threat, maxdist, playerOnly, powerType + 1
1279 SMART_TARGET_ACTION_INVOKER = 7, // Unit who caused this Event to occur
1280 SMART_TARGET_POSITION = 8, // use xyz from event params
1281 SMART_TARGET_CREATURE_RANGE = 9, // CreatureEntry(0any), minDist, maxDist
1282 SMART_TARGET_CREATURE_GUID = 10, // guid, entry
1283 SMART_TARGET_CREATURE_DISTANCE = 11, // CreatureEntry(0any), maxDist
1284 SMART_TARGET_STORED = 12, // id, uses pre-stored target(list)
1285 SMART_TARGET_GAMEOBJECT_RANGE = 13, // entry(0any), min, max
1286 SMART_TARGET_GAMEOBJECT_GUID = 14, // guid, entry
1287 SMART_TARGET_GAMEOBJECT_DISTANCE = 15, // entry(0any), maxDist
1288 SMART_TARGET_INVOKER_PARTY = 16, // invoker's party members
1291 SMART_TARGET_CLOSEST_CREATURE = 19, // CreatureEntry(0any), maxDist, dead?
1292 SMART_TARGET_CLOSEST_GAMEOBJECT = 20, // entry(0any), maxDist
1294 SMART_TARGET_ACTION_INVOKER_VEHICLE = 22, // Unit's vehicle who caused this Event to occur
1295 SMART_TARGET_OWNER_OR_SUMMONER = 23, // Unit's owner or summoner, Use Owner/Charmer of this unit
1296 SMART_TARGET_THREAT_LIST = 24, // All units on creature's threat list, maxdist
1297 SMART_TARGET_CLOSEST_ENEMY = 25, // maxDist, playerOnly
1298 SMART_TARGET_CLOSEST_FRIENDLY = 26, // maxDist, playerOnly
1299 SMART_TARGET_LOOT_RECIPIENTS = 27, // all players that have tagged this creature (for kill credit)
1300 SMART_TARGET_FARTHEST = 28, // maxDist, playerOnly, isInLos
1301 SMART_TARGET_VEHICLE_PASSENGER = 29, // seatMask (0 - all seats)
1302 SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT = 30, // entry(0any), maxDist
1303
1304 SMART_TARGET_END = 31
1306
1308{
1310 {
1311 type = t;
1312 raw.param1 = p1;
1313 raw.param2 = p2;
1314 raw.param3 = p3;
1315 raw.param4 = p4;
1316 x = 0.0f;
1317 y = 0.0f;
1318 z = 0.0f;
1319 o = 0.0f;
1320 }
1322 float x, y, z, o;
1323 union
1324 {
1325 struct
1326 {
1331
1332 struct
1333 {
1338
1339 struct
1340 {
1346
1347 struct
1348 {
1352
1353 struct
1354 {
1359
1360 struct
1361 {
1362 uint32 dist;
1364
1365 struct
1366 {
1370
1371 struct
1372 {
1375
1376 struct
1377 {
1378 uint32 entry;
1383
1384 struct
1385 {
1386 uint32 dbGuid;
1387 uint32 entry;
1389
1390 struct
1391 {
1392 uint32 entry;
1393 uint32 dist;
1396
1397 struct
1398 {
1399 uint32 entry;
1400 uint32 dist;
1403
1404 struct
1405 {
1406 uint32 entry;
1407 uint32 dist;
1409
1410 struct
1411 {
1415
1416 struct
1417 {
1421
1422 struct
1423 {
1426
1427 struct
1428 {
1431
1432 struct
1433 {
1436
1437 struct
1438 {
1444 };
1445};
1446
1448{
1464
1466{
1480
1482{
1496};
1497
1499{
1588};
1589
1591{
1592 SMART_EVENT_FLAG_NOT_REPEATABLE = 0x001, // Event can not repeat
1593 SMART_EVENT_FLAG_DIFFICULTY_0_DEPRECATED = 0x002, // UNUSED, DO NOT REUSE
1594 SMART_EVENT_FLAG_DIFFICULTY_1_DEPRECATED = 0x004, // UNUSED, DO NOT REUSE
1595 SMART_EVENT_FLAG_DIFFICULTY_2_DEPRECATED = 0x008, // UNUSED, DO NOT REUSE
1596 SMART_EVENT_FLAG_DIFFICULTY_3_DEPRECATED = 0x010, // UNUSED, DO NOT REUSE
1599 SMART_EVENT_FLAG_DEBUG_ONLY = 0x080, //Event only occurs in debug build
1600 SMART_EVENT_FLAG_DONT_RESET = 0x100, //Event will not reset in SmartScript::OnReset()
1601 SMART_EVENT_FLAG_WHILE_CHARMED = 0x200, //Event occurs even if AI owner is charmed
1602
1605
1606 // Temp flags, used only at runtime, never stored in DB
1607 SMART_EVENT_FLAG_TEMP_IGNORE_CHANCE_ROLL = 0x40000000, //Event occurs no matter what roll_chance_i(e.event.event_chance) returns.
1608};
1609
1611{
1612 SMARTCAST_INTERRUPT_PREVIOUS = 0x01, // Interrupt any spell casting
1613 SMARTCAST_TRIGGERED = 0x02, // Triggered (this makes spell cost zero mana and have no cast time)
1614 //SMARTCAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
1615 //SMARTCAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
1616 //SMARTCAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
1617 SMARTCAST_AURA_NOT_PRESENT = 0x20, // Only casts the spell if the target does not have an aura from the spell
1618 SMARTCAST_COMBAT_MOVE = 0x40 // Prevents combat movement if cast successful. Allows movement on range, OOM, LOS
1620
1621// one line in DB is one event
1623{
1625 , event_id(0), link(0), event(), action(), target(), timer(0), priority(DEFAULT_PRIORITY), active(false), runOnce(false)
1626 , enableTimed(false) { }
1627
1632 std::vector<Difficulty> Difficulties;
1633
1637
1639 uint32 GetEventType() const { return (uint32)event.type; }
1642
1648
1649 operator bool() const { return entryOrGuid != 0; }
1650 // Default comparision operator using priority field as first ordering field
1651 std::strong_ordering operator<=>(SmartScriptHolder const& right) const
1652 {
1653 if (std::strong_ordering cmp = priority <=> right.priority; advstd::is_neq(cmp))
1654 return cmp;
1655 if (std::strong_ordering cmp = entryOrGuid <=> right.entryOrGuid; advstd::is_neq(cmp))
1656 return cmp;
1657 if (std::strong_ordering cmp = source_type <=> right.source_type; advstd::is_neq(cmp))
1658 return cmp;
1659 if (std::strong_ordering cmp = event_id <=> right.event_id; advstd::is_neq(cmp))
1660 return cmp;
1661 if (std::strong_ordering cmp = link <=> right.link; advstd::is_neq(cmp))
1662 return cmp;
1663 return std::strong_ordering::equal;
1664 }
1665
1666 static constexpr uint32 DEFAULT_PRIORITY = std::numeric_limits<uint32>::max();
1667};
1668
1669typedef std::vector<WorldObject*> ObjectVector;
1670
1672{
1673 public:
1674 explicit ObjectGuidVector(ObjectVector const& objectVector);
1675
1677 {
1678 UpdateObjects(ref);
1679 return &_objectVector;
1680 }
1681
1682 void AddGuid(ObjectGuid const& guid) { _guidVector.push_back(guid); }
1683
1685
1686 private:
1689
1690 //sanitize vector using _guidVector
1691 void UpdateObjects(WorldObject const& ref) const;
1692};
1693typedef std::unordered_map<uint32, ObjectGuidVector> ObjectVectorMap;
1694
1695// all events for a single entry
1696typedef std::vector<SmartScriptHolder> SmartAIEventList;
1697typedef std::vector<SmartScriptHolder> SmartAIEventStoredList;
1698
1699// all events for all entries / guids
1700typedef std::unordered_map<int64, SmartAIEventList> SmartAIEventMap;
1701
1702// Helper Stores
1703typedef std::map<uint32 /*entry*/, std::pair<uint32 /*spellId*/, SpellEffIndex /*effIndex*/> > CacheSpellContainer;
1704typedef std::pair<CacheSpellContainer::const_iterator, CacheSpellContainer::const_iterator> CacheSpellContainerBounds;
1705
1707{
1708 private:
1711
1712 public:
1713 static SmartAIMgr* instance();
1714
1715 void LoadSmartAIFromDB();
1716
1717 SmartAIEventList GetScript(int32 entry, SmartScriptType type);
1718
1719 static SmartScriptHolder& FindLinkedSourceEvent(SmartAIEventList& list, uint32 eventId);
1720
1721 static SmartScriptHolder& FindLinkedEvent(SmartAIEventList& list, uint32 link);
1722
1723 private:
1724 //event stores
1726
1727 static bool EventHasInvoker(SMART_EVENT event);
1728
1729 bool IsEventValid(SmartScriptHolder& e);
1730 bool IsTargetValid(SmartScriptHolder const& e);
1731
1732 bool IsMinMaxValid(SmartScriptHolder const& e, uint32 min, uint32 max);
1733
1734 static bool NotNULL(SmartScriptHolder const& e, uint32 data);
1735 static bool IsCreatureValid(SmartScriptHolder const& e, uint32 entry);
1736 static bool IsQuestValid(SmartScriptHolder const& e, uint32 entry);
1737 static bool IsGameObjectValid(SmartScriptHolder const& e, uint32 entry);
1738 static bool IsSpellValid(SmartScriptHolder const& e, uint32 entry);
1739 static bool IsItemValid(SmartScriptHolder const& e, uint32 entry);
1740 static bool IsTextEmoteValid(SmartScriptHolder const& e, uint32 entry);
1741 static bool IsEmoteValid(SmartScriptHolder const& e, uint32 entry);
1742 static bool IsAreaTriggerValid(SmartScriptHolder const& e, uint32 entry);
1743 static bool IsSoundValid(SmartScriptHolder const& e, uint32 entry);
1744 static bool IsAnimKitValid(SmartScriptHolder const& e, uint32 entry);
1745 static bool IsSpellVisualKitValid(SmartScriptHolder const& e, uint32 entry);
1746 static bool IsTextValid(SmartScriptHolder const& e, uint32 id);
1747
1748 static bool CheckUnusedEventParams(SmartScriptHolder const& e);
1749 static bool CheckUnusedActionParams(SmartScriptHolder const& e);
1750 static bool CheckUnusedTargetParams(SmartScriptHolder const& e);
1751
1752 // Helpers
1753 void LoadHelperStores();
1754 void UnLoadHelperStores();
1755
1756 CacheSpellContainerBounds GetSummonCreatureSpellContainerBounds(uint32 creatureEntry) const;
1757 CacheSpellContainerBounds GetSummonGameObjectSpellContainerBounds(uint32 gameObjectEntry) const;
1758 CacheSpellContainerBounds GetKillCreditSpellContainerBounds(uint32 killCredit) const;
1759 CacheSpellContainerBounds GetCreateItemSpellContainerBounds(uint32 itemId) const;
1760
1765};
1766
1767#define sSmartScriptMgr SmartAIMgr::instance()
1768
1769#endif
#define TC_GAME_API
Definition: Define.h:123
uint8_t uint8
Definition: Define.h:144
int64_t int64
Definition: Define.h:137
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
std::vector< ObjectGuid > GuidVector
Definition: ObjectGuid.h:395
SpellEffIndex
Definition: SharedDefines.h:29
SmartScriptType
@ SMART_SCRIPT_TYPE_TIMED_ACTIONLIST
@ SMART_SCRIPT_TYPE_MAX
@ SMART_SCRIPT_TYPE_INSTANCE
@ SMART_SCRIPT_TYPE_CREATURE
@ SMART_SCRIPT_TYPE_GOSSIP
@ SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY_CUSTOM
@ SMART_SCRIPT_TYPE_GAMEOBJECT
@ SMART_SCRIPT_TYPE_AREATRIGGER
@ SMART_SCRIPT_TYPE_SPELL
@ SMART_SCRIPT_TYPE_TRANSPORT
@ SMART_SCRIPT_TYPE_AREATRIGGER_ENTITY
@ SMART_SCRIPT_TYPE_EVENT
@ SMART_SCRIPT_TYPE_SCENE
@ SMART_SCRIPT_TYPE_QUEST
std::vector< SmartScriptHolder > SmartAIEventList
std::vector< SmartScriptHolder > SmartAIEventStoredList
SmartEventFlags
@ SMART_EVENT_FLAG_RESERVED_5
@ SMART_EVENT_FLAG_DIFFICULTY_1_DEPRECATED
@ SMART_EVENT_FLAG_WHILE_CHARMED
@ SMART_EVENT_FLAGS_DEPRECATED
@ SMART_EVENT_FLAG_DONT_RESET
@ SMART_EVENT_FLAG_DEBUG_ONLY
@ SMART_EVENT_FLAGS_ALL
@ SMART_EVENT_FLAG_DIFFICULTY_2_DEPRECATED
@ SMART_EVENT_FLAG_RESERVED_6
@ SMART_EVENT_FLAG_DIFFICULTY_0_DEPRECATED
@ SMART_EVENT_FLAG_DIFFICULTY_3_DEPRECATED
@ SMART_EVENT_FLAG_TEMP_IGNORE_CHANCE_ROLL
@ SMART_EVENT_FLAG_NOT_REPEATABLE
SMARTAI_TARGETS
@ SMART_TARGET_LOOT_RECIPIENTS
@ SMART_TARGET_CLOSEST_CREATURE
@ SMART_TARGET_CREATURE_DISTANCE
@ SMART_TARGET_HOSTILE_RANDOM_NOT_TOP
@ SMART_TARGET_INVOKER_PARTY
@ SMART_TARGET_CLOSEST_FRIENDLY
@ SMART_TARGET_CLOSEST_GAMEOBJECT
@ SMART_TARGET_VEHICLE_PASSENGER
@ SMART_TARGET_GAMEOBJECT_RANGE
@ SMART_TARGET_CREATURE_GUID
@ SMART_TARGET_PLAYER_RANGE
@ SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT
@ SMART_TARGET_VICTIM
@ SMART_TARGET_GAMEOBJECT_DISTANCE
@ SMART_TARGET_CREATURE_RANGE
@ SMART_TARGET_CLOSEST_PLAYER
@ SMART_TARGET_HOSTILE_RANDOM
@ SMART_TARGET_GAMEOBJECT_GUID
@ SMART_TARGET_HOSTILE_SECOND_AGGRO
@ SMART_TARGET_OWNER_OR_SUMMONER
@ SMART_TARGET_SELF
@ SMART_TARGET_END
@ SMART_TARGET_ACTION_INVOKER
@ SMART_TARGET_POSITION
@ SMART_TARGET_HOSTILE_LAST_AGGRO
@ SMART_TARGET_ACTION_INVOKER_VEHICLE
@ SMART_TARGET_FARTHEST
@ SMART_TARGET_THREAT_LIST
@ SMART_TARGET_CLOSEST_ENEMY
@ SMART_TARGET_NONE
@ SMART_TARGET_PLAYER_DISTANCE
@ SMART_TARGET_STORED
std::map< uint32, std::pair< uint32, SpellEffIndex > > CacheSpellContainer
const uint32 SmartPhaseMask[SMART_EVENT_PHASE_COUNT][2]
std::unordered_map< int64, SmartAIEventList > SmartAIEventMap
std::vector< WorldObject * > ObjectVector
std::unordered_map< uint32, ObjectGuidVector > ObjectVectorMap
const uint32 SmartAIEventMask[SMART_EVENT_END][2]
SMART_SCRIPT_RESPAWN_CONDITION
@ SMART_SCRIPT_RESPAWN_CONDITION_END
@ SMART_SCRIPT_RESPAWN_CONDITION_NONE
@ SMART_SCRIPT_RESPAWN_CONDITION_AREA
@ SMART_SCRIPT_RESPAWN_CONDITION_MAP
SmartAITypeMaskId
@ SMART_SCRIPT_TYPE_MASK_SPELL
@ SMART_SCRIPT_TYPE_MASK_SCENE
@ SMART_SCRIPT_TYPE_MASK_EVENT
@ SMART_SCRIPT_TYPE_MASK_QUEST
@ SMART_SCRIPT_TYPE_MASK_TIMED_ACTIONLIST
@ SMART_SCRIPT_TYPE_MASK_CREATURE
@ SMART_SCRIPT_TYPE_MASK_INSTANCE
@ SMART_SCRIPT_TYPE_MASK_AREATRIGGER
@ SMART_SCRIPT_TYPE_MASK_AREATRIGGER_ENTITY
@ SMART_SCRIPT_TYPE_MASK_GOSSIP
@ SMART_SCRIPT_TYPE_MASK_GAMEOBJECT
@ SMART_SCRIPT_TYPE_MASK_TRANSPORT
SMART_ACTION
@ SMART_ACTION_REMOVE_TIMED_EVENT
@ SMART_ACTION_NONE
@ SMART_ACTION_SET_GO_FLAG
@ SMART_ACTION_WP_RESUME
@ SMART_ACTION_UPDATE_TEMPLATE
@ SMART_ACTION_STORE_TARGET_LIST
@ SMART_ACTION_SET_HEALTH_REGEN
@ SMART_ACTION_ACTIVATE_GOBJECT
@ SMART_ACTION_FORCE_DESPAWN
@ SMART_ACTION_GAME_EVENT_START
@ SMART_ACTION_CREATE_CONVERSATION
@ SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST
@ SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1
@ SMART_ACTION_SET_DISABLE_GRAVITY
@ SMART_ACTION_SET_INST_DATA64
@ SMART_ACTION_SET_FACTION
@ SMART_ACTION_THREAT_SINGLE_PCT
@ SMART_ACTION_OFFER_QUEST
@ SMART_ACTION_OVERRIDE_LIGHT
@ SMART_ACTION_REMOVE_ALL_GAMEOBJECTS
@ SMART_ACTION_SET_UNIT_FIELD_BYTES_1
@ SMART_ACTION_CLOSE_GOSSIP
@ SMART_ACTION_DISABLE_EVADE
@ SMART_ACTION_ADD_GO_FLAG
@ SMART_ACTION_ADD_DYNAMIC_FLAG
@ SMART_ACTION_KILL_UNIT
@ SMART_ACTION_LOAD_EQUIPMENT
@ SMART_ACTION_END
@ SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS
@ SMART_ACTION_ATTACK_START
@ SMART_ACTION_SET_UNIT_FLAG
@ SMART_ACTION_BECOME_PERSONAL_CLONE_FOR_PLAYER
@ SMART_ACTION_CALL_GROUPEVENTHAPPENS
@ SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL
@ SMART_ACTION_INVOKER_CAST
@ SMART_ACTION_SCENE_PLAY
@ SMART_ACTION_JUMP_TO_POS
@ SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST
@ SMART_ACTION_SEND_GOSSIP_MENU
@ SMART_ACTION_SET_COUNTER
@ SMART_ACTION_FLEE_FOR_ASSIST
@ SMART_ACTION_EQUIP
@ SMART_ACTION_SET_ROOT
@ SMART_ACTION_ATTACK_STOP
@ SMART_ACTION_SUMMON_GO
@ SMART_ACTION_SET_HOVER
@ SMART_ACTION_WP_PAUSE
@ SMART_ACTION_SIMPLE_TALK
@ SMART_ACTION_REMOVE_AURAS_BY_TYPE
@ SMART_ACTION_CAST
@ SMART_ACTION_SPAWN_SPAWNGROUP
@ SMART_ACTION_ALLOW_COMBAT_MOVEMENT
@ SMART_ACTION_ADD_AURA
@ SMART_ACTION_THREAT_ALL_PCT
@ SMART_ACTION_SOUND
@ SMART_ACTION_SET_MOVEMENT_SPEED
@ SMART_ACTION_PLAY_CINEMATIC
@ SMART_ACTION_ADD_NPC_FLAG
@ SMART_ACTION_EVADE
@ SMART_ACTION_FAIL_QUEST
@ SMART_ACTION_INTERRUPT_SPELL
@ SMART_ACTION_ADD_POWER
@ SMART_ACTION_REMOVE_DYNAMIC_FLAG
@ SMART_ACTION_RANDOM_SOUND
@ SMART_ACTION_SET_IMMUNE_PC
@ SMART_ACTION_SCENE_CANCEL
@ SMART_ACTION_SET_AI_ANIM_KIT
@ SMART_ACTION_SET_POWER
@ SMART_ACTION_SEND_TARGET_TO_TARGET
@ SMART_ACTION_SET_INGAME_PHASE_ID
@ SMART_ACTION_REMOVE_POWER
@ SMART_ACTION_SET_DYNAMIC_FLAG
@ SMART_ACTION_GO_SET_GO_STATE
@ SMART_ACTION_MOVE_OFFSET
@ SMART_ACTION_REMOVE_ITEM
@ SMART_ACTION_SEND_GO_CUSTOM_ANIM
@ SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL
@ SMART_ACTION_REMOVE_UNIT_FLAG
@ SMART_ACTION_RANDOM_PHASE
@ SMART_ACTION_SET_EMOTE_STATE
@ SMART_ACTION_CROSS_CAST
@ SMART_ACTION_WP_STOP
@ SMART_ACTION_GAME_EVENT_STOP
@ SMART_ACTION_CALL_KILLEDMONSTER
@ SMART_ACTION_TRIGGER_GAME_EVENT
@ SMART_ACTION_TALK
@ SMART_ACTION_CALL_SCRIPT_RESET
@ SMART_ACTION_SET_DATA
@ SMART_ACTION_PLAY_SPELL_VISUAL_KIT
@ SMART_ACTION_WP_START
@ SMART_ACTION_COMBAT_STOP
@ SMART_ACTION_SET_INGAME_PHASE_GROUP
@ SMART_ACTION_SET_RUN
@ SMART_ACTION_ACTIVATE_GAMEOBJECT
@ SMART_ACTION_ADD_TO_STORED_TARGET_LIST
@ SMART_ACTION_SET_HEALTH_PCT
@ SMART_ACTION_AUTO_ATTACK
@ SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL
@ SMART_ACTION_SET_VISIBILITY
@ SMART_ACTION_RANDOM_PHASE_RANGE
@ SMART_ACTION_GO_SET_LOOT_STATE
@ SMART_ACTION_SELF_CAST
@ SMART_ACTION_SET_SWIM
@ SMART_ACTION_SET_SIGHT_DIST
@ SMART_ACTION_SET_INST_DATA
@ SMART_ACTION_PLAY_ANIMKIT
@ SMART_ACTION_REMOVE_GO_FLAG
@ SMART_ACTION_CALL_FOR_HELP
@ SMART_ACTION_SET_UNINTERACTIBLE
@ SMART_ACTION_OVERRIDE_WEATHER
@ SMART_ACTION_ADD_THREAT
@ SMART_ACTION_TELEPORT
@ SMART_ACTION_PLAYMOVIE
@ SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT
@ SMART_ACTION_FOLLOW
@ SMART_ACTION_PLAY_EMOTE
@ SMART_ACTION_SET_EVENT_PHASE
@ SMART_ACTION_DESPAWN_SPAWNGROUP
@ SMART_ACTION_SET_CORPSE_DELAY
@ SMART_ACTION_SET_SHEATH
@ SMART_ACTION_SET_ORIENTATION
@ SMART_ACTION_RESPAWN_BY_SPAWNID
@ SMART_ACTION_SET_NPC_FLAG
@ SMART_ACTION_MOVE_TO_POS
@ SMART_ACTION_RANDOM_EMOTE
@ SMART_ACTION_INC_EVENT_PHASE
@ SMART_ACTION_ENABLE_TEMP_GOBJ
@ SMART_ACTION_CREATE_TIMED_EVENT
@ SMART_ACTION_DIE
@ SMART_ACTION_RESET_SCRIPT_BASE_OBJECT
@ SMART_ACTION_REMOVE_NPC_FLAG
@ SMART_ACTION_INSTALL_AI_TEMPLATE
@ SMART_ACTION_SUMMON_CREATURE
@ SMART_ACTION_RESET_GOBJECT
@ SMART_ACTION_CALL_TIMED_ACTIONLIST
@ SMART_ACTION_SET_IN_COMBAT_WITH_ZONE
@ SMART_ACTION_DO_ACTION
@ SMART_ACTION_SET_CAN_FLY
@ SMART_ACTION_SET_HOME_POS
@ SMART_ACTION_ADD_ITEM
@ SMART_ACTION_SET_ACTIVE
@ SMART_ACTION_SET_RANGED_MOVEMENT
@ SMART_ACTION_ACTIVATE_TAXI
@ SMART_ACTION_START_CLOSEST_WAYPOINT
@ SMART_ACTION_SUMMON_CREATURE_GROUP
@ SMART_ACTION_SET_REACT_STATE
@ SMART_ACTION_RANDOM_MOVE
@ SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT
@ SMART_ACTION_SET_IMMUNE_NPC
@ SMART_ACTION_TRIGGER_TIMED_EVENT
@ SMART_ACTION_REMOVEAURASFROMSPELL
@ SMART_ACTION_FLEE
@ SMART_ACTION_PAUSE_MOVEMENT
DEFINE_ENUM_FLAG(SmartActionSummonCreatureFlags)
SMART_EVENT
@ SMART_EVENT_IC_LOS
@ SMART_EVENT_EVADE
@ SMART_EVENT_ACTION_DONE
@ SMART_EVENT_SUMMON_DESPAWNED
@ SMART_EVENT_SPELLHIT
@ SMART_EVENT_SCENE_START
@ SMART_EVENT_RECEIVE_EMOTE
@ SMART_EVENT_FRIENDLY_HEALTH_PCT
@ SMART_EVENT_QUEST_FAIL
@ SMART_EVENT_DATA_SET
@ SMART_EVENT_RECEIVE_HEAL
@ SMART_EVENT_TIMED_EVENT_TRIGGERED
@ SMART_EVENT_SCENE_COMPLETE
@ SMART_EVENT_CHARMED_TARGET
@ SMART_EVENT_TARGET_MANA_PCT
@ SMART_EVENT_QUEST_COMPLETION
@ SMART_EVENT_JUST_CREATED
@ SMART_EVENT_HEALTH_PCT
@ SMART_EVENT_EVENT_PHASE_CHANGE
@ SMART_EVENT_AREATRIGGER_ONTRIGGER
@ SMART_EVENT_DISTANCE_GAMEOBJECT
@ SMART_EVENT_ON_SPELLCLICK
@ SMART_EVENT_MOVEMENTINFORM
@ SMART_EVENT_RANGE
@ SMART_EVENT_MANA_PCT
@ SMART_EVENT_PASSENGER_REMOVED
@ SMART_EVENT_INSTANCE_PLAYER_ENTER
@ SMART_EVENT_LINK
@ SMART_EVENT_WAYPOINT_PAUSED
@ SMART_EVENT_REACHED_HOME
@ SMART_EVENT_TRANSPORT_ADDCREATURE
@ SMART_EVENT_REWARD_QUEST
@ SMART_EVENT_END
@ SMART_EVENT_GO_EVENT_INFORM
@ SMART_EVENT_GO_LOOT_STATE_CHANGED
@ SMART_EVENT_UPDATE_IC
@ SMART_EVENT_RESET
@ SMART_EVENT_SCENE_CANCEL
@ SMART_EVENT_JUST_SUMMONED
@ SMART_EVENT_CHARMED
@ SMART_EVENT_AI_INIT
@ SMART_EVENT_WAYPOINT_START
@ SMART_EVENT_ON_SPELL_CAST
@ SMART_EVENT_SPELLHIT_TARGET
@ SMART_EVENT_GAME_EVENT_START
@ SMART_EVENT_KILL
@ SMART_EVENT_TRANSPORT_REMOVE_PLAYER
@ SMART_EVENT_GOSSIP_HELLO
@ SMART_EVENT_GOSSIP_SELECT
@ SMART_EVENT_CORPSE_REMOVED
@ SMART_EVENT_PASSENGER_BOARDED
@ SMART_EVENT_SCENE_TRIGGER
@ SMART_EVENT_UPDATE
@ SMART_EVENT_TRANSPORT_ADDPLAYER
@ SMART_EVENT_WAYPOINT_ENDED
@ SMART_EVENT_IS_BEHIND_TARGET
@ SMART_EVENT_UPDATE_OOC
@ SMART_EVENT_ACCEPTED_QUEST
@ SMART_EVENT_COUNTER_SET
@ SMART_EVENT_FRIENDLY_MISSING_BUFF
@ SMART_EVENT_WAYPOINT_RESUMED
@ SMART_EVENT_ON_SPELL_FAILED
@ SMART_EVENT_WAYPOINT_REACHED
@ SMART_EVENT_TARGET_BUFFED
@ SMART_EVENT_RESPAWN
@ SMART_EVENT_QUEST_ACCEPTED
@ SMART_EVENT_FRIENDLY_HEALTH
@ SMART_EVENT_QUEST_REWARDED
@ SMART_EVENT_TEXT_OVER
@ SMART_EVENT_DEATH
@ SMART_EVENT_TRANSPORT_RELOCATE
@ SMART_EVENT_GAME_EVENT_END
@ SMART_EVENT_DAMAGED
@ SMART_EVENT_FOLLOW_COMPLETED
@ SMART_EVENT_QUEST_OBJ_COMPLETION
@ SMART_EVENT_DISTANCE_CREATURE
@ SMART_EVENT_WAYPOINT_STOPPED
@ SMART_EVENT_SUMMONED_UNIT_DIES
@ SMART_EVENT_FRIENDLY_IS_CC
@ SMART_EVENT_SEND_EVENT_TRIGGER
@ SMART_EVENT_OOC_LOS
@ SMART_EVENT_ON_SPELL_START
@ SMART_EVENT_ON_DESPAWN
@ SMART_EVENT_AGGRO
@ SMART_EVENT_TARGET_HEALTH_PCT
@ SMART_EVENT_VICTIM_CASTING
@ SMART_EVENT_DAMAGED_TARGET
@ SMART_EVENT_HAS_AURA
@ SMART_EVENT_SUMMONED_UNIT
uint32 SAIBool
SmartActionSummonCreatureFlags
SMART_EVENT_PHASE_BITS
@ SMART_EVENT_PHASE_4_BIT
@ SMART_EVENT_PHASE_3_BIT
@ SMART_EVENT_PHASE_6_BIT
@ SMART_EVENT_PHASE_9_BIT
@ SMART_EVENT_PHASE_8_BIT
@ SMART_EVENT_PHASE_2_BIT
@ SMART_EVENT_PHASE_1_BIT
@ SMART_EVENT_PHASE_12_BIT
@ SMART_EVENT_PHASE_ALL
@ SMART_EVENT_PHASE_5_BIT
@ SMART_EVENT_PHASE_ALWAYS_BIT
@ SMART_EVENT_PHASE_10_BIT
@ SMART_EVENT_PHASE_11_BIT
@ SMART_EVENT_PHASE_7_BIT
eSmartAI
@ SMART_ESCORT_LAST_OOC_POINT
@ SMART_RANDOM_POINT
@ SMART_ACTION_PARAM_COUNT
@ SMART_EVENT_PARAM_COUNT
@ SMART_ESCORT_TARGETS
@ SMART_SUMMON_COUNTER
SMARTAI_SPAWN_FLAGS
@ SMARTAI_SPAWN_FLAG_FORCE_SPAWN
@ SMARTAI_SPAWN_FLAG_NOSAVE_RESPAWN
@ SMARTAI_SPAWN_FLAG_NONE
@ SMARTAI_SPAWN_FLAG_IGNORE_RESPAWN
SmartCastFlags
@ SMARTCAST_TRIGGERED
@ SMARTCAST_COMBAT_MOVE
@ SMARTCAST_INTERRUPT_PREVIOUS
@ SMARTCAST_AURA_NOT_PRESENT
SMART_EVENT_PHASE
@ SMART_EVENT_PHASE_COUNT
@ SMART_EVENT_PHASE_4
@ SMART_EVENT_PHASE_1
@ SMART_EVENT_PHASE_3
@ SMART_EVENT_PHASE_7
@ SMART_EVENT_PHASE_9
@ SMART_EVENT_PHASE_11
@ SMART_EVENT_PHASE_8
@ SMART_EVENT_PHASE_2
@ SMART_EVENT_PHASE_5
@ SMART_EVENT_PHASE_12
@ SMART_EVENT_PHASE_6
@ SMART_EVENT_PHASE_ALWAYS
@ SMART_EVENT_PHASE_10
@ SMART_EVENT_PHASE_MAX
const uint32 SmartAITypeMask[SMART_SCRIPT_TYPE_MAX][2]
std::pair< CacheSpellContainer::const_iterator, CacheSpellContainer::const_iterator > CacheSpellContainerBounds
ObjectVector _objectVector
void UpdateObjects(WorldObject const &ref) const
ObjectVector const * GetObjectVector(WorldObject const &ref) const
ObjectGuidVector(ObjectVector const &objectVector)
void AddGuid(ObjectGuid const &guid)
GuidVector _guidVector
CacheSpellContainer SummonCreatureSpellStore
CacheSpellContainer CreateItemSpellStore
CacheSpellContainer SummonGameObjectSpellStore
CacheSpellContainer KillCreditSpellStore
constexpr bool is_neq(std::partial_ordering cmp) noexcept
Definition: advstd.h:35
struct SmartAction::@66::@135 setRoot
struct SmartAction::@66::@166 addToStoredTargets
uint32 sounds[4]
uint32 targetParam2
SAIBool UseDefaultGravity
struct SmartAction::@66::@143 randomSound
struct SmartAction::@66::@79 crossCast
struct SmartAction::@66::@95 callHelp
struct SmartAction::@66::@128 enableTempGO
struct SmartAction::@66::@85 setEventPhase
uint32 repeatMax
struct SmartAction::@66::@161 conversation
uint32 targetsLimit
SAIBool transport
struct SmartAction::@66::@144 corpseDelay
struct SmartAction::@66::@160 setHealthPct
struct SmartAction::@66::@121 delunitByte
uint32 gameObjectAction
SAIBool disable
struct SmartAction::@66::@108 wpPause
struct SmartAction::@66::@92 setInstanceData
struct SmartAction::@66::@131 setGoLootState
struct SmartAction::@66::@130 sendGossipMenu
struct SmartAction::@66::@105 active
struct SmartAction::@66::@115 storeTargets
SAIBool regenHealth
uint32 wps[SMART_ACTION_PARAM_COUNT]
struct SmartAction::@66::@91 killedMonster
struct SmartAction::@66::@111 setRun
SAIBool allowOverride
struct SmartAction::@66::@107 wpStart
struct SmartAction::@66::@137 creatureGroup
uint32 triggerFlags
struct SmartAction::@66::@102 moveRandom
struct SmartAction::@66::@120 setunitByte
struct SmartAction::@66::@142 moveOffset
struct SmartAction::@66::@104 summonGO
uint32 emotes[SMART_ACTION_PARAM_COUNT]
SAIBool withDelayed
struct SmartAction::@66::@106 taxi
struct SmartAction::@66::@146 groupSpawn
SAIBool withInstant
struct SmartAction::@66::@162 setImmunePC
uint32 transitionMilliseconds
struct SmartAction::@66::@81 threatPCT
uint32 targetParam1
struct SmartAction::@66::@118 equip
struct SmartAction::@66::@148 randomTimedEvent
uint32 includeDecayRatio
struct SmartAction::@66::@134 setHealthRegen
struct SmartAction::@66::@96 setSheath
SAIBool toRespawnPosition
struct SmartAction::@66::@70 faction
struct SmartAction::@66::@129 moveToPos
SAIBool attackInvoker
struct SmartAction::@66::@69 simpleTalk
SAIBool useTalkTarget
uint32 areaLightId
struct SmartAction::@66::@88 follow
struct SmartAction::@66::@97 forceDespawn
SAIBool uninteractible
uint32 targetParam3
struct SmartAction::@66::@155 spellVisualKit
struct SmartAction::@66::@77 randomEmote
struct SmartAction::@66::@117 movie
struct SmartAction::@66::@140 gameEventStart
struct SmartAction::@66::@80 summonCreature
struct SmartAction::@66::@167 becomePersonalClone
struct SmartAction::@66::@109 wpStop
struct SmartAction::@66::@75 questOffer
uint32 spellVisualKitId
struct SmartAction::@66::@138 power
struct SmartAction::@66::@123 randTimedActionList
struct SmartAction::@66::@165 activateGameObject
struct SmartAction::@66::@122 timedActionList
struct SmartAction::@66::@101 setData
struct SmartAction::@66::@94 updateTemplate
struct SmartAction::@66::@141 closestWaypointFromList
struct SmartAction::@66::@103 visibility
struct SmartAction::@66::@152 scene
struct SmartAction::@66::@158 setHover
struct SmartAction::@66::@154 movementSpeed
SAIBool immunePC
struct SmartAction::@66::@159 evade
SAIBool updateLevel
uint32 actionLists[SMART_ACTION_PARAM_COUNT]
SMART_ACTION type
struct SmartAction::@66::@86 incEventPhase
struct SmartAction::@66::@125 interruptSpellCasting
uint32 forceRespawnTimer
uint32 targetType
struct SmartAction::@66::@93 setInstanceData64
uint32 phases[SMART_ACTION_PARAM_COUNT]
struct SmartAction::@66::@83 autoAttack
struct SmartAction::@66::@99 ingamePhaseId
struct SmartAction::@66::@113 teleport
struct SmartAction::@66::@153 cinematic
SAIBool onlySelf
struct SmartAction::@66::@112 setDisableGravity
SAIBool attack
uint32 repeatMin
struct SmartAction::@66::@87 removeAura
SAIBool onlyOwnedAuras
uint32 textGroupID
uint32 castFlags
uint32 overrideLightId
struct SmartAction::@66::@145 disableEvade
struct SmartAction::@66::@98 invincHP
struct SmartAction::@66::@100 ingamePhaseGroup
struct SmartAction::@66::@124 randRangeTimedActionList
uint32 gossipMenuId
struct SmartAction::@66::@116 timeEvent
SAIBool repeat
uint32 gossipNpcTextId
SAIBool disablePathfinding
struct SmartAction::@66::@139 gameEventStop
uint32 timerType
struct SmartAction::@66::@156 overrideLight
uint32 ContactDistance
struct SmartAction::@66::@168 triggerGameEvent
struct SmartAction::@66::@136 goState
uint32 counterId
SAIBool withEmote
SAIBool useSaiTargetAsGameEventSource
struct SmartAction::@66::@126 jump
uint32 summonType
struct SmartAction::@66::@133 setRangedMovement
uint32 speedFraction
uint32 movementSlot
struct SmartAction::@66::@164 setUninteractible
uint32 attackInvoker
SAIBool directAdd
struct SmartAction::@66::@163 setImmuneNPC
uint32 threatINC
struct SmartAction::@66::@76 react
struct SmartAction::@66::@78 cast
uint32 threatDEC
uint32 keyBroadcastTextId
struct SmartAction::@66::@127 fleeAssist
struct SmartAction::@66::@84 combatMove
struct SmartAction::@66::@110 item
struct SmartAction::@66::@169 doAction
uint32 speedInteger
struct SmartAction::@66::@89 randomPhase
uint32 despawnTime
struct SmartAction::@66::@132 sendTargetToTarget
uint32 factionID
struct SmartAction::@66::@68 talk
SAIBool immuneNPC
struct SmartAction::@66::@149 pauseMovement
struct SmartAction::@66::@150 respawnData
uint32 movementType
struct SmartAction::@66::@157 overrideWeather
struct SmartAction::@66::@170 raw
struct SmartAction::@66::@82 threat
struct SmartAction::@66::@71 morphOrMount
struct SmartAction::@66::@90 randomPhaseRange
struct SmartAction::@66::@147 loadEquipment
uint32 creditType
struct SmartAction::@66::@114 setCounter
uint32 event_flags
struct SmartEvent::@29::@36 minMax
uint32 event_phase_mask
struct SmartEvent::@29::@65 raw
struct SmartEvent::@29::@47 dataSet
struct SmartEvent::@29::@46 movementInform
struct SmartEvent::@29::@32 kill
std::string param_string
struct SmartEvent::@29::@48 waypoint
uint32 cooldownMax
struct SmartEvent::@29::@40 summoned
uint32 pointID
struct SmartEvent::@29::@58 goLootStateChanged
uint32 maxDist
struct SmartEvent::@29::@55 gossipHello
struct SmartEvent::@29::@37 targetCasting
struct SmartEvent::@29::@62 distance
uint32 eventId
struct SmartEvent::@29::@60 doAction
uint32 spellId
struct SmartEvent::@29::@59 eventInform
struct SmartEvent::@29::@39 missingBuff
uint32 hostilityMode
Hostility mode of the event. 0: hostile, 1: not hostile, 2: any
uint32 repeatMin
struct SmartEvent::@29::@63 counter
struct SmartEvent::@29::@38 friendlyCC
struct SmartEvent::@29::@34 los
uint32 event_chance
struct SmartEvent::@29::@35 respawn
struct SmartEvent::@29::@56 gossip
SAIBool playerOnly
struct SmartEvent::@29::@61 friendlyHealthPct
struct SmartEvent::@29::@45 charm
uint32 creatureEntry
struct SmartEvent::@29::@52 areatrigger
uint32 lootState
struct SmartEvent::@29::@33 spellHit
struct SmartEvent::@29::@42 questObjective
struct SmartEvent::@29::@50 transportRelocate
uint32 repeatMax
uint32 gameEventId
uint32 textGroupID
uint32 cooldownMin
struct SmartEvent::@29::@54 timedEvent
struct SmartEvent::@29::@64 spellCast
struct SmartEvent::@29::@49 transportAddCreature
uint32 minHpPct
struct SmartEvent::@29::@51 instancePlayerEnter
struct SmartEvent::@29::@57 gameEvent
struct SmartEvent::@29::@44 aura
SAIBool onRemove
uint32 maxHpPct
struct SmartEvent::@29::@31 minMaxRepeat
SMART_EVENT type
uint32 creature
struct SmartEvent::@29::@53 textOver
static constexpr uint32 DEFAULT_PRIORITY
std::strong_ordering operator<=>(SmartScriptHolder const &right) const
uint32 GetScriptType() const
uint32 GetEventType() const
uint32 GetTargetType() const
std::vector< Difficulty > Difficulties
SmartScriptType source_type
uint32 GetActionType() const
struct SmartTarget::@171::@178 playerDistance
struct SmartTarget::@171::@175 unitRange
struct SmartTarget::@171::@185 goClosest
struct SmartTarget::@171::@187 closestFriendly
SAIBool useCharmerOrOwner
SAIBool playerOnly
struct SmartTarget::@171::@184 unitClosest
struct SmartTarget::@171::@182 goGUID
struct SmartTarget::@171::@190 threatList
struct SmartTarget::@171::@183 goDistance
struct SmartTarget::@171::@191 raw
struct SmartTarget::@171::@186 closestAttackable
struct SmartTarget::@171::@189 vehicle
struct SmartTarget::@171::@177 unitDistance
struct SmartTarget::@171::@181 goRange
struct SmartTarget::@171::@173 hostilRandom
struct SmartTarget::@171::@176 unitGUID
struct SmartTarget::@171::@188 owner
struct SmartTarget::@171::@174 farthest
SMARTAI_TARGETS type
struct SmartTarget::@171::@179 playerRange
struct SmartTarget::@171::@180 stored
SmartTarget(SMARTAI_TARGETS t=SMART_TARGET_NONE, uint32 p1=0, uint32 p2=0, uint32 p3=0, uint32 p4=0)