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

Revision 102, 10.3 kB (checked in by yumileroy, 17 years ago)

[svn] Fixed copyright notices to comply with GPL.

Original author: w12x
Date: 2008-10-23 03:29:52-05:00

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