diff --git a/data/sql/updates/pending_db_world/rev_1477683243N.sql b/data/sql/updates/pending_db_world/rev_1477683243N.sql new file mode 100644 index 000000000..5d5c18cb7 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1477683243N.sql @@ -0,0 +1,5 @@ +INSERT INTO version_db_world(`sql_rev`) VALUES ('1477683243N'); + +DELETE FROM `command` WHERE `name` = 'reload battleground_template'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('reload battleground_template', 3, 'Syntax: .reload battleground_template\r\nReload Battleground Templates.'); diff --git a/src/scripts/Commands/cs_reload.cpp b/src/scripts/Commands/cs_reload.cpp index 901b6360b..7d870d9a5 100644 --- a/src/scripts/Commands/cs_reload.cpp +++ b/src/scripts/Commands/cs_reload.cpp @@ -13,6 +13,7 @@ EndScriptData */ #include "AchievementMgr.h" #include "AuctionHouseMgr.h" +#include "BattlegroundMgr.h" #include "Chat.h" #include "CreatureTextMgr.h" #include "DisableMgr.h" @@ -61,6 +62,7 @@ public: { "areatrigger_tavern", SEC_ADMINISTRATOR, true, &HandleReloadAreaTriggerTavernCommand, "" }, { "areatrigger_teleport", SEC_ADMINISTRATOR, true, &HandleReloadAreaTriggerTeleportCommand, "" }, { "autobroadcast", SEC_ADMINISTRATOR, true, &HandleReloadAutobroadcastCommand, "" }, + { "battleground_template", SEC_ADMINISTRATOR, true, &HandleReloadBattlegroundTemplate, "" }, { "command", SEC_ADMINISTRATOR, true, &HandleReloadCommandCommand, "" }, { "conditions", SEC_ADMINISTRATOR, true, &HandleReloadConditions, "" }, { "config", SEC_ADMINISTRATOR, true, &HandleReloadConfigCommand, "" }, @@ -179,6 +181,15 @@ public: HandleReloadVehicleTemplateAccessoryCommand(handler, ""); HandleReloadAutobroadcastCommand(handler, ""); + HandleReloadBattlegroundTemplate(handler, ""); + return true; + } + + static bool HandleReloadBattlegroundTemplate(ChatHandler* handler, char const* /*args*/) + { + sLog->outString("Re-Loading Battleground Templates..."); + sBattlegroundMgr->CreateInitialBattlegrounds(); + handler->SendGlobalGMSysMessage("DB table `battleground_template` reloaded."); return true; }