5757#include " Vehicle.h"
5858#include " World.h"
5959
60- ScriptMapMap sSpellScripts ;
6160ScriptMapMap sEventScripts ;
6261ScriptMapMap sWaypointScripts ;
6362
@@ -66,7 +65,6 @@ std::string GetScriptsTableNameByType(ScriptsType type)
6665 std::string res = " " ;
6766 switch (type)
6867 {
69- case SCRIPTS_SPELL: res = " spell_scripts" ; break ;
7068 case SCRIPTS_EVENT: res = " event_scripts" ; break ;
7169 case SCRIPTS_WAYPOINT: res = " waypoint_scripts" ; break ;
7270 default : break ;
@@ -79,7 +77,6 @@ ScriptMapMap* GetScriptsMapByType(ScriptsType type)
7977 ScriptMapMap* res = nullptr ;
8078 switch (type)
8179 {
82- case SCRIPTS_SPELL: res = &sSpellScripts ; break ;
8380 case SCRIPTS_EVENT: res = &sEventScripts ; break ;
8481 case SCRIPTS_WAYPOINT: res = &sWaypointScripts ; break ;
8582 default : break ;
@@ -5444,9 +5441,8 @@ void ObjectMgr::LoadScripts(ScriptsType type)
54445441
54455442 scripts->clear (); // need for reload support
54465443
5447- bool isSpellScriptTable = (type == SCRIPTS_SPELL);
54485444 // 0 1 2 3 4 5 6 7 8 9
5449- QueryResult result = WorldDatabase.PQuery (" SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o{} FROM {}" , isSpellScriptTable ? " , effIndex " : " " , tableName);
5445+ QueryResult result = WorldDatabase.PQuery (" SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o FROM {}" , tableName);
54505446
54515447 if (!result)
54525448 {
@@ -5462,8 +5458,6 @@ void ObjectMgr::LoadScripts(ScriptsType type)
54625458 ScriptInfo tmp;
54635459 tmp.type = type;
54645460 tmp.id = fields[0 ].GetUInt32 ();
5465- if (isSpellScriptTable)
5466- tmp.id |= fields[10 ].GetUInt8 () << 24 ;
54675461 tmp.delay = fields[1 ].GetUInt32 ();
54685462 tmp.command = ScriptCommands (fields[2 ].GetUInt32 ());
54695463 tmp.Raw .nData [0 ] = fields[3 ].GetUInt32 ();
@@ -5738,35 +5732,6 @@ void ObjectMgr::LoadScripts(ScriptsType type)
57385732 TC_LOG_INFO (" server.loading" , " >> Loaded {} script definitions in {} ms" , count, GetMSTimeDiffToNow (oldMSTime));
57395733}
57405734
5741- void ObjectMgr::LoadSpellScripts ()
5742- {
5743- LoadScripts (SCRIPTS_SPELL);
5744-
5745- // check ids
5746- for (ScriptMapMap::const_iterator itr = sSpellScripts .begin (); itr != sSpellScripts .end (); ++itr)
5747- {
5748- uint32 spellId = uint32 (itr->first ) & 0x00FFFFFF ;
5749- SpellInfo const * spellInfo = sSpellMgr ->GetSpellInfo (spellId);
5750-
5751- if (!spellInfo)
5752- {
5753- TC_LOG_ERROR (" sql.sql" , " Table `spell_scripts` has not existing spell (Id: {}) as script id" , spellId);
5754- continue ;
5755- }
5756-
5757- SpellEffIndex i = SpellEffIndex ((uint32 (itr->first ) >> 24 ) & 0x000000FF );
5758- if (uint32 (i) >= MAX_SPELL_EFFECTS)
5759- {
5760- TC_LOG_ERROR (" sql.sql" , " Table `spell_scripts` has too high effect index {} for spell (Id: {}) as script id" , uint32 (i), spellId);
5761- continue ;
5762- }
5763-
5764- // check for correct spellEffect
5765- if (!spellInfo->GetEffect (i).Effect || (spellInfo->GetEffect (i).Effect != SPELL_EFFECT_SCRIPT_EFFECT && spellInfo->GetEffect (i).Effect != SPELL_EFFECT_DUMMY))
5766- TC_LOG_ERROR (" sql.sql" , " Table `spell_scripts` - spell {} effect {} is not SPELL_EFFECT_SCRIPT_EFFECT or SPELL_EFFECT_DUMMY" , spellId, uint32 (i));
5767- }
5768- }
5769-
57705735void ObjectMgr::LoadEventScripts ()
57715736{
57725737 LoadScripts (SCRIPTS_EVENT);
0 commit comments