mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 01:29:07 +00:00
feat(Scripts/Commands): .debug boundary to visualize CreatureBoundary (#22099)
Co-authored-by: avarishd <46330494+avarishd@users.noreply.github.com> Co-authored-by: treeston <treeston.mmoc@gmail.com>
This commit is contained in:
@@ -105,7 +105,8 @@ public:
|
||||
{ "unitstate", HandleDebugUnitStateCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "objectcount", HandleDebugObjectCountCommand, SEC_ADMINISTRATOR, Console::Yes},
|
||||
{ "dummy", HandleDebugDummyCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "mapdata", HandleDebugMapDataCommand, SEC_ADMINISTRATOR, Console::No }
|
||||
{ "mapdata", HandleDebugMapDataCommand, SEC_ADMINISTRATOR, Console::No },
|
||||
{ "boundary", HandleDebugBoundaryCommand, SEC_ADMINISTRATOR, Console::No }
|
||||
};
|
||||
static ChatCommandTable commandTable =
|
||||
{
|
||||
@@ -1388,6 +1389,27 @@ public:
|
||||
handler->PSendSysMessage("Created Cells In Map: {} / {}", map->GetCreatedCellsInMapCount(), TOTAL_NUMBER_OF_CELLS_PER_MAP * TOTAL_NUMBER_OF_CELLS_PER_MAP);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDebugBoundaryCommand(ChatHandler* handler, Optional<uint32> durationArg, Optional<EXACT_SEQUENCE("fill")> fill, Optional<EXACT_SEQUENCE("z")> checkZ)
|
||||
{
|
||||
Player* player = handler->GetPlayer();
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
Creature* target = handler->getSelectedCreature();
|
||||
if (!target || !target->IsAIEnabled)
|
||||
return false;
|
||||
|
||||
uint32 duration = durationArg.value_or(5 * IN_MILLISECONDS);
|
||||
if (duration > 180 * IN_MILLISECONDS) // arbitrary upper limit
|
||||
duration = 180 * IN_MILLISECONDS;
|
||||
|
||||
int32 errMsg = target->AI()->VisualizeBoundary(duration, player, fill.has_value(), checkZ.has_value());
|
||||
if (errMsg > 0)
|
||||
handler->PSendSysMessage(errMsg);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_debug_commandscript()
|
||||
|
||||
Reference in New Issue
Block a user