TrinityCore
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 "ObjectGuid.h"
23#include "Position.h"
24#include "SharedDefines.h"
25#include "UniqueTrackablePtr.h"
26#include "ZoneScript.h"
27#include <deque>
28#include <map>
29#include <vector>
30
31class BattlegroundMap;
32class Creature;
33class GameObject;
34class Group;
35class Player;
36class Transport;
37class Unit;
38class WorldObject;
39class WorldPacket;
40struct BattlegroundPlayerScoreTemplate;
45
46namespace WorldPackets
47{
48 namespace Battleground
49 {
50 struct PVPMatchStatistics;
51 struct BattlegroundPlayerPosition;
52 }
53
54}
55
57{
60
65};
66
68{
73};
74
76{
85};
86
88{
91};
92
94{
96 BG_CREATURE_ENTRY_H_SPIRITGUIDE = 13117 // horde
97};
98
100{
101 SPELL_SPIRIT_HEAL_CHANNEL_AOE = 22011, // used for AoE resurrections
102 SPELL_SPIRIT_HEAL_PLAYER_AURA = 156758, // individual player timers for resurrection
103 SPELL_SPIRIT_HEAL_CHANNEL_SELF = 305122, // channel visual for individual area spirit healers
104 SPELL_WAITING_FOR_RESURRECT = 2584, // Waiting to Resurrect
106 SPELL_SPIRIT_HEAL = 22012, // Spirit Heal
107 SPELL_RESURRECTION_VISUAL = 24171, // Resurrection Impact Visual
108 SPELL_ARENA_PREPARATION = 32727, // use this one, 32728 not correct
109 SPELL_PREPARATION = 44521, // Preparation
110 SPELL_SPIRIT_HEAL_MANA = 44535, // Spirit Heal
111 SPELL_RECENTLY_DROPPED_ALLIANCE_FLAG = 42792, // makes Alliance flag unselectable
112 SPELL_RECENTLY_DROPPED_HORDE_FLAG = 50326, // makes Horde flag unselectable
113 SPELL_RECENTLY_DROPPED_NEUTRAL_FLAG = 50327, // makes Neutral flag unselectable
114 SPELL_AURA_PLAYER_INACTIVE = 43681, // Inactive
115 SPELL_HONORABLE_DEFENDER_25Y = 68652, // +50% honor when standing at a capture point that you control, 25yards radius (added in 3.2)
116 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
124 SPELL_PET_SUMMONED = 6962 // used after resurrection
126
128{
131 //REMIND_INTERVAL = 10000, // ms
135 MAX_OFFLINE_TIME = 300, // secs
136 RESPAWN_ONE_DAY = 86400, // secs
138 BUFF_RESPAWN_TIME = 180, // secs
142};
143
145{
146 BG_START_DELAY_2M = 120000, // ms (2 minutes)
147 BG_START_DELAY_1M = 60000, // ms (1 minute)
148 BG_START_DELAY_30S = 30000, // ms (30 seconds)
149 BG_START_DELAY_15S = 15000, // ms (15 seconds) Used only in arena
150 BG_START_DELAY_NONE = 0 // ms
152
154{
159
161
163{
164 STATUS_NONE = 0, // first status, should mean bg is not instance
165 STATUS_WAIT_QUEUE = 1, // means bg is empty and waiting for queue
166 STATUS_WAIT_JOIN = 2, // this means, that BG has already started and it is waiting for more players
167 STATUS_IN_PROGRESS = 3, // means bg is running
168 STATUS_WAIT_LEAVE = 4 // means some faction has won BG and it is ending
170
172{
173 time_t OfflineRemoveTime; // for tracking and removing offline players from queue after 5 minutes
174 ::Team Team; // Player's team
177};
178
180{
182
186};
187
189{
194
196{
203
205{
211#define BG_STARTING_EVENT_COUNT 4
212
213#define BG_AWARD_ARENA_POINTS_MIN_LEVEL 71
214#define ARENA_TIMELIMIT_POINTS_LOSS -16
215
217{
221
229
231{
232 Battleground = 0,
233 Arena = 1,
234 Wargame = 2,
235 Cheat = 3,
236 ArenaSkirmish = 4
237};
238
240{
243 Neutral,
246};
247
248/*
249This class is used to:
2501. Add player to battleground
2512. Remove player from battleground
2523. some certain cases, same for all battlegrounds
2534. It has properties same for all battlegrounds
254*/
256{
257 public:
258 Battleground(BattlegroundTemplate const* battlegroundTemplate);
260 virtual ~Battleground();
261
263
264 void Update(uint32 diff);
265
266 void Reset();
267
268 /* Battleground */
269 // Get methods:
270 char const* GetName() const;
271 BattlegroundTypeId GetTypeID() const;
272 BattlegroundBracketId GetBracketId() const;
273 uint32 GetInstanceID() const { return m_InstanceID; }
274 BattlegroundStatus GetStatus() const { return m_Status; }
275 uint32 GetClientInstanceID() const { return m_ClientInstanceID; }
276 uint32 GetElapsedTime() const { return m_StartTime; }
277 uint32 GetRemainingTime() const { return m_EndTime; }
278 uint32 GetMaxPlayers() const;
279 uint32 GetMinPlayers() const;
280
281 uint32 GetMinLevel() const;
282 uint32 GetMaxLevel() const;
283
284 uint32 GetMaxPlayersPerTeam() const;
285 uint32 GetMinPlayersPerTeam() const;
286
287 int32 GetStartDelayTime() const { return m_StartDelayTime; }
288 uint8 GetArenaType() const { return m_ArenaType; }
289 PvPTeamId GetWinner() const { return _winnerTeamId; }
290 uint32 GetScriptId() const;
291 uint32 GetBonusHonorFromKill(uint32 kills) const;
292
293 // Set methods:
294 //here we can count minlevel and maxlevel for players
295 void SetBracket(PVPDifficultyEntry const* bracketEntry);
296 void SetInstanceID(uint32 InstanceID) { m_InstanceID = InstanceID; }
297 void SetStatus(BattlegroundStatus Status) { m_Status = Status; }
298 void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; }
299 void SetElapsedTime(uint32 Time) { m_StartTime = Time; }
300 void SetRemainingTime(uint32 Time) { m_EndTime = Time; }
301 void SetRated(bool state) { m_IsRated = state; }
302 void SetArenaType(uint8 type) { m_ArenaType = type; }
303 void SetWinner(PvPTeamId winnerTeamId) { _winnerTeamId = winnerTeamId; }
304 std::unordered_set<uint32> const* GetPvpStatIds() const { return _pvpStatIds; }
305
306 void ModifyStartDelayTime(int diff) { m_StartDelayTime -= diff; }
307 void SetStartDelayTime(int Time) { m_StartDelayTime = Time; }
308
309 void AddToBGFreeSlotQueue(); //this queue will be useful when more battlegrounds instances will be available
310 void RemoveFromBGFreeSlotQueue(); //this method could delete whole BG instance, if another free is available
311
312 void DecreaseInvitedCount(Team team) { (team == ALLIANCE) ? --m_InvitedAlliance : --m_InvitedHorde; }
313 void IncreaseInvitedCount(Team team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; }
314
315 uint32 GetInvitedCount(Team team) const { return (team == ALLIANCE) ? m_InvitedAlliance : m_InvitedHorde; }
316 bool HasFreeSlots() const;
317 uint32 GetFreeSlotsForTeam(Team team) const;
318
319 bool isArena() const;
320 bool isBattleground() const;
321 bool isRated() const { return m_IsRated; }
322
323 typedef std::map<ObjectGuid, BattlegroundPlayer> BattlegroundPlayerMap;
324 BattlegroundPlayerMap const& GetPlayers() const { return m_Players; }
325 uint32 GetPlayersSize() const { return uint32(m_Players.size()); }
326
327 typedef std::map<ObjectGuid, BattlegroundScore*> BattlegroundScoreMap;
328 uint32 GetPlayerScoresSize() const { return uint32(PlayerScores.size()); }
329
330 void StartBattleground();
331
332 GameObject* GetBGObject(uint32 type, bool logError = true);
333 Creature* GetBGCreature(uint32 type, bool logError = true);
334
335 // Location
336 uint32 GetMapId() const;
337
338 // Map pointers
339 void SetBgMap(BattlegroundMap* map);
340 BattlegroundMap* GetBgMap() const;
341 BattlegroundMap* FindBgMap() const { return m_Map; }
342
343 WorldSafeLocsEntry const* GetTeamStartPosition(TeamId teamId) const;
344
345 float GetStartMaxDist() const;
346
347 // Packet Transfer
348 // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!)
349 void SendPacketToTeam(Team team, WorldPacket const* packet, Player* except = nullptr) const;
350 void SendPacketToAll(WorldPacket const* packet) const;
351
352 void SendChatMessage(Creature* source, uint8 textId, WorldObject* target = nullptr);
353 void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const* target = nullptr);
354
355 template<class Do>
356 void BroadcastWorker(Do& _do);
357
358 void PlaySoundToTeam(uint32 SoundID, Team team);
359 void PlaySoundToAll(uint32 SoundID);
360 void CastSpellOnTeam(uint32 SpellID, Team team);
361 void RemoveAuraOnTeam(uint32 SpellID, Team team);
362 void RewardHonorToTeam(uint32 Honor, Team team);
363 void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, Team team);
364 void UpdateWorldState(int32 worldStateId, int32 value, bool hidden = false);
365 virtual void EndBattleground(Team winner);
366 void BlockMovement(Player* player);
367
368 void SendMessageToAll(uint32 entry, ChatMsg type, Player const* source = nullptr);
369 void PSendMessageToAll(uint32 entry, ChatMsg type, Player const* source, ...);
370
371 // Raid Group
372 Group* GetBgRaid(Team team) const { return team == ALLIANCE ? m_BgRaids[TEAM_ALLIANCE] : m_BgRaids[TEAM_HORDE]; }
373 void SetBgRaid(Team team, Group* bg_raid);
374
375 virtual void BuildPvPLogDataPacket(WorldPackets::Battleground::PVPMatchStatistics& pvpLogData) const;
376
377 BattlegroundScore const* GetBattlegroundScore(Player* player) const;
378
379 bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true);
380 void UpdatePvpStat(Player* player, uint32 pvpStatId, uint32 value);
381
383 uint32 GetPlayersCountByTeam(Team team) const { return m_PlayersCount[GetTeamIndexByTeamId(team)]; }
384 uint32 GetAlivePlayersCountByTeam(Team team) const; // used in arenas to correctly handle death in spirit of redemption / last stand etc. (killer = killed) cases
385 void UpdatePlayersCountByTeam(Team team, bool remove)
386 {
387 if (remove)
388 --m_PlayersCount[GetTeamIndexByTeamId(team)];
389 else
390 ++m_PlayersCount[GetTeamIndexByTeamId(team)];
391 }
392
393 virtual void CheckWinConditions() { }
394
395 // used for rated arena battles
396 void SetArenaTeamIdForTeam(Team team, uint32 ArenaTeamId) { m_ArenaTeamIds[GetTeamIndexByTeamId(team)] = ArenaTeamId; }
397 uint32 GetArenaTeamIdForTeam(Team team) const { return m_ArenaTeamIds[GetTeamIndexByTeamId(team)]; }
398 uint32 GetArenaTeamIdByIndex(TeamId teamId) const { return m_ArenaTeamIds[teamId]; }
399 void SetArenaMatchmakerRating(Team team, uint32 MMR){ m_ArenaTeamMMR[GetTeamIndexByTeamId(team)] = MMR; }
400 uint32 GetArenaMatchmakerRating(Team team) const { return m_ArenaTeamMMR[GetTeamIndexByTeamId(team)]; }
401
402 // must be implemented in BG subclass if need AND call base class generic code
403 virtual void HandleKillPlayer(Player* player, Player* killer);
404 virtual void HandleKillUnit(Creature* /*creature*/, Unit* /*killer*/);
405
406 // Battleground events
407 void EventPlayerLoggedIn(Player* player);
408 void EventPlayerLoggedOut(Player* player);
409
410 virtual WorldSafeLocsEntry const* GetExploitTeleportLocation(Team /*team*/) { return nullptr; }
411 // GetExploitTeleportLocation(TeamId) must be implemented in the battleground subclass.
412 void TeleportPlayerToExploitLocation(Player* player);
413
414 virtual void AddPlayer(Player* player, BattlegroundQueueTypeId queueId); // must be implemented in BG subclass
415
416 void AddOrSetPlayerToCorrectBgGroup(Player* player, Team team);
417
418 virtual void RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket);
419
420 virtual bool HandlePlayerUnderMap(Player* /*player*/) { return false; }
421
422 // since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
423 Team GetPlayerTeam(ObjectGuid guid) const;
424 bool IsPlayerInBattleground(ObjectGuid guid) const;
425 bool IsPlayerMercenaryInBattleground(ObjectGuid guid) const;
426
427 bool ToBeDeleted() const { return m_SetDeleteThis; }
428 void SetDeleteThis() { m_SetDeleteThis = true; }
429
430 void RewardXPAtKill(Player* killer, Player* victim);
431 bool CanAwardArenaPoints() const { return GetMinLevel() >= BG_AWARD_ARENA_POINTS_MIN_LEVEL; }
432
433 uint32 GetTeamScore(TeamId teamId) const;
434
435 Team GetPrematureWinner();
436
437 // because BattleGrounds with different types and same level range has different m_BracketId
438 uint8 GetUniqueBracketId() const;
439
440 void AddPlayerPosition(WorldPackets::Battleground::BattlegroundPlayerPosition const& position);
441 void RemovePlayerPosition(ObjectGuid guid);
442
444 {
445 auto const& itr = m_Players.find(playerGuid);
446 if (itr == m_Players.end())
447 return nullptr;
448
449 return &itr->second;
450 }
451
452 void AddPoint(Team team, uint32 points = 1) { m_TeamScores[GetTeamIndexByTeamId(team)] += points; }
453 void SetTeamPoint(Team team, uint32 points = 0) { m_TeamScores[GetTeamIndexByTeamId(team)] = points; }
454 void RemovePoint(Team team, uint32 points = 1) { m_TeamScores[GetTeamIndexByTeamId(team)] -= points; }
455
457 void SetWeakPtr(Trinity::unique_weak_ptr<Battleground> weakRef) { m_weakRef = std::move(weakRef); }
458
459 protected:
460 // this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground
461 void EndNow();
462 void PlayerAddedToBGCheckIfBGIsRunning(Player* player);
463
464 Player* _GetPlayer(ObjectGuid guid, bool offlineRemove, char const* context) const;
465 Player* _GetPlayer(BattlegroundPlayerMap::iterator itr, char const* context) { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
466 Player* _GetPlayer(BattlegroundPlayerMap::const_iterator itr, char const* context) const { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
467 Player* _GetPlayerForTeam(Team team, BattlegroundPlayerMap::const_iterator itr, char const* context) const;
468
469 /* Pre- and post-update hooks */
470
484 virtual bool PreUpdateImpl(uint32 /* diff */) { return true; }
485
497 virtual void PostUpdateImpl(uint32 /* diff */) { }
498
499 void _ProcessOfflineQueue();
500 void _ProcessProgress(uint32 diff);
501 void _ProcessLeave(uint32 diff);
502 void _ProcessJoin(uint32 diff);
503 void _CheckSafePositions(uint32 diff);
504 void _ProcessPlayerPositionBroadcast(uint32 diff);
505
506 // Scorekeeping
508 // must be implemented in BG subclass
509 virtual void RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team*/) { }
510
511 // Player lists, those need to be accessible by inherited classes
513
514 // these are important variables used for starting messages
517 // this must be filled in constructors!
519
520 int32 m_TeamScores[PVP_TEAMS_COUNT];
521
522 private:
523 // Battleground
524 uint32 m_InstanceID; // Battleground Instance's GUID!
526 uint32 m_ClientInstanceID; // the instance-id which is sent to the client and without any other internal use
530 int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself
531 uint8 m_ArenaType; // 2=2v2, 3=3v3, 5=5v5
532 bool m_InBGFreeSlotQueue; // used to make sure that BG is only once inserted into the BattlegroundMgr.BGFreeSlotQueue[bgTypeId] deque
533 bool m_SetDeleteThis; // used for safe deletion of the bg after end / all players leave
534
537 bool m_IsRated; // is this battle rated?
541
542 // Player lists
543 std::deque<ObjectGuid> m_OfflineQueue; // Player GUID
544
545 // 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
546 // Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG
547 // Invited players counters
550
551 // Raid Group
552 Group* m_BgRaids[PVP_TEAMS_COUNT]; // 0 - alliance, 1 - horde
553
554 // Players count by team
555 uint32 m_PlayersCount[PVP_TEAMS_COUNT];
556
557 // Arena team ids by team
558 uint32 m_ArenaTeamIds[PVP_TEAMS_COUNT];
559
560 uint32 m_ArenaTeamMMR[PVP_TEAMS_COUNT];
561
562 // Start location
564 Position StartPosition[PVP_TEAMS_COUNT];
565
568 std::unordered_set<uint32> const* _pvpStatIds;
569
570 std::vector<WorldPackets::Battleground::BattlegroundPlayerPosition> _playerPositions;
571
572 // Time when the first message "the battle will begin in 2minutes" is send (or 1m for arenas)
574
576};
577#endif
BattlegroundTimeIntervals
Definition: Battleground.h:128
@ INVITE_ACCEPT_WAIT_TIME
Definition: Battleground.h:133
@ RESURRECTION_INTERVAL
Definition: Battleground.h:130
@ ARENA_COUNTDOWN_MAX
Definition: Battleground.h:140
@ PLAYER_POSITION_UPDATE_INTERVAL
Definition: Battleground.h:141
@ MAX_OFFLINE_TIME
Definition: Battleground.h:135
@ RESPAWN_IMMEDIATELY
Definition: Battleground.h:137
@ BUFF_RESPAWN_TIME
Definition: Battleground.h:138
@ TIME_AUTOCLOSE_BATTLEGROUND
Definition: Battleground.h:134
@ BATTLEGROUND_COUNTDOWN_MAX
Definition: Battleground.h:139
@ RESPAWN_ONE_DAY
Definition: Battleground.h:136
@ CHECK_PLAYER_POSITION_INVERVAL
Definition: Battleground.h:129
@ INVITATION_REMIND_TIME
Definition: Battleground.h:132
ArenaType
Definition: Battleground.h:189
@ ARENA_TYPE_5v5
Definition: Battleground.h:192
@ ARENA_TYPE_3v3
Definition: Battleground.h:191
@ ARENA_TYPE_2v2
Definition: Battleground.h:190
BattlegroundStartingEvents
Definition: Battleground.h:196
@ BG_STARTING_EVENT_NONE
Definition: Battleground.h:197
@ BG_STARTING_EVENT_3
Definition: Battleground.h:200
@ BG_STARTING_EVENT_2
Definition: Battleground.h:199
@ BG_STARTING_EVENT_1
Definition: Battleground.h:198
@ BG_STARTING_EVENT_4
Definition: Battleground.h:201
BattlegroundBuffObjects
Definition: Battleground.h:154
@ BG_OBJECTID_REGENBUFF_ENTRY
Definition: Battleground.h:156
@ BG_OBJECTID_BERSERKERBUFF_ENTRY
Definition: Battleground.h:157
@ BG_OBJECTID_SPEEDBUFF_ENTRY
Definition: Battleground.h:155
BattlegroundMarksCount
Definition: Battleground.h:88
@ ITEM_WINNER_COUNT
Definition: Battleground.h:89
@ ITEM_LOSER_COUNT
Definition: Battleground.h:90
BattlegroundCreatures
Definition: Battleground.h:94
@ BG_CREATURE_ENTRY_H_SPIRITGUIDE
Definition: Battleground.h:96
@ BG_CREATURE_ENTRY_A_SPIRITGUIDE
Definition: Battleground.h:95
uint32 const Buff_Entries[3]
Definition: Battleground.h:160
BattlegroundPlayerPositionConstants
Definition: Battleground.h:217
@ PLAYER_POSITION_ARENA_SLOT_1
Definition: Battleground.h:223
@ PLAYER_POSITION_ICON_NONE
Definition: Battleground.h:218
@ PLAYER_POSITION_ARENA_SLOT_NONE
Definition: Battleground.h:222
@ PLAYER_POSITION_ARENA_SLOT_4
Definition: Battleground.h:226
@ PLAYER_POSITION_ICON_ALLIANCE_FLAG
Definition: Battleground.h:220
@ PLAYER_POSITION_ARENA_SLOT_2
Definition: Battleground.h:224
@ PLAYER_POSITION_ICON_HORDE_FLAG
Definition: Battleground.h:219
@ PLAYER_POSITION_ARENA_SLOT_3
Definition: Battleground.h:225
@ PLAYER_POSITION_ARENA_SLOT_5
Definition: Battleground.h:227
BattlegroundBroadcastTexts
Definition: Battleground.h:57
@ BG_TEXT_START_TWO_MINUTES
Definition: Battleground.h:61
@ BG_TEXT_BATTLE_HAS_BEGUN
Definition: Battleground.h:64
@ BG_TEXT_ALLIANCE_WINS
Definition: Battleground.h:58
@ BG_TEXT_HORDE_WINS
Definition: Battleground.h:59
@ BG_TEXT_START_ONE_MINUTE
Definition: Battleground.h:62
@ BG_TEXT_START_HALF_MINUTE
Definition: Battleground.h:63
BattlegroundSpells
Definition: Battleground.h:100
@ SPELL_SPIRIT_HEAL_CHANNEL_AOE
Definition: Battleground.h:101
@ SPELL_SPIRIT_HEAL
Definition: Battleground.h:106
@ SPELL_AURA_PLAYER_INACTIVE
Definition: Battleground.h:114
@ SPELL_MERCENARY_SHAPESHIFT
Definition: Battleground.h:123
@ SPELL_RECENTLY_DROPPED_ALLIANCE_FLAG
Definition: Battleground.h:111
@ SPELL_MERCENARY_ALLIANCE_REACTIONS
Definition: Battleground.h:122
@ SPELL_PET_SUMMONED
Definition: Battleground.h:124
@ SPELL_SPIRIT_HEAL_PLAYER_AURA
Definition: Battleground.h:102
@ SPELL_MERCENARY_HORDE_REACTIONS
Definition: Battleground.h:120
@ SPELL_MERCENARY_HORDE_1
Definition: Battleground.h:119
@ SPELL_ARENA_PREPARATION
Definition: Battleground.h:108
@ SPELL_RECENTLY_DROPPED_HORDE_FLAG
Definition: Battleground.h:112
@ SPELL_MERCENARY_CONTRACT_ALLIANCE
Definition: Battleground.h:118
@ SPELL_SPIRIT_HEAL_MANA
Definition: Battleground.h:110
@ SPELL_HONORABLE_DEFENDER_25Y
Definition: Battleground.h:115
@ SPELL_MERCENARY_CONTRACT_HORDE
Definition: Battleground.h:117
@ SPELL_RECENTLY_DROPPED_NEUTRAL_FLAG
Definition: Battleground.h:113
@ SPELL_PREPARATION
Definition: Battleground.h:109
@ SPELL_SPIRIT_HEAL_CHANNEL_SELF
Definition: Battleground.h:103
@ VISUAL_SPIRIT_HEAL_CHANNEL
Definition: Battleground.h:105
@ SPELL_RESURRECTION_VISUAL
Definition: Battleground.h:107
@ SPELL_MERCENARY_ALLIANCE_1
Definition: Battleground.h:121
@ SPELL_WAITING_FOR_RESURRECT
Definition: Battleground.h:104
@ SPELL_HONORABLE_DEFENDER_60Y
Definition: Battleground.h:116
BattlegroundStartTimeIntervals
Definition: Battleground.h:145
@ BG_START_DELAY_1M
Definition: Battleground.h:147
@ BG_START_DELAY_30S
Definition: Battleground.h:148
@ BG_START_DELAY_2M
Definition: Battleground.h:146
@ BG_START_DELAY_NONE
Definition: Battleground.h:150
@ BG_START_DELAY_15S
Definition: Battleground.h:149
BattlegroundQueueIdType
Definition: Battleground.h:231
BattlegroundPointCaptureStatus
Definition: Battleground.h:240
#define BG_AWARD_ARENA_POINTS_MIN_LEVEL
Definition: Battleground.h:213
BattlegroundStatus
Definition: Battleground.h:163
@ STATUS_WAIT_QUEUE
Definition: Battleground.h:165
@ STATUS_NONE
Definition: Battleground.h:164
@ STATUS_WAIT_LEAVE
Definition: Battleground.h:168
@ STATUS_WAIT_JOIN
Definition: Battleground.h:166
@ STATUS_IN_PROGRESS
Definition: Battleground.h:167
BattlegroundSounds
Definition: Battleground.h:68
@ SOUND_BG_START
Definition: Battleground.h:71
@ SOUND_ALLIANCE_WINS
Definition: Battleground.h:70
@ SOUND_HORDE_WINS
Definition: Battleground.h:69
@ SOUND_BG_START_L70ETC
Definition: Battleground.h:72
#define BG_STARTING_EVENT_COUNT
Definition: Battleground.h:211
BattlegroundQuests
Definition: Battleground.h:76
@ SPELL_AV_QUEST_REWARD
Definition: Battleground.h:79
@ SPELL_AB_QUEST_REWARD_4_BASES
Definition: Battleground.h:83
@ SPELL_AB_QUEST_REWARD
Definition: Battleground.h:78
@ SPELL_AB_QUEST_REWARD_5_BASES
Definition: Battleground.h:84
@ SPELL_WS_QUEST_REWARD
Definition: Battleground.h:77
@ SPELL_SA_QUEST_REWARD
Definition: Battleground.h:82
@ SPELL_EY_QUEST_REWARD
Definition: Battleground.h:81
@ SPELL_AV_QUEST_KILLED_BOSS
Definition: Battleground.h:80
BattlegroundStartingEventsIds
Definition: Battleground.h:205
@ BG_STARTING_EVENT_THIRD
Definition: Battleground.h:208
@ BG_STARTING_EVENT_SECOND
Definition: Battleground.h:207
@ BG_STARTING_EVENT_FIRST
Definition: Battleground.h:206
@ BG_STARTING_EVENT_FOURTH
Definition: Battleground.h:209
BattlegroundBracketId
Definition: DBCEnums.h:59
#define TC_GAME_API
Definition: Define.h:123
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:142
TeamId
@ TEAM_ALLIANCE
@ TEAM_HORDE
uint8 constexpr PVP_TEAMS_COUNT
Team
@ ALLIANCE
BattlegroundTypeId
PvPTeamId
ChatMsg
Definition: Arena.h:57
uint32 m_InvitedAlliance
Definition: Battleground.h:548
void UpdatePlayersCountByTeam(Team team, bool remove)
Definition: Battleground.h:385
void SetRemainingTime(uint32 Time)
Definition: Battleground.h:300
void SetInstanceID(uint32 InstanceID)
Definition: Battleground.h:296
bool m_SetDeleteThis
Definition: Battleground.h:533
virtual bool HandlePlayerUnderMap(Player *)
Definition: Battleground.h:420
PvPTeamId _winnerTeamId
Definition: Battleground.h:535
bool ToBeDeleted() const
Definition: Battleground.h:427
PVPDifficultyEntry const * _pvpDifficultyEntry
Definition: Battleground.h:567
void SetDeleteThis()
Definition: Battleground.h:428
void IncreaseInvitedCount(Team team)
Definition: Battleground.h:313
void ModifyStartDelayTime(int diff)
Definition: Battleground.h:306
void SetElapsedTime(uint32 Time)
Definition: Battleground.h:299
std::unordered_set< uint32 > const * GetPvpStatIds() const
Definition: Battleground.h:304
std::deque< ObjectGuid > m_OfflineQueue
Definition: Battleground.h:543
uint8 GetArenaType() const
Definition: Battleground.h:288
BattlegroundPlayerMap m_Players
Definition: Battleground.h:512
time_t _preparationStartTime
Definition: Battleground.h:573
uint32 m_ValidStartPositionTimer
Definition: Battleground.h:529
int32 m_StartDelayTime
Definition: Battleground.h:536
Group * GetBgRaid(Team team) const
Definition: Battleground.h:372
uint32 GetArenaTeamIdForTeam(Team team) const
Definition: Battleground.h:397
BattlegroundTemplate const * _battlegroundTemplate
Definition: Battleground.h:566
uint32 GetInvitedCount(Team team) const
Definition: Battleground.h:315
void SetWinner(PvPTeamId winnerTeamId)
Definition: Battleground.h:303
Battleground(Battleground const &)
uint32 m_ClientInstanceID
Definition: Battleground.h:526
uint32 GetPlayerScoresSize() const
Definition: Battleground.h:328
void RemovePoint(Team team, uint32 points=1)
Definition: Battleground.h:454
void DecreaseInvitedCount(Team team)
Definition: Battleground.h:312
Creature * GetBGCreature(uint32 type, bool logError=true)
bool CanAwardArenaPoints() const
Definition: Battleground.h:431
bool isRated() const
Definition: Battleground.h:321
virtual void PostUpdateImpl(uint32)
Post-update hook.
Definition: Battleground.h:497
PvPTeamId GetWinner() const
Definition: Battleground.h:289
void SetRated(bool state)
Definition: Battleground.h:301
virtual void RemovePlayer(Player *, ObjectGuid, uint32)
Definition: Battleground.h:509
BattlegroundMap * FindBgMap() const
Definition: Battleground.h:341
uint32 GetArenaTeamIdByIndex(TeamId teamId) const
Definition: Battleground.h:398
uint32 GetRemainingTime() const
Definition: Battleground.h:277
bool m_PrematureCountDown
Definition: Battleground.h:538
uint32 GetInstanceID() const
Definition: Battleground.h:273
Battleground & operator=(Battleground const &)=delete
uint32 m_PrematureCountDownTimer
Definition: Battleground.h:539
void SetArenaTeamIdForTeam(Team team, uint32 ArenaTeamId)
Definition: Battleground.h:396
virtual WorldSafeLocsEntry const * GetExploitTeleportLocation(Team)
Definition: Battleground.h:410
void SetArenaMatchmakerRating(Team team, uint32 MMR)
Definition: Battleground.h:399
uint32 GetClientInstanceID() const
Definition: Battleground.h:275
BattlegroundPlayer const * GetBattlegroundPlayerData(ObjectGuid const &playerGuid) const
Definition: Battleground.h:443
bool m_InBGFreeSlotQueue
Definition: Battleground.h:532
void SetClientInstanceID(uint32 InstanceID)
Definition: Battleground.h:298
static TeamId GetTeamIndexByTeamId(Team team)
Definition: Battleground.h:382
void SetStatus(BattlegroundStatus Status)
Definition: Battleground.h:297
uint32 m_LastPlayerPositionBroadcast
Definition: Battleground.h:540
void SetArenaType(uint8 type)
Definition: Battleground.h:302
uint32 m_InstanceID
Definition: Battleground.h:524
uint32 m_ResetStatTimer
Definition: Battleground.h:528
BattlegroundPlayerMap const & GetPlayers() const
Definition: Battleground.h:324
int32 GetStartDelayTime() const
Definition: Battleground.h:287
BattlegroundScoreMap PlayerScores
Definition: Battleground.h:507
std::vector< WorldPackets::Battleground::BattlegroundPlayerPosition > _playerPositions
Definition: Battleground.h:570
BattlegroundStatus GetStatus() const
Definition: Battleground.h:274
uint8 m_ArenaType
Definition: Battleground.h:531
uint32 GetPlayersCountByTeam(Team team) const
Definition: Battleground.h:383
void AddPoint(Team team, uint32 points=1)
Definition: Battleground.h:452
virtual bool PreUpdateImpl(uint32)
Pre-update hook.
Definition: Battleground.h:484
Trinity::unique_weak_ptr< Battleground > m_weakRef
Definition: Battleground.h:575
virtual void CheckWinConditions()
Definition: Battleground.h:393
std::map< ObjectGuid, BattlegroundPlayer > BattlegroundPlayerMap
Definition: Battleground.h:323
std::map< ObjectGuid, BattlegroundScore * > BattlegroundScoreMap
Definition: Battleground.h:327
std::unordered_set< uint32 > const * _pvpStatIds
Definition: Battleground.h:568
uint32 m_InvitedHorde
Definition: Battleground.h:549
void SetTeamPoint(Team team, uint32 points=0)
Definition: Battleground.h:453
uint32 GetArenaMatchmakerRating(Team team) const
Definition: Battleground.h:400
uint32 GetElapsedTime() const
Definition: Battleground.h:276
Trinity::unique_weak_ptr< Battleground > GetWeakPtr() const
Definition: Battleground.h:456
uint32 GetPlayersSize() const
Definition: Battleground.h:325
Player * _GetPlayer(BattlegroundPlayerMap::iterator itr, char const *context)
Definition: Battleground.h:465
uint32 m_StartTime
Definition: Battleground.h:527
void SetStartDelayTime(int Time)
Definition: Battleground.h:307
GameObject * GetBGObject(uint32 type, bool logError=true)
BattlegroundMap * m_Map
Definition: Battleground.h:563
void SetWeakPtr(Trinity::unique_weak_ptr< Battleground > weakRef)
Definition: Battleground.h:457
Player * _GetPlayer(BattlegroundPlayerMap::const_iterator itr, char const *context) const
Definition: Battleground.h:466
BattlegroundStatus m_Status
Definition: Battleground.h:525
Definition: Group.h:205
Definition: Unit.h:630
TC_GAME_API bool GetName(uint32 accountId, std::string &name)
void Update(VignetteData &vignette, WorldObject const *owner)
Definition: Vignette.cpp:101
BattlegroundQueueTypeId queueTypeId
Definition: Battleground.h:176