root/trunk/src/game/OutdoorPvPEP.h @ 252

Revision 102, 8.2 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_EP_
20#define OUTDOOR_PVP_EP_
21
22#include "OutdoorPvP.h"
23
24#include "Database/DBCStructure.h"
25
26const uint32 EP_AllianceBuffs[4] = {11413, 11414, 11415, 1386};
27
28const uint32 EP_HordeBuffs[4] = {30880, 30683, 30682, 29520};
29
30const uint32 EP_GraveYardZone = 139;
31
32const uint32 EP_GraveYardId = 927;
33
34const uint32 EPBuffZonesNum = 3;
35
36const uint32 EP_EWT_CM = 17690;
37const uint32 EP_CGT_CM = 17689;
38const uint32 EP_NPT_CM = 17696;
39const uint32 EP_PWT_CM = 17698;
40
41const uint32 EPBuffZones[EPBuffZonesNum] = {139, 2017, 2057};
42
43enum EP_TaxiNodes {
44    EP_CGT_Taxi = 87,
45    EP_EWT_Taxi = 86,
46    EP_NPT_Taxi = 85,
47    EP_PWT_Taxi = 84
48};
49
50enum EP_EastwallTowerWorldStates {
51    EP_EWT_A = 2354,
52    EP_EWT_H = 2356,
53    EP_EWT_A_P = 2357, // ally progressing
54    EP_EWT_H_P = 2358,
55    EP_EWT_N_A = 2359, // ally conquested
56    EP_EWT_N_H = 2360,
57    EP_EWT_N = 2361
58};
59
60enum EP_NorthpassTowerWorldStates {
61    EP_NPT_N = 2352,
62    EP_NPT_N_A = 2362,
63    EP_NPT_N_H = 2363,
64    EP_NPT_A_P = 2364,
65    EP_NPT_H_P = 2365,
66    EP_NPT_A = 2372,
67    EP_NPT_H = 2373
68};
69
70enum EP_PlagewoodTowerWorldStates {
71    EP_PWT_N_A = 2366,
72    EP_PWT_N_H = 2353, //2367 not present! use neutral!
73    EP_PWT_A_P = 2368,
74    EP_PWT_H_P = 2369,
75    EP_PWT_A = 2370,
76    EP_PWT_H = 2371,
77    EP_PWT_N = 2353
78};
79
80enum EP_CrownGuardTowerWorldStates {
81    EP_CGT_N_A = 2374,
82    EP_CGT_N_H = 2375,
83    EP_CGT_A_P = 2376,
84    EP_CGT_H_P = 2377,
85    EP_CGT_A = 2378,
86    EP_CGT_H = 2379,
87    EP_CGT_N = 2355
88};
89
90enum EP_WorldStates {
91    EP_UI_TOWER_SLIDER_DISPLAY = 2426,
92    EP_UI_TOWER_SLIDER_POS = 2427,
93    EP_UI_TOWER_SLIDER_N = 2428,
94
95    EP_UI_TOWER_COUNT_A = 2327,
96    EP_UI_TOWER_COUNT_H = 2328
97};
98
99enum EP_Summons {
100    EP_EWT_COMMANDER = 0,
101    EP_EWT_SOLDIER1,
102    EP_EWT_SOLDIER2,
103    EP_EWT_SOLDIER3,
104    EP_EWT_SOLDIER4,
105    EP_PWT_FLIGHTMASTER,
106};
107
108enum EP_GoSummons {
109    EP_NPT_BUFF = 0,
110    EP_NPT_FLAGS,
111    EP_EWT_FLAGS,
112    EP_CGT_FLAGS,
113    EP_PWT_FLAGS
114};
115
116enum EP_Towers {
117    EP_EWT = 0, // plaguelands 03
118    EP_NPT,// plaguelands 01
119    EP_PWT,// plaguelands 04
120    EP_CGT,// plaguelands 02
121    EP_TOWER_NUM
122};
123
124const go_type EPCapturePoints[EP_TOWER_NUM] = {
125    {182097,0,2574.51,-4794.89,144.704,-1.45003,-0.097056,0.095578,-0.656229,0.742165},
126    {181899,0,3181.08,-4379.36,174.123,-2.03472,-0.065392,0.119494,-0.842275,0.521553},
127    {182098,0,2962.71,-3042.31,154.789,2.08426,-0.074807,-0.113837,0.855928,0.49883},
128    {182096,0,1860.85,-3731.23,196.716,-2.53214,0.033967,-0.131914,0.944741,-0.298177}
129};
130
131const go_type EPTowerFlags[EP_TOWER_NUM] = {
132    {182106,0,2569.60,-4772.93,115.399,2.72271,0,0,0.978148,0.207912},
133    {182106,0,3148.17,-4365.51,145.029,1.53589,0,0,0.694658,0.71934},
134    {182106,0,2992.63,-3022.95,125.593,3.03687,0,0,0.99863,0.052336},
135    {182106,0,1838.42,-3703.56,167.713,0.890118,0,0,0.430511,0.902585}
136};
137
138const uint32 EPTowerPlayerEnterEvents[EP_TOWER_NUM] = {10691,10699,10701,10705};
139
140const uint32 EPTowerPlayerLeaveEvents[EP_TOWER_NUM] = {10692,10698,10700,10704};
141
142const uint32 EP_NUM_CREATURES = 6;
143const uint32 EP_EWT_NUM_CREATURES = 5;
144
145// one lordaeron commander, 4 soldiers
146// should be spawned at EWT and follow a path, but trans-grid pathing isn't safe, so summon them directly at NPT
147const creature_type EP_EWT_Summons_A[EP_EWT_NUM_CREATURES] = {
148    {17635,469,0, 3167.61,-4352.09,138.20,4.5811},
149    {17647,469,0, 3172.74,-4352.99,139.14,4.9873},
150    {17647,469,0, 3165.89,-4354.46,138.67,3.7244},
151    {17647,469,0, 3164.65,-4350.26,138.22,2.4794},
152    {17647,469,0, 3169.91,-4349.68,138.37,0.7444}
153};
154
155const creature_type EP_EWT_Summons_H[EP_EWT_NUM_CREATURES] = {
156    {17995,67,0, 3167.61,-4352.09,138.20,4.5811},
157    {17996,67,0, 3172.74,-4352.99,139.14,4.9873},
158    {17996,67,0, 3165.89,-4354.46,138.67,3.7244},
159    {17996,67,0, 3164.65,-4350.26,138.22,2.4794},
160    {17996,67,0, 3169.91,-4349.68,138.37,0.7444}
161};
162
163enum EP_TowerStates {
164    EP_TS_N = 1,
165    EP_TS_N_A = 2,
166    EP_TS_N_H = 4,
167    EP_TS_A_P = 8,
168    EP_TS_H_P = 16,
169    EP_TS_A = 32,
170    EP_TS_H = 64
171};
172
173// when spawning, pay attention at setting the faction manually!
174const creature_type EP_PWT_FlightMaster = {17209,0,0,2987.5,-3049.11,120.126,5.75959};
175
176// after spawning, modify the faction so that only the controller will be able to use it with SetUInt32Value(GAMEOBJECT_FACTION, faction_id);
177const go_type EP_NPT_LordaeronShrine = {181682,0,3167.72,-4355.91,138.785,1.69297,0,0,0.748956,0.66262};
178
179class OutdoorPvPEP;
180
181class OutdoorPvPObjectiveEP_EWT : public OutdoorPvPObjective
182{
183friend class OutdoorPvPEP;
184public:
185    OutdoorPvPObjectiveEP_EWT(OutdoorPvP * pvp);
186    bool Update(uint32 diff);
187    void FillInitialWorldStates(WorldPacket & data);
188    // used when player is activated/inactivated in the area
189    bool HandlePlayerEnter(Player * plr);
190    void HandlePlayerLeave(Player * plr);
191protected:
192    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
193    void SummonSupportUnitAtNorthpassTower(uint32 team);
194    void UpdateTowerState();
195protected:
196    uint32 m_TowerState;
197    uint32 m_UnitsSummonedSide;
198};
199
200class OutdoorPvPObjectiveEP_NPT : public OutdoorPvPObjective
201{
202friend class OutdoorPvPEP;
203public:
204    OutdoorPvPObjectiveEP_NPT(OutdoorPvP * pvp);
205    bool Update(uint32 diff);
206    void FillInitialWorldStates(WorldPacket & data);
207    // used when player is activated/inactivated in the area
208    bool HandlePlayerEnter(Player * plr);
209    void HandlePlayerLeave(Player * plr);
210protected:
211    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
212    void SummonGO(uint32 team);
213    void UpdateTowerState();
214protected:
215    uint32 m_TowerState;
216    uint32 m_SummonedGOSide;
217};
218
219class OutdoorPvPObjectiveEP_CGT : public OutdoorPvPObjective
220{
221friend class OutdoorPvPEP;
222public:
223    OutdoorPvPObjectiveEP_CGT(OutdoorPvP * pvp);
224    bool Update(uint32 diff);
225    void FillInitialWorldStates(WorldPacket & data);
226    // used when player is activated/inactivated in the area
227    bool HandlePlayerEnter(Player * plr);
228    void HandlePlayerLeave(Player * plr);
229protected:
230    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
231    void LinkGraveYard(uint32 team);
232    void UpdateTowerState();
233protected:
234    uint32 m_TowerState;
235    uint32 m_GraveyardSide;
236};
237
238class OutdoorPvPObjectiveEP_PWT : public OutdoorPvPObjective
239{
240friend class OutdoorPvPEP;
241public:
242    OutdoorPvPObjectiveEP_PWT(OutdoorPvP * pvp);
243    bool Update(uint32 diff);
244    void FillInitialWorldStates(WorldPacket & data);
245    // used when player is activated/inactivated in the area
246    bool HandlePlayerEnter(Player * plr);
247    void HandlePlayerLeave(Player * plr);
248    bool HandleGossipOption(Player *plr, uint64 guid, uint32 gossipid);
249    bool CanTalkTo(Player * plr, Creature * c, GossipOption &gso);
250protected:
251    bool HandleCapturePointEvent(Player * plr, uint32 eventId);
252    void SummonFlightMaster(uint32 team);
253    void UpdateTowerState();
254protected:
255    uint32 m_FlightMasterSpawned;
256    uint32 m_TowerState;
257};
258
259class OutdoorPvPEP : public OutdoorPvP
260{
261friend class OutdoorPvPObjectiveEP_EWT;
262friend class OutdoorPvPObjectiveEP_NPT;
263friend class OutdoorPvPObjectiveEP_PWT;
264friend class OutdoorPvPObjectiveEP_CGT;
265public:
266    OutdoorPvPEP();
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 BuffTeams();
274private:
275    // how many towers are controlled
276    uint32 EP_Controls[EP_TOWER_NUM];
277    uint32 m_AllianceTowersControlled;
278    uint32 m_HordeTowersControlled;
279};
280
281#endif
Note: See TracBrowser for help on using the browser.