TrinityCore
Loading...
Searching...
No Matches
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 "Define.h"
22#include "EnumFlag.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
44
64
84
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
181 SMART_EVENT_SCENE_START = 78, // don't use on 3.3.5a
182 SMART_EVENT_SCENE_TRIGGER = 79, // don't use on 3.3.5a
183 SMART_EVENT_SCENE_CANCEL = 80, // don't use on 3.3.5a
184 SMART_EVENT_SCENE_COMPLETE = 81, // don't use on 3.3.5a
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
190 SMART_EVENT_SEND_EVENT_TRIGGER = 87, // UNUSED NEEDS CHERRYPICK
191 SMART_EVENT_AREATRIGGER_EXIT = 88, // don't use on 3.3.5a
192 SMART_EVENT_ON_AURA_APPLIED = 89, // SpellID, CooldownMin, CooldownMax
193 SMART_EVENT_ON_AURA_REMOVED = 90, // SpellID, CooldownMin, CooldownMax
194
195 SMART_EVENT_END = 91
197
199{
204 union
205 {
206 struct
207 {
213
214 struct
215 {
221
222 struct
223 {
229
230 struct
231 {
241
242 struct
243 {
248
249 struct
250 {
254
255 struct
256 {
261
262 struct
263 {
268
269 struct
270 {
276
277 struct
278 {
283
284 struct
285 {
290
291 struct
292 {
297
298 struct
299 {
305
306 struct
307 {
310
311 struct
312 {
313 uint32 type;
316
317 struct
318 {
319 uint32 id;
324
325 struct
326 {
330
331 struct
332 {
335
336 struct
337 {
340
341 struct
342 {
347
348 struct
349 {
350 uint32 id;
352
353 struct
354 {
358
359 struct
360 {
361 uint32 id;
363
364 struct
365 {
368
369 struct
370 {
374
375 struct
376 {
379
380 struct
381 {
384
385 struct
386 {
389
390 struct
391 {
394
395 struct
396 {
403
404 struct
405 {
411
412 struct
413 {
414 uint32 id;
419
420 struct
421 {
426
427 struct
428 {
435 };
436
438 {
439 Hostile = 0,
440 NotHostile = 1,
441 Any = 2,
442 End
443 };
444};
445
453
455{
456 SMART_ACTION_NONE = 0, // No action
457 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
458 SMART_ACTION_SET_FACTION = 2, // FactionId (or 0 for default)
459 SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL = 3, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to demorph)
460 SMART_ACTION_SOUND = 4, // SoundId, onlySelf
463 SMART_ACTION_OFFER_QUEST = 7, // QuestID, directAdd
466 SMART_ACTION_RANDOM_EMOTE = 10, // EmoteId1, EmoteId2, EmoteId3...
467 SMART_ACTION_CAST = 11, // SpellId, CastFlags, TriggeredFlags
468 SMART_ACTION_SUMMON_CREATURE = 12, // CreatureID, summonType, duration in ms, attackInvoker, flags(SmartActionSummonCreatureFlags)
472 SMART_ACTION_RESERVED_16 = 16, // used on 4.3.4 and higher scripts
474 SMART_ACTION_SET_UNIT_FLAG = 18, // UNUSED, DO NOT REUSE
475 SMART_ACTION_REMOVE_UNIT_FLAG = 19, // UNUSED, DO NOT REUSE
476 SMART_ACTION_AUTO_ATTACK = 20, // AllowAttackState (0 = stop attack, anything else means continue attacking)
477 SMART_ACTION_ALLOW_COMBAT_MOVEMENT = 21, // AllowCombatMovement (0 = stop combat based movement, anything else continue attacking)
479 SMART_ACTION_INC_EVENT_PHASE = 23, // Value (may be negative to decrement phase, should not be 0)
480 SMART_ACTION_EVADE = 24, // toRespawnPosition (0 = Move to RespawnPosition, 1 = Move to last stored home position)
484 SMART_ACTION_REMOVEAURASFROMSPELL = 28, // Spellid (0 removes all auras), charges (0 removes aura)
485 SMART_ACTION_FOLLOW = 29, // Distance (0 = default), Angle (0 = default), EndCreatureEntry, credit, creditType (0monsterkill, 1event)
486 SMART_ACTION_RANDOM_PHASE = 30, // PhaseId1, PhaseId2, PhaseId3...
487 SMART_ACTION_RANDOM_PHASE_RANGE = 31, // PhaseMin, PhaseMax
490 SMART_ACTION_SET_INST_DATA = 34, // Field, Data, Type (0 = SetData, 1 = SetBossState)
493 SMART_ACTION_DIE = 37, // No Params
495 SMART_ACTION_CALL_FOR_HELP = 39, // Radius, With Emote
496 SMART_ACTION_SET_SHEATH = 40, // Sheath (0-unarmed, 1-melee, 2-ranged)
498 SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue(+pct, -flat)
499 SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL = 43, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to dismount)
501 SMART_ACTION_SET_DATA = 45, // Field, Data (only creature @todo)
506 SMART_ACTION_SUMMON_GO = 50, // GameObjectID, DespawnTime in s
509 SMART_ACTION_WP_START = 53, // run/walk, pathID, canRepeat, quest, despawntime
511 SMART_ACTION_WP_STOP = 55, // despawnTime, quest, fail?
512 SMART_ACTION_ADD_ITEM = 56, // itemID, count
513 SMART_ACTION_REMOVE_ITEM = 57, // itemID, count
514 SMART_ACTION_INSTALL_AI_TEMPLATE = 58, // UNUSED, DO NOT REUSE
517 SMART_ACTION_SET_SWIM = 61, // UNUSED, DO NOT REUSE
518 SMART_ACTION_TELEPORT = 62, // mapID,
519 SMART_ACTION_SET_COUNTER = 63, // id, value, reset (0/1)
523 SMART_ACTION_CREATE_TIMED_EVENT = 67, // id, InitialMin, InitialMax, RepeatMin(only if it repeats), RepeatMax(only if it repeats), chance
525 SMART_ACTION_MOVE_TO_POS = 69, // PointId, transport, disablePathfinding, ContactDistance
526 SMART_ACTION_ENABLE_TEMP_GOBJ = 70, // despawnTimer (sec)
527 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
531 SMART_ACTION_ADD_AURA = 75, // UNUSED, DO NOT REUSE
532 SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT = 76, // UNUSED, DO NOT REUSE
533 SMART_ACTION_RESET_SCRIPT_BASE_OBJECT = 77, // UNUSED, DO NOT REUSE
535 SMART_ACTION_SET_RANGED_MOVEMENT = 79, // Distance, angle
536 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)
540 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)
541 SMART_ACTION_SELF_CAST = 85, // spellID, castFlags
542 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)
549 SMART_ACTION_SEND_GO_CUSTOM_ANIM = 93, // UNUSED, DO NOT REUSE
550 SMART_ACTION_SET_DYNAMIC_FLAG = 94, // UNUSED, DO NOT REUSE
551 SMART_ACTION_ADD_DYNAMIC_FLAG = 95, // UNUSED, DO NOT REUSE
552 SMART_ACTION_REMOVE_DYNAMIC_FLAG = 96, // UNUSED, DO NOT REUSE
553 SMART_ACTION_JUMP_TO_POS = 97, // speedXY, speedZ, targetX, targetY, targetZ
554 SMART_ACTION_SEND_GOSSIP_MENU = 98, // menuId, optionId
559 SMART_ACTION_SET_ROOT = 103, // off/on
560 SMART_ACTION_SET_GO_FLAG = 104, // UNUSED, DO NOT REUSE
561 SMART_ACTION_ADD_GO_FLAG = 105, // UNUSED, DO NOT REUSE
562 SMART_ACTION_REMOVE_GO_FLAG = 106, // UNUSED, DO NOT REUSE
563 SMART_ACTION_SUMMON_CREATURE_GROUP = 107, // Group, attackInvoker
564 SMART_ACTION_SET_POWER = 108, // PowerType, newPower
565 SMART_ACTION_ADD_POWER = 109, // PowerType, newPower
566 SMART_ACTION_REMOVE_POWER = 110, // PowerType, newPower
567 SMART_ACTION_GAME_EVENT_STOP = 111, // GameEventId
568 SMART_ACTION_GAME_EVENT_START = 112, // GameEventId
569 SMART_ACTION_START_CLOSEST_WAYPOINT = 113, // wp1, wp2, wp3, wp4, wp5, wp6, wp7
571 SMART_ACTION_RANDOM_SOUND = 115, // soundId1, soundId2, soundId3, soundId4, soundId5, onlySelf
573 SMART_ACTION_DISABLE_EVADE = 117, // 0/1 (1 = disabled, 0 = enabled)
575 SMART_ACTION_SET_CAN_FLY = 119, // UNUSED, DO NOT REUSE
576 SMART_ACTION_REMOVE_AURAS_BY_TYPE = 120, // UNUSED, DO NOT REUSE
577 SMART_ACTION_SET_SIGHT_DIST = 121, // UNUSED, DO NOT REUSE
578 SMART_ACTION_FLEE = 122, // UNUSED, DO NOT REUSE
579 SMART_ACTION_ADD_THREAT = 123, // +threat, -threat
581 SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT = 125, // id min range, id max range
582 SMART_ACTION_REMOVE_ALL_GAMEOBJECTS = 126, // UNUSED, DO NOT REUSE
583 SMART_ACTION_PAUSE_MOVEMENT = 127, // MovementSlot (default = 0, active = 1, controlled = 2), PauseTime (ms), Force
584 SMART_ACTION_PLAY_ANIMKIT = 128, // don't use on 3.3.5a
585 SMART_ACTION_SCENE_PLAY = 129, // don't use on 3.3.5a
586 SMART_ACTION_SCENE_CANCEL = 130, // don't use on 3.3.5a
587 SMART_ACTION_SPAWN_SPAWNGROUP = 131, // Group ID, min secs, max secs, spawnflags
588 SMART_ACTION_DESPAWN_SPAWNGROUP = 132, // Group ID, min secs, max secs, spawnflags
589 SMART_ACTION_RESPAWN_BY_SPAWNID = 133, // spawnType, spawnId
590 SMART_ACTION_INVOKER_CAST = 134, // spellID, castFlags
591 SMART_ACTION_PLAY_CINEMATIC = 135, // entry, cinematic
592 SMART_ACTION_SET_MOVEMENT_SPEED = 136, // movementType, speedInteger, speedFraction
593 SMART_ACTION_PLAY_SPELL_VISUAL_KIT = 137, // spellVisualKitId (RESERVED, PENDING CHERRYPICK)
594 SMART_ACTION_OVERRIDE_LIGHT = 138, // zoneId, overrideLightID, transitionMilliseconds
595 SMART_ACTION_OVERRIDE_WEATHER = 139, // zoneId, weatherId, intensity
596 SMART_ACTION_SET_AI_ANIM_KIT = 140, // DEPRECATED, DO REUSE (it was never used in any branch, treat as free action id)
599 SMART_ACTION_CREATE_CONVERSATION = 143, // don't use on 3.3.5a
603 SMART_ACTION_ACTIVATE_GAMEOBJECT = 147, // GameObjectActions
606 SMART_ACTION_TRIGGER_GAME_EVENT = 150, // eventId, useSaiTargetAsGameEventSource (RESERVED, PENDING CHERRYPICK)
607 SMART_ACTION_DO_ACTION = 151, // actionId (RESERVED, PENDING CHERRYPICK)
608 SMART_ACTION_COMPLETE_QUEST = 152, // QuestId. Regular quests with objectives can't be completed with this action (only quests with QUEST_FLAGS_COMPLETION_EVENT, QUEST_FLAGS_COMPLETION_AREA_TRIGGER or QUEST_FLAGS_TRACKING_EVENT) (RESERVED, PENDING CHERRYPICK)
609 SMART_ACTION_CREDIT_QUEST_OBJECTIVE_TALK_TO = 153, // (RESERVED, PENDING CHERRYPICK)
610 SMART_ACTION_DESTROY_CONVERSATION = 154, // don't use on 3.3.5a
611 SMART_ACTION_ENTER_VEHICLE = 155, // seat id (RESERVED, PENDING CHERRYPICK)
612 SMART_ACTION_BOARD_PASSENGER = 156, // seat id (RESERVED, PENDING CHERRYPICK)
613 SMART_ACTION_EXIT_VEHICLE = 157, // (RESERVED, PENDING CHERRYPICK)
614 SMART_ACTION_RESUME_MOVEMENT = 158, // MovementSlot (default = 0, active = 1, controlled = 2), ResumeTime (ms)
615 SMART_ACTION_END = 159
617
619{
620 None = 0,
621 PersonalSpawn = 1,
622 PreferUnit = 2,
623
625};
626
628
630{
632
633 union
634 {
635 struct
636 {
641
642 struct
643 {
647
648 struct
649 {
652
653 struct
654 {
658
659 struct
660 {
664 uint32 keyBroadcastTextId; // UNUSED: param reserved for compatibility with master branch
666
667 struct
668 {
671
672 struct
673 {
676
677 struct
678 {
682
683 struct
684 {
687
688 struct
689 {
692
693 struct
694 {
700
701 struct
702 {
710
711 struct
712 {
717 uint32 flags; // SmartActionSummonCreatureFlags
720
721 struct
722 {
726
727 struct
728 {
732
733 struct
734 {
737
738 struct
739 {
742
743 struct
744 {
747
748 struct
749 {
753
754 struct
755 {
760
761 struct
762 {
769
770 struct
771 {
774
775 struct
776 {
780
781 struct
782 {
785
786 struct
787 {
790 uint32 type;
792
793 struct
794 {
797
798 struct
799 {
803
804 struct
805 {
809
810 struct
811 {
814
815 struct
816 {
820
821 struct
822 {
826
827 struct
828 {
831
832 struct
833 {
835 uint32 data;
837
838 struct
839 {
842
843 struct
844 {
847
848 struct
849 {
854
855 struct
856 {
859
860 struct
861 {
864
865 struct
866 {
867 SAIBool run; // unused / overridden by waypoint_data
872 // uint32 reactState; DO NOT REUSE
874
875 struct
876 {
879
880 struct
881 {
886
887 struct
888 {
892
893 struct
894 {
895 SAIBool run;
897
898 struct
899 {
902
903 struct
904 {
907
908 struct
909 {
914
915 struct
916 {
917 uint32 id;
919
920 struct
921 {
922 uint32 id;
929
930 struct
931 {
934
935 struct
936 {
938 uint32 mask;
943
944 struct
945 {
948
949 struct
950 {
952 uint32 type;
954
955 struct
956 {
958 uint32 type;
960
961 struct
962 {
963 uint32 id;
967
968 struct
969 {
972
973 struct
974 {
978
979 struct
980 {
985
986 struct
987 {
991
992 struct
993 {
996
997 struct
998 {
1001
1002 struct
1003 {
1009
1010 struct
1011 {
1015
1016 struct
1017 {
1018 uint32 state;
1020
1021 struct
1022 {
1023 uint32 id;
1025
1026 struct
1027 {
1029 uint32 angle;
1031
1032 struct
1033 {
1036
1037 struct
1038 {
1041
1042 struct
1043 {
1044 uint32 state;
1046
1047 struct
1048 {
1052
1053 struct
1054 {
1058
1059 struct
1060 {
1061 uint32 id;
1063
1064 struct
1065 {
1066 uint32 id;
1068
1069 struct
1070 {
1073
1074 struct
1075 {
1080
1081 struct
1082 {
1086
1087 struct
1088 {
1091
1092 struct
1093 {
1099
1100 struct
1101 {
1102 uint32 id;
1105
1106 struct
1107 {
1111
1112 struct
1113 {
1116 SAIBool force;
1118
1119 struct
1120 {
1124
1125 struct
1126 {
1127 uint32 entry;
1129
1130 struct
1131 {
1136
1137 struct
1138 {
1144
1145 struct
1146 {
1147 uint32 zoneId;
1151
1152 struct
1153 {
1156
1157 struct
1158 {
1161
1162 struct
1163 {
1166
1167 struct
1168 {
1171
1172 struct
1173 {
1176
1177 struct
1178 {
1181
1182 struct
1183 {
1185 uint32 param; // UNUSED: param reserved for compatibility with master branch
1187
1188 struct
1189 {
1190 uint32 id;
1192
1193 struct
1194 {
1198
1201
1202 struct
1203 {
1211 };
1212};
1213
1221
1223{
1225 SMART_TARGET_SELF = 1, // Self cast
1226 SMART_TARGET_VICTIM = 2, // Our current target (ie: highest aggro)
1227 SMART_TARGET_HOSTILE_SECOND_AGGRO = 3, // Second highest aggro, maxdist, playerOnly, powerType + 1
1228 SMART_TARGET_HOSTILE_LAST_AGGRO = 4, // Dead last on aggro, maxdist, playerOnly, powerType + 1
1229 SMART_TARGET_HOSTILE_RANDOM = 5, // Just any random target on our threat list, maxdist, playerOnly, powerType + 1
1230 SMART_TARGET_HOSTILE_RANDOM_NOT_TOP = 6, // Any random target except top threat, maxdist, playerOnly, powerType + 1
1231 SMART_TARGET_ACTION_INVOKER = 7, // Unit who caused this Event to occur
1232 SMART_TARGET_POSITION = 8, // use xyz from event params
1233 SMART_TARGET_CREATURE_RANGE = 9, // CreatureEntry(0any), minDist, maxDist
1234 SMART_TARGET_CREATURE_GUID = 10, // guid, entry
1235 SMART_TARGET_CREATURE_DISTANCE = 11, // CreatureEntry(0any), maxDist
1236 SMART_TARGET_STORED = 12, // id, uses pre-stored target(list)
1237 SMART_TARGET_GAMEOBJECT_RANGE = 13, // entry(0any), min, max
1238 SMART_TARGET_GAMEOBJECT_GUID = 14, // guid, entry
1239 SMART_TARGET_GAMEOBJECT_DISTANCE = 15, // entry(0any), maxDist
1240 SMART_TARGET_INVOKER_PARTY = 16, // invoker's party members
1243 SMART_TARGET_CLOSEST_CREATURE = 19, // CreatureEntry(0any), maxDist, dead?
1244 SMART_TARGET_CLOSEST_GAMEOBJECT = 20, // entry(0any), maxDist
1246 SMART_TARGET_ACTION_INVOKER_VEHICLE = 22, // Unit's vehicle who caused this Event to occur
1247 SMART_TARGET_OWNER_OR_SUMMONER = 23, // Unit's owner or summoner, Use Owner/Charmer of this unit
1248 SMART_TARGET_THREAT_LIST = 24, // All units on creature's threat list, maxdist
1249 SMART_TARGET_CLOSEST_ENEMY = 25, // maxDist, playerOnly
1250 SMART_TARGET_CLOSEST_FRIENDLY = 26, // maxDist, playerOnly
1251 SMART_TARGET_LOOT_RECIPIENTS = 27, // all players that have tagged this creature (for kill credit)
1252 SMART_TARGET_FARTHEST = 28, // maxDist, playerOnly, isInLos
1253 SMART_TARGET_VEHICLE_PASSENGER = 29, // seatMask (0 - all seats)
1254 SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT = 30, // entry(0any), maxDist
1255
1256 SMART_TARGET_END = 31
1258
1260{
1262 {
1263 type = t;
1264 raw.param1 = p1;
1265 raw.param2 = p2;
1266 raw.param3 = p3;
1267 raw.param4 = p4;
1268 x = 0.0f;
1269 y = 0.0f;
1270 z = 0.0f;
1271 o = 0.0f;
1272 }
1274 float x, y, z, o;
1275 union
1276 {
1277 struct
1278 {
1283
1284 struct
1285 {
1290
1291 struct
1292 {
1298
1299 struct
1300 {
1304
1305 struct
1306 {
1311
1312 struct
1313 {
1314 uint32 dist;
1316
1317 struct
1318 {
1322
1323 struct
1324 {
1327
1328 struct
1329 {
1330 uint32 entry;
1335
1336 struct
1337 {
1338 uint32 dbGuid;
1339 uint32 entry;
1341
1342 struct
1343 {
1344 uint32 entry;
1345 uint32 dist;
1348
1349 struct
1350 {
1351 uint32 entry;
1352 uint32 dist;
1355
1356 struct
1357 {
1358 uint32 entry;
1359 uint32 dist;
1361
1362 struct
1363 {
1367
1368 struct
1369 {
1373
1374 struct
1375 {
1378
1379 struct
1380 {
1383
1384 struct
1385 {
1388
1389 struct
1390 {
1396 };
1397};
1398
1416
1432
1449
1451{
1543};
1544
1546{
1547 SMART_EVENT_FLAG_NOT_REPEATABLE = 0x001, // Event can not repeat
1548 SMART_EVENT_FLAG_DIFFICULTY_0 = 0x002, // UNUSED, DO NOT REUSE
1549 SMART_EVENT_FLAG_DIFFICULTY_1 = 0x004, // UNUSED, DO NOT REUSE
1550 SMART_EVENT_FLAG_DIFFICULTY_2 = 0x008, // UNUSED, DO NOT REUSE
1551 SMART_EVENT_FLAG_DIFFICULTY_3 = 0x010, // UNUSED, DO NOT REUSE
1554 SMART_EVENT_FLAG_DEBUG_ONLY = 0x080, //Event only occurs in debug build
1555 SMART_EVENT_FLAG_DONT_RESET = 0x100, //Event will not reset in SmartScript::OnReset()
1556 SMART_EVENT_FLAG_WHILE_CHARMED = 0x200, //Event occurs even if AI owner is charmed
1557
1560
1561 // Temp flags, used only at runtime, never stored in DB
1562 SMART_EVENT_FLAG_TEMP_IGNORE_CHANCE_ROLL = 0x40000000, //Event occurs no matter what roll_chance_i(e.event.event_chance) returns.
1563};
1564
1566{
1567 SMARTCAST_INTERRUPT_PREVIOUS = 0x01, // Interrupt any spell casting
1568 SMARTCAST_TRIGGERED = 0x02, // Triggered (this makes spell cost zero mana and have no cast time)
1569 //SMARTCAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
1570 //SMARTCAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
1571 //SMARTCAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
1572 SMARTCAST_AURA_NOT_PRESENT = 0x20, // Only casts the spell if the target does not have an aura from the spell
1573 SMARTCAST_COMBAT_MOVE = 0x40 // Prevents combat movement if cast successful. Allows movement on range, OOM, LOS
1575
1576// one line in DB is one event
1578{
1582
1587
1591
1593 uint32 GetEventType() const { return (uint32)event.type; }
1596
1602
1603 operator bool() const { return entryOrGuid != 0; }
1604 // Default comparision operator using priority field as first ordering field
1605 std::strong_ordering operator<=>(SmartScriptHolder const& right) const
1606 {
1607 if (std::strong_ordering cmp = priority <=> right.priority; advstd::is_neq(cmp))
1608 return cmp;
1609 if (std::strong_ordering cmp = entryOrGuid <=> right.entryOrGuid; advstd::is_neq(cmp))
1610 return cmp;
1611 if (std::strong_ordering cmp = source_type <=> right.source_type; advstd::is_neq(cmp))
1612 return cmp;
1613 if (std::strong_ordering cmp = event_id <=> right.event_id; advstd::is_neq(cmp))
1614 return cmp;
1615 if (std::strong_ordering cmp = link <=> right.link; advstd::is_neq(cmp))
1616 return cmp;
1617 return std::strong_ordering::equal;
1618 }
1619
1620 static constexpr uint32 DEFAULT_PRIORITY = std::numeric_limits<uint32>::max();
1621};
1622
1623typedef std::vector<WorldObject*> ObjectVector;
1624
1626{
1627 public:
1628 explicit ObjectGuidVector(ObjectVector const& objectVector);
1629
1631 {
1632 UpdateObjects(ref);
1633 return &_objectVector;
1634 }
1635
1636 void AddGuid(ObjectGuid const& guid) { _guidVector.push_back(guid); }
1637
1639
1640 private:
1643
1644 //sanitize vector using _guidVector
1645 void UpdateObjects(WorldObject const& ref) const;
1646};
1647typedef std::unordered_map<uint32, ObjectGuidVector> ObjectVectorMap;
1648
1649// all events for a single entry
1650typedef std::vector<SmartScriptHolder> SmartAIEventList;
1651typedef std::vector<SmartScriptHolder> SmartAIEventStoredList;
1652
1653// all events for all entries / guids
1654typedef std::unordered_map<int32, SmartAIEventList> SmartAIEventMap;
1655
1656// Helper Stores
1657typedef std::map<uint32 /*entry*/, std::pair<uint32 /*spellId*/, SpellEffIndex /*effIndex*/> > CacheSpellContainer;
1658typedef std::pair<CacheSpellContainer::const_iterator, CacheSpellContainer::const_iterator> CacheSpellContainerBounds;
1659
1661{
1662 private:
1665
1666 public:
1667 static SmartAIMgr* instance();
1668
1669 void LoadSmartAIFromDB();
1670
1671 SmartAIEventList GetScript(int32 entry, SmartScriptType type);
1672
1673 static SmartScriptHolder& FindLinkedSourceEvent(SmartAIEventList& list, uint32 eventId);
1674
1675 static SmartScriptHolder& FindLinkedEvent(SmartAIEventList& list, uint32 link);
1676
1677 private:
1678 //event stores
1680
1681 static bool EventHasInvoker(SMART_EVENT event);
1682
1683 bool IsEventValid(SmartScriptHolder& e);
1684 bool IsTargetValid(SmartScriptHolder const& e);
1685
1686 static bool IsMinMaxValid(SmartScriptHolder const& e, uint32 min, uint32 max);
1687
1688 static bool NotNULL(SmartScriptHolder const& e, uint32 data);
1689 static bool IsCreatureValid(SmartScriptHolder const& e, uint32 entry);
1690 static bool IsQuestValid(SmartScriptHolder const& e, uint32 entry);
1691 static bool IsGameObjectValid(SmartScriptHolder const& e, uint32 entry);
1692 static bool IsSpellValid(SmartScriptHolder const& e, uint32 entry);
1693 static bool IsItemValid(SmartScriptHolder const& e, uint32 entry);
1694 static bool IsTextEmoteValid(SmartScriptHolder const& e, uint32 entry);
1695 static bool IsEmoteValid(SmartScriptHolder const& e, uint32 entry);
1696 static bool IsAreaTriggerValid(SmartScriptHolder const& e, uint32 entry);
1697 static bool IsSoundValid(SmartScriptHolder const& e, uint32 entry);
1698 static bool IsTextValid(SmartScriptHolder const& e, uint32 id);
1699
1700 static bool CheckUnusedEventParams(SmartScriptHolder const& e);
1701 static bool CheckUnusedActionParams(SmartScriptHolder const& e);
1702 static bool CheckUnusedTargetParams(SmartScriptHolder const& e);
1703
1704 // Helpers
1705 void LoadHelperStores();
1706 void UnLoadHelperStores();
1707
1708 CacheSpellContainerBounds GetSummonCreatureSpellContainerBounds(uint32 creatureEntry) const;
1709 CacheSpellContainerBounds GetSummonGameObjectSpellContainerBounds(uint32 gameObjectEntry) const;
1710 CacheSpellContainerBounds GetKillCreditSpellContainerBounds(uint32 killCredit) const;
1711 CacheSpellContainerBounds GetCreateItemSpellContainerBounds(uint32 itemId) const;
1712
1717};
1718
1719#define sSmartScriptMgr SmartAIMgr::instance()
1720
1721#endif
#define TC_GAME_API
Definition Define.h:114
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
#define DEFINE_ENUM_FLAG(enumType)
Definition EnumFlag.h:26
std::vector< ObjectGuid > GuidVector
Definition ObjectGuid.h:262
SpellEffIndex
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_WHILE_CHARMED
@ SMART_EVENT_FLAG_DIFFICULTY_ALL
@ SMART_EVENT_FLAG_DIFFICULTY_3
@ SMART_EVENT_FLAG_DONT_RESET
@ SMART_EVENT_FLAG_DEBUG_ONLY
@ SMART_EVENT_FLAGS_ALL
@ SMART_EVENT_FLAG_RESERVED_6
@ SMART_EVENT_FLAG_DIFFICULTY_2
@ SMART_EVENT_FLAG_DIFFICULTY_1
@ SMART_EVENT_FLAG_DIFFICULTY_0
@ 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::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_DESTROY_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_INGAME_PHASE_MASK
@ SMART_ACTION_SET_UNIT_FIELD_BYTES_1
@ SMART_ACTION_CLOSE_GOSSIP
@ SMART_ACTION_RESERVED_16
@ 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_ENTER_VEHICLE
@ 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_REMOVE_POWER
@ SMART_ACTION_SET_DYNAMIC_FLAG
@ SMART_ACTION_RESUME_MOVEMENT
@ 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_BOARD_PASSENGER
@ SMART_ACTION_COMBAT_STOP
@ SMART_ACTION_EXIT_VEHICLE
@ 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_CREDIT_QUEST_OBJECTIVE_TALK_TO
@ 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_COMPLETE_QUEST
@ 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
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_ON_AURA_APPLIED
@ 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_ON_AURA_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_AREATRIGGER_EXIT
@ 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
std::unordered_map< int32, SmartAIEventList > SmartAIEventMap
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
void AddGuid(ObjectGuid const &guid)
CacheSpellContainer SummonCreatureSpellStore
CacheSpellContainer CreateItemSpellStore
CacheSpellContainer SummonGameObjectSpellStore
CacheSpellContainer KillCreditSpellStore
constexpr bool is_neq(std::partial_ordering cmp) noexcept
Definition advstd.h:35
struct SmartAction::@65::@144 loadEquipment
struct SmartAction::@65::@97 invincHP
struct SmartAction::@65::@161 raw
uint32 sounds[4]
uint32 targetParam2
struct SmartAction::@65::@83 combatMove
struct SmartAction::@65::@102 summonGO
struct SmartAction::@65::@70 morphOrMount
struct SmartAction::@65::@146 pauseMovement
uint32 targetsLimit
struct SmartAction::@65::@139 closestWaypointFromList
struct SmartAction::@65::@69 faction
struct SmartAction::@65::@130 sendTargetToTarget
uint32 gameObjectAction
struct SmartAction::@65::@119 delunitByte
struct SmartAction::@65::@129 setGoLootState
struct SmartAction::@65::@85 incEventPhase
SAIBool regenHealth
struct SmartAction::@65::@106 wpPause
uint32 wps[SMART_ACTION_PARAM_COUNT]
SAIBool allowOverride
struct SmartAction::@65::@111 teleport
struct SmartAction::@65::@99 setData
struct SmartAction::@65::@137 gameEventStop
struct SmartAction::@65::@157 setUninteractible
uint32 triggerFlags
struct SmartAction::@65::@134 goState
struct SmartAction::@65::@155 setImmunePC
uint32 emotes[SMART_ACTION_PARAM_COUNT]
SAIBool withDelayed
SAIBool withInstant
uint32 transitionMilliseconds
struct SmartAction::@65::@92 setInstanceData64
struct SmartAction::@65::@127 moveToPos
struct SmartAction::@65::@152 setHover
struct SmartAction::@65::@118 setunitByte
struct SmartAction::@65::@126 enableTempGO
struct SmartAction::@65::@128 sendGossipMenu
struct SmartAction::@65::@141 corpseDelay
struct SmartAction::@65::@121 randTimedActionList
struct SmartAction::@65::@108 item
struct SmartAction::@65::@140 randomSound
uint32 targetParam1
struct SmartAction::@65::@78 crossCast
struct SmartAction::@65::@138 gameEventStart
uint32 includeDecayRatio
struct SmartAction::@65::@74 questOffer
SAIBool toRespawnPosition
SAIBool attackInvoker
SAIBool useTalkTarget
struct SmartAction::@65::@110 setDisableGravity
struct SmartAction::@65::@160 resumeMovement
SAIBool uninteractible
struct SmartAction::@65::@153 evade
uint32 targetParam3
struct SmartAction::@65::@89 randomPhaseRange
struct SmartAction::@65::@120 timedActionList
struct SmartAction::@65::@115 movie
struct SmartAction::@65::@158 activateGameObject
struct SmartAction::@65::@81 threat
struct SmartAction::@65::@67 talk
struct SmartAction::@65::@114 timeEvent
struct SmartAction::@65::@151 overrideWeather
struct SmartAction::@65::@147 respawnData
struct SmartAction::@65::@100 moveRandom
SAIBool updateLevel
struct SmartAction::@65::@131 setRangedMovement
uint32 actionLists[SMART_ACTION_PARAM_COUNT]
SMART_ACTION type
struct SmartAction::@65::@150 overrideLight
uint32 forceRespawnTimer
struct SmartAction::@65::@156 setImmuneNPC
struct SmartAction::@65::@125 fleeAssist
struct SmartAction::@65::@148 cinematic
uint32 phases[SMART_ACTION_PARAM_COUNT]
struct SmartAction::@65::@104 taxi
struct SmartAction::@65::@154 setHealthPct
struct SmartAction::@65::@132 setHealthRegen
struct SmartAction::@65::@75 react
struct SmartAction::@65::@123 interruptSpellCasting
SAIBool onlyOwnedAuras
uint32 overrideLightId
struct SmartAction::@65::@88 randomPhase
struct SmartAction::@65::@93 updateTemplate
struct SmartAction::@65::@96 forceDespawn
struct SmartAction::@65::@124 jump
struct SmartAction::@65::@136 power
uint32 gossipNpcTextId
struct SmartAction::@65::@86 removeAura
SAIBool disablePathfinding
struct SmartAction::@65::@98 ingamePhaseMask
struct SmartAction::@65::@91 setInstanceData
struct SmartAction::@65::@77 cast
uint32 ContactDistance
struct SmartAction::@65::@68 simpleTalk
struct SmartAction::@65::@133 setRoot
SAIBool withEmote
struct SmartAction::@65::@109 setRun
struct SmartAction::@65::@142 disableEvade
struct SmartAction::@65::@113 storeTargets
struct SmartAction::@65::@76 randomEmote
struct SmartAction::@65::@82 autoAttack
struct SmartAction::@65::@87 follow
SAIBool directAdd
struct SmartAction::@65::@94 callHelp
struct SmartAction::@65::@105 wpStart
struct SmartAction::@65::@101 visibility
uint32 keyBroadcastTextId
struct SmartAction::@65::@116 equip
struct SmartAction::@65::@79 summonCreature
struct SmartAction::@65::@107 wpStop
struct SmartAction::@65::@149 movementSpeed
struct SmartAction::@65::@159 addToStoredTargets
struct SmartAction::@65::@143 groupSpawn
struct SmartAction::@65::@80 threatPCT
struct SmartAction::@65::@103 active
struct SmartAction::@65::@84 setEventPhase
struct SmartAction::@65::@145 randomTimedEvent
struct SmartAction::@65::@112 setCounter
struct SmartAction::@65::@122 randRangeTimedActionList
struct SmartAction::@65::@95 setSheath
struct SmartAction::@65::@90 killedMonster
struct SmartAction::@65::@135 creatureGroup
uint32 event_flags
struct SmartEvent::@29::@62 counter
struct SmartEvent::@29::@36 minMax
struct SmartEvent::@29::@56 gameEvent
struct SmartEvent::@29::@50 instancePlayerEnter
struct SmartEvent::@29::@45 movementInform
uint32 event_phase_mask
struct SmartEvent::@29::@44 charm
struct SmartEvent::@29::@52 textOver
struct SmartEvent::@29::@32 kill
uint32 cooldownMax
struct SmartEvent::@29::@40 summoned
struct SmartEvent::@29::@54 gossipHello
struct SmartEvent::@29::@59 doAction
struct SmartEvent::@29::@37 targetCasting
struct SmartEvent::@29::@48 transportAddCreature
struct SmartEvent::@29::@43 aura
struct SmartEvent::@29::@46 dataSet
struct SmartEvent::@29::@58 eventInform
struct SmartEvent::@29::@39 missingBuff
uint32 hostilityMode
Hostility mode of the event. 0: hostile, 1: not hostile, 2: any.
struct SmartEvent::@29::@49 transportRelocate
struct SmartEvent::@29::@61 distance
struct SmartEvent::@29::@38 friendlyCC
struct SmartEvent::@29::@34 los
uint32 event_chance
struct SmartEvent::@29::@63 spellCast
struct SmartEvent::@29::@35 respawn
struct SmartEvent::@29::@60 friendlyHealthPct
SAIBool playerOnly
uint32 creatureEntry
struct SmartEvent::@29::@57 goLootStateChanged
struct SmartEvent::@29::@33 spellHit
struct SmartEvent::@29::@53 timedEvent
struct SmartEvent::@29::@47 waypoint
uint32 gameEventId
uint32 textGroupID
uint32 cooldownMin
struct SmartEvent::@29::@51 areatrigger
struct SmartEvent::@29::@64 raw
SAIBool onRemove
struct SmartEvent::@29::@55 gossip
struct SmartEvent::@29::@31 minMaxRepeat
SMART_EVENT type
static constexpr uint32 DEFAULT_PRIORITY
std::strong_ordering operator<=>(SmartScriptHolder const &right) const
uint32 GetScriptType() const
uint32 GetEventType() const
uint32 GetTargetType() const
SmartScriptType source_type
uint32 GetActionType() const
struct SmartTarget::@162::@180 vehicle
struct SmartTarget::@162::@170 playerRange
struct SmartTarget::@162::@166 unitRange
struct SmartTarget::@162::@179 owner
struct SmartTarget::@162::@175 unitClosest
struct SmartTarget::@162::@171 stored
struct SmartTarget::@162::@167 unitGUID
SAIBool useCharmerOrOwner
struct SmartTarget::@162::@173 goGUID
struct SmartTarget::@162::@181 threatList
struct SmartTarget::@162::@178 closestFriendly
struct SmartTarget::@162::@177 closestAttackable
struct SmartTarget::@162::@172 goRange
struct SmartTarget::@162::@168 unitDistance
struct SmartTarget::@162::@174 goDistance
struct SmartTarget::@162::@182 raw
SMARTAI_TARGETS type
struct SmartTarget::@162::@169 playerDistance
struct SmartTarget::@162::@165 farthest
struct SmartTarget::@162::@176 goClosest
struct SmartTarget::@162::@164 hostilRandom
SmartTarget(SMARTAI_TARGETS t=SMART_TARGET_NONE, uint32 p1=0, uint32 p2=0, uint32 p3=0, uint32 p4=0)