mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Scripts: Drop gameobject_scripts table - empty, deprecated and no longer needed
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
DROP TABLE `gameobject_scripts`;
|
||||
DELETE FROM `command` WHERE `name`='reload gameobject_scripts';
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user