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

#include "BattlegroundRL.h"

Inheritance diagram for BattlegroundRL:
Arena Battleground

Public Member Functions

 BattlegroundRL ()
 
void FillInitialWorldStates (WorldPacket &d) override
 
void StartingEventCloseDoors () override
 
void StartingEventOpenDoors () override
 
void HandleAreaTrigger (Player *player, uint32 trigger) override
 
bool SetupBattleground () override
 
bool HandlePlayerUnderMap (Player *player) override
 
- 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
 
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
 

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 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 *)
 
- 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

◆ BattlegroundRL()

BattlegroundRL::BattlegroundRL ( )
24{
26}
@ BG_RL_OBJECT_MAX
Definition: BattlegroundRL.h:31
BGObjects BgObjects
Definition: Battleground.h:532

References BG_RL_OBJECT_MAX, and Battleground::BgObjects.

Member Function Documentation

◆ FillInitialWorldStates()

void BattlegroundRL::FillInitialWorldStates ( WorldPacket d)
overridevirtual

Reimplemented from Arena.

95{
96 data << uint32(0xbba) << uint32(1); // 9
98}
std::uint32_t uint32
Definition: Define.h:107
void FillInitialWorldStates(WorldPacket &data) override
Definition: Arena.cpp:149

References Arena::FillInitialWorldStates().

◆ HandleAreaTrigger()

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

Reimplemented from Battleground.

50{
52 return;
53
54 switch (trigger)
55 {
56 case 4696: // buff trigger?
57 case 4697: // buff trigger?
58 break;
59 // OUTSIDE OF ARENA, TELEPORT!
60 case 4927:
61 case 4928:
62 player->NearTeleportTo(1230.77f, 1662.42f, 34.56f, 0.0f);
63 break;
64 case 4929:
65 case 4930:
66 player->NearTeleportTo(1341.16f, 1673.52f, 34.43f, 3.5f);
67 break;
68 case 4931:
69 player->NearTeleportTo(1294.74f, 1584.5f, 31.62f, 1.66f);
70 break;
71 case 4932:
72 player->NearTeleportTo(1277.5f, 1751.07f, 31.61f, 4.7f);
73 break;
74 case 4933:
75 player->NearTeleportTo(1269.14f, 1713.85f, 34.46f, 5.23f);
76 break;
77 case 4934:
78 player->NearTeleportTo(1298.14f, 1713.8f, 33.58f, 4.55f);
79 break;
80 case 4935:
81 player->NearTeleportTo(1306.32f, 1620.75f, 34.25f, 1.97f);
82 break;
83 case 4936:
84 player->NearTeleportTo(1277.97f, 1615.51f, 34.56f, 1.15f);
85 break;
86 case 4941: // under arena +10
87 case 5041: // under arena -10
88 case 5042: // under arena -30
89 player->NearTeleportTo(1285.810547f, 1667.896851f, 39.957642f, player->GetOrientation());
90 break;
91 }
92}
@ STATUS_IN_PROGRESS
Definition: Battleground.h:197
BattlegroundStatus GetStatus() const
Definition: Battleground.h:327
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:19937

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

◆ HandlePlayerUnderMap()

bool BattlegroundRL::HandlePlayerUnderMap ( Player player)
overridevirtual

Reimplemented from Battleground.

44{
45 player->NearTeleportTo(1285.810547f, 1667.896851f, 39.957642f, player->GetOrientation());
46 return true;
47}

References Position::GetOrientation(), and Unit::NearTeleportTo().

◆ SetupBattleground()

bool BattlegroundRL::SetupBattleground ( )
overridevirtual

Reimplemented from Battleground.

101{
102 // gates
103 if (!AddObject(BG_RL_OBJECT_DOOR_1, BG_RL_OBJECT_TYPE_DOOR_1, 1293.561f, 1601.938f, 31.60557f, -1.457349f, 0, 0, -0.6658813f, 0.7460576f, RESPAWN_IMMEDIATELY)
104 || !AddObject(BG_RL_OBJECT_DOOR_2, BG_RL_OBJECT_TYPE_DOOR_2, 1278.648f, 1730.557f, 31.60557f, 1.684245f, 0, 0, 0.7460582f, 0.6658807f, RESPAWN_IMMEDIATELY)
105 // buffs
106 || !AddObject(BG_RL_OBJECT_BUFF_1, BG_RL_OBJECT_TYPE_BUFF_1, 1328.719971f, 1632.719971f, 36.730400f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
107 || !AddObject(BG_RL_OBJECT_BUFF_2, BG_RL_OBJECT_TYPE_BUFF_2, 1243.300049f, 1699.170044f, 34.872601f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120)
108 // Arena Ready Marker
109 || !AddObject(BG_RL_OBJECT_READY_MARKER_1, ARENA_READY_MARKER_ENTRY, 1298.61f, 1598.59f, 31.62f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 300)
110 || !AddObject(BG_RL_OBJECT_READY_MARKER_2, ARENA_READY_MARKER_ENTRY, 1273.71f, 1734.05f, 31.61f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 300))
111 {
112 LOG_ERROR("sql.sql", "BatteGroundRL: Failed to spawn some object!");
113 return false;
114 }
115
116 return true;
117}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:156
@ BG_RL_OBJECT_TYPE_DOOR_2
Definition: BattlegroundRL.h:37
@ BG_RL_OBJECT_TYPE_DOOR_1
Definition: BattlegroundRL.h:36
@ BG_RL_OBJECT_TYPE_BUFF_2
Definition: BattlegroundRL.h:39
@ BG_RL_OBJECT_TYPE_BUFF_1
Definition: BattlegroundRL.h:38
@ BG_RL_OBJECT_READY_MARKER_2
Definition: BattlegroundRL.h:30
@ BG_RL_OBJECT_READY_MARKER_1
Definition: BattlegroundRL.h:29
@ BG_RL_OBJECT_BUFF_2
Definition: BattlegroundRL.h:28
@ BG_RL_OBJECT_BUFF_1
Definition: BattlegroundRL.h:27
@ BG_RL_OBJECT_DOOR_2
Definition: BattlegroundRL.h:26
@ BG_RL_OBJECT_DOOR_1
Definition: BattlegroundRL.h:25
@ RESPAWN_IMMEDIATELY
Definition: Battleground.h:164
#define ARENA_READY_MARKER_ENTRY
Definition: Battleground.h:280
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:1405

References Battleground::AddObject(), ARENA_READY_MARKER_ENTRY, BG_RL_OBJECT_BUFF_1, BG_RL_OBJECT_BUFF_2, BG_RL_OBJECT_DOOR_1, BG_RL_OBJECT_DOOR_2, BG_RL_OBJECT_READY_MARKER_1, BG_RL_OBJECT_READY_MARKER_2, BG_RL_OBJECT_TYPE_BUFF_1, BG_RL_OBJECT_TYPE_BUFF_2, BG_RL_OBJECT_TYPE_DOOR_1, BG_RL_OBJECT_TYPE_DOOR_2, LOG_ERROR, and RESPAWN_IMMEDIATELY.

◆ StartingEventCloseDoors()

void BattlegroundRL::StartingEventCloseDoors ( )
overridevirtual

Reimplemented from Battleground.

29{
32}
void SpawnBGObject(uint32 type, uint32 respawntime, uint32 forceRespawnDelay=0)
Definition: Battleground.cpp:1507

References BG_RL_OBJECT_DOOR_1, BG_RL_OBJECT_DOOR_2, RESPAWN_IMMEDIATELY, and Battleground::SpawnBGObject().

◆ StartingEventOpenDoors()

void BattlegroundRL::StartingEventOpenDoors ( )
overridevirtual

Reimplemented from Battleground.

35{
37 DoorOpen(i);
38
40 SpawnBGObject(i, 90);
41}
void DoorOpen(uint32 type)
Definition: Battleground.cpp:1477

References BG_RL_OBJECT_BUFF_1, BG_RL_OBJECT_BUFF_2, BG_RL_OBJECT_DOOR_1, BG_RL_OBJECT_DOOR_2, Battleground::DoorOpen(), and Battleground::SpawnBGObject().