Core/Scripts: Drop gameobject_scripts table - empty, deprecated and no longer needed

This commit is contained in:
Nay
2013-01-03 19:18:26 +00:00
parent 59e4f6eb05
commit 9394dc10b4
7 changed files with 2 additions and 46 deletions

View File

@@ -0,0 +1,2 @@
DROP TABLE `gameobject_scripts`;
DELETE FROM `command` WHERE `name`='reload gameobject_scripts';

View File

@@ -1098,11 +1098,7 @@ void GameObject::Use(Unit* user)
case GAMEOBJECT_TYPE_BUTTON: //1
//doors/buttons never really despawn, only reset to default state/flags
UseDoorOrButton(0, false, user);
// activate script
GetMap()->ScriptsStart(sGameObjectScripts, GetDBTableGUIDLow(), spellCaster, this);
return;
case GAMEOBJECT_TYPE_QUESTGIVER: //2
{
if (user->GetTypeId() != TYPEID_PLAYER)

View File

@@ -50,7 +50,6 @@
#include "World.h"
ScriptMapMap sSpellScripts;
ScriptMapMap sGameObjectScripts;
ScriptMapMap sEventScripts;
ScriptMapMap sWaypointScripts;
@@ -60,7 +59,6 @@ std::string GetScriptsTableNameByType(ScriptsType type)
switch (type)
{
case SCRIPTS_SPELL: res = "spell_scripts"; break;
case SCRIPTS_GAMEOBJECT: res = "gameobject_scripts"; break;
case SCRIPTS_EVENT: res = "event_scripts"; break;
case SCRIPTS_WAYPOINT: res = "waypoint_scripts"; break;
default: break;
@@ -74,7 +72,6 @@ ScriptMapMap* GetScriptsMapByType(ScriptsType type)
switch (type)
{
case SCRIPTS_SPELL: res = &sSpellScripts; break;
case SCRIPTS_GAMEOBJECT: res = &sGameObjectScripts; break;
case SCRIPTS_EVENT: res = &sEventScripts; break;
case SCRIPTS_WAYPOINT: res = &sWaypointScripts; break;
default: break;
@@ -4667,18 +4664,6 @@ void ObjectMgr::LoadScripts(ScriptsType type)
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u script definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
void ObjectMgr::LoadGameObjectScripts()
{
LoadScripts(SCRIPTS_GAMEOBJECT);
// check ids
for (ScriptMapMap::const_iterator itr = sGameObjectScripts.begin(); itr != sGameObjectScripts.end(); ++itr)
{
if (!GetGOData(itr->first))
sLog->outError(LOG_FILTER_SQL, "Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id", itr->first);
}
}
void ObjectMgr::LoadSpellScripts()
{
LoadScripts(SCRIPTS_SPELL);

View File

@@ -128,7 +128,6 @@ enum ScriptsType
SCRIPTS_FIRST = 1,
SCRIPTS_SPELL = SCRIPTS_FIRST,
SCRIPTS_GAMEOBJECT,
SCRIPTS_EVENT,
SCRIPTS_WAYPOINT,
@@ -361,7 +360,6 @@ typedef std::map<uint32, ScriptMap > ScriptMapMap;
typedef std::multimap<uint32, uint32> SpellScriptsContainer;
typedef std::pair<SpellScriptsContainer::iterator, SpellScriptsContainer::iterator> SpellScriptsBounds;
extern ScriptMapMap sSpellScripts;
extern ScriptMapMap sGameObjectScripts;
extern ScriptMapMap sEventScripts;
extern ScriptMapMap sWaypointScripts;
@@ -863,7 +861,6 @@ class ObjectMgr
return _creatureQuestInvolvedRelations.equal_range(creature_entry);
}
void LoadGameObjectScripts();
void LoadEventScripts();
void LoadSpellScripts();
void LoadWaypointScripts();

View File

@@ -2010,7 +2010,6 @@ void Spell::SendLoot(uint64 guid, LootType loottype)
case GAMEOBJECT_TYPE_DOOR:
case GAMEOBJECT_TYPE_BUTTON:
gameObjTarget->UseDoorOrButton(0, false, player);
player->GetMap()->ScriptsStart(sGameObjectScripts, gameObjTarget->GetDBTableGUIDLow(), player, gameObjTarget);
return;
case GAMEOBJECT_TYPE_QUESTGIVER:

View File

@@ -1648,7 +1648,6 @@ void World::SetInitialWorldSettings()
///- Load and initialize scripts
sObjectMgr->LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
sObjectMgr->LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
sObjectMgr->LoadWaypointScripts();

View File

@@ -97,7 +97,6 @@ public:
{ "gameobject_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestInvRelationsCommand, "", NULL },
{ "gameobject_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesGameobjectCommand, "", NULL },
{ "gameobject_questrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestRelationsCommand, "", NULL },
{ "gameobject_scripts", SEC_ADMINISTRATOR, true, &HandleReloadGameObjectScriptsCommand, "", NULL },
{ "gm_tickets", SEC_ADMINISTRATOR, true, &HandleReloadGMTicketsCommand, "", NULL },
{ "gossip_menu", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuCommand, "", NULL },
{ "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL },
@@ -260,7 +259,6 @@ public:
}
sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts...");
HandleReloadGameObjectScriptsCommand(handler, "a");
HandleReloadEventScriptsCommand(handler, "a");
HandleReloadSpellScriptsCommand(handler, "a");
handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded.");
@@ -951,26 +949,6 @@ public:
return true;
}
static bool HandleReloadGameObjectScriptsCommand(ChatHandler* handler, const char* args)
{
if (sScriptMgr->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
return false;
}
if (*args != 'a')
sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `gameobject_scripts`...");
sObjectMgr->LoadGameObjectScripts();
if (*args != 'a')
handler->SendGlobalGMSysMessage("DB table `gameobject_scripts` reloaded.");
return true;
}
static bool HandleReloadEventScriptsCommand(ChatHandler* handler, const char* args)
{
if (sScriptMgr->IsScriptScheduled())