Script/Commands: Make creature_summon_groups table reloadable.

This commit is contained in:
horn
2013-02-24 23:25:17 +01:00
parent cb99c1d16a
commit c34f1aebe6
3 changed files with 17 additions and 0 deletions

View File

@@ -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.');

View File

@@ -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");

View File

@@ -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)