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 | |
---|
26 | const uint32 EP_AllianceBuffs[4] = {11413, 11414, 11415, 1386}; |
---|
27 | |
---|
28 | const uint32 EP_HordeBuffs[4] = {30880, 30683, 30682, 29520}; |
---|
29 | |
---|
30 | const uint32 EP_GraveYardZone = 139; |
---|
31 | |
---|
32 | const uint32 EP_GraveYardId = 927; |
---|
33 | |
---|
34 | const uint32 EPBuffZonesNum = 3; |
---|
35 | |
---|
36 | const uint32 EP_EWT_CM = 17690; |
---|
37 | const uint32 EP_CGT_CM = 17689; |
---|
38 | const uint32 EP_NPT_CM = 17696; |
---|
39 | const uint32 EP_PWT_CM = 17698; |
---|
40 | |
---|
41 | const uint32 EPBuffZones[EPBuffZonesNum] = {139, 2017, 2057}; |
---|
42 | |
---|
43 | enum EP_TaxiNodes { |
---|
44 | EP_CGT_Taxi = 87, |
---|
45 | EP_EWT_Taxi = 86, |
---|
46 | EP_NPT_Taxi = 85, |
---|
47 | EP_PWT_Taxi = 84 |
---|
48 | }; |
---|
49 | |
---|
50 | enum 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 | |
---|
60 | enum 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 | |
---|
70 | enum 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 | |
---|
80 | enum 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 | |
---|
90 | enum 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 | |
---|
99 | enum 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 | |
---|
108 | enum 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 | |
---|
116 | enum 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 | |
---|
124 | const 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 | |
---|
131 | const 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 | |
---|
138 | const uint32 EPTowerPlayerEnterEvents[EP_TOWER_NUM] = {10691,10699,10701,10705}; |
---|
139 | |
---|
140 | const uint32 EPTowerPlayerLeaveEvents[EP_TOWER_NUM] = {10692,10698,10700,10704}; |
---|
141 | |
---|
142 | const uint32 EP_NUM_CREATURES = 6; |
---|
143 | const 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 |
---|
147 | const 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 | |
---|
155 | const 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 | |
---|
163 | enum 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! |
---|
174 | const 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); |
---|
177 | const go_type EP_NPT_LordaeronShrine = {181682,0,3167.72,-4355.91,138.785,1.69297,0,0,0.748956,0.66262}; |
---|
178 | |
---|
179 | class OutdoorPvPEP; |
---|
180 | |
---|
181 | class OutdoorPvPObjectiveEP_EWT : public OutdoorPvPObjective |
---|
182 | { |
---|
183 | friend class OutdoorPvPEP; |
---|
184 | public: |
---|
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); |
---|
191 | protected: |
---|
192 | bool HandleCapturePointEvent(Player * plr, uint32 eventId); |
---|
193 | void SummonSupportUnitAtNorthpassTower(uint32 team); |
---|
194 | void UpdateTowerState(); |
---|
195 | protected: |
---|
196 | uint32 m_TowerState; |
---|
197 | uint32 m_UnitsSummonedSide; |
---|
198 | }; |
---|
199 | |
---|
200 | class OutdoorPvPObjectiveEP_NPT : public OutdoorPvPObjective |
---|
201 | { |
---|
202 | friend class OutdoorPvPEP; |
---|
203 | public: |
---|
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); |
---|
210 | protected: |
---|
211 | bool HandleCapturePointEvent(Player * plr, uint32 eventId); |
---|
212 | void SummonGO(uint32 team); |
---|
213 | void UpdateTowerState(); |
---|
214 | protected: |
---|
215 | uint32 m_TowerState; |
---|
216 | uint32 m_SummonedGOSide; |
---|
217 | }; |
---|
218 | |
---|
219 | class OutdoorPvPObjectiveEP_CGT : public OutdoorPvPObjective |
---|
220 | { |
---|
221 | friend class OutdoorPvPEP; |
---|
222 | public: |
---|
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); |
---|
229 | protected: |
---|
230 | bool HandleCapturePointEvent(Player * plr, uint32 eventId); |
---|
231 | void LinkGraveYard(uint32 team); |
---|
232 | void UpdateTowerState(); |
---|
233 | protected: |
---|
234 | uint32 m_TowerState; |
---|
235 | uint32 m_GraveyardSide; |
---|
236 | }; |
---|
237 | |
---|
238 | class OutdoorPvPObjectiveEP_PWT : public OutdoorPvPObjective |
---|
239 | { |
---|
240 | friend class OutdoorPvPEP; |
---|
241 | public: |
---|
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); |
---|
250 | protected: |
---|
251 | bool HandleCapturePointEvent(Player * plr, uint32 eventId); |
---|
252 | void SummonFlightMaster(uint32 team); |
---|
253 | void UpdateTowerState(); |
---|
254 | protected: |
---|
255 | uint32 m_FlightMasterSpawned; |
---|
256 | uint32 m_TowerState; |
---|
257 | }; |
---|
258 | |
---|
259 | class OutdoorPvPEP : public OutdoorPvP |
---|
260 | { |
---|
261 | friend class OutdoorPvPObjectiveEP_EWT; |
---|
262 | friend class OutdoorPvPObjectiveEP_NPT; |
---|
263 | friend class OutdoorPvPObjectiveEP_PWT; |
---|
264 | friend class OutdoorPvPObjectiveEP_CGT; |
---|
265 | public: |
---|
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(); |
---|
274 | private: |
---|
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 |
---|