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