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

#include <OutdoorPvPZM.h>

Public Member Functions

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

OPvPCapturePointZM_GraveYardm_GraveYard
 
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

OutdoorPvPZM::OutdoorPvPZM ( )
143 {
145  m_GraveYard = NULL;
148 }
OPvPCapturePointZM_GraveYard * m_GraveYard
Definition: OutdoorPvPZM.h:241
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPZM.h:243
uint32 m_TypeId
Definition: OutdoorPvP.h:273
Definition: OutdoorPvP.h:33
uint32 m_HordeTowersControlled
Definition: OutdoorPvPZM.h:244

Member Function Documentation

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

Reimplemented from OutdoorPvP.

379 {
380  packet.Worldstates.emplace_back(uint32(ZM_WORLDSTATE_UNK_1), 1);
381  for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
382  itr->second->FillInitialWorldStates(packet);
383 }
std::list< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
OPvPCapturePointMap m_capturePoints
Definition: OutdoorPvP.h:269
Definition: OutdoorPvPZM.h:125
uint32_t uint32
Definition: g3dmath.h:168
uint32 OutdoorPvPZM::GetAllianceTowersControlled ( ) const
359 {
361 }
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPZM.h:243
uint32 OutdoorPvPZM::GetHordeTowersControlled ( ) const
369 {
371 }
uint32 m_HordeTowersControlled
Definition: OutdoorPvPZM.h:244
void OutdoorPvPZM::HandleKillImpl ( Player player,
Unit killed 
)
overridevirtual

Reimplemented from OutdoorPvP.

170 {
171  if (killed->GetTypeId() != TYPEID_PLAYER)
172  return;
173 
174  if (player->GetTeam() == ALLIANCE && killed->ToPlayer()->GetTeam() != ALLIANCE)
175  player->CastSpell(player, ZM_AlliancePlayerKillReward, true);
176  else if (player->GetTeam() == HORDE && killed->ToPlayer()->GetTeam() != HORDE)
177  player->CastSpell(player, ZM_HordePlayerKillReward, true);
178 }
Definition: OutdoorPvPZM.h:59
Player * ToPlayer()
Definition: Object.h:191
Definition: SharedDefines.h:1000
TypeID GetTypeId() const
Definition: Object.h:113
Definition: SharedDefines.h:999
Definition: ObjectGuid.h:33
Definition: OutdoorPvPZM.h:57

+ Here is the call graph for this function:

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

Reimplemented from OutdoorPvP.

118 {
119  if (player->GetTeam() == ALLIANCE)
120  {
122  player->CastSpell(player, ZM_CAPTURE_BUFF, true);
123  }
124  else
125  {
127  player->CastSpell(player, ZM_CAPTURE_BUFF, true);
128  }
129  OutdoorPvP::HandlePlayerEnterZone(player, zone);
130 }
Definition: OutdoorPvPZM.h:51
OPvPCapturePointZM_GraveYard * m_GraveYard
Definition: OutdoorPvPZM.h:241
virtual void HandlePlayerEnterZone(Player *player, uint32 zone)
Definition: OutdoorPvP.cpp:257
Definition: OutdoorPvPZM.h:178
Definition: SharedDefines.h:1000
uint32 GetGraveYardState() const
Definition: OutdoorPvPZM.cpp:353
Definition: OutdoorPvPZM.h:179

+ Here is the call graph for this function:

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

Reimplemented from OutdoorPvP.

133 {
134  // remove buffs
135  player->RemoveAurasDueToSpell(ZM_CAPTURE_BUFF);
136  // remove flag
137  player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
138  player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
139  OutdoorPvP::HandlePlayerLeaveZone(player, zone);
140 }
Definition: OutdoorPvPZM.h:51
Definition: OutdoorPvPZM.h:53
virtual void HandlePlayerLeaveZone(Player *player, uint32 zone)
Definition: OutdoorPvP.cpp:262
Definition: OutdoorPvPZM.h:55

+ Here is the call graph for this function:

void OutdoorPvPZM::SendRemoveWorldStates ( Player player)
overridevirtual

Reimplemented from OutdoorPvP.

386 {
387  player->SendUpdateWorldState(ZM_WORLDSTATE_UNK_1, 1);
388  player->SendUpdateWorldState(ZM_UI_TOWER_EAST_N, 0);
389  player->SendUpdateWorldState(ZM_UI_TOWER_EAST_H, 0);
390  player->SendUpdateWorldState(ZM_UI_TOWER_EAST_A, 0);
391  player->SendUpdateWorldState(ZM_UI_TOWER_WEST_N, 0);
392  player->SendUpdateWorldState(ZM_UI_TOWER_WEST_H, 0);
393  player->SendUpdateWorldState(ZM_UI_TOWER_WEST_A, 0);
394  player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_N, 0);
395  player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_H, 0);
396  player->SendUpdateWorldState(ZM_MAP_TOWER_EAST_A, 0);
397  player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_H, 0);
398  player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_A, 0);
399  player->SendUpdateWorldState(ZM_MAP_GRAVEYARD_N, 0);
400  player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_N, 0);
401  player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_H, 0);
402  player->SendUpdateWorldState(ZM_MAP_TOWER_WEST_A, 0);
403  player->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_READY, 0);
404  player->SendUpdateWorldState(ZM_MAP_HORDE_FLAG_NOT_READY, 0);
405  player->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_NOT_READY, 0);
406  player->SendUpdateWorldState(ZM_MAP_ALLIANCE_FLAG_READY, 0);
407 }
Definition: OutdoorPvPZM.h:141
Definition: OutdoorPvPZM.h:130
Definition: OutdoorPvPZM.h:142
Definition: OutdoorPvPZM.h:129
Definition: OutdoorPvPZM.h:128
Definition: OutdoorPvPZM.h:145
Definition: OutdoorPvPZM.h:125
Definition: OutdoorPvPZM.h:146
Definition: OutdoorPvPZM.h:147
Definition: OutdoorPvPZM.h:137
Definition: OutdoorPvPZM.h:131
Definition: OutdoorPvPZM.h:135
Definition: OutdoorPvPZM.h:139
Definition: OutdoorPvPZM.h:144
Definition: OutdoorPvPZM.h:127
Definition: OutdoorPvPZM.h:138
Definition: OutdoorPvPZM.h:132
Definition: OutdoorPvPZM.h:136
Definition: OutdoorPvPZM.h:134
Definition: OutdoorPvPZM.h:140
void OutdoorPvPZM::SetAllianceTowersControlled ( uint32  count)
364 {
366 }
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPZM.h:243
void OutdoorPvPZM::SetHordeTowersControlled ( uint32  count)
374 {
375  m_HordeTowersControlled = count;
376 }
uint32 m_HordeTowersControlled
Definition: OutdoorPvPZM.h:244
bool OutdoorPvPZM::SetupOutdoorPvP ( )
overridevirtual

Reimplemented from OutdoorPvP.

151 {
154 
156 
157  // add the zones affected by the pvp buff
158  for (uint8 i = 0; i < OutdoorPvPZMBuffZonesNum; ++i)
160 
164  AddCapturePoint(m_GraveYard); // though the update function isn't used, the handleusego is!
165 
166  return true;
167 }
OPvPCapturePointZM_GraveYard * m_GraveYard
Definition: OutdoorPvPZM.h:241
const uint32 OutdoorPvPZMBuffZones[OutdoorPvPZMBuffZonesNum]
Definition: OutdoorPvPZM.h:40
void SetMapFromZone(uint32 zone)
Definition: OutdoorPvP.cpp:651
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPZM.h:243
Definition: OutdoorPvPZM.h:182
Definition: OutdoorPvPZM.h:95
void RegisterZone(uint32 zoneid)
Definition: OutdoorPvP.cpp:583
void AddCapturePoint(OPvPCapturePoint *cp)
Definition: OutdoorPvP.cpp:564
const uint8 OutdoorPvPZMBuffZonesNum
Definition: OutdoorPvPZM.h:37
Definition: OutdoorPvPZM.h:94
uint8_t uint8
Definition: Define.h:152
Definition: OutdoorPvPZM.h:159
uint32 m_HordeTowersControlled
Definition: OutdoorPvPZM.h:244

+ Here is the call graph for this function:

bool OutdoorPvPZM::Update ( uint32  diff)
overridevirtual

Reimplemented from OutdoorPvP.

103 {
104  bool changed = OutdoorPvP::Update(diff);
105  if (changed)
106  {
111  else
113  }
114  return changed;
115 }
void SetBeaconState(uint32 controlling_team)
Definition: OutdoorPvPZM.cpp:256
Definition: OutdoorPvPZM.h:96
OPvPCapturePointZM_GraveYard * m_GraveYard
Definition: OutdoorPvPZM.h:241
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPZM.h:243
Definition: SharedDefines.h:1000
Definition: SharedDefines.h:999
virtual bool Update(uint32 diff)
Definition: OutdoorPvP.cpp:276
uint32 m_HordeTowersControlled
Definition: OutdoorPvPZM.h:244

+ Here is the call graph for this function:

Member Data Documentation

uint32 OutdoorPvPZM::m_AllianceTowersControlled
private
OPvPCapturePointZM_GraveYard* OutdoorPvPZM::m_GraveYard
private
uint32 OutdoorPvPZM::m_HordeTowersControlled
private

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