AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
BattlegroundRV Class Reference

#include "BattlegroundRV.h"

Inheritance diagram for BattlegroundRV:
Arena Battleground

Public Member Functions

 BattlegroundRV ()
 
void StartingEventOpenDoors () override
 
void Init () override
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet) override
 
void HandleAreaTrigger (Player *player, uint32 trigger) override
 
bool SetupBattleground () override
 
bool HandlePlayerUnderMap (Player *player) override
 
GameObjectGetPillarAtPosition (Position *p)
 
- Public Member Functions inherited from Battleground
 Battleground ()
 
virtual ~Battleground ()
 
void Update (uint32 diff)
 
virtual void StartingEventCloseDoors ()
 
virtual void ResetBGSubclass ()
 
virtual void DestroyGate (Player *, GameObject *)
 
virtual bool AllNodesConrolledByTeam (TeamId) const
 
void StartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
std::string GetName () const
 
BattlegroundTypeId GetBgTypeID (bool GetRandom=false) const
 
BattlegroundBracketId GetBracketId () const
 
uint32 GetInstanceID () const
 
BattlegroundStatus GetStatus () const
 
uint32 GetClientInstanceID () const
 
uint32 GetStartTime () const
 
uint32 GetEndTime () const
 
uint32 GetLastResurrectTime () const
 
uint32 GetMinLevel () const
 
uint32 GetMaxLevel () const
 
bool isTemplate () const
 
bool isMaxLevel () const
 
uint32 GetMaxPlayersPerTeam () const
 
uint32 GetMinPlayersPerTeam () const
 
int32 GetStartDelayTime () const
 
uint8 GetArenaType () const
 
PvPTeamId GetWinner () const
 
uint32 GetScriptId () const
 
uint32 GetBonusHonorFromKill (uint32 kills) const
 
void SpiritOfCompetitionEvent (PvPTeamId winnerTeamId) const
 
bool IsRandom ()
 
void SetName (std::string_view name)
 
void SetBgTypeID (BattlegroundTypeId TypeID)
 
void SetRandomTypeID (BattlegroundTypeId TypeID)
 
void SetBracket (PvPDifficultyEntry const *bracketEntry)
 
void SetInstanceID (uint32 InstanceID)
 
void SetStatus (BattlegroundStatus Status)
 
void SetClientInstanceID (uint32 InstanceID)
 
void SetStartTime (uint32 Time)
 
void SetEndTime (uint32 Time)
 
void SetLastResurrectTime (uint32 Time)
 
void SetLevelRange (uint32 min, uint32 max)
 
void SetRated (bool state)
 
void SetArenaType (uint8 type)
 
void SetArenaorBGType (bool _isArena)
 
void SetWinner (PvPTeamId winner)
 
void SetScriptId (uint32 scriptId)
 
void SetRandom (bool isRandom)
 
void ModifyStartDelayTime (int32 diff)
 
void SetStartDelayTime (int32 Time)
 
void SetMaxPlayersPerTeam (uint32 MaxPlayers)
 
void SetMinPlayersPerTeam (uint32 MinPlayers)
 
void AddToBGFreeSlotQueue ()
 
void RemoveFromBGFreeSlotQueue ()
 
void DecreaseInvitedCount (TeamId teamId)
 
void IncreaseInvitedCount (TeamId teamId)
 
uint32 GetInvitedCount (TeamId teamId) const
 
bool HasFreeSlots () const
 
uint32 GetFreeSlotsForTeam (TeamId teamId) const
 
uint32 GetMaxFreeSlots () const
 
void AddSpectator (Player *p)
 
void RemoveSpectator (Player *p)
 
bool HaveSpectators ()
 
const SpectatorListGetSpectators () const
 
void AddToBeTeleported (ObjectGuid spectator, ObjectGuid participant)
 
void RemoveToBeTeleported (ObjectGuid spectator)
 
void SpectatorsSendPacket (WorldPacket &data)
 
bool isArena () const
 
bool isBattleground () const
 
bool isRated () const
 
BattlegroundPlayerMap const & GetPlayers () const
 
uint32 GetPlayersSize () const
 
void ReadyMarkerClicked (Player *p)
 
BattlegroundScoreMap const * GetPlayerScores () const
 
std::size_t GetPlayerScoresSize () const
 
uint32 GetReviveQueueSize () const
 
void AddPlayerToResurrectQueue (ObjectGuid npc_guid, ObjectGuid player_guid)
 
void RemovePlayerFromResurrectQueue (Player *player)
 
void RelocateDeadPlayers (ObjectGuid queueIndex)
 Relocate all players in ReviveQueue to the closest graveyard.
 
void StartBattleground ()
 
GameObjectGetBGObject (uint32 type)
 
CreatureGetBGCreature (uint32 type)
 
void SetMapId (uint32 MapID)
 
uint32 GetMapId () const
 
void SetBgMap (BattlegroundMap *map)
 
BattlegroundMapGetBgMap () const
 
BattlegroundMapFindBgMap () const
 
void SetTeamStartPosition (TeamId teamId, Position const &pos)
 
Position const * GetTeamStartPosition (TeamId teamId) const
 
void SetStartMaxDist (float startMaxDist)
 
float GetStartMaxDist () const
 
void SendPacketToTeam (TeamId teamId, WorldPacket const *packet, Player *sender=nullptr, bool self=true)
 
void SendPacketToAll (WorldPacket const *packet)
 
void YellToAll (Creature *creature, const char *text, uint32 language)
 
void SendChatMessage (Creature *source, uint8 textId, WorldObject *target=nullptr)
 
void SendBroadcastText (uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
 
template<class Do >
void BroadcastWorker (Do &_do)
 
void PlaySoundToAll (uint32 soundId)
 
void CastSpellOnTeam (uint32 spellId, TeamId teamId)
 
void RemoveAuraOnTeam (uint32 spellId, TeamId teamId)
 
void RewardHonorToTeam (uint32 honor, TeamId teamId)
 
void RewardReputationToTeam (uint32 factionId, uint32 reputation, TeamId teamId)
 
uint32 GetRealRepFactionForPlayer (uint32 factionId, Player *player)
 
void UpdateWorldState (uint32 variable, uint32 value)
 
void EndBattleground (PvPTeamId winnerTeamId)
 
void BlockMovement (Player *player)
 
GroupGetBgRaid (TeamId teamId) const
 
void SetBgRaid (TeamId teamId, Group *bg_raid)
 
void BuildPvPLogDataPacket (WorldPacket &data)
 
virtual bool UpdatePlayerScore (Player *player, uint32 type, uint32 value, bool doAddHonor=true)
 
uint32 GetPlayersCountByTeam (TeamId teamId) const
 
uint32 GetAlivePlayersCountByTeam (TeamId teamId) const
 
void UpdatePlayersCountByTeam (TeamId teamId, bool remove)
 
void SetArenaTeamIdForTeam (TeamId teamId, uint32 ArenaTeamId)
 
uint32 GetArenaTeamIdForTeam (TeamId teamId) const
 
void SetArenaMatchmakerRating (TeamId teamId, uint32 MMR)
 
uint32 GetArenaMatchmakerRating (TeamId teamId) const
 
virtual void HandleKillUnit (Creature *, Player *)
 
virtual void EventPlayerDroppedFlag (Player *)
 
virtual void EventPlayerClickedOnFlag (Player *, GameObject *)
 
virtual void EventPlayerDamagedGO (Player *, GameObject *, uint32)
 
virtual void EventPlayerUsedGO (Player *, GameObject *)
 
virtual void DoAction (uint32, ObjectGuid)
 
virtual void HandlePlayerResurrect (Player *)
 
virtual GraveyardStruct const * GetClosestGraveyard (Player *player)
 
void AddOrSetPlayerToCorrectBgGroup (Player *player, TeamId teamId)
 
void HandleTriggerBuff (GameObject *gameObject)
 
void SetHoliday (bool is_holiday)
 
void SpawnBGObject (uint32 type, uint32 respawntime, uint32 forceRespawnDelay=0)
 
bool AddObject (uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime=0, GOState goState=GO_STATE_READY)
 
CreatureAddCreature (uint32 entry, uint32 type, float x, float y, float z, float o, uint32 respawntime=0, MotionTransport *transport=nullptr)
 
bool DelCreature (uint32 type)
 
bool DelObject (uint32 type)
 
bool AddSpiritGuide (uint32 type, float x, float y, float z, float o, TeamId teamId)
 
int32 GetObjectType (ObjectGuid guid)
 
void DoorOpen (uint32 type)
 
void DoorClose (uint32 type)
 
bool IsPlayerInBattleground (ObjectGuid guid) const
 
bool ToBeDeleted () const
 
void RewardXPAtKill (Player *killer, Player *victim)
 
virtual ObjectGuid GetFlagPickerGUID (TeamId=TEAM_NEUTRAL) const
 
virtual void SetDroppedFlagGUID (ObjectGuid, TeamId=TEAM_NEUTRAL)
 
uint32 GetTeamScore (TeamId teamId) const
 
virtual TeamId GetPrematureWinner ()
 
uint8 GetUniqueBracketId () const
 
BattlegroundAVToBattlegroundAV ()
 
BattlegroundAV const * ToBattlegroundAV () const
 
BattlegroundWSToBattlegroundWS ()
 
BattlegroundWS const * ToBattlegroundWS () const
 
BattlegroundABToBattlegroundAB ()
 
BattlegroundAB const * ToBattlegroundAB () const
 
BattlegroundNAToBattlegroundNA ()
 
BattlegroundNA const * ToBattlegroundNA () const
 
BattlegroundBEToBattlegroundBE ()
 
BattlegroundBE const * ToBattlegroundBE () const
 
BattlegroundEYToBattlegroundEY ()
 
BattlegroundEY const * ToBattlegroundEY () const
 
BattlegroundRLToBattlegroundRL ()
 
BattlegroundRL const * ToBattlegroundRL () const
 
BattlegroundSAToBattlegroundSA ()
 
BattlegroundSA const * ToBattlegroundSA () const
 
BattlegroundDSToBattlegroundDS ()
 
BattlegroundDS const * ToBattlegroundDS () const
 
BattlegroundRVToBattlegroundRV ()
 
BattlegroundRV const * ToBattlegroundRV () const
 
BattlegroundICToBattlegroundIC ()
 
BattlegroundIC const * ToBattlegroundIC () const
 

Protected Member Functions

void TeleportUnitToNewZ (Unit *unit, float newZ, bool casting)
 
void CheckPositionForUnit (Unit *unit)
 
void UpdatePillars ()
 
uint32 GetPillarIdForPos (Position *p)
 
- Protected Member Functions inherited from Arena
 Arena ()
 
void AddPlayer (Player *player) override
 
void RemovePlayer (Player *) override
 
void UpdateArenaWorldState ()
 
void HandleKillPlayer (Player *player, Player *killer) override
 
- Protected Member Functions inherited from Battleground
void EndNow ()
 
void PlayerAddedToBGCheckIfBGIsRunning (Player *player)
 
void _ProcessResurrect (uint32 diff)
 
void _ProcessProgress (uint32 diff)
 
void _ProcessLeave (uint32 diff)
 
void _ProcessJoin (uint32 diff)
 
void _CheckSafePositions (uint32 diff)
 

Private Member Functions

void PostUpdateImpl (uint32 diff) override
 Post-update hook.
 

Private Attributes

Milliseconds _timer
 
uint32 _state
 
uint16 _checkPlayersTimer
 

Additional Inherited Members

- Public Types inherited from Battleground
typedef std::set< Player * > SpectatorList
 
typedef std::map< ObjectGuid, ObjectGuidToBeTeleportedMap
 
typedef std::map< ObjectGuid, Player * > BattlegroundPlayerMap
 
typedef std::unordered_map< ObjectGuid::LowType, BattlegroundScore * > BattlegroundScoreMap
 
typedef std::unordered_map< ObjectGuid, ArenaLogEntryDataArenaLogEntryDataMap
 
typedef GuidVector BGObjects
 
typedef GuidVector BGCreatures
 
- Static Public Member Functions inherited from Battleground
static TeamId GetOtherTeamId (TeamId teamId)
 
- Public Attributes inherited from Battleground
GuidSet readyMarkerClickedSet
 
ArenaLogEntryDataMap ArenaLogEntries
 
BGObjects BgObjects
 
BGCreatures BgCreatures
 
- Protected Attributes inherited from Battleground
BattlegroundScoreMap PlayerScores
 
BattlegroundPlayerMap m_Players
 
std::map< ObjectGuid, GuidVectorm_ReviveQueue
 
uint8 m_Events
 
BattlegroundStartTimeIntervals StartDelayTimes [BG_STARTING_EVENT_COUNT]
 
uint32 StartMessageIds [BG_STARTING_EVENT_COUNT]
 
bool m_BuffChange
 
bool m_IsRandom
 
BGHonorMode m_HonorMode
 
int32 m_TeamScores [PVP_TEAMS_COUNT]
 
ArenaTeamScore _arenaTeamScores [PVP_TEAMS_COUNT]
 
uint32 m_UpdateTimer
 
EventProcessor _reviveEvents
 

Detailed Description

Constructor & Destructor Documentation

◆ BattlegroundRV()

BattlegroundRV::BattlegroundRV ( )
33{
35
37 _timer = 0s;
38 _state = 0;
39}
@ BG_RV_OBJECT_MAX
Definition BattlegroundRV.h:48
uint16 _checkPlayersTimer
Definition BattlegroundRV.h:99
Milliseconds _timer
Definition BattlegroundRV.h:97
uint32 _state
Definition BattlegroundRV.h:98
BGObjects BgObjects
Definition Battleground.h:550

References _checkPlayersTimer, _state, _timer, BG_RV_OBJECT_MAX, and Battleground::BgObjects.

Member Function Documentation

◆ CheckPositionForUnit()

void BattlegroundRV::CheckPositionForUnit ( Unit unit)
protected
51{
52 // get height at current pos, if something is wrong (below or high above) - teleport
53 if (!unit->IsFalling() && unit->IsAlive())
54 {
55 float groundZ_vmap = unit->GetMap()->GetHeight(unit->GetPositionX(), unit->GetPositionY(), 37.0f, true, 50.0f);
56 float groundZ_dyntree = unit->GetMap()->GetDynamicMapTree().getHeight(unit->GetPositionX(), unit->GetPositionY(), 37.0f, 50.0f, unit->GetPhaseMask());
57
58 if ((groundZ_vmap > 28.0f && groundZ_vmap < 29.0f) || (groundZ_dyntree > 28.0f && groundZ_dyntree < 37.0f))
59 {
60 float groundZ = std::max<float>(groundZ_vmap, groundZ_dyntree);
61 if (unit->GetPositionZ() < groundZ - 0.2f || unit->GetPositionZ() > groundZ + 3.5f)
62 TeleportUnitToNewZ(unit, groundZ + 1.0f, true);
63 }
64 }
65}
void TeleportUnitToNewZ(Unit *unit, float newZ, bool casting)
Definition BattlegroundRV.cpp:41
float getHeight(float x, float y, float z, float maxSearchDist, uint32 phasemask) const
Definition DynamicTree.cpp:294
float GetHeight(float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
Definition Map.cpp:1194
DynamicMapTree const & GetDynamicMapTree() const
Definition Map.h:410
bool IsAlive() const
Definition Unit.h:1707
bool IsFalling() const
Definition Unit.cpp:20004
uint32 GetPhaseMask() const
Definition Object.h:451
Map * GetMap() const
Definition Object.h:536
float GetPositionZ() const
Definition Position.h:123
float GetPositionX() const
Definition Position.h:121
float GetPositionY() const
Definition Position.h:122

References Map::GetDynamicMapTree(), Map::GetHeight(), DynamicMapTree::getHeight(), WorldObject::GetMap(), WorldObject::GetPhaseMask(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Unit::IsAlive(), Unit::IsFalling(), and TeleportUnitToNewZ().

Referenced by PostUpdateImpl().

◆ FillInitialWorldStates()

void BattlegroundRV::FillInitialWorldStates ( WorldPackets::WorldState::InitWorldStates packet)
overridevirtual

Reimplemented from Arena.

209{
212}
@ WORLD_STATE_BATTLEGROUND_RV_ARENA_SHOW
Definition WorldStateDefines.h:354
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &packet) override
Definition Arena.cpp:151
std::vector< WorldStateInfo > Worldstates
Definition WorldStatePackets.h:46

References Arena::FillInitialWorldStates(), WORLD_STATE_BATTLEGROUND_RV_ARENA_SHOW, and WorldPackets::WorldState::InitWorldStates::Worldstates.

◆ GetPillarAtPosition()

GameObject * BattlegroundRV::GetPillarAtPosition ( Position p)
302{
303 uint32 pillar = GetPillarIdForPos(p);
304 if (!pillar)
305 return nullptr;
306
307 return GetBgMap()->GetGameObject(BgObjects[pillar]);
308}
std::uint32_t uint32
Definition Define.h:107
uint32 GetPillarIdForPos(Position *p)
Definition BattlegroundRV.cpp:287
BattlegroundMap * GetBgMap() const
Definition Battleground.h:450
GameObject * GetGameObject(ObjectGuid const guid)
Definition Map.cpp:2503

References Battleground::BgObjects, Battleground::GetBgMap(), Map::GetGameObject(), and GetPillarIdForPos().

◆ GetPillarIdForPos()

uint32 BattlegroundRV::GetPillarIdForPos ( Position p)
protected
288{
289 float range = 1.75f;
290 if (p->GetExactDist2d(763.632385f, -306.162384f) < range)
292 if (p->GetExactDist2d(723.644287f, -284.493256f) < 2.0f * range)
294 if (p->GetExactDist2d(763.611145f, -261.856750f) < range)
296 if (p->GetExactDist2d(802.211609f, -284.493256f) < 2.0f * range)
298 return 0;
299}
@ BG_RV_OBJECT_PILAR_1
Definition BattlegroundRV.h:32
@ BG_RV_OBJECT_PILAR_4
Definition BattlegroundRV.h:38
@ BG_RV_OBJECT_PILAR_2
Definition BattlegroundRV.h:37
@ BG_RV_OBJECT_PILAR_3
Definition BattlegroundRV.h:33
float GetExactDist2d(const float x, const float y) const
Definition Position.h:170

References BG_RV_OBJECT_PILAR_1, BG_RV_OBJECT_PILAR_2, BG_RV_OBJECT_PILAR_3, BG_RV_OBJECT_PILAR_4, and Position::GetExactDist2d().

Referenced by GetPillarAtPosition().

◆ HandleAreaTrigger()

void BattlegroundRV::HandleAreaTrigger ( Player player,
uint32  trigger 
)
overridevirtual

Reimplemented from Battleground.

185{
186 if (GetStatus() != STATUS_IN_PROGRESS || _state == BG_RV_STATE_OPEN_FENCES /*during elevator rising it's possible to jump and cause areatrigger*/)
187 return;
188
189 switch (trigger)
190 {
191 // fire was removed in 3.2.0
192 case 5473:
193 case 5474:
194 break;
195 // OUTSIDE OF ARENA, TELEPORT!
196 case 5224:
197 player->NearTeleportTo(765.0f, -294.0f, 28.3f, player->GetOrientation());
198 break;
199 case 5226:
200 player->NearTeleportTo(765.0f, -272.0f, 28.3f, player->GetOrientation());
201 break;
202 case 5447:
203 player->NearTeleportTo(763.5f, -284, 28.276f, 2.422f);
204 break;
205 }
206}
@ BG_RV_STATE_OPEN_FENCES
Definition BattlegroundRV.h:76
@ STATUS_IN_PROGRESS
Definition Battleground.h:203
BattlegroundStatus GetStatus() const
Definition Battleground.h:333
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition Unit.cpp:20031
float GetOrientation() const
Definition Position.h:124

References _state, BG_RV_STATE_OPEN_FENCES, Position::GetOrientation(), Battleground::GetStatus(), Unit::NearTeleportTo(), and STATUS_IN_PROGRESS.

◆ HandlePlayerUnderMap()

bool BattlegroundRV::HandlePlayerUnderMap ( Player player)
overridevirtual

Reimplemented from Battleground.

179{
180 player->NearTeleportTo(763.5f, -284, 28.276f, 2.422f);
181 return true;
182}

References Unit::NearTeleportTo().

◆ Init()

void BattlegroundRV::Init ( )
overridevirtual

Reimplemented from Battleground.

215{
216 //call parent's class reset
218}
virtual void Init()
Definition Battleground.cpp:1070

References Battleground::Init().

◆ PostUpdateImpl()

void BattlegroundRV::PostUpdateImpl ( uint32  )
overrideprivatevirtual

Post-update hook.

Will be called after battleground update has passed. May be used to implement custom update effects in subclasses.

Parameters
diffa time difference between two worldserver update loops in milliseconds.
See also
Update(), PreUpdateImpl().

Reimplemented from Battleground.

68{
70 return;
71
72 if (_timer < Milliseconds(diff))
73 {
74 switch (_state)
75 {
77 {
79 DoorOpen(i);
80
83
84 for (auto const& [playerGuid, player] : m_Players)
85 {
86 if (!player)
87 continue;
88
89 // Demonic Circle Summon
90 if (GameObject* gObj = player->GetGameObject(48018))
91 {
92 gObj->Relocate(gObj->GetPositionX(), gObj->GetPositionY(), 28.28f);
93 gObj->UpdateObjectVisibility(true);
94 }
95
96 if (player->GetPositionZ() < 27.0f)
97 TeleportUnitToNewZ(player, 28.28f, true);
98
99 for (uint8 i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
100 if (player->m_SummonSlot[i])
101 if (Creature* totem = GetBgMap()->GetCreature(player->m_SummonSlot[i]))
102 if (totem->GetPositionZ() < 28.0f)
103 TeleportUnitToNewZ(totem, 28.28f, true);
104
105 for (auto itr2 = player->m_Controlled.begin(); itr2 != player->m_Controlled.end(); ++itr2)
106 {
107 if ((*itr2)->GetPositionZ() < 28.0f)
108 TeleportUnitToNewZ((*itr2), 28.28f, true);
109
110 // Xinef: override stay position
111 if (CharmInfo* charmInfo = (*itr2)->GetCharmInfo())
112 if (charmInfo->IsAtStay())
113 {
114 (*itr2)->StopMovingOnCurrentPos();
115 charmInfo->SaveStayPosition(false);
116 }
117 }
118 }
119
120 // fix ground on elevators (so aoe spells can be casted there)
121 {
123 for (uint8 i = 0; i < 2; ++i)
124 if (GameObject* go = GetBGObject(objects[i]))
125 go->RemoveGameObjectFlag(GO_FLAG_TRANSPORT);
126 }
127 break;
128 }
131 DoorClose(i);
132 // Fire got closed after five seconds, leaves twenty seconds before toggling pillars
135 break;
139 break;
140 }
141 }
142 else
143 _timer -= Milliseconds(diff);
144
146 return;
147
148 if (_checkPlayersTimer <= diff)
149 {
151
152 for (auto const& itr : m_Players)
153 CheckPositionForUnit(itr.second);
154
155 // maybe for pets and m_Controlled also, but not really necessary
156 }
157 else
158 _checkPlayersTimer -= diff;
159}
static constexpr Milliseconds BG_RV_FIRE_TO_PILLAR_TIMER
Definition BattlegroundRV.cpp:28
static constexpr Milliseconds BG_RV_PILLAR_SWITCH_TIMER
Definition BattlegroundRV.cpp:27
static constexpr Milliseconds BG_RV_CLOSE_FIRE_TIMER
Definition BattlegroundRV.cpp:29
@ BG_RV_OBJECT_ELEVATOR_1
Definition BattlegroundRV.h:42
@ BG_RV_OBJECT_ELEVATOR_2
Definition BattlegroundRV.h:43
@ BG_RV_OBJECT_FIREDOOR_2
Definition BattlegroundRV.h:30
@ BG_RV_OBJECT_FIRE_1
Definition BattlegroundRV.h:27
@ BG_RV_STATE_SWITCH_PILLARS
Definition BattlegroundRV.h:77
@ BG_RV_STATE_CLOSE_FIRE
Definition BattlegroundRV.h:78
std::uint8_t uint8
Definition Define.h:109
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:27
@ GO_FLAG_TRANSPORT
Definition SharedDefines.h:1606
#define SUMMON_SLOT_TOTEM
Definition Unit.h:603
#define MAX_TOTEM_SLOT
Definition Unit.h:604
void CheckPositionForUnit(Unit *unit)
Definition BattlegroundRV.cpp:50
void UpdatePillars()
Definition BattlegroundRV.cpp:261
void DoorOpen(uint32 type)
Definition Battleground.cpp:1483
BattlegroundPlayerMap m_Players
Definition Battleground.h:633
void DoorClose(uint32 type)
Definition Battleground.cpp:1467
GameObject * GetBGObject(uint32 type)
Definition Battleground.cpp:1495
Definition Creature.h:43
Definition GameObject.h:120
Creature * GetCreature(WorldObject const &u, ObjectGuid const guid)
Definition ObjectAccessor.cpp:210
Definition CharmInfo.h:127

References _checkPlayersTimer, _state, _timer, BG_RV_CLOSE_FIRE_TIMER, BG_RV_FIRE_TO_PILLAR_TIMER, BG_RV_OBJECT_ELEVATOR_1, BG_RV_OBJECT_ELEVATOR_2, BG_RV_OBJECT_FIRE_1, BG_RV_OBJECT_FIREDOOR_2, BG_RV_PILLAR_SWITCH_TIMER, BG_RV_STATE_CLOSE_FIRE, BG_RV_STATE_OPEN_FENCES, BG_RV_STATE_SWITCH_PILLARS, CheckPositionForUnit(), Battleground::DoorClose(), Battleground::DoorOpen(), Battleground::GetBgMap(), Battleground::GetBGObject(), Map::GetCreature(), Battleground::GetStatus(), GO_FLAG_TRANSPORT, Battleground::m_Players, MAX_TOTEM_SLOT, STATUS_IN_PROGRESS, SUMMON_SLOT_TOTEM, TeleportUnitToNewZ(), and UpdatePillars().

◆ SetupBattleground()

bool BattlegroundRV::SetupBattleground ( )
overridevirtual

Reimplemented from Battleground.

221{
222 // elevators
223 if (!AddObject(BG_RV_OBJECT_ELEVATOR_1, BG_RV_OBJECT_TYPE_ELEVATOR_1, 763.536377f, -294.535767f, 0.505383f, 3.141593f, 0, 0, 0, RESPAWN_IMMEDIATELY)
224 || !AddObject(BG_RV_OBJECT_ELEVATOR_2, BG_RV_OBJECT_TYPE_ELEVATOR_2, 763.506348f, -273.873352f, 0.505383f, 0.000000f, 0, 0, 0, RESPAWN_IMMEDIATELY)
225 // buffs
226 || !AddObject(BG_RV_OBJECT_BUFF_1, BG_RV_OBJECT_TYPE_BUFF_1, 735.551819f, -284.794678f, 28.276682f, 0.034906f, 0, 0, 0, RESPAWN_IMMEDIATELY)
227 || !AddObject(BG_RV_OBJECT_BUFF_2, BG_RV_OBJECT_TYPE_BUFF_2, 791.224487f, -284.794464f, 28.276682f, 2.600535f, 0, 0, 0, RESPAWN_IMMEDIATELY)
228 // fire
229 || !AddObject(BG_RV_OBJECT_FIRE_1, BG_RV_OBJECT_TYPE_FIRE_1, 743.543457f, -283.799469f, 28.286655f, 3.141593f, 0, 0, 0, RESPAWN_IMMEDIATELY)
230 || !AddObject(BG_RV_OBJECT_FIRE_2, BG_RV_OBJECT_TYPE_FIRE_2, 782.971802f, -283.799469f, 28.286655f, 3.141593f, 0, 0, 0, RESPAWN_IMMEDIATELY)
231 || !AddObject(BG_RV_OBJECT_FIREDOOR_1, BG_RV_OBJECT_TYPE_FIREDOOR_1, 743.711060f, -284.099609f, 27.542587f, 3.141593f, 0, 0, 0, RESPAWN_IMMEDIATELY)
232 || !AddObject(BG_RV_OBJECT_FIREDOOR_2, BG_RV_OBJECT_TYPE_FIREDOOR_2, 783.221252f, -284.133362f, 27.535686f, 0.000000f, 0, 0, 0, RESPAWN_IMMEDIATELY)
233 // Gear
234 || !AddObject(BG_RV_OBJECT_GEAR_1, BG_RV_OBJECT_TYPE_GEAR_1, 763.664551f, -261.872986f, 26.686588f, 0.000000f, 0, 0, 0, RESPAWN_IMMEDIATELY)
235 || !AddObject(BG_RV_OBJECT_GEAR_2, BG_RV_OBJECT_TYPE_GEAR_2, 763.578979f, -306.146149f, 26.665222f, 3.141593f, 0, 0, 0, RESPAWN_IMMEDIATELY)
236 // Pulley
237 || !AddObject(BG_RV_OBJECT_PULLEY_1, BG_RV_OBJECT_TYPE_PULLEY_1, 700.722290f, -283.990662f, 39.517582f, 3.141593f, 0, 0, 0, RESPAWN_IMMEDIATELY)
238 || !AddObject(BG_RV_OBJECT_PULLEY_2, BG_RV_OBJECT_TYPE_PULLEY_2, 826.303833f, -283.996429f, 39.517582f, 0.000000f, 0, 0, 0, RESPAWN_IMMEDIATELY)
239 // Pilars
240 || !AddObject(BG_RV_OBJECT_PILAR_1, BG_RV_OBJECT_TYPE_PILAR_1, 763.632385f, -306.162384f, 25.909504f, 3.141593f, 0, 0, 0, RESPAWN_IMMEDIATELY)
241 || !AddObject(BG_RV_OBJECT_PILAR_2, BG_RV_OBJECT_TYPE_PILAR_2, 723.644287f, -284.493256f, 24.648525f, 3.141593f, 0, 0, 0, RESPAWN_IMMEDIATELY)
242 || !AddObject(BG_RV_OBJECT_PILAR_3, BG_RV_OBJECT_TYPE_PILAR_3, 763.611145f, -261.856750f, 25.909504f, 0.000000f, 0, 0, 0, RESPAWN_IMMEDIATELY)
243 || !AddObject(BG_RV_OBJECT_PILAR_4, BG_RV_OBJECT_TYPE_PILAR_4, 802.211609f, -284.493256f, 24.648525f, 0.000000f, 0, 0, 0, RESPAWN_IMMEDIATELY)
244
245 // Arena Ready Marker
246 || !AddObject(BG_RV_OBJECT_READY_MARKER_1, ARENA_READY_MARKER_ENTRY, 769.93f, -301.04f, 2.80f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 300)
247 || !AddObject(BG_RV_OBJECT_READY_MARKER_2, ARENA_READY_MARKER_ENTRY, 757.02f, -267.30f, 2.80f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 300)
248 )
249 {
250 LOG_ERROR("sql.sql", "BatteGroundRV: Failed to spawn some object!");
251 return false;
252 }
253
254 for (uint8 i = 0; i < BG_RV_OBJECT_MAX; ++i)
255 if (GameObject* go = GetBGObject(i))
256 go->SetPhaseMask(3, true);
257
258 return true;
259}
@ BG_RV_OBJECT_PULLEY_2
Definition BattlegroundRV.h:40
@ BG_RV_OBJECT_FIRE_2
Definition BattlegroundRV.h:28
@ BG_RV_OBJECT_GEAR_1
Definition BattlegroundRV.h:34
@ BG_RV_OBJECT_FIREDOOR_1
Definition BattlegroundRV.h:29
@ BG_RV_OBJECT_PULLEY_1
Definition BattlegroundRV.h:39
@ BG_RV_OBJECT_GEAR_2
Definition BattlegroundRV.h:35
@ BG_RV_OBJECT_BUFF_1
Definition BattlegroundRV.h:25
@ BG_RV_OBJECT_BUFF_2
Definition BattlegroundRV.h:26
@ BG_RV_OBJECT_READY_MARKER_2
Definition BattlegroundRV.h:46
@ BG_RV_OBJECT_READY_MARKER_1
Definition BattlegroundRV.h:45
@ BG_RV_OBJECT_TYPE_PILAR_2
Definition BattlegroundRV.h:69
@ BG_RV_OBJECT_TYPE_PILAR_1
Definition BattlegroundRV.h:68
@ BG_RV_OBJECT_TYPE_PILAR_4
Definition BattlegroundRV.h:71
@ BG_RV_OBJECT_TYPE_ELEVATOR_1
Definition BattlegroundRV.h:65
@ BG_RV_OBJECT_TYPE_BUFF_1
Definition BattlegroundRV.h:53
@ BG_RV_OBJECT_TYPE_BUFF_2
Definition BattlegroundRV.h:54
@ BG_RV_OBJECT_TYPE_PULLEY_2
Definition BattlegroundRV.h:61
@ BG_RV_OBJECT_TYPE_GEAR_2
Definition BattlegroundRV.h:63
@ BG_RV_OBJECT_TYPE_FIREDOOR_2
Definition BattlegroundRV.h:58
@ BG_RV_OBJECT_TYPE_PILAR_3
Definition BattlegroundRV.h:70
@ BG_RV_OBJECT_TYPE_FIREDOOR_1
Definition BattlegroundRV.h:59
@ BG_RV_OBJECT_TYPE_FIRE_2
Definition BattlegroundRV.h:56
@ BG_RV_OBJECT_TYPE_ELEVATOR_2
Definition BattlegroundRV.h:66
@ BG_RV_OBJECT_TYPE_GEAR_1
Definition BattlegroundRV.h:62
@ BG_RV_OBJECT_TYPE_PULLEY_1
Definition BattlegroundRV.h:60
@ BG_RV_OBJECT_TYPE_FIRE_1
Definition BattlegroundRV.h:55
@ RESPAWN_IMMEDIATELY
Definition Battleground.h:170
#define ARENA_READY_MARKER_ENTRY
Definition Battleground.h:286
#define LOG_ERROR(filterType__,...)
Definition Log.h:157
bool AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime=0, GOState goState=GO_STATE_READY)
Definition Battleground.cpp:1411

References Battleground::AddObject(), ARENA_READY_MARKER_ENTRY, BG_RV_OBJECT_BUFF_1, BG_RV_OBJECT_BUFF_2, BG_RV_OBJECT_ELEVATOR_1, BG_RV_OBJECT_ELEVATOR_2, BG_RV_OBJECT_FIRE_1, BG_RV_OBJECT_FIRE_2, BG_RV_OBJECT_FIREDOOR_1, BG_RV_OBJECT_FIREDOOR_2, BG_RV_OBJECT_GEAR_1, BG_RV_OBJECT_GEAR_2, BG_RV_OBJECT_MAX, BG_RV_OBJECT_PILAR_1, BG_RV_OBJECT_PILAR_2, BG_RV_OBJECT_PILAR_3, BG_RV_OBJECT_PILAR_4, BG_RV_OBJECT_PULLEY_1, BG_RV_OBJECT_PULLEY_2, BG_RV_OBJECT_READY_MARKER_1, BG_RV_OBJECT_READY_MARKER_2, BG_RV_OBJECT_TYPE_BUFF_1, BG_RV_OBJECT_TYPE_BUFF_2, BG_RV_OBJECT_TYPE_ELEVATOR_1, BG_RV_OBJECT_TYPE_ELEVATOR_2, BG_RV_OBJECT_TYPE_FIRE_1, BG_RV_OBJECT_TYPE_FIRE_2, BG_RV_OBJECT_TYPE_FIREDOOR_1, BG_RV_OBJECT_TYPE_FIREDOOR_2, BG_RV_OBJECT_TYPE_GEAR_1, BG_RV_OBJECT_TYPE_GEAR_2, BG_RV_OBJECT_TYPE_PILAR_1, BG_RV_OBJECT_TYPE_PILAR_2, BG_RV_OBJECT_TYPE_PILAR_3, BG_RV_OBJECT_TYPE_PILAR_4, BG_RV_OBJECT_TYPE_PULLEY_1, BG_RV_OBJECT_TYPE_PULLEY_2, Battleground::GetBGObject(), LOG_ERROR, and RESPAWN_IMMEDIATELY.

◆ StartingEventOpenDoors()

void BattlegroundRV::StartingEventOpenDoors ( )
overridevirtual

Reimplemented from Battleground.

162{
163 for (auto const& itr : m_Players)
164 itr.second->SetPhaseMask(1, true);
165
166 // Buff respawn
169
170 // Elevators
173
176}
static constexpr Milliseconds BG_RV_FIRST_TIMER
Definition BattlegroundRV.cpp:30
void SpawnBGObject(uint32 type, uint32 respawntime, uint32 forceRespawnDelay=0)
Definition Battleground.cpp:1513

References _state, _timer, BG_RV_FIRST_TIMER, BG_RV_OBJECT_BUFF_1, BG_RV_OBJECT_BUFF_2, BG_RV_OBJECT_ELEVATOR_1, BG_RV_OBJECT_ELEVATOR_2, BG_RV_STATE_OPEN_FENCES, Battleground::DoorOpen(), Battleground::m_Players, and Battleground::SpawnBGObject().

◆ TeleportUnitToNewZ()

void BattlegroundRV::TeleportUnitToNewZ ( Unit unit,
float  newZ,
bool  casting 
)
protected
42{
43 if (!unit->IsAlive())
44 return;
45
46 unit->NearTeleportTo(unit->GetPositionX(), unit->GetPositionY(), newZ, unit->GetOrientation(), casting);
47 unit->m_positionZ = newZ;
48}
float m_positionZ
Definition Position.h:57

References Position::GetOrientation(), Position::GetPositionX(), Position::GetPositionY(), Unit::IsAlive(), Position::m_positionZ, and Unit::NearTeleportTo().

Referenced by CheckPositionForUnit(), and PostUpdateImpl().

◆ UpdatePillars()

void BattlegroundRV::UpdatePillars ( )
protected
262{
264 if (!test)
265 return;
266
267 if (test->GetGoState() == GO_STATE_READY)
268 {
274 go->SetGoState(GO_STATE_READY);
275 }
276 else
277 {
280 go->SetGoState(GO_STATE_READY);
283 go->SetGoState(GO_STATE_ACTIVE);
284 }
285}
@ GO_STATE_READY
Definition GameObjectData.h:690
@ GO_STATE_ACTIVE
Definition GameObjectData.h:689
void SetGoState(GOState state)
Definition GameObject.cpp:2462
GOState GetGoState() const
Definition GameObject.h:204
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition ObjectAccessor.cpp:184

References BG_RV_OBJECT_GEAR_2, BG_RV_OBJECT_PILAR_1, BG_RV_OBJECT_PILAR_2, BG_RV_OBJECT_PULLEY_2, Battleground::BgObjects, Battleground::GetBgMap(), Map::GetGameObject(), GameObject::GetGoState(), GO_STATE_ACTIVE, GO_STATE_READY, and GameObject::SetGoState().

Referenced by PostUpdateImpl().

Member Data Documentation

◆ _checkPlayersTimer

uint16 BattlegroundRV::_checkPlayersTimer
private

Referenced by BattlegroundRV(), and PostUpdateImpl().

◆ _state

uint32 BattlegroundRV::_state
private

◆ _timer

Milliseconds BattlegroundRV::_timer
private

The documentation for this class was generated from the following files: