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

Additional Inherited Members

- Public Attributes inherited from OPvPCapturePoint
ObjectGuid::LowType m_capturePointSpawnId
 
GameObjectm_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
PlayerSet m_activePlayers [2]
 
float m_maxValue
 
float m_minValue
 
float m_maxSpeed
 
float m_value
 
TeamId m_team
 
ObjectiveStates m_OldState
 
ObjectiveStates m_State
 
uint32 m_neutralValuePct
 
OutdoorPvPm_PvP
 
std::map< uint32, ObjectGuid::LowTypem_Objects
 
std::map< uint32, ObjectGuid::LowTypem_Creatures
 
std::map< ObjectGuid::LowType, uint32m_ObjectTypes
 
std::map< ObjectGuid::LowType, uint32m_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:89
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:115

References OPvPCapturePoint::SetCapturePointData().

Member Function Documentation

◆ ChangeState()

void OPvPCapturePointGH::ChangeState ( )
overridevirtual

Implements OPvPCapturePoint.

89{
90 uint32 artkit = 21;
91 switch (m_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:108
#define sGameEventMgr
Definition: GameEventMgr.h:186
#define sMapMgr
Definition: MapMgr.h:221
@ OBJECTIVESTATE_HORDE
Definition: OutdoorPvP.h:44
@ OBJECTIVESTATE_ALLIANCE
Definition: OutdoorPvP.h:43
@ GH_ALLIANCE_DEFENSE_EVENT
Definition: OutdoorPvPGH.h:25
@ GH_HORDE_DEFENSE_EVENT
Definition: OutdoorPvPGH.h:26
Definition: Map.h:312
GameObjectBySpawnIdContainer & GetGameObjectBySpawnIdStore()
Definition: Map.h:521
ObjectiveStates m_State
Definition: OutdoorPvP.h:179
ObjectGuid::LowType m_capturePointSpawnId
Definition: OutdoorPvP.h:131

References Map::GetGameObjectBySpawnIdStore(), GH_ALLIANCE_DEFENSE_EVENT, GH_HORDE_DEFENSE_EVENT, OPvPCapturePoint::m_capturePointSpawnId, OPvPCapturePoint::m_State, 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((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
77 return true;
78 }
79 return false;
80}
phase
Definition: boss_skadi.cpp:102
void SendUpdateWorldState(uint32 variable, uint32 value) const
Definition: PlayerUpdates.cpp:2194
float m_value
Definition: OutdoorPvP.h:173
uint32 m_neutralValuePct
Definition: OutdoorPvP.h:182
float m_maxValue
Definition: OutdoorPvP.h:166
virtual bool HandlePlayerEnter(Player *player)
Definition: OutdoorPvP.cpp:36

References GH_UI_SLIDER_DISPLAY, GH_UI_SLIDER_N, GH_UI_SLIDER_POS, OPvPCapturePoint::HandlePlayerEnter(), OPvPCapturePoint::m_maxValue, OPvPCapturePoint::m_neutralValuePct, OPvPCapturePoint::m_value, and Player::SendUpdateWorldState().

◆ HandlePlayerLeave()

void OPvPCapturePointGH::HandlePlayerLeave ( Player player)
overridevirtual

Reimplemented from OPvPCapturePoint.

83{
86}
virtual void HandlePlayerLeave(Player *player)
Definition: OutdoorPvP.cpp:47

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((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
67}
void SendUpdateWorldState(uint32 field, uint32 value)
Definition: OutdoorPvP.cpp:420

References GH_UI_SLIDER_DISPLAY, GH_UI_SLIDER_N, GH_UI_SLIDER_POS, OPvPCapturePoint::m_maxValue, OPvPCapturePoint::m_neutralValuePct, OPvPCapturePoint::m_value, and OPvPCapturePoint::SendUpdateWorldState().