Core/Gossip: Ditch gossip_scripts as it is no longer used. SAI is a better option
This commit is contained in:
@@ -51,7 +51,6 @@ ScriptMapMap sQuestStartScripts;
|
||||
ScriptMapMap sSpellScripts;
|
||||
ScriptMapMap sGameObjectScripts;
|
||||
ScriptMapMap sEventScripts;
|
||||
ScriptMapMap sGossipScripts;
|
||||
ScriptMapMap sWaypointScripts;
|
||||
|
||||
std::string GetScriptsTableNameByType(ScriptsType type)
|
||||
@@ -65,7 +64,6 @@ std::string GetScriptsTableNameByType(ScriptsType type)
|
||||
case SCRIPTS_GAMEOBJECT: res = "gameobject_scripts"; break;
|
||||
case SCRIPTS_EVENT: res = "event_scripts"; break;
|
||||
case SCRIPTS_WAYPOINT: res = "waypoint_scripts"; break;
|
||||
case SCRIPTS_GOSSIP: res = "gossip_scripts"; break;
|
||||
default: break;
|
||||
}
|
||||
return res;
|
||||
@@ -82,7 +80,6 @@ ScriptMapMap* GetScriptsMapByType(ScriptsType type)
|
||||
case SCRIPTS_GAMEOBJECT: res = &sGameObjectScripts; break;
|
||||
case SCRIPTS_EVENT: res = &sEventScripts; break;
|
||||
case SCRIPTS_WAYPOINT: res = &sWaypointScripts; break;
|
||||
case SCRIPTS_GOSSIP: res = &sGossipScripts; break;
|
||||
default: break;
|
||||
}
|
||||
return res;
|
||||
@@ -5091,13 +5088,6 @@ void ObjectMgr::ValidateSpellScripts()
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadGossipScripts()
|
||||
{
|
||||
LoadScripts(SCRIPTS_GOSSIP);
|
||||
|
||||
// checks are done in LoadGossipMenuItems
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadPageTexts()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
@@ -8515,7 +8505,7 @@ void ObjectMgr::LoadGossipMenuItems()
|
||||
|
||||
QueryResult result = WorldDatabase.Query(
|
||||
"SELECT menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, "
|
||||
"action_menu_id, action_poi_id, action_script_id, box_coded, box_money, box_text "
|
||||
"action_menu_id, action_poi_id, box_coded, box_money, box_text "
|
||||
"FROM gossip_menu_option ORDER BY menu_id, id");
|
||||
|
||||
if (!result)
|
||||
@@ -8527,14 +8517,8 @@ void ObjectMgr::LoadGossipMenuItems()
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
std::set<uint32> gossipScriptSet;
|
||||
|
||||
for (ScriptMapMap::const_iterator itr = sGossipScripts.begin(); itr != sGossipScripts.end(); ++itr)
|
||||
gossipScriptSet.insert(itr->first);
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
GossipMenuItems gMenuItem;
|
||||
@@ -8547,10 +8531,9 @@ void ObjectMgr::LoadGossipMenuItems()
|
||||
gMenuItem.OptionNpcflag = fields[5].GetUInt32();
|
||||
gMenuItem.ActionMenuId = fields[6].GetUInt32();
|
||||
gMenuItem.ActionPoiId = fields[7].GetUInt32();
|
||||
gMenuItem.ActionScriptId = fields[8].GetUInt32();
|
||||
gMenuItem.BoxCoded = fields[9].GetBool();
|
||||
gMenuItem.BoxMoney = fields[10].GetUInt32();
|
||||
gMenuItem.BoxText = fields[11].GetString();
|
||||
gMenuItem.BoxCoded = fields[8].GetBool();
|
||||
gMenuItem.BoxMoney = fields[9].GetUInt32();
|
||||
gMenuItem.BoxText = fields[10].GetString();
|
||||
|
||||
if (gMenuItem.OptionIcon >= GOSSIP_ICON_MAX)
|
||||
{
|
||||
@@ -8567,34 +8550,11 @@ void ObjectMgr::LoadGossipMenuItems()
|
||||
gMenuItem.ActionPoiId = 0;
|
||||
}
|
||||
|
||||
if (gMenuItem.ActionScriptId)
|
||||
{
|
||||
if (gMenuItem.OptionType != GOSSIP_OPTION_GOSSIP)
|
||||
{
|
||||
sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u have action_script_id %u but option_id is not GOSSIP_OPTION_GOSSIP, ignoring", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.ActionScriptId);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sGossipScripts.find(gMenuItem.ActionScriptId) == sGossipScripts.end())
|
||||
{
|
||||
sLog->outErrorDb("Table gossip_menu_option for menu %u, id %u have action_script_id %u that does not exist in `gossip_scripts`, ignoring", gMenuItem.MenuId, gMenuItem.OptionIndex, gMenuItem.ActionScriptId);
|
||||
continue;
|
||||
}
|
||||
|
||||
gossipScriptSet.erase(gMenuItem.ActionScriptId);
|
||||
}
|
||||
|
||||
m_mGossipMenuItemsMap.insert(GossipMenuItemsMap::value_type(gMenuItem.MenuId, gMenuItem));
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
if (!gossipScriptSet.empty())
|
||||
{
|
||||
for (std::set<uint32>::const_iterator itr = gossipScriptSet.begin(); itr != gossipScriptSet.end(); ++itr)
|
||||
sLog->outErrorDb("Table `gossip_scripts` contain unused script, id %u.", *itr);
|
||||
}
|
||||
|
||||
sLog->outString(">> Loaded %u gossip_menu_option entries in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
@@ -94,7 +94,6 @@ enum ScriptsType
|
||||
SCRIPTS_GAMEOBJECT,
|
||||
SCRIPTS_EVENT,
|
||||
SCRIPTS_WAYPOINT,
|
||||
SCRIPTS_GOSSIP,
|
||||
|
||||
SCRIPTS_LAST
|
||||
};
|
||||
@@ -329,7 +328,6 @@ extern ScriptMapMap sQuestStartScripts;
|
||||
extern ScriptMapMap sSpellScripts;
|
||||
extern ScriptMapMap sGameObjectScripts;
|
||||
extern ScriptMapMap sEventScripts;
|
||||
extern ScriptMapMap sGossipScripts;
|
||||
extern ScriptMapMap sWaypointScripts;
|
||||
|
||||
std::string GetScriptsTableNameByType(ScriptsType type);
|
||||
@@ -483,7 +481,6 @@ struct GossipMenuItems
|
||||
uint32 OptionNpcflag;
|
||||
uint32 ActionMenuId;
|
||||
uint32 ActionPoiId;
|
||||
uint32 ActionScriptId;
|
||||
bool BoxCoded;
|
||||
uint32 BoxMoney;
|
||||
std::string BoxText;
|
||||
@@ -862,7 +859,6 @@ class ObjectMgr
|
||||
void LoadQuestStartScripts();
|
||||
void LoadEventScripts();
|
||||
void LoadSpellScripts();
|
||||
void LoadGossipScripts();
|
||||
void LoadWaypointScripts();
|
||||
|
||||
void LoadSpellScriptNames();
|
||||
|
||||
Reference in New Issue
Block a user