TrinityCore
BattlegroundAB.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __BATTLEGROUNDAB_H
19#define __BATTLEGROUNDAB_H
20
21#include "Battleground.h"
22#include "Object.h"
23
25{
32
33 BG_AB_WS_STABLE_ICON = 1842, // Stable map icon (NONE)
34 BG_AB_WS_STABLE_STATE_ALIENCE = 1767, // Stable map state (ALIENCE)
35 BG_AB_WS_STABLE_STATE_HORDE = 1768, // Stable map state (HORDE)
36 BG_AB_WS_STABLE_STATE_CON_ALI = 1769, // Stable map state (CON ALIENCE)
37 BG_AB_WS_STABLE_STATE_CON_HOR = 1770, // Stable map state (CON HORDE)
38 BG_AB_WS_FARM_ICON = 1845, // Farm map icon (NONE)
39 BG_AB_WS_FARM_STATE_ALIENCE = 1772, // Farm state (ALIENCE)
40 BG_AB_WS_FARM_STATE_HORDE = 1773, // Farm state (HORDE)
41 BG_AB_WS_FARM_STATE_CON_ALI = 1774, // Farm state (CON ALIENCE)
42 BG_AB_WS_FARM_STATE_CON_HOR = 1775, // Farm state (CON HORDE)
43 BG_AB_WS_BLACKSMITH_ICON = 1846, // Blacksmith map icon (NONE)
44 BG_AB_WS_BLACKSMITH_STATE_ALIENCE = 1782, // Blacksmith map state (ALIENCE)
45 BG_AB_WS_BLACKSMITH_STATE_HORDE = 1783, // Blacksmith map state (HORDE)
46 BG_AB_WS_BLACKSMITH_STATE_CON_ALI = 1784, // Blacksmith map state (CON ALIENCE)
47 BG_AB_WS_BLACKSMITH_STATE_CON_HOR = 1785, // Blacksmith map state (CON HORDE)
48 BG_AB_WS_LUMBERMILL_ICON = 1844, // Lumber Mill map icon (NONE)
49 BG_AB_WS_LUMBERMILL_STATE_ALIENCE = 1792, // Lumber Mill map state (ALIENCE)
50 BG_AB_WS_LUMBERMILL_STATE_HORDE = 1793, // Lumber Mill map state (HORDE)
51 BG_AB_WS_LUMBERMILL_STATE_CON_ALI = 1794, // Lumber Mill map state (CON ALIENCE)
52 BG_AB_WS_LUMBERMILL_STATE_CON_HOR = 1795, // Lumber Mill map state (CON HORDE)
53 BG_AB_WS_GOLDMINE_ICON = 1843, // Gold Mine map icon (NONE)
54 BG_AB_WS_GOLDMINE_STATE_ALIENCE = 1787, // Gold Mine map state (ALIENCE)
55 BG_AB_WS_GOLDMINE_STATE_HORDE = 1788, // Gold Mine map state (HORDE)
56 BG_AB_WS_GOLDMINE_STATE_CON_ALI = 1789, // Gold Mine map state (CON ALIENCE
57 BG_AB_WS_GOLDMINE_STATE_CON_HOR = 1790, // Gold Mine map state (CON HORDE)
58
61
62 BG_AB_WS_FARM_ICON_NEW = 8808, // Farm map icon
63 BG_AB_WS_LUMBER_MILL_ICON_NEW = 8805, // Lumber Mill map icon
64 BG_AB_WS_BLACKSMITH_ICON_NEW = 8799, // Blacksmith map icon
65 BG_AB_WS_GOLD_MINE_ICON_NEW = 8809, // Gold Mine map icon
66 BG_AB_WS_STABLES_ICON_NEW = 5834, // Stable map icon
67
78};
79
80/* Object id templates from DB */
82{
88
92};
93
95{
98};
99
101{
105
106/* do NOT change the order, else wrong behaviour */
108{
114
115 BG_AB_DYNAMIC_NODES_COUNT = 5, // dynamic nodes that can be captured
116
119
120 BG_AB_ALL_NODES_COUNT = 7 // all nodes (dynamic and static)
122
124{
127};
128
130{
139
141{
145
146#define BG_AB_NotABBGWeekendHonorTicks 260
147#define BG_AB_ABBGWeekendHonorTicks 160
148#define BG_AB_NotABBGWeekendReputationTicks 160
149#define BG_AB_ABBGWeekendReputationTicks 120
150
152{
153 AB_EVENT_START_BATTLE = 9158, // Achievement: Let's Get This Done
154
161
168
175
182
190
191// Tick intervals and given points: case 0, 1, 2, 3, 4, 5 captured nodes
193const uint32 BG_AB_TickPoints[6] = { 0, 2, 3, 4, 7, 60 };
194
195// WorldSafeLocs ids for 5 nodes, and for ally, and horde starting location
197{
206
208{
216};
217
219{
220 public:
221 BattlegroundAB(BattlegroundTemplate const* battlegroundTemplate);
223
224 void StartingEventOpenDoors() override;
225 bool SetupBattleground() override;
226 void Reset() override;
227 void EndBattleground(Team winner) override;
228 WorldSafeLocsEntry const* GetClosestGraveyard(Player* player) override;
230
231 Team GetPrematureWinner() override;
232
233 void ProcessEvent(WorldObject* obj, uint32 eventId, WorldObject* invoker = nullptr) override;
234
235 void OnCreatureCreate(Creature* creature) override;
236 void OnGameObjectCreate(GameObject* gameObject) override;
237 private:
238 void PostUpdateImpl(uint32 diff) override;
239
240 void _CalculateTeamNodes(uint8& alliance, uint8& horde);
241
248
253};
254#endif
BG_AB_ExploitTeleportLocations
@ AB_EXPLOIT_TELEPORT_LOCATION_ALLIANCE
@ AB_EXPLOIT_TELEPORT_LOCATION_HORDE
const uint32 BG_AB_TickPoints[6]
BG_AB_Creatures
@ BG_AB_NPC_THE_BLACK_BRIDE
@ BG_AB_NPC_RADULF_LEDER
BG_AB_BroadcastTexts
@ BG_AB_TEXT_ALLIANCE_NEAR_VICTORY
@ BG_AB_TEXT_HORDE_NEAR_VICTORY
const uint32 BG_AB_TickInterval
BG_AB_Events
@ AB_EVENT_CONTESTED_FARM_HORDE
@ AB_EVENT_CAPTURE_STABLES_HORDE
@ AB_EVENT_CONTESTED_GOLD_MINE_ALLIANCE
@ AB_EVENT_CAPTURE_BLACKSMITH_HORDE
@ AB_EVENT_CONTESTED_BLACKSMITH_HORDE
@ AB_EVENT_CAPTURE_GOLD_MINE_ALLIANCE
@ AB_EVENT_DEFENDED_LUMBER_MILL_ALLIANCE
@ AB_EVENT_CAPTURE_FARM_HORDE
@ AB_EVENT_DEFENDED_STABLES_HORDE
@ AB_EVENT_DEFENDED_BLACKSMITH_HORDE
@ AB_EVENT_CAPTURE_FARM_ALLIANCE
@ AB_EVENT_CONTESTED_LUMBER_MILL_HORDE
@ AB_EVENT_CONTESTED_STABLES_HORDE
@ AB_EVENT_CONTESTED_GOLD_MINE_HORDE
@ AB_EVENT_DEFENDED_FARM_HORDE
@ AB_EVENT_CONTESTED_LUMBER_MILL_ALLIANCE
@ AB_EVENT_CONTESTED_BLACKSMITH_ALLIANCE
@ AB_EVENT_CAPTURE_LUMBER_MILL_ALLIANCE
@ AB_EVENT_CONTESTED_FARM_ALLIANCE
@ AB_EVENT_DEFENDED_STABLES_ALLIANCE
@ AB_EVENT_DEFENDED_BLACKSMITH_ALLIANCE
@ AB_EVENT_CONTESTED_STABLES_ALLIANCE
@ AB_EVENT_DEFENDED_FARM_ALLIANCE
@ AB_EVENT_DEFENDED_GOLD_MINE_ALLIANCE
@ AB_EVENT_DEFENDED_GOLD_MINE_HORDE
@ AB_EVENT_CAPTURE_STABLES_ALLIANCE
@ AB_EVENT_CAPTURE_GOLD_MINE_HORDE
@ AB_EVENT_START_BATTLE
@ AB_EVENT_CAPTURE_BLACKSMITH_ALLIANCE
@ AB_EVENT_DEFENDED_LUMBER_MILL_HORDE
@ AB_EVENT_CAPTURE_LUMBER_MILL_HORDE
const uint32 BG_AB_GraveyardIds[BG_AB_ALL_NODES_COUNT]
BG_AB_ObjectTypes
@ BG_AB_OBJECTID_CAPTURE_POINT_FARM
@ BG_AB_OBJECTID_GHOST_GATE
@ BG_AB_OBJECTID_CAPTURE_POINT_STABLES
@ BG_AB_OBJECTID_CAPTURE_POINT_BLACKSMITH
@ BG_AB_OBJECTID_ALLIANCE_DOOR
@ BG_AB_OBJECTID_CAPTURE_POINT_GOLD_MINE
@ BG_AB_OBJECTID_HORDE_DOOR
@ BG_AB_OBJECTID_CAPTURE_POINT_LUMBER_MILL
BG_AB_BattlegroundNodes
@ BG_AB_NODE_BLACKSMITH
@ BG_AB_NODE_STABLES
@ BG_AB_ALL_NODES_COUNT
@ BG_AB_NODE_LUMBER_MILL
@ BG_AB_DYNAMIC_NODES_COUNT
@ BG_AB_NODE_FARM
@ BG_AB_SPIRIT_HORDE
@ BG_AB_NODE_GOLD_MINE
@ BG_AB_SPIRIT_ALIANCE
BG_AB_Graveyards
@ AB_GRAVEYARD_HORDE_BASE
@ AB_GRAVEYARD_STABLES
@ AB_GRAVEYARD_GOLD_MINE
@ AB_GRAVEYARD_BLACKSMITH
@ AB_GRAVEYARD_ALLIANCE_BASE
@ AB_GRAVEYARD_LUMBER_MILL
@ AB_GRAVEYARD_FARM
BG_AB_WorldStates
@ BG_AB_WS_LUMBERMILL_STATE_CON_ALI
@ BG_AB_WS_HAD_500_DISADVANTAGE_ALLIANCE
@ BG_AB_WS_BLACKSMITH_STATE_CON_ALI
@ BG_AB_WS_STABLES_HORDE_CONTROL_STATE
@ BG_AB_WS_LUMBER_MILL_HORDE_CONTROL_STATE
@ BG_AB_WS_GOLDMINE_ICON
@ BG_AB_WS_STABLE_STATE_CON_HOR
@ BG_AB_WS_LUMBER_MILL_ALLIANCE_CONTROL_STATE
@ BG_AB_WS_FARM_ICON_NEW
@ BG_AB_WS_LUMBERMILL_STATE_HORDE
@ BG_AB_WS_BLACKSMITH_ICON
@ BG_AB_WS_GOLD_MINE_ALLIANCE_CONTROL_STATE
@ BG_AB_WS_GOLDMINE_STATE_CON_HOR
@ BG_AB_WS_LUMBERMILL_STATE_ALIENCE
@ BG_AB_WS_FARM_STATE_CON_ALI
@ BG_AB_WS_HAD_500_DISADVANTAGE_HORDE
@ BG_AB_WS_LUMBER_MILL_ICON_NEW
@ BG_AB_WS_GOLD_MINE_HORDE_CONTROL_STATE
@ BG_AB_WS_GOLDMINE_STATE_HORDE
@ BG_AB_WS_GOLDMINE_STATE_ALIENCE
@ BG_AB_WS_STABLE_ICON
@ BG_AB_WS_STABLE_STATE_ALIENCE
@ BG_AB_WS_FARM_ALLIANCE_CONTROL_STATE
@ BG_AB_WS_BLACKSMITH_STATE_ALIENCE
@ BG_AB_WS_STABLE_STATE_HORDE
@ BG_AB_WS_LUMBERMILL_ICON
@ BG_AB_WS_RESOURCES_HORDE
@ BG_AB_WS_FARM_STATE_ALIENCE
@ BG_AB_WS_FARM_HORDE_CONTROL_STATE
@ BG_AB_WS_BLACKSMITH_ICON_NEW
@ BG_AB_WS_BLACKSMITH_STATE_HORDE
@ BG_AB_WS_RESOURCES_ALLY
@ BG_AB_WS_BLACKSMITH_HORDE_CONTROL_STATE
@ BG_AB_WS_OCCUPIED_BASES_HORDE
@ BG_AB_WS_RESOURCES_MAX
@ BG_AB_WS_FARM_STATE_HORDE
@ BG_AB_WS_STABLES_ALLIANCE_CONTROL_STATE
@ BG_AB_WS_RESOURCES_WARNING
@ BG_AB_WS_FARM_STATE_CON_HOR
@ BG_AB_WS_OCCUPIED_BASES_ALLY
@ BG_AB_WS_BLACKSMITH_STATE_CON_HOR
@ BG_AB_WS_LUMBERMILL_STATE_CON_HOR
@ BG_AB_WS_GOLD_MINE_ICON_NEW
@ BG_AB_WS_STABLE_STATE_CON_ALI
@ BG_AB_WS_BLACKSMITH_ALLIANCE_CONTROL_STATE
@ BG_AB_WS_GOLDMINE_STATE_CON_ALI
@ BG_AB_WS_STABLES_ICON_NEW
@ BG_AB_WS_FARM_ICON
BG_AB_Score
@ BG_AB_WARNING_NEAR_VICTORY_SCORE
@ BG_AB_MAX_TEAM_SCORE
BG_AB_Sounds
@ BG_AB_SOUND_NEAR_VICTORY_ALLIANCE
@ BG_AB_SOUND_NODE_CAPTURED_HORDE
@ BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE
@ BG_AB_SOUND_NODE_ASSAULTED_HORDE
@ BG_AB_SOUND_NEAR_VICTORY_HORDE
@ BG_AB_SOUND_NODE_CLAIMED
@ BG_AB_SOUND_NODE_CAPTURED_ALLIANCE
uint8_t uint8
Definition: Define.h:144
uint32_t uint32
Definition: Define.h:142
std::vector< ObjectGuid > GuidVector
Definition: ObjectGuid.h:395
uint8 constexpr PVP_TEAMS_COUNT
Team
WorldSafeLocsEntry const * GetClosestGraveyard(Player *player) override
void StartingEventOpenDoors() override
GuidVector _capturePoints
GuidVector _creaturesToRemoveOnMatchStart
bool SetupBattleground() override
uint32 m_ReputationTics
void EndBattleground(Team winner) override
void OnCreatureCreate(Creature *creature) override
void Reset() override
GuidVector _doors
uint32 m_HonorScoreTics[PVP_TEAMS_COUNT]
GuidVector _gameobjectsToRemoveOnMatchStart
bool m_IsInformedNearVictory
void ProcessEvent(WorldObject *obj, uint32 eventId, WorldObject *invoker=nullptr) override
BattlegroundAB(BattlegroundTemplate const *battlegroundTemplate)
uint32 m_ReputationScoreTics[PVP_TEAMS_COUNT]
void PostUpdateImpl(uint32 diff) override
Post-update hook.
WorldSafeLocsEntry const * GetExploitTeleportLocation(Team team) override
Team GetPrematureWinner() override
void _CalculateTeamNodes(uint8 &alliance, uint8 &horde)
void OnGameObjectCreate(GameObject *gameObject) override