| 1 | /* |
|---|
| 2 | * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> |
|---|
| 3 | * |
|---|
| 4 | * Thanks to the original authors: MaNGOS <http://www.mangosproject.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 __BATTLEGROUNDEY_H |
|---|
| 22 | #define __BATTLEGROUNDEY_H |
|---|
| 23 | |
|---|
| 24 | #include "Language.h" |
|---|
| 25 | |
|---|
| 26 | class BattleGround; |
|---|
| 27 | |
|---|
| 28 | #define EY_MAX_TEAM_SCORE 2000 |
|---|
| 29 | #define BG_EY_FLAG_RESPAWN_TIME 10000 //10 seconds |
|---|
| 30 | #define BG_EY_FPOINTS_TICK_TIME 2000 //2 seconds |
|---|
| 31 | |
|---|
| 32 | enum BG_EY_WorldStates |
|---|
| 33 | { |
|---|
| 34 | EY_ALLIANCE_RESOURCES = 2749, |
|---|
| 35 | EY_HORDE_RESOURCES = 2750, |
|---|
| 36 | EY_ALLIANCE_BASE = 2752, |
|---|
| 37 | EY_HORDE_BASE = 2753, |
|---|
| 38 | DRAENEI_RUINS_HORDE_CONTROL = 2733, |
|---|
| 39 | DRAENEI_RUINS_ALLIANCE_CONTROL = 2732, |
|---|
| 40 | DRAENEI_RUINS_UNCONTROL = 2731, |
|---|
| 41 | MAGE_TOWER_ALLIANCE_CONTROL = 2730, |
|---|
| 42 | MAGE_TOWER_HORDE_CONTROL = 2729, |
|---|
| 43 | MAGE_TOWER_UNCONTROL = 2728, |
|---|
| 44 | FEL_REAVER_HORDE_CONTROL = 2727, |
|---|
| 45 | FEL_REAVER_ALLIANCE_CONTROL = 2726, |
|---|
| 46 | FEL_REAVER_UNCONTROL = 2725, |
|---|
| 47 | BLOOD_ELF_HORDE_CONTROL = 2724, |
|---|
| 48 | BLOOD_ELF_ALLIANCE_CONTROL = 2723, |
|---|
| 49 | BLOOD_ELF_UNCONTROL = 2722, |
|---|
| 50 | PROGRESS_BAR_PERCENT_GREY = 2720, //100 = empty (only grey), 0 = blue|red (no grey) |
|---|
| 51 | PROGRESS_BAR_STATUS = 2719, //50 init!, 48 ... hordak bere .. 33 .. 0 = full 100% hordacky , 100 = full alliance |
|---|
| 52 | PROGRESS_BAR_SHOW = 2718, //1 init, 0 druhy send - bez messagu, 1 = controlled aliance |
|---|
| 53 | NETHERSTORM_FLAG = 2757, |
|---|
| 54 | //set to 2 when flag is picked up, and to 1 if it is dropped |
|---|
| 55 | NETHERSTORM_FLAG_STATE_ALLIANCE = 2769, |
|---|
| 56 | NETHERSTORM_FLAG_STATE_HORDE = 2770 |
|---|
| 57 | }; |
|---|
| 58 | |
|---|
| 59 | enum BG_EY_ProgressBarConsts |
|---|
| 60 | { |
|---|
| 61 | BG_EY_POINT_MAX_CAPTURERS_COUNT = 5, |
|---|
| 62 | BG_EY_POINT_RADIUS = 70, |
|---|
| 63 | BG_EY_PROGRESS_BAR_DONT_SHOW = 0, |
|---|
| 64 | BG_EY_PROGRESS_BAR_SHOW = 1, |
|---|
| 65 | BG_EY_PROGRESS_BAR_PERCENT_GREY = 40, |
|---|
| 66 | BG_EY_PROGRESS_BAR_STATE_MIDDLE = 50, |
|---|
| 67 | BG_EY_PROGRESS_BAR_HORDE_CONTROLLED = 0, |
|---|
| 68 | BG_EY_PROGRESS_BAR_NEUTRAL_LOW = 30, |
|---|
| 69 | BG_EY_PROGRESS_BAR_NEUTRAL_HIGH = 70, |
|---|
| 70 | BG_EY_PROGRESS_BAR_ALI_CONTROLLED = 100 |
|---|
| 71 | }; |
|---|
| 72 | |
|---|
| 73 | enum BG_EY_Sounds |
|---|
| 74 | { |
|---|
| 75 | //strange ids, but sure about them |
|---|
| 76 | BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE = 8212, |
|---|
| 77 | BG_EY_SOUND_FLAG_CAPTURED_HORDE = 8213, |
|---|
| 78 | BG_EY_SOUND_FLAG_PICKED_UP_HORDE = 8174, |
|---|
| 79 | BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE = 8173, |
|---|
| 80 | BG_EY_SOUND_FLAG_RESET = 8192 |
|---|
| 81 | }; |
|---|
| 82 | |
|---|
| 83 | enum BG_EY_Spells |
|---|
| 84 | { |
|---|
| 85 | BG_EY_NETHERSTORM_FLAG_SPELL = 34976, |
|---|
| 86 | BG_EY_PLAYER_DROPPED_FLAG_SPELL = 34991 |
|---|
| 87 | }; |
|---|
| 88 | |
|---|
| 89 | enum EYBattleGroundObjectEntry |
|---|
| 90 | { |
|---|
| 91 | BG_OBJECT_A_DOOR_EY_ENTRY = 184719, //Alliance door |
|---|
| 92 | BG_OBJECT_H_DOOR_EY_ENTRY = 184720, //Horde door |
|---|
| 93 | BG_OBJECT_FLAG1_EY_ENTRY = 184493, //Netherstorm flag (generic) |
|---|
| 94 | BG_OBJECT_FLAG2_EY_ENTRY = 184141, //Netherstorm flag (flagstand) |
|---|
| 95 | BG_OBJECT_FLAG3_EY_ENTRY = 184142, //Netherstorm flag (flagdrop) |
|---|
| 96 | BG_OBJECT_A_BANNER_EY_ENTRY = 184381, //Visual Banner (Alliance) |
|---|
| 97 | BG_OBJECT_H_BANNER_EY_ENTRY = 184380, //Visual Banner (Horde) |
|---|
| 98 | BG_OBJECT_N_BANNER_EY_ENTRY = 184382, //Visual Banner (Neutral) |
|---|
| 99 | BG_OBJECT_BE_TOWER_CAP_EY_ENTRY = 184080, //BE Tower Cap Pt |
|---|
| 100 | BG_OBJECT_FR_TOWER_CAP_EY_ENTRY = 184081, //Fel Reaver Cap Pt |
|---|
| 101 | BG_OBJECT_HU_TOWER_CAP_EY_ENTRY = 184082, //Human Tower Cap Pt |
|---|
| 102 | BG_OBJECT_DR_TOWER_CAP_EY_ENTRY = 184083 //Draenei Tower Cap Pt |
|---|
| 103 | }; |
|---|
| 104 | |
|---|
| 105 | enum EYBattleGroundPointsTrigger |
|---|
| 106 | { |
|---|
| 107 | TR_BLOOD_ELF_POINT = 4476, |
|---|
| 108 | TR_FEL_REALVER_POINT = 4514, |
|---|
| 109 | TR_MAGE_TOWER_POINT = 4516, |
|---|
| 110 | TR_DRAENEI_RUINS_POINT = 4518, |
|---|
| 111 | TR_BLOOD_ELF_BUFF = 4568, |
|---|
| 112 | TR_FEL_REALVER_BUFF = 4569, |
|---|
| 113 | TR_MAGE_TOWER_BUFF = 4570, |
|---|
| 114 | TR_DRAENEI_RUINS_BUFF = 4571 |
|---|
| 115 | }; |
|---|
| 116 | |
|---|
| 117 | enum EYBattleGroundGaveyards |
|---|
| 118 | { |
|---|
| 119 | EY_GRAVEYARD_MAIN_ALLIANCE = 1103, |
|---|
| 120 | EY_GRAVEYARD_MAIN_HORDE = 1104, |
|---|
| 121 | EY_GRAVEYARD_FEL_REALVER = 1105, |
|---|
| 122 | EY_GRAVEYARD_BLOOD_ELF = 1106, |
|---|
| 123 | EY_GRAVEYARD_DRAENEI_RUINS = 1107, |
|---|
| 124 | EY_GRAVEYARD_MAGE_TOWER = 1108 |
|---|
| 125 | }; |
|---|
| 126 | |
|---|
| 127 | enum EYBattleGroundPoints |
|---|
| 128 | { |
|---|
| 129 | FEL_REALVER = 0, |
|---|
| 130 | BLOOD_ELF = 1, |
|---|
| 131 | DRAENEI_RUINS = 2, |
|---|
| 132 | MAGE_TOWER = 3, |
|---|
| 133 | |
|---|
| 134 | EY_PLAYERS_OUT_OF_POINTS = 4, |
|---|
| 135 | EY_POINTS_MAX = 4 |
|---|
| 136 | }; |
|---|
| 137 | |
|---|
| 138 | enum EYBattleGroundCreaturesTypes |
|---|
| 139 | { |
|---|
| 140 | EY_SPIRIT_FEL_REALVER = 0, |
|---|
| 141 | EY_SPIRIT_BLOOD_ELF = 1, |
|---|
| 142 | EY_SPIRIT_DRAENEI_RUINS = 2, |
|---|
| 143 | EY_SPIRIT_MAGE_TOWER = 3, |
|---|
| 144 | EY_SPIRIT_MAIN_ALLIANCE = 4, |
|---|
| 145 | EY_SPIRIT_MAIN_HORDE = 5, |
|---|
| 146 | |
|---|
| 147 | BG_EY_CREATURES_MAX = 6 |
|---|
| 148 | }; |
|---|
| 149 | |
|---|
| 150 | enum EYBattleGroundObjectTypes |
|---|
| 151 | { |
|---|
| 152 | BG_EY_OBJECT_DOOR_A = 0, |
|---|
| 153 | BG_EY_OBJECT_DOOR_H = 1, |
|---|
| 154 | BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER = 2, |
|---|
| 155 | BG_EY_OBJECT_A_BANNER_FEL_REALVER_LEFT = 3, |
|---|
| 156 | BG_EY_OBJECT_A_BANNER_FEL_REALVER_RIGHT = 4, |
|---|
| 157 | BG_EY_OBJECT_A_BANNER_BLOOD_ELF_CENTER = 5, |
|---|
| 158 | BG_EY_OBJECT_A_BANNER_BLOOD_ELF_LEFT = 6, |
|---|
| 159 | BG_EY_OBJECT_A_BANNER_BLOOD_ELF_RIGHT = 7, |
|---|
| 160 | BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_CENTER = 8, |
|---|
| 161 | BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_LEFT = 9, |
|---|
| 162 | BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_RIGHT = 10, |
|---|
| 163 | BG_EY_OBJECT_A_BANNER_MAGE_TOWER_CENTER = 11, |
|---|
| 164 | BG_EY_OBJECT_A_BANNER_MAGE_TOWER_LEFT = 12, |
|---|
| 165 | BG_EY_OBJECT_A_BANNER_MAGE_TOWER_RIGHT = 13, |
|---|
| 166 | BG_EY_OBJECT_H_BANNER_FEL_REALVER_CENTER = 14, |
|---|
| 167 | BG_EY_OBJECT_H_BANNER_FEL_REALVER_LEFT = 15, |
|---|
| 168 | BG_EY_OBJECT_H_BANNER_FEL_REALVER_RIGHT = 16, |
|---|
| 169 | BG_EY_OBJECT_H_BANNER_BLOOD_ELF_CENTER = 17, |
|---|
| 170 | BG_EY_OBJECT_H_BANNER_BLOOD_ELF_LEFT = 18, |
|---|
| 171 | BG_EY_OBJECT_H_BANNER_BLOOD_ELF_RIGHT = 19, |
|---|
| 172 | BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_CENTER = 20, |
|---|
| 173 | BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_LEFT = 21, |
|---|
| 174 | BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_RIGHT = 22, |
|---|
| 175 | BG_EY_OBJECT_H_BANNER_MAGE_TOWER_CENTER = 23, |
|---|
| 176 | BG_EY_OBJECT_H_BANNER_MAGE_TOWER_LEFT = 24, |
|---|
| 177 | BG_EY_OBJECT_H_BANNER_MAGE_TOWER_RIGHT = 25, |
|---|
| 178 | BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER = 26, |
|---|
| 179 | BG_EY_OBJECT_N_BANNER_FEL_REALVER_LEFT = 27, |
|---|
| 180 | BG_EY_OBJECT_N_BANNER_FEL_REALVER_RIGHT = 28, |
|---|
| 181 | BG_EY_OBJECT_N_BANNER_BLOOD_ELF_CENTER = 29, |
|---|
| 182 | BG_EY_OBJECT_N_BANNER_BLOOD_ELF_LEFT = 30, |
|---|
| 183 | BG_EY_OBJECT_N_BANNER_BLOOD_ELF_RIGHT = 31, |
|---|
| 184 | BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_CENTER = 32, |
|---|
| 185 | BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_LEFT = 33, |
|---|
| 186 | BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_RIGHT = 34, |
|---|
| 187 | BG_EY_OBJECT_N_BANNER_MAGE_TOWER_CENTER = 35, |
|---|
| 188 | BG_EY_OBJECT_N_BANNER_MAGE_TOWER_LEFT = 36, |
|---|
| 189 | BG_EY_OBJECT_N_BANNER_MAGE_TOWER_RIGHT = 37, |
|---|
| 190 | BG_EY_OBJECT_TOWER_CAP_FEL_REALVER = 38, |
|---|
| 191 | BG_EY_OBJECT_TOWER_CAP_BLOOD_ELF = 39, |
|---|
| 192 | BG_EY_OBJECT_TOWER_CAP_DRAENEI_RUINS = 40, |
|---|
| 193 | BG_EY_OBJECT_TOWER_CAP_MAGE_TOWER = 41, |
|---|
| 194 | BG_EY_OBJECT_FLAG_NETHERSTORM = 42, |
|---|
| 195 | BG_EY_OBJECT_FLAG_FEL_REALVER = 43, |
|---|
| 196 | BG_EY_OBJECT_FLAG_BLOOD_ELF = 44, |
|---|
| 197 | BG_EY_OBJECT_FLAG_DRAENEI_RUINS = 45, |
|---|
| 198 | BG_EY_OBJECT_FLAG_MAGE_TOWER = 46, |
|---|
| 199 | //buffs |
|---|
| 200 | BG_EY_OBJECT_SPEEDBUFF_FEL_REALVER = 47, |
|---|
| 201 | BG_EY_OBJECT_REGENBUFF_FEL_REALVER = 48, |
|---|
| 202 | BG_EY_OBJECT_BERSERKBUFF_FEL_REALVER = 49, |
|---|
| 203 | BG_EY_OBJECT_SPEEDBUFF_BLOOD_ELF = 50, |
|---|
| 204 | BG_EY_OBJECT_REGENBUFF_BLOOD_ELF = 51, |
|---|
| 205 | BG_EY_OBJECT_BERSERKBUFF_BLOOD_ELF = 52, |
|---|
| 206 | BG_EY_OBJECT_SPEEDBUFF_DRAENEI_RUINS = 53, |
|---|
| 207 | BG_EY_OBJECT_REGENBUFF_DRAENEI_RUINS = 54, |
|---|
| 208 | BG_EY_OBJECT_BERSERKBUFF_DRAENEI_RUINS = 55, |
|---|
| 209 | BG_EY_OBJECT_SPEEDBUFF_MAGE_TOWER = 56, |
|---|
| 210 | BG_EY_OBJECT_REGENBUFF_MAGE_TOWER = 57, |
|---|
| 211 | BG_EY_OBJECT_BERSERKBUFF_MAGE_TOWER = 58, |
|---|
| 212 | BG_EY_OBJECT_MAX = 59 |
|---|
| 213 | }; |
|---|
| 214 | |
|---|
| 215 | enum BG_EY_FlagState |
|---|
| 216 | { |
|---|
| 217 | BG_EY_FLAG_STATE_ON_BASE = 0, |
|---|
| 218 | BG_EY_FLAG_STATE_WAIT_RESPAWN = 1, |
|---|
| 219 | BG_EY_FLAG_STATE_ON_PLAYER = 2, |
|---|
| 220 | BG_EY_FLAG_STATE_ON_GROUND = 3 |
|---|
| 221 | }; |
|---|
| 222 | |
|---|
| 223 | enum EYBattleGroundPointState |
|---|
| 224 | { |
|---|
| 225 | EY_POINT_NO_OWNER = 0, |
|---|
| 226 | EY_POINT_STATE_UNCONTROLLED = 0, |
|---|
| 227 | EY_POINT_UNDER_CONTROL = 3 |
|---|
| 228 | }; |
|---|
| 229 | |
|---|
| 230 | struct BattleGroundEYPointIconsStruct |
|---|
| 231 | { |
|---|
| 232 | BattleGroundEYPointIconsStruct(uint32 _WorldStateControlIndex, uint32 _WorldStateAllianceControlledIndex, uint32 _WorldStateHordeControlledIndex) |
|---|
| 233 | : WorldStateControlIndex(_WorldStateControlIndex), WorldStateAllianceControlledIndex(_WorldStateAllianceControlledIndex), WorldStateHordeControlledIndex(_WorldStateHordeControlledIndex) {} |
|---|
| 234 | uint32 WorldStateControlIndex; |
|---|
| 235 | uint32 WorldStateAllianceControlledIndex; |
|---|
| 236 | uint32 WorldStateHordeControlledIndex; |
|---|
| 237 | }; |
|---|
| 238 | |
|---|
| 239 | struct BattleGroundEYLoosingPointStruct |
|---|
| 240 | { |
|---|
| 241 | BattleGroundEYLoosingPointStruct(uint32 _SpawnNeutralObjectType, uint32 _DespawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _DespawnObjectTypeHorde, uint32 _MessageIdHorde) |
|---|
| 242 | : SpawnNeutralObjectType(_SpawnNeutralObjectType), DespawnObjectTypeAlliance(_DespawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance), DespawnObjectTypeHorde(_DespawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde) {} |
|---|
| 243 | uint32 SpawnNeutralObjectType; |
|---|
| 244 | uint32 DespawnObjectTypeAlliance; |
|---|
| 245 | uint32 DespawnObjectTypeHorde; |
|---|
| 246 | uint32 MessageIdHorde; |
|---|
| 247 | uint32 MessageIdAlliance; |
|---|
| 248 | }; |
|---|
| 249 | |
|---|
| 250 | struct BattleGroundEYCapturingPointStruct |
|---|
| 251 | { |
|---|
| 252 | BattleGroundEYCapturingPointStruct(uint32 _DespawnNeutralObjectType, uint32 _SpawnObjectTypeAlliance, uint32 _MessageIdAlliance, uint32 _SpawnObjectTypeHorde, uint32 _MessageIdHorde, uint32 _GraveYardId) |
|---|
| 253 | : DespawnNeutralObjectType(_DespawnNeutralObjectType), SpawnObjectTypeAlliance(_SpawnObjectTypeAlliance), MessageIdAlliance(_MessageIdAlliance), SpawnObjectTypeHorde(_SpawnObjectTypeHorde), MessageIdHorde(_MessageIdHorde), GraveYardId(_GraveYardId) {} |
|---|
| 254 | uint32 DespawnNeutralObjectType; |
|---|
| 255 | uint32 SpawnObjectTypeAlliance; |
|---|
| 256 | uint32 SpawnObjectTypeHorde; |
|---|
| 257 | uint32 MessageIdHorde; |
|---|
| 258 | uint32 MessageIdAlliance; |
|---|
| 259 | uint32 GraveYardId; |
|---|
| 260 | }; |
|---|
| 261 | |
|---|
| 262 | const uint8 BG_EY_TickPoints[EY_POINTS_MAX] = {1, 2, 5, 10}; |
|---|
| 263 | const uint32 BG_EY_FlagPoints[EY_POINTS_MAX] = {75, 85, 100, 500}; |
|---|
| 264 | |
|---|
| 265 | //constant arrays: |
|---|
| 266 | const BattleGroundEYPointIconsStruct m_PointsIconStruct[EY_POINTS_MAX] = |
|---|
| 267 | { |
|---|
| 268 | BattleGroundEYPointIconsStruct(FEL_REAVER_UNCONTROL, FEL_REAVER_ALLIANCE_CONTROL, FEL_REAVER_HORDE_CONTROL), |
|---|
| 269 | BattleGroundEYPointIconsStruct(BLOOD_ELF_UNCONTROL, BLOOD_ELF_ALLIANCE_CONTROL, BLOOD_ELF_HORDE_CONTROL), |
|---|
| 270 | BattleGroundEYPointIconsStruct(DRAENEI_RUINS_UNCONTROL, DRAENEI_RUINS_ALLIANCE_CONTROL, DRAENEI_RUINS_HORDE_CONTROL), |
|---|
| 271 | BattleGroundEYPointIconsStruct(MAGE_TOWER_UNCONTROL, MAGE_TOWER_ALLIANCE_CONTROL, MAGE_TOWER_HORDE_CONTROL) |
|---|
| 272 | }; |
|---|
| 273 | const BattleGroundEYLoosingPointStruct m_LoosingPointTypes[EY_POINTS_MAX] = |
|---|
| 274 | { |
|---|
| 275 | BattleGroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER, BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_LOST_A_F_RUINS, BG_EY_OBJECT_H_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_LOST_H_F_RUINS), |
|---|
| 276 | BattleGroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_BLOOD_ELF_CENTER, BG_EY_OBJECT_A_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_LOST_A_B_TOWER, BG_EY_OBJECT_H_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_LOST_H_B_TOWER), |
|---|
| 277 | BattleGroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_CENTER, BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_LOST_A_D_RUINS, BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_LOST_H_D_RUINS), |
|---|
| 278 | BattleGroundEYLoosingPointStruct(BG_EY_OBJECT_N_BANNER_MAGE_TOWER_CENTER, BG_EY_OBJECT_A_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_LOST_A_M_TOWER, BG_EY_OBJECT_H_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_LOST_H_M_TOWER) |
|---|
| 279 | }; |
|---|
| 280 | const BattleGroundEYCapturingPointStruct m_CapturingPointTypes[EY_POINTS_MAX] = |
|---|
| 281 | { |
|---|
| 282 | BattleGroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER, BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_TAKEN_A_F_RUINS, BG_EY_OBJECT_H_BANNER_FEL_REALVER_CENTER, LANG_BG_EY_HAS_TAKEN_H_F_RUINS, EY_GRAVEYARD_FEL_REALVER), |
|---|
| 283 | BattleGroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_BLOOD_ELF_CENTER, BG_EY_OBJECT_A_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_TAKEN_A_B_TOWER, BG_EY_OBJECT_H_BANNER_BLOOD_ELF_CENTER, LANG_BG_EY_HAS_TAKEN_H_B_TOWER, EY_GRAVEYARD_BLOOD_ELF), |
|---|
| 284 | BattleGroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_CENTER, BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_TAKEN_A_D_RUINS, BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_CENTER, LANG_BG_EY_HAS_TAKEN_H_D_RUINS, EY_GRAVEYARD_DRAENEI_RUINS), |
|---|
| 285 | BattleGroundEYCapturingPointStruct(BG_EY_OBJECT_N_BANNER_MAGE_TOWER_CENTER, BG_EY_OBJECT_A_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_TAKEN_A_M_TOWER, BG_EY_OBJECT_H_BANNER_MAGE_TOWER_CENTER, LANG_BG_EY_HAS_TAKEN_H_M_TOWER, EY_GRAVEYARD_MAGE_TOWER) |
|---|
| 286 | }; |
|---|
| 287 | |
|---|
| 288 | class BattleGroundEYScore : public BattleGroundScore |
|---|
| 289 | { |
|---|
| 290 | public: |
|---|
| 291 | BattleGroundEYScore () : FlagCaptures(0) {}; |
|---|
| 292 | virtual ~BattleGroundEYScore() {}; |
|---|
| 293 | uint32 FlagCaptures; |
|---|
| 294 | }; |
|---|
| 295 | |
|---|
| 296 | class BattleGroundEY : public BattleGround |
|---|
| 297 | { |
|---|
| 298 | friend class BattleGroundMgr; |
|---|
| 299 | |
|---|
| 300 | public: |
|---|
| 301 | BattleGroundEY(); |
|---|
| 302 | ~BattleGroundEY(); |
|---|
| 303 | void Update(time_t diff); |
|---|
| 304 | |
|---|
| 305 | /* inherited from BattlegroundClass */ |
|---|
| 306 | virtual void AddPlayer(Player *plr); |
|---|
| 307 | |
|---|
| 308 | /* BG Flags */ |
|---|
| 309 | uint64 GetFlagPickerGUID() const { return m_FlagKeeper; } |
|---|
| 310 | void SetFlagPicker(uint64 guid) { m_FlagKeeper = guid; } |
|---|
| 311 | bool IsFlagPickedup() const { return m_FlagKeeper != 0; } |
|---|
| 312 | uint8 GetFlagState() const { return m_FlagState; } |
|---|
| 313 | void RespawnFlag(bool send_message); |
|---|
| 314 | void RespawnFlagAfterDrop(); |
|---|
| 315 | |
|---|
| 316 | void RemovePlayer(Player *plr,uint64 guid); |
|---|
| 317 | void HandleBuffUse(uint64 const& buff_guid); |
|---|
| 318 | void HandleAreaTrigger(Player *Source, uint32 Trigger); |
|---|
| 319 | void HandleKillPlayer(Player *player, Player *killer); |
|---|
| 320 | virtual WorldSafeLocsEntry const* GetClosestGraveYard(float x, float y, float z, uint32 team); |
|---|
| 321 | virtual bool SetupBattleGround(); |
|---|
| 322 | virtual void ResetBGSubclass(); |
|---|
| 323 | void UpdateTeamScore(uint32 Team); |
|---|
| 324 | void UpdatePlayerScore(Player *Source, uint32 type, uint32 value); |
|---|
| 325 | virtual void FillInitialWorldStates(WorldPacket& data); |
|---|
| 326 | void SetDroppedFlagGUID(uint64 guid) { m_DroppedFlagGUID = guid;} |
|---|
| 327 | uint64 GetDroppedFlagGUID() const { return m_DroppedFlagGUID;} |
|---|
| 328 | |
|---|
| 329 | /* Battleground Events */ |
|---|
| 330 | virtual void EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj); |
|---|
| 331 | virtual void EventPlayerDroppedFlag(Player *Source); |
|---|
| 332 | |
|---|
| 333 | private: |
|---|
| 334 | void EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType); |
|---|
| 335 | void EventTeamCapturedPoint(Player *Source, uint32 Point); |
|---|
| 336 | void EventTeamLostPoint(Player *Source, uint32 Point); |
|---|
| 337 | void UpdatePointsCount(uint32 Team); |
|---|
| 338 | void UpdatePointsIcons(uint32 Team, uint32 Point); |
|---|
| 339 | |
|---|
| 340 | /* Point status updating procedures */ |
|---|
| 341 | void CheckSomeoneLeftPoint(); |
|---|
| 342 | void CheckSomeoneJoinedPoint(); |
|---|
| 343 | void UpdatePointStatuses(); |
|---|
| 344 | |
|---|
| 345 | /* Scorekeeping */ |
|---|
| 346 | uint32 GetTeamScore(uint32 Team) const { return m_TeamScores[GetTeamIndexByTeamId(Team)]; } |
|---|
| 347 | void AddPoints(uint32 Team, uint32 Points); |
|---|
| 348 | |
|---|
| 349 | void RemovePoint(uint32 TeamID, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] -= Points; } |
|---|
| 350 | void SetTeamPoint(uint32 TeamID, uint32 Points = 0) { m_TeamScores[GetTeamIndexByTeamId(TeamID)] = Points; } |
|---|
| 351 | |
|---|
| 352 | uint32 m_TeamScores[2]; |
|---|
| 353 | uint32 m_HonorScoreTics[2]; |
|---|
| 354 | uint32 m_TeamPointsCount[2]; |
|---|
| 355 | |
|---|
| 356 | uint32 m_Points_Trigger[EY_POINTS_MAX]; |
|---|
| 357 | |
|---|
| 358 | uint64 m_FlagKeeper; // keepers guid |
|---|
| 359 | uint64 m_DroppedFlagGUID; |
|---|
| 360 | uint32 m_FlagCapturedBgObjectType; // type that should be despawned when flag is captured |
|---|
| 361 | uint8 m_FlagState; // for checking flag state |
|---|
| 362 | int32 m_FlagsTimer; |
|---|
| 363 | int32 m_TowerCapCheckTimer; |
|---|
| 364 | |
|---|
| 365 | uint32 m_PointOwnedByTeam[EY_POINTS_MAX]; |
|---|
| 366 | uint8 m_PointState[EY_POINTS_MAX]; |
|---|
| 367 | int32 m_PointBarStatus[EY_POINTS_MAX]; |
|---|
| 368 | typedef std::vector<uint64> PlayersNearPointType; |
|---|
| 369 | PlayersNearPointType m_PlayersNearPoint[EY_POINTS_MAX + 1]; |
|---|
| 370 | uint8 m_CurrentPointPlayersCount[2*EY_POINTS_MAX]; |
|---|
| 371 | |
|---|
| 372 | int32 m_PointAddingTimer; |
|---|
| 373 | }; |
|---|
| 374 | #endif |
|---|