Merge branch '3.3.5-bossboundary' into 3.3.5-base (PR #16089)

(cherry picked from commit 5b8b8c6530)
This commit is contained in:
treeston
2016-01-13 15:33:17 +01:00
committed by Shauren
parent 78885769cb
commit e2f2c70ba4
136 changed files with 1008 additions and 555 deletions
+28
View File
@@ -98,6 +98,7 @@ 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, "" }
};
static std::vector<ChatCommand> commandTable =
{
@@ -1419,6 +1420,33 @@ public:
return true;
}
static bool HandleDebugBoundaryCommand(ChatHandler* handler, char const* args)
{
Player* player = handler->GetSession()->GetPlayer();
if (!player)
return false;
Creature* target = handler->getSelectedCreature();
if (!target || !target->IsAIEnabled || !target->AI())
{
return false;
}
char* fill_str = args ? strtok((char*)args, " ") : nullptr;
char* duration_str = args ? strtok(nullptr, " ") : nullptr;
int duration = duration_str ? atoi(duration_str) : -1;
if (duration <= 0 || duration >= 30 * MINUTE) // arbitary upper limit
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);
return true;
}
static bool HandleDebugPhaseCommand(ChatHandler* handler, char const* /*args*/)
{
Unit* target = handler->getSelectedUnit();