mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-17 13:39:46 -04:00
Merge branch '3.3.5-bossboundary' into 3.3.5-base (PR #16089)
(cherry picked from commit 5b8b8c6530)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user