[8483] Implement glyph 43361.
[getmangos.git] / src / game / BattleGround.h
blob3ba5a238f287ad7ff67c3cb791f1395e1fbda1ac
1 /*
2 * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef __BATTLEGROUND_H
20 #define __BATTLEGROUND_H
22 #include "Common.h"
23 #include "SharedDefines.h"
25 class Creature;
26 class GameObject;
27 class Group;
28 class Player;
29 class WorldPacket;
31 struct WorldSafeLocsEntry;
33 enum BattleGroundSounds
35 SOUND_HORDE_WINS = 8454,
36 SOUND_ALLIANCE_WINS = 8455,
37 SOUND_BG_START = 3439
40 enum BattleGroundQuests
42 SPELL_WS_QUEST_REWARD = 43483,
43 SPELL_AB_QUEST_REWARD = 43484,
44 SPELL_AV_QUEST_REWARD = 43475,
45 SPELL_AV_QUEST_KILLED_BOSS = 23658,
46 SPELL_EY_QUEST_REWARD = 43477,
47 SPELL_AB_QUEST_REWARD_4_BASES = 24061,
48 SPELL_AB_QUEST_REWARD_5_BASES = 24064
51 enum BattleGroundMarks
53 SPELL_WS_MARK_LOSER = 24950,
54 SPELL_WS_MARK_WINNER = 24951,
55 SPELL_AB_MARK_LOSER = 24952,
56 SPELL_AB_MARK_WINNER = 24953,
57 SPELL_AV_MARK_LOSER = 24954,
58 SPELL_AV_MARK_WINNER = 24955,
59 ITEM_EY_MARK_OF_HONOR = 29024
62 enum BattleGroundMarksCount
64 ITEM_WINNER_COUNT = 3,
65 ITEM_LOSER_COUNT = 1
68 enum BattleGroundSpells
70 SPELL_WAITING_FOR_RESURRECT = 2584, // Waiting to Resurrect
71 SPELL_SPIRIT_HEAL_CHANNEL = 22011, // Spirit Heal Channel
72 SPELL_SPIRIT_HEAL = 22012, // Spirit Heal
73 SPELL_RESURRECTION_VISUAL = 24171, // Resurrection Impact Visual
74 SPELL_ARENA_PREPARATION = 32727, // use this one, 32728 not correct
75 SPELL_ALLIANCE_GOLD_FLAG = 32724,
76 SPELL_ALLIANCE_GREEN_FLAG = 32725,
77 SPELL_HORDE_GOLD_FLAG = 35774,
78 SPELL_HORDE_GREEN_FLAG = 35775,
79 SPELL_PREPARATION = 44521, // Preparation
80 SPELL_SPIRIT_HEAL_MANA = 44535, // Spirit Heal
81 SPELL_RECENTLY_DROPPED_FLAG = 42792, // Recently Dropped Flag
82 SPELL_AURA_PLAYER_INACTIVE = 43681 // Inactive
85 enum BattleGroundTimeIntervals
87 RESURRECTION_INTERVAL = 30000, // ms
88 REMIND_INTERVAL = 30000, // ms
89 INVITATION_REMIND_TIME = 60000, // ms
90 INVITE_ACCEPT_WAIT_TIME = 80000, // ms
91 TIME_TO_AUTOREMOVE = 120000, // ms
92 MAX_OFFLINE_TIME = 300, // secs
93 RESPAWN_ONE_DAY = 86400, // secs
94 RESPAWN_IMMEDIATELY = 0, // secs
95 BUFF_RESPAWN_TIME = 180, // secs
98 enum BattleGroundStartTimeIntervals
100 BG_START_DELAY_2M = 120000, // ms (2 minutes)
101 BG_START_DELAY_1M = 60000, // ms (1 minute)
102 BG_START_DELAY_30S = 30000, // ms (30 seconds)
103 BG_START_DELAY_15S = 15000, // ms (15 seconds) Used only in arena
104 BG_START_DELAY_NONE = 0, // ms
107 enum BattleGroundBuffObjects
109 BG_OBJECTID_SPEEDBUFF_ENTRY = 179871,
110 BG_OBJECTID_REGENBUFF_ENTRY = 179904,
111 BG_OBJECTID_BERSERKERBUFF_ENTRY = 179905
114 const uint32 Buff_Entries[3] = { BG_OBJECTID_SPEEDBUFF_ENTRY, BG_OBJECTID_REGENBUFF_ENTRY, BG_OBJECTID_BERSERKERBUFF_ENTRY };
116 enum BattleGroundStatus
118 STATUS_NONE = 0, // first status, should mean bg is not instance
119 STATUS_WAIT_QUEUE = 1, // means bg is empty and waiting for queue
120 STATUS_WAIT_JOIN = 2, // this means, that BG has already started and it is waiting for more players
121 STATUS_IN_PROGRESS = 3, // means bg is running
122 STATUS_WAIT_LEAVE = 4 // means some faction has won BG and it is ending
125 struct BattleGroundPlayer
127 time_t OfflineRemoveTime; // for tracking and removing offline players from queue after 5 minutes
128 uint32 Team; // Player's team
131 struct BattleGroundObjectInfo
133 BattleGroundObjectInfo() : object(NULL), timer(0), spellid(0) {}
135 GameObject *object;
136 int32 timer;
137 uint32 spellid;
140 // handle the queue types and bg types separately to enable joining queue for different sized arenas at the same time
141 enum BattleGroundQueueTypeId
143 BATTLEGROUND_QUEUE_NONE = 0,
144 BATTLEGROUND_QUEUE_AV = 1,
145 BATTLEGROUND_QUEUE_WS = 2,
146 BATTLEGROUND_QUEUE_AB = 3,
147 BATTLEGROUND_QUEUE_EY = 4,
148 BATTLEGROUND_QUEUE_SA = 5,
149 BATTLEGROUND_QUEUE_2v2 = 6,
150 BATTLEGROUND_QUEUE_3v3 = 7,
151 BATTLEGROUND_QUEUE_5v5 = 8
153 #define MAX_BATTLEGROUND_QUEUE_TYPES 9
155 enum BGQueueIdBasedOnLevel // queue_id for level ranges
157 QUEUE_ID_MAX_LEVEL_19 = 0,
158 QUEUE_ID_MAX_LEVEL_29 = 1,
159 QUEUE_ID_MAX_LEVEL_39 = 2,
160 QUEUE_ID_MAX_LEVEL_49 = 3,
161 QUEUE_ID_MAX_LEVEL_59 = 4,
162 QUEUE_ID_MAX_LEVEL_69 = 5,
163 QUEUE_ID_MAX_LEVEL_79 = 6,
164 QUEUE_ID_MAX_LEVEL_80 = 7
166 #define MAX_BATTLEGROUND_QUEUES 8
168 enum ScoreType
170 SCORE_KILLING_BLOWS = 1,
171 SCORE_DEATHS = 2,
172 SCORE_HONORABLE_KILLS = 3,
173 SCORE_BONUS_HONOR = 4,
174 //EY, but in MSG_PVP_LOG_DATA opcode!
175 SCORE_DAMAGE_DONE = 5,
176 SCORE_HEALING_DONE = 6,
177 //WS
178 SCORE_FLAG_CAPTURES = 7,
179 SCORE_FLAG_RETURNS = 8,
180 //AB
181 SCORE_BASES_ASSAULTED = 9,
182 SCORE_BASES_DEFENDED = 10,
183 //AV
184 SCORE_GRAVEYARDS_ASSAULTED = 11,
185 SCORE_GRAVEYARDS_DEFENDED = 12,
186 SCORE_TOWERS_ASSAULTED = 13,
187 SCORE_TOWERS_DEFENDED = 14,
188 SCORE_MINES_CAPTURED = 15,
189 SCORE_LEADERS_KILLED = 16,
190 SCORE_SECONDARY_OBJECTIVES = 17
191 // TODO : implement them
194 enum ArenaType
196 ARENA_TYPE_2v2 = 2,
197 ARENA_TYPE_3v3 = 3,
198 ARENA_TYPE_5v5 = 5
201 enum BattleGroundType
203 TYPE_BATTLEGROUND = 3,
204 TYPE_ARENA = 4
207 enum BattleGroundWinner
209 WINNER_HORDE = 0,
210 WINNER_ALLIANCE = 1,
211 WINNER_NONE = 2
214 enum BattleGroundTeamId
216 BG_TEAM_ALLIANCE = 0,
217 BG_TEAM_HORDE = 1
219 #define BG_TEAMS_COUNT 2
221 enum BattleGroundStartingEvents
223 BG_STARTING_EVENT_NONE = 0x00,
224 BG_STARTING_EVENT_1 = 0x01,
225 BG_STARTING_EVENT_2 = 0x02,
226 BG_STARTING_EVENT_3 = 0x04,
227 BG_STARTING_EVENT_4 = 0x08
230 enum BattleGroundStartingEventsIds
232 BG_STARTING_EVENT_FIRST = 0,
233 BG_STARTING_EVENT_SECOND = 1,
234 BG_STARTING_EVENT_THIRD = 2,
235 BG_STARTING_EVENT_FOURTH = 3
237 #define BG_STARTING_EVENT_COUNT 4
239 enum BattleGroundJoinError
241 BG_JOIN_ERR_OK = 0,
242 BG_JOIN_ERR_OFFLINE_MEMBER = 1,
243 BG_JOIN_ERR_GROUP_TOO_MANY = 2,
244 BG_JOIN_ERR_MIXED_FACTION = 3,
245 BG_JOIN_ERR_MIXED_LEVELS = 4,
246 BG_JOIN_ERR_MIXED_ARENATEAM = 5,
247 BG_JOIN_ERR_GROUP_MEMBER_ALREADY_IN_QUEUE = 6,
248 BG_JOIN_ERR_GROUP_DESERTER = 7,
249 BG_JOIN_ERR_ALL_QUEUES_USED = 8,
250 BG_JOIN_ERR_GROUP_NOT_ENOUGH = 9
253 class BattleGroundScore
255 public:
256 BattleGroundScore() : KillingBlows(0), Deaths(0), HonorableKills(0),
257 BonusHonor(0), DamageDone(0), HealingDone(0)
259 virtual ~BattleGroundScore() {} //virtual destructor is used when deleting score from scores map
261 uint32 KillingBlows;
262 uint32 Deaths;
263 uint32 HonorableKills;
264 uint32 BonusHonor;
265 uint32 DamageDone;
266 uint32 HealingDone;
270 This class is used to:
271 1. Add player to battleground
272 2. Remove player from battleground
273 3. some certain cases, same for all battlegrounds
274 4. It has properties same for all battlegrounds
276 class BattleGround
278 friend class BattleGroundMgr;
280 public:
281 /* Construction */
282 BattleGround();
283 /*BattleGround(const BattleGround& bg);*/
284 virtual ~BattleGround();
285 virtual void Update(uint32 diff); // must be implemented in BG subclass of BG specific update code, but must in begginning call parent version
286 virtual bool SetupBattleGround() // must be implemented in BG subclass
288 return true;
290 virtual void Reset(); // resets all common properties for battlegrounds, must be implemented and called in BG subclass
291 virtual void StartingEventCloseDoors() {}
292 virtual void StartingEventOpenDoors() {}
294 /* achievement req. */
295 virtual bool IsAllNodesConrolledByTeam(uint32 /*team*/) const { return false; }
296 bool IsTeamScoreInRange(uint32 team, uint32 minScore, uint32 maxScore) const;
298 /* Battleground */
299 // Get methods:
300 char const* GetName() const { return m_Name; }
301 BattleGroundTypeId GetTypeID() const { return m_TypeID; }
302 BGQueueIdBasedOnLevel GetQueueId() const { return m_QueueId; }
303 uint32 GetInstanceID() const { return m_InstanceID; }
304 BattleGroundStatus GetStatus() const { return m_Status; }
305 uint32 GetClientInstanceID() const { return m_ClientInstanceID; }
306 uint32 GetStartTime() const { return m_StartTime; }
307 uint32 GetEndTime() const { return m_EndTime; }
308 uint32 GetLastResurrectTime() const { return m_LastResurrectTime; }
309 uint32 GetMaxPlayers() const { return m_MaxPlayers; }
310 uint32 GetMinPlayers() const { return m_MinPlayers; }
312 uint32 GetMinLevel() const { return m_LevelMin; }
313 uint32 GetMaxLevel() const { return m_LevelMax; }
315 uint32 GetMaxPlayersPerTeam() const { return m_MaxPlayersPerTeam; }
316 uint32 GetMinPlayersPerTeam() const { return m_MinPlayersPerTeam; }
318 int32 GetStartDelayTime() const { return m_StartDelayTime; }
319 uint8 GetArenaType() const { return m_ArenaType; }
320 uint8 GetWinner() const { return m_Winner; }
321 uint32 GetBattlemasterEntry() const;
322 uint32 GetBonusHonorFromKill(uint32 kills) const;
324 // Set methods:
325 void SetName(char const* Name) { m_Name = Name; }
326 void SetTypeID(BattleGroundTypeId TypeID) { m_TypeID = TypeID; }
327 //here we can count minlevel and maxlevel for players
328 void SetQueueId(BGQueueIdBasedOnLevel ID)
330 m_QueueId = ID;
331 uint8 diff = (m_TypeID == BATTLEGROUND_AV) ? 1 : 0;
332 this->SetLevelRange((ID + 1) * 10 + diff, (ID + 2) * 10 - ((diff + 1) % 2));
334 void SetInstanceID(uint32 InstanceID) { m_InstanceID = InstanceID; }
335 void SetStatus(BattleGroundStatus Status) { m_Status = Status; }
336 void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; }
337 void SetStartTime(uint32 Time) { m_StartTime = Time; }
338 void SetEndTime(uint32 Time) { m_EndTime = Time; }
339 void SetLastResurrectTime(uint32 Time) { m_LastResurrectTime = Time; }
340 void SetMaxPlayers(uint32 MaxPlayers) { m_MaxPlayers = MaxPlayers; }
341 void SetMinPlayers(uint32 MinPlayers) { m_MinPlayers = MinPlayers; }
342 void SetLevelRange(uint32 min, uint32 max) { m_LevelMin = min; m_LevelMax = max; }
343 void SetRated(bool state) { m_IsRated = state; }
344 void SetArenaType(uint8 type) { m_ArenaType = type; }
345 void SetArenaorBGType(bool _isArena) { m_IsArena = _isArena; }
346 void SetWinner(uint8 winner) { m_Winner = winner; }
348 void ModifyStartDelayTime(int diff) { m_StartDelayTime -= diff; }
349 void SetStartDelayTime(int Time) { m_StartDelayTime = Time; }
351 void SetMaxPlayersPerTeam(uint32 MaxPlayers) { m_MaxPlayersPerTeam = MaxPlayers; }
352 void SetMinPlayersPerTeam(uint32 MinPlayers) { m_MinPlayersPerTeam = MinPlayers; }
354 void AddToBGFreeSlotQueue(); //this queue will be useful when more battlegrounds instances will be available
355 void RemoveFromBGFreeSlotQueue(); //this method could delete whole BG instance, if another free is available
357 void DecreaseInvitedCount(uint32 team) { (team == ALLIANCE) ? --m_InvitedAlliance : --m_InvitedHorde; }
358 void IncreaseInvitedCount(uint32 team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; }
359 uint32 GetInvitedCount(uint32 team) const
361 if (team == ALLIANCE)
362 return m_InvitedAlliance;
363 else
364 return m_InvitedHorde;
366 bool HasFreeSlots() const;
367 uint32 GetFreeSlotsForTeam(uint32 Team) const;
369 bool isArena() const { return m_IsArena; }
370 bool isBattleGround() const { return !m_IsArena; }
371 bool isRated() const { return m_IsRated; }
373 typedef std::map<uint64, BattleGroundPlayer> BattleGroundPlayerMap;
374 BattleGroundPlayerMap const& GetPlayers() const { return m_Players; }
375 uint32 GetPlayersSize() const { return m_Players.size(); }
377 typedef std::map<uint64, BattleGroundScore*> BattleGroundScoreMap;
378 BattleGroundScoreMap::const_iterator GetPlayerScoresBegin() const { return m_PlayerScores.begin(); }
379 BattleGroundScoreMap::const_iterator GetPlayerScoresEnd() const { return m_PlayerScores.end(); }
380 uint32 GetPlayerScoresSize() const { return m_PlayerScores.size(); }
382 uint32 GetReviveQueueSize() const { return m_ReviveQueue.size(); }
384 void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid);
385 void RemovePlayerFromResurrectQueue(uint64 player_guid);
387 void StartBattleGround();
389 /* Location */
390 void SetMapId(uint32 MapID) { m_MapId = MapID; }
391 uint32 GetMapId() const { return m_MapId; }
393 void SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, float O);
394 void GetTeamStartLoc(uint32 TeamID, float &X, float &Y, float &Z, float &O) const
396 BattleGroundTeamId idx = GetTeamIndexByTeamId(TeamID);
397 X = m_TeamStartLocX[idx];
398 Y = m_TeamStartLocY[idx];
399 Z = m_TeamStartLocZ[idx];
400 O = m_TeamStartLocO[idx];
403 /* Packet Transfer */
404 // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!)
405 virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
406 void SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *sender = NULL, bool self = true);
407 void SendPacketToAll(WorldPacket *packet);
409 template<class Do>
410 void BroadcastWorker(Do& _do);
412 void PlaySoundToTeam(uint32 SoundID, uint32 TeamID);
413 void PlaySoundToAll(uint32 SoundID);
414 void CastSpellOnTeam(uint32 SpellID, uint32 TeamID);
415 void RewardHonorToTeam(uint32 Honor, uint32 TeamID);
416 void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID);
417 void RewardMark(Player *plr,uint32 count);
418 void SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count);
419 void RewardItem(Player *plr, uint32 item_id, uint32 count);
420 void RewardQuestComplete(Player *plr);
421 void RewardSpellCast(Player *plr, uint32 spell_id);
422 void UpdateWorldState(uint32 Field, uint32 Value);
423 void UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player *Source);
424 void EndBattleGround(uint32 winner);
425 void BlockMovement(Player *plr);
427 void SendMessageToAll(int32 entry, ChatMsg type, Player const* source = NULL);
428 void PSendMessageToAll(int32 entry, ChatMsg type, Player const* source, ... );
430 // specialized version with 2 string id args
431 void SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 strId1 = 0, int32 strId2 = 0);
433 /* Raid Group */
434 Group *GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; }
435 void SetBgRaid(uint32 TeamID, Group *bg_raid);
437 virtual void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
439 static BattleGroundTeamId GetTeamIndexByTeamId(uint32 Team) { return Team == ALLIANCE ? BG_TEAM_ALLIANCE : BG_TEAM_HORDE; }
440 uint32 GetPlayersCountByTeam(uint32 Team) const { return m_PlayersCount[GetTeamIndexByTeamId(Team)]; }
441 uint32 GetAlivePlayersCountByTeam(uint32 Team) const; // used in arenas to correctly handle death in spirit of redemption / last stand etc. (killer = killed) cases
442 void UpdatePlayersCountByTeam(uint32 Team, bool remove)
444 if (remove)
445 --m_PlayersCount[GetTeamIndexByTeamId(Team)];
446 else
447 ++m_PlayersCount[GetTeamIndexByTeamId(Team)];
450 // used for rated arena battles
451 void SetArenaTeamIdForTeam(uint32 Team, uint32 ArenaTeamId) { m_ArenaTeamIds[GetTeamIndexByTeamId(Team)] = ArenaTeamId; }
452 uint32 GetArenaTeamIdForTeam(uint32 Team) const { return m_ArenaTeamIds[GetTeamIndexByTeamId(Team)]; }
453 void SetArenaTeamRatingChangeForTeam(uint32 Team, int32 RatingChange) { m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)] = RatingChange; }
454 int32 GetArenaTeamRatingChangeForTeam(uint32 Team) const { return m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)]; }
455 void CheckArenaWinConditions();
457 /* Triggers handle */
458 // must be implemented in BG subclass
459 virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/) {}
460 // must be implemented in BG subclass if need AND call base class generic code
461 virtual void HandleKillPlayer(Player *player, Player *killer);
463 /* Battleground events */
464 virtual void EventPlayerDroppedFlag(Player* /*player*/) {}
465 virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) {}
466 virtual void EventPlayerCapturedFlag(Player* /*player*/) {}
467 void EventPlayerLoggedIn(Player* player, uint64 plr_guid);
468 void EventPlayerLoggedOut(Player* player);
470 /* Death related */
471 virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
473 virtual void AddPlayer(Player *plr); // must be implemented in BG subclass
475 void AddOrSetPlayerToCorrectBgGroup(Player *plr, uint64 plr_guid, uint32 team);
477 virtual void RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket);
478 // can be extended in in BG subclass
480 void HandleTriggerBuff(uint64 const& go_guid);
482 // TODO: make this protected:
483 typedef std::vector<uint64> BGObjects;
484 typedef std::vector<uint64> BGCreatures;
485 BGObjects m_BgObjects;
486 BGCreatures m_BgCreatures;
487 void SpawnBGObject(uint32 type, uint32 respawntime);
488 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);
489 // void SpawnBGCreature(uint32 type, uint32 respawntime);
490 Creature* AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime = 0);
491 bool DelCreature(uint32 type);
492 bool DelObject(uint32 type);
493 bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, uint32 team);
495 void DoorOpen(uint32 type);
496 void DoorClose(uint32 type);
498 virtual bool HandlePlayerUnderMap(Player * /*plr*/) { return false; }
500 // since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
501 uint32 GetPlayerTeam(uint64 guid);
502 uint32 GetOtherTeam(uint32 teamId);
503 bool IsPlayerInBattleGround(uint64 guid);
505 void SetDeleteThis() {m_SetDeleteThis = true;}
507 /* virtual score-array - get's used in bg-subclasses */
508 int32 m_TeamScores[BG_TEAMS_COUNT];
510 protected:
511 //this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends BattleGround
512 void EndNow();
513 void PlayerAddedToBGCheckIfBGIsRunning(Player* plr);
515 /* Scorekeeping */
517 BattleGroundScoreMap m_PlayerScores; // Player scores
518 // must be implemented in BG subclass
519 virtual void RemovePlayer(Player * /*player*/, uint64 /*guid*/) {}
521 /* Player lists, those need to be accessible by inherited classes */
522 BattleGroundPlayerMap m_Players;
523 // Spirit Guide guid + Player list GUIDS
524 std::map<uint64, std::vector<uint64> > m_ReviveQueue;
527 these are important variables used for starting messages
529 uint8 m_Events;
530 BattleGroundStartTimeIntervals m_StartDelayTimes[BG_STARTING_EVENT_COUNT];
531 //this must be filled in constructors!
532 uint32 m_StartMessageIds[BG_STARTING_EVENT_COUNT];
534 bool m_BuffChange;
536 private:
537 /* Battleground */
538 BattleGroundTypeId m_TypeID;
539 uint32 m_InstanceID; //BattleGround Instance's GUID!
540 BattleGroundStatus m_Status;
541 uint32 m_ClientInstanceID; //the instance-id which is sent to the client and without any other internal use
542 uint32 m_StartTime;
543 int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself
544 uint32 m_LastResurrectTime;
545 BGQueueIdBasedOnLevel m_QueueId;
546 uint8 m_ArenaType; // 2=2v2, 3=3v3, 5=5v5
547 bool m_InBGFreeSlotQueue; // used to make sure that BG is only once inserted into the BattleGroundMgr.BGFreeSlotQueue[bgTypeId] deque
548 bool m_SetDeleteThis; // used for safe deletion of the bg after end / all players leave
549 bool m_IsArena;
550 uint8 m_Winner; // 0=alliance, 1=horde, 2=none
551 int32 m_StartDelayTime;
552 bool m_IsRated; // is this battle rated?
553 bool m_PrematureCountDown;
554 uint32 m_PrematureCountDownTimer;
555 char const *m_Name;
557 /* Player lists */
558 std::vector<uint64> m_ResurrectQueue; // Player GUID
559 std::deque<uint64> m_OfflineQueue; // Player GUID
561 /* 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 */
562 /* Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG */
563 /* Invited players counters*/
564 uint32 m_InvitedAlliance;
565 uint32 m_InvitedHorde;
567 /* Raid Group */
568 Group *m_BgRaids[BG_TEAMS_COUNT]; // 0 - alliance, 1 - horde
570 /* Players count by team */
571 uint32 m_PlayersCount[BG_TEAMS_COUNT];
573 /* Arena team ids by team */
574 uint32 m_ArenaTeamIds[BG_TEAMS_COUNT];
576 int32 m_ArenaTeamRatingChanges[BG_TEAMS_COUNT];
578 /* Limits */
579 uint32 m_LevelMin;
580 uint32 m_LevelMax;
581 uint32 m_MaxPlayersPerTeam;
582 uint32 m_MaxPlayers;
583 uint32 m_MinPlayersPerTeam;
584 uint32 m_MinPlayers;
586 /* Start location */
587 uint32 m_MapId;
588 float m_TeamStartLocX[BG_TEAMS_COUNT];
589 float m_TeamStartLocY[BG_TEAMS_COUNT];
590 float m_TeamStartLocZ[BG_TEAMS_COUNT];
591 float m_TeamStartLocO[BG_TEAMS_COUNT];
593 #endif