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 "ArenaScore.h"
22#include "DBCEnums.h"
23#include "ObjectGuid.h"
24#include "Position.h"
25#include "SharedDefines.h"
26#include "UniqueTrackablePtr.h"
27#include <deque>
28#include <map>
29
30namespace WorldPackets
31{
32 namespace Battleground
33 {
35 }
36 namespace WorldState
37 {
38 class InitWorldStates;
39 }
40}
41
42class BattlegroundMap;
43class Creature;
44class GameObject;
45class Group;
46class Player;
47class Transport;
48class Unit;
49class WorldObject;
50class WorldPacket;
51
55
57{
58 BG_DESERTION_TYPE_LEAVE_BG = 0, // player leaves the BG
59 BG_DESERTION_TYPE_OFFLINE = 1, // player is kicked from BG because offline
60 BG_DESERTION_TYPE_LEAVE_QUEUE = 2, // player is invited to join and refuses to do it
61 BG_DESERTION_TYPE_NO_ENTER_BUTTON = 3, // player is invited to join and do nothing (time expires)
62 BG_DESERTION_TYPE_INVITE_LOGOUT = 4, // player is invited to join and logs out
63};
64
74
85
93
105
122
128
134
136{
137 SPELL_WAITING_FOR_RESURRECT = 2584, // Waiting to Resurrect
138 SPELL_SPIRIT_HEAL_CHANNEL = 22011, // Spirit Heal Channel
139 SPELL_SPIRIT_HEAL = 22012, // Spirit Heal
140 SPELL_RESURRECTION_VISUAL = 24171, // Resurrection Impact Visual
141 SPELL_ARENA_PREPARATION = 32727, // use this one, 32728 not correct
142 SPELL_PREPARATION = 44521, // Preparation
143 SPELL_SPIRIT_HEAL_MANA = 44535, // Spirit Heal
144 SPELL_RECENTLY_DROPPED_FLAG = 42792, // Recently Dropped Flag
145 SPELL_AURA_PLAYER_INACTIVE = 43681, // Inactive
146 SPELL_HONORABLE_DEFENDER_25Y = 68652, // +50% honor when standing at a capture point that you control, 25yards radius (added in 3.2)
147 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
149
151{
154 //REMIND_INTERVAL = 10000, // ms
157 TIME_TO_AUTOREMOVE = 120000, // ms
158 MAX_OFFLINE_TIME = 300, // secs
159 RESPAWN_ONE_DAY = 86400, // secs
161 BUFF_RESPAWN_TIME = 180 // secs
163
165{
166 BG_START_DELAY_2M = 120000, // ms (2 minutes)
167 BG_START_DELAY_1M = 60000, // ms (1 minute)
168 BG_START_DELAY_30S = 30000, // ms (30 seconds)
169 BG_START_DELAY_15S = 15000, // ms (15 seconds) Used only in arena
170 BG_START_DELAY_NONE = 0 // ms
172
179
181
183{
184 STATUS_NONE = 0, // first status, should mean bg is not instance
185 STATUS_WAIT_QUEUE = 1, // means bg is empty and waiting for queue
186 STATUS_WAIT_JOIN = 2, // this means, that BG has already started and it is waiting for more players
187 STATUS_IN_PROGRESS = 3, // means bg is running
188 STATUS_WAIT_LEAVE = 4 // means some faction has won BG and it is ending
190
192{
193 time_t OfflineRemoveTime; // for tracking and removing offline players from queue after 5 minutes
194 uint32 Team; // Player's team
195};
196
205
212
221
229#define BG_STARTING_EVENT_COUNT 4
230
237
238#define BG_AWARD_ARENA_POINTS_MIN_LEVEL 71
239#define ARENA_TIMELIMIT_POINTS_LOSS -16
240
241/*
242This class is used to:
2431. Add player to battleground
2442. Remove player from battleground
2453. some certain cases, same for all battlegrounds
2464. It has properties same for all battlegrounds
247*/
249{
250 public:
251 Battleground();
252 virtual ~Battleground();
253
254 void Update(uint32 diff);
255
256 virtual bool SetupBattleground() // must be implemented in BG subclass
257 {
258 return true;
259 }
260 virtual void Reset(); // resets all common properties for battlegrounds, must be implemented and called in BG subclass
261 virtual void StartingEventCloseDoors() { }
262 virtual void StartingEventOpenDoors() { }
263 virtual void ResetBGSubclass() { } // must be implemented in BG subclass
264
265 virtual void DestroyGate(Player* /*player*/, GameObject* /*go*/) { }
266
267 /* achievement req. */
268 virtual bool IsAllNodesControlledByTeam(uint32 /*team*/) const { return false; }
269 void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry);
270 virtual bool CheckAchievementCriteriaMeet(uint32 /*criteriaId*/, Player const* /*player*/, Unit const* /*target*/ = nullptr, uint32 /*miscvalue1*/ = 0);
271
272 /* Battleground */
273 // Get methods:
274 std::string const& GetName() const { return m_Name; }
275 BattlegroundTypeId GetTypeID(bool GetRandom = false) const { return GetRandom ? m_RandomTypeID : m_TypeID; }
276 BattlegroundBracketId GetBracketId() const { return m_BracketId; }
277 uint32 GetInstanceID() const { return m_InstanceID; }
278 BattlegroundStatus GetStatus() const { return m_Status; }
279 uint32 GetClientInstanceID() const { return m_ClientInstanceID; }
280 uint32 GetStartTime() const { return m_StartTime; }
281 uint32 GetEndTime() const { return m_EndTime; }
282 uint32 GetLastResurrectTime() const { return m_LastResurrectTime; }
283 uint32 GetMaxPlayers() const { return m_MaxPlayers; }
284 uint32 GetMinPlayers() const { return m_MinPlayers; }
285
286 uint32 GetMinLevel() const { return m_LevelMin; }
287 uint32 GetMaxLevel() const { return m_LevelMax; }
288
289 uint32 GetMaxPlayersPerTeam() const { return m_MaxPlayersPerTeam; }
290 uint32 GetMinPlayersPerTeam() const { return m_MinPlayersPerTeam; }
291
292 int32 GetStartDelayTime() const { return m_StartDelayTime; }
293 uint8 GetArenaType() const { return m_ArenaType; }
294 PvPTeamId GetWinner() const { return _winnerTeamId; }
295 uint32 GetScriptId() const { return ScriptId; }
296 uint32 GetBonusHonorFromKill(uint32 kills) const;
297 bool IsRandom() const { return m_IsRandom; }
298
299 // Set methods:
300 void SetName(std::string const& name) { m_Name = name; }
303 //here we can count minlevel and maxlevel for players
304 void SetBracket(PvPDifficultyEntry const* bracketEntry);
305 void SetInstanceID(uint32 InstanceID) { m_InstanceID = InstanceID; }
306 void SetStatus(BattlegroundStatus Status) { m_Status = Status; }
307 void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; }
308 void SetStartTime(uint32 Time) { m_StartTime = Time; }
309 void SetEndTime(uint32 Time) { m_EndTime = Time; }
310 void SetLastResurrectTime(uint32 Time) { m_LastResurrectTime = Time; }
311 void SetMaxPlayers(uint32 MaxPlayers) { m_MaxPlayers = MaxPlayers; }
312 void SetMinPlayers(uint32 MinPlayers) { m_MinPlayers = MinPlayers; }
313 void SetLevelRange(uint32 min, uint32 max) { m_LevelMin = min; m_LevelMax = max; }
314 void SetRated(bool state) { m_IsRated = state; }
315 void SetArenaType(uint8 type) { m_ArenaType = type; }
316 void SetArenaorBGType(bool _isArena) { m_IsArena = _isArena; }
317 void SetWinner(PvPTeamId winnerTeamId) { _winnerTeamId = winnerTeamId; }
318 void SetScriptId(uint32 scriptId) { ScriptId = scriptId; }
319
320 void ModifyStartDelayTime(int diff) { m_StartDelayTime -= diff; }
321 void SetStartDelayTime(int Time) { m_StartDelayTime = Time; }
322
323 void SetMaxPlayersPerTeam(uint32 MaxPlayers) { m_MaxPlayersPerTeam = MaxPlayers; }
324 void SetMinPlayersPerTeam(uint32 MinPlayers) { m_MinPlayersPerTeam = MinPlayers; }
325
326 void AddToBGFreeSlotQueue(); //this queue will be useful when more battlegrounds instances will be available
327 void RemoveFromBGFreeSlotQueue(); //this method could delete whole BG instance, if another free is available
328 void RemoveFromBGFreeSlotQueueOnShutdown() { m_InBGFreeSlotQueue = false; }
329
330 void DecreaseInvitedCount(uint32 team) { (team == ALLIANCE) ? --m_InvitedAlliance : --m_InvitedHorde; }
331 void IncreaseInvitedCount(uint32 team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; }
332
333 void SetRandom(bool isRandom) { m_IsRandom = isRandom; }
334 uint32 GetInvitedCount(uint32 team) const { return (team == ALLIANCE) ? m_InvitedAlliance : m_InvitedHorde; }
335 bool HasFreeSlots() const;
336 uint32 GetFreeSlotsForTeam(uint32 Team) const;
337
338 bool isArena() const { return m_IsArena; }
339 bool isBattleground() const { return !m_IsArena; }
340 bool isRated() const { return m_IsRated; }
341
342 typedef std::map<ObjectGuid, BattlegroundPlayer> BattlegroundPlayerMap;
343 BattlegroundPlayerMap const& GetPlayers() const { return m_Players; }
344 uint32 GetPlayersSize() const { return m_Players.size(); }
345
346 typedef std::map<ObjectGuid, BattlegroundScore*> BattlegroundScoreMap;
347 uint32 GetPlayerScoresSize() const { return PlayerScores.size(); }
348
349 uint32 GetReviveQueueSize() const { return m_ReviveQueue.size(); }
350
351 void AddPlayerToResurrectQueue(ObjectGuid npc_guid, ObjectGuid player_guid);
352 void RemovePlayerFromResurrectQueue(ObjectGuid player_guid);
353
355 void RelocateDeadPlayers(ObjectGuid guideGuid);
356
357 void StartBattleground();
358
359 GameObject* GetBGObject(uint32 type, bool logError = true);
360 Creature* GetBGCreature(uint32 type, bool logError = true);
361
362 // Location
363 void SetMapId(uint32 MapID) { m_MapId = MapID; }
364 uint32 GetMapId() const { return m_MapId; }
365
366 // Map pointers
367 void SetBgMap(BattlegroundMap* map) { m_Map = map; }
368 BattlegroundMap* GetBgMap() const { ASSERT(m_Map); return m_Map; }
369 BattlegroundMap* FindBgMap() const { return m_Map; }
370
371 void SetTeamStartPosition(TeamId teamId, Position const& pos);
372 Position const* GetTeamStartPosition(TeamId teamId) const;
373
374 void SetStartMaxDist(float startMaxDist) { m_StartMaxDist = startMaxDist; }
375 float GetStartMaxDist() const { return m_StartMaxDist; }
376
377 // Packet Transfer
378 // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!)
380 void SendPacketToTeam(uint32 TeamID, WorldPacket const* packet, Player* sender = nullptr, bool self = true) const;
381 void SendPacketToAll(WorldPacket const* packet) const;
382
383 void SendChatMessage(Creature* source, uint8 textId, WorldObject* target = nullptr);
384 void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const* target = nullptr);
385
386 template<class Do>
387 void BroadcastWorker(Do& _do);
388
389 void PlaySoundToTeam(uint32 soundID, uint32 teamID);
390 void PlaySoundToAll(uint32 soundID);
391 void CastSpellOnTeam(uint32 SpellID, uint32 TeamID);
392 void RemoveAuraOnTeam(uint32 SpellID, uint32 TeamID);
393 void RewardHonorToTeam(uint32 Honor, uint32 TeamID);
394 void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID);
395 void UpdateWorldState(uint32 variable, uint32 value);
396 virtual void EndBattleground(uint32 winner);
397 void BlockMovement(Player* player);
398
399 void SendWarningToAll(uint32 entry, ...);
400 void SendMessageToAll(uint32 entry, ChatMsg type, Player const* source = nullptr);
401 void PSendMessageToAll(uint32 entry, ChatMsg type, Player const* source, ...);
402
403 // Raid Group
404 Group* GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[TEAM_ALLIANCE] : m_BgRaids[TEAM_HORDE]; }
405 void SetBgRaid(uint32 TeamID, Group* bg_raid);
406
407 void BuildPvPLogDataPacket(WorldPackets::Battleground::PVPMatchStatistics& pvpLogData);
408 virtual bool UpdatePlayerScore(Player* player, uint32 type, uint32 value, bool doAddHonor = true);
409
411 uint32 GetPlayersCountByTeam(uint32 Team) const { return m_PlayersCount[GetTeamIndexByTeamId(Team)]; }
412 uint32 GetAlivePlayersCountByTeam(uint32 Team) const; // used in arenas to correctly handle death in spirit of redemption / last stand etc. (killer = killed) cases
414 {
415 if (remove)
416 --m_PlayersCount[GetTeamIndexByTeamId(Team)];
417 else
418 ++m_PlayersCount[GetTeamIndexByTeamId(Team)];
419 }
420
421 virtual void CheckWinConditions() { }
422
423 // used for rated arena battles
424 void SetArenaTeamIdForTeam(uint32 Team, uint32 ArenaTeamId) { m_ArenaTeamIds[GetTeamIndexByTeamId(Team)] = ArenaTeamId; }
425 uint32 GetArenaTeamIdForTeam(uint32 Team) const { return m_ArenaTeamIds[GetTeamIndexByTeamId(Team)]; }
426 uint32 GetArenaTeamIdByIndex(uint32 index) const { return m_ArenaTeamIds[index]; }
427 void SetArenaMatchmakerRating(uint32 Team, uint32 MMR){ m_ArenaTeamMMR[GetTeamIndexByTeamId(Team)] = MMR; }
428 uint32 GetArenaMatchmakerRating(uint32 Team) const { return m_ArenaTeamMMR[GetTeamIndexByTeamId(Team)]; }
429
430 // Triggers handle
431 // must be implemented in BG subclass
432 virtual void HandleAreaTrigger(Player* /*player*/, uint32 /*Trigger*/);
433 // must be implemented in BG subclass if need AND call base class generic code
434 virtual void HandleKillPlayer(Player* player, Player* killer);
435 virtual void HandleKillUnit(Creature* /*creature*/, Player* /*killer*/) { }
436
437 // Battleground events
438 virtual void EventPlayerDroppedFlag(Player* /*player*/) { }
439 virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) { }
440 void EventPlayerLoggedIn(Player* player);
441 void EventPlayerLoggedOut(Player* player);
442 virtual void ProcessEvent(WorldObject* /*obj*/, uint32 /*eventId*/, WorldObject* /*invoker*/ = nullptr) { }
443
444 // this function can be used by spell to interact with the BG map
445 virtual void DoAction(uint32 /*action*/, ObjectGuid /*var*/) { }
446
447 virtual void HandlePlayerResurrect(Player* /*player*/) { }
448
449 // Death related
450 virtual WorldSafeLocsEntry const* GetClosestGraveyard(Player* player);
451
452 virtual void AddPlayer(Player* player); // must be implemented in BG subclass
453
454 void AddOrSetPlayerToCorrectBgGroup(Player* player, uint32 team);
455
456 virtual void RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket);
457 // can be extended in in BG subclass
458
459 void HandleTriggerBuff(ObjectGuid go_guid);
460 void SetHoliday(bool is_holiday);
461
465 void SpawnBGObject(uint32 type, uint32 respawntime);
466 virtual 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);
467 bool AddObject(uint32 type, uint32 entry, Position const& pos, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime = 0, GOState goState = GO_STATE_READY);
468 virtual Creature* AddCreature(uint32 entry, uint32 type, float x, float y, float z, float o, TeamId teamId = TEAM_NEUTRAL, uint32 respawntime = 0, Transport* transport = nullptr);
469 Creature* AddCreature(uint32 entry, uint32 type, Position const& pos, TeamId teamId = TEAM_NEUTRAL, uint32 respawntime = 0, Transport* transport = nullptr);
470 bool DelCreature(uint32 type);
471 bool DelObject(uint32 type);
472 bool RemoveObjectFromWorld(uint32 type);
473 virtual bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId = TEAM_NEUTRAL);
474 bool AddSpiritGuide(uint32 type, Position const& pos, TeamId teamId = TEAM_NEUTRAL);
475 int32 GetObjectType(ObjectGuid guid);
476
477 void DoorOpen(uint32 type);
478 void DoorClose(uint32 type);
479
480 virtual bool HandlePlayerUnderMap(Player* /*player*/) { return false; }
481
482 // since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
483 uint32 GetPlayerTeam(ObjectGuid guid) const;
484 uint32 GetOtherTeam(uint32 teamId) const;
485 bool IsPlayerInBattleground(ObjectGuid guid) const;
486
487 bool ToBeDeleted() const { return m_SetDeleteThis; }
488 void SetDeleteThis() { m_SetDeleteThis = true; }
489
490 void RewardXPAtKill(Player* killer, Player* victim);
491 bool CanAwardArenaPoints() const { return m_LevelMin >= BG_AWARD_ARENA_POINTS_MIN_LEVEL; }
492
493 virtual ObjectGuid GetFlagPickerGUID(int32 /*team*/ = -1) const { return ObjectGuid::Empty; }
494 virtual void SetDroppedFlagGUID(ObjectGuid /*guid*/, int32 /*team*/ = -1) { }
495 virtual void HandleQuestComplete(uint32 /*questid*/, Player* /*player*/) { }
496 virtual bool CanActivateGO(int32 /*entry*/, uint32 /*team*/) const { return true; }
497 virtual bool IsSpellAllowed(uint32 /*spellId*/, Player const* /*player*/) const { return true; }
498 uint32 GetTeamScore(uint32 TeamID) const;
499
500 virtual uint32 GetPrematureWinner();
501
502 // because BattleGrounds with different types and same level range has different m_BracketId
503 uint8 GetUniqueBracketId() const;
504
506 {
507 auto itr = m_Players.find(playerGuid);
508 if (itr == m_Players.end())
509 return nullptr;
510
511 return &itr->second;
512 }
513
515 void SetWeakPtr(Trinity::unique_weak_ptr<Battleground> weakRef) { m_weakRef = std::move(weakRef); }
516
517 protected:
518 // this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends Battleground
519 void EndNow();
520 void PlayerAddedToBGCheckIfBGIsRunning(Player* player);
521
522 Player* _GetPlayer(ObjectGuid guid, bool offlineRemove, char const* context) const;
523 Player* _GetPlayer(BattlegroundPlayerMap::iterator itr, char const* context) { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
524 Player* _GetPlayer(BattlegroundPlayerMap::const_iterator itr, char const* context) const { return _GetPlayer(itr->first, itr->second.OfflineRemoveTime != 0, context); }
525 Player* _GetPlayerForTeam(uint32 teamId, BattlegroundPlayerMap::const_iterator itr, char const* context) const;
526
527 void _ProcessOfflineQueue();
528 void _ProcessResurrect(uint32 diff);
529 void _ProcessProgress(uint32 diff);
530 void _ProcessLeave(uint32 diff);
531 void _ProcessJoin(uint32 diff);
532 void _CheckSafePositions(uint32 diff);
533
534 // Scorekeeping
536 // must be implemented in BG subclass
537 virtual void RemovePlayer(Player* /*player*/, ObjectGuid /*guid*/, uint32 /*team*/) { }
538
539 // Player lists, those need to be accessible by inherited classes
541 // Spirit Guide guid + Player list GUIDS
542 std::map<ObjectGuid, GuidVector> m_ReviveQueue;
543
544 // these are important variables used for starting messages
547 // this must be filled in constructors!
549
552
554 int32 m_TeamScores[PVP_TEAMS_COUNT];
555
557
558 private:
559 // Battleground
562 uint32 m_InstanceID; // Battleground Instance's GUID!
564 uint32 m_ClientInstanceID; // the instance-id which is sent to the client and without any other internal use
568 int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself
571 uint8 m_ArenaType; // 2=2v2, 3=3v3, 5=5v5
572 bool m_InBGFreeSlotQueue; // used to make sure that BG is only once inserted into the BattlegroundMgr.BGFreeSlotQueue[bgTypeId] deque
573 bool m_SetDeleteThis; // used for safe deletion of the bg after end / all players leave
577 bool m_IsRated; // is this battle rated?
580 std::string m_Name;
581
582 /* Pre- and post-update hooks */
583
597 virtual bool PreUpdateImpl(uint32 /* diff */) { return true; }
598
610 virtual void PostUpdateImpl(uint32 /* diff */) { }
611
612 // Player lists
614 std::deque<ObjectGuid> m_OfflineQueue; // Player GUID
615
616 // 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
617 // Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG
618 // Invited players counters
621
622 // Raid Group
623 Group* m_BgRaids[PVP_TEAMS_COUNT]; // 0 - alliance, 1 - horde
624
625 // Players count by team
626 uint32 m_PlayersCount[PVP_TEAMS_COUNT];
627
628 // Arena team ids by team
629 uint32 m_ArenaTeamIds[PVP_TEAMS_COUNT];
630
631 uint32 m_ArenaTeamMMR[PVP_TEAMS_COUNT];
632
633 // Limits
640
641 // Start location
644 Position StartPosition[PVP_TEAMS_COUNT];
647
649};
650#endif
BattlegroundCriteriaId
@ BG_CRITERIA_CHECK_AV_PERFECTION
@ BG_CRITERIA_CHECK_SAVE_THE_DAY
@ BG_CRITERIA_CHECK_DEFENSE_OF_THE_ANCIENTS
@ BG_CRITERIA_CHECK_RESILIENT_VICTORY
@ BG_CRITERIA_CHECK_EVERYTHING_COUNTS
@ BG_CRITERIA_CHECK_NOT_EVEN_A_SCRATCH
BattlegroundTimeIntervals
@ INVITE_ACCEPT_WAIT_TIME
@ TIME_TO_AUTOREMOVE
@ RESURRECTION_INTERVAL
@ MAX_OFFLINE_TIME
@ RESPAWN_IMMEDIATELY
@ BUFF_RESPAWN_TIME
@ RESPAWN_ONE_DAY
@ CHECK_PLAYER_POSITION_INVERVAL
@ INVITATION_REMIND_TIME
ArenaType
@ ARENA_TYPE_5v5
@ ARENA_TYPE_3v3
@ ARENA_TYPE_2v2
const uint32 Buff_Entries[3]
BattlegroundDesertionType
@ BG_DESERTION_TYPE_LEAVE_BG
@ BG_DESERTION_TYPE_OFFLINE
@ BG_DESERTION_TYPE_NO_ENTER_BUTTON
@ BG_DESERTION_TYPE_LEAVE_QUEUE
@ BG_DESERTION_TYPE_INVITE_LOGOUT
BattlegroundMarks
@ SPELL_WS_MARK_WINNER
@ ITEM_WS_MARK_OF_HONOR
@ ITEM_SA_MARK_OF_HONOR
@ SPELL_SA_MARK_WINNER
@ SPELL_AV_MARK_LOSER
@ ITEM_EY_MARK_OF_HONOR
@ SPELL_WS_MARK_LOSER
@ SPELL_SA_MARK_LOSER
@ SPELL_AB_MARK_LOSER
@ ITEM_AV_MARK_OF_HONOR
@ ITEM_AB_MARK_OF_HONOR
@ SPELL_AB_MARK_WINNER
@ SPELL_AV_MARK_WINNER
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
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
BGHonorMode
@ BG_NORMAL
@ BG_HOLIDAY
@ BG_HONOR_MODE_NUM
BattlegroundSpells
@ SPELL_SPIRIT_HEAL
@ SPELL_AURA_PLAYER_INACTIVE
@ SPELL_RECENTLY_DROPPED_FLAG
@ SPELL_SPIRIT_HEAL_CHANNEL
@ SPELL_ARENA_PREPARATION
@ SPELL_SPIRIT_HEAL_MANA
@ SPELL_HONORABLE_DEFENDER_25Y
@ SPELL_PREPARATION
@ SPELL_RESURRECTION_VISUAL
@ 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
#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
AchievementCriteriaTimedTypes
Definition DBCEnums.h:121
BattlegroundBracketId
Definition DBCEnums.h:57
#define TC_GAME_API
Definition Define.h:114
uint8_t uint8
Definition Define.h:135
int32_t int32
Definition Define.h:129
uint32_t uint32
Definition Define.h:133
#define ASSERT
Definition Errors.h:68
TypeID
Definition ObjectGuid.h:34
std::vector< ObjectGuid > GuidVector
Definition ObjectGuid.h:262
PvPTeamId
TeamId
@ TEAM_NEUTRAL
@ TEAM_ALLIANCE
@ TEAM_HORDE
uint8 constexpr PVP_TEAMS_COUNT
@ ALLIANCE
ChatMsg
BattlegroundTypeId
WorldState
GOState
@ GO_STATE_READY
void UpdateWorldState(Map *map, uint32 id, uint32 state)
Definition chapter5.cpp:226
virtual ObjectGuid GetFlagPickerGUID(int32=-1) const
void SetMapId(uint32 MapID)
uint32 m_InvitedAlliance
GuidVector m_ResurrectQueue
void SetInstanceID(uint32 InstanceID)
void IncreaseInvitedCount(uint32 team)
uint32 GetMapId() const
BattlegroundTypeId GetTypeID(bool GetRandom=false) const
virtual void EventPlayerClickedOnFlag(Player *, GameObject *)
virtual bool HandlePlayerUnderMap(Player *)
PvPTeamId _winnerTeamId
bool ToBeDeleted() const
uint32 GetReviveQueueSize() const
void SetDeleteThis()
BGHonorMode m_HonorMode
uint32 GetMinLevel() const
void ModifyStartDelayTime(int diff)
void SetRandom(bool isRandom)
void SetMaxPlayers(uint32 MaxPlayers)
static TeamId GetTeamIndexByTeamId(uint32 Team)
void SendWarningToAll(uint32 entry,...)
virtual bool SetupBattleground()
std::deque< ObjectGuid > m_OfflineQueue
uint32 GetMinPlayersPerTeam() const
virtual void HandlePlayerResurrect(Player *)
uint8 GetArenaType() const
BattlegroundPlayerMap m_Players
uint32 GetMaxPlayersPerTeam() const
uint32 GetArenaTeamIdByIndex(uint32 index) const
uint32 m_ValidStartPositionTimer
void SetName(std::string const &name)
int32 m_StartDelayTime
std::string m_Name
void SetWinner(PvPTeamId winnerTeamId)
uint32 GetArenaMatchmakerRating(uint32 Team) const
uint32 m_ClientInstanceID
uint32 m_LevelMax
GuidVector BgObjects
uint32 GetPlayerScoresSize() const
uint32 GetEndTime() const
BattlegroundTypeId m_TypeID
Group * GetBgRaid(uint32 TeamID) const
virtual void HandleQuestComplete(uint32, Player *)
void SetScriptId(uint32 scriptId)
uint32 m_LastResurrectTime
virtual bool IsAllNodesControlledByTeam(uint32) const
bool CanAwardArenaPoints() const
bool isRated() const
void SetBgMap(BattlegroundMap *map)
uint32 GetMaxPlayers() const
BattlegroundMap * GetBgMap() const
virtual void PostUpdateImpl(uint32)
Post-update hook.
BattlegroundTypeId m_RandomTypeID
void DecreaseInvitedCount(uint32 team)
std::string const & GetName() const
PvPTeamId GetWinner() const
void SetMinPlayersPerTeam(uint32 MinPlayers)
void SetRated(bool state)
virtual void RemovePlayer(Player *, ObjectGuid, uint32)
uint32 GetArenaTeamIdForTeam(uint32 Team) const
BattlegroundMap * FindBgMap() const
void SetStartMaxDist(float startMaxDist)
virtual void ResetBGSubclass()
std::map< ObjectGuid, GuidVector > m_ReviveQueue
bool m_PrematureCountDown
uint32 GetInstanceID() const
uint32 m_PrematureCountDownTimer
void SetStartTime(uint32 Time)
void SetEndTime(uint32 Time)
virtual void DoAction(uint32, ObjectGuid)
void SetLevelRange(uint32 min, uint32 max)
GuidVector BgCreatures
uint32 GetClientInstanceID() const
uint32 m_MinPlayers
virtual bool IsSpellAllowed(uint32, Player const *) const
BattlegroundPlayer const * GetBattlegroundPlayerData(ObjectGuid const &playerGuid) const
bool m_InBGFreeSlotQueue
void SetClientInstanceID(uint32 InstanceID)
void SetStatus(BattlegroundStatus Status)
virtual void StartingEventCloseDoors()
BattlegroundBracketId m_BracketId
bool isArena() const
void SetArenaTeamIdForTeam(uint32 Team, uint32 ArenaTeamId)
void SetArenaType(uint8 type)
void SetArenaMatchmakerRating(uint32 Team, uint32 MMR)
uint32 m_InstanceID
void SetRandomTypeID(BattlegroundTypeId TypeID)
uint32 m_ResetStatTimer
uint32 GetStartTime() const
BattlegroundPlayerMap const & GetPlayers() const
int32 GetStartDelayTime() const
BattlegroundScoreMap PlayerScores
virtual void StartingEventOpenDoors()
float GetStartMaxDist() const
virtual void SetDroppedFlagGUID(ObjectGuid, int32=-1)
bool isBattleground() const
uint32 m_MinPlayersPerTeam
void SetLastResurrectTime(uint32 Time)
BattlegroundStatus GetStatus() const
void SetArenaorBGType(bool _isArena)
bool IsRandom() const
virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &)
virtual void HandleKillUnit(Creature *, Player *)
uint32 GetPlayersCountByTeam(uint32 Team) const
virtual bool PreUpdateImpl(uint32)
Pre-update hook.
float m_StartMaxDist
uint32 GetLastResurrectTime() const
Trinity::unique_weak_ptr< Battleground > m_weakRef
uint32 GetScriptId() const
virtual void CheckWinConditions()
uint32 m_MaxPlayersPerTeam
std::map< ObjectGuid, BattlegroundPlayer > BattlegroundPlayerMap
virtual void ProcessEvent(WorldObject *, uint32, WorldObject *=nullptr)
std::map< ObjectGuid, BattlegroundScore * > BattlegroundScoreMap
virtual void DestroyGate(Player *, GameObject *)
BattlegroundBracketId GetBracketId() const
uint32 m_InvitedHorde
void UpdatePlayersCountByTeam(uint32 Team, bool remove)
uint32 m_MaxPlayers
virtual bool CanActivateGO(int32, uint32) const
virtual void EventPlayerDroppedFlag(Player *)
uint32 GetMaxLevel() const
void SetMinPlayers(uint32 MinPlayers)
Trinity::unique_weak_ptr< Battleground > GetWeakPtr() const
uint32 GetPlayersSize() const
uint32 m_LevelMin
Player * _GetPlayer(BattlegroundPlayerMap::iterator itr, char const *context)
void SetMaxPlayersPerTeam(uint32 MaxPlayers)
uint32 m_StartTime
void SetStartDelayTime(int Time)
BattlegroundMap * m_Map
void SetWeakPtr(Trinity::unique_weak_ptr< Battleground > weakRef)
uint32 GetMinPlayers() const
Player * _GetPlayer(BattlegroundPlayerMap::const_iterator itr, char const *context) const
uint32 GetInvitedCount(uint32 team) const
BattlegroundStatus m_Status
void SetTypeID(BattlegroundTypeId TypeID)
void RemoveFromBGFreeSlotQueueOnShutdown()
Definition Group.h:165
static ObjectGuid const Empty
Definition ObjectGuid.h:140
Trinity::unique_trackable_ptr companion class, replicating what std::weak_ptr is to std::shared_ptr.
Definition Unit.h:769