diff options
author | runningnak3d <runningnak3d@gmail.com> | 2011-02-11 13:04:45 -0700 |
---|---|---|
committer | runningnak3d <runningnak3d@gmail.com> | 2011-02-11 13:04:45 -0700 |
commit | 05e075ce0ec0b758bca9a183b3a401c620fd58a7 (patch) | |
tree | 2407211a570a2b9efb779578612c10fc67c4d4a1 | |
parent | e609d18588a7941353e356731c6a5a0aace14d8f (diff) |
Core/Gossip: Remove support for `npc_gossip` table (DEPRECATED).
-rw-r--r-- | sql/base/world_database.sql | 28 | ||||
-rw-r--r-- | sql/updates/world/2011_02_11_1_world_command.sql | 3 | ||||
-rw-r--r-- | sql/updates/world/2011_02_11_2_world_npc_gossip.sql | 1 | ||||
-rwxr-xr-x | src/server/game/Entities/Player/Player.cpp | 46 | ||||
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.cpp | 47 | ||||
-rwxr-xr-x | src/server/game/Globals/ObjectMgr.h | 2 | ||||
-rwxr-xr-x | src/server/game/World/World.cpp | 3 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_reload.cpp | 13 |
8 files changed, 7 insertions, 136 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql index 5b558c9abcd..454a0adff74 100644 --- a/sql/base/world_database.sql +++ b/sql/base/world_database.sql @@ -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.'), @@ -3778,29 +3777,6 @@ LOCK TABLES `milling_loot_template` WRITE; 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` -- diff --git a/sql/updates/world/2011_02_11_1_world_command.sql b/sql/updates/world/2011_02_11_1_world_command.sql new file mode 100644 index 00000000000..407699d6d7d --- /dev/null +++ b/sql/updates/world/2011_02_11_1_world_command.sql @@ -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'; diff --git a/sql/updates/world/2011_02_11_2_world_npc_gossip.sql b/sql/updates/world/2011_02_11_2_world_npc_gossip.sql new file mode 100644 index 00000000000..18739ed1be6 --- /dev/null +++ b/sql/updates/world/2011_02_11_2_world_npc_gossip.sql @@ -0,0 +1 @@ +DROP TABLE `npc_gossip`; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2a664a2bbd9..4072d857233 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -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 diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 16198d2c86c..13438393bc4 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -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(); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 13d3a3ec418..99e4d8d7464 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -947,8 +947,6 @@ class ObjectMgr void LoadGameTele(); - void LoadNpcTextId(); - void LoadGossipMenu(); void LoadGossipMenuItems(); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index ab5071a18bd..b931db7a681 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -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..."); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index ae86a16fae9..b4cd6d6f8a9 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -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!"); |