refactor(Scripts/VioletHold): Modernize Violet Hold dungeon scripts (#25187)

Co-authored-by: joschiwald <joschiwald@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Andrew
2026-04-11 13:02:28 -03:00
committed by GitHub
parent 25b928b094
commit 272da9fbad
12 changed files with 1745 additions and 2222 deletions
+5 -4
View File
@@ -1810,12 +1810,13 @@ void Map::RemoveAllObjectsInRemoveList()
}
}
uint32 Map::GetPlayersCountExceptGMs() const
uint32 Map::GetPlayersCountExceptGMs(bool aliveOnly /*= false*/) const
{
uint32 count = 0;
for (MapRefMgr::const_iterator itr = m_mapRefMgr.begin(); itr != m_mapRefMgr.end(); ++itr)
if (!itr->GetSource()->IsGameMaster())
++count;
for (auto const& ref : m_mapRefMgr)
if (Player* player = ref.GetSource())
if (!player->IsGameMaster() && (!aliveOnly || (player->IsAlive() && !player->HasSpiritOfRedemptionAura())))
++count;
return count;
}
+2 -1
View File
@@ -318,7 +318,8 @@ public:
void markCell(uint32 pCellId) { marked_cells.set(pCellId); }
[[nodiscard]] bool HavePlayers() const { return !m_mapRefMgr.IsEmpty(); }
[[nodiscard]] uint32 GetPlayersCountExceptGMs() const;
// When aliveOnly is true, counts only players that are alive and not in Spirit of Redemption form.
[[nodiscard]] uint32 GetPlayersCountExceptGMs(bool aliveOnly = false) const;
void SendToPlayers(WorldPacket const* data) const;