30 for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr)
31 delete pathItr->second;
43 SF_LOG_INFO(
"server.loading",
">> Loaded 0 SmartAI Waypoint Paths. DB table `waypoints` is empty.");
55 Field* fields = result->Fetch();
63 if (last_entry != entry)
71 SF_LOG_ERROR(
"sql.sql",
"SmartWaypointMgr::LoadFromDB: Path entry %u, unexpected point id %u, expected %u.", entry,
id, last_id);
78 }
while (result->NextRow());
80 SF_LOG_INFO(
"server.loading",
">> Loaded %u SmartAI waypoint paths (total %u waypoints) in %u ms", count, total,
GetMSTimeDiffToNow(oldMSTime));
87 for (WPPath::iterator pathItr = itr->second->begin(); pathItr != itr->second->end(); ++pathItr)
88 delete pathItr->second;
108 SF_LOG_INFO(
"server.loading",
">> Loaded 0 SmartAI scripts. DB table `smartai_scripts` is empty.");
117 Field* fields = result->Fetch();
125 SF_LOG_ERROR(
"sql.sql",
"SmartAIMgr::LoadSmartAIFromDB: invalid source_type (%u), skipped loading.",
uint32(source_type));
162 SF_LOG_ERROR(
"sql.sql",
"SmartAIMgr::LoadSmartAIFromDB: not yet implemented source_type %u", (
uint32)source_type);
170 SF_LOG_ERROR(
"sql.sql",
"SmartAIMgr::LoadSmartAIFromDB: Creature guid (%u) does not exist, skipped loading.",
uint32(abs(temp.
entryOrGuid)));
223 }
while (result->NextRow());
785 for (CacheSpellContainer::const_iterator itr = sBounds.first; itr != sBounds.second; ++itr)
786 SF_LOG_ERROR(
"sql.sql",
"SmartAIMgr: Entry %d SourceType %u Event %u Action %u creature summon: There is a summon spell for creature entry %u (SpellId: %u, effect: %u)",
802 for (CacheSpellContainer::const_iterator itr = sBounds.first; itr != sBounds.second; ++itr)
803 SF_LOG_ERROR(
"sql.sql",
"SmartAIMgr: Entry %d SourceType %u Event %u Action %u Kill Credit: There is a killcredit spell for creatureEntry %u (SpellId: %u effect: %u)",
839 for (CacheSpellContainer::const_iterator itr = sBounds.first; itr != sBounds.second; ++itr)
840 SF_LOG_ERROR(
"sql.sql",
"SmartAIMgr: Entry %d SourceType %u Event %u Action %u gameobject summon: There is a summon spell for gameobject entry %u (SpellId: %u, effect: %u)",
909 if (eventId < 1 || eventId >= events.size())
928 if (eventId < 1 || eventId >= events.size())
DBCStorage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore(CreatureDisplayInfofmt)
DBCStorage< AreaTriggerEntry > sAreaTriggerStore(AreaTriggerEntryfmt)
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
DBCStorage< TaxiPathEntry > sTaxiPathStore(TaxiPathEntryfmt)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
AreaTableEntry const * GetAreaEntryByAreaID(uint32 area_id)
#define MAX_SPELL_EFFECTS
#define SF_LOG_ERROR(filterType__,...)
#define SF_LOG_INFO(filterType__,...)
@ TEMPSUMMON_MANUAL_DESPAWN
@ TEMPSUMMON_TIMED_OR_DEAD_DESPAWN
Skyfire::AutoPtr< PreparedResultSet, Skyfire::Mutex > PreparedQueryResult
@ QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT
@ SPELL_EFFECT_KILL_CREDIT
@ SPELL_EFFECT_KILL_CREDIT2
@ SPELL_EFFECT_SUMMON_OBJECT_WILD
@ SMART_SCRIPT_TYPE_TIMED_ACTIONLIST
@ SMART_SCRIPT_TYPE_CREATURE
@ SMART_SCRIPT_TYPE_GAMEOBJECT
@ SMART_SCRIPT_TYPE_AREATRIGGER
std::vector< SmartScriptHolder > SmartAIEventList
@ SMART_TARGET_CLOSEST_CREATURE
@ SMART_TARGET_CREATURE_DISTANCE
@ SMART_TARGET_HOSTILE_RANDOM_NOT_TOP
@ SMART_TARGET_INVOKER_PARTY
@ SMART_TARGET_CLOSEST_FRIENDLY
@ SMART_TARGET_CLOSEST_GAMEOBJECT
@ SMART_TARGET_GAMEOBJECT_RANGE
@ SMART_TARGET_CREATURE_GUID
@ SMART_TARGET_PLAYER_RANGE
@ SMART_TARGET_GAMEOBJECT_DISTANCE
@ SMART_TARGET_CREATURE_RANGE
@ SMART_TARGET_CLOSEST_PLAYER
@ SMART_TARGET_HOSTILE_RANDOM
@ SMART_TARGET_GAMEOBJECT_GUID
@ SMART_TARGET_HOSTILE_SECOND_AGGRO
@ SMART_TARGET_OWNER_OR_SUMMONER
@ SMART_TARGET_ACTION_INVOKER
@ SMART_TARGET_HOSTILE_LAST_AGGRO
@ SMART_TARGET_ACTION_INVOKER_VEHICLE
@ SMART_TARGET_THREAT_LIST
@ SMART_TARGET_CLOSEST_ENEMY
@ SMART_TARGET_PLAYER_DISTANCE
#define sSmartWaypointMgr
const uint32 SmartAIEventMask[SMART_EVENT_END][2]
@ SMART_SCRIPT_RESPAWN_CONDITION_AREA
@ SMART_SCRIPT_RESPAWN_CONDITION_MAP
UNORDERED_MAP< uint32, WayPoint * > WPPath
@ SMART_ACTION_REMOVE_TIMED_EVENT
@ SMART_ACTION_SET_GO_FLAG
@ SMART_ACTION_UPDATE_TEMPLATE
@ SMART_ACTION_STORE_TARGET_LIST
@ SMART_ACTION_SET_HEALTH_REGEN
@ SMART_ACTION_ACTIVATE_GOBJECT
@ SMART_ACTION_FORCE_DESPAWN
@ SMART_ACTION_GAME_EVENT_START
@ SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST
@ SMART_ACTION_SET_INST_DATA64
@ SMART_ACTION_SET_FACTION
@ SMART_ACTION_THREAT_SINGLE_PCT
@ SMART_ACTION_SET_INGAME_PHASE_MASK
@ SMART_ACTION_CLOSE_GOSSIP
@ SMART_ACTION_ADD_GO_FLAG
@ SMART_ACTION_ADD_DYNAMIC_FLAG
@ SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS
@ SMART_ACTION_ATTACK_START
@ SMART_ACTION_SET_UNIT_FLAG
@ SMART_ACTION_CALL_GROUPEVENTHAPPENS
@ SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL
@ SMART_ACTION_INVOKER_CAST
@ SMART_ACTION_JUMP_TO_POS
@ SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST
@ SMART_ACTION_SEND_GOSSIP_MENU
@ SMART_ACTION_FLEE_FOR_ASSIST
@ SMART_ACTION_SIMPLE_TALK
@ SMART_ACTION_ALLOW_COMBAT_MOVEMENT
@ SMART_ACTION_THREAT_ALL_PCT
@ SMART_ACTION_STORE_VARIABLE_DECIMAL
@ SMART_ACTION_SET_HEALTH
@ SMART_ACTION_RESPAWN_TARGET
@ SMART_ACTION_ADD_NPC_FLAG
@ SMART_ACTION_FAIL_QUEST
@ SMART_ACTION_INTERRUPT_SPELL
@ SMART_ACTION_REMOVE_DYNAMIC_FLAG
@ SMART_ACTION_RANDOM_SOUND
@ SMART_ACTION_MOVE_FORWARD
@ SMART_ACTION_SEND_TARGET_TO_TARGET
@ SMART_ACTION_REMOVE_POWER
@ SMART_ACTION_SET_DYNAMIC_FLAG
@ SMART_ACTION_REMOVE_ITEM
@ SMART_ACTION_SEND_GO_CUSTOM_ANIM
@ SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL
@ SMART_ACTION_REMOVE_UNIT_FLAG
@ SMART_ACTION_RANDOM_PHASE
@ SMART_ACTION_SET_EMOTE_STATE
@ SMART_ACTION_CROSS_CAST
@ SMART_ACTION_GAME_EVENT_STOP
@ SMART_ACTION_CALL_KILLEDMONSTER
@ SMART_ACTION_CALL_SCRIPT_RESET
@ SMART_ACTION_COMBAT_STOP
@ SMART_ACTION_AUTO_ATTACK
@ SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL
@ SMART_ACTION_SET_VISIBILITY
@ SMART_ACTION_RANDOM_PHASE_RANGE
@ SMART_ACTION_GO_SET_LOOT_STATE
@ SMART_ACTION_SET_INST_DATA
@ SMART_ACTION_REMOVE_GO_FLAG
@ SMART_ACTION_CALL_FOR_HELP
@ SMART_ACTION_PLAY_EMOTE
@ SMART_ACTION_SET_EVENT_PHASE
@ SMART_ACTION_SET_SHEATH
@ SMART_ACTION_SET_ORIENTATION
@ SMART_ACTION_SET_NPC_FLAG
@ SMART_ACTION_REMOVE_UNIT_FIELD_ANIM_TIER
@ SMART_ACTION_MOVE_TO_POS
@ SMART_ACTION_RANDOM_EMOTE
@ SMART_ACTION_INC_EVENT_PHASE
@ SMART_ACTION_CREATE_TIMED_EVENT
@ SMART_ACTION_RESET_SCRIPT_BASE_OBJECT
@ SMART_ACTION_REMOVE_NPC_FLAG
@ SMART_ACTION_INSTALL_AI_TEMPLATE
@ SMART_ACTION_SUMMON_CREATURE
@ SMART_ACTION_RESET_GOBJECT
@ SMART_ACTION_CALL_TIMED_ACTIONLIST
@ SMART_ACTION_SET_IN_COMBAT_WITH_ZONE
@ SMART_ACTION_SET_UNIT_FIELD_ANIM_TIER
@ SMART_ACTION_SET_HOME_POS
@ SMART_ACTION_SET_ACTIVE
@ SMART_ACTION_SET_RANGED_MOVEMENT
@ SMART_ACTION_ACTIVATE_TAXI
@ SMART_ACTION_SUMMON_CREATURE_GROUP
@ SMART_ACTION_SET_REACT_STATE
@ SMART_ACTION_RANDOM_MOVE
@ SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT
@ SMART_ACTION_TRIGGER_TIMED_EVENT
@ SMART_ACTION_REMOVEAURASFROMSPELL
@ SMART_EVENT_ACTION_DONE
@ SMART_EVENT_SUMMON_DESPAWNED
@ SMART_EVENT_RECEIVE_EMOTE
@ SMART_EVENT_FRIENDLY_HEALTH_PCT
@ SMART_EVENT_RECEIVE_HEAL
@ SMART_EVENT_DUMMY_EFFECT
@ SMART_EVENT_TIMED_EVENT_TRIGGERED
@ SMART_EVENT_CHARMED_TARGET
@ SMART_EVENT_TARGET_MANA_PCT
@ SMART_EVENT_QUEST_COMPLETION
@ SMART_EVENT_JUST_CREATED
@ SMART_EVENT_AREATRIGGER_ONTRIGGER
@ SMART_EVENT_ON_SPELLCLICK
@ SMART_EVENT_MOVEMENTINFORM
@ SMART_EVENT_PASSENGER_REMOVED
@ SMART_EVENT_INSTANCE_PLAYER_ENTER
@ SMART_EVENT_WAYPOINT_PAUSED
@ SMART_EVENT_REACHED_HOME
@ SMART_EVENT_TRANSPORT_ADDCREATURE
@ SMART_EVENT_REWARD_QUEST
@ SMART_EVENT_GO_EVENT_INFORM
@ SMART_EVENT_JUST_SUMMONED
@ SMART_EVENT_WAYPOINT_START
@ SMART_EVENT_SPELLHIT_TARGET
@ SMART_EVENT_GAME_EVENT_START
@ SMART_EVENT_TRANSPORT_REMOVE_PLAYER
@ SMART_EVENT_GOSSIP_HELLO
@ SMART_EVENT_GOSSIP_SELECT
@ SMART_EVENT_CORPSE_REMOVED
@ SMART_EVENT_QUEST_OBJ_COPLETETION
@ SMART_EVENT_PASSENGER_BOARDED
@ SMART_EVENT_TRANSPORT_ADDPLAYER
@ SMART_EVENT_WAYPOINT_ENDED
@ SMART_EVENT_IS_BEHIND_TARGET
@ SMART_EVENT_ACCEPTED_QUEST
@ SMART_EVENT_FRIENDLY_MISSING_BUFF
@ SMART_EVENT_WAYPOINT_RESUMED
@ SMART_EVENT_WAYPOINT_REACHED
@ SMART_EVENT_TARGET_BUFFED
@ SMART_EVENT_QUEST_ACCEPTED
@ SMART_EVENT_FRIENDLY_HEALTH
@ SMART_EVENT_QUEST_REWARDED
@ SMART_EVENT_TRANSPORT_RELOCATE
@ SMART_EVENT_GAME_EVENT_END
@ SMART_EVENT_FOLLOW_COMPLETED
@ SMART_EVENT_WAYPOINT_STOPPED
@ SMART_EVENT_FRIENDLY_IS_CC
@ SMART_EVENT_GO_STATE_CHANGED
@ SMART_EVENT_TARGET_HEALTH_PCT
@ SMART_EVENT_VICTIM_CASTING
@ SMART_EVENT_DAMAGED_TARGET
@ SMART_EVENT_SUMMONED_UNIT
const uint32 SmartAITypeMask[SMART_SCRIPT_TYPE_MAX][2]
std::pair< CacheSpellContainer::const_iterator, CacheSpellContainer::const_iterator > CacheSpellContainerBounds
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
@ WORLD_SEL_SMART_SCRIPTS
std::vector< GameEventData > GameEventDataMap
SmartAIEventMap mEventMap[SMART_SCRIPT_TYPE_MAX]
CacheSpellContainer SummonCreatureSpellStore
void UnLoadHelperStores()
CacheSpellContainerBounds GetSummonCreatureSpellContainerBounds(uint32 creatureEntry) const
bool IsTextEmoteValid(SmartScriptHolder const &e, uint32 entry)
bool IsTargetValid(SmartScriptHolder const &e)
bool NotNULL(SmartScriptHolder const &e, uint32 data)
bool IsSoundValid(SmartScriptHolder const &e, uint32 entry)
bool IsEventValid(SmartScriptHolder &e)
bool IsGameObjectValid(SmartScriptHolder const &e, uint32 entry)
bool IsMinMaxValid(SmartScriptHolder const &e, uint32 min, uint32 max)
CacheSpellContainer SummonGameObjectSpellStore
bool IsQuestValid(SmartScriptHolder const &e, uint32 entry)
bool IsCreatureValid(SmartScriptHolder const &e, uint32 entry)
bool IsAreaTriggerValid(SmartScriptHolder const &e, uint32 entry)
CacheSpellContainerBounds GetSummonGameObjectSpellContainerBounds(uint32 gameObjectEntry) const
CacheSpellContainerBounds GetKillCreditSpellContainerBounds(uint32 killCredit) const
bool IsItemValid(SmartScriptHolder const &e, uint32 entry)
CacheSpellContainer KillCreditSpellStore
bool IsEmoteValid(SmartScriptHolder const &e, uint32 entry)
bool IsSpellValid(SmartScriptHolder const &e, uint32 entry)
UNORDERED_MAP< uint32, WPPath * > waypoint_map
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
WorldDatabaseWorkerPool WorldDatabase
Accessor to the world database.
struct SmartAction::@137136306204214247065175315134144360247331017331::@063217247236027134221310037325112126070263107200 installTtemplate
struct SmartAction::@137136306204214247065175315134144360247331017331::@223221030233146165101047364315320356273243300160 killedMonster
struct SmartAction::@137136306204214247065175315134144360247331017331::@056037146104051216040022366365070022176220102015 setEventPhase
struct SmartAction::@137136306204214247065175315134144360247331017331::@225326137357300251213255332357005062365342332334 taxi
struct SmartAction::@137136306204214247065175315134144360247331017331::@263337113206264100344005071314123271031160215224 incEventPhase
struct SmartAction::@137136306204214247065175315134144360247331017331::@323250253076201247247032355216135323066263226166 summonGO
struct SmartAction::@137136306204214247065175315134144360247331017331::@260014043352000167110056244356272120365357113047 power
struct SmartAction::@137136306204214247065175315134144360247331017331::@105154066270000205250254221004375132270204111257 faction
struct SmartAction::@137136306204214247065175315134144360247331017331::@275255223343355134011263135140247005064156134156 removeAura
struct SmartAction::@137136306204214247065175315134144360247331017331::@340117101002077274057262132157002056007011042371 item
struct SmartAction::@137136306204214247065175315134144360247331017331::@321334216220214152324067135252322006365237051372 summonCreature
struct SmartAction::@137136306204214247065175315134144360247331017331::@271373373116125344236343321340152150140162062203 updateTemplate
struct SmartAction::@137136306204214247065175315134144360247331017331::@275214002000035051002312305231375170105074073031 react
struct SmartAction::@137136306204214247065175315134144360247331017331::@030016163313022245256210315150151222345056203275 randomPhaseRange
struct SmartAction::@137136306204214247065175315134144360247331017331::@364140021337216071013031072126362152213217361022 gameEventStart
struct SmartAction::@137136306204214247065175315134144360247331017331::@366346013116331267251301000101176066154005153314 wpStart
struct SmartAction::@137136306204214247065175315134144360247331017331::@154353352031206117237307025011150000165343160075 gameEventStop
struct SmartAction::@137136306204214247065175315134144360247331017331::@017204072246217361054270126345157054047267131155 timeEvent
struct SmartAction::@137136306204214247065175315134144360247331017331::@070027157377176027211043175361120005242332321041 cast
struct SmartAction::@137136306204214247065175315134144360247331017331::@361253355005363233353246257362125371204257066324 wpStop
struct SmartAction::@137136306204214247065175315134144360247331017331::@034027334375127044264311057312165257123120035111 setSheath
struct SmartAction::@137136306204214247065175315134144360247331017331::@047257325033252011304017203222214205224131346024 randomEmote
struct SmartAction::@137136306204214247065175315134144360247331017331::@146067006045202033167137301332374134247215001225 morphOrMount
struct SmartAction::@137136306204214247065175315134144360247331017331::@124325320104077343177176052310130023304351310216 randomSound
struct SmartAction::@137136306204214247065175315134144360247331017331::@017345322206322315133100210307152010072305326222 teleport
struct SmartAction::@137136306204214247065175315134144360247331017331::@110372216333363233013275026147121341347021271102 raw
struct SmartAction::@137136306204214247065175315134144360247331017331::@216226275100333317146042116304160061113317344104 randomPhase
struct SmartEvent::@166073203170024010224000246043245045265275236352::@205334221103210356102216306336035204273105217373 doAction
struct SmartEvent::@166073203170024010224000246043245045265275236352::@035124263137161112271324316211040076034364300254 friendlyHealthPct
struct SmartEvent::@166073203170024010224000246043245045265275236352::@151214011253067366266013227241263175352330107015 spellHit
struct SmartEvent::@166073203170024010224000246043245045265275236352::@153240210013057316073206114055356342200322004153 areatrigger
struct SmartEvent::@166073203170024010224000246043245045265275236352::@331123367372304044150027144120234260063243315361 raw
struct SmartEvent::@166073203170024010224000246043245045265275236352::@071217147231100355344130024153246046254076175303 minMax
struct SmartEvent::@166073203170024010224000246043245045265275236352::@014244365015242120343050241027342311345320231372 kill
struct SmartEvent::@166073203170024010224000246043245045265275236352::@221026305077317174075143035236341220146202106111 summoned
struct SmartEvent::@166073203170024010224000246043245045265275236352::@202207111237273327363141057053252156066031227127 targetCasting
struct SmartEvent::@166073203170024010224000246043245045265275236352::@143336307355047137005241062216153351167151345337 transportAddCreature
struct SmartEvent::@166073203170024010224000246043245045265275236352::@374352063271056252122325060177325011004327327320 dummy
struct SmartEvent::@166073203170024010224000246043245045265275236352::@317215266053337235107156201003013251003136307007 dataSet
struct SmartEvent::@166073203170024010224000246043245045265275236352::@316052106375244313267206021344134155050363137163 gameEvent
struct SmartEvent::@166073203170024010224000246043245045265275236352::@231361362314252335147144320331135255146044361230 friendlyHealth
struct SmartEvent::@166073203170024010224000246043245045265275236352::@176246375035351301250241104017222341335356255101 minMaxRepeat
struct SmartEvent::@166073203170024010224000246043245045265275236352::@215225270007231027007174002122072040103111365225 aura
struct SmartEvent::@166073203170024010224000246043245045265275236352::@153222357016331217240244030161351100040203125306 missingBuff
struct SmartEvent::@166073203170024010224000246043245045265275236352::@133146201062172166200111053367224171220224362315 movementInform
struct SmartEvent::@166073203170024010224000246043245045265275236352::@010250233120134241015123153125242336170064340121 friendlyCC
struct SmartEvent::@166073203170024010224000246043245045265275236352::@140352011036232354166330333342335043070367211016 respawn
struct SmartEvent::@166073203170024010224000246043245045265275236352::@206071060360274252071246267136154353111152272204 los
struct SmartEvent::@166073203170024010224000246043245045265275236352::@201273004001225050106107035207231367176035206120 behindTarget
uint32 GetScriptType() const
uint32 GetEventType() const
uint32 GetTargetType() const
SmartScriptType source_type
uint32 GetActionType() const
struct SmartTarget::@333075361354170120173166243340237372226003166270::@331304071055133014342035021265106076261007323121 raw
struct SmartTarget::@333075361354170120173166243340237372226003166270::@252242265355222362137233075236171264264255250353 goDistance
struct SmartTarget::@333075361354170120173166243340237372226003166270::@002214221374016261141032233225077144161065220344 unitGUID
struct SmartTarget::@333075361354170120173166243340237372226003166270::@172360030245270120053010162234377345135043301307 unitDistance
struct SmartTarget::@333075361354170120173166243340237372226003166270::@262226145054070224013345240063324147141336277263 playerDistance
struct SmartTarget::@333075361354170120173166243340237372226003166270::@163054074026206351133353217237356273245266110331 goGUID