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

#include "OutdoorPvPGH.h"

Inheritance diagram for OPvPCapturePointGH:
OPvPCapturePoint

Public Member Functions

 OPvPCapturePointGH (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
 

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

Detailed Description

Constructor & Destructor Documentation

◆ OPvPCapturePointGH()

OPvPCapturePointGH::OPvPCapturePointGH ( OutdoorPvP pvp)
48 : OPvPCapturePoint(pvp)
49{
50 SetCapturePointData(189310, 571, 2483.68f, -1873.6f, 10.6877f, -0.104719f, 0.0f, 0.0f, 0.0f, 1.0f);
51}
Definition OutdoorPvP.h:91
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::SetCapturePointData().

Member Function Documentation

◆ ChangeState()

void OPvPCapturePointGH::ChangeState ( )
overridevirtual

Implements OPvPCapturePoint.

91{
92 uint32 artkit = 21;
93 switch (_state)
94 {
99 artkit = 2;
100 break;
105 artkit = 1;
106 break;
107 default:
108 break;
109 }
110
111 Map* map = sMapMgr->FindMap(571, 0);
112 auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
113 for (auto itr = bounds.first; itr != bounds.second; ++itr)
114 itr->second->SetGoArtKit(artkit);
115}
std::uint32_t uint32
Definition Define.h:107
#define sGameEventMgr
Definition GameEventMgr.h:201
#define sMapMgr
Definition MapMgr.h:220
@ GH_ALLIANCE_DEFENSE_EVENT
Definition OutdoorPvPGH.h:25
@ GH_HORDE_DEFENSE_EVENT
Definition OutdoorPvPGH.h:26
@ OBJECTIVESTATE_HORDE
Definition OutdoorPvP.h:45
@ OBJECTIVESTATE_ALLIANCE
Definition OutdoorPvP.h:44
Definition Map.h:156
GameObjectBySpawnIdContainer & GetGameObjectBySpawnIdStore()
Definition Map.h:370
ObjectiveStates _state
Definition OutdoorPvP.h:167
ObjectGuid::LowType m_capturePointSpawnId
Definition OutdoorPvP.h:125

References OPvPCapturePoint::_state, Map::GetGameObjectBySpawnIdStore(), GH_ALLIANCE_DEFENSE_EVENT, GH_HORDE_DEFENSE_EVENT, OPvPCapturePoint::m_capturePointSpawnId, OBJECTIVESTATE_ALLIANCE, OBJECTIVESTATE_HORDE, sGameEventMgr, and sMapMgr.

◆ FillInitialWorldStates()

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

Reimplemented from OPvPCapturePoint.

54{
55 packet.Worldstates.reserve(3);
57 packet.Worldstates.emplace_back(WORLD_STATE_OPVP_GH_UI_SLIDER_POS, 50);
58 packet.Worldstates.emplace_back(WORLD_STATE_OPVP_GH_UI_SLIDER_N, 20);
59}
@ WORLD_STATE_OPVP_GH_UI_SLIDER_N
Definition WorldStateDefines.h:506
@ WORLD_STATE_OPVP_GH_UI_SLIDER_DISPLAY
Definition WorldStateDefines.h:504
@ WORLD_STATE_OPVP_GH_UI_SLIDER_POS
Definition WorldStateDefines.h:505
std::vector< WorldStateInfo > Worldstates
Definition WorldStatePackets.h:46

References WORLD_STATE_OPVP_GH_UI_SLIDER_DISPLAY, WORLD_STATE_OPVP_GH_UI_SLIDER_N, WORLD_STATE_OPVP_GH_UI_SLIDER_POS, and WorldPackets::WorldState::InitWorldStates::Worldstates.

◆ HandlePlayerEnter()

bool OPvPCapturePointGH::HandlePlayerEnter ( Player player)
overridevirtual

Reimplemented from OPvPCapturePoint.

72{
74 {
76 uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f);
79 return true;
80 }
81 return false;
82}
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_GH_UI_SLIDER_DISPLAY, WORLD_STATE_OPVP_GH_UI_SLIDER_N, and WORLD_STATE_OPVP_GH_UI_SLIDER_POS.

◆ HandlePlayerLeave()

void OPvPCapturePointGH::HandlePlayerLeave ( Player player)
overridevirtual

◆ SendChangePhase()

void OPvPCapturePointGH::SendChangePhase ( )
overridevirtual

Reimplemented from OPvPCapturePoint.

62{
63 // send this too, sometimes the slider disappears, dunno why :(
65 // send these updates to only the ones in this objective
66 uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f);
69}
void SendUpdateWorldState(uint32 field, uint32 value)
Definition OutdoorPvP.cpp:465

References OPvPCapturePoint::_maxValue, OPvPCapturePoint::_neutralValuePct, OPvPCapturePoint::_value, OPvPCapturePoint::SendUpdateWorldState(), WORLD_STATE_OPVP_GH_UI_SLIDER_DISPLAY, WORLD_STATE_OPVP_GH_UI_SLIDER_N, and WORLD_STATE_OPVP_GH_UI_SLIDER_POS.


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