40#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
41#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
51 std::span<ChatCommandBuilder const>
GetCommands()
const override
82 if (!player || !target)
88 char* para = strtok((
char*)args,
" ");
90 bool useStraightPath =
false;
91 if (para && strcmp(para,
"true") == 0)
92 useStraightPath =
true;
94 bool useRaycast =
false;
95 if (para && (strcmp(para,
"line") == 0 || strcmp(para,
"ray") == 0 || strcmp(para,
"raycast") == 0))
110 handler->
PSendSysMessage(
"Building: %s", useStraightPath ?
"StraightPath" : useRaycast ?
"Raycast" :
"SmoothPath");
111 handler->
PSendSysMessage(
"Result: %s - Length: %zu - Type: %u", (result ?
"true" :
"false"), pointPath.size(), path.
GetPathType());
117 handler->
PSendSysMessage(
"StartPosition (%.3f, %.3f, %.3f)", start.x, start.y, start.z);
118 handler->
PSendSysMessage(
"EndPosition (%.3f, %.3f, %.3f)", end.x, end.y, end.z);
119 handler->
PSendSysMessage(
"ActualEndPosition (%.3f, %.3f, %.3f)", actualEnd.x, actualEnd.y, actualEnd.z);
124 for (
uint32 i = 0; i < pointPath.size(); ++i)
146 handler->
PSendSysMessage(
"%04u_%02i_%02i.mmtile", terrainMapId, gx, gy);
151 if (!navmesh || !navmeshquery)
157 float const* min = navmesh->getParams()->orig;
167 dtQueryFilter filter = dtQueryFilter();
169 if (dtStatusFailed(navmeshquery->findNearestPoly(location, extents, &filter, &polyRef,
nullptr)))
171 handler->
PSendSysMessage(
"Dt [??,??] (invalid poly, probably no tile loaded)");
176 handler->
PSendSysMessage(
"Dt [??, ??] (invalid poly, probably no tile loaded)");
179 dtMeshTile
const* tile;
181 if (dtStatusSucceed(navmesh->getTileAndPolyByRef(polyRef, &tile, &poly)))
185 handler->
PSendSysMessage(
"Dt [%02i,%02i]", tile->header->x, tile->header->y);
202 if (!navmesh || !navmeshquery)
210 for (
int32 i = 0; i < navmesh->getMaxTiles(); ++i)
212 dtMeshTile
const* tile = navmesh->getTile(i);
213 if (!tile || !tile->header)
216 handler->
PSendSysMessage(
"[%02i, %02i]", tile->header->x, tile->header->y);
246 for (
int32 i = 0; i < navmesh->getMaxTiles(); ++i)
248 dtMeshTile
const* tile = navmesh->getTile(i);
249 if (!tile || !tile->header)
253 nodeCount += tile->header->bvNodeCount;
254 polyCount += tile->header->polyCount;
255 vertCount += tile->header->vertCount;
256 triCount += tile->header->detailTriCount;
257 triVertCount += tile->header->detailVertCount;
258 dataSize += tile->dataSize;
264 handler->
PSendSysMessage(
" %u polygons (%u vertices)", polyCount, vertCount);
265 handler->
PSendSysMessage(
" %u triangles (%u vertices)", triCount, triVertCount);
266 handler->
PSendSysMessage(
" %.2f MB of data (not including pointers)", ((
float)dataSize /
sizeof(
unsigned char)) / 1048576);
273 float radius = 40.0f;
277 std::list<Creature*> creatureList;
282 if (!creatureList.empty())
290 object->GetPosition(gx, gy, gz);
291 for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
299 handler->
PSendSysMessage(
"Generated %i paths in %i ms", paths, uPathLoadTime);
@ TEMPSUMMON_TIMED_DESPAWN
Role Based Access Control related classes definition.
uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
WorldSession * GetSession()
void PSendSysMessage(char const *fmt, Args &&... args)
uint32 getLoadedMapsCount() const
static MMapManager * instance()
dtNavMesh * GetNavMesh(uint32 mapId, uint32 instanceId)
dtNavMeshQuery const * GetNavMeshQuery(uint32 meshMapId, uint32 instanceMapId, uint32 instanceId)
uint32 getLoadedTilesCount() const
TerrainInfo * GetTerrain() const
void SetUseRaycast(bool useRaycast)
Movement::PointsArray const & GetPath() const
G3D::Vector3 const & GetStartPosition() const
PathType GetPathType() const
G3D::Vector3 const & GetEndPosition() const
bool CalculatePath(float srcX, float srcY, float srcZ, float destX, float destY, float destZ, bool forceDest=false)
void SetUseStraightPath(bool useStraightPath)
G3D::Vector3 const & GetActualEndPosition() const
static uint32 GetTerrainMapId(PhaseShift const &phaseShift, uint32 mapId, TerrainInfo const *terrain, float x, float y)
bool IsGameMaster() const
constexpr uint32 GetMapId() const
TempSummon * SummonCreature(uint32 entry, Position const &pos, TempSummonType despawnType=TEMPSUMMON_MANUAL_DESPAWN, Milliseconds despawnTime=0s, uint32 vehId=0, uint32 spellId=0, ObjectGuid privateObjectOwner=ObjectGuid::Empty)
PhaseShift & GetPhaseShift()
uint32 GetInstanceId() const
std::string const & GetName() const
Player * GetPlayer() const
std::span< ChatCommandBuilder const > GetCommands() const override
static bool HandleMmapTestArea(ChatHandler *handler, char const *)
static bool HandleMmapLocCommand(ChatHandler *handler, char const *)
static bool HandleMmapPathCommand(ChatHandler *handler, char const *args)
static bool HandleMmapStatsCommand(ChatHandler *handler, char const *)
static bool HandleMmapLoadedTilesCommand(ChatHandler *handler, char const *)
void AddSC_mmaps_commandscript()
bool IsPathfindingEnabled(uint32 mapId)
std::vector< Vector3 > PointsArray
ChatCommandBuilder const [] ChatCommandTable
@ RBAC_PERM_COMMAND_MMAP_LOC
@ RBAC_PERM_COMMAND_MMAP_TESTAREA
@ RBAC_PERM_COMMAND_MMAP_STATS
@ RBAC_PERM_COMMAND_MMAP_LOADEDTILES
@ RBAC_PERM_COMMAND_MMAP_PATH
static void VisitGridObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
constexpr float GetPositionX() const
constexpr float GetPositionY() const
constexpr void GetPosition(float &x, float &y) const