TrinityCore
Loading...
Searching...
No Matches
Battleground.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __BATTLEGROUND_H
19#define __BATTLEGROUND_H
20
21#include "DBCEnums.h"
22#include "Duration.h"
23#include "ObjectGuid.h"
24#include "Optional.h"
25#include "Position.h"
26#include "SharedDefines.h"
27#include "UniqueTrackablePtr.h"
28#include "ZoneScript.h"
29#include <deque>
30#include <map>
31#include <vector>
32
33class BattlegroundMap;
34class Creature;
35class GameObject;
36class Group;
37class Player;
38class Transport;
39class Unit;
40class WorldObject;
41class WorldPacket;
42struct BattlegroundPlayerScoreTemplate;
47enum class HonorGainSource : uint8;
48
49namespace WorldPackets
50{
51 namespace Battleground
52 {
53 struct PVPMatchStatistics;
54 struct BattlegroundPlayerPosition;
55 }
56
57}
58
69
77
89
95
101
103{
104 SPELL_SPIRIT_HEAL_CHANNEL_AOE = 22011, // used for AoE resurrections
105 SPELL_SPIRIT_HEAL_PLAYER_AURA = 156758, // individual player timers for resurrection
106 SPELL_SPIRIT_HEAL_CHANNEL_SELF = 305122, // channel visual for individual area spirit healers
107 SPELL_WAITING_FOR_RESURRECT = 2584, // Waiting to Resurrect
109 SPELL_SPIRIT_HEAL = 22012, // Spirit Heal
110 SPELL_RESURRECTION_VISUAL = 24171, // Resurrection Impact Visual
111 SPELL_ARENA_PREPARATION = 32727, // use this one, 32728 not correct
112 SPELL_PREPARATION = 44521, // Preparation
113 SPELL_SPIRIT_HEAL_MANA = 44535, // Spirit Heal
114 SPELL_RECENTLY_DROPPED_ALLIANCE_FLAG = 42792, // makes Alliance flag unselectable
115 SPELL_RECENTLY_DROPPED_HORDE_FLAG = 50326, // makes Horde flag unselectable
116 SPELL_RECENTLY_DROPPED_NEUTRAL_FLAG = 50327, // makes Neutral flag unselectable
117 SPELL_AURA_PLAYER_INACTIVE = 43681, // Inactive
118 SPELL_HONORABLE_DEFENDER_25Y = 68652, // +50% honor when standing at a capture point that you control, 25yards radius (added in 3.2)
119 SPELL_HONORABLE_DEFENDER_60Y = 66157, // +50% honor when standing at a capture point that you control, 60yards radius (added in 3.2), probably for 40+ player battlegrounds
127 SPELL_PET_SUMMONED = 6962 // used after resurrection
129
131{
134 //REMIND_INTERVAL = 10000, // ms
138 MAX_OFFLINE_TIME = 300, // secs
139 RESPAWN_ONE_DAY = 86400, // secs
141 BUFF_RESPAWN_TIME = 180, // secs
145};
146
148{
149 BG_START_DELAY_2M = 120000, // ms (2 minutes)
150 BG_START_DELAY_1M = 60000, // ms (1 minute)
151 BG_START_DELAY_30S = 30000, // ms (30 seconds)
152 BG_START_DELAY_15S = 15000, // ms (15 seconds) Used only in arena
153 BG_START_DELAY_NONE = 0 // ms
155
162
164
166{
167 STATUS_NONE = 0, // first status, should mean bg is not instance
168 STATUS_WAIT_QUEUE = 1, // means bg is empty and waiting for queue
169 STATUS_WAIT_JOIN = 2, // this means, that BG has already started and it is waiting for more players
170 STATUS_IN_PROGRESS = 3, // means bg is running
171 STATUS_WAIT_LEAVE = 4 // means some faction has won BG and it is ending
173
175{
176 time_t OfflineRemoveTime; // for tracking and removing offline players from queue after 5 minutes
177 ::Team Team; // Player's team
180};
181
190
197
206
214#define BG_STARTING_EVENT_COUNT 4
215
216#define BG_AWARD_ARENA_POINTS_MIN_LEVEL 71
217#define ARENA_TIMELIMIT_POINTS_LOSS -16
218
232
234{
235 Battleground = 0,
236 Arena = 1,
237 Wargame = 2,
238 Cheat = 3,
239 ArenaSkirmish = 4
240};
241
250
251/*
252This class is used to:
2531. Add player to battleground
2542. Remove player from battleground
2553. some certain cases, same for all battlegrounds
2564. It has properties same for all battlegrounds
257*/
259{
260 public:
261 Battleground(BattlegroundTemplate const* battlegroundTemplate);
263 virtual ~Battleground();
264
266
267 void Update(uint32 diff);
268
269 void Reset();
270
271 /* Battleground */
272 // Get methods:
273 char const* GetName() const;
274 BattlegroundTypeId GetTypeID() const;
275 BattlegroundBracketId GetBracketId() const;
276 uint32 GetInstanceID() const { return m_InstanceID; }
277 BattlegroundStatus GetStatus() const { return m_Status; }
278 uint32 GetClientInstanceID() const { return m_ClientInstanceID; }
279 uint32 GetElapsedTime() const { return m_StartTime; }
280 Milliseconds GetInProgressDuration() const { return (m_Events & BG_STARTING_EVENT_4) ? Milliseconds(m_StartTime - StartDelayTimes[BG_STARTING_EVENT_FIRST]) : 0ms; }
281 uint32 GetRemainingTime() const { return m_EndTime; }
282 uint32 GetMaxPlayers() const;
283 uint32 GetMinPlayers() const;
284
285 uint32 GetMinLevel() const;
286 uint32 GetMaxLevel() const;
287
288 uint32 GetMaxPlayersPerTeam() const;
289 uint32 GetMinPlayersPerTeam() const;
290
291 int32 GetStartDelayTime() const { return m_StartDelayTime; }
292 uint8 GetArenaType() const { return m_ArenaType; }
293 PvPTeamId GetWinner() const { return _winnerTeamId; }
294 uint32 GetScriptId() const;
295 uint32 GetBonusHonorFromKill(uint32 kills) const;
296
297 // Set methods:
298 //here we can count minlevel and maxlevel for players
299 void SetBracket(PVPDifficultyEntry const* bracketEntry);
300 void SetInstanceID(uint32 InstanceID) { m_InstanceID = InstanceID; }
301 void SetStatus(BattlegroundStatus Status) { m_Status = Status; }
302 void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; }
303 void SetElapsedTime(uint32 Time) { m_StartTime = Time; }
304 void SetRemainingTime(uint32 Time) { m_EndTime = Time; }
305 void SetRated(bool state) { m_IsRated = state; }
306 void SetArenaType(uint8 type) { m_ArenaType = type; }
307 void SetWinner(PvPTeamId winnerTeamId) { _winnerTeamId = winnerTeamId; }
308 std::unordered_set<uint32> const* GetPvpStatIds() const { return _pvpStatIds; }
309
310 void ModifyStartDelayTime(int diff) { m_StartDelayTime -= diff; }
311 void SetStartDelayTime(int Time) { m_StartDelayTime = Time; }
312
313 void AddToBGFreeSlotQueue(); //this queue will be useful when more battlegrounds instances will be available
314 void RemoveFromBGFreeSlotQueue(); //this method could delete whole BG instance, if another free is available
315
316 void DecreaseInvitedCount(Team team) { (team == ALLIANCE) ? --m_InvitedAlliance : --m_InvitedHorde; }
317 void IncreaseInvitedCount(Team team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; }
318
319 uint32 GetInvitedCount(Team team) const { return (team == ALLIANCE) ? m_InvitedAlliance : m_InvitedHorde; }
320 bool HasFreeSlots() const;
321 uint32 GetFreeSlotsForTeam(Team team) const;
322
323 bool isArena() const;
324 bool isBattleground() const;
325 bool isRated() const { return m_IsRated; }
326
327 typedef std::map<ObjectGuid, BattlegroundPlayer> BattlegroundPlayerMap;
328 BattlegroundPlayerMap const& GetPlayers() const { return m_Players; }
329 uint32 GetPlayersSize() const { return uint32(m_Players.size()); }
330
331 typedef std::map<ObjectGuid, BattlegroundScore*> BattlegroundScoreMap;
332 uint32 GetPlayerScoresSize() const { return uint32(PlayerScores.size()); }
333
334 void StartBattleground();
335
336 GameObject* GetBGObject(uint32 type, bool logError = true);
337 Creature* GetBGCreature(uint32 type, bool logError = true);
338
339 // Location
340 uint32 GetMapId() const;
341
342 // Map pointers
343 void SetBgMap(BattlegroundMap* map);
344 BattlegroundMap* GetBgMap() const;
345 BattlegroundMap* FindBgMap() const { return m_Map; }
346
347 WorldSafeLocsEntry const* GetTeamStartPosition(TeamId teamId) const;
348
349 float GetStartMaxDist() const;
350
351 // Packet Transfer
352 // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!)
353 void SendPacketToTeam(Team team, WorldPacket const* packet, Player* except = nullptr) const;
354 void SendPacketToAll(WorldPacket const* packet) const;
355
356 void SendChatMessage(Creature* source, uint8 textId, WorldObject* target = nullptr);
357 void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const* target = nullptr);
358
359 template<class Do>
360 void BroadcastWorker(Do& _do);
361
362 void PlaySoundToTeam(uint32 SoundID, Team team);
363 void PlaySoundToAll(uint32 SoundID);
364 void CastSpellOnTeam(uint32 SpellID, Team team);
365 void RemoveAuraOnTeam(uint32 SpellID, Team team);
366 void RewardHonorToTeam(uint32 Honor, Team team);
367 void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, Team team);
368 void UpdateWorldState(int32 worldStateId, int32 value, bool hidden = false);
369 virtual void EndBattleground(Team winner);
370 void BlockMovement(Player* player);
371
372 void SendMessageToAll(uint32 entry, ChatMsg type, Player const* source = nullptr);
373 void PSendMessageToAll(uint32 entry, ChatMsg type, Player const* source, ...);
374
375 // Raid Group
376 Group* GetBgRaid(Team team) const { return team == ALLIANCE ? m_BgRaids[TEAM_ALLIANCE] : m_BgRaids[TEAM_HORDE]; }
377 void SetBgRaid(Team team, Group* bg_raid);
378
379 virtual void BuildPvPLogDataPacket(WorldPackets::Battleground::PVPMatchStatistics& pvpLogData) const;
380
381 BattlegroundScore const* GetBattlegroundScore(Player* player) const;
382
383 bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true, Optional<HonorGainSource> source = {});
384 void UpdatePvpStat(Player* player, uint32 pvpStatId, uint32 value);
385
387 uint32 GetPlayersCountByTeam(Team team) const { return m_PlayersCount[GetTeamIndexByTeamId(team)]; }
388 uint32 GetAlivePlayersCountByTeam(Team team) const; // used in arenas to correctly handle death in spirit of redemption / last stand etc. (killer = killed) cases
389 void UpdatePlayersCountByTeam(Team team, bool remove)
390 {
391 if (remove)
392 --m_PlayersCount[GetTeamIndexByTeamId(team)];
393 else
394 ++m_PlayersCount[GetTeamIndexByTeamId(team)];
395 }
396
397 virtual void CheckWinConditions() { }
398
399 // used for rated arena battles
400 void SetArenaMatchmakerRating(Team team, uint32 MMR){ m_ArenaTeamMMR[GetTeamIndexByTeamId(team)] = MMR; }
401 uint32 GetArenaMatchmakerRating(Team team) const { return m_ArenaTeamMMR[GetTeamIndexByTeamId(team)]; }
402
403 // must be implemented in BG subclass if need AND call base class generic code
404 virtual void HandleKillPlayer(Player* player, Player* killer);
405 virtual void HandleKillUnit(Creature* /*creature*/, Unit* /*killer*/);
406
407 // Battleground events
408 void EventPlayerLoggedIn(Player* player);
409 void EventPlayerLoggedOut(Player* player);
410
411 virtual WorldSafeLocsEntry const* GetExploitTeleportLocation(Team /*team*/) { return nullptr; }
412 // GetExploitTeleportLocation(TeamId) must be implemented in the battleground subclass.
413 void TeleportPlayerToExploitLocation(Player* player);
414
415 virtual void AddPlayer(Player* player, BattlegroundQueueTypeId queueId); // must be implemented in BG subclass
416
417 void AddOrSetPlayerToCorrectBgGroup(Player* player, Team team);
418
419 virtual void RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket);
420
421 virtual bool HandlePlayerUnderMap(Player* /*player*/) { return false; }
422
423 // since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
424 Team GetPlayerTeam(ObjectGuid guid) const;
425 bool IsPlayerInBattleground(ObjectGuid guid) const;
426 bool IsPlayerMercenaryInBattleground(ObjectGuid guid) const;
427
428 bool ToBeDeleted() const { return m_SetDeleteThis; }
429 void SetDeleteThis() { m_SetDeleteThis = true; }
430
431 void RewardXPAtKill(Player* killer, Player* victim);
432 bool CanAwardArenaPoints() const { return GetMinLevel() >= BG_AWARD_ARENA_POINTS_MIN_LEVEL; }
433
434 uint32 GetTeamScore(TeamId teamId) const;
435
436 Team GetPrematureWinner();
437
438 // because BattleGrounds with different types and same level range has different m_BracketId
439 uint8 GetUniqueBracketId() const;
440
441 void AddPlayerPosition(WorldPackets::Battleground::BattlegroundPlayerPosition const& position);
442 void RemovePlayerPosition(ObjectGuid guid);
443
445 {
446 auto itr = m_Players.find(playerGuid);
447 if (itr == m_Players.end())
448 return nullptr;
449
450 return &itr->second;
451 }
452
453 void AddPoint(Team team, uint32 points = 1) { m_TeamScores[GetTeamIndexByTeamId(team)] += points; }
454 void SetTeamPoint(Team team, uint32 points = 0) { m_TeamScores[GetTeamIndexByTeamId(team)] = points; }
455 void RemovePoint(Team team, uint32 points = 1) { m_TeamScores[GetTeamIndexByTeamId(team)] -= points; }
456
458 void SetWeakPtr(Trinity::unique_weak_ptr<Battleground> weakRef) { m_weakRef = std::move(weakRef); }
459
460 protected:
461 // this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground
462 void EndNow();
463 void PlayerAddedToBGCheckIfBGIsRunning(Player* player);
464
465 Player* _GetPlayer(ObjectGuid guid, bool offlineRemove, char const* context) const;
466 Player* _GetPlayer(BattlegroundPlayerMap::iterator itr, char const* context) { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
467 Player* _GetPlayer(BattlegroundPlayerMap::const_iterator itr, char const* context) const { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
468 Player* _GetPlayerForTeam(Team team, BattlegroundPlayerMap::const_iterator itr, char const* context) const;
469
470 /* Pre- and post-update hooks */
471
485 virtual bool PreUpdateImpl(uint32 /* diff */) { return true; }
486
498 virtual void PostUpdateImpl(uint32 /* diff */) { }
499
500 void _ProcessOfflineQueue();
501 void _ProcessProgress(uint32 diff);
502 void _ProcessLeave(uint32 diff);
503 void _ProcessJoin(uint32 diff);
504 void _CheckSafePositions(uint32 diff);
505 void _ProcessPlayerPositionBroadcast(uint32 diff);
506
507 // Scorekeeping
509 // must be implemented in BG subclass
510 virtual void RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team*/) { }
511
512 // Player lists, those need to be accessible by inherited classes
514
515 // these are important variables used for starting messages
518 // this must be filled in constructors!
520
521 int32 m_TeamScores[PVP_TEAMS_COUNT];
522
523 private:
524 // Battleground
525 uint32 m_InstanceID; // Battleground Instance's GUID!
527 uint32 m_ClientInstanceID; // the instance-id which is sent to the client and without any other internal use
531 int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself
532 uint8 m_ArenaType; // 2=2v2, 3=3v3, 5=5v5
533 bool m_InBGFreeSlotQueue; // used to make sure that BG is only once inserted into the BattlegroundMgr.BGFreeSlotQueue[bgTypeId] deque
534 bool m_SetDeleteThis; // used for safe deletion of the bg after end / all players leave
535
538 bool m_IsRated; // is this battle rated?
542
543 // Player lists
544 std::deque<ObjectGuid> m_OfflineQueue; // Player GUID
545
546 // Invited counters are useful for player invitation to BG - do not allow, if BG is started to one faction to have 2 more players than another faction
547 // Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG
548 // Invited players counters
551
552 // Raid Group
553 Group* m_BgRaids[PVP_TEAMS_COUNT]; // 0 - alliance, 1 - horde
554
555 // Players count by team
556 uint32 m_PlayersCount[PVP_TEAMS_COUNT];
557
558 uint32 m_ArenaTeamMMR[PVP_TEAMS_COUNT];
559
560 // Start location
562 Position StartPosition[PVP_TEAMS_COUNT];
563
566 std::unordered_set<uint32> const* _pvpStatIds;
567
568 std::vector<WorldPackets::Battleground::BattlegroundPlayerPosition> _playerPositions;
569
570 // Time when the first message "the battle will begin in 2minutes" is send (or 1m for arenas)
572
574};
575#endif
BattlegroundTimeIntervals
@ INVITE_ACCEPT_WAIT_TIME
@ RESURRECTION_INTERVAL
@ ARENA_COUNTDOWN_MAX
@ PLAYER_POSITION_UPDATE_INTERVAL
@ MAX_OFFLINE_TIME
@ RESPAWN_IMMEDIATELY
@ BUFF_RESPAWN_TIME
@ TIME_AUTOCLOSE_BATTLEGROUND
@ BATTLEGROUND_COUNTDOWN_MAX
@ RESPAWN_ONE_DAY
@ CHECK_PLAYER_POSITION_INVERVAL
@ INVITATION_REMIND_TIME
ArenaType
@ ARENA_TYPE_5v5
@ ARENA_TYPE_3v3
@ ARENA_TYPE_2v2
BattlegroundStartingEvents
@ BG_STARTING_EVENT_NONE
@ BG_STARTING_EVENT_3
@ BG_STARTING_EVENT_2
@ BG_STARTING_EVENT_1
@ BG_STARTING_EVENT_4
BattlegroundBuffObjects
@ BG_OBJECTID_REGENBUFF_ENTRY
@ BG_OBJECTID_BERSERKERBUFF_ENTRY
@ BG_OBJECTID_SPEEDBUFF_ENTRY
BattlegroundMarksCount
@ ITEM_WINNER_COUNT
@ ITEM_LOSER_COUNT
BattlegroundCreatures
@ BG_CREATURE_ENTRY_H_SPIRITGUIDE
@ BG_CREATURE_ENTRY_A_SPIRITGUIDE
uint32 const Buff_Entries[3]
BattlegroundPlayerPositionConstants
@ PLAYER_POSITION_ARENA_SLOT_1
@ PLAYER_POSITION_ICON_NONE
@ PLAYER_POSITION_ARENA_SLOT_NONE
@ PLAYER_POSITION_ARENA_SLOT_4
@ PLAYER_POSITION_ICON_ALLIANCE_FLAG
@ PLAYER_POSITION_ARENA_SLOT_2
@ PLAYER_POSITION_ICON_HORDE_FLAG
@ PLAYER_POSITION_ARENA_SLOT_3
@ PLAYER_POSITION_ARENA_SLOT_5
BattlegroundBroadcastTexts
@ BG_TEXT_START_TWO_MINUTES
@ BG_TEXT_BATTLE_HAS_BEGUN
@ BG_TEXT_ALLIANCE_WINS
@ BG_TEXT_HORDE_WINS
@ BG_TEXT_START_ONE_MINUTE
@ BG_TEXT_START_HALF_MINUTE
BattlegroundSpells
@ SPELL_SPIRIT_HEAL_CHANNEL_AOE
@ SPELL_SPIRIT_HEAL
@ SPELL_AURA_PLAYER_INACTIVE
@ SPELL_MERCENARY_SHAPESHIFT
@ SPELL_RECENTLY_DROPPED_ALLIANCE_FLAG
@ SPELL_MERCENARY_ALLIANCE_REACTIONS
@ SPELL_PET_SUMMONED
@ SPELL_SPIRIT_HEAL_PLAYER_AURA
@ SPELL_MERCENARY_HORDE_REACTIONS
@ SPELL_MERCENARY_HORDE_1
@ SPELL_ARENA_PREPARATION
@ SPELL_RECENTLY_DROPPED_HORDE_FLAG
@ SPELL_MERCENARY_CONTRACT_ALLIANCE
@ SPELL_SPIRIT_HEAL_MANA
@ SPELL_HONORABLE_DEFENDER_25Y
@ SPELL_MERCENARY_CONTRACT_HORDE
@ SPELL_RECENTLY_DROPPED_NEUTRAL_FLAG
@ SPELL_PREPARATION
@ SPELL_SPIRIT_HEAL_CHANNEL_SELF
@ VISUAL_SPIRIT_HEAL_CHANNEL
@ SPELL_RESURRECTION_VISUAL
@ SPELL_MERCENARY_ALLIANCE_1
@ SPELL_WAITING_FOR_RESURRECT
@ SPELL_HONORABLE_DEFENDER_60Y
BattlegroundStartTimeIntervals
@ BG_START_DELAY_1M
@ BG_START_DELAY_30S
@ BG_START_DELAY_2M
@ BG_START_DELAY_NONE
@ BG_START_DELAY_15S
BattlegroundQueueIdType
BattlegroundPointCaptureStatus
#define BG_AWARD_ARENA_POINTS_MIN_LEVEL
BattlegroundStatus
@ STATUS_WAIT_QUEUE
@ STATUS_NONE
@ STATUS_WAIT_LEAVE
@ STATUS_WAIT_JOIN
@ STATUS_IN_PROGRESS
BattlegroundSounds
@ SOUND_BG_START
@ SOUND_ALLIANCE_WINS
@ SOUND_HORDE_WINS
@ SOUND_BG_START_L70ETC
#define BG_STARTING_EVENT_COUNT
BattlegroundQuests
@ SPELL_AV_QUEST_REWARD
@ SPELL_AB_QUEST_REWARD_4_BASES
@ SPELL_AB_QUEST_REWARD
@ SPELL_AB_QUEST_REWARD_5_BASES
@ SPELL_WS_QUEST_REWARD
@ SPELL_SA_QUEST_REWARD
@ SPELL_EY_QUEST_REWARD
@ SPELL_AV_QUEST_KILLED_BOSS
BattlegroundStartingEventsIds
@ BG_STARTING_EVENT_THIRD
@ BG_STARTING_EVENT_SECOND
@ BG_STARTING_EVENT_FIRST
@ BG_STARTING_EVENT_FOURTH
BattlegroundBracketId
Definition DBCEnums.h:53
#define TC_GAME_API
Definition Define.h:129
uint8_t uint8
Definition Define.h:156
int32_t int32
Definition Define.h:150
uint32_t uint32
Definition Define.h:154
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
Definition Duration.h:24
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition Optional.h:25
HonorGainSource
Definition Player.h:381
@ TEAM_ALLIANCE
@ TEAM_HORDE
uint8 constexpr PVP_TEAMS_COUNT
@ ALLIANCE
BattlegroundTypeId
PvPTeamId
ChatMsg
Definition Arena.h:57
uint32 m_InvitedAlliance
void UpdatePlayersCountByTeam(Team team, bool remove)
void SetRemainingTime(uint32 Time)
void SetInstanceID(uint32 InstanceID)
virtual bool HandlePlayerUnderMap(Player *)
PvPTeamId _winnerTeamId
bool ToBeDeleted() const
PVPDifficultyEntry const * _pvpDifficultyEntry
void SetDeleteThis()
void IncreaseInvitedCount(Team team)
void ModifyStartDelayTime(int diff)
void SetElapsedTime(uint32 Time)
std::unordered_set< uint32 > const * GetPvpStatIds() const
std::deque< ObjectGuid > m_OfflineQueue
uint8 GetArenaType() const
BattlegroundPlayerMap m_Players
time_t _preparationStartTime
uint32 m_ValidStartPositionTimer
int32 m_StartDelayTime
Group * GetBgRaid(Team team) const
BattlegroundTemplate const * _battlegroundTemplate
uint32 GetInvitedCount(Team team) const
void SetWinner(PvPTeamId winnerTeamId)
Battleground(Battleground const &)
uint32 m_ClientInstanceID
uint32 GetPlayerScoresSize() const
void RemovePoint(Team team, uint32 points=1)
void DecreaseInvitedCount(Team team)
Creature * GetBGCreature(uint32 type, bool logError=true)
bool CanAwardArenaPoints() const
bool isRated() const
virtual void PostUpdateImpl(uint32)
Post-update hook.
PvPTeamId GetWinner() const
void SetRated(bool state)
virtual void RemovePlayer(Player *, ObjectGuid, uint32)
BattlegroundMap * FindBgMap() const
uint32 GetRemainingTime() const
Milliseconds GetInProgressDuration() const
bool m_PrematureCountDown
uint32 GetInstanceID() const
Battleground & operator=(Battleground const &)=delete
uint32 m_PrematureCountDownTimer
virtual WorldSafeLocsEntry const * GetExploitTeleportLocation(Team)
void SetArenaMatchmakerRating(Team team, uint32 MMR)
uint32 GetClientInstanceID() const
BattlegroundPlayer const * GetBattlegroundPlayerData(ObjectGuid const &playerGuid) const
bool m_InBGFreeSlotQueue
void SetClientInstanceID(uint32 InstanceID)
static TeamId GetTeamIndexByTeamId(Team team)
void SetStatus(BattlegroundStatus Status)
uint32 m_LastPlayerPositionBroadcast
void SetArenaType(uint8 type)
uint32 m_InstanceID
uint32 m_ResetStatTimer
BattlegroundPlayerMap const & GetPlayers() const
int32 GetStartDelayTime() const
BattlegroundScoreMap PlayerScores
std::vector< WorldPackets::Battleground::BattlegroundPlayerPosition > _playerPositions
BattlegroundStatus GetStatus() const
uint32 GetPlayersCountByTeam(Team team) const
void AddPoint(Team team, uint32 points=1)
virtual bool PreUpdateImpl(uint32)
Pre-update hook.
Trinity::unique_weak_ptr< Battleground > m_weakRef
virtual void CheckWinConditions()
std::map< ObjectGuid, BattlegroundPlayer > BattlegroundPlayerMap
std::map< ObjectGuid, BattlegroundScore * > BattlegroundScoreMap
std::unordered_set< uint32 > const * _pvpStatIds
uint32 m_InvitedHorde
void SetTeamPoint(Team team, uint32 points=0)
uint32 GetArenaMatchmakerRating(Team team) const
uint32 GetElapsedTime() const
Trinity::unique_weak_ptr< Battleground > GetWeakPtr() const
uint32 GetPlayersSize() const
Player * _GetPlayer(BattlegroundPlayerMap::iterator itr, char const *context)
uint32 m_StartTime
void SetStartDelayTime(int Time)
GameObject * GetBGObject(uint32 type, bool logError=true)
BattlegroundMap * m_Map
void SetWeakPtr(Trinity::unique_weak_ptr< Battleground > weakRef)
Player * _GetPlayer(BattlegroundPlayerMap::const_iterator itr, char const *context) const
BattlegroundStatus m_Status
Definition Group.h:205
Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr.
Definition Unit.h:635
BattlegroundQueueTypeId queueTypeId