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

#include <OutdoorPvPZM.h>

Public Member Functions

 OPvPCapturePointZM_Beacon (OutdoorPvP *pvp, ZM_BeaconType type)
 
void ChangeState () override
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet) override
 
void UpdateTowerState ()
 
- 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)
 

Protected Attributes

ZM_BeaconType m_TowerType
 
uint32 m_TowerState
 
- 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
 

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 ()
 

Constructor & Destructor Documentation

OPvPCapturePointZM_Beacon::OPvPCapturePointZM_Beacon ( OutdoorPvP pvp,
ZM_BeaconType  type 
)
31 {
32  SetCapturePointData(ZMCapturePoints[type].entry, ZMCapturePoints[type].map, ZMCapturePoints[type].x, ZMCapturePoints[type].y, ZMCapturePoints[type].z, ZMCapturePoints[type].o, ZMCapturePoints[type].rot0, ZMCapturePoints[type].rot1, ZMCapturePoints[type].rot2, ZMCapturePoints[type].rot3);
33 }
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
ZM_BeaconType m_TowerType
Definition: OutdoorPvPZM.h:171
const go_type ZMCapturePoints[ZM_NUM_BEACONS]
Definition: OutdoorPvPZM.h:117
Definition: OutdoorPvPZM.h:152
G3D::int16 x
Definition: Vector2int16.h:37
uint32 m_TowerState
Definition: OutdoorPvPZM.h:172

+ Here is the call graph for this function:

Member Function Documentation

void OPvPCapturePointZM_Beacon::ChangeState ( )
overridevirtual

Implements OPvPCapturePoint.

56 {
57  // if changing from controlling alliance to horde
59  {
60  if (uint32 alliance_towers = ((OutdoorPvPZM*)m_PvP)->GetAllianceTowersControlled())
61  ((OutdoorPvPZM*)m_PvP)->SetAllianceTowersControlled(--alliance_towers);
62  }
63  // if changing from controlling horde to alliance
64  else if (m_OldState == OBJECTIVESTATE_HORDE)
65  {
66  if (uint32 horde_towers = ((OutdoorPvPZM*)m_PvP)->GetHordeTowersControlled())
67  ((OutdoorPvPZM*)m_PvP)->SetHordeTowersControlled(--horde_towers);
68  }
69 
70  switch (m_State)
71  {
73  {
75  uint32 alliance_towers = ((OutdoorPvPZM*)m_PvP)->GetAllianceTowersControlled();
76  if (alliance_towers < ZM_NUM_BEACONS)
77  ((OutdoorPvPZM*)m_PvP)->SetAllianceTowersControlled(++alliance_towers);
78  m_PvP->SendDefenseMessage(ZM_GRAVEYARD_ZONE, ZMBeaconCaptureA[m_TowerType]);
79  break;
80  }
82  {
84  uint32 horde_towers = ((OutdoorPvPZM*)m_PvP)->GetHordeTowersControlled();
85  if (horde_towers < ZM_NUM_BEACONS)
86  ((OutdoorPvPZM*)m_PvP)->SetHordeTowersControlled(++horde_towers);
87  m_PvP->SendDefenseMessage(ZM_GRAVEYARD_ZONE, ZMBeaconCaptureH[m_TowerType]);
88  break;
89  }
96  break;
97  }
98 
100 }
Definition: OutdoorPvPZM.h:153
Definition: OutdoorPvPZM.h:154
OutdoorPvP * m_PvP
Definition: OutdoorPvP.h:177
Definition: OutdoorPvP.h:46
Definition: OutdoorPvPZM.h:96
const uint32 ZMBeaconCaptureA[ZM_NUM_BEACONS]
Definition: OutdoorPvPZM.h:105
const uint32 ZM_GRAVEYARD_ZONE
Definition: OutdoorPvPZM.h:43
const uint32 ZMBeaconCaptureH[ZM_NUM_BEACONS]
Definition: OutdoorPvPZM.h:111
Definition: OutdoorPvPZM.h:216
Definition: OutdoorPvP.h:43
uint32_t uint32
Definition: Define.h:150
Definition: OutdoorPvP.h:45
void UpdateTowerState()
Definition: OutdoorPvPZM.cpp:45
ZM_BeaconType m_TowerType
Definition: OutdoorPvPZM.h:171
Definition: OutdoorPvP.h:42
Definition: OutdoorPvPZM.h:152
Definition: OutdoorPvP.h:47
ObjectiveStates m_OldState
Definition: OutdoorPvP.h:170
uint32 m_TowerState
Definition: OutdoorPvPZM.h:172
ObjectiveStates m_State
Definition: OutdoorPvP.h:171
Definition: OutdoorPvP.h:41

+ Here is the call graph for this function:

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

Reimplemented from OPvPCapturePoint.

36 {
37  packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].ui_tower_n, (m_TowerState & ZM_TOWERSTATE_N) != 0);
38  packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].map_tower_n, (m_TowerState & ZM_TOWERSTATE_N) != 0);
39  packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].ui_tower_a, (m_TowerState & ZM_TOWERSTATE_A) != 0);
40  packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].map_tower_a, 0);
41  packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].ui_tower_h, (m_TowerState & ZM_TOWERSTATE_H) != 0);
42  packet.Worldstates.emplace_back(ZMBeaconInfo[m_TowerType].map_tower_h, (m_TowerState & ZM_TOWERSTATE_H) != 0);
43 }
Definition: OutdoorPvPZM.h:153
Definition: OutdoorPvPZM.h:154
std::list< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
ZM_BeaconType m_TowerType
Definition: OutdoorPvPZM.h:171
const zm_beacon ZMBeaconInfo[ZM_NUM_BEACONS]
Definition: OutdoorPvPZM.h:99
Definition: OutdoorPvPZM.h:152
uint32 m_TowerState
Definition: OutdoorPvPZM.h:172
void OPvPCapturePointZM_Beacon::UpdateTowerState ( )
46 {
48  m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].map_tower_n), uint32((m_TowerState & ZM_TOWERSTATE_N) != 0));
50  m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].map_tower_a), uint32((m_TowerState & ZM_TOWERSTATE_A) != 0));
52  m_PvP->SendUpdateWorldState(uint32(ZMBeaconInfo[m_TowerType].map_tower_h), uint32((m_TowerState & ZM_TOWERSTATE_H) != 0));
53 }
Definition: OutdoorPvPZM.h:153
Definition: OutdoorPvPZM.h:154
OutdoorPvP * m_PvP
Definition: OutdoorPvP.h:177
ZM_BeaconType m_TowerType
Definition: OutdoorPvPZM.h:171
const zm_beacon ZMBeaconInfo[ZM_NUM_BEACONS]
Definition: OutdoorPvPZM.h:99
Definition: OutdoorPvPZM.h:152
uint32_t uint32
Definition: g3dmath.h:168
void SendUpdateWorldState(uint32 field, uint32 value)
Definition: OutdoorPvP.cpp:409
uint32 m_TowerState
Definition: OutdoorPvPZM.h:172

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

uint32 OPvPCapturePointZM_Beacon::m_TowerState
protected
ZM_BeaconType OPvPCapturePointZM_Beacon::m_TowerType
protected

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