AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
OutdoorPvPZM Class Reference

#include "OutdoorPvPZM.h"

Inheritance diagram for OutdoorPvPZM:
OutdoorPvP ZoneScript

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 (WorldPacket &data) 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 ()=default
 
 ~OutdoorPvP () override
 
void DeleteSpawns ()
 
virtual void FillInitialWorldStates (WorldPacket &)
 
virtual bool HandleAreaTrigger (Player *player, uint32 trigger)
 
virtual bool HandleCustomSpell (Player *player, uint32 spellId, GameObject *go)
 
virtual bool HandleOpenGo (Player *player, GameObject *go)
 
virtual bool SetupOutdoorPvP ()
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
void OnCreatureCreate (Creature *creature) override
 
void OnCreatureRemove (Creature *creature) override
 
void SendUpdateWorldState (uint32 field, uint32 value)
 
virtual bool Update (uint32 diff)
 
virtual void HandleKill (Player *killer, Unit *killed)
 
virtual void HandleKillImpl (Player *, Unit *)
 
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 teamId, uint32 spellId, uint32 spellId2=0, Player *sameMapPlr=nullptr)
 
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 OnCreatureCreate (Creature *)
 
virtual void OnCreatureRemove (Creature *)
 
virtual void OnGameObjectCreate (GameObject *)
 
virtual void OnGameObjectRemove (GameObject *)
 
virtual void OnUnitDeath (Unit *)
 
virtual void OnCreatureEvade (Creature *)
 
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
 
typedef std::pair< ObjectGuid::LowType, GameObject * > GoScriptPair
 
typedef std::pair< ObjectGuid::LowType, Creature * > CreatureScriptPair
 
- Protected Member Functions inherited from OutdoorPvP
void BroadcastPacket (WorldPacket &data) const
 
virtual void SendRemoveWorldStates (Player *)
 
virtual void HandlePlayerEnterZone (Player *player, uint32 zone)
 
virtual void HandlePlayerLeaveZone (Player *player, uint32 zone)
 
virtual void HandlePlayerResurrects (Player *player, uint32 zone)
 
void AddCapturePoint (OPvPCapturePoint *cp)
 
OPvPCapturePointGetCapturePoint (ObjectGuid::LowType spawnId) const
 
void RegisterZone (uint32 zoneid)
 
bool HasPlayer (Player const *player) const
 
void TeamCastSpell (TeamId team, int32 spellId, Player *sameMapPlr=nullptr)
 
void SetMapFromZone (uint32 zone)
 
- Protected Attributes inherited from OutdoorPvP
OPvPCapturePointMap _capturePoints
 
std::array< PlayerSet, 2 > _players
 
uint32 _typeId {}
 
bool _sendUpdate { true }
 
Map_map {}
 
std::unordered_map< ObjectGuid::LowType, GameObject * > _goScriptStore
 
std::unordered_map< ObjectGuid::LowType, Creature * > _creatureScriptStore
 

Detailed Description

Constructor & Destructor Documentation

◆ OutdoorPvPZM()

OutdoorPvPZM::OutdoorPvPZM ( )
174{
176 m_GraveYard = nullptr;
179}
@ OUTDOOR_PVP_ZM
Definition: OutdoorPvP.h:32
uint32 _typeId
Definition: OutdoorPvP.h:269
uint32 m_HordeTowersControlled
Definition: OutdoorPvPZM.h:259
OPvPCapturePointZM_GraveYard * m_GraveYard
Definition: OutdoorPvPZM.h:256
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPZM.h:258

References OutdoorPvP::_typeId, m_AllianceTowersControlled, m_GraveYard, m_HordeTowersControlled, and OUTDOOR_PVP_ZM.

Member Function Documentation

◆ FillInitialWorldStates()

void OutdoorPvPZM::FillInitialWorldStates ( WorldPacket data)
overridevirtual

Reimplemented from OutdoorPvP.

417{
418 data << ZM_WORLDSTATE_UNK_1 << uint32(1);
419 for (OPvPCapturePointMap::iterator itr = _capturePoints.begin(); itr != _capturePoints.end(); ++itr)
420 {
421 itr->second->FillInitialWorldStates(data);
422 }
423}
std::uint32_t uint32
Definition: Define.h:107
@ ZM_WORLDSTATE_UNK_1
Definition: OutdoorPvPZM.h:135
OPvPCapturePointMap _capturePoints
Definition: OutdoorPvP.h:267

References OutdoorPvP::_capturePoints, and ZM_WORLDSTATE_UNK_1.

◆ GetAllianceTowersControlled()

uint32 OutdoorPvPZM::GetAllianceTowersControlled ( ) const
397{
399}

References m_AllianceTowersControlled.

◆ GetHordeTowersControlled()

uint32 OutdoorPvPZM::GetHordeTowersControlled ( ) const
407{
409}

References m_HordeTowersControlled.

◆ HandleKillImpl()

void OutdoorPvPZM::HandleKillImpl ( Player player,
Unit killed 
)
overridevirtual

Reimplemented from OutdoorPvP.

201{
202 if (!killed->IsPlayer())
203 return;
204
205 if (player->GetTeamId() == TEAM_ALLIANCE && killed->ToPlayer()->GetTeamId() != TEAM_ALLIANCE)
206 player->CastSpell(player, ZM_AlliancePlayerKillReward, true);
207 else if (player->GetTeamId() == TEAM_HORDE && killed->ToPlayer()->GetTeamId() != TEAM_HORDE)
208 player->CastSpell(player, ZM_HordePlayerKillReward, true);
209}
@ ZM_AlliancePlayerKillReward
Definition: OutdoorPvPZM.h:44
@ ZM_HordePlayerKillReward
Definition: OutdoorPvPZM.h:46
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ TEAM_HORDE
Definition: SharedDefines.h:761
bool IsPlayer() const
Definition: Object.h:200
Player * ToPlayer()
Definition: Object.h:201
TeamId GetTeamId(bool original=false) const
Definition: Player.h:2108
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1167

References Unit::CastSpell(), Player::GetTeamId(), Object::IsPlayer(), TEAM_ALLIANCE, TEAM_HORDE, Object::ToPlayer(), ZM_AlliancePlayerKillReward, and ZM_HordePlayerKillReward.

◆ HandlePlayerEnterZone()

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

Reimplemented from OutdoorPvP.

149{
150 if (player->GetTeamId() == TEAM_ALLIANCE)
151 {
153 player->CastSpell(player, ZM_CAPTURE_BUFF, true);
154 }
155 else
156 {
158 player->CastSpell(player, ZM_CAPTURE_BUFF, true);
159 }
161}
@ ZM_GRAVEYARD_H
Definition: OutdoorPvPZM.h:195
@ ZM_GRAVEYARD_A
Definition: OutdoorPvPZM.h:194
@ ZM_CAPTURE_BUFF
Definition: OutdoorPvPZM.h:38
virtual void HandlePlayerEnterZone(Player *player, uint32 zone)
Definition: OutdoorPvP.cpp:277
uint32 GetGraveYardState() const
Definition: OutdoorPvPZM.cpp:391

References Unit::CastSpell(), OPvPCapturePointZM_GraveYard::GetGraveYardState(), Player::GetTeamId(), OutdoorPvP::HandlePlayerEnterZone(), m_GraveYard, TEAM_ALLIANCE, ZM_CAPTURE_BUFF, ZM_GRAVEYARD_A, and ZM_GRAVEYARD_H.

◆ HandlePlayerLeaveZone()

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

Reimplemented from OutdoorPvP.

164{
165 // remove buffs
167 // remove flag
171}
@ ZM_BATTLE_STANDARD_H
Definition: OutdoorPvPZM.h:42
@ ZM_BATTLE_STANDARD_A
Definition: OutdoorPvPZM.h:40
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
virtual void HandlePlayerLeaveZone(Player *player, uint32 zone)
Definition: OutdoorPvP.cpp:282

References OutdoorPvP::HandlePlayerLeaveZone(), Unit::RemoveAurasDueToSpell(), ZM_BATTLE_STANDARD_A, ZM_BATTLE_STANDARD_H, and ZM_CAPTURE_BUFF.

◆ SendRemoveWorldStates()

void OutdoorPvPZM::SendRemoveWorldStates ( Player player)
overridevirtual

Reimplemented from OutdoorPvP.

426{
453}
@ ZM_MAP_TOWER_EAST_A
Definition: OutdoorPvPZM.h:146
@ ZM_MAP_HORDE_FLAG_NOT_READY
Definition: OutdoorPvPZM.h:155
@ ZM_UI_TOWER_WEST_N
Definition: OutdoorPvPZM.h:140
@ ZM_UI_TOWER_WEST_A
Definition: OutdoorPvPZM.h:142
@ ZM_UI_TOWER_SLIDER_N_W
Definition: OutdoorPvPZM.h:127
@ ZM_UI_TOWER_SLIDER_POS_W
Definition: OutdoorPvPZM.h:128
@ ZM_MAP_ALLIANCE_FLAG_READY
Definition: OutdoorPvPZM.h:157
@ ZM_MAP_GRAVEYARD_A
Definition: OutdoorPvPZM.h:148
@ ZM_MAP_TOWER_WEST_N
Definition: OutdoorPvPZM.h:150
@ ZM_MAP_TOWER_WEST_A
Definition: OutdoorPvPZM.h:152
@ ZM_UI_TOWER_SLIDER_DISPLAY_W
Definition: OutdoorPvPZM.h:129
@ ZM_MAP_GRAVEYARD_N
Definition: OutdoorPvPZM.h:149
@ ZM_MAP_GRAVEYARD_H
Definition: OutdoorPvPZM.h:147
@ ZM_UI_TOWER_EAST_H
Definition: OutdoorPvPZM.h:138
@ ZM_MAP_TOWER_EAST_N
Definition: OutdoorPvPZM.h:144
@ ZM_UI_TOWER_SLIDER_POS_E
Definition: OutdoorPvPZM.h:132
@ ZM_UI_TOWER_SLIDER_DISPLAY_E
Definition: OutdoorPvPZM.h:133
@ ZM_UI_TOWER_WEST_H
Definition: OutdoorPvPZM.h:141
@ ZM_MAP_TOWER_WEST_H
Definition: OutdoorPvPZM.h:151
@ ZM_MAP_HORDE_FLAG_READY
Definition: OutdoorPvPZM.h:154
@ ZM_UI_TOWER_SLIDER_N_E
Definition: OutdoorPvPZM.h:131
@ ZM_MAP_ALLIANCE_FLAG_NOT_READY
Definition: OutdoorPvPZM.h:156
@ ZM_UI_TOWER_EAST_A
Definition: OutdoorPvPZM.h:139
@ ZM_UI_TOWER_EAST_N
Definition: OutdoorPvPZM.h:137
@ ZM_MAP_TOWER_EAST_H
Definition: OutdoorPvPZM.h:145
void SendUpdateWorldState(uint32 variable, uint32 value) const
Definition: PlayerUpdates.cpp:2197

References Player::SendUpdateWorldState(), ZM_MAP_ALLIANCE_FLAG_NOT_READY, ZM_MAP_ALLIANCE_FLAG_READY, ZM_MAP_GRAVEYARD_A, ZM_MAP_GRAVEYARD_H, ZM_MAP_GRAVEYARD_N, ZM_MAP_HORDE_FLAG_NOT_READY, ZM_MAP_HORDE_FLAG_READY, ZM_MAP_TOWER_EAST_A, ZM_MAP_TOWER_EAST_H, ZM_MAP_TOWER_EAST_N, ZM_MAP_TOWER_WEST_A, ZM_MAP_TOWER_WEST_H, ZM_MAP_TOWER_WEST_N, ZM_UI_TOWER_EAST_A, ZM_UI_TOWER_EAST_H, ZM_UI_TOWER_EAST_N, ZM_UI_TOWER_SLIDER_DISPLAY_E, ZM_UI_TOWER_SLIDER_DISPLAY_W, ZM_UI_TOWER_SLIDER_N_E, ZM_UI_TOWER_SLIDER_N_W, ZM_UI_TOWER_SLIDER_POS_E, ZM_UI_TOWER_SLIDER_POS_W, ZM_UI_TOWER_WEST_A, ZM_UI_TOWER_WEST_H, ZM_UI_TOWER_WEST_N, and ZM_WORLDSTATE_UNK_1.

◆ SetAllianceTowersControlled()

void OutdoorPvPZM::SetAllianceTowersControlled ( uint32  count)
402{
404}

References m_AllianceTowersControlled.

◆ SetHordeTowersControlled()

void OutdoorPvPZM::SetHordeTowersControlled ( uint32  count)
412{
414}

References m_HordeTowersControlled.

◆ SetupOutdoorPvP()

bool OutdoorPvPZM::SetupOutdoorPvP ( )
overridevirtual

Reimplemented from OutdoorPvP.

182{
185
186 // add the zones affected by the pvp buff
187 for (uint8 i = 0; i < OutdoorPvPZMBuffZonesNum; ++i)
189
191
195 AddCapturePoint(m_GraveYard); // though the update function isn't used, the handleusego is!
196
197 return true;
198}
std::uint8_t uint8
Definition: Define.h:109
const uint32 OutdoorPvPZMBuffZones[OutdoorPvPZMBuffZonesNum]
Definition: OutdoorPvPZM.h:27
@ ZM_BEACON_EAST
Definition: OutdoorPvPZM.h:84
@ ZM_BEACON_WEST
Definition: OutdoorPvPZM.h:85
const uint8 OutdoorPvPZMBuffZonesNum
Definition: OutdoorPvPZM.h:24
void RegisterZone(uint32 zoneid)
Definition: OutdoorPvP.cpp:641
void SetMapFromZone(uint32 zone)
Definition: OutdoorPvP.cpp:718
void AddCapturePoint(OPvPCapturePoint *cp)
Definition: OutdoorPvP.h:253
Definition: OutdoorPvPZM.h:170
Definition: OutdoorPvPZM.h:199

References OutdoorPvP::AddCapturePoint(), m_AllianceTowersControlled, m_GraveYard, m_HordeTowersControlled, OutdoorPvPZMBuffZones, OutdoorPvPZMBuffZonesNum, OutdoorPvP::RegisterZone(), OutdoorPvP::SetMapFromZone(), ZM_BEACON_EAST, and ZM_BEACON_WEST.

◆ Update()

bool OutdoorPvPZM::Update ( uint32  diff)
overridevirtual

Reimplemented from OutdoorPvP.

134{
135 bool changed = OutdoorPvP::Update(diff);
136 if (changed)
137 {
142 else
144 }
145 return changed;
146}
@ ZM_NUM_BEACONS
Definition: OutdoorPvPZM.h:86
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
virtual bool Update(uint32 diff)
Definition: OutdoorPvP.cpp:304
void SetBeaconState(TeamId controlling_teamId)
Definition: OutdoorPvPZM.cpp:291

References m_AllianceTowersControlled, m_GraveYard, m_HordeTowersControlled, OPvPCapturePointZM_GraveYard::SetBeaconState(), TEAM_ALLIANCE, TEAM_HORDE, TEAM_NEUTRAL, OutdoorPvP::Update(), and ZM_NUM_BEACONS.

Member Data Documentation

◆ m_AllianceTowersControlled

uint32 OutdoorPvPZM::m_AllianceTowersControlled
private

◆ m_GraveYard

OPvPCapturePointZM_GraveYard* OutdoorPvPZM::m_GraveYard
private

◆ m_HordeTowersControlled

uint32 OutdoorPvPZM::m_HordeTowersControlled
private