AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
SmartAIMgr Class Reference

#include "SmartScriptMgr.h"

Public Member Functions

 ~SmartAIMgr ()
 
void LoadSmartAIFromDB ()
 
void CheckIfSmartAIInDatabaseExists ()
 
SmartAIEventList GetScript (int32 entry, SmartScriptType type)
 

Static Public Member Functions

static SmartAIMgrinstance ()
 

Private Member Functions

 SmartAIMgr ()
 
bool IsEventValid (SmartScriptHolder &e)
 
bool IsTargetValid (SmartScriptHolder const &e)
 
bool IsMinMaxValid (SmartScriptHolder const &e, uint32 min, uint32 max)
 
bool NotNULL (SmartScriptHolder const &e, uint32 data)
 
bool IsCreatureValid (SmartScriptHolder const &e, uint32 entry)
 
bool IsQuestValid (SmartScriptHolder const &e, uint32 entry)
 
bool IsGameObjectValid (SmartScriptHolder const &e, uint32 entry)
 
bool IsSpellValid (SmartScriptHolder const &e, uint32 entry)
 
bool IsItemValid (SmartScriptHolder const &e, uint32 entry)
 
bool IsTextEmoteValid (SmartScriptHolder const &e, uint32 entry)
 
bool IsEmoteValid (SmartScriptHolder const &e, uint32 entry)
 
bool IsAreaTriggerValid (SmartScriptHolder const &e, uint32 entry)
 
bool IsSoundValid (SmartScriptHolder const &e, uint32 entry)
 

Static Private Member Functions

static bool EventHasInvoker (SMART_EVENT event)
 
static bool IsTextValid (SmartScriptHolder const &e, uint32 id)
 
static bool CheckUnusedEventParams (SmartScriptHolder const &e)
 
static bool CheckUnusedActionParams (SmartScriptHolder const &e)
 
static bool CheckUnusedTargetParams (SmartScriptHolder const &e)
 

Private Attributes

SmartAIEventMap mEventMap [SMART_SCRIPT_TYPE_MAX]
 

Detailed Description

Constructor & Destructor Documentation

◆ SmartAIMgr()

SmartAIMgr::SmartAIMgr ( )
inlineprivate
2061{};

◆ ~SmartAIMgr()

SmartAIMgr::~SmartAIMgr ( )
inline
2063{};

Member Function Documentation

◆ CheckIfSmartAIInDatabaseExists()

void SmartAIMgr::CheckIfSmartAIInDatabaseExists ( )
306{
307 // SMART_SCRIPT_TYPE_CREATURE
308 for (auto const& [entry, creatureTemplate] : *sObjectMgr->GetCreatureTemplates())
309 {
310 if (creatureTemplate.AIName != "SmartAI")
311 continue;
312
313 bool found = false;
314
315 // check template SAI
316 if (mEventMap[uint32(SmartScriptType::SMART_SCRIPT_TYPE_CREATURE)].find(creatureTemplate.Entry) != mEventMap[uint32(SmartScriptType::SMART_SCRIPT_TYPE_CREATURE)].end())
317 found = true;
318 else
319 {
320 // check GUID SAI
321 for (auto const& pair : sObjectMgr->GetAllCreatureData())
322 {
323 if (pair.second.id1 != creatureTemplate.Entry)
324 continue;
325
326 if (mEventMap[uint32(SmartScriptType::SMART_SCRIPT_TYPE_CREATURE)].find((-1) * pair.first) != mEventMap[uint32(SmartScriptType::SMART_SCRIPT_TYPE_CREATURE)].end())
327 {
328 found = true;
329 break;
330 }
331 }
332 }
333
334 if (!found)
335 LOG_ERROR("sql.sql", "Creature entry ({}) has SmartAI enabled but no SmartAI entries in the database.", creatureTemplate.Entry);
336 }
337
338 // SMART_SCRIPT_TYPE_GAMEOBJECT
339 for (auto const& [entry, gameobjectTemplate] : *sObjectMgr->GetGameObjectTemplates())
340 {
341 if (gameobjectTemplate.AIName != "SmartGameObjectAI")
342 continue;
343
344 bool found = false;
345
346 // check template SAI
347 if (mEventMap[uint32(SmartScriptType::SMART_SCRIPT_TYPE_GAMEOBJECT)].find(gameobjectTemplate.entry) != mEventMap[uint32(SmartScriptType::SMART_SCRIPT_TYPE_GAMEOBJECT)].end())
348 found = true;
349 else
350 {
351 // check GUID SAI
352 for (auto const& pair : sObjectMgr->GetAllGOData())
353 {
354 if (pair.second.id != gameobjectTemplate.entry)
355 continue;
356
357 if (mEventMap[uint32(SmartScriptType::SMART_SCRIPT_TYPE_GAMEOBJECT)].find((-1) * pair.first) != mEventMap[uint32(SmartScriptType::SMART_SCRIPT_TYPE_GAMEOBJECT)].end())
358 {
359 found = true;
360 break;
361 }
362 }
363 }
364
365 if (!found)
366 LOG_ERROR("sql.sql", "Gameobject entry ({}) has SmartGameobjectAI enabled but no SmartAI entries in the database.", gameobjectTemplate.entry);
367 }
368
369 // SMART_SCRIPT_TYPE_AREATRIGGER
370 uint32 scriptID = sObjectMgr->GetScriptId("SmartTrigger");
371
372 for (auto const& pair : sObjectMgr->GetAllAreaTriggerScriptData())
373 {
374 if (pair.second != scriptID)
375 continue;
376
377 if (mEventMap[uint32(SmartScriptType::SMART_SCRIPT_TYPE_AREATRIGGER)].find(pair.first) == mEventMap[uint32(SmartScriptType::SMART_SCRIPT_TYPE_AREATRIGGER)].end())
378 LOG_ERROR("sql.sql", "AreaTrigger entry ({}) has SmartTrigger enabled but no SmartAI entries in the database.", pair.first);
379 }
380}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:157
std::uint32_t uint32
Definition: Define.h:107
#define sObjectMgr
Definition: ObjectMgr.h:1635
SmartAIEventMap mEventMap[SMART_SCRIPT_TYPE_MAX]
Definition: SmartScriptMgr.h:2085

References LOG_ERROR, mEventMap, and sObjectMgr.

Referenced by LoadSmartAIFromDB().

◆ CheckUnusedActionParams()

bool SmartAIMgr::CheckUnusedActionParams ( SmartScriptHolder const &  e)
staticprivate
688{
689 std::size_t paramsStructSize = [&]() -> std::size_t
690 {
691 constexpr std::size_t NO_PARAMS = std::size_t(0);
692 switch (e.action.type)
693 {
694 case SMART_ACTION_NONE: return NO_PARAMS;
695 case SMART_ACTION_TALK: return sizeof(SmartAction::talk);
698 case SMART_ACTION_SOUND: return sizeof(SmartAction::sound);
699 case SMART_ACTION_PLAY_EMOTE: return sizeof(SmartAction::emote);
700 case SMART_ACTION_FAIL_QUEST: return sizeof(SmartAction::quest);
703 case SMART_ACTION_ACTIVATE_GOBJECT: return NO_PARAMS;
705 case SMART_ACTION_CAST: return sizeof(SmartAction::cast);
710 case SMART_ACTION_RESERVED_16: return sizeof(SmartAction::raw);
718 case SMART_ACTION_EVADE: return NO_PARAMS;
721 case SMART_ACTION_COMBAT_STOP: return NO_PARAMS;
723 case SMART_ACTION_FOLLOW: return sizeof(SmartAction::follow);
726 case SMART_ACTION_RESET_GOBJECT: return NO_PARAMS;
731 case SMART_ACTION_DIE: return sizeof(SmartAction::die);
732 case SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: return NO_PARAMS;
739 case SMART_ACTION_SET_DATA: return sizeof(SmartAction::setData);
741 case SMART_ACTION_ATTACK_STOP: return NO_PARAMS;
744 case SMART_ACTION_ATTACK_START: return NO_PARAMS;
746 case SMART_ACTION_KILL_UNIT: return NO_PARAMS;
748 case SMART_ACTION_WP_START: return sizeof(SmartAction::wpStart);
749 case SMART_ACTION_WP_PAUSE: return sizeof(SmartAction::wpPause);
750 case SMART_ACTION_WP_STOP: return sizeof(SmartAction::wpStop);
751 case SMART_ACTION_ADD_ITEM: return sizeof(SmartAction::item);
752 case SMART_ACTION_REMOVE_ITEM: return sizeof(SmartAction::item);
754 case SMART_ACTION_SET_RUN: return sizeof(SmartAction::setRun);
755 case SMART_ACTION_SET_FLY: return sizeof(SmartAction::setFly);
756 case SMART_ACTION_SET_SWIM: return sizeof(SmartAction::setSwim);
757 case SMART_ACTION_TELEPORT: return sizeof(SmartAction::teleport);
760 case SMART_ACTION_WP_RESUME: return NO_PARAMS;
763 case SMART_ACTION_PLAYMOVIE: return sizeof(SmartAction::movie);
766 case SMART_ACTION_EQUIP: return sizeof(SmartAction::equip);
767 case SMART_ACTION_CLOSE_GOSSIP: return NO_PARAMS;
770 case SMART_ACTION_ADD_AURA: return sizeof(SmartAction::addAura);
771 case SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT: return NO_PARAMS;
772 case SMART_ACTION_RESET_SCRIPT_BASE_OBJECT: return NO_PARAMS;
773 case SMART_ACTION_CALL_SCRIPT_RESET: return NO_PARAMS;
776 case SMART_ACTION_SET_NPC_FLAG: return sizeof(SmartAction::flag);
777 case SMART_ACTION_ADD_NPC_FLAG: return sizeof(SmartAction::flag);
780 case SMART_ACTION_SELF_CAST: return sizeof(SmartAction::cast);
781 case SMART_ACTION_INVOKER_CAST: return sizeof(SmartAction::cast);
793 case SMART_ACTION_JUMP_TO_POS: return sizeof(SmartAction::jump);
799 case SMART_ACTION_SET_ROOT: return sizeof(SmartAction::setRoot);
804 case SMART_ACTION_SET_POWER: return sizeof(SmartAction::power);
805 case SMART_ACTION_ADD_POWER: return sizeof(SmartAction::power);
815 // case SMART_ACTION_SET_CAN_FLY: return sizeof(SmartAction::setFly);
816 // case SMART_ACTION_REMOVE_AURAS_BY_TYPE: return sizeof(SmartAction::auraType);
818 case SMART_ACTION_FLEE: return sizeof(SmartAction::flee);
819 case SMART_ACTION_ADD_THREAT: return sizeof(SmartAction::threat);
822 case SMART_ACTION_REMOVE_ALL_GAMEOBJECTS: return NO_PARAMS;
823 // case SMART_ACTION_PAUSE_MOVEMENT: return sizeof(SmartAction::pauseMovement);
824 case SMART_ACTION_PLAY_ANIMKIT: return sizeof(SmartAction::raw);
825 case SMART_ACTION_SCENE_PLAY: return sizeof(SmartAction::raw);
826 case SMART_ACTION_SCENE_CANCEL: return sizeof(SmartAction::raw);
827 // case SMART_ACTION_SPAWN_SPAWNGROUP: return sizeof(SmartAction::groupSpawn);
828 // case SMART_ACTION_DESPAWN_SPAWNGROUP: return sizeof(SmartAction::groupSpawn);
829 // case SMART_ACTION_RESPAWN_BY_SPAWNID: return sizeof(SmartAction::respawnData);
832 // case SMART_ACTION_PLAY_SPELL_VISUAL_KIT: return sizeof(SmartAction::raw);
833 // case SMART_ACTION_OVERRIDE_LIGHT: return sizeof(SmartAction::overrideLight);
834 // case SMART_ACTION_OVERRIDE_WEATHER: return sizeof(SmartAction::overrideWeather);
835 // case SMART_ACTION_SET_AI_ANIM_KIT: return sizeof(SmartAction::raw);
838 // case SMART_ACTION_CREATE_CONVERSATION: return sizeof(SmartAction::raw);
840 case SMART_ACTION_EXIT_VEHICLE: return NO_PARAMS;
843 case SMART_ACTION_FALL: return NO_PARAMS;
846 case SMART_ACTION_NO_ENVIRONMENT_UPDATE: return NO_PARAMS;
847 case SMART_ACTION_ZONE_UNDER_ATTACK: return NO_PARAMS;
848 case SMART_ACTION_LOAD_GRID: return NO_PARAMS;
849 case SMART_ACTION_MUSIC: return sizeof(SmartAction::music);
850 case SMART_ACTION_SET_GUID: return sizeof(SmartAction::setGuid);
859 case SMART_ACTION_MOVEMENT_STOP: return NO_PARAMS;
863 default:
864 LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using an action with no unused params specified in SmartAIMgr::CheckUnusedActionParams(), please report this.",
865 e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
866 return sizeof(SmartAction::raw);
867 }
868 }();
869
870 static std::size_t rawCount = sizeof(SmartAction::raw) / sizeof(uint32);
871 std::size_t paramsCount = paramsStructSize / sizeof(uint32);
872
873 bool valid = true;
874 for (std::size_t index = paramsCount; index < rawCount; index++)
875 {
876 uint32 value = ((uint32*)&e.action.raw)[index];
877 if (value != 0)
878 {
879 LOG_ERROR("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} has unused action_param{} with value {}, it must be 0, skipped.",
880 e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), index + 1, value);
881 valid = false;
882 }
883 }
884
885 return valid;
886}
#define LOG_WARN(filterType__,...)
Definition: Log.h:161
@ SMART_ACTION_REMOVE_TIMED_EVENT
Definition: SmartScriptMgr.h:632
@ SMART_ACTION_NONE
Definition: SmartScriptMgr.h:558
@ SMART_ACTION_SET_GO_FLAG
Definition: SmartScriptMgr.h:662
@ SMART_ACTION_WP_RESUME
Definition: SmartScriptMgr.h:623
@ SMART_ACTION_UPDATE_TEMPLATE
Definition: SmartScriptMgr.h:594
@ SMART_ACTION_STORE_TARGET_LIST
Definition: SmartScriptMgr.h:622
@ SMART_ACTION_SET_HEALTH_REGEN
Definition: SmartScriptMgr.h:660
@ SMART_ACTION_ACTIVATE_GOBJECT
Definition: SmartScriptMgr.h:567
@ SMART_ACTION_FORCE_DESPAWN
Definition: SmartScriptMgr.h:599
@ SMART_ACTION_GAME_EVENT_START
Definition: SmartScriptMgr.h:670
@ SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:646
@ SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1
Definition: SmartScriptMgr.h:649
@ SMART_ACTION_SET_INST_DATA64
Definition: SmartScriptMgr.h:593
@ SMART_ACTION_SET_FACTION
Definition: SmartScriptMgr.h:560
@ SMART_ACTION_THREAT_SINGLE_PCT
Definition: SmartScriptMgr.h:571
@ SMART_ACTION_OFFER_QUEST
Definition: SmartScriptMgr.h:565
@ SMART_ACTION_REMOVE_ALL_GAMEOBJECTS
Definition: SmartScriptMgr.h:684
@ SMART_ACTION_RISE_UP
Definition: SmartScriptMgr.h:672
@ SMART_ACTION_SET_INGAME_PHASE_MASK
Definition: SmartScriptMgr.h:602
@ SMART_ACTION_SET_UNIT_FIELD_BYTES_1
Definition: SmartScriptMgr.h:648
@ SMART_ACTION_CLOSE_GOSSIP
Definition: SmartScriptMgr.h:630
@ SMART_ACTION_RESERVED_16
Definition: SmartScriptMgr.h:574
@ SMART_ACTION_DISABLE_EVADE
Definition: SmartScriptMgr.h:675
@ SMART_ACTION_ADD_GO_FLAG
Definition: SmartScriptMgr.h:663
@ SMART_ACTION_ADD_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:653
@ SMART_ACTION_KILL_UNIT
Definition: SmartScriptMgr.h:609
@ SMART_ACTION_LOAD_EQUIPMENT
Definition: SmartScriptMgr.h:682
@ SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS
Definition: SmartScriptMgr.h:573
@ SMART_ACTION_ATTACK_START
Definition: SmartScriptMgr.h:607
@ SMART_ACTION_MOVEMENT_RESUME
Definition: SmartScriptMgr.h:739
@ SMART_ACTION_SET_UNIT_FLAG
Definition: SmartScriptMgr.h:576
@ SMART_ACTION_NO_ENVIRONMENT_UPDATE
Definition: SmartScriptMgr.h:715
@ SMART_ACTION_CALL_GROUPEVENTHAPPENS
Definition: SmartScriptMgr.h:584
@ SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL
Definition: SmartScriptMgr.h:601
@ SMART_ACTION_INVOKER_CAST
Definition: SmartScriptMgr.h:692
@ SMART_ACTION_SCENE_PLAY
Definition: SmartScriptMgr.h:687
@ SMART_ACTION_MOVEMENT_STOP
Definition: SmartScriptMgr.h:737
@ SMART_ACTION_SET_SCALE
Definition: SmartScriptMgr.h:730
@ SMART_ACTION_JUMP_TO_POS
Definition: SmartScriptMgr.h:655
@ SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:645
@ SMART_ACTION_SEND_GOSSIP_MENU
Definition: SmartScriptMgr.h:656
@ SMART_ACTION_SET_COUNTER
Definition: SmartScriptMgr.h:621
@ SMART_ACTION_FLEE_FOR_ASSIST
Definition: SmartScriptMgr.h:583
@ SMART_ACTION_EQUIP
Definition: SmartScriptMgr.h:629
@ SMART_ACTION_SET_ROOT
Definition: SmartScriptMgr.h:661
@ SMART_ACTION_ATTACK_STOP
Definition: SmartScriptMgr.h:727
@ SMART_ACTION_SUMMON_GO
Definition: SmartScriptMgr.h:608
@ SMART_ACTION_SET_HOVER
Definition: SmartScriptMgr.h:709
@ SMART_ACTION_WP_PAUSE
Definition: SmartScriptMgr.h:612
@ SMART_ACTION_SIMPLE_TALK
Definition: SmartScriptMgr.h:642
@ SMART_ACTION_STOP_MOTION
Definition: SmartScriptMgr.h:714
@ SMART_ACTION_CAST
Definition: SmartScriptMgr.h:569
@ SMART_ACTION_WORLD_SCRIPT
Definition: SmartScriptMgr.h:740
@ SMART_ACTION_MUSIC
Definition: SmartScriptMgr.h:718
@ SMART_ACTION_SET_ORIENTATION_TARGET
Definition: SmartScriptMgr.h:734
@ SMART_ACTION_ALLOW_COMBAT_MOVEMENT
Definition: SmartScriptMgr.h:579
@ SMART_ACTION_SET_UNIT_MOVEMENT_FLAGS
Definition: SmartScriptMgr.h:706
@ SMART_ACTION_ADD_AURA
Definition: SmartScriptMgr.h:633
@ SMART_ACTION_THREAT_ALL_PCT
Definition: SmartScriptMgr.h:572
@ SMART_ACTION_RESPAWN_TARGET
Definition: SmartScriptMgr.h:628
@ SMART_ACTION_FOLLOW_GROUP
Definition: SmartScriptMgr.h:733
@ SMART_ACTION_SOUND
Definition: SmartScriptMgr.h:562
@ SMART_ACTION_MOVE_TO_POS_TARGET
Definition: SmartScriptMgr.h:703
@ SMART_ACTION_SET_MOVEMENT_SPEED
Definition: SmartScriptMgr.h:694
@ SMART_ACTION_PLAY_CINEMATIC
Definition: SmartScriptMgr.h:693
@ SMART_ACTION_ADD_NPC_FLAG
Definition: SmartScriptMgr.h:640
@ SMART_ACTION_EVADE
Definition: SmartScriptMgr.h:582
@ SMART_ACTION_FAIL_QUEST
Definition: SmartScriptMgr.h:564
@ SMART_ACTION_INTERRUPT_SPELL
Definition: SmartScriptMgr.h:650
@ SMART_ACTION_ADD_POWER
Definition: SmartScriptMgr.h:667
@ SMART_ACTION_REMOVE_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:654
@ SMART_ACTION_WAYPOINT_DATA_START
Definition: SmartScriptMgr.h:735
@ SMART_ACTION_RANDOM_SOUND
Definition: SmartScriptMgr.h:673
@ SMART_ACTION_SET_COMBAT_DISTANCE
Definition: SmartScriptMgr.h:707
@ SMART_ACTION_SCENE_CANCEL
Definition: SmartScriptMgr.h:688
@ SMART_ACTION_SET_POWER
Definition: SmartScriptMgr.h:666
@ SMART_ACTION_MOVE_FORWARD
Definition: SmartScriptMgr.h:604
@ SMART_ACTION_SEND_TARGET_TO_TARGET
Definition: SmartScriptMgr.h:658
@ SMART_ACTION_REMOVE_POWER
Definition: SmartScriptMgr.h:668
@ SMART_ACTION_SET_DYNAMIC_FLAG
Definition: SmartScriptMgr.h:652
@ SMART_ACTION_FALL
Definition: SmartScriptMgr.h:712
@ SMART_ACTION_GO_SET_GO_STATE
Definition: SmartScriptMgr.h:676
@ SMART_ACTION_REMOVE_ITEM
Definition: SmartScriptMgr.h:615
@ SMART_ACTION_SEND_GO_CUSTOM_ANIM
Definition: SmartScriptMgr.h:651
@ SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL
Definition: SmartScriptMgr.h:561
@ SMART_ACTION_REMOVE_UNIT_FLAG
Definition: SmartScriptMgr.h:577
@ SMART_ACTION_RANDOM_PHASE
Definition: SmartScriptMgr.h:588
@ SMART_ACTION_SET_EMOTE_STATE
Definition: SmartScriptMgr.h:575
@ SMART_ACTION_CROSS_CAST
Definition: SmartScriptMgr.h:644
@ SMART_ACTION_WP_STOP
Definition: SmartScriptMgr.h:613
@ SMART_ACTION_GAME_EVENT_STOP
Definition: SmartScriptMgr.h:669
@ SMART_ACTION_CALL_KILLEDMONSTER
Definition: SmartScriptMgr.h:591
@ SMART_ACTION_SCRIPTED_SPAWN
Definition: SmartScriptMgr.h:729
@ SMART_ACTION_TALK
Definition: SmartScriptMgr.h:559
@ SMART_ACTION_CALL_SCRIPT_RESET
Definition: SmartScriptMgr.h:636
@ SMART_ACTION_SET_DATA
Definition: SmartScriptMgr.h:603
@ SMART_ACTION_WP_START
Definition: SmartScriptMgr.h:611
@ SMART_ACTION_COMBAT_STOP
Definition: SmartScriptMgr.h:585
@ SMART_ACTION_EXIT_VEHICLE
Definition: SmartScriptMgr.h:705
@ SMART_ACTION_SET_RUN
Definition: SmartScriptMgr.h:617
@ SMART_ACTION_SET_HEALTH_PCT
Definition: SmartScriptMgr.h:696
@ SMART_ACTION_AUTO_ATTACK
Definition: SmartScriptMgr.h:578
@ SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL
Definition: SmartScriptMgr.h:600
@ SMART_ACTION_SET_VISIBILITY
Definition: SmartScriptMgr.h:605
@ SMART_ACTION_RANDOM_PHASE_RANGE
Definition: SmartScriptMgr.h:589
@ SMART_ACTION_MOVEMENT_PAUSE
Definition: SmartScriptMgr.h:738
@ SMART_ACTION_GO_SET_LOOT_STATE
Definition: SmartScriptMgr.h:657
@ SMART_ACTION_SELF_CAST
Definition: SmartScriptMgr.h:643
@ SMART_ACTION_SET_SWIM
Definition: SmartScriptMgr.h:619
@ SMART_ACTION_SET_SIGHT_DIST
Definition: SmartScriptMgr.h:679
@ SMART_ACTION_SET_INST_DATA
Definition: SmartScriptMgr.h:592
@ SMART_ACTION_PLAY_ANIMKIT
Definition: SmartScriptMgr.h:686
@ SMART_ACTION_REMOVE_GO_FLAG
Definition: SmartScriptMgr.h:664
@ SMART_ACTION_LOAD_GRID
Definition: SmartScriptMgr.h:717
@ SMART_ACTION_CALL_FOR_HELP
Definition: SmartScriptMgr.h:597
@ SMART_ACTION_SUMMON_RADIAL
Definition: SmartScriptMgr.h:731
@ SMART_ACTION_ADD_THREAT
Definition: SmartScriptMgr.h:681
@ SMART_ACTION_TELEPORT
Definition: SmartScriptMgr.h:620
@ SMART_ACTION_PLAYMOVIE
Definition: SmartScriptMgr.h:626
@ SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT
Definition: SmartScriptMgr.h:683
@ SMART_ACTION_FOLLOW
Definition: SmartScriptMgr.h:587
@ SMART_ACTION_PLAY_EMOTE
Definition: SmartScriptMgr.h:563
@ SMART_ACTION_SET_EVENT_PHASE
Definition: SmartScriptMgr.h:580
@ SMART_ACTION_SET_CORPSE_DELAY
Definition: SmartScriptMgr.h:674
@ SMART_ACTION_WAYPOINT_DATA_RANDOM
Definition: SmartScriptMgr.h:736
@ SMART_ACTION_SET_GUID
Definition: SmartScriptMgr.h:728
@ SMART_ACTION_SET_SHEATH
Definition: SmartScriptMgr.h:598
@ SMART_ACTION_SET_ORIENTATION
Definition: SmartScriptMgr.h:624
@ SMART_ACTION_SET_NPC_FLAG
Definition: SmartScriptMgr.h:639
@ SMART_ACTION_MOVE_TO_POS
Definition: SmartScriptMgr.h:627
@ SMART_ACTION_RANDOM_EMOTE
Definition: SmartScriptMgr.h:568
@ SMART_ACTION_INC_EVENT_PHASE
Definition: SmartScriptMgr.h:581
@ SMART_ACTION_CREATE_TIMED_EVENT
Definition: SmartScriptMgr.h:625
@ SMART_ACTION_SET_EVENT_FLAG_RESET
Definition: SmartScriptMgr.h:713
@ SMART_ACTION_DIE
Definition: SmartScriptMgr.h:595
@ SMART_ACTION_RESET_SCRIPT_BASE_OBJECT
Definition: SmartScriptMgr.h:635
@ SMART_ACTION_REMOVE_NPC_FLAG
Definition: SmartScriptMgr.h:641
@ SMART_ACTION_SET_FLY
Definition: SmartScriptMgr.h:618
@ SMART_ACTION_INSTALL_AI_TEMPLATE
Definition: SmartScriptMgr.h:616
@ SMART_ACTION_SUMMON_CREATURE
Definition: SmartScriptMgr.h:570
@ SMART_ACTION_RESET_GOBJECT
Definition: SmartScriptMgr.h:590
@ SMART_ACTION_CALL_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:638
@ SMART_ACTION_SET_IN_COMBAT_WITH_ZONE
Definition: SmartScriptMgr.h:596
@ SMART_ACTION_SET_HOME_POS
Definition: SmartScriptMgr.h:659
@ SMART_ACTION_ADD_ITEM
Definition: SmartScriptMgr.h:614
@ SMART_ACTION_SET_ACTIVE
Definition: SmartScriptMgr.h:606
@ SMART_ACTION_SET_RANGED_MOVEMENT
Definition: SmartScriptMgr.h:637
@ SMART_ACTION_ACTIVATE_TAXI
Definition: SmartScriptMgr.h:610
@ SMART_ACTION_START_CLOSEST_WAYPOINT
Definition: SmartScriptMgr.h:671
@ SMART_ACTION_SUMMON_CREATURE_GROUP
Definition: SmartScriptMgr.h:665
@ SMART_ACTION_PLAY_SPELL_VISUAL
Definition: SmartScriptMgr.h:732
@ SMART_ACTION_SET_REACT_STATE
Definition: SmartScriptMgr.h:566
@ SMART_ACTION_RANDOM_MOVE
Definition: SmartScriptMgr.h:647
@ SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT
Definition: SmartScriptMgr.h:634
@ SMART_ACTION_TRIGGER_TIMED_EVENT
Definition: SmartScriptMgr.h:631
@ SMART_ACTION_REMOVEAURASFROMSPELL
Definition: SmartScriptMgr.h:586
@ SMART_ACTION_FLEE
Definition: SmartScriptMgr.h:680
@ SMART_ACTION_ZONE_UNDER_ATTACK
Definition: SmartScriptMgr.h:716
struct SmartAction::@75::@193 worldStateScript
struct SmartAction::@75::@98 combatMove
struct SmartAction::@75::@100 incEventPhase
struct SmartAction::@75::@106 killedMonster
struct SmartAction::@75::@163 combatDistance
struct SmartAction::@75::@166 setHomePos
struct SmartAction::@75::@82 randomSound
struct SmartAction::@75::@120 summonGO
struct SmartAction::@75::@182 cinematic
struct SmartAction::@75::@167 loadEquipment
struct SmartAction::@75::@142 randRangeTimedActionList
struct SmartAction::@75::@111 callHelp
struct SmartAction::@75::@97 autoAttack
struct SmartAction::@75::@105 randomPhaseRange
struct SmartAction::@75::@168 randomTimedEvent
struct SmartAction::@75::@184 scriptSpawn
struct SmartAction::@75::@91 crossCast
struct SmartAction::@75::@129 setSwim
uint32 quest
Definition: SmartScriptMgr.h:827
struct SmartAction::@75::@78 simpleTalk
struct SmartAction::@75::@87 questOffer
struct SmartAction::@75::@101 addAura
struct SmartAction::@75::@110 die
struct SmartAction::@75::@104 randomPhase
struct SmartAction::@75::@133 timeEvent
struct SmartAction::@75::@125 item
struct SmartAction::@75::@152 sendTargetToTarget
struct SmartAction::@75::@169 setHover
struct SmartAction::@75::@134 movie
struct SmartAction::@75::@94 summonCreature
struct SmartAction::@75::@113 forceDespawn
struct SmartAction::@75::@185 setScale
struct SmartAction::@75::@103 follow
struct SmartAction::@75::@187 spellVisual
struct SmartAction::@75::@191 wpDataRandom
struct SmartAction::@75::@164 sightDistance
struct SmartAction::@75::@126 installTtemplate
struct SmartAction::@75::@140 timedActionList
struct SmartAction::@75::@117 moveRandom
struct SmartAction::@75::@150 sendGossipMenu
struct SmartAction::@75::@161 gameEventStart
struct SmartAction::@75::@186 radialSummon
struct SmartAction::@75::@179 corpseDelay
struct SmartAction::@75::@183 setGuid
struct SmartAction::@75::@190 wpData
struct SmartAction::@75::@156 goFlag
struct SmartAction::@75::@132 storeTargets
struct SmartAction::@75::@114 invincHP
struct SmartAction::@75::@95 threatPCT
struct SmartAction::@75::@89 randomEmote
uint32 flag
Definition: SmartScriptMgr.h:1137
struct SmartAction::@75::@145 jump
struct SmartAction::@75::@151 setGoLootState
struct SmartAction::@75::@188 followGroup
struct SmartAction::@75::@131 setCounter
struct SmartAction::@75::@139 delunitByte
struct SmartAction::@75::@90 cast
struct SmartAction::@75::@155 setRoot
struct SmartAction::@75::@108 setInstanceData64
struct SmartAction::@75::@180 movementSpeed
struct SmartAction::@75::@80 morphOrMount
struct SmartAction::@75::@116 setData
struct SmartAction::@75::@147 flee
struct SmartAction::@75::@122 wpStart
struct SmartAction::@75::@189 orientationTarget
struct SmartAction::@75::@118 visibility
struct SmartAction::@75::@172 stopMotion
struct SmartAction::@75::@121 taxi
struct SmartAction::@75::@162 closestWaypointFromList
struct SmartAction::@75::@112 setSheath
struct SmartAction::@75::@130 teleport
struct SmartAction::@75::@181 setHealthPct
struct SmartAction::@75::@79 faction
struct SmartAction::@75::@135 equip
struct SmartAction::@75::@96 threat
struct SmartAction::@75::@171 orientation
struct SmartAction::@75::@146 movementFlag
struct SmartAction::@75::@143 interruptSpellCasting
struct SmartAction::@75::@136 unitFlag
struct SmartAction::@75::@153 setRangedMovement
struct SmartAction::@75::@88 react
struct SmartAction::@75::@119 setActive
struct SmartAction::@75::@124 wpStop
struct SmartAction::@75::@194 raw
struct SmartAction::@75::@157 goState
uint32 sound
Definition: SmartScriptMgr.h:788
struct SmartAction::@75::@138 setunitByte
struct SmartAction::@75::@178 disableEvade
struct SmartAction::@75::@158 creatureGroup
struct SmartAction::@75::@160 gameEventStop
struct SmartAction::@75::@148 RespawnTarget
struct SmartAction::@75::@109 updateTemplate
struct SmartAction::@75::@77 talk
struct SmartAction::@75::@123 wpPause
struct SmartAction::@75::@83 music
struct SmartAction::@75::@128 setFly
struct SmartAction::@75::@115 ingamePhaseMask
SAIBool move
Definition: SmartScriptMgr.h:903
struct SmartAction::@75::@144 sendGoCustomAnim
struct SmartAction::@75::@149 moveToPos
struct SmartAction::@75::@127 setRun
struct SmartAction::@75::@99 setEventPhase
struct SmartAction::@75::@107 setInstanceData
uint32 emote
Definition: SmartScriptMgr.h:822
struct SmartAction::@75::@102 removeAura
struct SmartAction::@75::@159 power
struct SmartAction::@75::@154 setHealthRegen
struct SmartAction::@75::@141 randTimedActionList

References SmartScriptHolder::action, SmartAction::addAura, SmartAction::autoAttack, SmartAction::callHelp, SmartAction::cast, SmartAction::cinematic, SmartAction::closestWaypointFromList, SmartAction::combatDistance, SmartAction::combatMove, SmartAction::corpseDelay, SmartAction::creatureGroup, SmartAction::crossCast, SmartAction::delunitByte, SmartAction::die, SmartAction::disableEvade, SmartAction::emote, SmartScriptHolder::entryOrGuid, SmartAction::equip, SmartScriptHolder::event_id, SmartAction::faction, SmartAction::flag, SmartAction::flee, SmartAction::follow, SmartAction::followGroup, SmartAction::forceDespawn, SmartAction::gameEventStart, SmartAction::gameEventStop, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), SmartAction::goFlag, SmartAction::goState, SmartAction::incEventPhase, SmartAction::ingamePhaseMask, SmartAction::installTtemplate, SmartAction::interruptSpellCasting, SmartAction::invincHP, SmartAction::item, SmartAction::jump, SmartAction::killedMonster, SmartAction::loadEquipment, LOG_ERROR, LOG_WARN, SmartAction::morphOrMount, SmartAction::move, SmartAction::movementFlag, SmartAction::movementSpeed, SmartAction::moveRandom, SmartAction::moveToPos, SmartAction::movie, SmartAction::music, SmartAction::orientation, SmartAction::orientationTarget, SmartAction::power, SmartAction::quest, SmartAction::questOffer, SmartAction::radialSummon, SmartAction::randomEmote, SmartAction::randomPhase, SmartAction::randomPhaseRange, SmartAction::randomSound, SmartAction::randomTimedEvent, SmartAction::randRangeTimedActionList, SmartAction::randTimedActionList, SmartAction::raw, SmartAction::react, SmartAction::removeAura, SmartAction::RespawnTarget, SmartAction::scriptSpawn, SmartAction::sendGoCustomAnim, SmartAction::sendGossipMenu, SmartAction::sendTargetToTarget, SmartAction::setActive, SmartAction::setCounter, SmartAction::setData, SmartAction::setEventPhase, SmartAction::setFly, SmartAction::setGoLootState, SmartAction::setGuid, SmartAction::setHealthPct, SmartAction::setHealthRegen, SmartAction::setHomePos, SmartAction::setHover, SmartAction::setInstanceData, SmartAction::setInstanceData64, SmartAction::setRangedMovement, SmartAction::setRoot, SmartAction::setRun, SmartAction::setScale, SmartAction::setSheath, SmartAction::setSwim, SmartAction::setunitByte, SmartAction::sightDistance, SmartAction::simpleTalk, SMART_ACTION_ACTIVATE_GOBJECT, SMART_ACTION_ACTIVATE_TAXI, SMART_ACTION_ADD_AURA, SMART_ACTION_ADD_DYNAMIC_FLAG, SMART_ACTION_ADD_GO_FLAG, SMART_ACTION_ADD_ITEM, SMART_ACTION_ADD_NPC_FLAG, SMART_ACTION_ADD_POWER, SMART_ACTION_ADD_THREAT, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, SMART_ACTION_ATTACK_START, SMART_ACTION_ATTACK_STOP, SMART_ACTION_AUTO_ATTACK, SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS, SMART_ACTION_CALL_FOR_HELP, SMART_ACTION_CALL_GROUPEVENTHAPPENS, SMART_ACTION_CALL_KILLEDMONSTER, SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST, SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST, SMART_ACTION_CALL_SCRIPT_RESET, SMART_ACTION_CALL_TIMED_ACTIONLIST, SMART_ACTION_CAST, SMART_ACTION_CLOSE_GOSSIP, SMART_ACTION_COMBAT_STOP, SMART_ACTION_CREATE_TIMED_EVENT, SMART_ACTION_CROSS_CAST, SMART_ACTION_DIE, SMART_ACTION_DISABLE_EVADE, SMART_ACTION_EQUIP, SMART_ACTION_EVADE, SMART_ACTION_EXIT_VEHICLE, SMART_ACTION_FAIL_QUEST, SMART_ACTION_FALL, SMART_ACTION_FLEE, SMART_ACTION_FLEE_FOR_ASSIST, SMART_ACTION_FOLLOW, SMART_ACTION_FOLLOW_GROUP, SMART_ACTION_FORCE_DESPAWN, SMART_ACTION_GAME_EVENT_START, SMART_ACTION_GAME_EVENT_STOP, SMART_ACTION_GO_SET_GO_STATE, SMART_ACTION_GO_SET_LOOT_STATE, SMART_ACTION_INC_EVENT_PHASE, SMART_ACTION_INSTALL_AI_TEMPLATE, SMART_ACTION_INTERRUPT_SPELL, SMART_ACTION_INVOKER_CAST, SMART_ACTION_JUMP_TO_POS, SMART_ACTION_KILL_UNIT, SMART_ACTION_LOAD_EQUIPMENT, SMART_ACTION_LOAD_GRID, SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL, SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL, SMART_ACTION_MOVE_FORWARD, SMART_ACTION_MOVE_TO_POS, SMART_ACTION_MOVE_TO_POS_TARGET, SMART_ACTION_MOVEMENT_PAUSE, SMART_ACTION_MOVEMENT_RESUME, SMART_ACTION_MOVEMENT_STOP, SMART_ACTION_MUSIC, SMART_ACTION_NO_ENVIRONMENT_UPDATE, SMART_ACTION_NONE, SMART_ACTION_OFFER_QUEST, SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT, SMART_ACTION_PLAY_ANIMKIT, SMART_ACTION_PLAY_CINEMATIC, SMART_ACTION_PLAY_EMOTE, SMART_ACTION_PLAY_SPELL_VISUAL, SMART_ACTION_PLAYMOVIE, SMART_ACTION_RANDOM_EMOTE, SMART_ACTION_RANDOM_MOVE, SMART_ACTION_RANDOM_PHASE, SMART_ACTION_RANDOM_PHASE_RANGE, SMART_ACTION_RANDOM_SOUND, SMART_ACTION_REMOVE_ALL_GAMEOBJECTS, SMART_ACTION_REMOVE_DYNAMIC_FLAG, SMART_ACTION_REMOVE_GO_FLAG, SMART_ACTION_REMOVE_ITEM, SMART_ACTION_REMOVE_NPC_FLAG, SMART_ACTION_REMOVE_POWER, SMART_ACTION_REMOVE_TIMED_EVENT, SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1, SMART_ACTION_REMOVE_UNIT_FLAG, SMART_ACTION_REMOVEAURASFROMSPELL, SMART_ACTION_RESERVED_16, SMART_ACTION_RESET_GOBJECT, SMART_ACTION_RESET_SCRIPT_BASE_OBJECT, SMART_ACTION_RESPAWN_TARGET, SMART_ACTION_RISE_UP, SMART_ACTION_SCENE_CANCEL, SMART_ACTION_SCENE_PLAY, SMART_ACTION_SCRIPTED_SPAWN, SMART_ACTION_SELF_CAST, SMART_ACTION_SEND_GO_CUSTOM_ANIM, SMART_ACTION_SEND_GOSSIP_MENU, SMART_ACTION_SEND_TARGET_TO_TARGET, SMART_ACTION_SET_ACTIVE, SMART_ACTION_SET_COMBAT_DISTANCE, SMART_ACTION_SET_CORPSE_DELAY, SMART_ACTION_SET_COUNTER, SMART_ACTION_SET_DATA, SMART_ACTION_SET_DYNAMIC_FLAG, SMART_ACTION_SET_EMOTE_STATE, SMART_ACTION_SET_EVENT_FLAG_RESET, SMART_ACTION_SET_EVENT_PHASE, SMART_ACTION_SET_FACTION, SMART_ACTION_SET_FLY, SMART_ACTION_SET_GO_FLAG, SMART_ACTION_SET_GUID, SMART_ACTION_SET_HEALTH_PCT, SMART_ACTION_SET_HEALTH_REGEN, SMART_ACTION_SET_HOME_POS, SMART_ACTION_SET_HOVER, SMART_ACTION_SET_IN_COMBAT_WITH_ZONE, SMART_ACTION_SET_INGAME_PHASE_MASK, SMART_ACTION_SET_INST_DATA, SMART_ACTION_SET_INST_DATA64, SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL, SMART_ACTION_SET_MOVEMENT_SPEED, SMART_ACTION_SET_NPC_FLAG, SMART_ACTION_SET_ORIENTATION, SMART_ACTION_SET_ORIENTATION_TARGET, SMART_ACTION_SET_POWER, SMART_ACTION_SET_RANGED_MOVEMENT, SMART_ACTION_SET_REACT_STATE, SMART_ACTION_SET_ROOT, SMART_ACTION_SET_RUN, SMART_ACTION_SET_SCALE, SMART_ACTION_SET_SHEATH, SMART_ACTION_SET_SIGHT_DIST, SMART_ACTION_SET_SWIM, SMART_ACTION_SET_UNIT_FIELD_BYTES_1, SMART_ACTION_SET_UNIT_FLAG, SMART_ACTION_SET_UNIT_MOVEMENT_FLAGS, SMART_ACTION_SET_VISIBILITY, SMART_ACTION_SIMPLE_TALK, SMART_ACTION_SOUND, SMART_ACTION_START_CLOSEST_WAYPOINT, SMART_ACTION_STOP_MOTION, SMART_ACTION_STORE_TARGET_LIST, SMART_ACTION_SUMMON_CREATURE, SMART_ACTION_SUMMON_CREATURE_GROUP, SMART_ACTION_SUMMON_GO, SMART_ACTION_SUMMON_RADIAL, SMART_ACTION_TALK, SMART_ACTION_TELEPORT, SMART_ACTION_THREAT_ALL_PCT, SMART_ACTION_THREAT_SINGLE_PCT, SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT, SMART_ACTION_TRIGGER_TIMED_EVENT, SMART_ACTION_UPDATE_TEMPLATE, SMART_ACTION_WAYPOINT_DATA_RANDOM, SMART_ACTION_WAYPOINT_DATA_START, SMART_ACTION_WORLD_SCRIPT, SMART_ACTION_WP_PAUSE, SMART_ACTION_WP_RESUME, SMART_ACTION_WP_START, SMART_ACTION_WP_STOP, SMART_ACTION_ZONE_UNDER_ATTACK, SmartAction::sound, SmartAction::spellVisual, SmartAction::stopMotion, SmartAction::storeTargets, SmartAction::summonCreature, SmartAction::summonGO, SmartAction::talk, SmartAction::taxi, SmartAction::teleport, SmartAction::threat, SmartAction::threatPCT, SmartAction::timedActionList, SmartAction::timeEvent, SmartAction::type, SmartAction::unitFlag, SmartAction::updateTemplate, SmartAction::visibility, SmartAction::worldStateScript, SmartAction::wpData, SmartAction::wpDataRandom, SmartAction::wpPause, SmartAction::wpStart, and SmartAction::wpStop.

Referenced by IsEventValid().

◆ CheckUnusedEventParams()

bool SmartAIMgr::CheckUnusedEventParams ( SmartScriptHolder const &  e)
staticprivate
563{
564 std::size_t paramsStructSize = [&]() -> std::size_t
565 {
566 constexpr std::size_t NO_PARAMS = std::size_t(0);
567 switch (e.event.type)
568 {
573 case SMART_EVENT_AGGRO: return NO_PARAMS;
574 case SMART_EVENT_KILL: return sizeof(SmartEvent::kill);
575 case SMART_EVENT_DEATH: return NO_PARAMS;
576 case SMART_EVENT_EVADE: return NO_PARAMS;
577 case SMART_EVENT_SPELLHIT: return sizeof(SmartEvent::spellHit);
578 case SMART_EVENT_RANGE: return sizeof(SmartEvent::minMaxRepeat);
579 case SMART_EVENT_OOC_LOS: return sizeof(SmartEvent::los);
580 case SMART_EVENT_RESPAWN: return sizeof(SmartEvent::respawn);
589 case SMART_EVENT_REWARD_QUEST: return sizeof(SmartEvent::quest);
590 case SMART_EVENT_REACHED_HOME: return NO_PARAMS;
591 case SMART_EVENT_RECEIVE_EMOTE: return sizeof(SmartEvent::emote);
592 case SMART_EVENT_HAS_AURA: return sizeof(SmartEvent::aura);
593 case SMART_EVENT_TARGET_BUFFED: return sizeof(SmartEvent::aura);
594 case SMART_EVENT_RESET: return NO_PARAMS;
595 case SMART_EVENT_IC_LOS: return sizeof(SmartEvent::los);
598 case SMART_EVENT_CHARMED: return sizeof(SmartEvent::charm);
599 case SMART_EVENT_CHARMED_TARGET: return NO_PARAMS;
605 case SMART_EVENT_CORPSE_REMOVED: return NO_PARAMS;
606 case SMART_EVENT_AI_INIT: return NO_PARAMS;
607 case SMART_EVENT_DATA_SET: return sizeof(SmartEvent::dataSet);
610 case SMART_EVENT_TRANSPORT_ADDPLAYER: return NO_PARAMS;
612 case SMART_EVENT_TRANSPORT_REMOVE_PLAYER: return NO_PARAMS;
616 case SMART_EVENT_QUEST_ACCEPTED: return NO_PARAMS;
617 case SMART_EVENT_QUEST_OBJ_COMPLETION: return NO_PARAMS;
618 case SMART_EVENT_QUEST_COMPLETION: return NO_PARAMS;
619 case SMART_EVENT_QUEST_REWARDED: return NO_PARAMS;
620 case SMART_EVENT_QUEST_FAIL: return NO_PARAMS;
621 case SMART_EVENT_TEXT_OVER: return sizeof(SmartEvent::textOver);
623 case SMART_EVENT_JUST_SUMMONED: return NO_PARAMS;
629 case SMART_EVENT_UPDATE: return sizeof(SmartEvent::minMaxRepeat);
630 case SMART_EVENT_LINK: return NO_PARAMS;
632 case SMART_EVENT_JUST_CREATED: return NO_PARAMS;
634 case SMART_EVENT_FOLLOW_COMPLETED: return NO_PARAMS;
643 case SMART_EVENT_ON_SPELLCLICK: return NO_PARAMS;
647 case SMART_EVENT_COUNTER_SET: return sizeof(SmartEvent::counter);
648 //case SMART_EVENT_SCENE_START: return sizeof(SmartEvent::raw);
649 //case SMART_EVENT_SCENE_TRIGGER: return sizeof(SmartEvent::raw);
650 //case SMART_EVENT_SCENE_CANCEL: return sizeof(SmartEvent::raw);
651 //case SMART_EVENT_SCENE_COMPLETE: return sizeof(SmartEvent::raw);
655 case SMART_EVENT_NEAR_UNIT: return sizeof(SmartEvent::nearUnit);
662 default:
663 LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using an event {} with no unused params specified in SmartAIMgr::CheckUnusedEventParams(), please report this.",
664 e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetEventType());
665 return sizeof(SmartEvent::raw);
666 }
667 }();
668
669 static std::size_t rawCount = sizeof(SmartEvent::raw) / sizeof(uint32);
670 std::size_t paramsCount = paramsStructSize / sizeof(uint32);
671
672 bool valid = true;
673 for (std::size_t index = paramsCount; index < rawCount; index++)
674 {
675 uint32 value = ((uint32*)&e.event.raw)[index];
676 if (value != 0)
677 {
678 LOG_ERROR("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} has unused event_param{} with value {}, it must be 0, skipped.",
679 e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), index + 1, value);
680 valid = false;
681 }
682 }
683
684 return valid;
685}
@ SMART_EVENT_IC_LOS
Definition: SmartScriptMgr.h:144
@ SMART_EVENT_EVADE
Definition: SmartScriptMgr.h:125
@ SMART_EVENT_ACTION_DONE
Definition: SmartScriptMgr.h:190
@ SMART_EVENT_SUMMON_DESPAWNED
Definition: SmartScriptMgr.h:153
@ SMART_EVENT_SPELLHIT
Definition: SmartScriptMgr.h:126
@ SMART_EVENT_RECEIVE_EMOTE
Definition: SmartScriptMgr.h:140
@ SMART_EVENT_FRIENDLY_HEALTH_PCT
Definition: SmartScriptMgr.h:192
@ SMART_EVENT_QUEST_FAIL
Definition: SmartScriptMgr.h:169
@ SMART_EVENT_DATA_SET
Definition: SmartScriptMgr.h:156
@ SMART_EVENT_RECEIVE_HEAL
Definition: SmartScriptMgr.h:171
@ SMART_EVENT_TIMED_EVENT_TRIGGERED
Definition: SmartScriptMgr.h:177
@ SMART_EVENT_CHARMED_TARGET
Definition: SmartScriptMgr.h:148
@ SMART_EVENT_NEAR_PLAYERS_NEGATION
Definition: SmartScriptMgr.h:210
@ SMART_EVENT_TARGET_MANA_PCT
Definition: SmartScriptMgr.h:136
@ SMART_EVENT_QUEST_COMPLETION
Definition: SmartScriptMgr.h:167
@ SMART_EVENT_JUST_CREATED
Definition: SmartScriptMgr.h:181
@ SMART_EVENT_HEALTH_PCT
Definition: SmartScriptMgr.h:120
@ SMART_EVENT_EVENT_PHASE_CHANGE
Definition: SmartScriptMgr.h:184
@ SMART_EVENT_AREA_CASTING
Definition: SmartScriptMgr.h:213
@ SMART_EVENT_AREATRIGGER_ONTRIGGER
Definition: SmartScriptMgr.h:164
@ SMART_EVENT_DISTANCE_GAMEOBJECT
Definition: SmartScriptMgr.h:194
@ SMART_EVENT_ON_SPELLCLICK
Definition: SmartScriptMgr.h:191
@ SMART_EVENT_MOVEMENTINFORM
Definition: SmartScriptMgr.h:152
@ SMART_EVENT_RANGE
Definition: SmartScriptMgr.h:127
@ SMART_EVENT_MANA_PCT
Definition: SmartScriptMgr.h:121
@ SMART_EVENT_NEAR_UNIT_NEGATION
Definition: SmartScriptMgr.h:212
@ SMART_EVENT_PASSENGER_REMOVED
Definition: SmartScriptMgr.h:146
@ SMART_EVENT_INSTANCE_PLAYER_ENTER
Definition: SmartScriptMgr.h:163
@ SMART_EVENT_LINK
Definition: SmartScriptMgr.h:179
@ SMART_EVENT_WAYPOINT_PAUSED
Definition: SmartScriptMgr.h:173
@ SMART_EVENT_WAYPOINT_DATA_ENDED
Definition: SmartScriptMgr.h:217
@ SMART_EVENT_REACHED_HOME
Definition: SmartScriptMgr.h:139
@ SMART_EVENT_TRANSPORT_ADDCREATURE
Definition: SmartScriptMgr.h:160
@ SMART_EVENT_REWARD_QUEST
Definition: SmartScriptMgr.h:138
@ SMART_EVENT_WAYPOINT_DATA_REACHED
Definition: SmartScriptMgr.h:216
@ SMART_EVENT_GO_EVENT_INFORM
Definition: SmartScriptMgr.h:189
@ SMART_EVENT_UPDATE_IC
Definition: SmartScriptMgr.h:118
@ SMART_EVENT_RESET
Definition: SmartScriptMgr.h:143
@ SMART_EVENT_IS_IN_MELEE_RANGE
Definition: SmartScriptMgr.h:218
@ SMART_EVENT_JUST_SUMMONED
Definition: SmartScriptMgr.h:172
@ SMART_EVENT_CHARMED
Definition: SmartScriptMgr.h:147
@ SMART_EVENT_AI_INIT
Definition: SmartScriptMgr.h:155
@ SMART_EVENT_WAYPOINT_START
Definition: SmartScriptMgr.h:157
@ SMART_EVENT_AREA_RANGE
Definition: SmartScriptMgr.h:214
@ SMART_EVENT_SPELLHIT_TARGET
Definition: SmartScriptMgr.h:149
@ SMART_EVENT_GAME_EVENT_START
Definition: SmartScriptMgr.h:186
@ SMART_EVENT_KILL
Definition: SmartScriptMgr.h:123
@ SMART_EVENT_TRANSPORT_REMOVE_PLAYER
Definition: SmartScriptMgr.h:161
@ SMART_EVENT_GOSSIP_HELLO
Definition: SmartScriptMgr.h:182
@ SMART_EVENT_GOSSIP_SELECT
Definition: SmartScriptMgr.h:180
@ SMART_EVENT_CORPSE_REMOVED
Definition: SmartScriptMgr.h:154
@ SMART_EVENT_SUMMONED_UNIT_EVADE
Definition: SmartScriptMgr.h:215
@ SMART_EVENT_PASSENGER_BOARDED
Definition: SmartScriptMgr.h:145
@ SMART_EVENT_UPDATE
Definition: SmartScriptMgr.h:178
@ SMART_EVENT_TRANSPORT_ADDPLAYER
Definition: SmartScriptMgr.h:159
@ SMART_EVENT_WAYPOINT_ENDED
Definition: SmartScriptMgr.h:176
@ SMART_EVENT_IS_BEHIND_TARGET
Definition: SmartScriptMgr.h:185
@ SMART_EVENT_UPDATE_OOC
Definition: SmartScriptMgr.h:119
@ SMART_EVENT_ACCEPTED_QUEST
Definition: SmartScriptMgr.h:137
@ SMART_EVENT_COUNTER_SET
Definition: SmartScriptMgr.h:195
@ SMART_EVENT_FRIENDLY_MISSING_BUFF
Definition: SmartScriptMgr.h:134
@ SMART_EVENT_WAYPOINT_RESUMED
Definition: SmartScriptMgr.h:174
@ SMART_EVENT_WAYPOINT_REACHED
Definition: SmartScriptMgr.h:158
@ SMART_EVENT_TARGET_BUFFED
Definition: SmartScriptMgr.h:142
@ SMART_EVENT_RESPAWN
Definition: SmartScriptMgr.h:129
@ SMART_EVENT_QUEST_ACCEPTED
Definition: SmartScriptMgr.h:165
@ SMART_EVENT_FRIENDLY_HEALTH
Definition: SmartScriptMgr.h:132
@ SMART_EVENT_NEAR_UNIT
Definition: SmartScriptMgr.h:211
@ SMART_EVENT_QUEST_REWARDED
Definition: SmartScriptMgr.h:168
@ SMART_EVENT_TEXT_OVER
Definition: SmartScriptMgr.h:170
@ SMART_EVENT_DEATH
Definition: SmartScriptMgr.h:124
@ SMART_EVENT_TRANSPORT_RELOCATE
Definition: SmartScriptMgr.h:162
@ SMART_EVENT_GAME_EVENT_END
Definition: SmartScriptMgr.h:187
@ SMART_EVENT_DAMAGED
Definition: SmartScriptMgr.h:150
@ SMART_EVENT_FOLLOW_COMPLETED
Definition: SmartScriptMgr.h:183
@ SMART_EVENT_QUEST_OBJ_COMPLETION
Definition: SmartScriptMgr.h:166
@ SMART_EVENT_DISTANCE_CREATURE
Definition: SmartScriptMgr.h:193
@ SMART_EVENT_WAYPOINT_STOPPED
Definition: SmartScriptMgr.h:175
@ SMART_EVENT_SUMMONED_UNIT_DIES
Definition: SmartScriptMgr.h:202
@ SMART_EVENT_FRIENDLY_IS_CC
Definition: SmartScriptMgr.h:133
@ SMART_EVENT_GO_STATE_CHANGED
Definition: SmartScriptMgr.h:188
@ SMART_EVENT_OOC_LOS
Definition: SmartScriptMgr.h:128
@ SMART_EVENT_AGGRO
Definition: SmartScriptMgr.h:122
@ SMART_EVENT_NEAR_PLAYERS
Definition: SmartScriptMgr.h:209
@ SMART_EVENT_TARGET_HEALTH_PCT
Definition: SmartScriptMgr.h:130
@ SMART_EVENT_VICTIM_CASTING
Definition: SmartScriptMgr.h:131
@ SMART_EVENT_DAMAGED_TARGET
Definition: SmartScriptMgr.h:151
@ SMART_EVENT_HAS_AURA
Definition: SmartScriptMgr.h:141
@ SMART_EVENT_SUMMONED_UNIT
Definition: SmartScriptMgr.h:135
struct SmartEvent::@30::@69 nearPlayerNegation
struct SmartEvent::@30::@74 raw
struct SmartEvent::@30::@68 nearPlayer
struct SmartEvent::@30::@32 minMaxRepeat
struct SmartEvent::@30::@61 gameEvent
struct SmartEvent::@30::@70 nearUnit
struct SmartEvent::@30::@53 instancePlayerEnter
struct SmartEvent::@30::@51 transportAddCreature
struct SmartEvent::@30::@45 aura
struct SmartEvent::@30::@57 gossipHello
struct SmartEvent::@30::@34 spellHit
struct SmartEvent::@30::@35 los
struct SmartEvent::@30::@49 dataSet
struct SmartEvent::@30::@48 movementInform
uint32 emote
Definition: SmartScriptMgr.h:329
struct SmartEvent::@30::@72 nearUnitNegation
struct SmartEvent::@30::@33 kill
struct SmartEvent::@30::@71 meleeRange
struct SmartEvent::@30::@41 missingBuff
struct SmartEvent::@30::@50 waypoint
struct SmartEvent::@30::@42 summoned
struct SmartEvent::@30::@54 areatrigger
struct SmartEvent::@30::@60 eventPhaseChange
struct SmartEvent::@30::@65 friendlyHealthPct
struct SmartEvent::@30::@58 gossip
struct SmartEvent::@30::@64 doAction
struct SmartEvent::@30::@46 charm
struct SmartEvent::@30::@63 eventInform
struct SmartEvent::@30::@38 targetCasting
struct SmartEvent::@30::@52 transportRelocate
struct SmartEvent::@30::@73 wpData
uint32 quest
Definition: SmartScriptMgr.h:322
struct SmartEvent::@30::@67 counter
struct SmartEvent::@30::@36 respawn
struct SmartEvent::@30::@56 timedEvent
struct SmartEvent::@30::@39 friendlyHealth
struct SmartEvent::@30::@66 distance
struct SmartEvent::@30::@37 minMax
struct SmartEvent::@30::@55 textOver
struct SmartEvent::@30::@40 friendlyCC
struct SmartEvent::@30::@62 goStateChanged

References SmartEvent::areatrigger, SmartEvent::aura, SmartEvent::charm, SmartEvent::counter, SmartEvent::dataSet, SmartEvent::distance, SmartEvent::doAction, SmartEvent::emote, SmartScriptHolder::entryOrGuid, SmartScriptHolder::event, SmartScriptHolder::event_id, SmartEvent::eventInform, SmartEvent::eventPhaseChange, SmartEvent::friendlyCC, SmartEvent::friendlyHealth, SmartEvent::friendlyHealthPct, SmartEvent::gameEvent, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetEventType(), SmartScriptHolder::GetScriptType(), SmartEvent::gossip, SmartEvent::gossipHello, SmartEvent::goStateChanged, SmartEvent::instancePlayerEnter, SmartEvent::kill, LOG_ERROR, LOG_WARN, SmartEvent::los, SmartEvent::meleeRange, SmartEvent::minMax, SmartEvent::minMaxRepeat, SmartEvent::missingBuff, SmartEvent::movementInform, SmartEvent::nearPlayer, SmartEvent::nearPlayerNegation, SmartEvent::nearUnit, SmartEvent::nearUnitNegation, SmartEvent::quest, SmartEvent::raw, SmartEvent::respawn, SMART_EVENT_ACCEPTED_QUEST, SMART_EVENT_ACTION_DONE, SMART_EVENT_AGGRO, SMART_EVENT_AI_INIT, SMART_EVENT_AREA_CASTING, SMART_EVENT_AREA_RANGE, SMART_EVENT_AREATRIGGER_ONTRIGGER, SMART_EVENT_CHARMED, SMART_EVENT_CHARMED_TARGET, SMART_EVENT_CORPSE_REMOVED, SMART_EVENT_COUNTER_SET, SMART_EVENT_DAMAGED, SMART_EVENT_DAMAGED_TARGET, SMART_EVENT_DATA_SET, SMART_EVENT_DEATH, SMART_EVENT_DISTANCE_CREATURE, SMART_EVENT_DISTANCE_GAMEOBJECT, SMART_EVENT_EVADE, SMART_EVENT_EVENT_PHASE_CHANGE, SMART_EVENT_FOLLOW_COMPLETED, SMART_EVENT_FRIENDLY_HEALTH, SMART_EVENT_FRIENDLY_HEALTH_PCT, SMART_EVENT_FRIENDLY_IS_CC, SMART_EVENT_FRIENDLY_MISSING_BUFF, SMART_EVENT_GAME_EVENT_END, SMART_EVENT_GAME_EVENT_START, SMART_EVENT_GO_EVENT_INFORM, SMART_EVENT_GO_STATE_CHANGED, SMART_EVENT_GOSSIP_HELLO, SMART_EVENT_GOSSIP_SELECT, SMART_EVENT_HAS_AURA, SMART_EVENT_HEALTH_PCT, SMART_EVENT_IC_LOS, SMART_EVENT_INSTANCE_PLAYER_ENTER, SMART_EVENT_IS_BEHIND_TARGET, SMART_EVENT_IS_IN_MELEE_RANGE, SMART_EVENT_JUST_CREATED, SMART_EVENT_JUST_SUMMONED, SMART_EVENT_KILL, SMART_EVENT_LINK, SMART_EVENT_MANA_PCT, SMART_EVENT_MOVEMENTINFORM, SMART_EVENT_NEAR_PLAYERS, SMART_EVENT_NEAR_PLAYERS_NEGATION, SMART_EVENT_NEAR_UNIT, SMART_EVENT_NEAR_UNIT_NEGATION, SMART_EVENT_ON_SPELLCLICK, SMART_EVENT_OOC_LOS, SMART_EVENT_PASSENGER_BOARDED, SMART_EVENT_PASSENGER_REMOVED, SMART_EVENT_QUEST_ACCEPTED, SMART_EVENT_QUEST_COMPLETION, SMART_EVENT_QUEST_FAIL, SMART_EVENT_QUEST_OBJ_COMPLETION, SMART_EVENT_QUEST_REWARDED, SMART_EVENT_RANGE, SMART_EVENT_REACHED_HOME, SMART_EVENT_RECEIVE_EMOTE, SMART_EVENT_RECEIVE_HEAL, SMART_EVENT_RESET, SMART_EVENT_RESPAWN, SMART_EVENT_REWARD_QUEST, SMART_EVENT_SPELLHIT, SMART_EVENT_SPELLHIT_TARGET, SMART_EVENT_SUMMON_DESPAWNED, SMART_EVENT_SUMMONED_UNIT, SMART_EVENT_SUMMONED_UNIT_DIES, SMART_EVENT_SUMMONED_UNIT_EVADE, SMART_EVENT_TARGET_BUFFED, SMART_EVENT_TARGET_HEALTH_PCT, SMART_EVENT_TARGET_MANA_PCT, SMART_EVENT_TEXT_OVER, SMART_EVENT_TIMED_EVENT_TRIGGERED, SMART_EVENT_TRANSPORT_ADDCREATURE, SMART_EVENT_TRANSPORT_ADDPLAYER, SMART_EVENT_TRANSPORT_RELOCATE, SMART_EVENT_TRANSPORT_REMOVE_PLAYER, SMART_EVENT_UPDATE, SMART_EVENT_UPDATE_IC, SMART_EVENT_UPDATE_OOC, SMART_EVENT_VICTIM_CASTING, SMART_EVENT_WAYPOINT_DATA_ENDED, SMART_EVENT_WAYPOINT_DATA_REACHED, SMART_EVENT_WAYPOINT_ENDED, SMART_EVENT_WAYPOINT_PAUSED, SMART_EVENT_WAYPOINT_REACHED, SMART_EVENT_WAYPOINT_RESUMED, SMART_EVENT_WAYPOINT_START, SMART_EVENT_WAYPOINT_STOPPED, SmartEvent::spellHit, SmartEvent::summoned, SmartEvent::targetCasting, SmartEvent::textOver, SmartEvent::timedEvent, SmartEvent::transportAddCreature, SmartEvent::transportRelocate, SmartEvent::type, SmartEvent::waypoint, and SmartEvent::wpData.

Referenced by IsEventValid().

◆ CheckUnusedTargetParams()

bool SmartAIMgr::CheckUnusedTargetParams ( SmartScriptHolder const &  e)
staticprivate
889{
890 std::size_t paramsStructSize = [&]() -> std::size_t
891 {
892 constexpr std::size_t NO_PARAMS = std::size_t(0);
893 switch (e.target.type)
894 {
895 case SMART_TARGET_NONE: return NO_PARAMS;
896 case SMART_TARGET_SELF: return NO_PARAMS;
897 case SMART_TARGET_VICTIM: return NO_PARAMS;
902 case SMART_TARGET_ACTION_INVOKER: return NO_PARAMS;
903 case SMART_TARGET_POSITION: return NO_PARAMS; //uses x,y,z,o
907 case SMART_TARGET_STORED: return sizeof(SmartTarget::stored);
917 case SMART_TARGET_ACTION_INVOKER_VEHICLE: return NO_PARAMS;
922 case SMART_TARGET_LOOT_RECIPIENTS: return NO_PARAMS;
923 case SMART_TARGET_FARTHEST: return sizeof(SmartTarget::farthest);
925 // case SMART_TARGET_CLOSEST_UNSPAWNED_GAMEOBJECT: return sizeof(SmartTarget::goClosest);
927 default:
928 LOG_WARN("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} is using a target {} with no unused params specified in SmartAIMgr::CheckUnusedTargetParams(), please report this.",
929 e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetTargetType());
930 return sizeof(SmartTarget::raw);
931 }
932 }();
933
934 static std::size_t rawCount = sizeof(SmartTarget::raw) / sizeof(uint32);
935 std::size_t paramsCount = paramsStructSize / sizeof(uint32);
936
937 bool valid = true;
938 for (std::size_t index = paramsCount; index < rawCount; index++)
939 {
940 uint32 value = ((uint32*)&e.target.raw)[index];
941 if (value != 0)
942 {
943 LOG_ERROR("sql.sql", "SmartAIMgr: entryorguid {} source_type {} id {} action_type {} has unused target_param{} with value {}, it must be 0, skipped.",
944 e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), index + 1, value);
945 valid = false;
946 }
947 }
948
949 return valid;
950}
@ SMART_TARGET_LOOT_RECIPIENTS
Definition: SmartScriptMgr.h:1547
@ SMART_TARGET_CLOSEST_CREATURE
Definition: SmartScriptMgr.h:1539
@ SMART_TARGET_CREATURE_DISTANCE
Definition: SmartScriptMgr.h:1531
@ SMART_TARGET_HOSTILE_RANDOM_NOT_TOP
Definition: SmartScriptMgr.h:1526
@ SMART_TARGET_INVOKER_PARTY
Definition: SmartScriptMgr.h:1536
@ SMART_TARGET_CLOSEST_FRIENDLY
Definition: SmartScriptMgr.h:1546
@ SMART_TARGET_CLOSEST_GAMEOBJECT
Definition: SmartScriptMgr.h:1540
@ SMART_TARGET_VEHICLE_PASSENGER
Definition: SmartScriptMgr.h:1549
@ SMART_TARGET_GAMEOBJECT_RANGE
Definition: SmartScriptMgr.h:1533
@ SMART_TARGET_CREATURE_GUID
Definition: SmartScriptMgr.h:1530
@ SMART_TARGET_PLAYER_RANGE
Definition: SmartScriptMgr.h:1537
@ SMART_TARGET_VICTIM
Definition: SmartScriptMgr.h:1522
@ SMART_TARGET_GAMEOBJECT_DISTANCE
Definition: SmartScriptMgr.h:1535
@ SMART_TARGET_CREATURE_RANGE
Definition: SmartScriptMgr.h:1529
@ SMART_TARGET_CLOSEST_PLAYER
Definition: SmartScriptMgr.h:1541
@ SMART_TARGET_HOSTILE_RANDOM
Definition: SmartScriptMgr.h:1525
@ SMART_TARGET_GAMEOBJECT_GUID
Definition: SmartScriptMgr.h:1534
@ SMART_TARGET_HOSTILE_SECOND_AGGRO
Definition: SmartScriptMgr.h:1523
@ SMART_TARGET_OWNER_OR_SUMMONER
Definition: SmartScriptMgr.h:1543
@ SMART_TARGET_SELF
Definition: SmartScriptMgr.h:1521
@ SMART_TARGET_PLAYER_WITH_AURA
Definition: SmartScriptMgr.h:1557
@ SMART_TARGET_ACTION_INVOKER
Definition: SmartScriptMgr.h:1527
@ SMART_TARGET_POSITION
Definition: SmartScriptMgr.h:1528
@ SMART_TARGET_HOSTILE_LAST_AGGRO
Definition: SmartScriptMgr.h:1524
@ SMART_TARGET_ACTION_INVOKER_VEHICLE
Definition: SmartScriptMgr.h:1542
@ SMART_TARGET_FARTHEST
Definition: SmartScriptMgr.h:1548
@ SMART_TARGET_THREAT_LIST
Definition: SmartScriptMgr.h:1544
@ SMART_TARGET_CLOSEST_ENEMY
Definition: SmartScriptMgr.h:1545
@ SMART_TARGET_NONE
Definition: SmartScriptMgr.h:1520
@ SMART_TARGET_PLAYER_DISTANCE
Definition: SmartScriptMgr.h:1538
@ SMART_TARGET_STORED
Definition: SmartScriptMgr.h:1532
struct SmartTarget::@195::@215 closestFriendly
struct SmartTarget::@195::@205 stored
struct SmartTarget::@195::@207 goGUID
struct SmartTarget::@195::@212 threatList
struct SmartTarget::@195::@204 playerRange
struct SmartTarget::@195::@200 unitGUID
struct SmartTarget::@195::@206 goRange
struct SmartTarget::@195::@217 playerWithAura
struct SmartTarget::@195::@208 goDistance
struct SmartTarget::@195::@199 unitRange
struct SmartTarget::@195::@211 vehicle
struct SmartTarget::@195::@210 owner
struct SmartTarget::@195::@197 hostileRandom
struct SmartTarget::@195::@198 farthest
struct SmartTarget::@195::@209 unitClosest
struct SmartTarget::@195::@221 invokerParty
struct SmartTarget::@195::@202 unitDistance
struct SmartTarget::@195::@213 goClosest
struct SmartTarget::@195::@214 closestAttackable
struct SmartTarget::@195::@203 playerDistance
struct SmartTarget::@195::@219 raw

References SmartTarget::closestAttackable, SmartTarget::closestFriendly, SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartTarget::farthest, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), SmartScriptHolder::GetTargetType(), SmartTarget::goClosest, SmartTarget::goDistance, SmartTarget::goGUID, SmartTarget::goRange, SmartTarget::hostileRandom, SmartTarget::invokerParty, LOG_ERROR, LOG_WARN, SmartTarget::owner, SmartTarget::playerDistance, SmartTarget::playerRange, SmartTarget::playerWithAura, SmartTarget::raw, SMART_TARGET_ACTION_INVOKER, SMART_TARGET_ACTION_INVOKER_VEHICLE, SMART_TARGET_CLOSEST_CREATURE, SMART_TARGET_CLOSEST_ENEMY, SMART_TARGET_CLOSEST_FRIENDLY, SMART_TARGET_CLOSEST_GAMEOBJECT, SMART_TARGET_CLOSEST_PLAYER, SMART_TARGET_CREATURE_DISTANCE, SMART_TARGET_CREATURE_GUID, SMART_TARGET_CREATURE_RANGE, SMART_TARGET_FARTHEST, SMART_TARGET_GAMEOBJECT_DISTANCE, SMART_TARGET_GAMEOBJECT_GUID, SMART_TARGET_GAMEOBJECT_RANGE, SMART_TARGET_HOSTILE_LAST_AGGRO, SMART_TARGET_HOSTILE_RANDOM, SMART_TARGET_HOSTILE_RANDOM_NOT_TOP, SMART_TARGET_HOSTILE_SECOND_AGGRO, SMART_TARGET_INVOKER_PARTY, SMART_TARGET_LOOT_RECIPIENTS, SMART_TARGET_NONE, SMART_TARGET_OWNER_OR_SUMMONER, SMART_TARGET_PLAYER_DISTANCE, SMART_TARGET_PLAYER_RANGE, SMART_TARGET_PLAYER_WITH_AURA, SMART_TARGET_POSITION, SMART_TARGET_SELF, SMART_TARGET_STORED, SMART_TARGET_THREAT_LIST, SMART_TARGET_VEHICLE_PASSENGER, SMART_TARGET_VICTIM, SmartTarget::stored, SmartScriptHolder::target, SmartTarget::threatList, SmartTarget::type, SmartTarget::unitClosest, SmartTarget::unitDistance, SmartTarget::unitGUID, SmartTarget::unitRange, and SmartTarget::vehicle.

Referenced by IsTargetValid().

◆ EventHasInvoker()

bool SmartAIMgr::EventHasInvoker ( SMART_EVENT  event)
staticprivate
383{
384 switch (event)
385 { // white list of events that actually have an invoker passed to them
388 case SMART_EVENT_KILL:
431 return true;
432 default:
433 return false;
434 }
435}

References SMART_EVENT_ACCEPTED_QUEST, SMART_EVENT_ACTION_DONE, SMART_EVENT_AGGRO, SMART_EVENT_AREA_CASTING, SMART_EVENT_AREA_RANGE, SMART_EVENT_AREATRIGGER_ONTRIGGER, SMART_EVENT_DAMAGED, SMART_EVENT_DAMAGED_TARGET, SMART_EVENT_DATA_SET, SMART_EVENT_DEATH, SMART_EVENT_DISTANCE_CREATURE, SMART_EVENT_FOLLOW_COMPLETED, SMART_EVENT_FRIENDLY_HEALTH, SMART_EVENT_FRIENDLY_HEALTH_PCT, SMART_EVENT_FRIENDLY_IS_CC, SMART_EVENT_FRIENDLY_MISSING_BUFF, SMART_EVENT_GO_STATE_CHANGED, SMART_EVENT_GOSSIP_HELLO, SMART_EVENT_GOSSIP_SELECT, SMART_EVENT_IC_LOS, SMART_EVENT_INSTANCE_PLAYER_ENTER, SMART_EVENT_IS_BEHIND_TARGET, SMART_EVENT_IS_IN_MELEE_RANGE, SMART_EVENT_JUST_SUMMONED, SMART_EVENT_KILL, SMART_EVENT_NEAR_PLAYERS, SMART_EVENT_ON_SPELLCLICK, SMART_EVENT_OOC_LOS, SMART_EVENT_PASSENGER_BOARDED, SMART_EVENT_PASSENGER_REMOVED, SMART_EVENT_RANGE, SMART_EVENT_RECEIVE_EMOTE, SMART_EVENT_RECEIVE_HEAL, SMART_EVENT_REWARD_QUEST, SMART_EVENT_SPELLHIT, SMART_EVENT_SPELLHIT_TARGET, SMART_EVENT_SUMMON_DESPAWNED, SMART_EVENT_SUMMONED_UNIT, SMART_EVENT_SUMMONED_UNIT_DIES, SMART_EVENT_SUMMONED_UNIT_EVADE, SMART_EVENT_TARGET_BUFFED, SMART_EVENT_TARGET_HEALTH_PCT, SMART_EVENT_TARGET_MANA_PCT, SMART_EVENT_TRANSPORT_ADDCREATURE, and SMART_EVENT_VICTIM_CASTING.

Referenced by IsEventValid(), and IsTargetValid().

◆ GetScript()

SmartAIEventList SmartAIMgr::GetScript ( int32  entry,
SmartScriptType  type 
)
inline
2071 {
2072 SmartAIEventList temp;
2073 if (mEventMap[uint32(type)].find(entry) != mEventMap[uint32(type)].end())
2074 return mEventMap[uint32(type)][entry];
2075 else
2076 {
2077 if (entry > 0) //first search is for guid (negative), do not drop error if not found
2078 LOG_DEBUG("sql.sql", "SmartAIMgr::GetScript: Could not load Script for Entry {} ScriptType {}.", entry, uint32(type));
2079 return temp;
2080 }
2081 }
#define LOG_DEBUG(filterType__,...)
Definition: Log.h:169
std::vector< SmartScriptHolder > SmartAIEventList
Definition: SmartScriptMgr.h:2053

References LOG_DEBUG, and mEventMap.

◆ instance()

SmartAIMgr * SmartAIMgr::instance ( )
static
121{
122 static SmartAIMgr instance;
123 return &instance;
124}
Definition: SmartScriptMgr.h:2060
static SmartAIMgr * instance()
Definition: SmartScriptMgr.cpp:120

References instance().

Referenced by instance().

◆ IsAreaTriggerValid()

bool SmartAIMgr::IsAreaTriggerValid ( SmartScriptHolder const &  e,
uint32  entry 
)
inlineprivate
2203 {
2204 if (!sObjectMgr->GetAreaTrigger(entry))
2205 {
2206 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent AreaTrigger entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
2207 return false;
2208 }
2209 return true;
2210 }

References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), LOG_ERROR, and sObjectMgr.

Referenced by IsEventValid().

◆ IsCreatureValid()

bool SmartAIMgr::IsCreatureValid ( SmartScriptHolder const &  e,
uint32  entry 
)
inlineprivate
2133 {
2134 if (!sObjectMgr->GetCreatureTemplate(entry))
2135 {
2136 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Creature entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
2137 return false;
2138 }
2139 return true;
2140 }

References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), LOG_ERROR, and sObjectMgr.

Referenced by IsEventValid(), and IsTargetValid().

◆ IsEmoteValid()

bool SmartAIMgr::IsEmoteValid ( SmartScriptHolder const &  e,
uint32  entry 
)
inlineprivate
2193 {
2194 if (!sEmotesStore.LookupEntry(entry))
2195 {
2196 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Emote entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
2197 return false;
2198 }
2199 return true;
2200 }
DBCStorage< EmotesEntry > sEmotesStore(EmotesEntryfmt)

References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), LOG_ERROR, and sEmotesStore.

Referenced by IsEventValid().

◆ IsEventValid()

bool SmartAIMgr::IsEventValid ( SmartScriptHolder e)
private
953{
955 {
956 LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has invalid event type ({}), skipped.", e.entryOrGuid, e.event_id, e.GetEventType());
957 return false;
958 }
959 // in SMART_SCRIPT_TYPE_TIMED_ACTIONLIST all event types are overriden by core
961 {
962 LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {}, event type {} can not be used for Script type {}", e.entryOrGuid, e.GetEventType(), e.GetScriptType());
963 return false;
964 }
965 if (e.action.type <= 0
968 {
969 LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has an invalid action type ({}), skipped.", e.entryOrGuid, e.event_id, e.GetActionType());
970 return false;
971 }
972 switch (e.action.type)
973 {
978 LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has an action type that is not supported on 3.3.5a ({}), skipped.",
980 return false;
987 LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has an action type that is not yet supported on AzerothCore ({}), skipped.",
989 return false;
990 default:
991 break;
992 }
994 {
995 LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has an invalid target type ({}), skipped.",
997 return false;
998 }
1000 {
1001 LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has a target type that is not yet supported on AzerothCore ({}), skipped.",
1003 return false;
1004 }
1006 {
1007 LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has invalid phase mask ({}), skipped.", e.entryOrGuid, e.event_id, e.event.event_phase_mask);
1008 return false;
1009 }
1011 {
1012 LOG_ERROR("sql.sql", "SmartAIMgr: EntryOrGuid {} using event({}) has invalid event flags ({}), skipped.", e.entryOrGuid, e.event_id, e.event.event_flags);
1013 return false;
1014 }
1016 {
1017 e.event.type = SMART_EVENT_UPDATE_OOC;//force default OOC, can change when calling the script!
1019 return false;
1020
1022 return false;
1023 }
1024 else
1025 {
1026 uint32 type = e.event.type;
1027 switch (type)
1028 {
1029 case SMART_EVENT_UPDATE:
1040 return false;
1041
1043 return false;
1044 break;
1048 case SMART_EVENT_RANGE:
1051 return false;
1052
1054 return false;
1055
1057 return false;
1058
1059 break;
1062 if (e.event.spellHit.spell)
1063 {
1064 SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(e.event.spellHit.spell);
1065 if (!spellInfo)
1066 {
1067 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Spell entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
1068 return false;
1069 }
1070 if (e.event.spellHit.school && (e.event.spellHit.school & spellInfo->SchoolMask) != spellInfo->SchoolMask)
1071 {
1072 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses Spell entry {} with invalid school mask, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
1073 return false;
1074 }
1075 }
1077 return false;
1078 break;
1080 case SMART_EVENT_IC_LOS:
1082 {
1083 return false;
1084 }
1085
1087 {
1088 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses hostilityMode with invalid value {} (max allowed value {}), skipped.",
1090 return false;
1091 }
1092
1094 break;
1097 {
1098 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Map entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.map);
1099 return false;
1100 }
1102 {
1103 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Area entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.respawn.area);
1104 return false;
1105 }
1106 break;
1109 return false;
1110
1112 return false;
1113 break;
1116 return false;
1117 break;
1119 {
1121 return false;
1122
1123 if (!NotNULL(e, e.event.missingBuff.radius))
1124 return false;
1125
1127 return false;
1128 break;
1129 }
1130 case SMART_EVENT_KILL:
1132 return false;
1133
1135 return false;
1136
1138 break;
1140 if (e.event.targetCasting.spellId > 0 && !sSpellMgr->GetSpellInfo(e.event.targetCasting.spellId))
1141 {
1142 LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Spell entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell);
1143 return false;
1144 }
1145
1147 return false;
1148 break;
1152 return false;
1153 break;
1159 return false;
1160
1162 return false;
1163 break;
1166 if (e.event.quest.quest && !IsQuestValid(e, e.event.quest.quest))
1167 {
1168 return false;
1169 }
1170
1171 if (!IsMinMaxValid(e, e.event.quest.cooldownMin, e.event.quest.cooldownMax))
1172 {
1173 return false;
1174 }
1175 break;
1177 {
1178 if (e.event.emote.emote && !IsTextEmoteValid(e, e.event.emote.emote))
1179 return false;
1180
1181 if (!IsMinMaxValid(e, e.event.emote.cooldownMin, e.event.emote.cooldownMax))
1182 return false;
1183 break;
1184 }
1187 {
1188 if (!IsSpellValid(e, e.event.aura.spell))
1189 return false;
1190
1192 return false;
1193 break;
1194 }
1196 {
1198 return false;
1199 break;
1200 }
1202 {
1204 {
1205 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid Motion type {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.movementInform.type);
1206 return false;
1207 }
1208 break;
1209 }
1211 {
1213 return false;
1214 break;
1215 }
1217 {
1219 return false;
1220 break;
1221 }
1223 //if (e.event.textOver.textGroupID && !IsTextValid(e, e.event.textOver.textGroupID)) return false;// 0 is a valid text group!
1224 break;
1225 case SMART_EVENT_LINK:
1226 {
1227 if (e.link && e.link == e.event_id)
1228 {
1229 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {}, Event {}, Link Event is linking self (infinite loop), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id);
1230 return false;
1231 }
1232 break;
1233 }
1235 {
1237 {
1238 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has no param set, event won't be executed!.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
1239 return false;
1240 }
1241
1243 {
1244 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid phasemask {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.eventPhaseChange.phasemask);
1245 return false;
1246 }
1247
1249 {
1250 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses event phasemask {} and incompatible event_param1 {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.event_phase_mask, e.event.eventPhaseChange.phasemask);
1251 return false;
1252 }
1253 break;
1254 }
1257 {
1258 GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
1259 if (e.event.gameEvent.gameEventId >= events.size() || !events[e.event.gameEvent.gameEventId].isValid())
1260 return false;
1261 break;
1262 }
1264 {
1266 {
1267 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid event id {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.doAction.eventId);
1268 return false;
1269 }
1270 break;
1271 }
1274 return false;
1275
1277 return false;
1278
1279 if (e.event.friendlyHealthPct.hpPct > 100)
1280 {
1281 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has pct value above 100, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
1282 return false;
1283 }
1284
1285 switch (e.GetTargetType())
1286 {
1294 break;
1295 case SMART_TARGET_SELF:
1298 {
1299 return false;
1300 }
1301 break;
1302 default:
1303 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid target_type {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.GetTargetType());
1304 return false;
1305 }
1306 break;
1308 if (e.event.distance.guid == 0 && e.event.distance.entry == 0)
1309 {
1310 LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_CREATURE did not provide creature guid or entry, skipped.");
1311 return false;
1312 }
1313
1314 if (e.event.distance.guid != 0 && e.event.distance.entry != 0)
1315 {
1316 LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_CREATURE provided both an entry and guid, skipped.");
1317 return false;
1318 }
1319
1320 if (e.event.distance.guid != 0 && !sObjectMgr->GetCreatureData(e.event.distance.guid))
1321 {
1322 LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_CREATURE using invalid creature guid {}, skipped.", e.event.distance.guid);
1323 return false;
1324 }
1325
1326 if (e.event.distance.entry != 0 && !sObjectMgr->GetCreatureTemplate(e.event.distance.entry))
1327 {
1328 LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_CREATURE using invalid creature entry {}, skipped.", e.event.distance.entry);
1329 return false;
1330 }
1331 break;
1333 if (e.event.distance.guid == 0 && e.event.distance.entry == 0)
1334 {
1335 LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_GAMEOBJECT did not provide gameobject guid or entry, skipped.");
1336 return false;
1337 }
1338
1339 if (e.event.distance.guid != 0 && e.event.distance.entry != 0)
1340 {
1341 LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_GAMEOBJECT provided both an entry and guid, skipped.");
1342 return false;
1343 }
1344
1345 if (e.event.distance.guid != 0 && !sObjectMgr->GetGameObjectData(e.event.distance.guid))
1346 {
1347 LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_GAMEOBJECT using invalid gameobject guid {}, skipped.", e.event.distance.guid);
1348 return false;
1349 }
1350
1351 if (e.event.distance.entry != 0 && !sObjectMgr->GetGameObjectTemplate(e.event.distance.entry))
1352 {
1353 LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_DISTANCE_GAMEOBJECT using invalid gameobject entry {}, skipped.", e.event.distance.entry);
1354 return false;
1355 }
1356 break;
1359 return false;
1360
1361 if (e.event.counter.id == 0)
1362 {
1363 LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_COUNTER_SET using invalid counter id {}, skipped.", e.event.counter.id);
1364 return false;
1365 }
1366
1367 if (e.event.counter.value == 0)
1368 {
1369 LOG_ERROR("sql.sql", "SmartAIMgr: Event SMART_EVENT_COUNTER_SET using invalid value {}, skipped.", e.event.counter.value);
1370 return false;
1371 }
1372 break;
1375 return false;
1376 break;
1379 return false;
1380 break;
1394 case SMART_EVENT_AGGRO:
1395 case SMART_EVENT_DEATH:
1396 case SMART_EVENT_EVADE:
1398 case SMART_EVENT_RESET:
1418 break;
1419 default:
1420 LOG_ERROR("sql.sql", "SmartAIMgr: Not handled event_type({}), Entry {} SourceType {} Event {} Action {}, skipped.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
1421 return false;
1422 }
1423 }
1424
1425 if (!CheckUnusedEventParams(e))
1426 {
1427 return false;
1428 }
1429
1430 switch (e.GetActionType())
1431 {
1434 {
1435 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Faction {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.faction.factionID);
1436 return false;
1437 }
1438 break;
1442 {
1443 if (e.action.morphOrMount.creature > 0 && !sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature))
1444 {
1445 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Creature entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.creature);
1446 return false;
1447 }
1448
1450 {
1452 {
1453 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has ModelID set with also set CreatureId, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
1454 return false;
1455 }
1456 else if (!sCreatureDisplayInfoStore.LookupEntry(e.action.morphOrMount.model))
1457 {
1458 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Model id {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.morphOrMount.model);
1459 return false;
1460 }
1461 }
1462 }
1463 break;
1464 case SMART_ACTION_SOUND:
1465 if (!IsSoundValid(e, e.action.sound.sound))
1466 return false;
1467 AC_SAI_IS_BOOLEAN_VALID(e, e.action.sound.onlySelf);
1468 break;
1471 return false;
1472
1474 return false;
1475
1477 return false;
1478
1480 return false;
1481 break;
1482 case SMART_ACTION_MUSIC:
1483 if (!IsSoundValid(e, e.action.music.sound))
1484 return false;
1485 break;
1488 return false;
1489
1491 return false;
1492
1494 return false;
1495
1497 return false;
1498 break;
1501 if (!IsEmoteValid(e, e.action.emote.emote))
1502 return false;
1503 break;
1506 return false;
1507
1509 break;
1511 if (!IsQuestValid(e, e.action.quest.quest))
1512 return false;
1513 break;
1515 {
1516 if (!sTaxiPathStore.LookupEntry(e.action.taxi.id))
1517 {
1518 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid Taxi path ID {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.taxi.id);
1519 return false;
1520 }
1521 break;
1522 }
1524 {
1525 if (std::all_of(e.action.randomEmote.emotes.begin(), e.action.randomEmote.emotes.end(), [](uint32 emote) { return emote == 0; }))
1526 {
1527 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} does not have any non-zero emote",
1529 return false;
1530 }
1531
1532 for (uint32 emote : e.action.randomEmote.emotes)
1533 if (emote && !IsEmoteValid(e, emote))
1534 return false;
1535 break;
1536 }
1538 {
1539 if (std::all_of(e.action.randTimedActionList.actionLists.begin(), e.action.randTimedActionList.actionLists.end(), [](uint32 actionList) { return actionList == 0; }))
1540 {
1541 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} does not have any non-zero action list",
1543 return false;
1544 }
1545 break;
1546 }
1548 {
1549 if (std::all_of(e.action.closestWaypointFromList.wps.begin(), e.action.closestWaypointFromList.wps.end(), [](uint32 wp) { return wp == 0; }))
1550 {
1551 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} does not have any non-zero waypoint id",
1553 return false;
1554 }
1555 break;
1556 }
1559 {
1560 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has invoker cast action, but event does not provide any invoker!", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
1561 return false;
1562 }
1563 break;
1564 case SMART_ACTION_CAST:
1567 return false;
1568 break;
1571 return false;
1572 break;
1574 if (!IsSpellValid(e, e.action.addAura.spell))
1575 return false;
1576 break;
1579 if (Quest const* qid = sObjectMgr->GetQuestTemplate(e.action.quest.quest))
1580 {
1581 if (!qid->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT))
1582 {
1583 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} SpecialFlags for Quest entry {} does not include FLAGS_EXPLORATION_OR_EVENT(2), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
1584 return false;
1585 }
1586 }
1587 else
1588 {
1589 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Quest entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.quest.quest);
1590 return false;
1591 }
1592 break;
1595 {
1596 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} attempts to set phase {}. Phase mask cannot be used past phase {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setEventPhase.phase, SMART_EVENT_PHASE_MAX - 1);
1597 return false;
1598 }
1599 break;
1602 {
1603 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} is incrementing phase by 0, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
1604 return false;
1605 }
1607 {
1608 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} attempts to increment phase by too large value, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
1609 return false;
1610 }
1611 break;
1614 return false;
1615 break;
1617 {
1618 if (std::all_of(e.action.randomPhase.phases.begin(), e.action.randomPhase.phases.end(), [](uint32 phase) { return phase == 0; }))
1619 {
1620 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} does not have any non-zero phase",
1622 return false;
1623 }
1624
1625 if (std::any_of(e.action.randomPhase.phases.begin(), e.action.randomPhase.phases.end(), [](uint32 phase) { return phase >= SMART_EVENT_PHASE_MAX; }))
1626 {
1627 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
1628 return false;
1629 }
1630 break;
1631 }
1632 case SMART_ACTION_RANDOM_PHASE_RANGE: //PhaseMin, PhaseMax
1633 {
1636 {
1637 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
1638 return false;
1639 }
1640
1642 return false;
1643 break;
1644 }
1647 return false;
1649 {
1650 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses incorrect TempSummonType {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.type);
1651 return false;
1652 }
1653
1655 break;
1658 return false;
1659 break;
1662 return false;
1664 break;
1667 {
1668 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses incorrect Sheath state {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.setSheath.sheath);
1669 return false;
1670 }
1671 break;
1673 {
1675 {
1676 LOG_ERROR("sql.sql", "SmartAIMgr: Creature {} Event {} Action {} uses invalid React State {}, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.react.state);
1677 return false;
1678 }
1679 break;
1680 }
1683 return false;
1684 break;
1687 if (!IsItemValid(e, e.action.item.entry))
1688 return false;
1689
1690 if (!NotNULL(e, e.action.item.count))
1691 return false;
1692 break;
1694 if (!sMapStore.LookupEntry(e.action.teleport.mapID))
1695 {
1696 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Map entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.teleport.mapID);
1697 return false;
1698 }
1699 break;
1702 {
1703 LOG_ERROR("sql.sql", "SmartAIMgr: Creature {} Event {} Action {} uses non-existent AI template id {}, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.installTtemplate.id);
1704 return false;
1705 }
1706 break;
1709 return false;
1711 break;
1713 {
1714 if (!sSmartWaypointMgr->GetPath(e.action.wpStart.pathID))
1715 {
1716 LOG_ERROR("sql.sql", "SmartAIMgr: Creature {} Event {} Action {} uses non-existent WaypointPath id {}, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID);
1717 return false;
1718 }
1720 return false;
1721
1722 // Allow "invalid" value 3 for a while to allow cleanup the values stored in the db for SMART_ACTION_WP_START.
1723 // Remember to remove this once the clean is complete.
1724 constexpr uint32 TEMPORARY_EXTRA_VALUE_FOR_DB_CLEANUP = 1;
1725
1726 if (e.action.wpStart.reactState > (REACT_AGGRESSIVE + TEMPORARY_EXTRA_VALUE_FOR_DB_CLEANUP))
1727 {
1728 LOG_ERROR("sql.sql", "SmartAIMgr: Creature {} Event {} Action {} uses invalid React State {}, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.reactState);
1729 return false;
1730 }
1731
1734 break;
1735 }
1737 {
1739 return false;
1740
1742 return false;
1743 break;
1744 }
1746 {
1748 return false;
1749 break;
1750 }
1755 {
1756 LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Power {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.power.powerType);
1757 return false;
1758 }
1759 break;
1761 {
1762 uint32 eventId = e.action.gameEventStop.id;
1763
1764 GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
1765 if (eventId < 1 || eventId >= events.size())
1766 {
1767 LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent event, eventId {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStop.id);
1768 return false;
1769 }
1770
1771 GameEventData const& eventData = events[eventId];
1772 if (!eventData.isValid())
1773 {
1774 LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent event, eventId {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStop.id);
1775 return false;
1776 }
1777 break;
1778 }
1780 {
1781 uint32 eventId = e.action.gameEventStart.id;
1782
1783 GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
1784 if (eventId < 1 || eventId >= events.size())
1785 {
1786 LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent event, eventId {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStart.id);
1787 return false;
1788 }
1789
1790 GameEventData const& eventData = events[eventId];
1791 if (!eventData.isValid())
1792 {
1793 LOG_ERROR("scripts.ai.sai", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent event, eventId {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.gameEventStart.id);
1794 return false;
1795 }
1796 break;
1797 }
1798 case SMART_ACTION_EQUIP:
1799 {
1801 {
1802 if (int8 equipId = static_cast<int8>(e.action.equip.entry))
1803 {
1804 EquipmentInfo const* eInfo = sObjectMgr->GetEquipmentInfo(e.entryOrGuid, equipId);
1805 if (!eInfo)
1806 {
1807 LOG_ERROR("scripts.ai.sai", "SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id {} for creature {}, skipped.", equipId, e.entryOrGuid);
1808 return false;
1809 }
1810 }
1811 }
1812 break;
1813 }
1815 {
1817 {
1818 LOG_ERROR("scripts.ai.sai", "SmartScript: SMART_ACTION_LOAD_GRID uses invalid map coords: {}, skipped.", e.entryOrGuid);
1819 return false;
1820 }
1821 break;
1822 }
1824 {
1826 {
1827 LOG_ERROR("sql.sql", "SmartScript: action_type {} is not allowed with source_type {}. Entry {}, skipped.", e.GetActionType(), e.GetScriptType(), e.entryOrGuid);
1828 return false;
1829 }
1830 break;
1831 }
1833 {
1834 if (e.action.setInstanceData.type == 1)
1835 {
1836 if (e.action.setInstanceData.data >= EncounterState::TO_BE_DECIDED)
1837 {
1838 LOG_ERROR("sql.sql", "SmartScript: SMART_ACTION_SET_INST_DATA with type 1 (bossState) uses invalid encounter state {}. Source entry {}, type {}", e.action.setInstanceData.data, e.entryOrGuid, e.GetScriptType());
1839 return false;
1840 }
1841 }
1842 else if (e.action.setInstanceData.type > 1)
1843 {
1844 LOG_ERROR("sql.sql", "SmartScript: SMART_ACTION_SET_INST_DATA uses unsupported data type {}. Source entry {}, type {}", e.action.setInstanceData.type, e.entryOrGuid, e.GetScriptType());
1845 return false;
1846 }
1847 break;
1848 }
1850 {
1852 {
1853 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} is trying to set invalid HP percent {}, skipped.",
1855 return false;
1856 }
1857 break;
1858 }
1860 {
1862 {
1863 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses invalid movementType {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.movementSpeed.movementType);
1864 return false;
1865 }
1866
1868 {
1869 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses speed 0, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
1870 return false;
1871 }
1872 break;
1873 }
1875 {
1877 break;
1878 }
1880 {
1882 break;
1883 }
1885 {
1887 break;
1888 }
1890 {
1892 break;
1893 }
1895 {
1897 break;
1898 }
1900 {
1902 break;
1903 }
1905 {
1907 break;
1908 }
1910 {
1912 break;
1913 }
1915 {
1918 break;
1919 }
1921 {
1923 break;
1924 }
1926 {
1928 break;
1929 }
1931 {
1933 break;
1934 }
1935 case SMART_ACTION_TALK:
1938 return false;
1939 break;
1942 return false;
1943 break;
1945 {
1947 break;
1948 }
1950 {
1952 break;
1953 }
1956 case SMART_ACTION_EVADE:
1962 case SMART_ACTION_DIE:
2015 case SMART_ACTION_FLEE:
2022 case SMART_ACTION_FALL:
2049 break;
2050 default:
2051 LOG_ERROR("sql.sql", "SmartAIMgr: Not handled action_type({}), event_type({}), Entry {} SourceType {} Event {}, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
2052 return false;
2053 }
2054
2056 return false;
2057
2058 return true;
2059}
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
Definition: Util.h:619
std::int8_t int8
Definition: Define.h:105
events
Definition: boss_sartura.cpp:43
phase
Definition: boss_skadi.cpp:103
@ MAX_POWERS
Definition: SharedDefines.h:276
@ EVENT_CHARGE
Definition: SharedDefines.h:3311
#define AC_SAI_IS_BOOLEAN_VALID(e, value)
Definition: SmartScriptMgr.cpp:30
@ SMART_SCRIPT_TYPE_TIMED_ACTIONLIST
Definition: SmartScriptMgr.h:1765
@ SMART_SCRIPT_TYPE_CREATURE
Definition: SmartScriptMgr.h:1756
@ SMART_SCRIPT_TYPE_GAMEOBJECT
Definition: SmartScriptMgr.h:1757
@ SMARTAI_TEMPLATE_END
Definition: SmartScriptMgr.h:1515
@ SMART_EVENT_FLAGS_ALL
Definition: SmartScriptMgr.h:1926
@ SMART_TARGET_AC_END
Definition: SmartScriptMgr.h:1563
@ SMART_TARGET_AC_START
Definition: SmartScriptMgr.h:1555
@ SMART_TARGET_TC_END
Definition: SmartScriptMgr.h:1551
const uint32 SmartAIEventMask[SMART_EVENT_AC_END][2]
Definition: SmartScriptMgr.h:1797
#define sSmartWaypointMgr
Definition: SmartScriptMgr.h:2229
@ SMART_SCRIPT_RESPAWN_CONDITION_AREA
Definition: SmartScriptMgr.h:552
@ SMART_SCRIPT_RESPAWN_CONDITION_MAP
Definition: SmartScriptMgr.h:551
@ SMART_ACTION_TC_END
Definition: SmartScriptMgr.h:698
@ SMART_ACTION_AC_START
Definition: SmartScriptMgr.h:701
@ SMART_ACTION_CONE_SUMMON
Definition: SmartScriptMgr.h:722
@ SMART_ACTION_REMOVE_AURAS_BY_TYPE
Definition: SmartScriptMgr.h:678
@ SMART_ACTION_VORTEX_SUMMON
Definition: SmartScriptMgr.h:724
@ SMART_ACTION_SPAWN_SPAWNGROUP
Definition: SmartScriptMgr.h:689
@ SMART_ACTION_RANDOM_MUSIC
Definition: SmartScriptMgr.h:719
@ SMART_ACTION_ADD_IMMUNITY
Definition: SmartScriptMgr.h:710
@ SMART_ACTION_CUSTOM_CAST
Definition: SmartScriptMgr.h:721
@ SMART_ACTION_CU_ENCOUNTER_START
Definition: SmartScriptMgr.h:725
@ SMART_ACTION_AC_END
Definition: SmartScriptMgr.h:742
@ SMART_ACTION_PLAYER_TALK
Definition: SmartScriptMgr.h:723
@ SMART_ACTION_DISMOUNT
Definition: SmartScriptMgr.h:708
@ SMART_ACTION_DESPAWN_SPAWNGROUP
Definition: SmartScriptMgr.h:690
@ SMART_ACTION_RESPAWN_BY_SPAWNID
Definition: SmartScriptMgr.h:691
@ SMART_ACTION_REMOVE_MOVEMENT
Definition: SmartScriptMgr.h:685
@ SMART_ACTION_DO_ACTION
Definition: SmartScriptMgr.h:726
@ SMART_ACTION_SET_CAN_FLY
Definition: SmartScriptMgr.h:677
@ SMART_ACTION_REMOVE_IMMUNITY
Definition: SmartScriptMgr.h:711
@ SMART_EVENT_AC_START
Definition: SmartScriptMgr.h:207
@ SMART_EVENT_TC_END
Definition: SmartScriptMgr.h:204
@ SMART_EVENT_AC_END
Definition: SmartScriptMgr.h:220
@ SMART_EVENT_PHASE_ALL
Definition: SmartScriptMgr.h:97
@ SMART_EVENT_PHASE_MAX
Definition: SmartScriptMgr.h:77
const uint32 SmartAITypeMask[SMART_SCRIPT_TYPE_MAX][2]
Definition: SmartScriptMgr.h:1783
@ QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT
Definition: QuestDef.h:161
#define sSpellMgr
Definition: SpellMgr.h:825
#define sGameEventMgr
Definition: GameEventMgr.h:186
@ TEMPSUMMON_MANUAL_DESPAWN
Definition: Object.h:53
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
Definition: Object.h:46
@ REACT_AGGRESSIVE
Definition: Unit.h:550
#define MAX_MOVE_TYPE
Definition: UnitDefines.h:339
#define MAX_SHEATH_STATE
Definition: UnitDefines.h:110
DBCStorage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore(CreatureDisplayInfofmt)
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
DBCStorage< TaxiPathEntry > sTaxiPathStore(TaxiPathEntryfmt)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTableEntryfmt)
@ NULL_MOTION_TYPE
Definition: MotionMaster.h:58
bool IsValidMapCoord(float c)
Definition: GridDefines.h:215
uint32 map
Definition: SmartScriptMgr.h:272
uint32 event_flags
Definition: SmartScriptMgr.h:228
uint32 event_phase_mask
Definition: SmartScriptMgr.h:226
uint32 entry
Definition: SmartScriptMgr.h:463
uint32 id
Definition: SmartScriptMgr.h:358
uint32 cooldownMax
Definition: SmartScriptMgr.h:244
uint32 min
Definition: SmartScriptMgr.h:233
uint32 radius
Definition: SmartScriptMgr.h:292
uint32 school
Definition: SmartScriptMgr.h:252
uint32 rangeMin
Definition: SmartScriptMgr.h:237
uint32 eventId
Definition: SmartScriptMgr.h:442
uint32 guid
Definition: SmartScriptMgr.h:462
uint32 spellId
Definition: SmartScriptMgr.h:286
uint32 hpPct
Definition: SmartScriptMgr.h:456
uint32 hostilityMode
Hostility mode of the event. 0: hostile, 1: not hostile, 2: any
Definition: SmartScriptMgr.h:262
uint32 repeatMin
Definition: SmartScriptMgr.h:235
uint32 area
Definition: SmartScriptMgr.h:273
uint32 value
Definition: SmartScriptMgr.h:364
SAIBool playerOnly
Definition: SmartScriptMgr.h:245
uint32 spell
Definition: SmartScriptMgr.h:251
uint32 repeatMax
Definition: SmartScriptMgr.h:236
uint32 max
Definition: SmartScriptMgr.h:234
uint32 gameEventId
Definition: SmartScriptMgr.h:432
uint32 cooldownMin
Definition: SmartScriptMgr.h:243
uint32 rangeMax
Definition: SmartScriptMgr.h:238
SMART_EVENT type
Definition: SmartScriptMgr.h:225
uint32 creature
Definition: SmartScriptMgr.h:246
uint32 phasemask
Definition: SmartScriptMgr.h:427
std::array< uint32, SMART_ACTION_PARAM_COUNT > emotes
Definition: SmartScriptMgr.h:843
uint32 repeatMax
Definition: SmartScriptMgr.h:1119
uint32 phaseMin
Definition: SmartScriptMgr.h:945
SAIBool reset
Definition: SmartScriptMgr.h:1104
std::array< uint32, SMART_ACTION_PARAM_COUNT > actionLists
Definition: SmartScriptMgr.h:1167
SAIBool root
Definition: SmartScriptMgr.h:1248
SAIBool disable
Definition: SmartScriptMgr.h:1391
uint32 spell
Definition: SmartScriptMgr.h:848
std::array< uint32, SMART_ACTION_PARAM_COUNT > wps
Definition: SmartScriptMgr.h:1286
SAIBool force
Definition: SmartScriptMgr.h:1313
uint32 data
Definition: SmartScriptMgr.h:957
uint32 powerType
Definition: SmartScriptMgr.h:1270
SAIBool regenHealth
Definition: SmartScriptMgr.h:1243
uint32 entry
Definition: SmartScriptMgr.h:932
SAIBool allowOverride
Definition: SmartScriptMgr.h:1162
struct SmartAction::@75::@175 castCustom
uint32 min
Definition: SmartScriptMgr.h:1116
SAIBool withDelayed
Definition: SmartScriptMgr.h:1178
SAIBool withInstant
Definition: SmartScriptMgr.h:1180
uint32 percent
Definition: SmartScriptMgr.h:998
uint32 dec
Definition: SmartScriptMgr.h:914
struct SmartAction::@75::@84 randomMusic
uint32 mapID
Definition: SmartScriptMgr.h:1097
uint32 model
Definition: SmartScriptMgr.h:783
SAIBool attackInvoker
Definition: SmartScriptMgr.h:879
SAIBool useTalkTarget
Definition: SmartScriptMgr.h:766
SAIBool run
Definition: SmartScriptMgr.h:1042
SAIBool swim
Definition: SmartScriptMgr.h:1092
uint32 sound2
Definition: SmartScriptMgr.h:796
uint32 creature
Definition: SmartScriptMgr.h:782
uint32 sound3
Definition: SmartScriptMgr.h:797
uint32 state
Definition: SmartScriptMgr.h:838
uint32 sound1
Definition: SmartScriptMgr.h:795
SAIBool updateLevel
Definition: SmartScriptMgr.h:969
SMART_ACTION type
Definition: SmartScriptMgr.h:758
uint32 sound4
Definition: SmartScriptMgr.h:798
SAIBool attack
Definition: SmartScriptMgr.h:898
uint32 repeatMin
Definition: SmartScriptMgr.h:1118
SAIBool fly
Definition: SmartScriptMgr.h:1085
uint32 textGroupID
Definition: SmartScriptMgr.h:764
std::array< uint32, SMART_ACTION_PARAM_COUNT > phases
Definition: SmartScriptMgr.h:940
SAIBool repeat
Definition: SmartScriptMgr.h:1044
uint32 count
Definition: SmartScriptMgr.h:1065
uint32 inc
Definition: SmartScriptMgr.h:913
uint32 phaseMax
Definition: SmartScriptMgr.h:946
SAIBool withEmote
Definition: SmartScriptMgr.h:980
uint32 max
Definition: SmartScriptMgr.h:1117
uint32 speedFraction
Definition: SmartScriptMgr.h:1403
SAIBool fail
Definition: SmartScriptMgr.h:1059
SAIBool directAdd
Definition: SmartScriptMgr.h:833
uint32 reactState
Definition: SmartScriptMgr.h:1047
uint32 speedInteger
Definition: SmartScriptMgr.h:1402
uint32 factionID
Definition: SmartScriptMgr.h:777
uint32 movementType
Definition: SmartScriptMgr.h:1401
uint32 questID
Definition: SmartScriptMgr.h:832
uint32 pathID
Definition: SmartScriptMgr.h:1043
uint32 id
Definition: SmartScriptMgr.h:1037
uint32 phase
Definition: SmartScriptMgr.h:908
uint32 sheath
Definition: SmartScriptMgr.h:985
float x
Definition: SmartScriptMgr.h:1581
float y
Definition: SmartScriptMgr.h:1581
SMARTAI_TARGETS type
Definition: SmartScriptMgr.h:1580
uint32 link
Definition: SmartScriptMgr.h:1965
uint32 event_id
Definition: SmartScriptMgr.h:1964
int32 entryOrGuid
Definition: SmartScriptMgr.h:1962
uint32 GetScriptType() const
Definition: SmartScriptMgr.h:1972
uint32 GetEventType() const
Definition: SmartScriptMgr.h:1973
uint32 GetTargetType() const
Definition: SmartScriptMgr.h:1975
SmartAction action
Definition: SmartScriptMgr.h:1968
SmartEvent event
Definition: SmartScriptMgr.h:1967
uint32 GetActionType() const
Definition: SmartScriptMgr.h:1974
SmartTarget target
Definition: SmartScriptMgr.h:1969
bool IsTextEmoteValid(SmartScriptHolder const &e, uint32 entry)
Definition: SmartScriptMgr.h:2182
bool NotNULL(SmartScriptHolder const &e, uint32 data)
Definition: SmartScriptMgr.h:2122
bool IsSoundValid(SmartScriptHolder const &e, uint32 entry)
Definition: SmartScriptMgr.h:2212
bool IsGameObjectValid(SmartScriptHolder const &e, uint32 entry)
Definition: SmartScriptMgr.h:2152
bool IsMinMaxValid(SmartScriptHolder const &e, uint32 min, uint32 max)
Definition: SmartScriptMgr.h:2102
static bool EventHasInvoker(SMART_EVENT event)
Definition: SmartScriptMgr.cpp:382
bool IsQuestValid(SmartScriptHolder const &e, uint32 entry)
Definition: SmartScriptMgr.h:2142
bool IsCreatureValid(SmartScriptHolder const &e, uint32 entry)
Definition: SmartScriptMgr.h:2132
bool IsAreaTriggerValid(SmartScriptHolder const &e, uint32 entry)
Definition: SmartScriptMgr.h:2202
static bool IsTextValid(SmartScriptHolder const &e, uint32 id)
Definition: SmartScriptMgr.cpp:2061
static bool CheckUnusedEventParams(SmartScriptHolder const &e)
Definition: SmartScriptMgr.cpp:562
static bool CheckUnusedActionParams(SmartScriptHolder const &e)
Definition: SmartScriptMgr.cpp:687
bool IsItemValid(SmartScriptHolder const &e, uint32 entry)
Definition: SmartScriptMgr.h:2172
bool IsEmoteValid(SmartScriptHolder const &e, uint32 entry)
Definition: SmartScriptMgr.h:2192
bool IsSpellValid(SmartScriptHolder const &e, uint32 entry)
Definition: SmartScriptMgr.h:2162
Definition: CreatureData.h:360
Definition: GameEventMgr.h:57
bool isValid() const
Definition: GameEventMgr.h:73
std::vector< GameEventData > GameEventDataMap
Definition: GameEventMgr.h:107
Definition: QuestDef.h:210
Definition: SpellInfo.h:316
uint32 SchoolMask
Definition: SpellInfo.h:392

References AC_SAI_IS_BOOLEAN_VALID, SmartScriptHolder::action, SmartAction::actionLists, SmartAction::addAura, SmartAction::allowOverride, SmartEvent::area, SmartEvent::areatrigger, AsUnderlyingType(), SmartAction::attack, SmartAction::attackInvoker, SmartEvent::aura, SmartAction::autoAttack, SmartAction::callHelp, SmartAction::castCustom, CheckUnusedActionParams(), CheckUnusedEventParams(), SmartAction::closestWaypointFromList, SmartAction::combatMove, SmartEvent::cooldownMax, SmartEvent::cooldownMin, SmartAction::count, SmartEvent::counter, SmartEvent::creature, SmartAction::creature, SmartAction::crossCast, SmartAction::data, SmartEvent::dataSet, SmartAction::dec, SmartAction::directAdd, SmartAction::disable, SmartAction::disableEvade, SmartEvent::distance, SmartEvent::doAction, SmartEvent::emote, SmartAction::emote, SmartAction::emotes, SmartEvent::End, SmartEvent::entry, SmartAction::entry, SmartScriptHolder::entryOrGuid, SmartAction::equip, SmartScriptHolder::event, EVENT_CHARGE, SmartEvent::event_flags, SmartScriptHolder::event_id, SmartEvent::event_phase_mask, EventHasInvoker(), SmartEvent::eventId, SmartEvent::eventPhaseChange, SmartAction::faction, SmartAction::factionID, SmartAction::fail, SmartAction::fly, SmartAction::force, SmartEvent::friendlyCC, SmartEvent::friendlyHealth, SmartEvent::friendlyHealthPct, SmartEvent::gameEvent, SmartEvent::gameEventId, SmartAction::gameEventStart, SmartAction::gameEventStop, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetEventType(), SmartScriptHolder::GetScriptType(), SmartScriptHolder::GetTargetType(), SmartEvent::guid, SmartEvent::hostilityMode, SmartEvent::hpPct, SmartEvent::id, SmartAction::id, SmartAction::inc, SmartAction::incEventPhase, SmartAction::installTtemplate, SmartAction::interruptSpellCasting, IsAreaTriggerValid(), IsCreatureValid(), IsEmoteValid(), IsGameObjectValid(), IsItemValid(), IsMinMaxValid(), IsQuestValid(), IsSoundValid(), IsSpellValid(), IsTextEmoteValid(), IsTextValid(), GameEventData::isValid(), Acore::IsValidMapCoord(), SmartAction::item, SmartEvent::kill, SmartAction::killedMonster, SmartScriptHolder::link, SmartAction::loadEquipment, LOG_ERROR, SmartEvent::los, SmartEvent::map, SmartAction::mapID, SmartEvent::max, SmartAction::max, MAX_MOVE_TYPE, MAX_POWERS, MAX_SHEATH_STATE, SmartEvent::min, SmartAction::min, SmartEvent::minMax, SmartEvent::minMaxRepeat, SmartEvent::missingBuff, SmartAction::model, SmartAction::morphOrMount, SmartAction::move, SmartEvent::movementInform, SmartAction::movementSpeed, SmartAction::movementType, SmartAction::music, SmartEvent::nearPlayer, SmartEvent::nearPlayerNegation, NotNULL(), NULL_MOTION_TYPE, SmartAction::pathID, SmartAction::percent, SmartAction::phase, SmartEvent::phasemask, SmartAction::phaseMax, SmartAction::phaseMin, SmartAction::phases, SmartEvent::playerOnly, SmartAction::power, SmartAction::powerType, SmartEvent::quest, SmartAction::quest, QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT, SmartAction::questID, SmartAction::questOffer, SmartEvent::radius, SmartAction::randomEmote, SmartAction::randomMusic, SmartAction::randomPhase, SmartAction::randomPhaseRange, SmartAction::randomSound, SmartAction::randTimedActionList, SmartEvent::rangeMax, SmartEvent::rangeMin, SmartAction::react, REACT_AGGRESSIVE, SmartAction::reactState, SmartAction::regenHealth, SmartAction::removeAura, SmartAction::repeat, SmartEvent::repeatMax, SmartAction::repeatMax, SmartEvent::repeatMin, SmartAction::repeatMin, SmartAction::reset, SmartEvent::respawn, SmartAction::root, SmartAction::run, sAreaTableStore, SmartEvent::school, SpellInfo::SchoolMask, sCreatureDisplayInfoStore, SmartAction::setCounter, SmartAction::setEventPhase, SmartAction::setFly, SmartAction::setHealthPct, SmartAction::setHealthRegen, SmartAction::setInstanceData, SmartAction::setRoot, SmartAction::setRun, SmartAction::setSheath, SmartAction::setSwim, sFactionTemplateStore, sGameEventMgr, SmartAction::sheath, SmartAction::simpleTalk, sMapStore, SMART_ACTION_AC_END, SMART_ACTION_AC_START, SMART_ACTION_ACTIVATE_GOBJECT, SMART_ACTION_ACTIVATE_TAXI, SMART_ACTION_ADD_AURA, SMART_ACTION_ADD_DYNAMIC_FLAG, SMART_ACTION_ADD_GO_FLAG, SMART_ACTION_ADD_IMMUNITY, SMART_ACTION_ADD_ITEM, SMART_ACTION_ADD_NPC_FLAG, SMART_ACTION_ADD_POWER, SMART_ACTION_ADD_THREAT, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, SMART_ACTION_ATTACK_START, SMART_ACTION_ATTACK_STOP, SMART_ACTION_AUTO_ATTACK, SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS, SMART_ACTION_CALL_FOR_HELP, SMART_ACTION_CALL_GROUPEVENTHAPPENS, SMART_ACTION_CALL_KILLEDMONSTER, SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST, SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST, SMART_ACTION_CALL_SCRIPT_RESET, SMART_ACTION_CALL_TIMED_ACTIONLIST, SMART_ACTION_CAST, SMART_ACTION_CLOSE_GOSSIP, SMART_ACTION_COMBAT_STOP, SMART_ACTION_CONE_SUMMON, SMART_ACTION_CREATE_TIMED_EVENT, SMART_ACTION_CROSS_CAST, SMART_ACTION_CU_ENCOUNTER_START, SMART_ACTION_CUSTOM_CAST, SMART_ACTION_DESPAWN_SPAWNGROUP, SMART_ACTION_DIE, SMART_ACTION_DISABLE_EVADE, SMART_ACTION_DISMOUNT, SMART_ACTION_DO_ACTION, SMART_ACTION_EQUIP, SMART_ACTION_EVADE, SMART_ACTION_EXIT_VEHICLE, SMART_ACTION_FAIL_QUEST, SMART_ACTION_FALL, SMART_ACTION_FLEE, SMART_ACTION_FLEE_FOR_ASSIST, SMART_ACTION_FOLLOW, SMART_ACTION_FOLLOW_GROUP, SMART_ACTION_FORCE_DESPAWN, SMART_ACTION_GAME_EVENT_START, SMART_ACTION_GAME_EVENT_STOP, SMART_ACTION_GO_SET_GO_STATE, SMART_ACTION_GO_SET_LOOT_STATE, SMART_ACTION_INC_EVENT_PHASE, SMART_ACTION_INSTALL_AI_TEMPLATE, SMART_ACTION_INTERRUPT_SPELL, SMART_ACTION_INVOKER_CAST, SMART_ACTION_JUMP_TO_POS, SMART_ACTION_KILL_UNIT, SMART_ACTION_LOAD_EQUIPMENT, SMART_ACTION_LOAD_GRID, SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL, SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL, SMART_ACTION_MOVE_FORWARD, SMART_ACTION_MOVE_TO_POS, SMART_ACTION_MOVE_TO_POS_TARGET, SMART_ACTION_MOVEMENT_PAUSE, SMART_ACTION_MOVEMENT_RESUME, SMART_ACTION_MOVEMENT_STOP, SMART_ACTION_MUSIC, SMART_ACTION_NO_ENVIRONMENT_UPDATE, SMART_ACTION_OFFER_QUEST, SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT, SMART_ACTION_PLAY_ANIMKIT, SMART_ACTION_PLAY_CINEMATIC, SMART_ACTION_PLAY_EMOTE, SMART_ACTION_PLAY_SPELL_VISUAL, SMART_ACTION_PLAYER_TALK, SMART_ACTION_PLAYMOVIE, SMART_ACTION_RANDOM_EMOTE, SMART_ACTION_RANDOM_MOVE, SMART_ACTION_RANDOM_MUSIC, SMART_ACTION_RANDOM_PHASE, SMART_ACTION_RANDOM_PHASE_RANGE, SMART_ACTION_RANDOM_SOUND, SMART_ACTION_REMOVE_ALL_GAMEOBJECTS, SMART_ACTION_REMOVE_AURAS_BY_TYPE, SMART_ACTION_REMOVE_DYNAMIC_FLAG, SMART_ACTION_REMOVE_GO_FLAG, SMART_ACTION_REMOVE_IMMUNITY, SMART_ACTION_REMOVE_ITEM, SMART_ACTION_REMOVE_MOVEMENT, SMART_ACTION_REMOVE_NPC_FLAG, SMART_ACTION_REMOVE_POWER, SMART_ACTION_REMOVE_TIMED_EVENT, SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1, SMART_ACTION_REMOVE_UNIT_FLAG, SMART_ACTION_REMOVEAURASFROMSPELL, SMART_ACTION_RESERVED_16, SMART_ACTION_RESET_GOBJECT, SMART_ACTION_RESET_SCRIPT_BASE_OBJECT, SMART_ACTION_RESPAWN_BY_SPAWNID, SMART_ACTION_RESPAWN_TARGET, SMART_ACTION_RISE_UP, SMART_ACTION_SCENE_CANCEL, SMART_ACTION_SCENE_PLAY, SMART_ACTION_SCRIPTED_SPAWN, SMART_ACTION_SEND_GO_CUSTOM_ANIM, SMART_ACTION_SEND_GOSSIP_MENU, SMART_ACTION_SEND_TARGET_TO_TARGET, SMART_ACTION_SET_ACTIVE, SMART_ACTION_SET_CAN_FLY, SMART_ACTION_SET_COMBAT_DISTANCE, SMART_ACTION_SET_CORPSE_DELAY, SMART_ACTION_SET_COUNTER, SMART_ACTION_SET_DATA, SMART_ACTION_SET_DYNAMIC_FLAG, SMART_ACTION_SET_EMOTE_STATE, SMART_ACTION_SET_EVENT_FLAG_RESET, SMART_ACTION_SET_EVENT_PHASE, SMART_ACTION_SET_FACTION, SMART_ACTION_SET_FLY, SMART_ACTION_SET_GO_FLAG, SMART_ACTION_SET_GUID, SMART_ACTION_SET_HEALTH_PCT, SMART_ACTION_SET_HEALTH_REGEN, SMART_ACTION_SET_HOME_POS, SMART_ACTION_SET_HOVER, SMART_ACTION_SET_IN_COMBAT_WITH_ZONE, SMART_ACTION_SET_INGAME_PHASE_MASK, SMART_ACTION_SET_INST_DATA, SMART_ACTION_SET_INST_DATA64, SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL, SMART_ACTION_SET_MOVEMENT_SPEED, SMART_ACTION_SET_NPC_FLAG, SMART_ACTION_SET_ORIENTATION, SMART_ACTION_SET_ORIENTATION_TARGET, SMART_ACTION_SET_POWER, SMART_ACTION_SET_RANGED_MOVEMENT, SMART_ACTION_SET_REACT_STATE, SMART_ACTION_SET_ROOT, SMART_ACTION_SET_RUN, SMART_ACTION_SET_SCALE, SMART_ACTION_SET_SHEATH, SMART_ACTION_SET_SIGHT_DIST, SMART_ACTION_SET_SWIM, SMART_ACTION_SET_UNIT_FIELD_BYTES_1, SMART_ACTION_SET_UNIT_FLAG, SMART_ACTION_SET_UNIT_MOVEMENT_FLAGS, SMART_ACTION_SET_VISIBILITY, SMART_ACTION_SIMPLE_TALK, SMART_ACTION_SOUND, SMART_ACTION_SPAWN_SPAWNGROUP, SMART_ACTION_START_CLOSEST_WAYPOINT, SMART_ACTION_STOP_MOTION, SMART_ACTION_STORE_TARGET_LIST, SMART_ACTION_SUMMON_CREATURE, SMART_ACTION_SUMMON_CREATURE_GROUP, SMART_ACTION_SUMMON_GO, SMART_ACTION_SUMMON_RADIAL, SMART_ACTION_TALK, SMART_ACTION_TC_END, SMART_ACTION_TELEPORT, SMART_ACTION_THREAT_ALL_PCT, SMART_ACTION_THREAT_SINGLE_PCT, SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT, SMART_ACTION_TRIGGER_TIMED_EVENT, SMART_ACTION_UPDATE_TEMPLATE, SMART_ACTION_VORTEX_SUMMON, SMART_ACTION_WAYPOINT_DATA_RANDOM, SMART_ACTION_WAYPOINT_DATA_START, SMART_ACTION_WORLD_SCRIPT, SMART_ACTION_WP_PAUSE, SMART_ACTION_WP_RESUME, SMART_ACTION_WP_START, SMART_ACTION_WP_STOP, SMART_ACTION_ZONE_UNDER_ATTACK, SMART_EVENT_AC_END, SMART_EVENT_AC_START, SMART_EVENT_ACCEPTED_QUEST, SMART_EVENT_ACTION_DONE, SMART_EVENT_AGGRO, SMART_EVENT_AI_INIT, SMART_EVENT_AREA_CASTING, SMART_EVENT_AREA_RANGE, SMART_EVENT_AREATRIGGER_ONTRIGGER, SMART_EVENT_CHARMED, SMART_EVENT_CHARMED_TARGET, SMART_EVENT_CORPSE_REMOVED, SMART_EVENT_COUNTER_SET, SMART_EVENT_DAMAGED, SMART_EVENT_DAMAGED_TARGET, SMART_EVENT_DATA_SET, SMART_EVENT_DEATH, SMART_EVENT_DISTANCE_CREATURE, SMART_EVENT_DISTANCE_GAMEOBJECT, SMART_EVENT_EVADE, SMART_EVENT_EVENT_PHASE_CHANGE, SMART_EVENT_FLAGS_ALL, SMART_EVENT_FOLLOW_COMPLETED, SMART_EVENT_FRIENDLY_HEALTH, SMART_EVENT_FRIENDLY_HEALTH_PCT, SMART_EVENT_FRIENDLY_IS_CC, SMART_EVENT_FRIENDLY_MISSING_BUFF, SMART_EVENT_GAME_EVENT_END, SMART_EVENT_GAME_EVENT_START, SMART_EVENT_GO_EVENT_INFORM, SMART_EVENT_GO_STATE_CHANGED, SMART_EVENT_GOSSIP_HELLO, SMART_EVENT_GOSSIP_SELECT, SMART_EVENT_HAS_AURA, SMART_EVENT_HEALTH_PCT, SMART_EVENT_IC_LOS, SMART_EVENT_INSTANCE_PLAYER_ENTER, SMART_EVENT_IS_BEHIND_TARGET, SMART_EVENT_IS_IN_MELEE_RANGE, SMART_EVENT_JUST_CREATED, SMART_EVENT_JUST_SUMMONED, SMART_EVENT_KILL, SMART_EVENT_LINK, SMART_EVENT_MANA_PCT, SMART_EVENT_MOVEMENTINFORM, SMART_EVENT_NEAR_PLAYERS, SMART_EVENT_NEAR_PLAYERS_NEGATION, SMART_EVENT_NEAR_UNIT, SMART_EVENT_NEAR_UNIT_NEGATION, SMART_EVENT_ON_SPELLCLICK, SMART_EVENT_OOC_LOS, SMART_EVENT_PASSENGER_BOARDED, SMART_EVENT_PASSENGER_REMOVED, SMART_EVENT_PHASE_ALL, SMART_EVENT_PHASE_MAX, SMART_EVENT_QUEST_ACCEPTED, SMART_EVENT_QUEST_COMPLETION, SMART_EVENT_QUEST_FAIL, SMART_EVENT_QUEST_OBJ_COMPLETION, SMART_EVENT_QUEST_REWARDED, SMART_EVENT_RANGE, SMART_EVENT_REACHED_HOME, SMART_EVENT_RECEIVE_EMOTE, SMART_EVENT_RECEIVE_HEAL, SMART_EVENT_RESET, SMART_EVENT_RESPAWN, SMART_EVENT_REWARD_QUEST, SMART_EVENT_SPELLHIT, SMART_EVENT_SPELLHIT_TARGET, SMART_EVENT_SUMMON_DESPAWNED, SMART_EVENT_SUMMONED_UNIT, SMART_EVENT_SUMMONED_UNIT_DIES, SMART_EVENT_SUMMONED_UNIT_EVADE, SMART_EVENT_TARGET_BUFFED, SMART_EVENT_TARGET_HEALTH_PCT, SMART_EVENT_TARGET_MANA_PCT, SMART_EVENT_TC_END, SMART_EVENT_TEXT_OVER, SMART_EVENT_TIMED_EVENT_TRIGGERED, SMART_EVENT_TRANSPORT_ADDCREATURE, SMART_EVENT_TRANSPORT_ADDPLAYER, SMART_EVENT_TRANSPORT_RELOCATE, SMART_EVENT_TRANSPORT_REMOVE_PLAYER, SMART_EVENT_UPDATE, SMART_EVENT_UPDATE_IC, SMART_EVENT_UPDATE_OOC, SMART_EVENT_VICTIM_CASTING, SMART_EVENT_WAYPOINT_DATA_ENDED, SMART_EVENT_WAYPOINT_DATA_REACHED, SMART_EVENT_WAYPOINT_ENDED, SMART_EVENT_WAYPOINT_PAUSED, SMART_EVENT_WAYPOINT_REACHED, SMART_EVENT_WAYPOINT_RESUMED, SMART_EVENT_WAYPOINT_START, SMART_EVENT_WAYPOINT_STOPPED, SMART_SCRIPT_RESPAWN_CONDITION_AREA, SMART_SCRIPT_RESPAWN_CONDITION_MAP, SMART_SCRIPT_TYPE_CREATURE, SMART_SCRIPT_TYPE_GAMEOBJECT, SMART_SCRIPT_TYPE_TIMED_ACTIONLIST, SMART_TARGET_AC_END, SMART_TARGET_AC_START, SMART_TARGET_ACTION_INVOKER, SMART_TARGET_CLOSEST_CREATURE, SMART_TARGET_CLOSEST_PLAYER, SMART_TARGET_CREATURE_DISTANCE, SMART_TARGET_CREATURE_GUID, SMART_TARGET_CREATURE_RANGE, SMART_TARGET_LOOT_RECIPIENTS, SMART_TARGET_PLAYER_DISTANCE, SMART_TARGET_PLAYER_RANGE, SMART_TARGET_SELF, SMART_TARGET_TC_END, SMARTAI_TEMPLATE_END, SmartAIEventMask, SmartAITypeMask, sObjectMgr, SmartAction::sound, SmartAction::sound1, SmartAction::sound2, SmartAction::sound3, SmartAction::sound4, SmartAction::speedFraction, SmartAction::speedInteger, SmartEvent::spell, SmartAction::spell, SmartEvent::spellHit, SmartEvent::spellId, sSmartWaypointMgr, sSpellMgr, SmartAction::state, sTaxiPathStore, SmartAction::summonCreature, SmartEvent::summoned, SmartAction::summonGO, SmartAction::swim, SmartAction::talk, SmartScriptHolder::target, SmartEvent::targetCasting, SmartAction::taxi, SmartAction::teleport, TEMPSUMMON_MANUAL_DESPAWN, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, SmartAction::textGroupID, SmartAction::timedActionList, SmartAction::timeEvent, SmartEvent::transportAddCreature, SmartEvent::type, SmartAction::type, SmartTarget::type, SmartAction::updateLevel, SmartAction::updateTemplate, SmartAction::useTalkTarget, SmartEvent::value, SmartAction::visibility, SmartAction::withDelayed, SmartAction::withEmote, SmartAction::withInstant, SmartAction::wps, SmartAction::wpStart, SmartAction::wpStop, SmartTarget::x, and SmartTarget::y.

Referenced by LoadSmartAIFromDB().

◆ IsGameObjectValid()

bool SmartAIMgr::IsGameObjectValid ( SmartScriptHolder const &  e,
uint32  entry 
)
inlineprivate
2153 {
2154 if (!sObjectMgr->GetGameObjectTemplate(entry))
2155 {
2156 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent GameObject entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
2157 return false;
2158 }
2159 return true;
2160 }

References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), LOG_ERROR, and sObjectMgr.

Referenced by IsEventValid(), and IsTargetValid().

◆ IsItemValid()

bool SmartAIMgr::IsItemValid ( SmartScriptHolder const &  e,
uint32  entry 
)
inlineprivate
2173 {
2174 if (!sItemStore.LookupEntry(entry))
2175 {
2176 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Item entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
2177 return false;
2178 }
2179 return true;
2180 }
DBCStorage< ItemEntry > sItemStore(Itemfmt)

References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), LOG_ERROR, and sItemStore.

Referenced by IsEventValid().

◆ IsMinMaxValid()

bool SmartAIMgr::IsMinMaxValid ( SmartScriptHolder const &  e,
uint32  min,
uint32  max 
)
inlineprivate
2103 {
2104 if (max < min)
2105 {
2106 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses min/max params wrong ({}/{}), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), min, max);
2107 return false;
2108 }
2109 return true;
2110 }

References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), and LOG_ERROR.

Referenced by IsEventValid().

◆ IsQuestValid()

bool SmartAIMgr::IsQuestValid ( SmartScriptHolder const &  e,
uint32  entry 
)
inlineprivate
2143 {
2144 if (!sObjectMgr->GetQuestTemplate(entry))
2145 {
2146 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Quest entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
2147 return false;
2148 }
2149 return true;
2150 }

References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), LOG_ERROR, and sObjectMgr.

Referenced by IsEventValid().

◆ IsSoundValid()

bool SmartAIMgr::IsSoundValid ( SmartScriptHolder const &  e,
uint32  entry 
)
inlineprivate
2213 {
2214 if (!sSoundEntriesStore.LookupEntry(entry))
2215 {
2216 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Sound entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
2217 return false;
2218 }
2219 return true;
2220 }
DBCStorage< SoundEntriesEntry > sSoundEntriesStore(SoundEntriesfmt)

References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), LOG_ERROR, and sSoundEntriesStore.

Referenced by IsEventValid().

◆ IsSpellValid()

bool SmartAIMgr::IsSpellValid ( SmartScriptHolder const &  e,
uint32  entry 
)
inlineprivate
2163 {
2164 if (!sSpellMgr->GetSpellInfo(entry))
2165 {
2166 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Spell entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
2167 return false;
2168 }
2169 return true;
2170 }

References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), LOG_ERROR, and sSpellMgr.

Referenced by IsEventValid().

◆ IsTargetValid()

bool SmartAIMgr::IsTargetValid ( SmartScriptHolder const &  e)
private
438{
439 if (e.GetActionType() == SMART_ACTION_INSTALL_AI_TEMPLATE)
440 return true; // AI template has special handling
441 switch (e.GetTargetType())
442 {
445 {
446 if (e.target.unitDistance.creature && !sObjectMgr->GetCreatureTemplate(e.target.unitDistance.creature))
447 {
448 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Creature entry {} as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.unitDistance.creature);
449 return false;
450 }
451 break;
452 }
455 {
456 if (e.target.goDistance.entry && !sObjectMgr->GetGameObjectTemplate(e.target.goDistance.entry))
457 {
458 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent GameObject entry {} as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.target.goDistance.entry);
459 return false;
460 }
461 break;
462 }
464 {
465 if (e.target.unitGUID.entry && !IsCreatureValid(e, e.target.unitGUID.entry))
466 return false;
467 break;
468 }
470 {
471 if (e.target.goGUID.entry && !IsGameObjectValid(e, e.target.goGUID.entry))
472 return false;
473 break;
474 }
477 {
478 if (e.target.playerDistance.dist == 0)
479 {
480 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has maxDist 0 as target_param1, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
481 return false;
482 }
483 break;
484 }
488 if (e.GetScriptType() != SMART_SCRIPT_TYPE_TIMED_ACTIONLIST && e.GetEventType() != SMART_EVENT_LINK && !EventHasInvoker(e.event.type))
489 {
490 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has invoker target, but event does not provide any invoker!", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType());
491 return false;
492 }
493 break;
495 {
496 if (e.target.summonedCreatures.entry && !IsCreatureValid(e, e.target.summonedCreatures.entry))
497 {
498 return false;
499 }
500 break;
501 }
503 {
504 if (e.target.instanceStorage.type != 1 && e.target.instanceStorage.type != 2)
505 {
506 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} has invalid instance storage type as target ({}).",
507 e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType(), e.target.instanceStorage.type);
508 return false;
509 }
510 break;
511 }
516 AC_SAI_IS_BOOLEAN_VALID(e, e.target.hostileRandom.playerOnly);
517 break;
519 AC_SAI_IS_BOOLEAN_VALID(e, e.target.farthest.playerOnly);
520 AC_SAI_IS_BOOLEAN_VALID(e, e.target.farthest.isInLos);
521 break;
523 AC_SAI_IS_BOOLEAN_VALID(e, e.target.unitClosest.dead);
524 break;
526 AC_SAI_IS_BOOLEAN_VALID(e, e.target.closestAttackable.playerOnly);
527 break;
529 AC_SAI_IS_BOOLEAN_VALID(e, e.target.closestFriendly.playerOnly);
530 break;
532 AC_SAI_IS_BOOLEAN_VALID(e, e.target.owner.useCharmerOrOwner);
533 break;
548 break;
549 default:
550 LOG_ERROR("sql.sql", "SmartAIMgr: Not handled target_type({}), Entry {} SourceType {} Event {} Action {}, skipped.", e.GetTargetType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
551 return false;
552 }
553
555 {
556 return false;
557 }
558
559 return true;
560}
@ SMART_TARGET_SUMMONED_CREATURES
Definition: SmartScriptMgr.h:1560
@ SMART_TARGET_ROLE_SELECTION
Definition: SmartScriptMgr.h:1559
@ SMART_TARGET_INSTANCE_STORAGE
Definition: SmartScriptMgr.h:1561
@ SMART_TARGET_RANDOM_POINT
Definition: SmartScriptMgr.h:1558
static bool CheckUnusedTargetParams(SmartScriptHolder const &e)
Definition: SmartScriptMgr.cpp:888

References AC_SAI_IS_BOOLEAN_VALID, CheckUnusedTargetParams(), SmartTarget::closestAttackable, SmartTarget::closestFriendly, SmartTarget::creature, SmartTarget::dead, SmartTarget::dist, SmartTarget::entry, SmartScriptHolder::entryOrGuid, SmartScriptHolder::event, SmartScriptHolder::event_id, EventHasInvoker(), SmartTarget::farthest, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetEventType(), SmartScriptHolder::GetScriptType(), SmartScriptHolder::GetTargetType(), SmartTarget::goDistance, SmartTarget::goGUID, SmartTarget::hostileRandom, SmartTarget::instanceStorage, IsCreatureValid(), IsGameObjectValid(), SmartTarget::isInLos, LOG_ERROR, SmartTarget::owner, SmartTarget::playerDistance, SmartTarget::playerOnly, SMART_ACTION_INSTALL_AI_TEMPLATE, SMART_EVENT_LINK, SMART_EVENT_SUMMONED_UNIT_DIES, SMART_EVENT_SUMMONED_UNIT_EVADE, SMART_SCRIPT_TYPE_TIMED_ACTIONLIST, SMART_TARGET_ACTION_INVOKER, SMART_TARGET_ACTION_INVOKER_VEHICLE, SMART_TARGET_CLOSEST_CREATURE, SMART_TARGET_CLOSEST_ENEMY, SMART_TARGET_CLOSEST_FRIENDLY, SMART_TARGET_CLOSEST_GAMEOBJECT, SMART_TARGET_CLOSEST_PLAYER, SMART_TARGET_CREATURE_DISTANCE, SMART_TARGET_CREATURE_GUID, SMART_TARGET_CREATURE_RANGE, SMART_TARGET_FARTHEST, SMART_TARGET_GAMEOBJECT_DISTANCE, SMART_TARGET_GAMEOBJECT_GUID, SMART_TARGET_GAMEOBJECT_RANGE, SMART_TARGET_HOSTILE_LAST_AGGRO, SMART_TARGET_HOSTILE_RANDOM, SMART_TARGET_HOSTILE_RANDOM_NOT_TOP, SMART_TARGET_HOSTILE_SECOND_AGGRO, SMART_TARGET_INSTANCE_STORAGE, SMART_TARGET_INVOKER_PARTY, SMART_TARGET_LOOT_RECIPIENTS, SMART_TARGET_NONE, SMART_TARGET_OWNER_OR_SUMMONER, SMART_TARGET_PLAYER_DISTANCE, SMART_TARGET_PLAYER_RANGE, SMART_TARGET_PLAYER_WITH_AURA, SMART_TARGET_POSITION, SMART_TARGET_RANDOM_POINT, SMART_TARGET_ROLE_SELECTION, SMART_TARGET_SELF, SMART_TARGET_STORED, SMART_TARGET_SUMMONED_CREATURES, SMART_TARGET_THREAT_LIST, SMART_TARGET_VICTIM, sObjectMgr, SmartTarget::summonedCreatures, SmartScriptHolder::target, SmartEvent::type, SmartTarget::type, SmartTarget::unitClosest, SmartTarget::unitDistance, SmartTarget::unitGUID, and SmartTarget::useCharmerOrOwner.

Referenced by LoadSmartAIFromDB().

◆ IsTextEmoteValid()

bool SmartAIMgr::IsTextEmoteValid ( SmartScriptHolder const &  e,
uint32  entry 
)
inlineprivate
2183 {
2184 if (!sEmotesTextStore.LookupEntry(entry))
2185 {
2186 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} uses non-existent Text Emote entry {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), entry);
2187 return false;
2188 }
2189 return true;
2190 }
DBCStorage< EmotesTextEntry > sEmotesTextStore(EmotesTextEntryfmt)

References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), LOG_ERROR, and sEmotesTextStore.

Referenced by IsEventValid().

◆ IsTextValid()

bool SmartAIMgr::IsTextValid ( SmartScriptHolder const &  e,
uint32  id 
)
staticprivate
2062{
2063 if (e.GetScriptType() != SMART_SCRIPT_TYPE_CREATURE)
2064 return true;
2065
2066 uint32 entry = 0;
2067
2068 if (e.GetEventType() == SMART_EVENT_TEXT_OVER)
2069 {
2070 entry = e.event.textOver.creatureEntry;
2071 }
2072 else
2073 {
2074 switch (e.GetTargetType())
2075 {
2079 return true; // ignore
2080 default:
2081 if (e.entryOrGuid < 0)
2082 {
2083 ObjectGuid::LowType guid = ObjectGuid::LowType(-e.entryOrGuid);
2084 CreatureData const* data = sObjectMgr->GetCreatureData(guid);
2085 if (!data)
2086 {
2087 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} using non-existent Creature guid {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), guid);
2088 return false;
2089 }
2090 else
2091 entry = data->id1;
2092 }
2093 else
2094 entry = uint32(e.entryOrGuid);
2095 break;
2096 }
2097 }
2098
2099 if (!entry || !sCreatureTextMgr->TextExist(entry, uint8(id)))
2100 {
2101 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} using non-existent Text id {}, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), id);
2102 return false;
2103 }
2104
2105 return true;
2106}
std::uint8_t uint8
Definition: Define.h:109
#define sCreatureTextMgr
Definition: CreatureTextMgr.h:118
Definition: CreatureData.h:370
uint32 id1
Definition: CreatureData.h:372
uint32 LowType
Definition: ObjectGuid.h:122

References SmartEvent::creatureEntry, SmartScriptHolder::entryOrGuid, SmartScriptHolder::event, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetEventType(), SmartScriptHolder::GetScriptType(), SmartScriptHolder::GetTargetType(), CreatureData::id1, LOG_ERROR, sCreatureTextMgr, SMART_EVENT_TEXT_OVER, SMART_SCRIPT_TYPE_CREATURE, SMART_TARGET_CLOSEST_CREATURE, SMART_TARGET_CREATURE_DISTANCE, SMART_TARGET_CREATURE_RANGE, sObjectMgr, and SmartEvent::textOver.

Referenced by IsEventValid().

◆ LoadSmartAIFromDB()

void SmartAIMgr::LoadSmartAIFromDB ( )
127{
128 uint32 oldMSTime = getMSTime();
129
130 for (uint8 i = 0; i < SMART_SCRIPT_TYPE_MAX; i++)
131 mEventMap[i].clear(); //Drop Existing SmartAI List
132
134 PreparedQueryResult result = WorldDatabase.Query(stmt);
135
136 if (!result)
137 {
138 LOG_WARN("server.loading", ">> Loaded 0 SmartAI scripts. DB table `smart_scripts` is empty.");
139 LOG_INFO("server.loading", " ");
140 return;
141 }
142
143 uint32 count = 0;
144
145 do
146 {
147 Field* fields = result->Fetch();
148
150
151 temp.entryOrGuid = fields[0].Get<int32>();
152 if (!temp.entryOrGuid)
153 {
154 LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: invalid entryorguid (0), skipped loading.");
155 continue;
156 }
157
158 SmartScriptType source_type = (SmartScriptType)fields[1].Get<uint8>();
159 if (source_type >= SMART_SCRIPT_TYPE_MAX)
160 {
161 LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: invalid source_type ({}), skipped loading.", uint32(source_type));
162 continue;
163 }
164 if (temp.entryOrGuid >= 0)
165 {
166 switch (source_type)
167 {
169 {
170 if (!sObjectMgr->GetCreatureTemplate((uint32)temp.entryOrGuid))
171 {
172 LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Creature entry ({}) does not exist, skipped loading.", uint32(temp.entryOrGuid));
173 continue;
174 }
175 break;
176 }
178 {
179 if (!sObjectMgr->GetGameObjectTemplate((uint32)temp.entryOrGuid))
180 {
181 LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: GameObject entry ({}) does not exist, skipped loading.", uint32(temp.entryOrGuid));
182 continue;
183 }
184 break;
185 }
187 {
188 if (!sObjectMgr->GetAreaTrigger((uint32)temp.entryOrGuid))
189 {
190 LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: AreaTrigger entry ({}) does not exist, skipped loading.", uint32(temp.entryOrGuid));
191 continue;
192 }
193 break;
194 }
196 break;//nothing to check, really
197 default:
198 LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: not yet implemented source_type {}", (uint32)source_type);
199 continue;
200 }
201 }
202 else
203 {
204 if (!sObjectMgr->GetCreatureData(uint32(std::abs(temp.entryOrGuid))))
205 {
206 LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: Creature guid ({}) does not exist, skipped loading.", uint32(std::abs(temp.entryOrGuid)));
207 continue;
208 }
209 }
210
211 temp.source_type = source_type;
212 temp.event_id = fields[2].Get<uint16>();
213 temp.link = fields[3].Get<uint16>();
214 temp.event.type = (SMART_EVENT)fields[4].Get<uint8>();
215 temp.event.event_phase_mask = fields[5].Get<uint16>();
216 temp.event.event_chance = fields[6].Get<uint8>();
217 temp.event.event_flags = fields[7].Get<uint16>();
218
219 temp.event.raw.param1 = fields[8].Get<uint32>();
220 temp.event.raw.param2 = fields[9].Get<uint32>();
221 temp.event.raw.param3 = fields[10].Get<uint32>();
222 temp.event.raw.param4 = fields[11].Get<uint32>();
223 temp.event.raw.param5 = fields[12].Get<uint32>();
224 temp.event.raw.param6 = fields[13].Get<uint32>();
225
226 temp.action.type = (SMART_ACTION)fields[14].Get<uint8>();
227 temp.action.raw.param1 = fields[15].Get<uint32>();
228 temp.action.raw.param2 = fields[16].Get<uint32>();
229 temp.action.raw.param3 = fields[17].Get<uint32>();
230 temp.action.raw.param4 = fields[18].Get<uint32>();
231 temp.action.raw.param5 = fields[19].Get<uint32>();
232 temp.action.raw.param6 = fields[20].Get<uint32>();
233
234 temp.target.type = (SMARTAI_TARGETS)fields[21].Get<uint8>();
235 temp.target.raw.param1 = fields[22].Get<uint32>();
236 temp.target.raw.param2 = fields[23].Get<uint32>();
237 temp.target.raw.param3 = fields[24].Get<uint32>();
238 temp.target.raw.param4 = fields[25].Get<uint32>();
239 temp.target.x = fields[26].Get<float>();
240 temp.target.y = fields[27].Get<float>();
241 temp.target.z = fields[28].Get<float>();
242 temp.target.o = fields[29].Get<float>();
243
244 //check target
245 if (!IsTargetValid(temp))
246 continue;
247
248 // check all event and action params
249 if (!IsEventValid(temp))
250 continue;
251
252 // xinef: specific check for timed events, fix db makers
253 switch (temp.event.type)
254 {
272 if (temp.event.minMaxRepeat.repeatMin == 0 && temp.event.minMaxRepeat.repeatMax == 0)
274 break;
277 if (temp.event.friendlyCC.repeatMin == 0 && temp.event.friendlyCC.repeatMax == 0)
279 break;
280 default:
281 break;
282 }
283
285 if (temp.target.type == SMART_TARGET_SELF && (std::fabs(temp.target.x) > 200.0f || std::fabs(temp.target.y) > 200.0f || std::fabs(temp.target.z) > 200.0f))
287
288 // creature entry / guid not found in storage, create empty event list for it and increase counters
289 if (mEventMap[source_type].find(temp.entryOrGuid) == mEventMap[source_type].end())
290 {
291 ++count;
292 SmartAIEventList eventList;
293 mEventMap[source_type][temp.entryOrGuid] = eventList;
294 }
295 // store the new event
296 mEventMap[source_type][temp.entryOrGuid].push_back(temp);
297 } while (result->NextRow());
298
300
301 LOG_INFO("server.loading", ">> Loaded {} SmartAI scripts in {} ms", count, GetMSTimeDiffToNow(oldMSTime));
302 LOG_INFO("server.loading", " ");
303}
#define LOG_INFO(filterType__,...)
Definition: Log.h:165
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:131
uint32 getMSTime()
Definition: Timer.h:103
std::int32_t int32
Definition: Define.h:103
std::uint16_t uint16
Definition: Define.h:108
SmartScriptType
Definition: SmartScriptMgr.h:1755
@ SMART_SCRIPT_TYPE_MAX
Definition: SmartScriptMgr.h:1766
@ SMART_SCRIPT_TYPE_AREATRIGGER
Definition: SmartScriptMgr.h:1758
@ SMART_EVENT_FLAG_NOT_REPEATABLE
Definition: SmartScriptMgr.h:1914
SMARTAI_TARGETS
Definition: SmartScriptMgr.h:1519
SMART_ACTION
Definition: SmartScriptMgr.h:557
SMART_EVENT
Definition: SmartScriptMgr.h:117
@ WORLD_SEL_SMART_SCRIPTS
Definition: WorldDatabase.h:35
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: DatabaseEnvFwd.h:45
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
Definition: PreparedStatement.h:157
Class used to access individual fields of database query result.
Definition: Field.h:98
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition: Field.h:112
uint32 param1
Definition: SmartScriptMgr.h:530
uint32 param2
Definition: SmartScriptMgr.h:531
uint32 param4
Definition: SmartScriptMgr.h:533
uint32 param3
Definition: SmartScriptMgr.h:532
uint32 param6
Definition: SmartScriptMgr.h:535
uint32 event_chance
Definition: SmartScriptMgr.h:227
uint32 param5
Definition: SmartScriptMgr.h:534
uint32 param3
Definition: SmartScriptMgr.h:1073
uint32 param5
Definition: SmartScriptMgr.h:1075
uint32 param1
Definition: SmartScriptMgr.h:1071
uint32 param4
Definition: SmartScriptMgr.h:1074
uint32 param6
Definition: SmartScriptMgr.h:1502
uint32 param2
Definition: SmartScriptMgr.h:1072
uint32 param4
Definition: SmartScriptMgr.h:1731
float o
Definition: SmartScriptMgr.h:1581
uint32 param1
Definition: SmartScriptMgr.h:1728
uint32 param3
Definition: SmartScriptMgr.h:1730
float z
Definition: SmartScriptMgr.h:1581
uint32 param2
Definition: SmartScriptMgr.h:1729
Definition: SmartScriptMgr.h:1957
SmartScriptType source_type
Definition: SmartScriptMgr.h:1963
bool IsTargetValid(SmartScriptHolder const &e)
Definition: SmartScriptMgr.cpp:437
bool IsEventValid(SmartScriptHolder &e)
Definition: SmartScriptMgr.cpp:952
void CheckIfSmartAIInDatabaseExists()
Definition: SmartScriptMgr.cpp:305

References SmartScriptHolder::action, CheckIfSmartAIInDatabaseExists(), SmartScriptHolder::entryOrGuid, SmartScriptHolder::event, SmartEvent::event_chance, SmartEvent::event_flags, SmartScriptHolder::event_id, SmartEvent::event_phase_mask, SmartEvent::friendlyCC, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), IsEventValid(), IsTargetValid(), SmartScriptHolder::link, LOG_ERROR, LOG_INFO, LOG_WARN, mEventMap, SmartEvent::minMaxRepeat, SmartTarget::o, SmartEvent::param1, SmartAction::param1, SmartTarget::param1, SmartEvent::param2, SmartAction::param2, SmartTarget::param2, SmartEvent::param3, SmartAction::param3, SmartTarget::param3, SmartEvent::param4, SmartAction::param4, SmartTarget::param4, SmartEvent::param5, SmartAction::param5, SmartEvent::param6, SmartAction::param6, SmartEvent::raw, SmartAction::raw, SmartTarget::raw, SmartEvent::repeatMax, SmartEvent::repeatMin, SMART_ACTION_MOVE_TO_POS, SMART_EVENT_AREA_CASTING, SMART_EVENT_AREA_RANGE, SMART_EVENT_FLAG_NOT_REPEATABLE, SMART_EVENT_FRIENDLY_HEALTH, SMART_EVENT_FRIENDLY_HEALTH_PCT, SMART_EVENT_FRIENDLY_IS_CC, SMART_EVENT_FRIENDLY_MISSING_BUFF, SMART_EVENT_HAS_AURA, SMART_EVENT_HEALTH_PCT, SMART_EVENT_IS_BEHIND_TARGET, SMART_EVENT_IS_IN_MELEE_RANGE, SMART_EVENT_MANA_PCT, SMART_EVENT_RANGE, SMART_EVENT_TARGET_BUFFED, SMART_EVENT_TARGET_HEALTH_PCT, SMART_EVENT_TARGET_MANA_PCT, SMART_EVENT_UPDATE, SMART_EVENT_UPDATE_IC, SMART_EVENT_UPDATE_OOC, SMART_EVENT_VICTIM_CASTING, SMART_SCRIPT_TYPE_AREATRIGGER, SMART_SCRIPT_TYPE_CREATURE, SMART_SCRIPT_TYPE_GAMEOBJECT, SMART_SCRIPT_TYPE_MAX, SMART_SCRIPT_TYPE_TIMED_ACTIONLIST, SMART_TARGET_POSITION, SMART_TARGET_SELF, sObjectMgr, SmartScriptHolder::source_type, SmartScriptHolder::target, SmartEvent::type, SmartAction::type, SmartTarget::type, WORLD_SEL_SMART_SCRIPTS, WorldDatabase, SmartTarget::x, SmartTarget::y, and SmartTarget::z.

◆ NotNULL()

bool SmartAIMgr::NotNULL ( SmartScriptHolder const &  e,
uint32  data 
)
inlineprivate
2123 {
2124 if (!data)
2125 {
2126 LOG_ERROR("sql.sql", "SmartAIMgr: Entry {} SourceType {} Event {} Action {} Parameter can not be nullptr, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
2127 return false;
2128 }
2129 return true;
2130 }

References SmartScriptHolder::entryOrGuid, SmartScriptHolder::event_id, SmartScriptHolder::GetActionType(), SmartScriptHolder::GetScriptType(), and LOG_ERROR.

Referenced by IsEventValid().

Member Data Documentation

◆ mEventMap