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 (WorldPacket &d) 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 bool SetupBattleground ()
 
virtual void Init ()
 
virtual void StartingEventCloseDoors ()
 
virtual void StartingEventOpenDoors ()
 
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. More...
 
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
 
virtual void FillInitialWorldStates (WorldPacket &)
 
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)
 
virtual void EndBattleground (TeamId 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)
 
virtual void CheckWinConditions ()
 
void SetArenaTeamIdForTeam (TeamId teamId, uint32 ArenaTeamId)
 
uint32 GetArenaTeamIdForTeam (TeamId teamId) const
 
void SetArenaMatchmakerRating (TeamId teamId, uint32 MMR)
 
uint32 GetArenaMatchmakerRating (TeamId teamId) const
 
virtual void HandleAreaTrigger (Player *, uint32)
 
virtual void HandleKillPlayer (Player *player, Player *killer)
 
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)
 
virtual void AddPlayer (Player *player)
 
void AddOrSetPlayerToCorrectBgGroup (Player *player, TeamId teamId)
 
virtual void RemovePlayerAtLeave (Player *player)
 
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)
 
const char * GetAcoreString (int32 entry)
 
virtual bool HandlePlayerUnderMap (Player *)
 
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 FillInitialWorldStates (WorldPacket &data) 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)
 
virtual void RemovePlayer (Player *)
 

Private Member Functions

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

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 ( )
32{
34
36 _timer = 0s;
37 _state = 0;
38}
@ BG_RV_OBJECT_MAX
Definition: BattlegroundRV.h:48
BGObjects BgObjects
Definition: Battleground.h:549
uint16 _checkPlayersTimer
Definition: BattlegroundRV.h:103
Milliseconds _timer
Definition: BattlegroundRV.h:101
uint32 _state
Definition: BattlegroundRV.h:102

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

Member Function Documentation

◆ CheckPositionForUnit()

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

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 ( WorldPacket d)
overridevirtual

Reimplemented from Arena.

208{
209 data << uint32(BG_RV_WORLD_STATE) << uint32(1);
211}
std::uint32_t uint32
Definition: Define.h:107
@ BG_RV_WORLD_STATE
Definition: BattlegroundRV.h:82
void FillInitialWorldStates(WorldPacket &data) override
Definition: Arena.cpp:149

References BG_RV_WORLD_STATE, and Arena::FillInitialWorldStates().

◆ GetPillarAtPosition()

GameObject * BattlegroundRV::GetPillarAtPosition ( Position p)
301{
302 uint32 pillar = GetPillarIdForPos(p);
303 if (!pillar)
304 return nullptr;
305
306 return GetBgMap()->GetGameObject(BgObjects[pillar]);
307}
BattlegroundMap * GetBgMap() const
Definition: Battleground.h:449
uint32 GetPillarIdForPos(Position *p)
Definition: BattlegroundRV.cpp:286
GameObject * GetGameObject(ObjectGuid const guid)
Definition: Map.cpp:3319

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

◆ GetPillarIdForPos()

uint32 BattlegroundRV::GetPillarIdForPos ( Position p)
protected
287{
288 float range = 1.75f;
289 if (p->GetExactDist2d(763.632385f, -306.162384f) < range)
291 if (p->GetExactDist2d(723.644287f, -284.493256f) < 2.0f * range)
293 if (p->GetExactDist2d(763.611145f, -261.856750f) < range)
295 if (p->GetExactDist2d(802.211609f, -284.493256f) < 2.0f * range)
297 return 0;
298}
@ 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:166

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.

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

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.

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

References Unit::NearTeleportTo().

◆ Init()

void BattlegroundRV::Init ( )
overridevirtual

Reimplemented from Battleground.

214{
215 //call parent's class reset
217}
virtual void Init()
Definition: Battleground.cpp:1066

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.

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

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(), 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.

220{
221 // elevators
222 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)
223 || !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)
224 // buffs
225 || !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)
226 || !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)
227 // fire
228 || !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)
229 || !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)
230 || !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)
231 || !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)
232 // Gear
233 || !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)
234 || !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)
235 // Pulley
236 || !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)
237 || !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)
238 // Pilars
239 || !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)
240 || !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)
241 || !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)
242 || !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)
243
244 // Arena Ready Marker
245 || !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)
246 || !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)
247 )
248 {
249 LOG_ERROR("sql.sql", "BatteGroundRV: Failed to spawn some object!");
250 return false;
251 }
252
253 for (uint8 i = 0; i < BG_RV_OBJECT_MAX; ++i)
254 if (GameObject* go = GetBGObject(i))
255 go->SetPhaseMask(3, true);
256
257 return true;
258}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:156
@ 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:169
#define ARENA_READY_MARKER_ENTRY
Definition: Battleground.h:285
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:1407

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.

161{
162 for (auto const& itr : m_Players)
163 itr.second->SetPhaseMask(1, true);
164
165 // Buff respawn
168
169 // Elevators
172
175}
static constexpr Milliseconds BG_RV_FIRST_TIMER
Definition: BattlegroundRV.cpp:29
void SpawnBGObject(uint32 type, uint32 respawntime, uint32 forceRespawnDelay=0)
Definition: Battleground.cpp:1509

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
41{
42 if (!unit->IsAlive())
43 return;
44
45 unit->NearTeleportTo(unit->GetPositionX(), unit->GetPositionY(), newZ, unit->GetOrientation(), casting);
46 unit->m_positionZ = newZ;
47}
float m_positionZ
Definition: Position.h:58

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
261{
263 if (!test)
264 return;
265
266 if (test->GetGoState() == GO_STATE_READY)
267 {
273 go->SetGoState(GO_STATE_READY);
274 }
275 else
276 {
279 go->SetGoState(GO_STATE_READY);
282 go->SetGoState(GO_STATE_ACTIVE);
283 }
284}
@ GO_STATE_READY
Definition: GameObjectData.h:690
@ GO_STATE_ACTIVE
Definition: GameObjectData.h:689
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:184
void SetGoState(GOState state)
Definition: GameObject.cpp:2477
GOState GetGoState() const
Definition: GameObject.h:206

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