aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNay <dnpd.dd@gmail.com>2013-02-25 17:17:53 -0800
committerNay <dnpd.dd@gmail.com>2013-02-25 17:17:53 -0800
commitb00f6a981eb64d1b05a56b8009f3fdbcc20900a8 (patch)
treed6eb080de93a5c1363220f6d11d4b8c6220893ff
parent4bdc9e6f1cf104fc8f09ab2d9e7c7832c012e2d5 (diff)
parentc34f1aebe67b48ee2b8618636fc7eef7ea8fbd9f (diff)
Merge pull request #9295 from horn/summons
Script/Commands: Make creature_summon_groups table reloadable.
-rw-r--r--sql/updates/world/2013_02_24_05_world_command.sql4
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp2
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp11
3 files changed, 17 insertions, 0 deletions
diff --git a/sql/updates/world/2013_02_24_05_world_command.sql b/sql/updates/world/2013_02_24_05_world_command.sql
new file mode 100644
index 00000000000..0b153be15bc
--- /dev/null
+++ b/sql/updates/world/2013_02_24_05_world_command.sql
@@ -0,0 +1,4 @@
+DELETE FROM `command` WHERE `name` = 'reload creature_summon_groups';
+INSERT INTO `command` (`name`,`security`,`help`) VALUES
+('reload creature_summon_groups',3,'Syntax: .reload creature_summon_groups
+Reload creature_summon_groups table.');
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 222331c48f8..3b71d11757c 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -1425,6 +1425,8 @@ void ObjectMgr::LoadTempSummons()
{
uint32 oldMSTime = getMSTime();
+ _tempSummonDataStore.clear(); // needed for reload case
+
// 0 1 2 3 4 5 6 7 8 9
QueryResult result = WorldDatabase.Query("SELECT summonerId, summonerType, groupId, entry, position_x, position_y, position_z, orientation, summonType, summonTime FROM creature_summon_groups");
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index b2542d6a668..3f15c3fe6b7 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -86,6 +86,7 @@ public:
{ "creature_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL },
{ "creature_onkill_reputation", SEC_ADMINISTRATOR, true, &HandleReloadOnKillReputationCommand, "", NULL },
{ "creature_questrelation", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestRelationsCommand, "", NULL },
+ { "creature_summon_groups", SEC_ADMINISTRATOR, true, &HandleReloadCreatureSummonGroupsCommand, "", NULL },
{ "creature_template", SEC_ADMINISTRATOR, true, &HandleReloadCreatureTemplateCommand, "", NULL },
//{ "db_script_string", SEC_ADMINISTRATOR, true, &HandleReloadDbScriptStringCommand, "", NULL },
{ "disables", SEC_ADMINISTRATOR, true, &HandleReloadDisablesCommand, "", NULL },
@@ -195,6 +196,8 @@ public:
HandleReloadTrinityStringCommand(handler, "");
HandleReloadGameTeleCommand(handler, "");
+ HandleReloadCreatureSummonGroupsCommand(handler, "");
+
HandleReloadVehicleAccessoryCommand(handler, "");
HandleReloadVehicleTemplateAccessoryCommand(handler, "");
@@ -397,6 +400,14 @@ public:
return true;
}
+ static bool HandleReloadCreatureSummonGroupsCommand(ChatHandler* handler, const char* /*args*/)
+ {
+ sLog->outInfo(LOG_FILTER_GENERAL, "Reloading creature summon groups...");
+ sObjectMgr->LoadTempSummons();
+ handler->SendGlobalGMSysMessage("DB table `creature_summon_groups` reloaded.");
+ return true;
+ }
+
static bool HandleReloadCreatureTemplateCommand(ChatHandler* handler, const char* args)
{
if (!*args)