Maps/Instances: Implement handling of CMSG_SET_SAVED_INSTANCE_EXTEND

This commit is contained in:
treeston committed 2016-02-10 19:35:11 +01:00
1 parent cfed2d7a3d
commit 6102a7937d
17 files changed
+232 -77

No files matched your search

+28 -1
View File
@@ -93,7 +93,8 @@ public:
{ "moveflags", rbac::RBAC_PERM_COMMAND_DEBUG_MOVEFLAGS, false, &HandleDebugMoveflagsCommand, "" },
{ "transport", rbac::RBAC_PERM_COMMAND_DEBUG_TRANSPORT, false, &HandleDebugTransportCommand, "" },
{ "loadcells", rbac::RBAC_PERM_COMMAND_DEBUG_LOADCELLS, false, &HandleDebugLoadCellsCommand, "" },
{ "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 =
{
@@ -1442,6 +1443,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_RAID_DIFFICULTY || difficulty < -1)
return false;
if (difficulty == -1)
for (uint8 diff = 0; diff < MAX_RAID_DIFFICULTY; ++diff)
{
if (GetMapDifficultyData(mEntry->MapID, Difficulty(diff)))
sInstanceSaveMgr->ForceGlobalReset(mEntry->MapID, Difficulty(diff));
}
else
sInstanceSaveMgr->ForceGlobalReset(mEntry->MapID, Difficulty(difficulty));
return true;
}
};
void AddSC_debug_commandscript()