[10942] Implement .reload npc_text.

This commit is contained in:
VladimirMangos 2010-12-30 23:39:43 +03:00
parent 16768da053
commit 7a2478ff4f
7 changed files with 22 additions and 12 deletions

View file

@ -496,6 +496,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "mangos_string", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadMangosStringCommand, "", NULL },
{ "milling_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesMillingCommand, "", NULL },
{ "npc_gossip", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcGossipCommand, "", NULL },
{ "npc_text", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcTextCommand, "", NULL },
{ "npc_spellclick_spells", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadSpellClickSpellsCommand, "", NULL },
{ "npc_trainer", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcTrainerCommand, "", NULL },
{ "npc_vendor", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadNpcVendorCommand, "", NULL },

View file

@ -418,6 +418,7 @@ class ChatHandler
bool HandleReloadMailLevelRewardCommand(char* args);
bool HandleReloadMangosStringCommand(char* args);
bool HandleReloadNpcGossipCommand(char* args);
bool HandleReloadNpcTextCommand(char* args);
bool HandleReloadNpcTrainerCommand(char* args);
bool HandleReloadNpcVendorCommand(char* args);
bool HandleReloadPageTextsCommand(char* args);

View file

@ -460,11 +460,19 @@ bool ChatHandler::HandleReloadMangosStringCommand(char* /*args*/)
bool ChatHandler::HandleReloadNpcGossipCommand(char* /*args*/)
{
sLog.outString( "Re-Loading `npc_gossip` Table!" );
sObjectMgr.LoadNpcTextId();
sObjectMgr.LoadNpcGossips();
SendGlobalSysMessage("DB table `npc_gossip` reloaded.");
return true;
}
bool ChatHandler::HandleReloadNpcTextCommand(char* /*args*/)
{
sLog.outString( "Re-Loading `npc_text` Table!" );
sObjectMgr.LoadGossipText();
SendGlobalSysMessage("DB table `npc_text` reloaded.");
return true;
}
bool ChatHandler::HandleReloadNpcTrainerCommand(char* /*args*/)
{
sLog.outString( "Re-Loading `npc_trainer_template` Table!" );
@ -888,7 +896,7 @@ bool ChatHandler::HandleReloadLocalesItemCommand(char* /*args*/)
bool ChatHandler::HandleReloadLocalesNpcTextCommand(char* /*args*/)
{
sLog.outString( "Re-Loading Locales NPC Text ... ");
sObjectMgr.LoadNpcTextLocales();
sObjectMgr.LoadGossipTextLocales();
SendGlobalSysMessage("DB table `locales_npc_text` reloaded.");
return true;
}

View file

@ -4776,7 +4776,7 @@ void ObjectMgr::LoadGossipText()
delete result;
}
void ObjectMgr::LoadNpcTextLocales()
void ObjectMgr::LoadGossipTextLocales()
{
mNpcTextLocaleMap.clear(); // need for reload case
@ -8338,7 +8338,7 @@ void ObjectMgr::LoadVendorTemplates()
sLog.outErrorDb("Table `npc_vendor_template` has vendor template %u not used by any vendors ", *vItr);
}
void ObjectMgr::LoadNpcTextId()
void ObjectMgr::LoadNpcGossips()
{
m_mCacheNpcTextIdMap.clear();

View file

@ -653,7 +653,7 @@ class ObjectMgr
void LoadItemRequiredTarget();
void LoadItemLocales();
void LoadQuestLocales();
void LoadNpcTextLocales();
void LoadGossipTextLocales();
void LoadPageTextLocales();
void LoadGossipMenuItemsLocales();
void LoadPointOfInterestLocales();
@ -689,7 +689,7 @@ class ObjectMgr
void LoadWeatherZoneChances();
void LoadGameTele();
void LoadNpcTextId();
void LoadNpcGossips();
void LoadGossipMenu();
void LoadGossipMenuItems();

View file

@ -1148,7 +1148,7 @@ void World::SetInitialWorldSettings()
sLog.outString();
sLog.outString( "Loading Npc Text Id..." );
sObjectMgr.LoadNpcTextId(); // must be after load Creature and LoadGossipText
sObjectMgr.LoadNpcGossips(); // must be after load Creature and LoadGossipText
sLog.outString( "Loading Gossip scripts..." );
sScriptMgr.LoadGossipScripts(); // must be before gossip menu options
@ -1180,7 +1180,7 @@ void World::SetInitialWorldSettings()
sObjectMgr.LoadGameObjectLocales(); // must be after GameobjectInfo loading
sObjectMgr.LoadItemLocales(); // must be after ItemPrototypes loading
sObjectMgr.LoadQuestLocales(); // must be after QuestTemplates loading
sObjectMgr.LoadNpcTextLocales(); // must be after LoadGossipText
sObjectMgr.LoadGossipTextLocales(); // must be after LoadGossipText
sObjectMgr.LoadPageTextLocales(); // must be after PageText loading
sObjectMgr.LoadGossipMenuItemsLocales(); // must be after gossip menu items loading
sObjectMgr.LoadPointOfInterestLocales(); // must be after POI loading

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10941"
#define REVISION_NR "10942"
#endif // __REVISION_NR_H__