root/trunk/src/game/BattleGround.h @ 257

Revision 257, 22.3 kB (checked in by yumileroy, 17 years ago)

*Merge from Mangos. Add MapReference?. Author: hunuza.
*Also re-commit the patches reverted in 255.

Original author: megamage
Date: 2008-11-18 19:40:06-06:00

Line 
1/*
2 * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
3 *
4 * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21#ifndef __BATTLEGROUND_H
22#define __BATTLEGROUND_H
23
24#include "Common.h"
25#include "WorldPacket.h"
26#include "WorldSession.h"
27#include "Opcodes.h"
28#include "ObjectMgr.h"
29#include "BattleGroundMgr.h"
30#include "SharedDefines.h"
31
32enum BattleGroundSounds
33{
34    SOUND_HORDE_WINS                = 8454,
35    SOUND_ALLIANCE_WINS             = 8455,
36    SOUND_BG_START                  = 3439,
37    SOUND_BG_START_L70ETC                       = 11803,
38};
39
40enum BattleGroundQuests
41{
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
49};
50
51enum BattleGroundMarks
52{
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
60};
61
62enum BattleGroundMarksCount
63{
64    ITEM_WINNER_COUNT               = 3,
65    ITEM_LOSER_COUNT                = 1
66};
67
68enum BattleGroundSpells
69{
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
83};
84
85enum BattleGroundTimeIntervals
86{
87    RESURRECTION_INTERVAL           = 30000,                // ms
88    REMIND_INTERVAL                 = 30000,                // ms
89    INVITE_ACCEPT_WAIT_TIME         = 120000,               // ms
90    TIME_TO_AUTOREMOVE              = 120000,               // ms
91    MAX_OFFLINE_TIME                = 300000,               // ms
92    START_DELAY0                    = 120000,               // ms
93    START_DELAY1                    = 60000,                // ms
94    START_DELAY2                    = 30000,                // ms
95    START_DELAY3                    = 15000,                // ms used only in arena
96    RESPAWN_ONE_DAY                 = 86400,                // secs
97    RESPAWN_IMMEDIATELY             = 0,                    // secs
98    BUFF_RESPAWN_TIME               = 180,                  // secs
99    BG_HONOR_SCORE_TICKS            = 330                   // points
100};
101
102enum BattleGroundBuffObjects
103{
104    BG_OBJECTID_SPEEDBUFF_ENTRY     = 179871,
105    BG_OBJECTID_REGENBUFF_ENTRY     = 179904,
106    BG_OBJECTID_BERSERKERBUFF_ENTRY = 179905
107};
108
109const uint32 Buff_Entries[3] = { BG_OBJECTID_SPEEDBUFF_ENTRY, BG_OBJECTID_REGENBUFF_ENTRY, BG_OBJECTID_BERSERKERBUFF_ENTRY };
110
111enum BattleGroundStatus
112{
113    STATUS_NONE         = 0,
114    STATUS_WAIT_QUEUE   = 1,
115    STATUS_WAIT_JOIN    = 2,
116    STATUS_IN_PROGRESS  = 3,
117    STATUS_WAIT_LEAVE   = 4                                 // custom
118};
119
120struct BattleGroundPlayer
121{
122    uint32  LastOnlineTime;                                 // for tracking and removing offline players from queue after 5 minutes
123    uint32  Team;                                           // Player's team
124};
125
126struct BattleGroundObjectInfo
127{
128    BattleGroundObjectInfo() : object(NULL), timer(0), spellid(0) {}
129
130    GameObject  *object;
131    int32       timer;
132    uint32      spellid;
133};
134
135#define MAX_QUEUED_PLAYERS_MAP 7
136
137enum BattleGroundTypeId
138{
139    BATTLEGROUND_AV     = 1,
140    BATTLEGROUND_WS     = 2,
141    BATTLEGROUND_AB     = 3,
142    BATTLEGROUND_NA     = 4,
143    BATTLEGROUND_BE     = 5,
144    BATTLEGROUND_AA     = 6,
145    BATTLEGROUND_EY     = 7,
146    BATTLEGROUND_RL     = 8
147};
148
149// handle the queue types and bg types separately to enable joining queue for different sized arenas at the same time
150enum BattleGroundQueueTypeId
151{
152    BATTLEGROUND_QUEUE_AV     = 1,
153    BATTLEGROUND_QUEUE_WS     = 2,
154    BATTLEGROUND_QUEUE_AB     = 3,
155    BATTLEGROUND_QUEUE_EY     = 4,
156    BATTLEGROUND_QUEUE_2v2     = 5,
157    BATTLEGROUND_QUEUE_3v3     = 6,
158    BATTLEGROUND_QUEUE_5v5     = 7,
159};
160
161enum ScoreType
162{
163    SCORE_KILLING_BLOWS         = 1,
164    SCORE_DEATHS                = 2,
165    SCORE_HONORABLE_KILLS       = 3,
166    SCORE_BONUS_HONOR           = 4,
167    //EY, but in MSG_PVP_LOG_DATA opcode!
168    SCORE_DAMAGE_DONE           = 5,
169    SCORE_HEALING_DONE          = 6,
170    //WS
171    SCORE_FLAG_CAPTURES         = 7,
172    SCORE_FLAG_RETURNS          = 8,
173    //AB
174    SCORE_BASES_ASSAULTED       = 9,
175    SCORE_BASES_DEFENDED        = 10,
176    //AV
177    SCORE_GRAVEYARDS_ASSAULTED  = 11,
178    SCORE_GRAVEYARDS_DEFENDED   = 12,
179    SCORE_TOWERS_ASSAULTED      = 13,
180    SCORE_TOWERS_DEFENDED       = 14,
181    SCORE_MINES_CAPTURED        = 15,
182    SCORE_LEADERS_KILLED        = 16,
183    SCORE_SECONDARY_OBJECTIVES  = 17
184    // TODO : implement them
185};
186
187enum ArenaType
188{
189    ARENA_TYPE_2v2          = 2,
190    ARENA_TYPE_3v3          = 3,
191    ARENA_TYPE_5v5          = 5
192};
193
194enum BattleGroundType
195{
196    TYPE_BATTLEGROUND     = 3,
197    TYPE_ARENA            = 4
198};
199
200enum BattleGroundWinner
201{
202    WINNER_HORDE            = 0,
203    WINNER_ALLIANCE         = 1,
204    WINNER_NONE             = 2
205};
206
207enum BattleGroundTeamId
208{
209    BG_TEAM_ALLIANCE        = 0,
210    BG_TEAM_HORDE           = 1
211};
212
213enum BattleGroundJoinError
214{
215    BG_JOIN_ERR_OK = 0,
216    BG_JOIN_ERR_OFFLINE_MEMBER = 1,
217    BG_JOIN_ERR_GROUP_TOO_MANY = 2,
218    BG_JOIN_ERR_MIXED_FACTION = 3,
219    BG_JOIN_ERR_MIXED_LEVELS = 4,
220    BG_JOIN_ERR_MIXED_ARENATEAM = 5,
221    BG_JOIN_ERR_GROUP_MEMBER_ALREADY_IN_QUEUE = 6,
222    BG_JOIN_ERR_GROUP_DESERTER = 7,
223    BG_JOIN_ERR_ALL_QUEUES_USED = 8,
224    BG_JOIN_ERR_GROUP_NOT_ENOUGH = 9
225};
226
227class BattleGroundScore
228{
229    public:
230        BattleGroundScore() : KillingBlows(0), HonorableKills(0), Deaths(0), DamageDone(0), HealingDone(0), BonusHonor(0) {};
231        virtual ~BattleGroundScore()                        //virtual destructor is used when deleting score from scores map
232        {
233        };
234        uint32 KillingBlows;
235        uint32 Deaths;
236        uint32 HonorableKills;
237        uint32 BonusHonor;
238        uint32 DamageDone;
239        uint32 HealingDone;
240};
241
242enum BGHonorMode
243{
244    BG_NORMAL = 0,
245    BG_HOLIDAY,
246    BG_HONOR_MODE_NUM
247};
248
249/*
250This class is used to:
2511. Add player to battleground
2522. Remove player from battleground
2533. some certain cases, same for all battlegrounds
2544. It has properties same for all battlegrounds
255*/
256class BattleGround
257{
258    friend class BattleGroundMgr;
259
260    public:
261        /* Construction */
262        BattleGround();
263        virtual ~BattleGround();
264        virtual void Update(time_t diff);                   // must be implemented in BG subclass of BG specific update code, but must in begginning call parent version
265        virtual bool SetupBattleGround()                    // must be implemented in BG subclass
266        {
267            return true;
268        }
269        void Reset();                                       // resets all common properties for battlegrounds
270        virtual void ResetBGSubclass()                      // must be implemented in BG subclass
271        {
272        }
273
274        /* Battleground */
275        // Get methods:
276        char const* GetName() const         { return m_Name; }
277        uint32 GetTypeID() const            { return m_TypeID; }
278        uint32 GetQueueType() const         { return m_Queue_type; }
279        uint32 GetInstanceID() const        { return m_InstanceID; }
280        uint32 GetStatus() const            { return m_Status; }
281        uint32 GetStartTime() const         { return m_StartTime; }
282        uint32 GetEndTime() const           { return m_EndTime; }
283        uint32 GetLastResurrectTime() const { return m_LastResurrectTime; }
284        uint32 GetMaxPlayers() const        { return m_MaxPlayers; }
285        uint32 GetMinPlayers() const        { return m_MinPlayers; }
286
287        uint32 GetMinLevel() const          { return m_LevelMin; }
288        uint32 GetMaxLevel() const          { return m_LevelMax; }
289
290        uint32 GetMaxPlayersPerTeam() const { return m_MaxPlayersPerTeam; }
291        uint32 GetMinPlayersPerTeam() const { return m_MinPlayersPerTeam; }
292
293        int GetStartDelayTime() const       { return m_StartDelayTime; }
294        uint8 GetArenaType() const          { return m_ArenaType; }
295        uint8 GetWinner() const             { return m_Winner; }
296        uint32 GetBattlemasterEntry() const;
297
298        // Set methods:
299        void SetName(char const* Name)      { m_Name = Name; }
300        void SetTypeID(uint32 TypeID)       { m_TypeID = TypeID; }
301        void SetQueueType(uint32 ID)        { m_Queue_type = ID; }
302        void SetInstanceID(uint32 InstanceID) { m_InstanceID = InstanceID; }
303        void SetStatus(uint32 Status)       { m_Status = Status; }
304        void SetStartTime(uint32 Time)      { m_StartTime = Time; }
305        void SetEndTime(uint32 Time)        { m_EndTime = Time; }
306        void SetLastResurrectTime(uint32 Time) { m_LastResurrectTime = Time; }
307        void SetMaxPlayers(uint32 MaxPlayers) { m_MaxPlayers = MaxPlayers; }
308        void SetMinPlayers(uint32 MinPlayers) { m_MinPlayers = MinPlayers; }
309        void SetLevelRange(uint32 min, uint32 max) { m_LevelMin = min; m_LevelMax = max; }
310        void SetRated(bool state)           { m_IsRated = state; }
311        void SetArenaType(uint8 type)       { m_ArenaType = type; }
312        void SetArenaorBGType(bool _isArena) { m_IsArena = _isArena; }
313        void SetWinner(uint8 winner)        { m_Winner = winner; }
314
315        void ModifyStartDelayTime(int diff) { m_StartDelayTime -= diff; }
316        void SetStartDelayTime(int Time)    { m_StartDelayTime = Time; }
317
318        void SetMaxPlayersPerTeam(uint32 MaxPlayers) { m_MaxPlayersPerTeam = MaxPlayers; }
319        void SetMinPlayersPerTeam(uint32 MinPlayers) { m_MinPlayersPerTeam = MinPlayers; }
320
321        void AddToBGFreeSlotQueue();                        //this queue will be useful when more battlegrounds instances will be available
322        void RemoveFromBGFreeSlotQueue();                   //this method could delete whole BG instance, if another free is available
323
324        void DecreaseInvitedCount(uint32 team)      { (team == ALLIANCE) ? --m_InvitedAlliance : --m_InvitedHorde; }
325        void IncreaseInvitedCount(uint32 team)      { (team == ALLIANCE) ? ++m_InvitedAlliance : ++m_InvitedHorde; }
326        uint32 GetInvitedCount(uint32 team) const
327        {
328            if( team == ALLIANCE )
329                return m_InvitedAlliance;
330            else
331                return m_InvitedHorde;
332        }
333        bool HasFreeSlotsForTeam(uint32 Team) const;
334        bool HasFreeSlots() const;
335        uint32 GetFreeSlotsForTeam(uint32 Team) const;
336
337        bool isArena() const        { return m_IsArena; }
338        bool isBattleGround() const { return !m_IsArena; }
339        bool isRated() const        { return m_IsRated; }
340
341        typedef std::map<uint64, BattleGroundPlayer> BattleGroundPlayerMap;
342        BattleGroundPlayerMap const& GetPlayers() const { return m_Players; }
343        uint32 GetPlayersSize() const { return m_Players.size(); }
344        uint32 GetRemovedPlayersSize() const { return m_RemovedPlayers.size(); }
345
346        std::map<uint64, BattleGroundScore*>::const_iterator GetPlayerScoresBegin() const { return m_PlayerScores.begin(); }
347        std::map<uint64, BattleGroundScore*>::const_iterator GetPlayerScoresEnd() const { return m_PlayerScores.end(); }
348        uint32 GetPlayerScoresSize() const { return m_PlayerScores.size(); }
349
350        uint32 GetReviveQueueSize() const { return m_ReviveQueue.size(); }
351
352        void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid);
353        void RemovePlayerFromResurrectQueue(uint64 player_guid);
354
355        void StartBattleGround();
356
357        /* Location */
358        void SetMapId(uint32 MapID) { m_MapId = MapID; }
359        uint32 GetMapId() const { return m_MapId; }
360
361        void SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, float O);
362        void GetTeamStartLoc(uint32 TeamID, float &X, float &Y, float &Z, float &O) const
363        {
364            uint8 idx = GetTeamIndexByTeamId(TeamID);
365            X = m_TeamStartLocX[idx];
366            Y = m_TeamStartLocY[idx];
367            Z = m_TeamStartLocZ[idx];
368            O = m_TeamStartLocO[idx];
369        }
370
371        /* Packet Transfer */
372        // method that should fill worldpacket with actual world states (not yet implemented for all battlegrounds!)
373        virtual void FillInitialWorldStates(WorldPacket& /*data*/) {}
374        void SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *sender = NULL, bool self = true);
375        void SendPacketToAll(WorldPacket *packet);
376        void PlaySoundToTeam(uint32 SoundID, uint32 TeamID);
377        void PlaySoundToAll(uint32 SoundID);
378        void CastSpellOnTeam(uint32 SpellID, uint32 TeamID);
379        void RewardHonorToTeam(uint32 Honor, uint32 TeamID);
380        void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID);
381        void RewardMark(Player *plr,uint32 count);
382        void SendRewardMarkByMail(Player *plr,uint32 mark, uint32 count);
383        void RewardQuest(Player *plr);
384        void UpdateWorldState(uint32 Field, uint32 Value);
385        void UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player *Source);
386        void EndBattleGround(uint32 winner);
387        void BlockMovement(Player *plr);
388
389        void SendMessageToAll(char const* text);
390        void SendMessageToAll(int32 entry);
391
392        /* Raid Group */
393        Group *GetBgRaid(uint32 TeamID) const { return TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE]; }
394        void SetBgRaid(uint32 TeamID, Group *bg_raid)
395        {
396            Group* &old_raid = TeamID == ALLIANCE ? m_BgRaids[BG_TEAM_ALLIANCE] : m_BgRaids[BG_TEAM_HORDE];
397            if(old_raid) old_raid->SetBattlegroundGroup(NULL);
398            if(bg_raid) bg_raid->SetBattlegroundGroup(this);
399            old_raid = bg_raid;
400        }
401
402        virtual void UpdatePlayerScore(Player *Source, uint32 type, uint32 value);
403
404        uint8 GetTeamIndexByTeamId(uint32 Team) const { return Team == ALLIANCE ? BG_TEAM_ALLIANCE : BG_TEAM_HORDE; }
405        uint32 GetPlayersCountByTeam(uint32 Team) const { return m_PlayersCount[GetTeamIndexByTeamId(Team)]; }
406        uint32 GetAlivePlayersCountByTeam(uint32 Team) const;   // used in arenas to correctly handle death in spirit of redemption / last stand etc. (killer = killed) cases
407        void UpdatePlayersCountByTeam(uint32 Team, bool remove)
408        {
409            if(remove)
410                --m_PlayersCount[GetTeamIndexByTeamId(Team)];
411            else
412                ++m_PlayersCount[GetTeamIndexByTeamId(Team)];
413        }
414
415        // used for rated arena battles
416        void SetArenaTeamIdForTeam(uint32 Team, uint32 ArenaTeamId) { m_ArenaTeamIds[GetTeamIndexByTeamId(Team)] = ArenaTeamId; }
417        uint32 GetArenaTeamIdForTeam(uint32 Team) const { return m_ArenaTeamIds[GetTeamIndexByTeamId(Team)]; }
418        void SetArenaTeamRatingChangeForTeam(uint32 Team, int32 RatingChange) { m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)] = RatingChange; }
419        int32 GetArenaTeamRatingChangeForTeam(uint32 Team) const { return m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)]; }
420
421        /* Triggers handle */
422        // must be implemented in BG subclass
423        virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/) {}
424        // must be implemented in BG subclass if need AND call base class generic code
425        virtual void HandleKillPlayer(Player *player, Player *killer);
426
427        /* Battleground events */
428        /* these functions will return true event is possible, but false if player is bugger */
429        virtual void EventPlayerDroppedFlag(Player* /*player*/) {}
430        virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) {}
431        virtual void EventPlayerCapturedFlag(Player* /*player*/) {}
432
433        /* Death related */
434        virtual WorldSafeLocsEntry const* GetClosestGraveYard(float /*x*/, float /*y*/, float /*z*/, uint32 /*team*/)  { return NULL; }
435
436        virtual void AddPlayer(Player *plr);                // must be implemented in BG subclass
437        virtual void RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket);
438                                                            // can be extended in in BG subclass
439
440        void HandleTriggerBuff(uint64 const& go_guid);
441        void SetHoliday(bool is_holiday);
442
443        // TODO: make this protected:
444        typedef std::vector<uint64> BGObjects;
445        typedef std::vector<uint64> BGCreatures;
446        BGObjects m_BgObjects;
447        BGCreatures m_BgCreatures;
448        void SpawnBGObject(uint32 type, uint32 respawntime);
449        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);
450//        void SpawnBGCreature(uint32 type, uint32 respawntime);
451        Creature* AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime = 0);
452        bool DelCreature(uint32 type);
453        bool DelObject(uint32 type);
454        bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, uint32 team);
455
456        void DoorOpen(uint32 type);
457        void DoorClose(uint32 type);
458        const char *GetTrinityString(int32 entry);
459
460        virtual bool HandlePlayerUnderMap(Player * plr) {return false;}
461
462        // since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
463        uint32 GetPlayerTeam(uint64 guid);
464
465        void SetDeleteThis() {m_SetDeleteThis = true;}
466
467    protected:
468        //this method is called, when BG cannot spawn its own spirit guide, or something is wrong, It correctly ends BattleGround
469        void EndNow();
470
471        /* Scorekeeping */
472                                                            // Player scores
473        std::map<uint64, BattleGroundScore*>    m_PlayerScores;
474        // must be implemented in BG subclass
475        virtual void RemovePlayer(Player * /*player*/, uint64 /*guid*/) {}
476
477        /* Player lists, those need to be accessible by inherited classes */
478        BattleGroundPlayerMap  m_Players;
479                                                            // Spirit Guide guid + Player list GUIDS
480        std::map<uint64, std::vector<uint64> >  m_ReviveQueue;
481
482        /*
483        this is important variable used for invitation messages
484        */
485        uint8 m_Events;
486
487        bool   m_BuffChange;
488
489        BGHonorMode m_HonorMode;
490    private:
491        /* Battleground */
492        uint32 m_TypeID;                                    //Battleground type, defined in enum BattleGroundTypeId
493        uint32 m_InstanceID;                                //BattleGround Instance's GUID!
494        uint32 m_Status;
495        uint32 m_StartTime;
496        uint32 m_EndTime;
497        uint32 m_LastResurrectTime;
498        uint32 m_Queue_type;
499        uint8  m_ArenaType;                                 // 2=2v2, 3=3v3, 5=5v5
500        bool   m_InBGFreeSlotQueue;                         // used to make sure that BG is only once inserted into the BattleGroundMgr.BGFreeSlotQueue[bgTypeId] deque
501        bool   m_SetDeleteThis;                             // used for safe deletion of the bg after end / all players leave
502        // this variable is not used .... it can be found in many other ways... but to store it in BG object instance is useless
503        //uint8  m_BattleGroundType;                        // 3=BG, 4=arena
504        //instead of uint8 (in previous line) is bool used
505        bool   m_IsArena;
506        uint8  m_Winner;                                    // 0=alliance, 1=horde, 2=none
507        int32  m_StartDelayTime;
508        bool   m_IsRated;                                   // is this battle rated?
509        bool   m_PrematureCountDown;
510        uint32 m_PrematureCountDownTimer;
511        char const *m_Name;
512
513        /* Player lists */
514        std::vector<uint64> m_ResurrectQueue;               // Player GUID
515        std::map<uint64, uint8> m_RemovedPlayers;           // uint8 is remove type (0 - bgqueue, 1 - bg, 2 - resurrect queue)
516
517        /* 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 */
518        /* Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG */
519        /* Invited players counters*/
520        uint32 m_InvitedAlliance;
521        uint32 m_InvitedHorde;
522
523        /* Raid Group */
524        Group *m_BgRaids[2];                                // 0 - alliance, 1 - horde
525
526        /* Players count by team */
527        uint32 m_PlayersCount[2];
528
529        /* Arena team ids by team */
530        uint32 m_ArenaTeamIds[2];
531
532        int32 m_ArenaTeamRatingChanges[2];
533
534        /* Limits */
535        uint32 m_LevelMin;
536        uint32 m_LevelMax;
537        uint32 m_MaxPlayersPerTeam;
538        uint32 m_MaxPlayers;
539        uint32 m_MinPlayersPerTeam;
540        uint32 m_MinPlayers;
541
542        /* Location */
543        uint32 m_MapId;
544        float m_TeamStartLocX[2];
545        float m_TeamStartLocY[2];
546        float m_TeamStartLocZ[2];
547        float m_TeamStartLocO[2];
548};
549#endif
Note: See TracBrowser for help on using the browser.