From 4e6ea306f575fc50afc60b871cfce2bb30ed57d8 Mon Sep 17 00:00:00 2001 From: Karrz1 <127596890+Karrz1@users.noreply.github.com> Date: Thu, 12 Nov 2026 19:16:21 +0000 Subject: [PATCH] Bots: .playerbot groundz lists the standing surfaces under a point Incinerator Gar'im stands high in the canyon wall of Render's Valley (Discord 2026-11-04). To choose or check a spawn height from the console, with no player or bot on the map, the new command lists every surface under a point from the top down: terrain plus building and cave geometry, so a ledge, a cave floor and the valley floor each show as their own line. (cherry picked from commit 3628a1e631c0b973e438c63d00ce1ed51d90e893) --- .../PlayerbotV2/Commands/cs_playerbot_v2.cpp | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/modules/PlayerbotV2/Commands/cs_playerbot_v2.cpp b/src/modules/PlayerbotV2/Commands/cs_playerbot_v2.cpp index 4471011675..d49b95d97b 100644 --- a/src/modules/PlayerbotV2/Commands/cs_playerbot_v2.cpp +++ b/src/modules/PlayerbotV2/Commands/cs_playerbot_v2.cpp @@ -648,6 +648,7 @@ public: { "casttest", HandleCastTest, rbac::RBAC_PERM_COMMAND_GM, Console::Yes }, { "xpprobe", HandleXpProbe, rbac::RBAC_PERM_COMMAND_GM, Console::Yes }, { "questchainprobe", HandleQuestChainProbe, rbac::RBAC_PERM_COMMAND_GM, Console::Yes }, + { "groundz", HandleGroundZ, rbac::RBAC_PERM_COMMAND_GM, Console::Yes }, { "formprobe", HandleFormProbe, rbac::RBAC_PERM_COMMAND_GM, Console::Yes }, { "equipprobe", HandleEquipProbe, rbac::RBAC_PERM_COMMAND_GM, Console::Yes }, { "gearpick", HandleGearPick, rbac::RBAC_PERM_COMMAND_GM, Console::Yes }, @@ -5280,6 +5281,36 @@ public: return true; } + // .playerbot groundz [] + // Lists every standing surface under a point, top down (terrain .map plus VMap: ledges, cave roofs and floors, the valley + // floor), with no player or bot needed, so a spawn's height can be checked or chosen from the console. A creature spawned off + // these surfaces floats or sits inside the rock (Incinerator Gar'im, 2026-11-04). + static bool HandleGroundZ(ChatHandler* handler, uint32 mapId, float x, float y, Optional fromZ) + { + if (!sMapStore.LookupEntry(mapId) || !Trinity::IsValidMapCoord(x, y)) + { + handler->SendSysMessage("groundz: no such map or point"); + handler->SetSentErrorMessage(true); + return false; + } + + std::shared_ptr terrain = sTerrainMgr.LoadTerrain(mapId); + PhaseShift const& phaseShift = PhasingHandler::GetEmptyPhaseShift(); + float const gridZ = terrain->GetGridHeight(phaseShift, mapId, x, y); + handler->PSendSysMessage("groundz: map %u (%.2f, %.2f) terrain (.map) %.2f", mapId, x, y, gridZ); + + float z = fromZ.value_or(2000.0f); + for (uint32 i = 1; i <= 10; ++i) + { + float const surface = terrain->GetStaticHeight(phaseShift, mapId, x, y, z, true, 4000.0f); + if (surface <= INVALID_HEIGHT) + break; + handler->PSendSysMessage("groundz: surface %u at %.2f", i, surface); + z = surface - 3.0f; // under this floor, down to the next one + } + return true; + } + // .playerbot questchainprobe // Walks a quest chain the way a player meets it: for each quest it reports who starts it (creatures, objects, items), every // requirement check the player fails, then takes, completes and rewards it and looks for what comes next (the reward's next