TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OutdoorPvPZM.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef OUTDOOR_PVP_ZM_
19 #define OUTDOOR_PVP_ZM_
20 
21 #include "OutdoorPvP.h"
22 
24 {
25  TEXT_WEST_BEACON_TAKEN_ALLIANCE = 15541, // '|cffffff00The Alliance has taken control of the West Beacon!|r'
26  TEXT_WEST_BEACON_TAKEN_HORDE = 15543, // '|cffffff00The Horde has taken control of the West Beacon!|r'
27  TEXT_EAST_BEACON_TAKEN_ALLIANCE = 15546, // '|cffffff00The Alliance has taken control of the East Beacon!|r'
28  TEXT_EAST_BEACON_TAKEN_HORDE = 15545, // '|cffffff00The Horde has taken control of the East Beacon!|r'
29  TEXT_TWIN_SPIRE_RUINS_TAKEN_ALLIANCE = 15591, // '|cffffff00The Alliance has taken control of Twin Spire Ruins!|r'
30  TEXT_TWIN_SPIRE_RUINS_TAKEN_HORDE = 15590, // '|cffffff00The Horde has taken control of Twin Spire Ruins!|r'
31  TEXT_BOTH_BEACONS_TAKEN_ALLIANCE = 16284, // (NYI) '|cffffff00The Alliance has taken control of both beacons!|r'
32  TEXT_BOTH_BEACONS_TAKEN_HORDE = 16285, // (NYI) '|cffffff00The Horde has taken control of both beacons!|r'
33  TEXT_BATTLE_STANDARDS_ALLIANCE = 16287, // (NYI) '|cffffff00The Alliance Field Scout is now issuing battle standards.|r'
34  TEXT_BATTLE_STANDARDS_HORDE = 16288 // (NYI) '|cffffff00The Horde Field Scout is now issuing battle standards.|r'
35 };
36 
38 
39 // the buff is cast in these zones
40 const uint32 OutdoorPvPZMBuffZones[OutdoorPvPZMBuffZonesNum] = {3521, 3607, 3717, 3715, 3716};
41 
42 // linked when the central tower is controlled
44 
45 // linked when the central tower is controlled
46 const uint32 ZM_GRAVEYARD_ID = 969;
47 
49 {
50  // cast on the players of the controlling faction
51  ZM_CAPTURE_BUFF = 33779, // twin spire blessing
52  // spell that the field scout casts on the player to carry the flag
54  // spell that the field scout casts on the player to carry the flag
56  // token create spell
58  // token create spell
60 };
61 
62 // banners 182527, 182528, 182529, gotta check them ingame
63 const go_type ZM_Banner_A = { 182527, 530, 253.54f, 7083.81f, 36.7728f, -0.017453f, 0.0f, 0.0f, 0.008727f, -0.999962f };
64 const go_type ZM_Banner_H = { 182528, 530, 253.54f, 7083.81f, 36.7728f, -0.017453f, 0.0f, 0.0f, 0.008727f, -0.999962f };
65 const go_type ZM_Banner_N = { 182529, 530, 253.54f, 7083.81f, 36.7728f, -0.017453f, 0.0f, 0.0f, 0.008727f, -0.999962f };
66 
67 // horde field scout spawn data
68 const creature_type ZM_HordeFieldScout = {18564, 530, 296.625f, 7818.4f, 42.6294f, 5.18363f};
69 
70 // alliance field scout spawn data
71 const creature_type ZM_AllianceFieldScout = {18581, 530, 374.395f, 6230.08f, 22.8351f, 0.593412f};
72 
74 {
78 };
79 
80 struct zm_beacon
81 {
90 };
91 
93 {
97 };
98 
100 {
101  {2560, 2559, 2558, 2652, 2651, 2650, 11807, 11806},
102  {2557, 2556, 2555, 2646, 2645, 2644, 11805, 11804}
103 };
104 
106 {
109 };
110 
112 {
115 };
116 
118 {
119  {182523, 530, 303.243f, 6841.36f, 40.1245f, -1.58825f, 0.0f, 0.0f, 0.71325f, -0.700909f},
120  {182522, 530, 336.466f, 7340.26f, 41.4984f, -1.58825f, 0.0f, 0.0f, 0.71325f, -0.700909f}
121 };
122 
124 {
126 
133 
143 
148 };
149 
151 {
155 };
156 
157 class OutdoorPvPZM;
158 
160 {
161  public:
163 
164  void ChangeState() override;
165 
167 
168  void UpdateTowerState();
169 
170  protected:
173 };
174 
176 {
180 };
181 
183 {
184  public:
186 
187  bool Update(uint32 diff) override;
188 
189  void ChangeState() override { }
190 
192 
193  void UpdateTowerState();
194 
195  int32 HandleOpenGo(Player* player, GameObject* go) override;
196 
197  void SetBeaconState(uint32 controlling_team); // not good atm
198 
199  bool HandleGossipOption(Player* player, Creature* creature, uint32 gossipid) override;
200 
201  bool HandleDropFlag(Player* player, uint32 spellId) override;
202 
203  bool CanTalkTo(Player* player, Creature* creature, GossipMenuItems const& gso) override;
204 
205  uint32 GetGraveYardState() const;
206 
207  private:
209 
210  protected:
212 
214 };
215 
216 class OutdoorPvPZM : public OutdoorPvP
217 {
218  public:
219  OutdoorPvPZM();
220 
221  bool SetupOutdoorPvP() override;
222 
223  void HandlePlayerEnterZone(Player* player, uint32 zone) override;
224  void HandlePlayerLeaveZone(Player* player, uint32 zone) override;
225 
226  bool Update(uint32 diff) override;
227 
229 
230  void SendRemoveWorldStates(Player* player) override;
231 
232  void HandleKillImpl(Player* player, Unit* killed) override;
233 
236 
238  void SetHordeTowersControlled(uint32 count);
239 
240  private:
242 
245 };
246 
248 #endif
Definition: OutdoorPvPZM.h:141
Definition: OutdoorPvPZM.h:153
ObjectGuid m_FlagCarrierGUID
Definition: OutdoorPvPZM.h:213
Definition: OutdoorPvPZM.h:51
Definition: OutdoorPvPZM.h:154
OutdoorPvPZMSpells
Definition: OutdoorPvPZM.h:48
Definition: OutdoorPvPZM.h:75
Definition: OutdoorPvPZM.h:77
Definition: OutdoorPvPZM.h:130
OutdoorPvPZM()
Definition: OutdoorPvPZM.cpp:142
uint32 ui_tower_h
Definition: OutdoorPvPZM.h:83
void SetBeaconState(uint32 controlling_team)
Definition: OutdoorPvPZM.cpp:256
Definition: OutdoorPvPZM.h:142
void SendRemoveWorldStates(Player *player) override
Definition: OutdoorPvPZM.cpp:385
Definition: OutdoorPvPZM.h:96
void ChangeState() override
Definition: OutdoorPvPZM.h:189
Definition: OutdoorPvPZM.h:129
Definition: OutdoorPvP.h:87
OPvPCapturePointZM_GraveYard * m_GraveYard
Definition: OutdoorPvPZM.h:241
Definition: OutdoorPvPZM.h:26
bool Update(uint32 diff) override
Definition: OutdoorPvPZM.cpp:180
uint32 m_GraveYardState
Definition: OutdoorPvPZM.h:208
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &packet) override
Definition: OutdoorPvPZM.cpp:378
ZM_TowerStateMask
Definition: OutdoorPvPZM.h:150
Definition: OutdoorPvPZM.h:59
const uint32 OutdoorPvPZMBuffZones[OutdoorPvPZMBuffZonesNum]
Definition: OutdoorPvPZM.h:40
uint32 event_enter
Definition: OutdoorPvPZM.h:88
bool HandleGossipOption(Player *player, Creature *creature, uint32 gossipid) override
Definition: OutdoorPvPZM.cpp:314
uint32 GetHordeTowersControlled() const
Definition: OutdoorPvPZM.cpp:368
const go_type ZM_Banner_A
Definition: OutdoorPvPZM.h:63
const go_type ZM_Banner_H
Definition: OutdoorPvPZM.h:64
Definition: OutdoorPvPZM.h:30
Definition: OutdoorPvPZM.h:128
OutdoorPvPZMWorldStates
Definition: OutdoorPvPZM.h:123
uint32 ui_tower_n
Definition: OutdoorPvPZM.h:82
const uint32 ZMBeaconCaptureA[ZM_NUM_BEACONS]
Definition: OutdoorPvPZM.h:105
Definition: OutdoorPvPZM.h:28
Definition: OutdoorPvPZM.h:145
Definition: OutdoorPvPZM.h:33
Definition: OutdoorPvPZM.h:80
uint32 event_leave
Definition: OutdoorPvPZM.h:89
ZM_GraveYardState
Definition: OutdoorPvPZM.h:175
Definition: Creature.h:467
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &packet) override
Definition: OutdoorPvPZM.cpp:244
const go_type ZM_Banner_N
Definition: OutdoorPvPZM.h:65
OPvPCapturePointZM_GraveYard(OutdoorPvP *pvp)
Definition: OutdoorPvPZM.cpp:219
Definition: OutdoorPvPZM.h:178
uint32 m_BothControllingFaction
Definition: OutdoorPvPZM.h:211
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPZM.h:243
const uint32 ZM_GRAVEYARD_ZONE
Definition: OutdoorPvPZM.h:43
Definition: OutdoorPvPZM.h:125
Definition: OutdoorPvPZM.h:146
Definition: OutdoorPvPZM.h:53
void HandleKillImpl(Player *player, Unit *killed) override
Definition: OutdoorPvPZM.cpp:169
void UpdateTowerState()
Definition: OutdoorPvPZM.cpp:232
Definition: OutdoorPvPZM.h:32
const uint32 ZMBeaconCaptureH[ZM_NUM_BEACONS]
Definition: OutdoorPvPZM.h:111
Definition: ObjectMgr.h:510
DefenseMessages
Definition: OutdoorPvPHP.h:23
void ChangeState() override
Definition: OutdoorPvPZM.cpp:55
uint32 map_tower_n
Definition: OutdoorPvPZM.h:85
Definition: OutdoorPvPZM.h:31
Definition: OutdoorPvPZM.h:216
int32 HandleOpenGo(Player *player, GameObject *go) override
Definition: OutdoorPvPZM.cpp:187
Definition: OutdoorPvPZM.h:182
Definition: OutdoorPvPZM.h:95
ZMCreatureTypes
Definition: OutdoorPvPZM.h:73
int32_t int32
Definition: Define.h:146
OPvPCapturePointZM_Beacon(OutdoorPvP *pvp, ZM_BeaconType type)
Definition: OutdoorPvPZM.cpp:29
uint32_t uint32
Definition: Define.h:150
Definition: OutdoorPvPZM.h:147
Definition: WorldStatePackets.h:27
void SetAllianceTowersControlled(uint32 count)
Definition: OutdoorPvPZM.cpp:363
Definition: GameObject.h:880
void SetHordeTowersControlled(uint32 count)
Definition: OutdoorPvPZM.cpp:373
void UpdateTowerState()
Definition: OutdoorPvPZM.cpp:45
const uint8 OutdoorPvPZMBuffZonesNum
Definition: OutdoorPvPZM.h:37
Definition: OutdoorPvPZM.h:137
Definition: OutdoorPvPZM.h:131
void HandlePlayerLeaveZone(Player *player, uint32 zone) override
Definition: OutdoorPvPZM.cpp:132
Definition: OutdoorPvPZM.h:135
Definition: OutdoorPvPZM.h:94
Definition: OutdoorPvPZM.h:139
ZM_BeaconType m_TowerType
Definition: OutdoorPvPZM.h:171
Definition: OutdoorPvP.h:68
Definition: OutdoorPvP.h:188
uint32 ui_tower_a
Definition: OutdoorPvPZM.h:84
const go_type ZMCapturePoints[ZM_NUM_BEACONS]
Definition: OutdoorPvPZM.h:117
bool SetupOutdoorPvP() override
Definition: OutdoorPvPZM.cpp:150
Definition: OutdoorPvPZM.h:177
Definition: OutdoorPvPZM.h:34
Definition: OutdoorPvPZM.h:29
uint32 GetAllianceTowersControlled() const
Definition: OutdoorPvPZM.cpp:358
Definition: OutdoorPvPZM.h:25
void HandlePlayerEnterZone(Player *player, uint32 zone) override
Definition: OutdoorPvPZM.cpp:117
uint32 map_tower_a
Definition: OutdoorPvPZM.h:87
Definition: OutdoorPvPZM.h:144
uint8_t uint8
Definition: Define.h:152
uint32 GetGraveYardState() const
Definition: OutdoorPvPZM.cpp:353
const zm_beacon ZMBeaconInfo[ZM_NUM_BEACONS]
Definition: OutdoorPvPZM.h:99
Definition: OutdoorPvPZM.h:152
const uint32 ZM_GRAVEYARD_ID
Definition: OutdoorPvPZM.h:46
Definition: OutdoorPvPZM.h:127
bool Update(uint32 diff) override
Definition: OutdoorPvPZM.cpp:102
Definition: OutdoorPvPZM.h:57
Definition: ObjectGuid.h:189
Definition: OutdoorPvPZM.h:159
Definition: OutdoorPvPZM.h:138
Definition: OutdoorPvPZM.h:76
const creature_type ZM_AllianceFieldScout
Definition: OutdoorPvPZM.h:71
Definition: OutdoorPvPZM.h:179
Definition: Unit.h:1305
ZM_BeaconType
Definition: OutdoorPvPZM.h:92
bool HandleDropFlag(Player *player, uint32 spellId) override
Definition: OutdoorPvPZM.cpp:339
uint32 m_TowerState
Definition: OutdoorPvPZM.h:172
uint32 map_tower_h
Definition: OutdoorPvPZM.h:86
Definition: OutdoorPvPZM.h:27
bool CanTalkTo(Player *player, Creature *creature, GossipMenuItems const &gso) override
Definition: OutdoorPvPZM.cpp:301
Definition: OutdoorPvPZM.h:132
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &packet) override
Definition: OutdoorPvPZM.cpp:35
Definition: OutdoorPvP.h:53
Definition: OutdoorPvPZM.h:136
Definition: OutdoorPvPZM.h:134
Definition: OutdoorPvPZM.h:140
uint32 m_HordeTowersControlled
Definition: OutdoorPvPZM.h:244
Definition: OutdoorPvPZM.h:55
const creature_type ZM_HordeFieldScout
Definition: OutdoorPvPZM.h:68