NeatElves
20.01.2010, 14:18
Вроде правильно..))
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index ca8644d..0e61208 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -425,6 +425,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "gameobject_battleground", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadBattleEventCommand, "", NULL },
{ "gossip_menu", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGossipMenuCommand, "", NULL },
{ "gossip_menu_option", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGossipMenuOptionCommand, "", NULL },
+ { "gossip_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGossipScriptsCommand, "", NULL },
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemEnchantementsCommand, "", NULL },
{ "item_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesItemCommand, "", NULL },
{ "item_required_target", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemRequiredTragetCommand , "", NULL },
diff --git a/src/game/Chat.h b/src/game/Chat.h
index 7f2a7b1..04585f5 100644
--- a/src/game/Chat.h
+++ b/src/game/Chat.h
@@ -337,6 +337,7 @@ class ChatHandler
bool HandleReloadGameTeleCommand(const char* args);
bool HandleReloadGossipMenuCommand(const char* args);
bool HandleReloadGossipMenuOptionCommand(const char* args);
+ bool HandleReloadGossipScriptsCommand(const char* args);
bool HandleReloadGOQuestRelationsCommand(const char* args);
bool HandleReloadGOQuestInvRelationsCommand(const char* args);
bool HandleReloadItemEnchantementsCommand(const char* args);
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index 7586ff6..e8e4c1b 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -131,6 +131,7 @@ bool ChatHandler::HandleReloadAllScriptsCommand(const char*)
sLog.outString( "Re-Loading Scripts..." );
HandleReloadGameObjectScriptsCommand("a");
+ HandleReloadGossipScriptsCommand("a");
HandleReloadEventScriptsCommand("a");
HandleReloadQuestEndScriptsCommand("a");
HandleReloadQuestStartScriptsCommand("a");
@@ -267,6 +268,26 @@ bool ChatHandler::HandleReloadGossipMenuOptionCommand(c onst char*)
return true;
}
+bool ChatHandler::HandleReloadGossipScriptsCommand(cons t char* arg)
+{
+ if(sWorld.IsScriptScheduled())
+ {
+ SendSysMessage("DB scripts used currently, please attempt reload later.");
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ if(*arg!='a')
+ sLog.outString( "Re-Loading Scripts from `gossip_scripts`...");
+
+ sObjectMgr.LoadGossipScripts();
+
+ if(*arg!='a')
+ SendGlobalSysMessage("DB table `gossip_scripts` reloaded.");
+
+ return true;
+}
+
bool ChatHandler::HandleReloadGOQuestRelationsCommand(c onst char*)
{
sLog.outString( "Loading Quests Relations... (`gameobject_questrelation`)" );
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp
index ca8644d..0e61208 100644
--- a/src/game/Chat.cpp
+++ b/src/game/Chat.cpp
@@ -425,6 +425,7 @@ ChatCommand * ChatHandler::getCommandTable()
{ "gameobject_battleground", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadBattleEventCommand, "", NULL },
{ "gossip_menu", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGossipMenuCommand, "", NULL },
{ "gossip_menu_option", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGossipMenuOptionCommand, "", NULL },
+ { "gossip_scripts", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadGossipScriptsCommand, "", NULL },
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemEnchantementsCommand, "", NULL },
{ "item_loot_template", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadLootTemplatesItemCommand, "", NULL },
{ "item_required_target", SEC_ADMINISTRATOR, true, &ChatHandler::HandleReloadItemRequiredTragetCommand , "", NULL },
diff --git a/src/game/Chat.h b/src/game/Chat.h
index 7f2a7b1..04585f5 100644
--- a/src/game/Chat.h
+++ b/src/game/Chat.h
@@ -337,6 +337,7 @@ class ChatHandler
bool HandleReloadGameTeleCommand(const char* args);
bool HandleReloadGossipMenuCommand(const char* args);
bool HandleReloadGossipMenuOptionCommand(const char* args);
+ bool HandleReloadGossipScriptsCommand(const char* args);
bool HandleReloadGOQuestRelationsCommand(const char* args);
bool HandleReloadGOQuestInvRelationsCommand(const char* args);
bool HandleReloadItemEnchantementsCommand(const char* args);
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index 7586ff6..e8e4c1b 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -131,6 +131,7 @@ bool ChatHandler::HandleReloadAllScriptsCommand(const char*)
sLog.outString( "Re-Loading Scripts..." );
HandleReloadGameObjectScriptsCommand("a");
+ HandleReloadGossipScriptsCommand("a");
HandleReloadEventScriptsCommand("a");
HandleReloadQuestEndScriptsCommand("a");
HandleReloadQuestStartScriptsCommand("a");
@@ -267,6 +268,26 @@ bool ChatHandler::HandleReloadGossipMenuOptionCommand(c onst char*)
return true;
}
+bool ChatHandler::HandleReloadGossipScriptsCommand(cons t char* arg)
+{
+ if(sWorld.IsScriptScheduled())
+ {
+ SendSysMessage("DB scripts used currently, please attempt reload later.");
+ SetSentErrorMessage(true);
+ return false;
+ }
+
+ if(*arg!='a')
+ sLog.outString( "Re-Loading Scripts from `gossip_scripts`...");
+
+ sObjectMgr.LoadGossipScripts();
+
+ if(*arg!='a')
+ SendGlobalSysMessage("DB table `gossip_scripts` reloaded.");
+
+ return true;
+}
+
bool ChatHandler::HandleReloadGOQuestRelationsCommand(c onst char*)
{
sLog.outString( "Loading Quests Relations... (`gameobject_questrelation`)" );