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

#include "OutdoorPvPEP.h"

Inheritance diagram for OPvPCapturePointEP_CGT:
OPvPCapturePoint

Public Member Functions

 OPvPCapturePointEP_CGT (OutdoorPvP *pvp)
 
void ChangeState () override
 
void SendChangePhase () override
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet) override
 
bool HandlePlayerEnter (Player *player) override
 
void HandlePlayerLeave (Player *player) override
 
- Public Member Functions inherited from OPvPCapturePoint
 OPvPCapturePoint (OutdoorPvP *pvp)
 
virtual ~OPvPCapturePoint ()=default
 
void SendUpdateWorldState (uint32 field, uint32 value)
 
void SendObjectiveComplete (uint32 id, ObjectGuid guid=ObjectGuid::Empty)
 
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 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 Member Functions

void LinkGraveyard (TeamId teamId)
 
void UpdateTowerState ()
 
- 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 ()
 

Protected Attributes

uint32 m_TowerState
 
TeamId m_GraveyardSide
 
- 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
 

Additional Inherited Members

- Public Attributes inherited from OPvPCapturePoint
ObjectGuid::LowType m_capturePointSpawnId {}
 
GameObject_capturePoint {}
 

Detailed Description

Constructor & Destructor Documentation

◆ OPvPCapturePointEP_CGT()

OPvPCapturePointEP_CGT::OPvPCapturePointEP_CGT ( OutdoorPvP pvp)
312{
315}
@ EP_CGT_FLAGS
Definition OutdoorPvPEP.h:64
const go_type EPCapturePoints[EP_TOWER_NUM]
Definition OutdoorPvPEP.h:77
@ EP_TS_N
Definition OutdoorPvPEP.h:122
@ EP_CGT
Definition OutdoorPvPEP.h:73
const go_type EPTowerFlags[EP_TOWER_NUM]
Definition OutdoorPvPEP.h:85
@ TEAM_NEUTRAL
Definition SharedDefines.h:762
uint32 m_TowerState
Definition OutdoorPvPEP.h:212
TeamId m_GraveyardSide
Definition OutdoorPvPEP.h:214
Definition OutdoorPvP.h:91
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 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:127

References OPvPCapturePoint::AddObject(), EP_CGT, EP_CGT_FLAGS, EPCapturePoints, EPTowerFlags, and OPvPCapturePoint::SetCapturePointData().

Member Function Documentation

◆ ChangeState()

void OPvPCapturePointEP_CGT::ChangeState ( )
overridevirtual

Implements OPvPCapturePoint.

318{
319 // if changing from controlling alliance to horde or vice versa
321 {
322 sWorldSessionMgr->SendZoneText(EP_GraveyardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_A));
323 ((OutdoorPvPEP*)_pvp)->SetControlledState(EP_CGT, TEAM_NEUTRAL);
324 }
326 {
327 sWorldSessionMgr->SendZoneText(EP_GraveyardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_H));
328 ((OutdoorPvPEP*)_pvp)->SetControlledState(EP_CGT, TEAM_NEUTRAL);
329 }
330
331 uint32 artkit = 21;
332
333 switch (_state)
334 {
337 artkit = 2;
339 ((OutdoorPvPEP*)_pvp)->SetControlledState(EP_CGT, TEAM_ALLIANCE);
340 if (_oldState != _state) sWorldSessionMgr->SendZoneText(EP_GraveyardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A));
341 break;
344 artkit = 1;
346 ((OutdoorPvPEP*)_pvp)->SetControlledState(EP_CGT, TEAM_HORDE);
347 if (_oldState != _state) sWorldSessionMgr->SendZoneText(EP_GraveyardZone, sObjectMgr->GetAcoreStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H));
348 break;
351 break;
355 break;
359 break;
360 }
361
362 Map* map = sMapMgr->FindMap(0, 0);
363 auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
364 for (auto itr = bounds.first; itr != bounds.second; ++itr)
365 itr->second->SetGoArtKit(artkit);
366
367 bounds = map->GetGameObjectBySpawnIdStore().equal_range(_objects[EP_CGT_FLAGS]);
368 for (auto itr = bounds.first; itr != bounds.second; ++itr)
369 itr->second->SetGoArtKit(artkit);
370
372
373 // complete quest objective
376}
std::uint32_t uint32
Definition Define.h:107
@ LANG_OPVP_EP_LOSE_CGT_A
Definition Language.h:1251
@ LANG_OPVP_EP_LOSE_CGT_H
Definition Language.h:1250
@ LANG_OPVP_EP_CAPTURE_CGT_H
Definition Language.h:1242
@ LANG_OPVP_EP_CAPTURE_CGT_A
Definition Language.h:1243
#define sMapMgr
Definition MapMgr.h:220
#define sObjectMgr
Definition ObjectMgr.h:1636
const uint32 EP_GraveyardZone
Definition OutdoorPvPEP.h:28
const uint32 EP_CGT_CM
Definition OutdoorPvPEP.h:35
@ EP_TS_A
Definition OutdoorPvPEP.h:127
@ EP_TS_N_A
Definition OutdoorPvPEP.h:123
@ EP_TS_N_H
Definition OutdoorPvPEP.h:124
@ EP_TS_H
Definition OutdoorPvPEP.h:128
@ OBJECTIVESTATE_HORDE
Definition OutdoorPvP.h:45
@ OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE
Definition OutdoorPvP.h:47
@ OBJECTIVESTATE_ALLIANCE
Definition OutdoorPvP.h:44
@ OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE
Definition OutdoorPvP.h:46
@ OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE
Definition OutdoorPvP.h:49
@ OBJECTIVESTATE_NEUTRAL
Definition OutdoorPvP.h:43
@ OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE
Definition OutdoorPvP.h:48
@ TEAM_ALLIANCE
Definition SharedDefines.h:760
@ TEAM_HORDE
Definition SharedDefines.h:761
#define sWorldSessionMgr
Definition WorldSessionMgr.h:110
Definition Map.h:156
GameObjectBySpawnIdContainer & GetGameObjectBySpawnIdStore()
Definition Map.h:370
void UpdateTowerState()
Definition OutdoorPvPEP.cpp:399
void LinkGraveyard(TeamId teamId)
Definition OutdoorPvPEP.cpp:427
ObjectiveStates _state
Definition OutdoorPvP.h:167
ObjectiveStates _oldState
Definition OutdoorPvP.h:166
ObjectGuid::LowType m_capturePointSpawnId
Definition OutdoorPvP.h:125
OutdoorPvP * _pvp
Definition OutdoorPvP.h:173
std::unordered_map< uint32, ObjectGuid::LowType > _objects
Definition OutdoorPvP.h:178
void SendObjectiveComplete(uint32 id, ObjectGuid guid=ObjectGuid::Empty)
Definition OutdoorPvP.cpp:476
Definition OutdoorPvPEP.h:244

References OPvPCapturePoint::_objects, OPvPCapturePoint::_oldState, OPvPCapturePoint::_pvp, OPvPCapturePoint::_state, EP_CGT, EP_CGT_CM, EP_CGT_FLAGS, EP_GraveyardZone, EP_TS_A, EP_TS_H, EP_TS_N, EP_TS_N_A, EP_TS_N_H, Map::GetGameObjectBySpawnIdStore(), LANG_OPVP_EP_CAPTURE_CGT_A, LANG_OPVP_EP_CAPTURE_CGT_H, LANG_OPVP_EP_LOSE_CGT_A, LANG_OPVP_EP_LOSE_CGT_H, LinkGraveyard(), OPvPCapturePoint::m_capturePointSpawnId, m_TowerState, OBJECTIVESTATE_ALLIANCE, OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE, OBJECTIVESTATE_HORDE, OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE, OBJECTIVESTATE_NEUTRAL, OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE, OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE, OPvPCapturePoint::SendObjectiveComplete(), sMapMgr, sObjectMgr, sWorldSessionMgr, TEAM_ALLIANCE, TEAM_HORDE, TEAM_NEUTRAL, and UpdateTowerState().

◆ FillInitialWorldStates()

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

Reimplemented from OPvPCapturePoint.

390{
391 packet.Worldstates.reserve(5);
392 packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_A, (m_TowerState & EP_TS_A) != 0 ? 1 : 0);
393 packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_H, (m_TowerState & EP_TS_H) != 0 ? 1 : 0);
394 packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_A, (m_TowerState & EP_TS_N_A) != 0 ? 1 : 0);
395 packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_H, (m_TowerState & EP_TS_N_H) != 0 ? 1 : 0);
396 packet.Worldstates.emplace_back(WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N, (m_TowerState & EP_TS_N) != 0 ? 1 : 0);
397}
@ WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_H
Definition WorldStateDefines.h:381
@ WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_A
Definition WorldStateDefines.h:380
@ WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_H
Definition WorldStateDefines.h:383
@ WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N
Definition WorldStateDefines.h:368
@ WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_A
Definition WorldStateDefines.h:382
std::vector< WorldStateInfo > Worldstates
Definition WorldStatePackets.h:46

References EP_TS_A, EP_TS_H, EP_TS_N, EP_TS_N_A, EP_TS_N_H, m_TowerState, WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_A, WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_H, WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N, WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_A, WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_H, and WorldPackets::WorldState::InitWorldStates::Worldstates.

◆ HandlePlayerEnter()

bool OPvPCapturePointEP_CGT::HandlePlayerEnter ( Player player)
overridevirtual

Reimplemented from OPvPCapturePoint.

409{
411 {
413 uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f);
416 return true;
417 }
418 return false;
419}
@ WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY
Definition WorldStateDefines.h:384
@ WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS
Definition WorldStateDefines.h:385
@ WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N
Definition WorldStateDefines.h:386
phase
Definition boss_skadi.cpp:103
uint32 _neutralValuePct
Definition OutdoorPvP.h:170
float _maxValue
Definition OutdoorPvP.h:154
virtual bool HandlePlayerEnter(Player *player)
Definition OutdoorPvP.cpp:34
float _value
Definition OutdoorPvP.h:161
void SendUpdateWorldState(uint32 variable, uint32 value) const
Definition PlayerUpdates.cpp:2243

References OPvPCapturePoint::_maxValue, OPvPCapturePoint::_neutralValuePct, OPvPCapturePoint::_value, OPvPCapturePoint::HandlePlayerEnter(), Player::SendUpdateWorldState(), WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, and WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS.

◆ HandlePlayerLeave()

void OPvPCapturePointEP_CGT::HandlePlayerLeave ( Player player)
overridevirtual

◆ LinkGraveyard()

void OPvPCapturePointEP_CGT::LinkGraveyard ( TeamId  teamId)
protected
428{
429 if (m_GraveyardSide != teamId)
430 {
431 sGraveyard->RemoveGraveyardLink(EP_GraveyardId, EP_GraveyardZone, m_GraveyardSide, false);
432 sGraveyard->AddGraveyardLink(EP_GraveyardId, EP_GraveyardZone, teamId, false);
433 m_GraveyardSide = teamId;
434 }
435}
#define sGraveyard
Definition GameGraveyard.h:74
const uint32 EP_GraveyardId
Definition OutdoorPvPEP.h:30

References EP_GraveyardId, EP_GraveyardZone, m_GraveyardSide, and sGraveyard.

Referenced by ChangeState().

◆ SendChangePhase()

void OPvPCapturePointEP_CGT::SendChangePhase ( )
overridevirtual

Reimplemented from OPvPCapturePoint.

379{
380 // send this too, sometimes the slider disappears, dunno why :(
382 // send these updates to only the ones in this objective
383 uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f);
385 // send this too, sometimes it resets :S
387}
void SendUpdateWorldState(uint32 field, uint32 value)
Definition OutdoorPvP.cpp:465

References OPvPCapturePoint::_maxValue, OPvPCapturePoint::_neutralValuePct, OPvPCapturePoint::_value, OPvPCapturePoint::SendUpdateWorldState(), WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY, WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N, and WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS.

◆ UpdateTowerState()

Member Data Documentation

◆ m_GraveyardSide

TeamId OPvPCapturePointEP_CGT::m_GraveyardSide
protected

Referenced by LinkGraveyard().

◆ m_TowerState

uint32 OPvPCapturePointEP_CGT::m_TowerState
protected

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