aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Accounts/RBAC.h11
-rw-r--r--src/server/game/Globals/ObjectMgr.h2
-rw-r--r--src/server/game/Maps/Map.h6
-rw-r--r--src/server/scripts/Commands/cs_list.cpp51
4 files changed, 56 insertions, 14 deletions
diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h
index 8fc5f220d43..cf2d1f3f409 100644
--- a/src/server/game/Accounts/RBAC.h
+++ b/src/server/game/Accounts/RBAC.h
@@ -761,16 +761,17 @@ enum RBACPermissions
RBAC_PERM_COMMAND_RELOAD_CONVERSATION_TEMPLATE = 853, // not on 3.3.5a
RBAC_PERM_COMMAND_DEBUG_CONVERSATION = 854, // not on 3.3.5a
RBAC_PERM_COMMAND_DEBUG_PLAY_MUSIC = 855,
- RBAC_PERM_COMMAND_NPC_SPAWNGROUP = 856, // reserved for dynamic_spawning
- RBAC_PERM_COMMAND_NPC_DESPAWNGROUP = 857, // reserved for dynamic_spawning
- RBAC_PERM_COMMAND_GOBJECT_SPAWNGROUP = 858, // reserved for dynamic_spawning
- RBAC_PERM_COMMAND_GOBJECT_DESPAWNGROUP = 859, // reserved for dynamic_spawning
- RBAC_PERM_COMMAND_LIST_RESPAWNS = 860, // reserved for dynamic_spawning
+ RBAC_PERM_COMMAND_NPC_SPAWNGROUP = 856,
+ RBAC_PERM_COMMAND_NPC_DESPAWNGROUP = 857,
+ RBAC_PERM_COMMAND_GOBJECT_SPAWNGROUP = 858,
+ RBAC_PERM_COMMAND_GOBJECT_DESPAWNGROUP = 859,
+ RBAC_PERM_COMMAND_LIST_RESPAWNS = 860,
RBAC_PERM_COMMAND_GROUP_SET = 861,
RBAC_PERM_COMMAND_GROUP_ASSISTANT = 862,
RBAC_PERM_COMMAND_GROUP_MAINTANK = 863,
RBAC_PERM_COMMAND_GROUP_MAINASSIST = 864,
RBAC_PERM_COMMAND_NPC_SHOWLOOT = 865,
+ RBAC_PERM_COMMAND_LIST_SPAWNPOINTS = 866,
// custom permissions 1000+
RBAC_PERM_MAX
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 7c28b21ebea..97a030738ce 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -1281,6 +1281,7 @@ class TC_GAME_API ObjectMgr
return nullptr;
}
void OnDeleteSpawnData(SpawnData const* data);
+ CreatureDataContainer const& GetAllCreatureData() const { return _creatureDataStore; }
CreatureData const* GetCreatureData(ObjectGuid::LowType guid) const
{
CreatureDataContainer::const_iterator itr = _creatureDataStore.find(guid);
@@ -1301,6 +1302,7 @@ class TC_GAME_API ObjectMgr
if (itr == _creatureLocaleStore.end()) return nullptr;
return &itr->second;
}
+ GameObjectDataContainer const& GetAllGameObjectData() const { return _gameObjectDataStore; }
GameObjectData const* GetGameObjectData(ObjectGuid::LowType guid) const
{
GameObjectDataContainer::const_iterator itr = _gameObjectDataStore.find(guid);
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index d7613f79de5..7488e8660ac 100644
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -389,11 +389,11 @@ class TC_GAME_API Map : public GridRefManager<NGridType>
bool GetAreaInfo(float x, float y, float z, uint32& mogpflags, int32& adtId, int32& rootId, int32& groupId) const;
uint32 GetAreaId(float x, float y, float z, bool *isOutdoors = nullptr) const;
- uint32 GetAreaId(Position const& pos) { return GetAreaId(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); }
+ uint32 GetAreaId(Position const& pos) const { return GetAreaId(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); }
uint32 GetZoneId(float x, float y, float z) const;
- uint32 GetZoneId(Position const& pos) { return GetZoneId(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); }
+ uint32 GetZoneId(Position const& pos) const { return GetZoneId(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); }
void GetZoneAndAreaId(uint32& zoneid, uint32& areaid, float x, float y, float z) const;
- void GetZoneAndAreaId(uint32& zoneid, uint32& areaid, Position const& pos) { GetZoneAndAreaId(zoneid, areaid, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); }
+ void GetZoneAndAreaId(uint32& zoneid, uint32& areaid, Position const& pos) const { GetZoneAndAreaId(zoneid, areaid, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ()); }
bool IsOutdoors(float x, float y, float z) const;
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp
index 0885227eb4d..4c77bb92e14 100644
--- a/src/server/scripts/Commands/cs_list.cpp
+++ b/src/server/scripts/Commands/cs_list.cpp
@@ -48,12 +48,13 @@ public:
{
static std::vector<ChatCommand> listCommandTable =
{
- { "creature", rbac::RBAC_PERM_COMMAND_LIST_CREATURE, true, &HandleListCreatureCommand, "" },
- { "item", rbac::RBAC_PERM_COMMAND_LIST_ITEM, true, &HandleListItemCommand, "" },
- { "object", rbac::RBAC_PERM_COMMAND_LIST_OBJECT, true, &HandleListObjectCommand, "" },
- { "auras", rbac::RBAC_PERM_COMMAND_LIST_AURAS, false, &HandleListAurasCommand, "" },
- { "mail", rbac::RBAC_PERM_COMMAND_LIST_MAIL, true, &HandleListMailCommand, "" },
- { "respawns", rbac::RBAC_PERM_COMMAND_LIST_MAIL, false, &HandleListRespawnsCommand, "" },
+ { "creature", rbac::RBAC_PERM_COMMAND_LIST_CREATURE, true, &HandleListCreatureCommand, "" },
+ { "item", rbac::RBAC_PERM_COMMAND_LIST_ITEM, true, &HandleListItemCommand, "" },
+ { "object", rbac::RBAC_PERM_COMMAND_LIST_OBJECT, true, &HandleListObjectCommand, "" },
+ { "auras", rbac::RBAC_PERM_COMMAND_LIST_AURAS, false, &HandleListAurasCommand, "" },
+ { "mail", rbac::RBAC_PERM_COMMAND_LIST_MAIL, true, &HandleListMailCommand, "" },
+ { "spawnpoints", rbac::RBAC_PERM_COMMAND_LIST_SPAWNPOINTS, false, &HandleListSpawnPointsCommand, "" },
+ { "respawns", rbac::RBAC_PERM_COMMAND_LIST_RESPAWNS, false, &HandleListRespawnsCommand, "" },
};
static std::vector<ChatCommand> commandTable =
{
@@ -644,6 +645,44 @@ public:
return true;
}
+ static bool HandleListSpawnPointsCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Player const* player = handler->GetSession()->GetPlayer();
+ if (!player)
+ return false;
+ Map const* map = player->GetMap();
+ if (!map)
+ return false;
+
+ LocaleConstant const locale = handler->GetSession()->GetSessionDbcLocale();
+ uint32 const mapId = map->GetId();
+ bool const showAll = map->IsBattlegroundOrArena() || map->IsDungeon();
+ handler->PSendSysMessage("Listing all spawn points in map %u (%s)%s:", mapId, map->GetMapName(), showAll ? "" : " within 5000yd");
+ for (auto const& pair : sObjectMgr->GetAllCreatureData())
+ {
+ SpawnData const& data = pair.second;
+ if (data.spawnPoint.GetMapId() != mapId)
+ continue;
+ CreatureTemplate const* cTemp = sObjectMgr->GetCreatureTemplate(data.id);
+ if (!cTemp)
+ continue;
+ if (showAll || data.spawnPoint.IsInDist2d(player, 5000.0))
+ handler->PSendSysMessage("Type: %u | SpawnId: %u | Entry: %u (%s) | X: %.3f | Y: %.3f | Z: %.3f", uint32(data.type), data.spawnId, data.id, cTemp->Name.c_str(), data.spawnPoint.GetPositionX(), data.spawnPoint.GetPositionY(), data.spawnPoint.GetPositionZ());
+ }
+ for (auto const& pair : sObjectMgr->GetAllGameObjectData())
+ {
+ SpawnData const& data = pair.second;
+ if (data.spawnPoint.GetMapId() != mapId)
+ continue;
+ GameObjectTemplate const* goTemp = sObjectMgr->GetGameObjectTemplate(data.id);
+ if (!goTemp)
+ continue;
+ if (showAll || data.spawnPoint.IsInDist2d(player, 5000.0))
+ handler->PSendSysMessage("Type: %u | SpawnId: %u | Entry: %u (%s) | X: %.3f | Y: %.3f | Z: %.3f", uint32(data.type), data.spawnId, data.id, goTemp->name.c_str(), data.spawnPoint.GetPositionX(), data.spawnPoint.GetPositionY(), data.spawnPoint.GetPositionZ());
+ }
+ return true;
+ }
+
static char const* GetZoneName(uint32 zoneId, LocaleConstant locale)
{
AreaTableEntry const* zoneEntry = sAreaTableStore.LookupEntry(zoneId);