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_ZM_ |
---|
20 | #define OUTDOOR_PVP_ZM_ |
---|
21 | |
---|
22 | #include "OutdoorPvP.h" |
---|
23 | #include "Language.h" |
---|
24 | |
---|
25 | const uint32 OutdoorPvPZMBuffZonesNum = 5; |
---|
26 | // the buff is cast in these zones |
---|
27 | const uint32 OutdoorPvPZMBuffZones[OutdoorPvPZMBuffZonesNum] = {3521,3607,3717,3715,3716}; |
---|
28 | // cast on the players of the controlling faction |
---|
29 | const uint32 ZM_CAPTURE_BUFF = 33779; // twin spire blessing |
---|
30 | // spell that the field scout casts on the player to carry the flag |
---|
31 | const uint32 ZM_BATTLE_STANDARD_A = 32430; |
---|
32 | // spell that the field scout casts on the player to carry the flag |
---|
33 | const uint32 ZM_BATTLE_STANDARD_H = 32431; |
---|
34 | // linked when the central tower is controlled |
---|
35 | const uint32 ZM_GRAVEYARD_ZONE = 3521; |
---|
36 | // linked when the central tower is controlled |
---|
37 | const uint32 ZM_GRAVEYARD_ID = 969; |
---|
38 | // token create spell |
---|
39 | const uint32 ZM_AlliancePlayerKillReward = 32155; |
---|
40 | // token create spell |
---|
41 | const uint32 ZM_HordePlayerKillReward = 32158; |
---|
42 | |
---|
43 | // banners 182527, 182528, 182529, gotta check them ingame |
---|
44 | const go_type ZM_Banner_A = { 182527,530,253.54,7083.81,36.7728,-0.017453,0,0,0.008727,-0.999962 }; |
---|
45 | const go_type ZM_Banner_H = { 182528,530,253.54,7083.81,36.7728,-0.017453,0,0,0.008727,-0.999962 }; |
---|
46 | const go_type ZM_Banner_N = { 182529,530,253.54,7083.81,36.7728,-0.017453,0,0,0.008727,-0.999962 }; |
---|
47 | |
---|
48 | // horde field scout spawn data |
---|
49 | const creature_type ZM_HordeFieldScout = {18564,67,530,296.625,7818.4,42.6294,5.18363}; |
---|
50 | // alliance field scout spawn data |
---|
51 | const creature_type ZM_AllianceFieldScout = {18581,469,530,374.395,6230.08,22.8351,0.593412}; |
---|
52 | |
---|
53 | enum ZMCreatureTypes{ |
---|
54 | ZM_ALLIANCE_FIELD_SCOUT = 0, |
---|
55 | ZM_HORDE_FIELD_SCOUT, |
---|
56 | ZM_CREATURE_NUM |
---|
57 | }; |
---|
58 | |
---|
59 | struct zm_beacon { |
---|
60 | uint32 slider_disp; |
---|
61 | uint32 slider_n; |
---|
62 | uint32 slider_pos; |
---|
63 | uint32 ui_tower_n; |
---|
64 | uint32 ui_tower_h; |
---|
65 | uint32 ui_tower_a; |
---|
66 | uint32 map_tower_n; |
---|
67 | uint32 map_tower_h; |
---|
68 | uint32 map_tower_a; |
---|
69 | uint32 event_enter; |
---|
70 | uint32 event_leave; |
---|
71 | }; |
---|
72 | |
---|
73 | enum ZM_BeaconType{ |
---|
74 | ZM_BEACON_EAST = 0, |
---|
75 | ZM_BEACON_WEST, |
---|
76 | ZM_NUM_BEACONS |
---|
77 | }; |
---|
78 | |
---|
79 | const zm_beacon ZMBeaconInfo[ZM_NUM_BEACONS] = { |
---|
80 | {2533,2535,2534,2560,2559,2558,2652,2651,2650,11807,11806}, |
---|
81 | {2527,2529,2528,2557,2556,2555,2646,2645,2644,11805,11804} |
---|
82 | }; |
---|
83 | |
---|
84 | const uint32 ZMBeaconCaptureA[ZM_NUM_BEACONS] = { |
---|
85 | LANG_OPVP_ZM_CAPTURE_EAST_A, |
---|
86 | LANG_OPVP_ZM_CAPTURE_WEST_A |
---|
87 | }; |
---|
88 | |
---|
89 | const uint32 ZMBeaconCaptureH[ZM_NUM_BEACONS] = { |
---|
90 | LANG_OPVP_ZM_CAPTURE_EAST_H, |
---|
91 | LANG_OPVP_ZM_CAPTURE_WEST_H |
---|
92 | }; |
---|
93 | |
---|
94 | const uint32 ZMBeaconLooseA[ZM_NUM_BEACONS] = { |
---|
95 | LANG_OPVP_ZM_LOOSE_EAST_A, |
---|
96 | LANG_OPVP_ZM_LOOSE_WEST_A |
---|
97 | }; |
---|
98 | |
---|
99 | const uint32 ZMBeaconLooseH[ZM_NUM_BEACONS] = { |
---|
100 | LANG_OPVP_ZM_LOOSE_EAST_H, |
---|
101 | LANG_OPVP_ZM_LOOSE_WEST_H |
---|
102 | }; |
---|
103 | |
---|
104 | const go_type ZMCapturePoints[ZM_NUM_BEACONS] = { |
---|
105 | {182523,530,303.243,6841.36,40.1245,-1.58825,0,0,0.71325,-0.700909}, |
---|
106 | {182522,530,336.466,7340.26,41.4984,-1.58825,0,0,0.71325,-0.700909} |
---|
107 | }; |
---|
108 | |
---|
109 | enum OutdoorPvPZMWorldStates |
---|
110 | { |
---|
111 | ZM_UI_TOWER_SLIDER_N_W = 2529, |
---|
112 | ZM_UI_TOWER_SLIDER_POS_W = 2528, |
---|
113 | ZM_UI_TOWER_SLIDER_DISPLAY_W = 2527, |
---|
114 | |
---|
115 | ZM_UI_TOWER_SLIDER_N_E = 2535, |
---|
116 | ZM_UI_TOWER_SLIDER_POS_E = 2534, |
---|
117 | ZM_UI_TOWER_SLIDER_DISPLAY_E = 2533, |
---|
118 | |
---|
119 | ZM_WORLDSTATE_UNK_1 = 2653, |
---|
120 | |
---|
121 | ZM_UI_TOWER_EAST_N = 2560, |
---|
122 | ZM_UI_TOWER_EAST_H = 2559, |
---|
123 | ZM_UI_TOWER_EAST_A = 2558, |
---|
124 | ZM_UI_TOWER_WEST_N = 2557, |
---|
125 | ZM_UI_TOWER_WEST_H = 2556, |
---|
126 | ZM_UI_TOWER_WEST_A = 2555, |
---|
127 | |
---|
128 | ZM_MAP_TOWER_EAST_N = 2652, |
---|
129 | ZM_MAP_TOWER_EAST_H = 2651, |
---|
130 | ZM_MAP_TOWER_EAST_A = 2650, |
---|
131 | ZM_MAP_GRAVEYARD_H = 2649, |
---|
132 | ZM_MAP_GRAVEYARD_A = 2648, |
---|
133 | ZM_MAP_GRAVEYARD_N = 2647, |
---|
134 | ZM_MAP_TOWER_WEST_N = 2646, |
---|
135 | ZM_MAP_TOWER_WEST_H = 2645, |
---|
136 | ZM_MAP_TOWER_WEST_A = 2644, |
---|
137 | |
---|
138 | ZM_MAP_HORDE_FLAG_READY = 2658, |
---|
139 | ZM_MAP_HORDE_FLAG_NOT_READY = 2657, |
---|
140 | ZM_MAP_ALLIANCE_FLAG_NOT_READY = 2656, |
---|
141 | ZM_MAP_ALLIANCE_FLAG_READY = 2655 |
---|
142 | }; |
---|
143 | |
---|
144 | enum ZM_TowerStateMask{ |
---|
145 | ZM_TOWERSTATE_N = 1, |
---|
146 | ZM_TOWERSTATE_A = 2, |
---|
147 | ZM_TOWERSTATE_H = 4 |
---|
148 | }; |
---|
149 | |
---|
150 | class OutdoorPvPZM; |
---|
151 | class OutdoorPvPObjectiveZM_Beacon : public OutdoorPvPObjective |
---|
152 | { |
---|
153 | friend class OutdoorPvPZM; |
---|
154 | public: |
---|
155 | OutdoorPvPObjectiveZM_Beacon(OutdoorPvP * pvp, ZM_BeaconType type); |
---|
156 | bool Update(uint32 diff); |
---|
157 | void FillInitialWorldStates(WorldPacket & data); |
---|
158 | // used when player is activated/inactivated in the area |
---|
159 | bool HandlePlayerEnter(Player * plr); |
---|
160 | void HandlePlayerLeave(Player * plr); |
---|
161 | void UpdateTowerState(); |
---|
162 | protected: |
---|
163 | bool HandleCapturePointEvent(Player * plr, uint32 eventId); |
---|
164 | protected: |
---|
165 | ZM_BeaconType m_TowerType; |
---|
166 | uint32 m_TowerState; |
---|
167 | }; |
---|
168 | |
---|
169 | enum ZM_GraveYardState{ |
---|
170 | ZM_GRAVEYARD_N = 1, |
---|
171 | ZM_GRAVEYARD_A = 2, |
---|
172 | ZM_GRAVEYARD_H = 4 |
---|
173 | }; |
---|
174 | |
---|
175 | class OutdoorPvPObjectiveZM_GraveYard : public OutdoorPvPObjective |
---|
176 | { |
---|
177 | friend class OutdoorPvPZM; |
---|
178 | public: |
---|
179 | OutdoorPvPObjectiveZM_GraveYard(OutdoorPvP * pvp); |
---|
180 | bool Update(uint32 diff); |
---|
181 | void FillInitialWorldStates(WorldPacket & data); |
---|
182 | void UpdateTowerState(); |
---|
183 | int32 HandleOpenGo(Player *plr, uint64 guid); |
---|
184 | void SetBeaconState(uint32 controlling_team); // not good atm |
---|
185 | bool HandleGossipOption(Player * plr, uint64 guid, uint32 gossipid); |
---|
186 | bool HandleDropFlag(Player * plr, uint32 spellId); |
---|
187 | bool CanTalkTo(Player * plr, Creature * c, GossipOption &gso); |
---|
188 | private: |
---|
189 | uint32 m_GraveYardState; |
---|
190 | protected: |
---|
191 | uint32 m_BothControllingFaction; |
---|
192 | uint64 m_FlagCarrierGUID; |
---|
193 | }; |
---|
194 | |
---|
195 | class OutdoorPvPZM : public OutdoorPvP |
---|
196 | { |
---|
197 | friend class OutdoorPvPObjectiveZM_Beacon; |
---|
198 | public: |
---|
199 | OutdoorPvPZM(); |
---|
200 | bool SetupOutdoorPvP(); |
---|
201 | void HandlePlayerEnterZone(Player *plr, uint32 zone); |
---|
202 | void HandlePlayerLeaveZone(Player *plr, uint32 zone); |
---|
203 | bool Update(uint32 diff); |
---|
204 | void FillInitialWorldStates(WorldPacket &data); |
---|
205 | void SendRemoveWorldStates(Player * plr); |
---|
206 | void HandleKillImpl(Player * plr, Unit * killed); |
---|
207 | void BuffTeam(uint32 team); |
---|
208 | private: |
---|
209 | OutdoorPvPObjectiveZM_GraveYard * m_GraveYard; |
---|
210 | uint32 m_AllianceTowersControlled; |
---|
211 | uint32 m_HordeTowersControlled; |
---|
212 | }; |
---|
213 | |
---|
214 | // todo: flag carrier death/leave/mount/activitychange should give back the gossip options |
---|
215 | #endif |
---|