root/trunk/src/game/OutdoorPvPNA.h @ 94

Revision 44, 9.5 kB (checked in by yumileroy, 17 years ago)

[svn] * Merge Temp dev SVN with Assembla.
* Changes include:

  • Implementation of w12x's Outdoor PvP and Game Event Systems.
  • Temporary removal of IRC Chat Bot (until infinite loop when disabled is fixed).
  • All mangos -> trinity (to convert your mangos_string table, please run mangos_string_to_trinity_string.sql).
  • Improved Config cleanup.
  • And many more changes.

Original author: Seline
Date: 2008-10-14 11:57:03-05:00

Line 
1#ifndef OUTDOOR_PVP_NA_
2#define OUTDOOR_PVP_NA_
3
4// TODO: "sometimes" set to neutral
5
6#include "OutdoorPvP.h"
7
8// kill credit for pks
9const uint32 NA_CREDIT_MARKER = 24867;
10
11const uint32 NA_KILL_TOKEN_ALLIANCE = 33005;
12const uint32 NA_KILL_TOKEN_HORDE = 33004;
13
14const uint32 NA_CAPTURE_BUFF = 33795;  // strength of the halaani
15
16const uint32 NA_GUARDS_MAX = 15;
17
18const uint32 NA_BUFF_ZONE = 3518;
19
20const uint32 NA_HALAA_GRAVEYARD = 993;
21
22const uint32 NA_HALAA_GRAVEYARD_ZONE = 3518; // need to add zone id, not area id
23
24const uint32 NA_RESPAWN_TIME = 3600000; // one hour to capture after defeating all guards
25
26const uint32 NA_GUARD_CHECK_TIME = 500; // every half second
27
28enum OutdoorPvPNAWorldStates{
29    NA_UI_HORDE_GUARDS_SHOW = 2503,
30    NA_UI_ALLIANCE_GUARDS_SHOW = 2502,
31    NA_UI_GUARDS_MAX = 2493,
32    NA_UI_GUARDS_LEFT = 2491,
33
34    NA_UI_TOWER_SLIDER_DISPLAY = 2495,
35    NA_UI_TOWER_SLIDER_POS = 2494,
36    NA_UI_TOWER_SLIDER_N = 2497,
37
38    NA_MAP_WYVERN_NORTH_NEU_H = 2762,
39    NA_MAP_WYVERN_NORTH_NEU_A = 2662,
40    NA_MAP_WYVERN_NORTH_H = 2663,
41    NA_MAP_WYVERN_NORTH_A = 2664,
42
43    NA_MAP_WYVERN_SOUTH_NEU_H = 2760,
44    NA_MAP_WYVERN_SOUTH_NEU_A = 2670,
45    NA_MAP_WYVERN_SOUTH_H = 2668,
46    NA_MAP_WYVERN_SOUTH_A = 2669,
47
48    NA_MAP_WYVERN_WEST_NEU_H = 2761,
49    NA_MAP_WYVERN_WEST_NEU_A = 2667,
50    NA_MAP_WYVERN_WEST_H = 2665,
51    NA_MAP_WYVERN_WEST_A = 2666,
52
53    NA_MAP_WYVERN_EAST_NEU_H = 2763,
54    NA_MAP_WYVERN_EAST_NEU_A = 2659,
55    NA_MAP_WYVERN_EAST_H = 2660,
56    NA_MAP_WYVERN_EAST_A = 2661,
57
58    NA_MAP_HALAA_NEUTRAL = 2671,
59    NA_MAP_HALAA_NEU_A = 2676,
60    NA_MAP_HALAA_NEU_H = 2677,
61    NA_MAP_HALAA_HORDE = 2672,
62    NA_MAP_HALAA_ALLIANCE = 2673 
63};
64
65const uint32 FLIGHT_NODES_NUM = 4;
66
67// used to access the elements of Horde/AllyControlGOs
68enum ControlGOTypes{
69    NA_ROOST_S = 0,
70    NA_ROOST_W = 1,
71    NA_ROOST_N = 2,
72    NA_ROOST_E = 3,
73
74    NA_BOMB_WAGON_S = 4,
75    NA_BOMB_WAGON_W = 5,
76    NA_BOMB_WAGON_N = 6,
77    NA_BOMB_WAGON_E = 7,
78
79    NA_DESTROYED_ROOST_S = 8, 
80    NA_DESTROYED_ROOST_W = 9, 
81    NA_DESTROYED_ROOST_N = 10,
82    NA_DESTROYED_ROOST_E = 11,
83
84    NA_CONTROL_GO_NUM = 12
85};
86
87const uint32 FlightPathStartNodes[FLIGHT_NODES_NUM] = {103,105,107,109};
88const uint32 FlightPathEndNodes[FLIGHT_NODES_NUM] = {104,106,108,110};
89
90enum FlightSpellsNA{
91    NA_SPELL_FLY_SOUTH = 32059,
92    NA_SPELL_FLY_WEST = 32068,
93    NA_SPELL_FLY_NORTH = 32075,
94    NA_SPELL_FLY_EAST = 32081
95};
96
97// spawned when the alliance is attacking, horde is in control
98const go_type HordeControlGOs[NA_CONTROL_GO_NUM] = {
99    {182267,530,-1815.8,8036.51,-26.2354,-2.89725,0,0,0.992546,-0.121869}, //ALLY_ROOST_SOUTH
100    {182280,530,-1507.95,8132.1,-19.5585,-1.3439,0,0,0.622515,-0.782608}, //ALLY_ROOST_WEST
101    {182281,530,-1384.52,7779.33,-11.1663,-0.575959,0,0,0.284015,-0.95882}, //ALLY_ROOST_NORTH
102    {182282,530,-1650.11,7732.56,-15.4505,-2.80998,0,0,0.986286,-0.165048}, //ALLY_ROOST_EAST
103
104    {182222,530,-1825.4022,8039.2602,-26.08,-2.89725,0,0,0.992546,-0.121869}, //HORDE_BOMB_WAGON_SOUTH
105    {182272,530,-1515.37,8136.91,-20.42,-1.3439,0,0,0.622515,-0.782608}, //HORDE_BOMB_WAGON_WEST
106    {182273,530,-1377.95,7773.44,-10.31,-0.575959,0,0,0.284015,-0.95882}, //HORDE_BOMB_WAGON_NORTH
107    {182274,530,-1659.87,7733.15,-15.75,-2.80998,0,0,0.986286,-0.165048}, //HORDE_BOMB_WAGON_EAST
108
109    {182266,530,-1815.8,8036.51,-26.2354,-2.89725,0,0,0.992546,-0.121869}, //DESTROYED_ALLY_ROOST_SOUTH
110    {182275,530,-1507.95,8132.1,-19.5585,-1.3439,0,0,0.622515,-0.782608}, //DESTROYED_ALLY_ROOST_WEST
111    {182276,530,-1384.52,7779.33,-11.1663,-0.575959,0,0,0.284015,-0.95882}, //DESTROYED_ALLY_ROOST_NORTH
112    {182277,530,-1650.11,7732.56,-15.4505,-2.80998,0,0,0.986286,-0.165048}  //DESTROYED_ALLY_ROOST_EAST
113};
114
115// spawned when the horde is attacking, alliance is in control
116const go_type AllianceControlGOs[NA_CONTROL_GO_NUM] = {
117    {182301,530,-1815.8,8036.51,-26.2354,-2.89725,0,0,0.992546,-0.121869}, //HORDE_ROOST_SOUTH
118    {182302,530,-1507.95,8132.1,-19.5585,-1.3439,0,0,0.622515,-0.782608}, //HORDE_ROOST_WEST
119    {182303,530,-1384.52,7779.33,-11.1663,-0.575959,0,0,0.284015,-0.95882}, //HORDE_ROOST_NORTH
120    {182304,530,-1650.11,7732.56,-15.4505,-2.80998,0,0,0.986286,-0.165048}, //HORDE_ROOST_EAST
121
122    {182305,530,-1825.4022,8039.2602,-26.08,-2.89725,0,0,0.992546,-0.121869}, //ALLY_BOMB_WAGON_SOUTH
123    {182306,530,-1515.37,8136.91,-20.42,-1.3439,0,0,0.622515,-0.782608}, //ALLY_BOMB_WAGON_WEST
124    {182307,530,-1377.95,7773.44,-10.31,-0.575959,0,0,0.284015,-0.95882}, //ALLY_BOMB_WAGON_NORTH
125    {182308,530,-1659.87,7733.15,-15.75,-2.80998,0,0,0.986286,-0.165048}, //ALLY_BOMB_WAGON_EAST
126
127    {182297,530,-1815.8,8036.51,-26.2354,-2.89725,0,0,0.992546,-0.121869}, //DESTROYED_HORDE_ROOST_SOUTH
128    {182298,530,-1507.95,8132.1,-19.5585,-1.3439,0,0,0.622515,-0.782608}, //DESTROYED_HORDE_ROOST_WEST
129    {182299,530,-1384.52,7779.33,-11.1663,-0.575959,0,0,0.284015,-0.95882}, //DESTROYED_HORDE_ROOST_NORTH
130    {182300,530,-1650.11,7732.56,-15.4505,-2.80998,0,0,0.986286,-0.165048}  //DESTROYED_HORDE_ROOST_EAST
131};
132
133enum ControlNPCTypes{
134    NA_NPC_RESEARCHER = 0,
135    NA_NPC_QUARTERMASTER,
136    NA_NPC_BLADE_MERCHANT,
137    NA_NPC_FOOD_MERCHANT,
138    NA_NPC_AMMO,
139
140    NA_NPC_GUARD_01,
141    NA_NPC_GUARD_02,
142    NA_NPC_GUARD_03,
143    NA_NPC_GUARD_04,
144    NA_NPC_GUARD_05,
145    NA_NPC_GUARD_06,
146    NA_NPC_GUARD_07,
147    NA_NPC_GUARD_08,
148    NA_NPC_GUARD_09,
149    NA_NPC_GUARD_10,
150    NA_NPC_GUARD_11,
151    NA_NPC_GUARD_12,
152    NA_NPC_GUARD_13,
153    NA_NPC_GUARD_14,
154    NA_NPC_GUARD_15,
155
156    NA_CONTROL_NPC_NUM
157};
158
159const creature_type HordeControlNPCs[NA_CONTROL_NPC_NUM] = {
160    {18816,67,530,-1523.92,7951.76,-17.6942,3.51172},
161    {18821,67,530,-1527.75,7952.46,-17.6948,3.99317},
162    {21474,67,530,-1520.14,7927.11,-20.2527,3.39389},
163    {21484,67,530,-1524.84,7930.34,-20.182,3.6405},
164    {21483,67,530,-1570.01,7993.8,-22.4505,5.02655},
165    {18192,67,530,-1654.06,8000.46,-26.59,3.37},
166    {18192,67,530,-1487.18,7899.1,-19.53,0.954},
167    {18192,67,530,-1480.88,7908.79,-19.19,4.485},
168    {18192,67,530,-1540.56,7995.44,-20.45,0.947},
169    {18192,67,530,-1546.95,8000.85,-20.72,6.035},
170    {18192,67,530,-1595.31,7860.53,-21.51,3.747},
171    {18192,67,530,-1642.31,7995.59,-25.8,3.317},
172    {18192,67,530,-1545.46,7995.35,-20.63,1.094},
173    {18192,67,530,-1487.58,7907.99,-19.27,5.567},
174    {18192,67,530,-1651.54,7988.56,-26.5289,2.98451},
175    {18192,67,530,-1602.46,7866.43,-22.1177,4.74729},
176    {18192,67,530,-1591.22,7875.29,-22.3536,4.34587},
177    {18192,67,530,-1550.6,7944.45,-21.63,3.559},
178    {18192,67,530,-1545.57,7935.83,-21.13,3.448},
179    {18192,67,530,-1550.86,7937.56,-21.7,3.801}
180};
181
182const creature_type AllianceControlNPCs[NA_CONTROL_NPC_NUM] = {
183    {18817,469,530,-1591.18,8020.39,-22.2042,4.59022},
184    {18822,469,530,-1588.0,8019.0,-22.2042,4.06662},
185    {21485,469,530,-1521.93,7927.37,-20.2299,3.24631},
186    {21487,469,530,-1540.33,7971.95,-20.7186,3.07178},
187    {21488,469,530,-1570.01,7993.8,-22.4505,5.02655},
188    {18256,469,530,-1654.06,8000.46,-26.59,3.37},
189    {18256,469,530,-1487.18,7899.1,-19.53,0.954},
190    {18256,469,530,-1480.88,7908.79,-19.19,4.485},
191    {18256,469,530,-1540.56,7995.44,-20.45,0.947},
192    {18256,469,530,-1546.95,8000.85,-20.72,6.035},
193    {18256,469,530,-1595.31,7860.53,-21.51,3.747},
194    {18256,469,530,-1642.31,7995.59,-25.8,3.317},
195    {18256,469,530,-1545.46,7995.35,-20.63,1.094},
196    {18256,469,530,-1487.58,7907.99,-19.27,5.567},
197    {18256,469,530,-1651.54,7988.56,-26.5289,2.98451},
198    {18256,469,530,-1602.46,7866.43,-22.1177,4.74729},
199    {18256,469,530,-1591.22,7875.29,-22.3536,4.34587},
200    {18256,469,530,-1603.75,8000.36,-24.18,4.516},
201    {18256,469,530,-1585.73,7994.68,-23.29,4.439},
202    {18256,469,530,-1595.5,7991.27,-23.53,4.738}
203};
204
205enum WyvernStates{
206    WYVERN_NEU_HORDE = 1,
207    WYVERN_NEU_ALLIANCE = 2,
208    WYVERN_HORDE = 4,
209    WYVERN_ALLIANCE = 8
210};
211
212enum HalaaStates{
213    HALAA_N = 1,
214    HALAA_N_A = 2,
215    HALAA_A = 4,
216    HALAA_N_H = 8,
217    HALAA_H = 16
218};
219
220class Unit;
221class Creature;
222class OutdoorPvPNA;
223class OutdoorPvPObjectiveNA : public OutdoorPvPObjective
224{
225friend class OutdoorPvPNA;
226public:
227    OutdoorPvPObjectiveNA(OutdoorPvP * pvp);
228    bool Update(uint32 diff);
229    void FillInitialWorldStates(WorldPacket & data);
230    // used when player is activated/inactivated in the area
231    bool HandlePlayerEnter(Player * plr);
232    void HandlePlayerLeave(Player * plr);
233    bool HandleCustomSpell(Player *plr, uint32 spellId, GameObject * go);
234    int32 HandleOpenGo(Player *plr, uint64 guid);
235    uint32 GetAliveGuardsCount();
236protected:
237    // called when a faction takes control
238    void FactionTakeOver(uint32 team);
239
240    void DeSpawnNPCs();
241    void DeSpawnGOs();
242    void SpawnNPCsForTeam(uint32 team);
243    void SpawnGOsForTeam(uint32 team);
244
245    void UpdateWyvernRoostWorldState(uint32 roost);
246    void UpdateHalaaWorldState();
247
248    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
249private:
250    bool m_capturable;
251    uint32 m_GuardsAlive;
252    uint32 m_ControllingFaction;
253    uint32 m_WyvernStateNorth;
254    uint32 m_WyvernStateSouth;
255    uint32 m_WyvernStateEast;
256    uint32 m_WyvernStateWest;
257    uint32 m_HalaaState;
258    uint32 m_RespawnTimer;
259    uint32 m_GuardCheckTimer;
260};
261
262class OutdoorPvPNA : public OutdoorPvP
263{
264friend class OutdoorPvPObjectiveNA;
265public:
266    OutdoorPvPNA();
267    bool SetupOutdoorPvP();
268    void HandlePlayerEnterZone(Player *plr, uint32 zone);
269    void HandlePlayerLeaveZone(Player *plr, uint32 zone);
270    bool Update(uint32 diff);
271    void FillInitialWorldStates(WorldPacket &data);
272    void SendRemoveWorldStates(Player * plr);
273    void HandleKillImpl(Player * plr, Unit * killed);
274    void BuffTeam(uint32 team);
275private:
276    OutdoorPvPObjectiveNA * m_obj;
277};
278
279#endif
Note: See TracBrowser for help on using the browser.