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

#include "OutdoorPvPZM.h"

Inheritance diagram for OPvPCapturePointZM_GraveYard:
OPvPCapturePoint

Public Member Functions

 OPvPCapturePointZM_GraveYard (OutdoorPvP *pvp)
 
bool Update (uint32 diff) override
 
void ChangeState () override
 
void FillInitialWorldStates (WorldPacket &data) override
 
void UpdateTowerState ()
 
int32 HandleOpenGo (Player *player, GameObject *go) override
 
void SetBeaconState (TeamId controlling_teamId)
 
bool HandleGossipOption (Player *player, Creature *creature, uint32 gossipid) override
 
bool HandleDropFlag (Player *player, uint32 spellId) override
 
bool CanTalkTo (Player *player, Creature *creature, GossipMenuItems const &gso) override
 
uint32 GetGraveYardState () const
 
- Public Member Functions inherited from OPvPCapturePoint
 OPvPCapturePoint (OutdoorPvP *pvp)
 
virtual ~OPvPCapturePoint ()=default
 
virtual void FillInitialWorldStates (WorldPacket &)
 
void SendUpdateWorldState (uint32 field, uint32 value)
 
void SendObjectiveComplete (uint32 id, ObjectGuid guid=ObjectGuid::Empty)
 
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 ChangeState ()=0
 
virtual void ChangeTeam (TeamId)
 
virtual void SendChangePhase ()
 
virtual bool HandleGossipOption (Player *player, Creature *creature, uint32 gossipId)
 
virtual bool CanTalkTo (Player *player, Creature *c, GossipMenuItems const &gso)
 
virtual bool HandleDropFlag (Player *player, uint32 spellId)
 
virtual void DeleteSpawns ()
 
void AddGO (uint32 type, ObjectGuid::LowType guid, uint32 entry=0)
 
void AddCre (uint32 type, ObjectGuid::LowType guid, uint32 entry=0)
 
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)
 
void SetSlider (float slider)
 
float GetSlider () const
 

Protected Attributes

TeamId m_BothControllingFactionId
 
ObjectGuid m_FlagCarrierGUID
 
- Protected Attributes inherited from OPvPCapturePoint
std::array< PlayerSet, 2 > _activePlayers
 
float _maxValue {}
 
float _minValue {}
 
float _maxSpeed {}
 
float _value {}
 
TeamId _team { TEAM_NEUTRAL }
 
ObjectiveStates _oldState { OBJECTIVESTATE_NEUTRAL }
 
ObjectiveStates _state { OBJECTIVESTATE_NEUTRAL }
 
uint32 _neutralValuePct {}
 
OutdoorPvP_pvp {}
 
std::unordered_map< uint32, ObjectGuid::LowType_objects
 
std::unordered_map< uint32, ObjectGuid::LowType_creatures
 
std::unordered_map< ObjectGuid::LowType, uint32_objectTypes
 
std::unordered_map< ObjectGuid::LowType, uint32_creatureTypes
 

Private Attributes

uint32 m_GraveYardState
 

Additional Inherited Members

- Public Attributes inherited from OPvPCapturePoint
ObjectGuid::LowType m_capturePointSpawnId {}
 
GameObject_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)
 
bool AddCreature (uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, uint32 spawntimeDelay=0)
 
bool DelCreature (uint32 type)
 
bool DelObject (uint32 type)
 
bool DelCapturePoint ()
 

Detailed Description

Constructor & Destructor Documentation

◆ OPvPCapturePointZM_GraveYard()

OPvPCapturePointZM_GraveYard::OPvPCapturePointZM_GraveYard ( OutdoorPvP pvp)
255 : OPvPCapturePoint(pvp)
256{
260 // add field scouts here
263 // add neutral banner
265}
const creature_type ZM_AllianceFieldScout
Definition: OutdoorPvPZM.h:58
@ ZM_GRAVEYARD_N
Definition: OutdoorPvPZM.h:193
const go_type ZM_Banner_N
Definition: OutdoorPvPZM.h:52
const creature_type ZM_HordeFieldScout
Definition: OutdoorPvPZM.h:55
@ ZM_HORDE_FIELD_SCOUT
Definition: OutdoorPvPZM.h:63
@ ZM_ALLIANCE_FIELD_SCOUT
Definition: OutdoorPvPZM.h:62
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
void Clear()
Definition: ObjectGuid.h:138
float x
Definition: OutdoorPvP.h:56
uint32 map
Definition: OutdoorPvP.h:55
uint32 entry
Definition: OutdoorPvP.h:54
float o
Definition: OutdoorPvP.h:59
float z
Definition: OutdoorPvP.h:58
float rot3
Definition: OutdoorPvP.h:63
float rot0
Definition: OutdoorPvP.h:60
float rot1
Definition: OutdoorPvP.h:61
float y
Definition: OutdoorPvP.h:57
float rot2
Definition: OutdoorPvP.h:62
float y
Definition: OutdoorPvP.h:72
float x
Definition: OutdoorPvP.h:71
uint32 entry
Definition: OutdoorPvP.h:69
float o
Definition: OutdoorPvP.h:74
uint32 map
Definition: OutdoorPvP.h:70
float z
Definition: OutdoorPvP.h:73
Definition: OutdoorPvP.h:90
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:105
bool AddCreature(uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, uint32 spawntimeDelay=0)
Definition: OutdoorPvP.cpp:116
ObjectGuid m_FlagCarrierGUID
Definition: OutdoorPvPZM.h:228
TeamId m_BothControllingFactionId
Definition: OutdoorPvPZM.h:227
uint32 m_GraveYardState
Definition: OutdoorPvPZM.h:224

References OPvPCapturePoint::AddCreature(), OPvPCapturePoint::AddObject(), ObjectGuid::Clear(), go_type::entry, creature_type::entry, m_BothControllingFactionId, m_FlagCarrierGUID, m_GraveYardState, go_type::map, creature_type::map, go_type::o, creature_type::o, go_type::rot0, go_type::rot1, go_type::rot2, go_type::rot3, TEAM_NEUTRAL, go_type::x, creature_type::x, go_type::y, creature_type::y, go_type::z, creature_type::z, ZM_ALLIANCE_FIELD_SCOUT, ZM_AllianceFieldScout, ZM_Banner_N, ZM_GRAVEYARD_N, ZM_HORDE_FIELD_SCOUT, and ZM_HordeFieldScout.

Member Function Documentation

◆ CanTalkTo()

bool OPvPCapturePointZM_GraveYard::CanTalkTo ( Player player,
Creature creature,
GossipMenuItems const &  gso 
)
overridevirtual

Reimplemented from OPvPCapturePoint.

337{
338 ObjectGuid guid = c->GetGUID();
339 auto itr = _creatureTypes.find(guid.GetCounter());
340 if (itr != _creatureTypes.end())
341 {
343 return true;
345 return true;
346 }
347 return false;
348}
@ ZM_GRAVEYARD_H
Definition: OutdoorPvPZM.h:195
@ ZM_GRAVEYARD_A
Definition: OutdoorPvPZM.h:194
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ TEAM_HORDE
Definition: SharedDefines.h:761
Definition: ObjectGuid.h:118
LowType GetCounter() const
Definition: ObjectGuid.h:145
TeamId GetTeamId(bool original=false) const
Definition: Player.h:2108
std::unordered_map< ObjectGuid::LowType, uint32 > _creatureTypes
Definition: OutdoorPvP.h:180

References OPvPCapturePoint::_creatureTypes, ObjectGuid::GetCounter(), Object::GetGUID(), Player::GetTeamId(), m_BothControllingFactionId, m_FlagCarrierGUID, m_GraveYardState, TEAM_ALLIANCE, TEAM_HORDE, ZM_ALLIANCE_FIELD_SCOUT, ZM_GRAVEYARD_A, ZM_GRAVEYARD_H, and ZM_HORDE_FIELD_SCOUT.

◆ ChangeState()

void OPvPCapturePointZM_GraveYard::ChangeState ( )
inlineoverridevirtual

Implements OPvPCapturePoint.

205{}

◆ FillInitialWorldStates()

void OPvPCapturePointZM_GraveYard::FillInitialWorldStates ( WorldPacket data)
overridevirtual

Reimplemented from OPvPCapturePoint.

280{
284
289}
std::uint32_t uint32
Definition: Define.h:107
@ ZM_MAP_HORDE_FLAG_NOT_READY
Definition: OutdoorPvPZM.h:155
@ ZM_MAP_ALLIANCE_FLAG_READY
Definition: OutdoorPvPZM.h:157
@ ZM_MAP_GRAVEYARD_A
Definition: OutdoorPvPZM.h:148
@ ZM_MAP_GRAVEYARD_N
Definition: OutdoorPvPZM.h:149
@ ZM_MAP_GRAVEYARD_H
Definition: OutdoorPvPZM.h:147
@ ZM_MAP_HORDE_FLAG_READY
Definition: OutdoorPvPZM.h:154
@ ZM_MAP_ALLIANCE_FLAG_NOT_READY
Definition: OutdoorPvPZM.h:156

References m_BothControllingFactionId, m_GraveYardState, TEAM_ALLIANCE, TEAM_HORDE, ZM_GRAVEYARD_A, ZM_GRAVEYARD_H, ZM_GRAVEYARD_N, 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, and ZM_MAP_HORDE_FLAG_READY.

◆ GetGraveYardState()

uint32 OPvPCapturePointZM_GraveYard::GetGraveYardState ( ) const
392{
393 return m_GraveYardState;
394}

References m_GraveYardState.

Referenced by OutdoorPvPZM::HandlePlayerEnterZone().

◆ HandleDropFlag()

bool OPvPCapturePointZM_GraveYard::HandleDropFlag ( Player player,
uint32  spellId 
)
overridevirtual

Reimplemented from OPvPCapturePoint.

378{
379 switch (spellId)
380 {
383 return true;
386 return true;
387 }
388 return false;
389}
@ ZM_BATTLE_STANDARD_H
Definition: OutdoorPvPZM.h:42
@ ZM_BATTLE_STANDARD_A
Definition: OutdoorPvPZM.h:40

References ObjectGuid::Clear(), m_FlagCarrierGUID, ZM_BATTLE_STANDARD_A, and ZM_BATTLE_STANDARD_H.

◆ HandleGossipOption()

bool OPvPCapturePointZM_GraveYard::HandleGossipOption ( Player player,
Creature creature,
uint32  gossipid 
)
overridevirtual

Reimplemented from OPvPCapturePoint.

351{
352 auto itr = _creatureTypes.find(creature->GetSpawnId());
353 if (itr != _creatureTypes.end())
354 {
355 // if the flag is already taken, then return
357 return true;
358
359 if (itr->second == ZM_ALLIANCE_FIELD_SCOUT)
360 {
361 creature->CastSpell(player, ZM_BATTLE_STANDARD_A, true);
362 m_FlagCarrierGUID = player->GetGUID();
363 }
364 else if (itr->second == ZM_HORDE_FIELD_SCOUT)
365 {
366 creature->CastSpell(player, ZM_BATTLE_STANDARD_H, true);
367 m_FlagCarrierGUID = player->GetGUID();
368 }
369
372 return true;
373 }
374 return false;
375}
ObjectGuid::LowType GetSpawnId() const
Definition: Creature.h:65
void SendCloseGossip()
Definition: GossipDef.cpp:239
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:112
PlayerMenu * PlayerTalkClass
Definition: Player.h:2239
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
void UpdateTowerState()
Definition: OutdoorPvPZM.cpp:267

References OPvPCapturePoint::_creatureTypes, Unit::CastSpell(), Object::GetGUID(), Creature::GetSpawnId(), m_FlagCarrierGUID, Player::PlayerTalkClass, PlayerMenu::SendCloseGossip(), UpdateTowerState(), ZM_ALLIANCE_FIELD_SCOUT, ZM_BATTLE_STANDARD_A, ZM_BATTLE_STANDARD_H, and ZM_HORDE_FIELD_SCOUT.

◆ HandleOpenGo()

int32 OPvPCapturePointZM_GraveYard::HandleOpenGo ( Player player,
GameObject go 
)
overridevirtual

Reimplemented from OPvPCapturePoint.

219{
220 int32 retval = OPvPCapturePoint::HandleOpenGo(player, go);
221 if (retval >= 0)
222 {
224 {
226 sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_H));
228 DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
230 sGraveyard->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE); // rem gy
231 sGraveyard->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE, false); // add gy
234 sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_A));
235 }
237 {
239 sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_ZM_LOSE_GY_A));
241 DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
243 sGraveyard->RemoveGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_ALLIANCE); // rem gy
244 sGraveyard->AddGraveyardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, TEAM_HORDE, false); // add gy
247 sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_ZM_CAPTURE_GY_H));
248 }
250 }
251 return retval;
252}
std::int32_t int32
Definition: Define.h:103
const uint32 ZM_GRAVEYARD_ZONE
Definition: OutdoorPvPZM.h:30
const go_type ZM_Banner_H
Definition: OutdoorPvPZM.h:51
const go_type ZM_Banner_A
Definition: OutdoorPvPZM.h:50
@ ZM_CAPTURE_BUFF
Definition: OutdoorPvPZM.h:38
const uint32 ZM_GRAVEYARD_ID
Definition: OutdoorPvPZM.h:33
#define sObjectMgr
Definition: ObjectMgr.h:1635
#define sGraveyard
Definition: GameGraveyard.h:74
@ LANG_OPVP_ZM_CAPTURE_GY_A
Definition: Language.h:1216
@ LANG_OPVP_ZM_LOSE_GY_A
Definition: Language.h:1222
@ LANG_OPVP_ZM_LOSE_GY_H
Definition: Language.h:1221
@ LANG_OPVP_ZM_CAPTURE_GY_H
Definition: Language.h:1215
#define sWorld
Definition: World.h:443
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
Definition: Unit.cpp:5698
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
OutdoorPvP * _pvp
Definition: OutdoorPvP.h:172
virtual int32 HandleOpenGo(Player *player, GameObject *go)
Definition: OutdoorPvP.cpp:611
bool DelObject(uint32 type)
Definition: OutdoorPvP.cpp:193
void TeamApplyBuff(TeamId teamId, uint32 spellId, uint32 spellId2=0, Player *sameMapPlr=nullptr)
Definition: OutdoorPvP.cpp:670

References OPvPCapturePoint::_pvp, OPvPCapturePoint::AddObject(), OPvPCapturePoint::DelObject(), go_type::entry, OPvPCapturePoint::HandleOpenGo(), Unit::HasAura(), LANG_OPVP_ZM_CAPTURE_GY_A, LANG_OPVP_ZM_CAPTURE_GY_H, LANG_OPVP_ZM_LOSE_GY_A, LANG_OPVP_ZM_LOSE_GY_H, m_GraveYardState, go_type::map, go_type::o, Unit::RemoveAurasDueToSpell(), go_type::rot0, go_type::rot1, go_type::rot2, go_type::rot3, sGraveyard, sObjectMgr, sWorld, TEAM_ALLIANCE, TEAM_HORDE, OutdoorPvP::TeamApplyBuff(), UpdateTowerState(), go_type::x, go_type::y, go_type::z, ZM_Banner_A, ZM_Banner_H, ZM_BATTLE_STANDARD_A, ZM_BATTLE_STANDARD_H, ZM_CAPTURE_BUFF, ZM_GRAVEYARD_A, ZM_GRAVEYARD_H, ZM_GRAVEYARD_ID, and ZM_GRAVEYARD_ZONE.

◆ SetBeaconState()

void OPvPCapturePointZM_GraveYard::SetBeaconState ( TeamId  controlling_teamId)
292{
293 // nothing to do here
294 if (m_BothControllingFactionId == controlling_factionId)
295 return;
296 m_BothControllingFactionId = controlling_factionId;
297
298 switch (controlling_factionId)
299 {
300 case TEAM_ALLIANCE:
301 // if ally already controls the gy and taken back both beacons, return, nothing to do for us
303 return;
304 // ally doesn't control the gy, but controls the side beacons -> add gossip option, add neutral banner
305 break;
306 case TEAM_HORDE:
307 // if horde already controls the gy and taken back both beacons, return, nothing to do for us
309 return;
310 // horde doesn't control the gy, but controls the side beacons -> add gossip option, add neutral banner
311 break;
312 default:
313 // if the graveyard is not neutral, then leave it that way
314 // if the graveyard is neutral, then we have to dispel the buff from the flag carrier
316 {
317 // gy was neutral, thus neutral banner was spawned, it is possible that someone was taking the flag to the gy
319 {
320 // remove flag from carrier, reset flag carrier guid
322 if (p)
323 {
326 }
328 }
329 }
330 break;
331 }
332 // send worldstateupdate
334}
Player * FindPlayer(ObjectGuid const guid)
Definition: ObjectAccessor.cpp:245
Definition: Player.h:1081

References ObjectGuid::Clear(), ObjectAccessor::FindPlayer(), m_BothControllingFactionId, m_FlagCarrierGUID, m_GraveYardState, Unit::RemoveAurasDueToSpell(), TEAM_ALLIANCE, TEAM_HORDE, UpdateTowerState(), ZM_BATTLE_STANDARD_A, ZM_BATTLE_STANDARD_H, ZM_GRAVEYARD_A, ZM_GRAVEYARD_H, and ZM_GRAVEYARD_N.

Referenced by OutdoorPvPZM::Update().

◆ Update()

bool OPvPCapturePointZM_GraveYard::Update ( uint32  diff)
overridevirtual

Reimplemented from OPvPCapturePoint.

212{
213 bool retval = _state != _oldState;
215 return retval;
216}
ObjectiveStates _state
Definition: OutdoorPvP.h:166
ObjectiveStates _oldState
Definition: OutdoorPvP.h:165

References OPvPCapturePoint::_oldState, and OPvPCapturePoint::_state.

◆ UpdateTowerState()

Member Data Documentation

◆ m_BothControllingFactionId

TeamId OPvPCapturePointZM_GraveYard::m_BothControllingFactionId
protected

◆ m_FlagCarrierGUID

ObjectGuid OPvPCapturePointZM_GraveYard::m_FlagCarrierGUID
protected

◆ m_GraveYardState