TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OutdoorPvPNA.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
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 OUTDOOR_PVP_NA_
19 #define OUTDOOR_PVP_NA_
20 
21 #include "OutdoorPvP.h"
22 
24 {
25  TEXT_ALL_GUARDS_DEFEATED = 15017, // (NYI) '|cffffff00All the guards have been defeated!|r'
26  TEXT_HALAA_TAKEN_ALLIANCE = 15018, // '|cffffff00The Alliance has taken control of Halaa!|r'
27  TEXT_HALAA_TAKEN_HORDE = 15019, // '|cffffff00The Horde has taken control of Halaa!|r'
28  TEXT_HALAA_DEFENSELESS = 15020, // (NYI) '|cffffff00Halaa is defenseless!|r'
29  TEXT_HALAA_GAINING_CONTROL_HORDE = 15493, // (NYI) '|cffffff00The Horde is gaining control of Halaa!|r'
30  TEXT_HALAA_GAINING_CONTROL_ALLIANCE = 15494 // (NYI) '|cffffff00The Alliance is gaining control of Halaa!|r'
31 };
32 
34 
36 {
39  NA_CAPTURE_BUFF = 33795 // strength of the halaani
40 };
41 
42 // kill credit for pks
43 const uint32 NA_CREDIT_MARKER = 24867;
44 
45 const uint32 NA_GUARDS_MAX = 15;
46 
47 const uint32 NA_BUFF_ZONE = 3518;
48 
50 
51 const uint32 NA_HALAA_GRAVEYARD_ZONE = 3518; // need to add zone id, not area id
52 
53 const uint32 NA_RESPAWN_TIME = 3600000; // one hour to capture after defeating all guards
54 
55 const uint32 NA_GUARD_CHECK_TIME = 500; // every half second
56 
58 {
63 
68 
73 
78 
83 
89 };
90 
92 
93 // used to access the elements of Horde/AllyControlGOs
95 {
100 
105 
110 
112 };
113 
114 const uint32 FlightPathStartNodes[FLIGHT_NODES_NUM] = {103, 105, 107, 109};
115 const uint32 FlightPathEndNodes[FLIGHT_NODES_NUM] = {104, 106, 108, 110};
116 
118 {
123 };
124 
125 // spawned when the alliance is attacking, horde is in control
127 {
128  {182267, 530, -1815.8f, 8036.51f, -26.2354f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //ALLY_ROOST_SOUTH
129  {182280, 530, -1507.95f, 8132.1f, -19.5585f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //ALLY_ROOST_WEST
130  {182281, 530, -1384.52f, 7779.33f, -11.1663f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //ALLY_ROOST_NORTH
131  {182282, 530, -1650.11f, 7732.56f, -15.4505f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f}, //ALLY_ROOST_EAST
132 
133  {182222, 530, -1825.4022f, 8039.2602f, -26.08f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //HORDE_BOMB_WAGON_SOUTH
134  {182272, 530, -1515.37f, 8136.91f, -20.42f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //HORDE_BOMB_WAGON_WEST
135  {182273, 530, -1377.95f, 7773.44f, -10.31f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //HORDE_BOMB_WAGON_NORTH
136  {182274, 530, -1659.87f, 7733.15f, -15.75f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f}, //HORDE_BOMB_WAGON_EAST
137 
138  {182266, 530, -1815.8f, 8036.51f, -26.2354f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //DESTROYED_ALLY_ROOST_SOUTH
139  {182275, 530, -1507.95f, 8132.1f, -19.5585f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //DESTROYED_ALLY_ROOST_WEST
140  {182276, 530, -1384.52f, 7779.33f, -11.1663f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //DESTROYED_ALLY_ROOST_NORTH
141  {182277, 530, -1650.11f, 7732.56f, -15.4505f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f} //DESTROYED_ALLY_ROOST_EAST
142 };
143 
144 // spawned when the horde is attacking, alliance is in control
146 {
147  {182301, 530, -1815.8f, 8036.51f, -26.2354f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //HORDE_ROOST_SOUTH
148  {182302, 530, -1507.95f, 8132.1f, -19.5585f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //HORDE_ROOST_WEST
149  {182303, 530, -1384.52f, 7779.33f, -11.1663f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //HORDE_ROOST_NORTH
150  {182304, 530, -1650.11f, 7732.56f, -15.4505f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f}, //HORDE_ROOST_EAST
151 
152  {182305, 530, -1825.4022f, 8039.2602f, -26.08f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //ALLY_BOMB_WAGON_SOUTH
153  {182306, 530, -1515.37f, 8136.91f, -20.42f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //ALLY_BOMB_WAGON_WEST
154  {182307, 530, -1377.95f, 7773.44f, -10.31f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //ALLY_BOMB_WAGON_NORTH
155  {182308, 530, -1659.87f, 7733.15f, -15.75f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f}, //ALLY_BOMB_WAGON_EAST
156 
157  {182297, 530, -1815.8f, 8036.51f, -26.2354f, -2.89725f, 0.0f, 0.0f, 0.992546f, -0.121869f}, //DESTROYED_HORDE_ROOST_SOUTH
158  {182298, 530, -1507.95f, 8132.1f, -19.5585f, -1.3439f, 0.0f, 0.0f, 0.622515f, -0.782608f}, //DESTROYED_HORDE_ROOST_WEST
159  {182299, 530, -1384.52f, 7779.33f, -11.1663f, -0.575959f, 0.0f, 0.0f, 0.284015f, -0.95882f}, //DESTROYED_HORDE_ROOST_NORTH
160  {182300, 530, -1650.11f, 7732.56f, -15.4505f, -2.80998f, 0.0f, 0.0f, 0.986286f, -0.165048f} //DESTROYED_HORDE_ROOST_EAST
161 };
162 
164 {
170 
186 
188 };
189 
191 {
192  {18816, 530, -1523.92f, 7951.76f, -17.6942f, 3.51172f},
193  {18821, 530, -1527.75f, 7952.46f, -17.6948f, 3.99317f},
194  {21474, 530, -1520.14f, 7927.11f, -20.2527f, 3.39389f},
195  {21484, 530, -1524.84f, 7930.34f, -20.182f, 3.6405f},
196  {21483, 530, -1570.01f, 7993.8f, -22.4505f, 5.02655f},
197  {18192, 530, -1654.06f, 8000.46f, -26.59f, 3.37f},
198  {18192, 530, -1487.18f, 7899.1f, -19.53f, 0.954f},
199  {18192, 530, -1480.88f, 7908.79f, -19.19f, 4.485f},
200  {18192, 530, -1540.56f, 7995.44f, -20.45f, 0.947f},
201  {18192, 530, -1546.95f, 8000.85f, -20.72f, 6.035f},
202  {18192, 530, -1595.31f, 7860.53f, -21.51f, 3.747f},
203  {18192, 530, -1642.31f, 7995.59f, -25.8f, 3.317f},
204  {18192, 530, -1545.46f, 7995.35f, -20.63f, 1.094f},
205  {18192, 530, -1487.58f, 7907.99f, -19.27f, 5.567f},
206  {18192, 530, -1651.54f, 7988.56f, -26.5289f, 2.98451f},
207  {18192, 530, -1602.46f, 7866.43f, -22.1177f, 4.74729f},
208  {18192, 530, -1591.22f, 7875.29f, -22.3536f, 4.34587f},
209  {18192, 530, -1550.6f, 7944.45f, -21.63f, 3.559f},
210  {18192, 530, -1545.57f, 7935.83f, -21.13f, 3.448f},
211  {18192, 530, -1550.86f, 7937.56f, -21.7f, 3.801f}
212 };
213 
215 {
216  {18817, 530, -1591.18f, 8020.39f, -22.2042f, 4.59022f},
217  {18822, 530, -1588.0f, 8019.0f, -22.2042f, 4.06662f},
218  {21485, 530, -1521.93f, 7927.37f, -20.2299f, 3.24631f},
219  {21487, 530, -1540.33f, 7971.95f, -20.7186f, 3.07178f},
220  {21488, 530, -1570.01f, 7993.8f, -22.4505f, 5.02655f},
221  {18256, 530, -1654.06f, 8000.46f, -26.59f, 3.37f},
222  {18256, 530, -1487.18f, 7899.1f, -19.53f, 0.954f},
223  {18256, 530, -1480.88f, 7908.79f, -19.19f, 4.485f},
224  {18256, 530, -1540.56f, 7995.44f, -20.45f, 0.947f},
225  {18256, 530, -1546.95f, 8000.85f, -20.72f, 6.035f},
226  {18256, 530, -1595.31f, 7860.53f, -21.51f, 3.747f},
227  {18256, 530, -1642.31f, 7995.59f, -25.8f, 3.317f},
228  {18256, 530, -1545.46f, 7995.35f, -20.63f, 1.094f},
229  {18256, 530, -1487.58f, 7907.99f, -19.27f, 5.567f},
230  {18256, 530, -1651.54f, 7988.56f, -26.5289f, 2.98451f},
231  {18256, 530, -1602.46f, 7866.43f, -22.1177f, 4.74729f},
232  {18256, 530, -1591.22f, 7875.29f, -22.3536f, 4.34587f},
233  {18256, 530, -1603.75f, 8000.36f, -24.18f, 4.516f},
234  {18256, 530, -1585.73f, 7994.68f, -23.29f, 4.439f},
235  {18256, 530, -1595.5f, 7991.27f, -23.53f, 4.738f}
236 };
237 
239 {
244 };
245 
247 {
248  HALAA_N = 1,
250  HALAA_A = 4,
252  HALAA_H = 16
253 };
254 
255 class Unit;
256 class Creature;
257 class OutdoorPvPNA;
258 
260 {
261  public:
263 
264  bool Update(uint32 diff) override;
265 
266  void ChangeState() override;
267 
269 
270  bool HandleCustomSpell(Player* player, uint32 spellId, GameObject* go) override;
271 
272  int32 HandleOpenGo(Player* player, GameObject* go) override;
273 
276 
277  protected:
278  // called when a faction takes control
279  void FactionTakeOver(uint32 team);
280 
281  void DeSpawnNPCs();
282  void DeSpawnGOs();
283 
284  void SpawnNPCsForTeam(uint32 team);
285  void SpawnGOsForTeam(uint32 team);
286 
288  void UpdateHalaaWorldState();
289 
290  private:
292 
294 
296 
301 
303 
305 
307 };
308 
309 class OutdoorPvPNA : public OutdoorPvP
310 {
311  public:
312  OutdoorPvPNA();
313 
314  bool SetupOutdoorPvP() override;
315 
316  void HandlePlayerEnterZone(Player* player, uint32 zone) override;
317  void HandlePlayerLeaveZone(Player* player, uint32 zone) override;
318 
319  bool Update(uint32 diff) override;
320 
322 
323  void SendRemoveWorldStates(Player* player) override;
324 
325  void HandleKillImpl(Player* player, Unit* killed) override;
326 
327  private:
329 };
330 
331 #endif
Definition: OutdoorPvPNA.h:109
Definition: OutdoorPvPNA.h:64
int32 HandleOpenGo(Player *player, GameObject *go) override
Definition: OutdoorPvPNA.cpp:380
Definition: OutdoorPvPNA.h:240
const uint32 NA_GUARDS_MAX
Definition: OutdoorPvPNA.h:45
void HandleKillImpl(Player *player, Unit *killed) override
Definition: OutdoorPvPNA.cpp:32
uint32 m_WyvernStateNorth
Definition: OutdoorPvPNA.h:297
Definition: OutdoorPvPNA.h:39
Definition: OutdoorPvPNA.h:75
bool m_capturable
Definition: OutdoorPvPNA.h:291
Definition: OutdoorPvPNA.h:74
uint32 m_ControllingFaction
Definition: OutdoorPvPNA.h:295
Definition: OutdoorPvPNA.h:252
OutdoorPvPNA()
Definition: OutdoorPvPNA.cpp:26
bool Update(uint32 diff) override
Definition: OutdoorPvPNA.cpp:502
uint32 m_GuardCheckTimer
Definition: OutdoorPvPNA.h:306
void FactionTakeOver(uint32 team)
Definition: OutdoorPvPNA.cpp:136
Definition: OutdoorPvPNA.h:184
Definition: OutdoorPvPNA.h:174
FlightSpellsNA
Definition: OutdoorPvPNA.h:117
Definition: OutdoorPvPNA.h:165
Definition: OutdoorPvPNA.h:122
Definition: OutdoorPvPNA.h:172
Definition: OutdoorPvPNA.h:242
Definition: OutdoorPvP.h:87
Definition: OutdoorPvPNA.h:87
Definition: OutdoorPvPNA.h:77
const uint32 NA_BUFF_ZONE
Definition: OutdoorPvPNA.h:47
Definition: OutdoorPvPNA.h:97
Definition: OutdoorPvPNA.h:70
const uint32 NA_HALAA_GRAVEYARD_ZONE
Definition: OutdoorPvPNA.h:51
const uint32 NA_CREDIT_MARKER
Definition: OutdoorPvPNA.h:43
Definition: OutdoorPvPNA.h:82
Definition: OutdoorPvPNA.h:76
Definition: OutdoorPvPNA.h:25
Definition: OutdoorPvPNA.h:309
Definition: OutdoorPvPNA.h:71
Definition: OutdoorPvPNA.h:59
Definition: OutdoorPvPNA.h:249
Definition: Creature.h:467
Definition: OutdoorPvPNA.h:67
uint32 m_RespawnTimer
Definition: OutdoorPvPNA.h:304
Definition: OutdoorPvPNA.h:88
Definition: OutdoorPvPNA.h:166
Definition: OutdoorPvPNA.h:28
Definition: OutdoorPvPNA.h:181
Definition: OutdoorPvPNA.h:169
bool Update(uint32 diff) override
Definition: OutdoorPvPNA.cpp:300
Definition: OutdoorPvPNA.h:98
uint32 m_GuardsAlive
Definition: OutdoorPvPNA.h:293
HalaaStates
Definition: OutdoorPvPNA.h:246
Definition: OutdoorPvPNA.h:106
Definition: OutdoorPvPNA.h:81
Definition: OutdoorPvPNA.h:79
Definition: OutdoorPvPNA.h:65
Definition: OutdoorPvPNA.h:183
const uint32 FlightPathEndNodes[FLIGHT_NODES_NUM]
Definition: OutdoorPvPNA.h:115
uint32 m_HalaaState
Definition: OutdoorPvPNA.h:302
void SpawnGOsForTeam(uint32 team)
Definition: OutdoorPvPNA.cpp:104
const uint32 NA_GUARD_CHECK_TIME
Definition: OutdoorPvPNA.h:55
Definition: OutdoorPvPNA.h:27
const go_type HordeControlGOs[NA_CONTROL_GO_NUM]
Definition: OutdoorPvPNA.h:126
uint32 m_WyvernStateWest
Definition: OutdoorPvPNA.h:300
DefenseMessages
Definition: OutdoorPvPHP.h:23
Definition: OutdoorPvPNA.h:80
Definition: OutdoorPvPNA.h:120
Definition: OutdoorPvPNA.h:101
Definition: OutdoorPvPNA.h:66
const uint32 FLIGHT_NODES_NUM
Definition: OutdoorPvPNA.h:91
OutdoorPvPNASpells
Definition: OutdoorPvPNA.h:35
Definition: OutdoorPvPNA.h:26
void HandlePlayerEnterZone(Player *player, uint32 zone) override
Definition: OutdoorPvPNA.cpp:203
Definition: OutdoorPvPNA.h:61
Definition: OutdoorPvPNA.h:69
Definition: OutdoorPvPNA.h:251
OPvPCapturePointNA(OutdoorPvP *pvp)
Definition: OutdoorPvPNA.cpp:181
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
Definition: WorldStatePackets.h:27
Definition: GameObject.h:880
Definition: OutdoorPvPNA.h:185
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &packet) override
Definition: OutdoorPvPNA.cpp:223
Definition: OutdoorPvPNA.h:84
const uint32 FlightPathStartNodes[FLIGHT_NODES_NUM]
Definition: OutdoorPvPNA.h:114
Definition: OutdoorPvPNA.h:167
Definition: OutdoorPvPNA.h:173
uint32 GetControllingFaction() const
Definition: OutdoorPvPNA.cpp:80
void SpawnNPCsForTeam(uint32 team)
Definition: OutdoorPvPNA.cpp:85
Definition: OutdoorPvPNA.h:29
Definition: OutdoorPvPNA.h:177
Definition: OutdoorPvPNA.h:72
void SendRemoveWorldStates(Player *player) override
Definition: OutdoorPvPNA.cpp:271
Definition: OutdoorPvPNA.h:259
Definition: OutdoorPvPNA.h:86
Definition: OutdoorPvP.h:68
Definition: OutdoorPvPNA.h:176
void DeSpawnGOs()
Definition: OutdoorPvPNA.cpp:128
Definition: OutdoorPvP.h:188
Definition: OutdoorPvPNA.h:250
OPvPCapturePointNA * m_obj
Definition: OutdoorPvPNA.h:328
Definition: OutdoorPvPNA.h:30
uint32 m_WyvernStateEast
Definition: OutdoorPvPNA.h:299
bool HandleCustomSpell(Player *player, uint32 spellId, GameObject *go) override
Definition: OutdoorPvPNA.cpp:305
const creature_type HordeControlNPCs[NA_CONTROL_NPC_NUM]
Definition: OutdoorPvPNA.h:190
Definition: OutdoorPvPNA.h:175
Definition: OutdoorPvPNA.h:121
Definition: OutdoorPvPNA.h:96
Definition: OutdoorPvPNA.h:182
void ChangeState() override
Definition: OutdoorPvPNA.cpp:541
Definition: OutdoorPvPNA.h:168
Definition: OutdoorPvPNA.h:180
const uint32 NA_RESPAWN_TIME
Definition: OutdoorPvPNA.h:53
const creature_type AllianceControlNPCs[NA_CONTROL_NPC_NUM]
Definition: OutdoorPvPNA.h:214
void UpdateWyvernRoostWorldState(uint32 roost)
Definition: OutdoorPvPNA.cpp:591
Definition: OutdoorPvPNA.h:108
Definition: OutdoorPvPNA.h:178
Definition: OutdoorPvPNA.h:99
uint32 GetAliveGuardsCount()
Definition: OutdoorPvPNA.cpp:44
Definition: OutdoorPvPNA.h:104
Definition: OutdoorPvPNA.h:37
void UpdateHalaaWorldState()
Definition: OutdoorPvPNA.cpp:582
Definition: OutdoorPvPNA.h:243
Definition: OutdoorPvPNA.h:60
Definition: OutdoorPvPNA.h:107
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &packet) override
Definition: OutdoorPvPNA.cpp:218
Definition: OutdoorPvPNA.h:241
Definition: OutdoorPvPNA.h:102
Definition: OutdoorPvPNA.h:38
Definition: Unit.h:1305
WyvernStates
Definition: OutdoorPvPNA.h:238
const uint32 NA_HALAA_GRAVEYARD
Definition: OutdoorPvPNA.h:49
uint32 m_WyvernStateSouth
Definition: OutdoorPvPNA.h:298
OutdoorPvPNAWorldStates
Definition: OutdoorPvPNA.h:57
Definition: OutdoorPvPNA.h:119
void DeSpawnNPCs()
Definition: OutdoorPvPNA.cpp:98
Definition: OutdoorPvPNA.h:103
Definition: OutdoorPvPNA.h:85
ControlGOTypes
Definition: OutdoorPvPNA.h:94
ControlNPCTypes
Definition: OutdoorPvPNA.h:163
void HandlePlayerLeaveZone(Player *player, uint32 zone) override
Definition: OutdoorPvPNA.cpp:211
Definition: OutdoorPvP.h:53
Definition: OutdoorPvPNA.h:171
const go_type AllianceControlGOs[NA_CONTROL_GO_NUM]
Definition: OutdoorPvPNA.h:145
bool SetupOutdoorPvP() override
Definition: OutdoorPvPNA.cpp:189
Definition: OutdoorPvPNA.h:187
Definition: OutdoorPvPNA.h:248
Definition: OutdoorPvPNA.h:111
Definition: OutdoorPvPNA.h:179
Definition: OutdoorPvPNA.h:62