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

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

53{
54 data << GH_UI_SLIDER_DISPLAY << uint32(0);
55 data << GH_UI_SLIDER_POS << uint32(50);
56 data << GH_UI_SLIDER_N << uint32(20);
57}
@ 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.

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

83{
86}
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.

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

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