aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2016-01-13 15:33:17 +0100
committerShauren <shauren.trinity@gmail.com>2016-03-22 22:56:43 +0100
commite2f2c70ba4ee0205dbe7f6ebb81e79dd0872d9e8 (patch)
tree462105f4bd862b5b2d0a761aa6c5912151bda68a /src/server/scripts/Commands
parent78885769cbc52940993064b34f347e50c018dd52 (diff)
Merge branch '3.3.5-bossboundary' into 3.3.5-base (PR #16089)
(cherry picked from commit 5b8b8c653039ec2add0b3a66468abb85e6f35054)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index dc2baa57e5f..8be6e029cf0 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -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();