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

#include <OutdoorPvPHP.h>

Public Member Functions

 OutdoorPvPHP ()
 
bool SetupOutdoorPvP () override
 
void HandlePlayerEnterZone (Player *player, uint32 zone) override
 
void HandlePlayerLeaveZone (Player *player, uint32 zone) override
 
bool Update (uint32 diff) override
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet) override
 
void SendRemoveWorldStates (Player *player) override
 
void HandleKillImpl (Player *player, Unit *killed) override
 
uint32 GetAllianceTowersControlled () const
 
void SetAllianceTowersControlled (uint32 count)
 
uint32 GetHordeTowersControlled () const
 
void SetHordeTowersControlled (uint32 count)
 
- Public Member Functions inherited from OutdoorPvP
 OutdoorPvP ()
 
virtual ~OutdoorPvP ()
 
void DeleteSpawns ()
 
virtual bool HandleAreaTrigger (Player *, uint32, bool)
 
virtual bool HandleCustomSpell (Player *player, uint32 spellId, GameObject *go)
 
virtual bool HandleOpenGo (Player *player, GameObject *go)
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
void OnCreatureCreate (Creature *) override
 
void SendUpdateWorldState (uint32 field, uint32 value)
 
virtual void HandleKill (Player *killer, Unit *killed)
 
bool IsInsideObjective (Player *player) const
 
virtual void AwardKillBonus (Player *)
 
uint32 GetTypeId () const
 
virtual bool HandleDropFlag (Player *player, uint32 spellId)
 
virtual bool HandleGossipOption (Player *player, Creature *creature, uint32 gossipid)
 
virtual bool CanTalkTo (Player *player, Creature *c, GossipMenuItems const &gso)
 
void TeamApplyBuff (TeamId team, uint32 spellId, uint32 spellId2=0)
 
void SendDefenseMessage (uint32 zoneId, uint32 id)
 
MapGetMap () const
 
- Public Member Functions inherited from ZoneScript
 ZoneScript ()
 
virtual ~ZoneScript ()
 
virtual uint32 GetCreatureEntry (ObjectGuid::LowType, CreatureData const *data)
 
virtual uint32 GetGameObjectEntry (ObjectGuid::LowType, uint32 entry)
 
virtual void OnCreatureRemove (Creature *)
 
virtual void OnUnitDeath (Unit *)
 
virtual ObjectGuid GetGuidData (uint32) const
 
virtual void SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Private Attributes

uint32 m_AllianceTowersControlled
 
uint32 m_HordeTowersControlled
 

Additional Inherited Members

- Public Types inherited from OutdoorPvP
typedef std::map
< ObjectGuid::LowType,
OPvPCapturePoint * > 
OPvPCapturePointMap
 
- Static Public Member Functions inherited from OutdoorPvP
static TeamId GetTeamIdByTeam (uint32 team)
 
- Protected Member Functions inherited from OutdoorPvP
void BroadcastPacket (WorldPacket const *data) const
 
virtual void HandlePlayerResurrects (Player *player, uint32 zone)
 
void AddCapturePoint (OPvPCapturePoint *cp)
 
OPvPCapturePointGetCapturePoint (ObjectGuid::LowType guid) const
 
void RegisterZone (uint32 zoneid)
 
bool HasPlayer (Player const *player) const
 
void TeamCastSpell (TeamId team, int32 spellId)
 
template<class Worker >
void BroadcastWorker (Worker &_worker, uint32 zoneId)
 
void SetMapFromZone (uint32 zone)
 
- Protected Attributes inherited from OutdoorPvP
OPvPCapturePointMap m_capturePoints
 
GuidSet m_players [2]
 
uint32 m_TypeId
 
bool m_sendUpdate
 
Mapm_map
 

Constructor & Destructor Documentation

OutdoorPvPHP::OutdoorPvPHP ( )
58 {
62 }
uint32 m_HordeTowersControlled
Definition: OutdoorPvPHP.h:134
Definition: OutdoorPvP.h:30
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPHP.h:133
uint32 m_TypeId
Definition: OutdoorPvP.h:273

Member Function Documentation

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

Reimplemented from OutdoorPvP.

149 {
150  packet.Worldstates.emplace_back(uint32(HP_UI_TOWER_DISPLAY_A), 1);
151  packet.Worldstates.emplace_back(uint32(HP_UI_TOWER_DISPLAY_H), 1);
154 
155  for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
156  itr->second->FillInitialWorldStates(packet);
157 }
uint32 m_HordeTowersControlled
Definition: OutdoorPvPHP.h:134
Definition: OutdoorPvPHP.h:65
std::list< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
OPvPCapturePointMap m_capturePoints
Definition: OutdoorPvP.h:269
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPHP.h:133
Definition: OutdoorPvPHP.h:64
Definition: OutdoorPvPHP.h:61
Definition: OutdoorPvPHP.h:62
int32_t int32
Definition: g3dmath.h:167
uint32_t uint32
Definition: g3dmath.h:168
uint32 OutdoorPvPHP::GetAllianceTowersControlled ( ) const
301 {
303 }
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPHP.h:133
uint32 OutdoorPvPHP::GetHordeTowersControlled ( ) const
311 {
313 }
uint32 m_HordeTowersControlled
Definition: OutdoorPvPHP.h:134
void OutdoorPvPHP::HandleKillImpl ( Player player,
Unit killed 
)
overridevirtual

Reimplemented from OutdoorPvP.

290 {
291  if (killed->GetTypeId() != TYPEID_PLAYER)
292  return;
293 
294  if (player->GetTeam() == ALLIANCE && killed->ToPlayer()->GetTeam() != ALLIANCE)
295  player->CastSpell(player, AlliancePlayerKillReward, true);
296  else if (player->GetTeam() == HORDE && killed->ToPlayer()->GetTeam() != HORDE)
297  player->CastSpell(player, HordePlayerKillReward, true);
298 }
Definition: OutdoorPvPHP.h:40
Player * ToPlayer()
Definition: Object.h:191
Definition: SharedDefines.h:1000
TypeID GetTypeId() const
Definition: Object.h:113
Definition: OutdoorPvPHP.h:39
Definition: SharedDefines.h:999
Definition: ObjectGuid.h:33

+ Here is the call graph for this function:

void OutdoorPvPHP::HandlePlayerEnterZone ( Player player,
uint32  zone 
)
overridevirtual

Reimplemented from OutdoorPvP.

84 {
85  // add buffs
86  if (player->GetTeam() == ALLIANCE)
87  {
89  player->CastSpell(player, AllianceBuff, true);
90  }
91  else
92  {
94  player->CastSpell(player, HordeBuff, true);
95  }
97 }
Definition: OutdoorPvPHP.h:41
uint32 m_HordeTowersControlled
Definition: OutdoorPvPHP.h:134
virtual void HandlePlayerEnterZone(Player *player, uint32 zone)
Definition: OutdoorPvP.cpp:257
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPHP.h:133
Definition: SharedDefines.h:1000
Definition: OutdoorPvPHP.h:42

+ Here is the call graph for this function:

void OutdoorPvPHP::HandlePlayerLeaveZone ( Player player,
uint32  zone 
)
overridevirtual

Reimplemented from OutdoorPvP.

100 {
101  // remove buffs
102  if (player->GetTeam() == ALLIANCE)
103  {
104  player->RemoveAurasDueToSpell(AllianceBuff);
105  }
106  else
107  {
108  player->RemoveAurasDueToSpell(HordeBuff);
109  }
110  OutdoorPvP::HandlePlayerLeaveZone(player, zone);
111 }
Definition: OutdoorPvPHP.h:41
Definition: SharedDefines.h:1000
Definition: OutdoorPvPHP.h:42
virtual void HandlePlayerLeaveZone(Player *player, uint32 zone)
Definition: OutdoorPvP.cpp:262

+ Here is the call graph for this function:

void OutdoorPvPHP::SendRemoveWorldStates ( Player player)
overridevirtual

Reimplemented from OutdoorPvP.

134 {
135  player->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_A, 0);
136  player->SendUpdateWorldState(HP_UI_TOWER_DISPLAY_H, 0);
137  player->SendUpdateWorldState(HP_UI_TOWER_COUNT_H, 0);
138  player->SendUpdateWorldState(HP_UI_TOWER_COUNT_A, 0);
139 
140  for (int i = 0; i < HP_TOWER_NUM; ++i)
141  {
142  player->SendUpdateWorldState(HP_MAP_N[i], 0);
143  player->SendUpdateWorldState(HP_MAP_A[i], 0);
144  player->SendUpdateWorldState(HP_MAP_H[i], 0);
145  }
146 }
const uint32 HP_MAP_N[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:68
Definition: OutdoorPvPHP.h:65
const uint32 HP_MAP_H[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:72
Definition: OutdoorPvPHP.h:64
Definition: OutdoorPvPHP.h:61
Definition: OutdoorPvPHP.h:62
const uint32 HP_MAP_A[HP_TOWER_NUM]
Definition: OutdoorPvPHP.h:70
Definition: OutdoorPvPHP.h:50
void OutdoorPvPHP::SetAllianceTowersControlled ( uint32  count)
306 {
308 }
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPHP.h:133
void OutdoorPvPHP::SetHordeTowersControlled ( uint32  count)
316 {
317  m_HordeTowersControlled = count;
318 }
uint32 m_HordeTowersControlled
Definition: OutdoorPvPHP.h:134
bool OutdoorPvPHP::SetupOutdoorPvP ( )
overridevirtual

Reimplemented from OutdoorPvP.

65 {
69 
70  // add the zones affected by the pvp buff
71  for (int i = 0; i < OutdoorPvPHPBuffZonesNum; ++i)
73 
75 
77 
79 
80  return true;
81 }
Definition: OutdoorPvPHP.h:47
uint32 m_HordeTowersControlled
Definition: OutdoorPvPHP.h:134
void SetMapFromZone(uint32 zone)
Definition: OutdoorPvP.cpp:651
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPHP.h:133
Definition: OutdoorPvPHP.h:48
void RegisterZone(uint32 zoneid)
Definition: OutdoorPvP.cpp:583
void AddCapturePoint(OPvPCapturePoint *cp)
Definition: OutdoorPvP.cpp:564
Definition: OutdoorPvPHP.h:94
#define OutdoorPvPHPBuffZonesNum
Definition: OutdoorPvPHP.h:33
Definition: OutdoorPvPHP.h:49
const uint32 OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum]
Definition: OutdoorPvPHP.h:35

+ Here is the call graph for this function:

bool OutdoorPvPHP::Update ( uint32  diff)
overridevirtual

Reimplemented from OutdoorPvP.

114 {
115  bool changed = OutdoorPvP::Update(diff);
116  if (changed)
117  {
120  else if (m_HordeTowersControlled == 3)
122  else
123  {
126  }
129  }
130  return changed;
131 }
void TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2=0)
Definition: OutdoorPvP.cpp:610
Definition: OutdoorPvPHP.h:41
void TeamCastSpell(TeamId team, int32 spellId)
Definition: OutdoorPvP.cpp:594
uint32 m_HordeTowersControlled
Definition: OutdoorPvPHP.h:134
Definition: OutdoorPvPHP.h:65
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPHP.h:133
Definition: OutdoorPvPHP.h:64
Definition: OutdoorPvPHP.h:42
Definition: SharedDefines.h:992
virtual bool Update(uint32 diff)
Definition: OutdoorPvP.cpp:276
Definition: SharedDefines.h:993
void SendUpdateWorldState(uint32 field, uint32 value)
Definition: OutdoorPvP.cpp:409

+ Here is the call graph for this function:

Member Data Documentation

uint32 OutdoorPvPHP::m_AllianceTowersControlled
private
uint32 OutdoorPvPHP::m_HordeTowersControlled
private

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