Core/Gossip: Remove support for npc_gossip table (DEPRECATED).
This commit is contained in:
@@ -566,11 +566,11 @@ INSERT INTO `command` VALUES
|
||||
('reload all achievement',3,'Syntax: .reload all achievement\r\n\r\nReload achievement_reward, achievement_criteria_data tables.'),
|
||||
('reload all area',3,'Syntax: .reload all area\r\n\r\nReload areatrigger_teleport, areatrigger_tavern, game_graveyard_zone tables.'),
|
||||
('reload all eventai',3,'Syntax: .reload all eventai\r\n\r\nReload creature_ai_scripts, creature_ai_summons, creature_ai_texts tables.'),
|
||||
('reload all gossips',3,'Syntax: .reload all gossips\nReload gossip_menu, gossip_menu_option, gossip_scripts, npc_gossip, points_of_interest tables.'),
|
||||
('reload all gossips',3,'Syntax: .reload all gossips\nReload gossip_menu, gossip_menu_option, gossip_scripts, points_of_interest tables.'),
|
||||
('reload all item',3,'Syntax: .reload all item\nReload page_text, item_enchantment_table tables.'),
|
||||
('reload all locales',3,'Syntax: .reload all locales\r\n\r\nReload all `locales_*` tables with reload support added and that can be _safe_ reloaded.'),
|
||||
('reload all loot',3,'Syntax: .reload all loot\r\n\r\nReload all `*_loot_template` tables. This can be slow operation with lags for server run.'),
|
||||
('reload all npc',3,'Syntax: .reload all npc\nReload npc_gossip, npc_option, npc_trainer, npc vendor, points of interest tables.'),
|
||||
('reload all npc',3,'Syntax: .reload all npc\nReload npc_option, npc_trainer, npc vendor, points of interest tables.'),
|
||||
('reload all quest',3,'Syntax: .reload all quest\r\n\r\nReload all quest related tables if reload support added for this table and this table can be _safe_ reloaded.'),
|
||||
('reload all scripts',3,'Syntax: .reload all scripts\nReload gameobject_scripts, event_scripts, quest_end_scripts, quest_start_scripts, spell_scripts, db_script_string, waypoint_scripts tables.'),
|
||||
('reload all spell',3,'Syntax: .reload all spell\r\n\r\nReload all `spell_*` tables with reload support added and that can be _safe_ reloaded.'),
|
||||
@@ -619,7 +619,6 @@ INSERT INTO `command` VALUES
|
||||
('reload mail_level_reward',3,'Syntax: .reload mail_level_reward\nReload mail_level_reward table.'),
|
||||
('reload mail_loot_template',3,'Syntax: .reload mail_loot_template\nReload mail_loot_template table.'),
|
||||
('reload milling_loot_template',3,'Syntax: .reload milling_loot_template\nReload milling_loot_template table.'),
|
||||
('reload npc_gossip',3,'Syntax: .reload npc_gossip\nReload npc_gossip table.'),
|
||||
('reload npc_trainer',3,'Syntax: .reload npc_trainer\nReload npc_trainer table.'),
|
||||
('reload npc_vendor',3,'Syntax: .reload npc_vendor\nReload npc_vendor table.'),
|
||||
('reload page_text',3,'Syntax: .reload page_text\nReload page_text table.'),
|
||||
@@ -3777,29 +3776,6 @@ LOCK TABLES `milling_loot_template` WRITE;
|
||||
/*!40000 ALTER TABLE `milling_loot_template` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `npc_gossip`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `npc_gossip`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `npc_gossip` (
|
||||
`npc_guid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`textid` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`npc_guid`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `npc_gossip`
|
||||
--
|
||||
|
||||
LOCK TABLES `npc_gossip` WRITE;
|
||||
/*!40000 ALTER TABLE `npc_gossip` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `npc_gossip` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `npc_spellclick_spells`
|
||||
--
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
UPDATE `command` SET `help` = 'Syntax: .reload all gossips\nReload gossip_menu, gossip_menu_option, gossip_scripts, points_of_interest tables.' WHERE `name` = 'reload all gossips';
|
||||
UPDATE `command` SET `help` = 'Syntax: .reload all npc\nReload npc_option, npc_trainer, npc vendor, points of interest tables.' WHERE `name` = 'reload all npc';
|
||||
DELETE FROM `command` WHERE `name` = 'reload npc_gossip';
|
||||
@@ -0,0 +1 @@
|
||||
DROP TABLE `npc_gossip`;
|
||||
@@ -14196,52 +14196,6 @@ void Player::SendPreparedQuest(uint64 guid)
|
||||
}
|
||||
}
|
||||
}
|
||||
// multiply entries
|
||||
else
|
||||
{
|
||||
QEmote qe;
|
||||
qe._Delay = 0;
|
||||
qe._Emote = 0;
|
||||
std::string title = "";
|
||||
|
||||
// need pet case for some quests
|
||||
Creature *pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this,guid);
|
||||
if (pCreature)
|
||||
{
|
||||
uint32 textid = GetGossipTextId(pCreature);
|
||||
GossipText const* gossiptext = sObjectMgr->GetGossipText(textid);
|
||||
if (!gossiptext)
|
||||
{
|
||||
qe._Delay = 0; //TEXTEMOTE_MESSAGE; //zyg: player emote
|
||||
qe._Emote = 0; //TEXTEMOTE_HELLO; //zyg: NPC emote
|
||||
title = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
qe = gossiptext->Options[0].Emotes[0];
|
||||
|
||||
if (!gossiptext->Options[0].Text_0.empty())
|
||||
{
|
||||
title = gossiptext->Options[0].Text_0;
|
||||
|
||||
int loc_idx = GetSession()->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
if (NpcTextLocale const *nl = sObjectMgr->GetNpcTextLocale(textid))
|
||||
sObjectMgr->GetLocaleString(nl->Text_0[0], loc_idx, title);
|
||||
}
|
||||
else
|
||||
{
|
||||
title = gossiptext->Options[0].Text_1;
|
||||
|
||||
int loc_idx = GetSession()->GetSessionDbLocaleIndex();
|
||||
if (loc_idx >= 0)
|
||||
if (NpcTextLocale const *nl = sObjectMgr->GetNpcTextLocale(textid))
|
||||
sObjectMgr->GetLocaleString(nl->Text_1[0], loc_idx, title);
|
||||
}
|
||||
}
|
||||
}
|
||||
PlayerTalkClass->SendQuestGiverQuestList(qe, title, guid);
|
||||
}
|
||||
}
|
||||
|
||||
bool Player::IsActiveQuest(uint32 quest_id) const
|
||||
|
||||
@@ -8787,53 +8787,6 @@ void ObjectMgr::LoadVendors()
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadNpcTextId()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
m_mCacheNpcTextIdMap.clear();
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT npc_guid, textid FROM npc_gossip");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
sLog->outErrorDb(">> Loaded 0 NpcTextId. DB table `npc_gossip` is empty!");
|
||||
sLog->outString();
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 count = 0;
|
||||
uint32 guid, textid;
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
guid = fields[0].GetUInt32();
|
||||
textid = fields[1].GetUInt32();
|
||||
|
||||
if (!GetCreatureData(guid))
|
||||
{
|
||||
sLog->outErrorDb("Table `npc_gossip` have not existed creature (GUID: %u) entry, ignore. ",guid);
|
||||
continue;
|
||||
}
|
||||
if (!GetGossipText(textid))
|
||||
{
|
||||
sLog->outErrorDb("Table `npc_gossip` for creature (GUID: %u) have wrong Textid (%u), ignore. ", guid, textid);
|
||||
continue;
|
||||
}
|
||||
|
||||
m_mCacheNpcTextIdMap[guid] = textid ;
|
||||
++count;
|
||||
|
||||
}
|
||||
while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %d NpcTextId in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadGossipMenu()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
@@ -947,8 +947,6 @@ class ObjectMgr
|
||||
|
||||
void LoadGameTele();
|
||||
|
||||
void LoadNpcTextId();
|
||||
|
||||
void LoadGossipMenu();
|
||||
void LoadGossipMenuItems();
|
||||
|
||||
|
||||
@@ -1521,9 +1521,6 @@ void World::SetInitialWorldSettings()
|
||||
sLog->outString("Loading GameTeleports...");
|
||||
sObjectMgr->LoadGameTele();
|
||||
|
||||
sLog->outString("Loading Npc Text Id...");
|
||||
sObjectMgr->LoadNpcTextId(); // must be after load Creature and NpcText
|
||||
|
||||
sObjectMgr->LoadGossipScripts(); // must be before gossip menu options
|
||||
|
||||
sLog->outString("Loading Gossip menu...");
|
||||
|
||||
@@ -116,7 +116,6 @@ public:
|
||||
{ "mail_level_reward", SEC_ADMINISTRATOR, true, &HandleReloadMailLevelRewardCommand, "", NULL },
|
||||
{ "mail_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMailCommand, "", NULL },
|
||||
{ "milling_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMillingCommand, "", NULL },
|
||||
{ "npc_gossip", SEC_ADMINISTRATOR, true, &HandleReloadNpcGossipCommand, "", NULL },
|
||||
{ "npc_spellclick_spells", SEC_ADMINISTRATOR, true, &HandleReloadSpellClickSpellsCommand, "",NULL},
|
||||
{ "npc_trainer", SEC_ADMINISTRATOR, true, &HandleReloadNpcTrainerCommand, "", NULL },
|
||||
{ "npc_vendor", SEC_ADMINISTRATOR, true, &HandleReloadNpcVendorCommand, "", NULL },
|
||||
@@ -223,7 +222,6 @@ public:
|
||||
static bool HandleReloadAllNpcCommand(ChatHandler* handler, const char* args)
|
||||
{
|
||||
if(*args != 'a') // will be reloaded from all_gossips
|
||||
HandleReloadNpcGossipCommand(handler,"a");
|
||||
HandleReloadNpcTrainerCommand(handler,"a");
|
||||
HandleReloadNpcVendorCommand(handler,"a");
|
||||
HandleReloadPointsOfInterestCommand(handler,"a");
|
||||
@@ -296,8 +294,7 @@ public:
|
||||
HandleReloadGossipMenuCommand(handler,"a");
|
||||
HandleReloadGossipMenuOptionCommand(handler,"a");
|
||||
if(*args != 'a') // already reload from all_scripts
|
||||
HandleReloadGossipScriptsCommand(handler,"a");
|
||||
HandleReloadNpcGossipCommand(handler,"a");
|
||||
HandleReloadGossipScriptsCommand(handler,"a");
|
||||
HandleReloadPointsOfInterestCommand(handler,"a");
|
||||
return true;
|
||||
}
|
||||
@@ -742,14 +739,6 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadNpcGossipCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading `npc_gossip` Table!");
|
||||
sObjectMgr->LoadNpcTextId();
|
||||
handler->SendGlobalGMSysMessage("DB table `npc_gossip` reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadNpcTrainerCommand(ChatHandler* handler, const char* /*args*/)
|
||||
{
|
||||
sLog->outString("Re-Loading `npc_trainer` Table!");
|
||||
|
||||
Reference in New Issue
Block a user