[7918] Improve portability in work with uint64 string format specifiers and in code...
[getmangos.git] / src / game / BattleGround.h
blob91eb32382dad126eae554508b1bc32b2c270e317
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 /* Battleground */
295 // Get methods:
296 char const* GetName() const { return m_Name; }
297 BattleGroundTypeId GetTypeID() const { return m_TypeID; }
298 BGQueueIdBasedOnLevel GetQueueId() const { return m_QueueId; }
299 uint32 GetInstanceID() const { return m_InstanceID; }
300 BattleGroundStatus GetStatus() const { return m_Status; }
301 uint32 GetClientInstanceID() const { return m_ClientInstanceID; }
302 uint32 GetStartTime() const { return m_StartTime; }
303 uint32 GetEndTime() const { return m_EndTime; }
304 uint32 GetLastResurrectTime() const { return m_LastResurrectTime; }
305 uint32 GetMaxPlayers() const { return m_MaxPlayers; }
306 uint32 GetMinPlayers() const { return m_MinPlayers; }
308 uint32 GetMinLevel() const { return m_LevelMin; }
309 uint32 GetMaxLevel() const { return m_LevelMax; }
311 uint32 GetMaxPlayersPerTeam() const { return m_MaxPlayersPerTeam; }
312 uint32 GetMinPlayersPerTeam() const { return m_MinPlayersPerTeam; }
314 int32 GetStartDelayTime() const { return m_StartDelayTime; }
315 uint8 GetArenaType() const { return m_ArenaType; }
316 uint8 GetWinner() const { return m_Winner; }
317 uint32 GetBattlemasterEntry() const;
318 uint32 GetBonusHonorFromKill(uint32 kills) const;
320 // Set methods:
321 void SetName(char const* Name) { m_Name = Name; }
322 void SetTypeID(BattleGroundTypeId TypeID) { m_TypeID = TypeID; }
323 //here we can count minlevel and maxlevel for players
324 void SetQueueId(BGQueueIdBasedOnLevel ID)
326 m_QueueId = ID;
327 uint8 diff = (m_TypeID == BATTLEGROUND_AV) ? 1 : 0;
328 this->SetLevelRange((ID + 1) * 10 + diff, (ID + 2) * 10 - ((diff + 1) % 2));
330 void SetInstanceID(uint32 InstanceID) { m_InstanceID = InstanceID; }
331 void SetStatus(BattleGroundStatus Status) { m_Status = Status; }
332 void SetClientInstanceID(uint32 InstanceID) { m_ClientInstanceID = InstanceID; }
333 void SetStartTime(uint32 Time) { m_StartTime = Time; }
334 void SetEndTime(uint32 Time) { m_EndTime = Time; }
335 void SetLastResurrectTime(uint32 Time) { m_LastResurrectTime = Time; }
336 void SetMaxPlayers(uint32 MaxPlayers) { m_MaxPlayers = MaxPlayers; }
337 void SetMinPlayers(uint32 MinPlayers) { m_MinPlayers = MinPlayers; }
338 void SetLevelRange(uint32 min, uint32 max) { m_LevelMin = min; m_LevelMax = max; }
339 void SetRated(bool state) { m_IsRated = state; }
340 void SetArenaType(uint8 type) { m_ArenaType = type; }
341 void SetArenaorBGType(bool _isArena) { m_IsArena = _isArena; }
342 void SetWinner(uint8 winner) { m_Winner = winner; }
344 void ModifyStartDelayTime(int diff) { m_StartDelayTime -= diff; }
345 void SetStartDelayTime(int Time) { m_StartDelayTime = Time; }
347 void SetMaxPlayersPerTeam(uint32 MaxPlayers) { m_MaxPlayersPerTeam = MaxPlayers; }
348 void SetMinPlayersPerTeam(uint32 MinPlayers) { m_MinPlayersPerTeam = MinPlayers; }
350 void AddToBGFreeSlotQueue(); //this queue will be useful when more battlegrounds instances will be available
351 void RemoveFromBGFreeSlotQueue(); //this method could delete whole BG instance, if another free is available
353 void DecreaseInvitedCount(uint32 team) { (team == ALLIANCE) ? --m_InvitedAlliance : --m_InvitedHorde; }
354 void IncreaseInvitedCount(uint32 team) { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; }
355 uint32 GetInvitedCount(uint32 team) const
357 if (team == ALLIANCE)
358 return m_InvitedAlliance;
359 else
360 return m_InvitedHorde;
362 bool HasFreeSlots() const;
363 uint32 GetFreeSlotsForTeam(uint32 Team) const;
365 bool isArena() const { return m_IsArena; }
366 bool isBattleGround() const { return !m_IsArena; }
367 bool isRated() const { return m_IsRated; }
369 typedef std::map<uint64, BattleGroundPlayer> BattleGroundPlayerMap;
370 BattleGroundPlayerMap const& GetPlayers() const { return m_Players; }
371 uint32 GetPlayersSize() const { return m_Players.size(); }
373 std::map<uint64, BattleGroundScore*>::const_iterator GetPlayerScoresBegin() const { return m_PlayerScores.begin(); }
374 std::map<uint64, BattleGroundScore*>::const_iterator GetPlayerScoresEnd() const { return m_PlayerScores.end(); }
375 uint32 GetPlayerScoresSize() const { return m_PlayerScores.size(); }
377 uint32 GetReviveQueueSize() const { return m_ReviveQueue.size(); }
379 void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid);
380 void RemovePlayerFromResurrectQueue(uint64 player_guid);
382 void StartBattleGround();
384 /* Location */
385 void SetMapId(uint32 MapID) { m_MapId = MapID; }
386 uint32 GetMapId() const { return m_MapId; }
388 void SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, float O);
389 void GetTeamStartLoc(uint32 TeamID, float &X, float &Y, float &Z, float &O) const
391 uint8 idx = GetTeamIndexByTeamId(TeamID);
392 X = m_TeamStartLocX[idx];
393 Y = m_TeamStartLocY[idx];
394 Z = m_TeamStartLocZ[idx];
395 O = m_TeamStartLocO[idx];
398 /* Packet Transfer */
399 // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!)
400 virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
401 void SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *sender = NULL, bool self = true);
402 void SendPacketToAll(WorldPacket *packet);
404 template<class Do>
405 void BroadcastWorker(Do& _do);
407 void PlaySoundToTeam(uint32 SoundID, uint32 TeamID);
408 void PlaySoundToAll(uint32 SoundID);
409 void CastSpellOnTeam(uint32 SpellID, uint32 TeamID);
410 void RewardHonorToTeam(uint32 Honor, uint32 TeamID);
411 void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID);
412 void RewardMark(Player *plr,uint32 count);
413 void SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count);
414 void RewardItem(Player *plr, uint32 item_id, uint32 count);
415 void RewardQuestComplete(Player *plr);
416 void RewardSpellCast(Player *plr, uint32 spell_id);
417 void UpdateWorldState(uint32 Field, uint32 Value);
418 void UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player *Source);
419 void EndBattleGround(uint32 winner);
420 void BlockMovement(Player *plr);
422 void SendMessageToAll(int32 entry, ChatMsg type, Player const* source = NULL);
423 void PSendMessageToAll(int32 entry, ChatMsg type, Player const* source, ... );
425 // specialized version with 2 string id args
426 void SendMessage2ToAll(int32 entry, ChatMsg type, Player const* source, int32 strId1 = 0, int32 strId2 = 0);
428 /* Raid Group */
429 Group *GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; }
430 void SetBgRaid(uint32 TeamID, Group *bg_raid);
432 virtual void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
434 uint8 GetTeamIndexByTeamId(uint32 Team) const { return Team == ALLIANCE ? BG_TEAM_ALLIANCE : BG_TEAM_HORDE; }
435 uint32 GetPlayersCountByTeam(uint32 Team) const { return m_PlayersCount[GetTeamIndexByTeamId(Team)]; }
436 uint32 GetAlivePlayersCountByTeam(uint32 Team) const; // used in arenas to correctly handle death in spirit of redemption / last stand etc. (killer = killed) cases
437 void UpdatePlayersCountByTeam(uint32 Team, bool remove)
439 if (remove)
440 --m_PlayersCount[GetTeamIndexByTeamId(Team)];
441 else
442 ++m_PlayersCount[GetTeamIndexByTeamId(Team)];
445 // used for rated arena battles
446 void SetArenaTeamIdForTeam(uint32 Team, uint32 ArenaTeamId) { m_ArenaTeamIds[GetTeamIndexByTeamId(Team)] = ArenaTeamId; }
447 uint32 GetArenaTeamIdForTeam(uint32 Team) const { return m_ArenaTeamIds[GetTeamIndexByTeamId(Team)]; }
448 void SetArenaTeamRatingChangeForTeam(uint32 Team, int32 RatingChange) { m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)] = RatingChange; }
449 int32 GetArenaTeamRatingChangeForTeam(uint32 Team) const { return m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)]; }
450 void CheckArenaWinConditions();
452 /* Triggers handle */
453 // must be implemented in BG subclass
454 virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/) {}
455 // must be implemented in BG subclass if need AND call base class generic code
456 virtual void HandleKillPlayer(Player *player, Player *killer);
458 /* Battleground events */
459 virtual void EventPlayerDroppedFlag(Player* /*player*/) {}
460 virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) {}
461 virtual void EventPlayerCapturedFlag(Player* /*player*/) {}
462 void EventPlayerLoggedIn(Player* player, uint64 plr_guid);
463 void EventPlayerLoggedOut(Player* player);
465 /* Death related */
466 virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
468 virtual void AddPlayer(Player *plr); // must be implemented in BG subclass
470 void AddOrSetPlayerToCorrectBgGroup(Player *plr, uint64 plr_guid, uint32 team);
472 virtual void RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket);
473 // can be extended in in BG subclass
475 void HandleTriggerBuff(uint64 const& go_guid);
477 // TODO: make this protected:
478 typedef std::vector<uint64> BGObjects;
479 typedef std::vector<uint64> BGCreatures;
480 BGObjects m_BgObjects;
481 BGCreatures m_BgCreatures;
482 void SpawnBGObject(uint32 type, uint32 respawntime);
483 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);
484 // void SpawnBGCreature(uint32 type, uint32 respawntime);
485 Creature* AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime = 0);
486 bool DelCreature(uint32 type);
487 bool DelObject(uint32 type);
488 bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, uint32 team);
490 void DoorOpen(uint32 type);
491 void DoorClose(uint32 type);
493 virtual bool HandlePlayerUnderMap(Player * /*plr*/) { return false; }
495 // since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
496 uint32 GetPlayerTeam(uint64 guid);
497 uint32 GetOtherTeam(uint32 teamId);
498 bool IsPlayerInBattleGround(uint64 guid);
500 void SetDeleteThis() {m_SetDeleteThis = true;}
502 protected:
503 //this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends BattleGround
504 void EndNow();
505 void PlayerAddedToBGCheckIfBGIsRunning(Player* plr);
507 /* Scorekeeping */
508 // Player scores
509 std::map<uint64, BattleGroundScore*> m_PlayerScores;
510 // must be implemented in BG subclass
511 virtual void RemovePlayer(Player * /*player*/, uint64 /*guid*/) {}
513 /* Player lists, those need to be accessible by inherited classes */
514 BattleGroundPlayerMap m_Players;
515 // Spirit Guide guid + Player list GUIDS
516 std::map<uint64, std::vector<uint64> > m_ReviveQueue;
519 these are important variables used for starting messages
521 uint8 m_Events;
522 BattleGroundStartTimeIntervals m_StartDelayTimes[BG_STARTING_EVENT_COUNT];
523 //this must be filled in constructors!
524 uint32 m_StartMessageIds[BG_STARTING_EVENT_COUNT];
526 bool m_BuffChange;
528 private:
529 /* Battleground */
530 BattleGroundTypeId m_TypeID;
531 uint32 m_InstanceID; //BattleGround Instance's GUID!
532 BattleGroundStatus m_Status;
533 uint32 m_ClientInstanceID; //the instance-id which is sent to the client and without any other internal use
534 uint32 m_StartTime;
535 int32 m_EndTime; // it is set to 120000 when bg is ending and it decreases itself
536 uint32 m_LastResurrectTime;
537 BGQueueIdBasedOnLevel m_QueueId;
538 uint8 m_ArenaType; // 2=2v2, 3=3v3, 5=5v5
539 bool m_InBGFreeSlotQueue; // used to make sure that BG is only once inserted into the BattleGroundMgr.BGFreeSlotQueue[bgTypeId] deque
540 bool m_SetDeleteThis; // used for safe deletion of the bg after end / all players leave
541 bool m_IsArena;
542 uint8 m_Winner; // 0=alliance, 1=horde, 2=none
543 int32 m_StartDelayTime;
544 bool m_IsRated; // is this battle rated?
545 bool m_PrematureCountDown;
546 uint32 m_PrematureCountDownTimer;
547 char const *m_Name;
549 /* Player lists */
550 std::vector<uint64> m_ResurrectQueue; // Player GUID
551 std::deque<uint64> m_OfflineQueue; // Player GUID
553 /* 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 */
554 /* Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG */
555 /* Invited players counters*/
556 uint32 m_InvitedAlliance;
557 uint32 m_InvitedHorde;
559 /* Raid Group */
560 Group *m_BgRaids[BG_TEAMS_COUNT]; // 0 - alliance, 1 - horde
562 /* Players count by team */
563 uint32 m_PlayersCount[BG_TEAMS_COUNT];
565 /* Arena team ids by team */
566 uint32 m_ArenaTeamIds[BG_TEAMS_COUNT];
568 int32 m_ArenaTeamRatingChanges[BG_TEAMS_COUNT];
570 /* Limits */
571 uint32 m_LevelMin;
572 uint32 m_LevelMax;
573 uint32 m_MaxPlayersPerTeam;
574 uint32 m_MaxPlayers;
575 uint32 m_MinPlayersPerTeam;
576 uint32 m_MinPlayers;
578 /* Start location */
579 uint32 m_MapId;
580 float m_TeamStartLocX[BG_TEAMS_COUNT];
581 float m_TeamStartLocY[BG_TEAMS_COUNT];
582 float m_TeamStartLocZ[BG_TEAMS_COUNT];
583 float m_TeamStartLocO[BG_TEAMS_COUNT];
585 #endif