OregonCore  revision fb2a440-git
Your Favourite TBC server
Battleground.h File Reference
#include "Common.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "Opcodes.h"
#include "ObjectMgr.h"
#include "BattlegroundMgr.h"
#include "SharedDefines.h"

Go to the source code of this file.

Classes

struct  BattlegroundPlayer
 
struct  BattlegroundObjectInfo
 
class  BattlegroundScore
 
class  Battleground
 

Macros

#define MAX_QUEUED_PLAYERS_MAP   7
 
#define MAX_BATTLEGROUND_TYPE_ID   8
 
#define BG_TEAMS_COUNT   2
 
#define BG_STARTING_EVENT_COUNT   4
 

Enumerations

enum  BattlegroundSounds { SOUND_HORDE_WINS = 8454, SOUND_ALLIANCE_WINS = 8455, SOUND_BG_START = 3439, SOUND_BG_START_L70ETC = 11803 }
 
enum  BattlegroundQuests {
  SPELL_WS_QUEST_REWARD = 43483, SPELL_AB_QUEST_REWARD = 43484, SPELL_AV_QUEST_REWARD = 43475, SPELL_AV_QUEST_KILLED_BOSS = 23658,
  SPELL_EY_QUEST_REWARD = 43477, SPELL_AB_QUEST_REWARD_4_BASES = 24061, SPELL_AB_QUEST_REWARD_5_BASES = 24064
}
 
enum  BattlegroundMarks { ITEM_AV_MARK_OF_HONOR = 20560, ITEM_WS_MARK_OF_HONOR = 20558, ITEM_AB_MARK_OF_HONOR = 20559, ITEM_EY_MARK_OF_HONOR = 29024 }
 
enum  BattlegroundMarksCount { ITEM_WINNER_COUNT = 3, ITEM_LOSER_COUNT = 1 }
 
enum  BattlegroundSpells {
  SPELL_SUMMON_PET = 6962, SPELL_WAITING_FOR_RESURRECT = 2584, SPELL_SPIRIT_HEAL_CHANNEL = 22011, SPELL_SPIRIT_HEAL = 22012,
  SPELL_RESURRECTION_VISUAL = 24171, SPELL_ARENA_PREPARATION = 32727, SPELL_ALLIANCE_GOLD_FLAG = 32724, SPELL_ALLIANCE_GREEN_FLAG = 32725,
  SPELL_HORDE_GOLD_FLAG = 35774, SPELL_HORDE_GREEN_FLAG = 35775, SPELL_PREPARATION = 44521, SPELL_SPIRIT_HEAL_MANA = 44535,
  SPELL_RECENTLY_DROPPED_FLAG = 42792, SPELL_AURA_PLAYER_INACTIVE = 43681
}
 
enum  BattlegroundTimeIntervals {
  CHECK_PLAYER_POSITION_INVERVAL = 1000, RESURRECTION_INTERVAL = 30000, REMIND_INTERVAL = 30000, INVITE_ACCEPT_WAIT_TIME = 80000,
  TIME_TO_AUTOREMOVE = 120000, MAX_OFFLINE_TIME = 300000, RESPAWN_ONE_DAY = 86400, RESPAWN_IMMEDIATELY = 0,
  BUFF_RESPAWN_TIME = 180, BG_HONOR_SCORE_TICKS = 330
}
 
enum  BattlegroundStartTimeIntervals {
  BG_START_DELAY_2M = 120000, BG_START_DELAY_1M = 60000, BG_START_DELAY_30S = 30000, BG_START_DELAY_15S = 15000,
  BG_START_DELAY_NONE = 0
}
 
enum  BattlegroundBuffObjects { BG_OBJECTID_SPEEDBUFF_ENTRY = 179871, BG_OBJECTID_REGENBUFF_ENTRY = 179904, BG_OBJECTID_BERSERKERBUFF_ENTRY = 179905 }
 
enum  BattlegroundStatus {
  STATUS_NONE = 0, STATUS_WAIT_QUEUE = 1, STATUS_WAIT_JOIN = 2, STATUS_IN_PROGRESS = 3,
  STATUS_WAIT_LEAVE = 4
}
 
enum  BattlegroundTypeId {
  BATTLEGROUND_AV = 1, BATTLEGROUND_WS = 2, BATTLEGROUND_AB = 3, BATTLEGROUND_NA = 4,
  BATTLEGROUND_BE = 5, BATTLEGROUND_AA = 6, BATTLEGROUND_EY = 7, BATTLEGROUND_RL = 8
}
 
enum  BattlegroundQueueTypeId {
  BATTLEGROUND_QUEUE_AV = 1, BATTLEGROUND_QUEUE_WS = 2, BATTLEGROUND_QUEUE_AB = 3, BATTLEGROUND_QUEUE_EY = 4,
  BATTLEGROUND_QUEUE_2v2 = 5, BATTLEGROUND_QUEUE_3v3 = 6, BATTLEGROUND_QUEUE_5v5 = 7
}
 
enum  ScoreType {
  SCORE_KILLING_BLOWS = 1, SCORE_DEATHS = 2, SCORE_HONORABLE_KILLS = 3, SCORE_BONUS_HONOR = 4,
  SCORE_DAMAGE_DONE = 5, SCORE_HEALING_DONE = 6, SCORE_FLAG_CAPTURES = 7, SCORE_FLAG_RETURNS = 8,
  SCORE_BASES_ASSAULTED = 9, SCORE_BASES_DEFENDED = 10, SCORE_GRAVEYARDS_ASSAULTED = 11, SCORE_GRAVEYARDS_DEFENDED = 12,
  SCORE_TOWERS_ASSAULTED = 13, SCORE_TOWERS_DEFENDED = 14, SCORE_MINES_CAPTURED = 15, SCORE_LEADERS_KILLED = 16,
  SCORE_SECONDARY_OBJECTIVES = 17
}
 
enum  ArenaType { ARENA_TYPE_2v2 = 2, ARENA_TYPE_3v3 = 3, ARENA_TYPE_5v5 = 5 }
 
enum  BattlegroundType { TYPE_BATTLEGROUND = 3, TYPE_ARENA = 4 }
 
enum  BattlegroundWinner { WINNER_HORDE = 0, WINNER_ALLIANCE = 1, WINNER_NONE = 2 }
 
enum  BattlegroundTeamId { BG_TEAM_ALLIANCE = 0, BG_TEAM_HORDE = 1 }
 
enum  BattlegroundStartingEvents {
  BG_STARTING_EVENT_NONE = 0x00, BG_STARTING_EVENT_1 = 0x01, BG_STARTING_EVENT_2 = 0x02, BG_STARTING_EVENT_3 = 0x04,
  BG_STARTING_EVENT_4 = 0x08
}
 
enum  BattlegroundStartingEventsIds { BG_STARTING_EVENT_FIRST = 0, BG_STARTING_EVENT_SECOND = 1, BG_STARTING_EVENT_THIRD = 2, BG_STARTING_EVENT_FOURTH = 3 }
 
enum  BattlegroundJoinError {
  BG_JOIN_ERR_OK = 0, BG_JOIN_ERR_OFFLINE_MEMBER = 1, BG_JOIN_ERR_GROUP_TOO_MANY = 2, BG_JOIN_ERR_MIXED_FACTION = 3,
  BG_JOIN_ERR_MIXED_LEVELS = 4, BG_JOIN_ERR_MIXED_ARENATEAM = 5, BG_JOIN_ERR_GROUP_MEMBER_ALREADY_IN_QUEUE = 6, BG_JOIN_ERR_GROUP_DESERTER = 7,
  BG_JOIN_ERR_ALL_QUEUES_USED = 8, BG_JOIN_ERR_GROUP_NOT_ENOUGH = 9
}
 
enum  BGHonorMode { BG_NORMAL = 0, BG_HOLIDAY, BG_HONOR_MODE_NUM }
 

Variables

const uint32 Buff_Entries [3] = { BG_OBJECTID_SPEEDBUFF_ENTRY, BG_OBJECTID_REGENBUFF_ENTRY, BG_OBJECTID_BERSERKERBUFF_ENTRY }
 

Macro Definition Documentation

#define BG_STARTING_EVENT_COUNT   4

Definition at line 232 of file Battleground.h.

#define BG_TEAMS_COUNT   2
#define MAX_BATTLEGROUND_TYPE_ID   8

Definition at line 149 of file Battleground.h.

Referenced by BattlegroundMgr::DeleteAlllBattlegrounds().

#define MAX_QUEUED_PLAYERS_MAP   7

Definition at line 136 of file Battleground.h.

Enumeration Type Documentation

enum ArenaType
Enumerator
ARENA_TYPE_2v2 
ARENA_TYPE_3v3 
ARENA_TYPE_5v5 

Definition at line 189 of file Battleground.h.

Enumerator
BG_OBJECTID_SPEEDBUFF_ENTRY 
BG_OBJECTID_REGENBUFF_ENTRY 
BG_OBJECTID_BERSERKERBUFF_ENTRY 

Definition at line 103 of file Battleground.h.

Enumerator
BG_JOIN_ERR_OK 
BG_JOIN_ERR_OFFLINE_MEMBER 
BG_JOIN_ERR_GROUP_TOO_MANY 
BG_JOIN_ERR_MIXED_FACTION 
BG_JOIN_ERR_MIXED_LEVELS 
BG_JOIN_ERR_MIXED_ARENATEAM 
BG_JOIN_ERR_GROUP_MEMBER_ALREADY_IN_QUEUE 
BG_JOIN_ERR_GROUP_DESERTER 
BG_JOIN_ERR_ALL_QUEUES_USED 
BG_JOIN_ERR_GROUP_NOT_ENOUGH 

Definition at line 234 of file Battleground.h.

Enumerator
ITEM_AV_MARK_OF_HONOR 
ITEM_WS_MARK_OF_HONOR 
ITEM_AB_MARK_OF_HONOR 
ITEM_EY_MARK_OF_HONOR 

Definition at line 48 of file Battleground.h.

Enumerator
ITEM_WINNER_COUNT 
ITEM_LOSER_COUNT 

Definition at line 56 of file Battleground.h.

Enumerator
SPELL_WS_QUEST_REWARD 
SPELL_AB_QUEST_REWARD 
SPELL_AV_QUEST_REWARD 
SPELL_AV_QUEST_KILLED_BOSS 
SPELL_EY_QUEST_REWARD 
SPELL_AB_QUEST_REWARD_4_BASES 
SPELL_AB_QUEST_REWARD_5_BASES 

Definition at line 37 of file Battleground.h.

Enumerator
BATTLEGROUND_QUEUE_AV 
BATTLEGROUND_QUEUE_WS 
BATTLEGROUND_QUEUE_AB 
BATTLEGROUND_QUEUE_EY 
BATTLEGROUND_QUEUE_2v2 
BATTLEGROUND_QUEUE_3v3 
BATTLEGROUND_QUEUE_5v5 

Definition at line 152 of file Battleground.h.

Enumerator
SOUND_HORDE_WINS 
SOUND_ALLIANCE_WINS 
SOUND_BG_START 
SOUND_BG_START_L70ETC 

Definition at line 29 of file Battleground.h.

Enumerator
SPELL_SUMMON_PET 
SPELL_WAITING_FOR_RESURRECT 
SPELL_SPIRIT_HEAL_CHANNEL 
SPELL_SPIRIT_HEAL 
SPELL_RESURRECTION_VISUAL 
SPELL_ARENA_PREPARATION 
SPELL_ALLIANCE_GOLD_FLAG 
SPELL_ALLIANCE_GREEN_FLAG 
SPELL_HORDE_GOLD_FLAG 
SPELL_HORDE_GREEN_FLAG 
SPELL_PREPARATION 
SPELL_SPIRIT_HEAL_MANA 
SPELL_RECENTLY_DROPPED_FLAG 
SPELL_AURA_PLAYER_INACTIVE 

Definition at line 62 of file Battleground.h.

63 {
64  SPELL_SUMMON_PET = 6962, // Pet Summoned
65  SPELL_WAITING_FOR_RESURRECT = 2584, // Waiting to Resurrect
66  SPELL_SPIRIT_HEAL_CHANNEL = 22011, // Spirit Heal Channel
67  SPELL_SPIRIT_HEAL = 22012, // Spirit Heal
68  SPELL_RESURRECTION_VISUAL = 24171, // Resurrection Impact Visual
69  SPELL_ARENA_PREPARATION = 32727, // use this one, 32728 not correct
72  SPELL_HORDE_GOLD_FLAG = 35774,
73  SPELL_HORDE_GREEN_FLAG = 35775,
74  SPELL_PREPARATION = 44521, // Preparation
75  SPELL_SPIRIT_HEAL_MANA = 44535, // Spirit Heal
76  SPELL_RECENTLY_DROPPED_FLAG = 42792, // Recently Dropped Flag
77  SPELL_AURA_PLAYER_INACTIVE = 43681 // Inactive
78 };
Enumerator
BG_STARTING_EVENT_NONE 
BG_STARTING_EVENT_1 
BG_STARTING_EVENT_2 
BG_STARTING_EVENT_3 
BG_STARTING_EVENT_4 

Definition at line 216 of file Battleground.h.

Enumerator
BG_STARTING_EVENT_FIRST 
BG_STARTING_EVENT_SECOND 
BG_STARTING_EVENT_THIRD 
BG_STARTING_EVENT_FOURTH 

Definition at line 225 of file Battleground.h.

Enumerator
BG_START_DELAY_2M 
BG_START_DELAY_1M 
BG_START_DELAY_30S 
BG_START_DELAY_15S 
BG_START_DELAY_NONE 

Definition at line 94 of file Battleground.h.

95 {
96  BG_START_DELAY_2M = 120000, // ms (2 minutes)
97  BG_START_DELAY_1M = 60000, // ms (1 minute)
98  BG_START_DELAY_30S = 30000, // ms (30 seconds)
99  BG_START_DELAY_15S = 15000, // ms (15 seconds) Used only in arena
100  BG_START_DELAY_NONE = 0, // ms
101 };
Enumerator
STATUS_NONE 
STATUS_WAIT_QUEUE 
STATUS_WAIT_JOIN 
STATUS_IN_PROGRESS 
STATUS_WAIT_LEAVE 

Definition at line 112 of file Battleground.h.

113 {
114  STATUS_NONE = 0, // first status, should mean bg is not instance
115  STATUS_WAIT_QUEUE = 1, // means bg is empty and waiting for queue
116  STATUS_WAIT_JOIN = 2, // this means, that BG has already started and it is waiting for more players
117  STATUS_IN_PROGRESS = 3, // means bg is running
118  STATUS_WAIT_LEAVE = 4 // means some faction has won BG and it is ending
119 };
Enumerator
BG_TEAM_ALLIANCE 
BG_TEAM_HORDE 

Definition at line 209 of file Battleground.h.

210 {
211  BG_TEAM_ALLIANCE = 0,
212  BG_TEAM_HORDE = 1
213 };
Enumerator
CHECK_PLAYER_POSITION_INVERVAL 
RESURRECTION_INTERVAL 
REMIND_INTERVAL 
INVITE_ACCEPT_WAIT_TIME 
TIME_TO_AUTOREMOVE 
MAX_OFFLINE_TIME 
RESPAWN_ONE_DAY 
RESPAWN_IMMEDIATELY 
BUFF_RESPAWN_TIME 
BG_HONOR_SCORE_TICKS 

Definition at line 80 of file Battleground.h.

Enumerator
TYPE_BATTLEGROUND 
TYPE_ARENA 

Definition at line 196 of file Battleground.h.

197 {
198  TYPE_BATTLEGROUND = 3,
199  TYPE_ARENA = 4
200 };
Enumerator
BATTLEGROUND_AV 
BATTLEGROUND_WS 
BATTLEGROUND_AB 
BATTLEGROUND_NA 
BATTLEGROUND_BE 
BATTLEGROUND_AA 
BATTLEGROUND_EY 
BATTLEGROUND_RL 

Definition at line 138 of file Battleground.h.

Enumerator
WINNER_HORDE 
WINNER_ALLIANCE 
WINNER_NONE 

Definition at line 202 of file Battleground.h.

203 {
204  WINNER_HORDE = 0,
205  WINNER_ALLIANCE = 1,
206  WINNER_NONE = 2
207 };
Enumerator
BG_NORMAL 
BG_HOLIDAY 
BG_HONOR_MODE_NUM 

Definition at line 264 of file Battleground.h.

enum ScoreType
Enumerator
SCORE_KILLING_BLOWS 
SCORE_DEATHS 
SCORE_HONORABLE_KILLS 
SCORE_BONUS_HONOR 
SCORE_DAMAGE_DONE 
SCORE_HEALING_DONE 
SCORE_FLAG_CAPTURES 
SCORE_FLAG_RETURNS 
SCORE_BASES_ASSAULTED 
SCORE_BASES_DEFENDED 
SCORE_GRAVEYARDS_ASSAULTED 
SCORE_GRAVEYARDS_DEFENDED 
SCORE_TOWERS_ASSAULTED 
SCORE_TOWERS_DEFENDED 
SCORE_MINES_CAPTURED 
SCORE_LEADERS_KILLED 
SCORE_SECONDARY_OBJECTIVES 

Definition at line 163 of file Battleground.h.

164 {
166  SCORE_DEATHS = 2,
168  SCORE_BONUS_HONOR = 4,
169  //EY, but in MSG_PVP_LOG_DATA opcode!
170  SCORE_DAMAGE_DONE = 5,
171  SCORE_HEALING_DONE = 6,
172  //WS
174  SCORE_FLAG_RETURNS = 8,
175  //AB
178  //AV
186  // TODO : implement them
187 };

Variable Documentation