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 (WorldPacket &data) override
 
bool HandlePlayerEnter (Player *player) override
 
void HandlePlayerLeave (Player *player) override
 
- 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
 

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.

90{
91 uint32 artkit = 21;
92 switch (_state)
93 {
98 artkit = 2;
99 break;
104 artkit = 1;
105 break;
106 default:
107 break;
108 }
109
110 Map* map = sMapMgr->FindMap(571, 0);
111 auto bounds = map->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
112 for (auto itr = bounds.first; itr != bounds.second; ++itr)
113 itr->second->SetGoArtKit(artkit);
114}
std::uint32_t uint32
Definition: Define.h:108
#define sGameEventMgr
Definition: GameEventMgr.h:186
#define sMapMgr
Definition: MapMgr.h:221
@ OBJECTIVESTATE_HORDE
Definition: OutdoorPvP.h:45
@ OBJECTIVESTATE_ALLIANCE
Definition: OutdoorPvP.h:44
@ GH_ALLIANCE_DEFENSE_EVENT
Definition: OutdoorPvPGH.h:25
@ GH_HORDE_DEFENSE_EVENT
Definition: OutdoorPvPGH.h:26
Definition: Map.h:313
GameObjectBySpawnIdContainer & GetGameObjectBySpawnIdStore()
Definition: Map.h:522
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 ( WorldPacket data)
overridevirtual

Reimplemented from OPvPCapturePoint.

54{
55 data << GH_UI_SLIDER_DISPLAY << uint32(0);
56 data << GH_UI_SLIDER_POS << uint32(50);
57 data << GH_UI_SLIDER_N << uint32(20);
58}
@ GH_UI_SLIDER_N
Definition: OutdoorPvPGH.h:32
@ GH_UI_SLIDER_DISPLAY
Definition: OutdoorPvPGH.h:30
@ GH_UI_SLIDER_POS
Definition: OutdoorPvPGH.h:31

References GH_UI_SLIDER_DISPLAY, GH_UI_SLIDER_N, and GH_UI_SLIDER_POS.

◆ HandlePlayerEnter()

bool OPvPCapturePointGH::HandlePlayerEnter ( Player player)
overridevirtual

Reimplemented from OPvPCapturePoint.

71{
73 {
75 uint32 phase = (uint32)ceil((_value + _maxValue) / (2 * _maxValue) * 100.0f);
78 return true;
79 }
80 return false;
81}
phase
Definition: boss_skadi.cpp:103
void SendUpdateWorldState(uint32 variable, uint32 value) const
Definition: PlayerUpdates.cpp:2197
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

References OPvPCapturePoint::_maxValue, OPvPCapturePoint::_neutralValuePct, OPvPCapturePoint::_value, GH_UI_SLIDER_DISPLAY, GH_UI_SLIDER_N, GH_UI_SLIDER_POS, OPvPCapturePoint::HandlePlayerEnter(), and Player::SendUpdateWorldState().

◆ HandlePlayerLeave()

void OPvPCapturePointGH::HandlePlayerLeave ( Player player)
overridevirtual

Reimplemented from OPvPCapturePoint.

84{
87}
virtual void HandlePlayerLeave(Player *player)
Definition: OutdoorPvP.cpp:46

References GH_UI_SLIDER_DISPLAY, OPvPCapturePoint::HandlePlayerLeave(), and Player::SendUpdateWorldState().

◆ SendChangePhase()

void OPvPCapturePointGH::SendChangePhase ( )
overridevirtual

Reimplemented from OPvPCapturePoint.

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

References OPvPCapturePoint::_maxValue, OPvPCapturePoint::_neutralValuePct, OPvPCapturePoint::_value, GH_UI_SLIDER_DISPLAY, GH_UI_SLIDER_N, GH_UI_SLIDER_POS, and OPvPCapturePoint::SendUpdateWorldState().