aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
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 bfc01932061..9902b83ff63 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -93,6 +93,7 @@ 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, "" }
};
static std::vector<ChatCommand> commandTable =
{
@@ -1414,6 +1415,33 @@ public:
handler->PSendSysMessage("Cells loaded (mapId: %u) After load - Next GameObject %u, Creature %u", map->GetId(), map->GetMaxLowGuid<HighGuid::GameObject>(), map->GetMaxLowGuid<HighGuid::Unit>());
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;
+ }
};
void AddSC_debug_commandscript()