38#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
39#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
49 static std::vector<ChatCommand> mmapCommandTable =
58 static std::vector<ChatCommand> commandTable =
78 if (!player || !target)
84 char* para = strtok((
char*)args,
" ");
86 bool useStraightPath =
false;
87 if (para && strcmp(para,
"true") == 0)
88 useStraightPath =
true;
90 bool useRaycast =
false;
91 if (para && (strcmp(para,
"line") == 0 || strcmp(para,
"ray") == 0 || strcmp(para,
"raycast") == 0))
106 handler->
PSendSysMessage(
"Building: %s", useStraightPath ?
"StraightPath" : useRaycast ?
"Raycast" :
"SmoothPath");
107 handler->
PSendSysMessage(
"Result: %s - Length: %zu - Type: %u", (result ?
"true" :
"false"), pointPath.size(), path.
GetPathType());
113 handler->
PSendSysMessage(
"StartPosition (%.3f, %.3f, %.3f)", start.x, start.y, start.z);
114 handler->
PSendSysMessage(
"EndPosition (%.3f, %.3f, %.3f)", end.x, end.y, end.z);
115 handler->
PSendSysMessage(
"ActualEndPosition (%.3f, %.3f, %.3f)", actualEnd.x, actualEnd.y, actualEnd.z);
120 for (
uint32 i = 0; i < pointPath.size(); ++i)
142 if (!navmesh || !navmeshquery)
148 float const* min = navmesh->getParams()->orig;
160 dtQueryFilter filter = dtQueryFilter();
162 if (dtStatusFailed(navmeshquery->findNearestPoly(location, extents, &filter, &polyRef,
nullptr)))
164 handler->
PSendSysMessage(
"Dt [??,??] (invalid poly, probably no tile loaded)");
169 handler->
PSendSysMessage(
"Dt [??, ??] (invalid poly, probably no tile loaded)");
172 dtMeshTile
const* tile;
174 if (dtStatusSucceed(navmesh->getTileAndPolyByRef(polyRef, &tile, &poly)))
178 handler->
PSendSysMessage(
"Dt [%02i,%02i]", tile->header->x, tile->header->y);
194 if (!navmesh || !navmeshquery)
202 for (
int32 i = 0; i < navmesh->getMaxTiles(); ++i)
204 dtMeshTile
const* tile = navmesh->getTile(i);
205 if (!tile || !tile->header)
208 handler->
PSendSysMessage(
"[%02i, %02i]", tile->header->x, tile->header->y);
237 for (
int32 i = 0; i < navmesh->getMaxTiles(); ++i)
239 dtMeshTile
const* tile = navmesh->getTile(i);
240 if (!tile || !tile->header)
244 nodeCount += tile->header->bvNodeCount;
245 polyCount += tile->header->polyCount;
246 vertCount += tile->header->vertCount;
247 triCount += tile->header->detailTriCount;
248 triVertCount += tile->header->detailVertCount;
249 dataSize += tile->dataSize;
255 handler->
PSendSysMessage(
" %u polygons (%u vertices)", polyCount, vertCount);
256 handler->
PSendSysMessage(
" %u triangles (%u vertices)", triCount, triVertCount);
257 handler->
PSendSysMessage(
" %.2f MB of data (not including pointers)", ((
float)dataSize /
sizeof(
unsigned char)) / 1048576);
264 float radius = 40.0f;
268 std::list<Creature*> creatureList;
273 if (!creatureList.empty())
281 object->GetPosition(gx, gy, gz);
282 for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
290 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)
static MMapManager * createOrGetMMapManager()
uint32 getLoadedMapsCount() const
dtNavMeshQuery const * GetNavMeshQuery(uint32 mapId, uint32 instanceId)
dtNavMesh const * GetNavMesh(uint32 mapId)
uint32 getLoadedTilesCount() 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 destX, float destY, float destZ, bool forceDest=false)
void SetUseStraightPath(bool useStraightPath)
G3D::Vector3 const & GetActualEndPosition() const
bool IsGameMaster() 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)
uint32 GetInstanceId() const
std::string const & GetName() const
Player * GetPlayer() const
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 *)
std::vector< ChatCommand > GetCommands() const override
void AddSC_mmaps_commandscript()
bool IsPathfindingEnabled(uint32 mapId)
std::vector< Vector3 > PointsArray
@ 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)
float GetPositionX() const
void GetPosition(float &x, float &y) const
float GetPositionY() const