TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
OPvPCapturePointZM_GraveYard Class Reference

#include <OutdoorPvPZM.h>

Public Member Functions

 OPvPCapturePointZM_GraveYard (OutdoorPvP *pvp)
 
bool Update (uint32 diff) override
 
void ChangeState () override
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet) override
 
void UpdateTowerState ()
 
int32 HandleOpenGo (Player *player, GameObject *go) override
 
void SetBeaconState (uint32 controlling_team)
 
bool HandleGossipOption (Player *player, Creature *creature, uint32 gossipid) override
 
bool HandleDropFlag (Player *player, uint32 spellId) override
 
bool CanTalkTo (Player *player, Creature *creature, GossipMenuItems const &gso) override
 
uint32 GetGraveYardState () const
 
- Public Member Functions inherited from OPvPCapturePoint
 OPvPCapturePoint (OutdoorPvP *pvp)
 
virtual ~OPvPCapturePoint ()
 
void SendUpdateWorldState (uint32 field, uint32 value)
 
void SendObjectiveComplete (uint32 id, ObjectGuid guid)
 
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 void ChangeTeam (TeamId)
 
virtual void SendChangePhase ()
 
virtual void DeleteSpawns ()
 
void AddGO (uint32 type, ObjectGuid::LowType guid)
 
void AddCre (uint32 type, ObjectGuid::LowType guid)
 
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)
 

Protected Attributes

uint32 m_BothControllingFaction
 
ObjectGuid m_FlagCarrierGUID
 
- Protected Attributes inherited from OPvPCapturePoint
GuidSet 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::LowType
m_Objects
 
std::map< uint32,
ObjectGuid::LowType
m_Creatures
 
std::map< ObjectGuid::LowType,
uint32
m_ObjectTypes
 
std::map< ObjectGuid::LowType,
uint32
m_CreatureTypes
 

Private Attributes

uint32 m_GraveYardState
 

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)
 
virtual bool AddCreature (uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL, uint32 spawntimedelay=0)
 
bool DelCreature (uint32 type)
 
bool DelObject (uint32 type)
 
bool DelCapturePoint ()
 

Constructor & Destructor Documentation

OPvPCapturePointZM_GraveYard::OPvPCapturePointZM_GraveYard ( OutdoorPvP pvp)
220 : OPvPCapturePoint(pvp)
221 {
225  // add field scouts here
228  // add neutral banner
230 }
float rot1
Definition: OutdoorPvP.h:62
float z
Definition: OutdoorPvP.h:59
uint32 map
Definition: OutdoorPvP.h:71
float o
Definition: OutdoorPvP.h:75
ObjectGuid m_FlagCarrierGUID
Definition: OutdoorPvPZM.h:213
float y
Definition: OutdoorPvP.h:58
Definition: OutdoorPvPZM.h:75
uint32 entry
Definition: OutdoorPvP.h:70
float x
Definition: OutdoorPvP.h:72
OPvPCapturePoint(OutdoorPvP *pvp)
Definition: OutdoorPvP.cpp:52
uint32 m_GraveYardState
Definition: OutdoorPvPZM.h:208
float z
Definition: OutdoorPvP.h:74
const go_type ZM_Banner_N
Definition: OutdoorPvPZM.h:65
uint32 m_BothControllingFaction
Definition: OutdoorPvPZM.h:211
float o
Definition: OutdoorPvP.h:60
float y
Definition: OutdoorPvP.h:73
float rot2
Definition: OutdoorPvP.h:63
uint32 map
Definition: OutdoorPvP.h:56
float rot3
Definition: OutdoorPvP.h:64
float rot0
Definition: OutdoorPvP.h:61
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:109
virtual bool AddCreature(uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL, uint32 spawntimedelay=0)
Definition: OutdoorPvP.cpp:120
void Clear()
Definition: ObjectGuid.h:215
Definition: OutdoorPvPZM.h:177
uint32 entry
Definition: OutdoorPvP.h:55
Definition: OutdoorPvPZM.h:76
const creature_type ZM_AllianceFieldScout
Definition: OutdoorPvPZM.h:71
float x
Definition: OutdoorPvP.h:57
const creature_type ZM_HordeFieldScout
Definition: OutdoorPvPZM.h:68

+ Here is the call graph for this function:

Member Function Documentation

bool OPvPCapturePointZM_GraveYard::CanTalkTo ( Player player,
Creature creature,
GossipMenuItems const gso 
)
overridevirtual

Reimplemented from OPvPCapturePoint.

302 {
303  std::map<ObjectGuid::LowType, uint32>::iterator itr = m_CreatureTypes.find(c->GetSpawnId());
304  if (itr != m_CreatureTypes.end())
305  {
307  return true;
308  else if (itr->second == ZM_HORDE_FIELD_SCOUT && player->GetTeam() == HORDE && m_BothControllingFaction == HORDE && !m_FlagCarrierGUID && m_GraveYardState != ZM_GRAVEYARD_H)
309  return true;
310  }
311  return false;
312 }
ObjectGuid m_FlagCarrierGUID
Definition: OutdoorPvPZM.h:213
Definition: OutdoorPvPZM.h:75
uint32 m_GraveYardState
Definition: OutdoorPvPZM.h:208
Definition: OutdoorPvPZM.h:178
uint32 m_BothControllingFaction
Definition: OutdoorPvPZM.h:211
std::map< ObjectGuid::LowType, uint32 > m_CreatureTypes
Definition: OutdoorPvP.h:184
Definition: SharedDefines.h:1000
Definition: SharedDefines.h:999
Definition: OutdoorPvPZM.h:76
Definition: OutdoorPvPZM.h:179

+ Here is the call graph for this function:

void OPvPCapturePointZM_GraveYard::ChangeState ( )
inlineoverridevirtual

Implements OPvPCapturePoint.

189 { }
void OPvPCapturePointZM_GraveYard::FillInitialWorldStates ( WorldPackets::WorldState::InitWorldStates packet)
overridevirtual

Reimplemented from OPvPCapturePoint.

245 {
249 
254 }
uint32 m_GraveYardState
Definition: OutdoorPvPZM.h:208
std::list< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
Definition: OutdoorPvPZM.h:145
Definition: OutdoorPvPZM.h:178
uint32 m_BothControllingFaction
Definition: OutdoorPvPZM.h:211
Definition: OutdoorPvPZM.h:146
Definition: SharedDefines.h:1000
Definition: OutdoorPvPZM.h:147
Definition: OutdoorPvPZM.h:137
Definition: SharedDefines.h:999
Definition: OutdoorPvPZM.h:139
Definition: OutdoorPvPZM.h:177
Definition: OutdoorPvPZM.h:144
int32_t int32
Definition: g3dmath.h:167
uint32_t uint32
Definition: g3dmath.h:168
Definition: OutdoorPvPZM.h:138
Definition: OutdoorPvPZM.h:179
uint32 OPvPCapturePointZM_GraveYard::GetGraveYardState ( ) const
354 {
355  return m_GraveYardState;
356 }
uint32 m_GraveYardState
Definition: OutdoorPvPZM.h:208

+ Here is the caller graph for this function:

bool OPvPCapturePointZM_GraveYard::HandleDropFlag ( Player player,
uint32  spellId 
)
overridevirtual

Reimplemented from OPvPCapturePoint.

340 {
341  switch (spellId)
342  {
345  return true;
348  return true;
349  }
350  return false;
351 }
ObjectGuid m_FlagCarrierGUID
Definition: OutdoorPvPZM.h:213
Definition: OutdoorPvPZM.h:53
void Clear()
Definition: ObjectGuid.h:215
Definition: OutdoorPvPZM.h:55

+ Here is the call graph for this function:

bool OPvPCapturePointZM_GraveYard::HandleGossipOption ( Player player,
Creature creature,
uint32  gossipid 
)
overridevirtual

Reimplemented from OPvPCapturePoint.

315 {
316  std::map<ObjectGuid::LowType, uint32>::iterator itr = m_CreatureTypes.find(creature->GetSpawnId());
317  if (itr != m_CreatureTypes.end())
318  {
319  // if the flag is already taken, then return
320  if (!m_FlagCarrierGUID.IsEmpty())
321  return true;
322  if (itr->second == ZM_ALLIANCE_FIELD_SCOUT)
323  {
324  creature->CastSpell(player, ZM_BATTLE_STANDARD_A, true);
325  m_FlagCarrierGUID = player->GetGUID();
326  }
327  else if (itr->second == ZM_HORDE_FIELD_SCOUT)
328  {
329  creature->CastSpell(player, ZM_BATTLE_STANDARD_H, true);
330  m_FlagCarrierGUID = player->GetGUID();
331  }
333  player->PlayerTalkClass->SendCloseGossip();
334  return true;
335  }
336  return false;
337 }
ObjectGuid m_FlagCarrierGUID
Definition: OutdoorPvPZM.h:213
Definition: OutdoorPvPZM.h:75
ObjectGuid::LowType GetSpawnId() const
Definition: Creature.h:487
std::map< ObjectGuid::LowType, uint32 > m_CreatureTypes
Definition: OutdoorPvP.h:184
Definition: OutdoorPvPZM.h:53
void UpdateTowerState()
Definition: OutdoorPvPZM.cpp:232
Definition: OutdoorPvPZM.h:76
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:869
bool IsEmpty() const
Definition: ObjectGuid.h:242
Definition: OutdoorPvPZM.h:55

+ Here is the call graph for this function:

int32 OPvPCapturePointZM_GraveYard::HandleOpenGo ( Player player,
GameObject go 
)
overridevirtual

Reimplemented from OPvPCapturePoint.

188 {
189  int32 retval = OPvPCapturePoint::HandleOpenGo(player, go);
190  if (retval >= 0)
191  {
192  if (player->HasAura(ZM_BATTLE_STANDARD_A) && m_GraveYardState != ZM_GRAVEYARD_A)
193  {
195  DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
197  sObjectMgr->RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE); // rem gy
198  sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE, false); // add gy
200  player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
202  }
203  else if (player->HasAura(ZM_BATTLE_STANDARD_H) && m_GraveYardState != ZM_GRAVEYARD_H)
204  {
206  DelObject(0); // only one gotype is used in the whole outdoor pvp, no need to call it a constant
208  sObjectMgr->RemoveGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, ALLIANCE); // rem gy
209  sObjectMgr->AddGraveYardLink(ZM_GRAVEYARD_ID, ZM_GRAVEYARD_ZONE, HORDE, false); // add gy
211  player->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
213  }
215  }
216  return retval;
217 }
float rot1
Definition: OutdoorPvP.h:62
float z
Definition: OutdoorPvP.h:59
void TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2=0)
Definition: OutdoorPvP.cpp:610
float y
Definition: OutdoorPvP.h:58
Definition: OutdoorPvPZM.h:51
OutdoorPvP * m_PvP
Definition: OutdoorPvP.h:177
uint32 m_GraveYardState
Definition: OutdoorPvPZM.h:208
bool DelObject(uint32 type)
Definition: OutdoorPvP.cpp:195
const go_type ZM_Banner_A
Definition: OutdoorPvPZM.h:63
const go_type ZM_Banner_H
Definition: OutdoorPvPZM.h:64
Definition: OutdoorPvPZM.h:30
Definition: OutdoorPvPZM.h:178
float o
Definition: OutdoorPvP.h:60
#define sObjectMgr
Definition: ObjectMgr.h:1567
const uint32 ZM_GRAVEYARD_ZONE
Definition: OutdoorPvPZM.h:43
virtual int32 HandleOpenGo(Player *player, GameObject *go)
Definition: OutdoorPvP.cpp:546
Definition: OutdoorPvPZM.h:53
Definition: SharedDefines.h:1000
void UpdateTowerState()
Definition: OutdoorPvPZM.cpp:232
float rot2
Definition: OutdoorPvP.h:63
uint32 map
Definition: OutdoorPvP.h:56
float rot3
Definition: OutdoorPvP.h:64
float rot0
Definition: OutdoorPvP.h:61
int32_t int32
Definition: Define.h:146
Definition: SharedDefines.h:992
void SendDefenseMessage(uint32 zoneId, uint32 id)
Definition: OutdoorPvP.cpp:634
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:109
Definition: SharedDefines.h:999
Definition: OutdoorPvPZM.h:29
uint32 entry
Definition: OutdoorPvP.h:55
const uint32 ZM_GRAVEYARD_ID
Definition: OutdoorPvPZM.h:46
Definition: SharedDefines.h:993
Definition: OutdoorPvPZM.h:179
float x
Definition: OutdoorPvP.h:57
Definition: OutdoorPvPZM.h:55

+ Here is the call graph for this function:

void OPvPCapturePointZM_GraveYard::SetBeaconState ( uint32  controlling_team)
257 {
258  // nothing to do here
259  if (m_BothControllingFaction == controlling_faction)
260  return;
261  m_BothControllingFaction = controlling_faction;
262 
263  switch (controlling_faction)
264  {
265  case ALLIANCE:
266  // if ally already controls the gy and taken back both beacons, return, nothing to do for us
268  return;
269  // ally doesn't control the gy, but controls the side beacons -> add gossip option, add neutral banner
270  break;
271  case HORDE:
272  // if horde already controls the gy and taken back both beacons, return, nothing to do for us
274  return;
275  // horde doesn't control the gy, but controls the side beacons -> add gossip option, add neutral banner
276  break;
277  default:
278  // if the graveyard is not neutral, then leave it that way
279  // if the graveyard is neutral, then we have to dispel the buff from the flag carrier
281  {
282  // gy was neutral, thus neutral banner was spawned, it is possible that someone was taking the flag to the gy
283  if (!m_FlagCarrierGUID.IsEmpty())
284  {
285  // remove flag from carrier, reset flag carrier guid
287  if (p)
288  {
289  p->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_A);
290  p->RemoveAurasDueToSpell(ZM_BATTLE_STANDARD_H);
291  }
293  }
294  }
295  break;
296  }
297  // send worldstateupdate
299 }
ObjectGuid m_FlagCarrierGUID
Definition: OutdoorPvPZM.h:213
uint32 m_GraveYardState
Definition: OutdoorPvPZM.h:208
Definition: OutdoorPvPZM.h:178
uint32 m_BothControllingFaction
Definition: OutdoorPvPZM.h:211
Definition: OutdoorPvPZM.h:53
Definition: SharedDefines.h:1000
void UpdateTowerState()
Definition: OutdoorPvPZM.cpp:232
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:209
Definition: SharedDefines.h:999
void Clear()
Definition: ObjectGuid.h:215
Definition: OutdoorPvPZM.h:177
Definition: OutdoorPvPZM.h:179
bool IsEmpty() const
Definition: ObjectGuid.h:242
Definition: OutdoorPvPZM.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool OPvPCapturePointZM_GraveYard::Update ( uint32  diff)
overridevirtual

Reimplemented from OPvPCapturePoint.

181 {
182  bool retval = m_State != m_OldState;
184  return retval;
185 }
ObjectiveStates m_OldState
Definition: OutdoorPvP.h:170
ObjectiveStates m_State
Definition: OutdoorPvP.h:171
void OPvPCapturePointZM_GraveYard::UpdateTowerState ( )
233 {
237 
242 }
OutdoorPvP * m_PvP
Definition: OutdoorPvP.h:177
uint32 m_GraveYardState
Definition: OutdoorPvPZM.h:208
Definition: OutdoorPvPZM.h:145
Definition: OutdoorPvPZM.h:178
uint32 m_BothControllingFaction
Definition: OutdoorPvPZM.h:211
Definition: OutdoorPvPZM.h:146
Definition: SharedDefines.h:1000
Definition: OutdoorPvPZM.h:147
Definition: OutdoorPvPZM.h:137
Definition: SharedDefines.h:999
Definition: OutdoorPvPZM.h:139
Definition: OutdoorPvPZM.h:177
Definition: OutdoorPvPZM.h:144
uint32_t uint32
Definition: g3dmath.h:168
Definition: OutdoorPvPZM.h:138
Definition: OutdoorPvPZM.h:179
void SendUpdateWorldState(uint32 field, uint32 value)
Definition: OutdoorPvP.cpp:409

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

uint32 OPvPCapturePointZM_GraveYard::m_BothControllingFaction
protected
ObjectGuid OPvPCapturePointZM_GraveYard::m_FlagCarrierGUID
protected
uint32 OPvPCapturePointZM_GraveYard::m_GraveYardState
private

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