TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OPvPCapturePointHP Class Reference

#include <OutdoorPvPHP.h>

Public Member Functions

 OPvPCapturePointHP (OutdoorPvP *pvp, OutdoorPvPHPTowerType type)
 
void ChangeState () override
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet) override
 
- Public Member Functions inherited from OPvPCapturePoint
 OPvPCapturePoint (OutdoorPvP *pvp)
 
virtual ~OPvPCapturePoint ()
 
void SendUpdateWorldState (uint32 field, uint32 value)
 
void SendObjectiveComplete (uint32 id, ObjectGuid guid)
 
virtual bool HandlePlayerEnter (Player *player)
 
virtual void HandlePlayerLeave (Player *player)
 
bool IsInsideObjective (Player *player) const
 
virtual bool HandleCustomSpell (Player *player, uint32 spellId, GameObject *go)
 
virtual int32 HandleOpenGo (Player *player, GameObject *go)
 
virtual bool Update (uint32 diff)
 
virtual void ChangeTeam (TeamId)
 
virtual void SendChangePhase ()
 
virtual bool HandleGossipOption (Player *, Creature *, uint32)
 
virtual bool CanTalkTo (Player *, Creature *, GossipMenuItems const &)
 
virtual bool HandleDropFlag (Player *, uint32)
 
virtual void DeleteSpawns ()
 
void AddGO (uint32 type, ObjectGuid::LowType guid)
 
void AddCre (uint32 type, ObjectGuid::LowType guid)
 
bool SetCapturePointData (uint32 entry, uint32 map, float x, float y, float z, float o=0, float rotation0=0, float rotation1=0, float rotation2=0, float rotation3=0)
 

Private Attributes

OutdoorPvPHPTowerType m_TowerType
 

Additional Inherited Members

- Public Attributes inherited from OPvPCapturePoint
ObjectGuid::LowType m_capturePointSpawnId
 
GameObjectm_capturePoint
 
- Protected Member Functions inherited from OPvPCapturePoint
bool AddObject (uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3)
 
virtual bool AddCreature (uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL, uint32 spawntimedelay=0)
 
bool DelCreature (uint32 type)
 
bool DelObject (uint32 type)
 
bool DelCapturePoint ()
 
- Protected Attributes inherited from OPvPCapturePoint
GuidSet m_activePlayers [2]
 
float m_maxValue
 
float m_minValue
 
float m_maxSpeed
 
float m_value
 
TeamId m_team
 
ObjectiveStates m_OldState
 
ObjectiveStates m_State
 
uint32 m_neutralValuePct
 
OutdoorPvPm_PvP
 
std::map< uint32,
ObjectGuid::LowType
m_Objects
 
std::map< uint32,
ObjectGuid::LowType
m_Creatures
 
std::map< ObjectGuid::LowType,
uint32
m_ObjectTypes
 
std::map< ObjectGuid::LowType,
uint32
m_CreatureTypes
 

Constructor & Destructor Documentation

OPvPCapturePointHP::OPvPCapturePointHP ( OutdoorPvP pvp,
OutdoorPvPHPTowerType  type 
)
32 : OPvPCapturePoint(pvp), m_TowerType(type)
33 {
35  HPCapturePoints[type].map,
36  HPCapturePoints[type].x,
37  HPCapturePoints[type].y,
38  HPCapturePoints[type].z,
39  HPCapturePoints[type].o,
40  HPCapturePoints[type].rot0,
41  HPCapturePoints[type].rot1,
42  HPCapturePoints[type].rot2,
43  HPCapturePoints[type].rot3);
44  AddObject(type,
45  HPTowerFlags[type].entry,
46  HPTowerFlags[type].map,
47  HPTowerFlags[type].x,
48  HPTowerFlags[type].y,
49  HPTowerFlags[type].z,
50  HPTowerFlags[type].o,
51  HPTowerFlags[type].rot0,
52  HPTowerFlags[type].rot1,
53  HPTowerFlags[type].rot2,
54  HPTowerFlags[type].rot3);
55 }
const go_type HPTowerFlags[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:87
const go_type HPCapturePoints[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:80
OPvPCapturePoint(OutdoorPvP *pvp)
Definition: OutdoorPvP.cpp:52
bool SetCapturePointData(uint32 entry, uint32 map, float x, float y, float z, float o=0, float rotation0=0, float rotation1=0, float rotation2=0, float rotation3=0)
Definition: OutdoorPvP.cpp:131
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
bool AddObject(uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3)
Definition: OutdoorPvP.cpp:109
OutdoorPvPHPTowerType m_TowerType
Definition: OutdoorPvPHP.h:104
G3D::int16 x
Definition: Vector2int16.h:37

+ Here is the call graph for this function:

Member Function Documentation

void OPvPCapturePointHP::ChangeState ( )
overridevirtual

Implements OPvPCapturePoint.

160 {
161  uint32 field = 0;
162  switch (m_OldState)
163  {
165  field = HP_MAP_N[m_TowerType];
166  break;
168  field = HP_MAP_A[m_TowerType];
169  if (uint32 alliance_towers = ((OutdoorPvPHP*)m_PvP)->GetAllianceTowersControlled())
170  ((OutdoorPvPHP*)m_PvP)->SetAllianceTowersControlled(--alliance_towers);
171  break;
173  field = HP_MAP_H[m_TowerType];
174  if (uint32 horde_towers = ((OutdoorPvPHP*)m_PvP)->GetHordeTowersControlled())
175  ((OutdoorPvPHP*)m_PvP)->SetHordeTowersControlled(--horde_towers);
176  break;
178  field = HP_MAP_N[m_TowerType];
179  break;
181  field = HP_MAP_N[m_TowerType];
182  break;
184  field = HP_MAP_A[m_TowerType];
185  break;
187  field = HP_MAP_H[m_TowerType];
188  break;
189  }
190 
191  // send world state update
192  if (field)
193  {
194  m_PvP->SendUpdateWorldState(field, 0);
195  field = 0;
196  }
197  uint32 artkit = 21;
199  switch (m_State)
200  {
202  field = HP_MAP_N[m_TowerType];
203  break;
205  {
206  field = HP_MAP_A[m_TowerType];
207  artkit = 2;
208  artkit2 = HP_TowerArtKit_A[m_TowerType];
209  uint32 alliance_towers = ((OutdoorPvPHP*)m_PvP)->GetAllianceTowersControlled();
210  if (alliance_towers < 3)
211  ((OutdoorPvPHP*)m_PvP)->SetAllianceTowersControlled(++alliance_towers);
213  break;
214  }
216  {
217  field = HP_MAP_H[m_TowerType];
218  artkit = 1;
219  artkit2 = HP_TowerArtKit_H[m_TowerType];
220  uint32 horde_towers = ((OutdoorPvPHP*)m_PvP)->GetHordeTowersControlled();
221  if (horde_towers < 3)
222  ((OutdoorPvPHP*)m_PvP)->SetHordeTowersControlled(++horde_towers);
224  break;
225  }
227  field = HP_MAP_N[m_TowerType];
228  break;
230  field = HP_MAP_N[m_TowerType];
231  break;
233  field = HP_MAP_A[m_TowerType];
234  artkit = 2;
235  artkit2 = HP_TowerArtKit_A[m_TowerType];
236  break;
238  field = HP_MAP_H[m_TowerType];
239  artkit = 1;
240  artkit2 = HP_TowerArtKit_H[m_TowerType];
241  break;
242  }
243 
244  Map* map = sMapMgr->FindMap(530, 0);
245  auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
246  for (auto itr = bounds.first; itr != bounds.second; ++itr)
247  itr->second->SetGoArtKit(artkit);
248 
249  bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_Objects[m_TowerType]);
250  for (auto itr = bounds.first; itr != bounds.second; ++itr)
251  itr->second->SetGoArtKit(artkit2);
252 
253  // send world state update
254  if (field)
255  m_PvP->SendUpdateWorldState(field, 1);
256 
257  // complete quest objective
260 }
OutdoorPvP * m_PvP
Definition: OutdoorPvP.h:177
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: OutdoorPvP.h:46
const uint32 HP_LANG_CAPTURE_H[HP_TOWER_NUM]
Definition: OutdoorPvPHP.cpp:29
const uint32 HP_MAP_N[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:68
const uint32 HP_MAP_H[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:72
const uint32 HP_CREDITMARKER[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:53
const uint32 HP_TowerArtKit_N[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:78
ObjectGuid::LowType m_capturePointSpawnId
Definition: OutdoorPvP.h:131
Definition: OutdoorPvP.h:43
uint32_t uint32
Definition: Define.h:150
Definition: OutdoorPvP.h:45
Definition: OutdoorPvPHP.h:107
void SendDefenseMessage(uint32 zoneId, uint32 id)
Definition: OutdoorPvP.cpp:634
Definition: Map.h:259
std::map< uint32, ObjectGuid::LowType > m_Objects
Definition: OutdoorPvP.h:181
const uint32 HP_TowerArtKit_A[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:74
OutdoorPvPHPTowerType m_TowerType
Definition: OutdoorPvPHP.h:104
const uint32 HP_MAP_A[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:70
Definition: OutdoorPvP.h:42
void SendObjectiveComplete(uint32 id, ObjectGuid guid)
Definition: OutdoorPvP.cpp:429
const uint32 HP_LANG_CAPTURE_A[HP_TOWER_NUM]
Definition: OutdoorPvPHP.cpp:27
#define sMapMgr
Definition: MapManager.h:194
GameObjectBySpawnIdContainer & GetGameObjectBySpawnIdStore()
Definition: Map.h:472
Definition: OutdoorPvP.h:47
const uint32 OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum]
Definition: OutdoorPvPHP.h:35
const uint32 HP_TowerArtKit_H[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:76
void SendUpdateWorldState(uint32 field, uint32 value)
Definition: OutdoorPvP.cpp:409
ObjectiveStates m_OldState
Definition: OutdoorPvP.h:170
ObjectiveStates m_State
Definition: OutdoorPvP.h:171
Definition: OutdoorPvP.h:41

+ Here is the call graph for this function:

void OPvPCapturePointHP::FillInitialWorldStates ( WorldPackets::WorldState::InitWorldStates packet)
overridevirtual

Reimplemented from OPvPCapturePoint.

263 {
264  switch (m_State)
265  {
268  packet.Worldstates.emplace_back(uint32(HP_MAP_N[m_TowerType]), 0);
269  packet.Worldstates.emplace_back(uint32(HP_MAP_A[m_TowerType]), 1);
270  packet.Worldstates.emplace_back(uint32(HP_MAP_H[m_TowerType]), 0);
271  break;
274  packet.Worldstates.emplace_back(uint32(HP_MAP_N[m_TowerType]), 0);
275  packet.Worldstates.emplace_back(uint32(HP_MAP_A[m_TowerType]), 0);
276  packet.Worldstates.emplace_back(uint32(HP_MAP_H[m_TowerType]), 1);
277  break;
281  default:
282  packet.Worldstates.emplace_back(uint32(HP_MAP_N[m_TowerType]), 1);
283  packet.Worldstates.emplace_back(uint32(HP_MAP_A[m_TowerType]), 0);
284  packet.Worldstates.emplace_back(uint32(HP_MAP_H[m_TowerType]), 0);
285  break;
286  }
287 }
Definition: OutdoorPvP.h:46
const uint32 HP_MAP_N[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:68
std::list< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
const uint32 HP_MAP_H[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:72
Definition: OutdoorPvP.h:43
Definition: OutdoorPvP.h:45
OutdoorPvPHPTowerType m_TowerType
Definition: OutdoorPvPHP.h:104
const uint32 HP_MAP_A[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:70
Definition: OutdoorPvP.h:42
uint32_t uint32
Definition: g3dmath.h:168
Definition: OutdoorPvP.h:47
ObjectiveStates m_State
Definition: OutdoorPvP.h:171
Definition: OutdoorPvP.h:41

Member Data Documentation

OutdoorPvPHPTowerType OPvPCapturePointHP::m_TowerType
private

The documentation for this class was generated from the following files: