diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index a8f2b56936c..4313a655eb5 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1028,6 +1028,9 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry, SpellEffectEntry const** effe ChainEntry = NULL; ExplicitTargetMask = 0; + + _spellSpecific = SPELL_SPECIFIC_NORMAL; + _auraState = AURA_STATE_NONE; } SpellInfo::~SpellInfo() diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h index 9f8859fa97d..270d1c2f457 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -560,11 +560,17 @@ public: bool _IsPositiveEffect(uint8 effIndex, bool deep) const; bool _IsPositiveSpell() const; static bool _IsPositiveTarget(uint32 targetA, uint32 targetB); + void _LoadSpellSpecific(); + void _LoadAuraState(); void _LoadImmunityInfo(); // unloading helpers void _UnloadImplicitTargetConditionLists(); +private: + SpellSpecificType _spellSpecific; + AuraStateType _auraState; + ImmunityInfo _immunityInfo[MAX_SPELL_EFFECTS]; }; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 7b7f41466cb..e5e68e51bc9 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3821,6 +3821,23 @@ void SpellMgr::LoadSpellInfoCorrections() TC_LOG_INFO("server.loading", ">> Loaded SpellInfo corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } +void SpellMgr::LoadSpellInfoSpellSpecificAndAuraState() +{ + uint32 oldMSTime = getMSTime(); + + for (SpellInfo* spellInfo : mSpellInfoMap) + { + if (!spellInfo) + continue; + + // AuraState depends on SpellSpecific + spellInfo->_LoadSpellSpecific(); + spellInfo->_LoadAuraState(); + } + + TC_LOG_INFO("server.loading", ">> Loaded SpellInfo SpellSpecific and AuraState in %u ms", GetMSTimeDiffToNow(oldMSTime)); +} + void SpellMgr::LoadSpellInfoImmunities() { uint32 oldMSTime = getMSTime(); diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index f00300628cd..9945b1da2ff 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -684,6 +684,7 @@ class TC_GAME_API SpellMgr void UnloadSpellInfoImplicitTargetConditionLists(); void LoadSpellInfoCustomAttributes(); void LoadSpellInfoCorrections(); + void LoadSpellInfoSpellSpecificAndAuraState(); void LoadSpellInfoImmunities(); private: diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index cf5a07bf955..e7c2c20ceec 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1506,6 +1506,9 @@ void World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading SpellInfo custom attributes..."); sSpellMgr->LoadSpellInfoCustomAttributes(); + TC_LOG_INFO("server.loading", "Loading SpellInfo SpellSpecific and AuraState..."); + sSpellMgr->LoadSpellInfoSpellSpecificAndAuraState(); + TC_LOG_INFO("server.loading", "Loading SpellInfo immunity infos..."); sSpellMgr->LoadSpellInfoImmunities();