Merge branch '3.3.5-instanceextend' into 3.3.5 (PR #16392)

(cherry picked from commit 62aff401f687b56d720a320778950e82b65fbd8b)
This commit is contained in:
Shauren
2016-04-05 20:35:59 +02:00
parent 6d2dd48183
commit 4e67383621
17 changed files with 229 additions and 75 deletions
+29 -2
View File
@@ -98,7 +98,8 @@ public:
{ "transport", rbac::RBAC_PERM_COMMAND_DEBUG_TRANSPORT, false, &HandleDebugTransportCommand, "" },
{ "loadcells", rbac::RBAC_PERM_COMMAND_DEBUG_LOADCELLS, false, &HandleDebugLoadCellsCommand, "",},
{ "phase", rbac::RBAC_PERM_COMMAND_DEBUG_PHASE, false, &HandleDebugPhaseCommand, "" },
{ "boundary", rbac::RBAC_PERM_COMMAND_DEBUG_BOUNDARY, false, &HandleDebugBoundaryCommand, "" }
{ "boundary", rbac::RBAC_PERM_COMMAND_DEBUG_BOUNDARY, false, &HandleDebugBoundaryCommand, "" },
{ "raidreset", rbac::RBAC_PERM_COMMAND_INSTANCE_UNBIND, false, &HandleDebugRaidResetCommand, "" }
};
static std::vector<ChatCommand> commandTable =
{
@@ -1439,7 +1440,7 @@ public:
duration = 3 * MINUTE;
bool doFill = fill_str ? (stricmp(fill_str, "FILL") == 0) : false;
int32 errMsg = target->AI()->VisualizeBoundary(duration, player, doFill);
if (errMsg > 0)
handler->PSendSysMessage(errMsg);
@@ -1522,6 +1523,32 @@ public:
return true;
}
static bool HandleDebugRaidResetCommand(ChatHandler* /*handler*/, char const* args)
{
char* map_str = args ? strtok((char*)args, " ") : nullptr;
char* difficulty_str = args ? strtok(nullptr, " ") : nullptr;
int32 map = map_str ? atoi(map_str) : -1;
if (map <= 0)
return false;
MapEntry const* mEntry = sMapStore.LookupEntry(map);
if (!mEntry || !mEntry->IsRaid())
return false;
int32 difficulty = difficulty_str ? atoi(difficulty_str) : -1;
if (difficulty >= MAX_DIFFICULTY || difficulty < -1)
return false;
if (difficulty == -1)
for (uint8 diff = 0; diff < MAX_DIFFICULTY; ++diff)
{
if (GetMapDifficultyData(mEntry->ID, Difficulty(diff)))
sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(diff));
}
else
sInstanceSaveMgr->ForceGlobalReset(mEntry->ID, Difficulty(difficulty));
return true;
}
};
void AddSC_debug_commandscript()