diff options
Diffstat (limited to 'src/server/game/Globals')
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 37 | ||||
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.h | 5 |
2 files changed, 2 insertions, 40 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index b738e885f3b..01555141b3c 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -57,7 +57,6 @@ #include "Vehicle.h" #include "World.h" -ScriptMapMap sSpellScripts; ScriptMapMap sEventScripts; ScriptMapMap sWaypointScripts; @@ -66,7 +65,6 @@ std::string GetScriptsTableNameByType(ScriptsType type) std::string res = ""; switch (type) { - case SCRIPTS_SPELL: res = "spell_scripts"; break; case SCRIPTS_EVENT: res = "event_scripts"; break; case SCRIPTS_WAYPOINT: res = "waypoint_scripts"; break; default: break; @@ -79,7 +77,6 @@ ScriptMapMap* GetScriptsMapByType(ScriptsType type) ScriptMapMap* res = nullptr; switch (type) { - case SCRIPTS_SPELL: res = &sSpellScripts; break; case SCRIPTS_EVENT: res = &sEventScripts; break; case SCRIPTS_WAYPOINT: res = &sWaypointScripts; break; default: break; @@ -5444,9 +5441,8 @@ void ObjectMgr::LoadScripts(ScriptsType type) scripts->clear(); // need for reload support - bool isSpellScriptTable = (type == SCRIPTS_SPELL); // 0 1 2 3 4 5 6 7 8 9 - QueryResult result = WorldDatabase.PQuery("SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o{} FROM {}", isSpellScriptTable ? ", effIndex" : "", tableName); + QueryResult result = WorldDatabase.PQuery("SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o FROM {}", tableName); if (!result) { @@ -5462,8 +5458,6 @@ void ObjectMgr::LoadScripts(ScriptsType type) ScriptInfo tmp; tmp.type = type; tmp.id = fields[0].GetUInt32(); - if (isSpellScriptTable) - tmp.id |= fields[10].GetUInt8() << 24; tmp.delay = fields[1].GetUInt32(); tmp.command = ScriptCommands(fields[2].GetUInt32()); tmp.Raw.nData[0] = fields[3].GetUInt32(); @@ -5738,35 +5732,6 @@ void ObjectMgr::LoadScripts(ScriptsType type) TC_LOG_INFO("server.loading", ">> Loaded {} script definitions in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); } -void ObjectMgr::LoadSpellScripts() -{ - LoadScripts(SCRIPTS_SPELL); - - // check ids - for (ScriptMapMap::const_iterator itr = sSpellScripts.begin(); itr != sSpellScripts.end(); ++itr) - { - uint32 spellId = uint32(itr->first) & 0x00FFFFFF; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); - - if (!spellInfo) - { - TC_LOG_ERROR("sql.sql", "Table `spell_scripts` has not existing spell (Id: {}) as script id", spellId); - continue; - } - - SpellEffIndex i = SpellEffIndex((uint32(itr->first) >> 24) & 0x000000FF); - if (uint32(i) >= MAX_SPELL_EFFECTS) - { - TC_LOG_ERROR("sql.sql", "Table `spell_scripts` has too high effect index {} for spell (Id: {}) as script id", uint32(i), spellId); - continue; - } - - //check for correct spellEffect - if (!spellInfo->GetEffect(i).Effect || (spellInfo->GetEffect(i).Effect != SPELL_EFFECT_SCRIPT_EFFECT && spellInfo->GetEffect(i).Effect != SPELL_EFFECT_DUMMY)) - TC_LOG_ERROR("sql.sql", "Table `spell_scripts` - spell {} effect {} is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY", spellId, uint32(i)); - } -} - void ObjectMgr::LoadEventScripts() { LoadScripts(SCRIPTS_EVENT); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 162feb35b3e..aada65ed912 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -173,8 +173,7 @@ enum ScriptsType { SCRIPTS_FIRST = 1, - SCRIPTS_SPELL = SCRIPTS_FIRST, - SCRIPTS_EVENT, + SCRIPTS_EVENT = SCRIPTS_FIRST, SCRIPTS_WAYPOINT, SCRIPTS_LAST @@ -412,7 +411,6 @@ typedef std::multimap<uint32, ScriptInfo> ScriptMap; typedef std::map<uint32, ScriptMap> ScriptMapMap; typedef std::multimap<uint32 /*spell id*/, std::pair<uint32 /*script id*/, bool /*enabled*/>> SpellScriptsContainer; typedef std::pair<SpellScriptsContainer::iterator, SpellScriptsContainer::iterator> SpellScriptsBounds; -TC_GAME_API extern ScriptMapMap sSpellScripts; TC_GAME_API extern ScriptMapMap sEventScripts; TC_GAME_API extern ScriptMapMap sWaypointScripts; @@ -1138,7 +1136,6 @@ class TC_GAME_API ObjectMgr bool LoadTrinityStrings(); void LoadEventScripts(); - void LoadSpellScripts(); void LoadWaypointScripts(); void LoadSpellScriptNames(); |
