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

#include <OutdoorPvPNA.h>

Public Member Functions

 OPvPCapturePointNA (OutdoorPvP *pvp)
 
bool Update (uint32 diff) override
 
void ChangeState () override
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet) override
 
bool HandleCustomSpell (Player *player, uint32 spellId, GameObject *go) override
 
int32 HandleOpenGo (Player *player, GameObject *go) override
 
uint32 GetAliveGuardsCount ()
 
uint32 GetControllingFaction () 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 void ChangeTeam (TeamId)
 
virtual void SendChangePhase ()
 
virtual bool HandleGossipOption (Player *, Creature *, uint32)
 
virtual bool CanTalkTo (Player *, Creature *, GossipMenuItems const &)
 
virtual bool HandleDropFlag (Player *, uint32)
 
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 Member Functions

void FactionTakeOver (uint32 team)
 
void DeSpawnNPCs ()
 
void DeSpawnGOs ()
 
void SpawnNPCsForTeam (uint32 team)
 
void SpawnGOsForTeam (uint32 team)
 
void UpdateWyvernRoostWorldState (uint32 roost)
 
void UpdateHalaaWorldState ()
 
- 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 ()
 

Private Attributes

bool m_capturable
 
uint32 m_GuardsAlive
 
uint32 m_ControllingFaction
 
uint32 m_WyvernStateNorth
 
uint32 m_WyvernStateSouth
 
uint32 m_WyvernStateEast
 
uint32 m_WyvernStateWest
 
uint32 m_HalaaState
 
uint32 m_RespawnTimer
 
uint32 m_GuardCheckTimer
 

Additional Inherited Members

- Public Attributes inherited from OPvPCapturePoint
ObjectGuid::LowType m_capturePointSpawnId
 
GameObjectm_capturePoint
 
- 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
 

Constructor & Destructor Documentation

OPvPCapturePointNA::OPvPCapturePointNA ( OutdoorPvP pvp)
181  :
185 {
186  SetCapturePointData(182210, 530, -1572.57f, 7945.3f, -22.475f, 2.05949f, 0.0f, 0.0f, 0.857167f, 0.515038f);
187 }
uint32 m_WyvernStateNorth
Definition: OutdoorPvPNA.h:297
bool m_capturable
Definition: OutdoorPvPNA.h:291
uint32 m_ControllingFaction
Definition: OutdoorPvPNA.h:295
uint32 m_GuardCheckTimer
Definition: OutdoorPvPNA.h:306
OPvPCapturePoint(OutdoorPvP *pvp)
Definition: OutdoorPvP.cpp:52
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:131
uint32 m_RespawnTimer
Definition: OutdoorPvPNA.h:304
uint32 m_GuardsAlive
Definition: OutdoorPvPNA.h:293
uint32 m_HalaaState
Definition: OutdoorPvPNA.h:302
const uint32 NA_GUARD_CHECK_TIME
Definition: OutdoorPvPNA.h:55
uint32 m_WyvernStateWest
Definition: OutdoorPvPNA.h:300
uint32 m_WyvernStateEast
Definition: OutdoorPvPNA.h:299
const uint32 NA_RESPAWN_TIME
Definition: OutdoorPvPNA.h:53
uint32 m_WyvernStateSouth
Definition: OutdoorPvPNA.h:298
Definition: OutdoorPvPNA.h:248

+ Here is the call graph for this function:

Member Function Documentation

void OPvPCapturePointNA::ChangeState ( )
overridevirtual

Implements OPvPCapturePoint.

542 {
543  uint32 artkit = 21;
544  switch (m_State)
545  {
548  break;
552  artkit = 2;
553  break;
557  artkit = 1;
558  break;
561  break;
564  break;
567  artkit = 2;
568  break;
571  artkit = 1;
572  break;
573  }
574 
575  auto bounds = sMapMgr->FindMap(530, 0)->GetGameObjectBySpawnIdStore().equal_range(m_capturePointSpawnId);
576  for (auto itr = bounds.first; itr != bounds.second; ++itr)
577  itr->second->SetGoArtKit(artkit);
578 
580 }
Definition: OutdoorPvPNA.h:252
void FactionTakeOver(uint32 team)
Definition: OutdoorPvPNA.cpp:136
Definition: OutdoorPvP.h:46
Definition: OutdoorPvPNA.h:249
Definition: SharedDefines.h:1000
uint32 m_HalaaState
Definition: OutdoorPvPNA.h:302
ObjectGuid::LowType m_capturePointSpawnId
Definition: OutdoorPvP.h:131
Definition: OutdoorPvP.h:43
Definition: OutdoorPvPNA.h:251
uint32_t uint32
Definition: Define.h:150
Definition: OutdoorPvP.h:45
Definition: SharedDefines.h:999
Definition: OutdoorPvPNA.h:250
Definition: OutdoorPvP.h:42
#define sMapMgr
Definition: MapManager.h:194
void UpdateHalaaWorldState()
Definition: OutdoorPvPNA.cpp:582
Definition: OutdoorPvP.h:47
ObjectiveStates m_State
Definition: OutdoorPvP.h:171
Definition: OutdoorPvP.h:41
Definition: OutdoorPvPNA.h:248

+ Here is the call graph for this function:

void OPvPCapturePointNA::DeSpawnGOs ( )
protected
129 {
130  for (int i = 0; i < NA_CONTROL_GO_NUM; ++i)
131  {
132  DelObject(i);
133  }
134 }
bool DelObject(uint32 type)
Definition: OutdoorPvP.cpp:195
Definition: OutdoorPvPNA.h:111

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void OPvPCapturePointNA::DeSpawnNPCs ( )
protected
99 {
100  for (int i = 0; i < NA_CONTROL_NPC_NUM; ++i)
101  DelCreature(i);
102 }
bool DelCreature(uint32 type)
Definition: OutdoorPvP.cpp:156
Definition: OutdoorPvPNA.h:187

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void OPvPCapturePointNA::FactionTakeOver ( uint32  team)
protected
137 {
140 
141  m_ControllingFaction = team;
144  DeSpawnGOs();
145  DeSpawnNPCs();
146  SpawnGOsForTeam(team);
147  SpawnNPCsForTeam(team);
149  m_capturable = false;
150  this->UpdateHalaaWorldState();
151  if (team == ALLIANCE)
152  {
162  }
163  else
164  {
174  }
179 }
void TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2=0)
Definition: OutdoorPvP.cpp:610
Definition: OutdoorPvPNA.h:240
const uint32 NA_GUARDS_MAX
Definition: OutdoorPvPNA.h:45
uint32 m_WyvernStateNorth
Definition: OutdoorPvPNA.h:297
Definition: OutdoorPvPNA.h:39
bool m_capturable
Definition: OutdoorPvPNA.h:291
uint32 m_ControllingFaction
Definition: OutdoorPvPNA.h:295
OutdoorPvP * m_PvP
Definition: OutdoorPvP.h:177
Definition: OutdoorPvPNA.h:97
const uint32 NA_HALAA_GRAVEYARD_ZONE
Definition: OutdoorPvPNA.h:51
Definition: OutdoorPvPNA.h:59
#define sObjectMgr
Definition: ObjectMgr.h:1567
Definition: OutdoorPvPNA.h:98
uint32 m_GuardsAlive
Definition: OutdoorPvPNA.h:293
Definition: SharedDefines.h:1000
void SpawnGOsForTeam(uint32 team)
Definition: OutdoorPvPNA.cpp:104
Definition: OutdoorPvPNA.h:27
uint32 m_WyvernStateWest
Definition: OutdoorPvPNA.h:300
Definition: OutdoorPvPNA.h:26
Definition: SharedDefines.h:992
void SendDefenseMessage(uint32 zoneId, uint32 id)
Definition: OutdoorPvP.cpp:634
void SpawnNPCsForTeam(uint32 team)
Definition: OutdoorPvPNA.cpp:85
void DeSpawnGOs()
Definition: OutdoorPvPNA.cpp:128
uint32 m_WyvernStateEast
Definition: OutdoorPvPNA.h:299
Definition: OutdoorPvPNA.h:96
void UpdateWyvernRoostWorldState(uint32 roost)
Definition: OutdoorPvPNA.cpp:591
Definition: OutdoorPvPNA.h:99
void UpdateHalaaWorldState()
Definition: OutdoorPvPNA.cpp:582
Definition: OutdoorPvPNA.h:60
Definition: OutdoorPvPNA.h:241
Definition: SharedDefines.h:993
void SendUpdateWorldState(uint32 field, uint32 value)
Definition: OutdoorPvP.cpp:409
const uint32 NA_HALAA_GRAVEYARD
Definition: OutdoorPvPNA.h:49
uint32 m_WyvernStateSouth
Definition: OutdoorPvPNA.h:298
void DeSpawnNPCs()
Definition: OutdoorPvPNA.cpp:98
Definition: OutdoorPvPNA.h:62

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from OPvPCapturePoint.

224 {
226  {
227  packet.Worldstates.emplace_back(uint32(NA_UI_HORDE_GUARDS_SHOW), 0);
228  packet.Worldstates.emplace_back(uint32(NA_UI_ALLIANCE_GUARDS_SHOW), 1);
229  }
230  else if (m_ControllingFaction == HORDE)
231  {
232  packet.Worldstates.emplace_back(uint32(NA_UI_HORDE_GUARDS_SHOW), 1);
233  packet.Worldstates.emplace_back(uint32(NA_UI_ALLIANCE_GUARDS_SHOW), 1);
234  }
235  else
236  {
237  packet.Worldstates.emplace_back(uint32(NA_UI_HORDE_GUARDS_SHOW), 0);
238  packet.Worldstates.emplace_back(uint32(NA_UI_ALLIANCE_GUARDS_SHOW), 0);
239  }
240 
241  packet.Worldstates.emplace_back(uint32(NA_UI_GUARDS_MAX), int32(NA_GUARDS_MAX));
242  packet.Worldstates.emplace_back(uint32(NA_UI_GUARDS_LEFT), int32(m_GuardsAlive));
243 
248 
249  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_SOUTH_NEU_H), int32((m_WyvernStateSouth & WYVERN_NEU_HORDE) != 0));
250  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_SOUTH_NEU_A), int32((m_WyvernStateSouth & WYVERN_NEU_ALLIANCE) != 0));
251  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_SOUTH_H), int32((m_WyvernStateSouth & WYVERN_HORDE) != 0));
252  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_SOUTH_A), int32((m_WyvernStateSouth & WYVERN_ALLIANCE) != 0));
253 
254  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_WEST_NEU_H), int32((m_WyvernStateWest & WYVERN_NEU_HORDE) != 0));
255  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_WEST_NEU_A), int32((m_WyvernStateWest & WYVERN_NEU_ALLIANCE) != 0));
256  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_WEST_H), int32((m_WyvernStateWest & WYVERN_HORDE) != 0));
257  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_WEST_A), int32((m_WyvernStateWest & WYVERN_ALLIANCE) != 0));
258 
259  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_EAST_NEU_H), int32((m_WyvernStateEast & WYVERN_NEU_HORDE) != 0));
260  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_EAST_NEU_A), int32((m_WyvernStateEast & WYVERN_NEU_ALLIANCE) != 0));
261  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_EAST_H), int32((m_WyvernStateEast & WYVERN_HORDE) != 0));
262  packet.Worldstates.emplace_back(uint32(NA_MAP_WYVERN_EAST_A), int32((m_WyvernStateEast & WYVERN_ALLIANCE) != 0));
263 
264  packet.Worldstates.emplace_back(uint32(NA_MAP_HALAA_NEUTRAL), int32((m_HalaaState & HALAA_N) != 0));
265  packet.Worldstates.emplace_back(uint32(NA_MAP_HALAA_NEU_A), int32((m_HalaaState & HALAA_N_A) != 0));
266  packet.Worldstates.emplace_back(uint32(NA_MAP_HALAA_NEU_H), int32((m_HalaaState & HALAA_N_H) != 0));
267  packet.Worldstates.emplace_back(uint32(NA_MAP_HALAA_HORDE), int32((m_HalaaState & HALAA_H) != 0));
268  packet.Worldstates.emplace_back(uint32(NA_MAP_HALAA_ALLIANCE), int32((m_HalaaState & HALAA_A) != 0));
269 }
Definition: OutdoorPvPNA.h:240
const uint32 NA_GUARDS_MAX
Definition: OutdoorPvPNA.h:45
uint32 m_WyvernStateNorth
Definition: OutdoorPvPNA.h:297
Definition: OutdoorPvPNA.h:75
Definition: OutdoorPvPNA.h:74
uint32 m_ControllingFaction
Definition: OutdoorPvPNA.h:295
Definition: OutdoorPvPNA.h:252
Definition: OutdoorPvPNA.h:242
Definition: OutdoorPvPNA.h:87
Definition: OutdoorPvPNA.h:77
Definition: OutdoorPvPNA.h:70
Definition: OutdoorPvPNA.h:82
std::list< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
Definition: OutdoorPvPNA.h:76
Definition: OutdoorPvPNA.h:71
Definition: OutdoorPvPNA.h:59
Definition: OutdoorPvPNA.h:249
Definition: OutdoorPvPNA.h:67
Definition: OutdoorPvPNA.h:88
uint32 m_GuardsAlive
Definition: OutdoorPvPNA.h:293
Definition: OutdoorPvPNA.h:81
Definition: SharedDefines.h:1000
Definition: OutdoorPvPNA.h:79
Definition: OutdoorPvPNA.h:65
uint32 m_HalaaState
Definition: OutdoorPvPNA.h:302
uint32 m_WyvernStateWest
Definition: OutdoorPvPNA.h:300
Definition: OutdoorPvPNA.h:80
Definition: OutdoorPvPNA.h:66
Definition: OutdoorPvPNA.h:61
Definition: OutdoorPvPNA.h:69
Definition: OutdoorPvPNA.h:251
Definition: OutdoorPvPNA.h:84
Definition: SharedDefines.h:999
Definition: OutdoorPvPNA.h:72
Definition: OutdoorPvPNA.h:86
Definition: OutdoorPvPNA.h:250
uint32 m_WyvernStateEast
Definition: OutdoorPvPNA.h:299
int32_t int32
Definition: g3dmath.h:167
uint32_t uint32
Definition: g3dmath.h:168
Definition: OutdoorPvPNA.h:243
Definition: OutdoorPvPNA.h:60
Definition: OutdoorPvPNA.h:241
uint32 m_WyvernStateSouth
Definition: OutdoorPvPNA.h:298
Definition: OutdoorPvPNA.h:85
Definition: OutdoorPvPNA.h:248
Definition: OutdoorPvPNA.h:62

+ Here is the caller graph for this function:

uint32 OPvPCapturePointNA::GetAliveGuardsCount ( )
45 {
46  uint32 cnt = 0;
47  for (std::map<uint32, ObjectGuid::LowType>::iterator itr = m_Creatures.begin(); itr != m_Creatures.end(); ++itr)
48  {
49  switch (itr->first)
50  {
51  case NA_NPC_GUARD_01:
52  case NA_NPC_GUARD_02:
53  case NA_NPC_GUARD_03:
54  case NA_NPC_GUARD_04:
55  case NA_NPC_GUARD_05:
56  case NA_NPC_GUARD_06:
57  case NA_NPC_GUARD_07:
58  case NA_NPC_GUARD_08:
59  case NA_NPC_GUARD_09:
60  case NA_NPC_GUARD_10:
61  case NA_NPC_GUARD_11:
62  case NA_NPC_GUARD_12:
63  case NA_NPC_GUARD_13:
64  case NA_NPC_GUARD_14:
65  case NA_NPC_GUARD_15:
66  {
67  auto bounds = m_PvP->GetMap()->GetCreatureBySpawnIdStore().equal_range(itr->second);
68  for (auto itr2 = bounds.first; itr2 != bounds.second; ++itr2)
69  if (itr2->second->IsAlive())
70  ++cnt;
71  break;
72  }
73  default:
74  break;
75  }
76  }
77  return cnt;
78 }
OutdoorPvP * m_PvP
Definition: OutdoorPvP.h:177
std::map< uint32, ObjectGuid::LowType > m_Creatures
Definition: OutdoorPvP.h:182
Definition: OutdoorPvPNA.h:184
Definition: OutdoorPvPNA.h:174
Definition: OutdoorPvPNA.h:172
Map * GetMap() const
Definition: OutdoorPvP.h:264
Definition: OutdoorPvPNA.h:181
Definition: OutdoorPvPNA.h:183
uint32_t uint32
Definition: Define.h:150
Definition: OutdoorPvPNA.h:185
Definition: OutdoorPvPNA.h:173
Definition: OutdoorPvPNA.h:177
Definition: OutdoorPvPNA.h:176
Definition: OutdoorPvPNA.h:175
Definition: OutdoorPvPNA.h:182
CreatureBySpawnIdContainer & GetCreatureBySpawnIdStore()
Definition: Map.h:469
Definition: OutdoorPvPNA.h:180
Definition: OutdoorPvPNA.h:178
Definition: OutdoorPvPNA.h:171
Definition: OutdoorPvPNA.h:179

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32 OPvPCapturePointNA::GetControllingFaction ( ) const
81 {
82  return m_ControllingFaction;
83 }
uint32 m_ControllingFaction
Definition: OutdoorPvPNA.h:295

+ Here is the caller graph for this function:

bool OPvPCapturePointNA::HandleCustomSpell ( Player player,
uint32  spellId,
GameObject go 
)
overridevirtual

Reimplemented from OPvPCapturePoint.

306 {
307  std::vector<uint32> nodes;
308  nodes.resize(2);
309  bool retval = false;
310  switch (spellId)
311  {
312  case NA_SPELL_FLY_NORTH:
313  nodes[0] = FlightPathStartNodes[NA_ROOST_N];
314  nodes[1] = FlightPathEndNodes[NA_ROOST_N];
315  player->ActivateTaxiPathTo(nodes);
316  player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
317  player->UpdatePvP(true, true);
318  retval = true;
319  break;
320  case NA_SPELL_FLY_SOUTH:
321  nodes[0] = FlightPathStartNodes[NA_ROOST_S];
322  nodes[1] = FlightPathEndNodes[NA_ROOST_S];
323  player->ActivateTaxiPathTo(nodes);
324  player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
325  player->UpdatePvP(true, true);
326  retval = true;
327  break;
328  case NA_SPELL_FLY_WEST:
329  nodes[0] = FlightPathStartNodes[NA_ROOST_W];
330  nodes[1] = FlightPathEndNodes[NA_ROOST_W];
331  player->ActivateTaxiPathTo(nodes);
332  player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
333  player->UpdatePvP(true, true);
334  retval = true;
335  break;
336  case NA_SPELL_FLY_EAST:
337  nodes[0] = FlightPathStartNodes[NA_ROOST_E];
338  nodes[1] = FlightPathEndNodes[NA_ROOST_E];
339  player->ActivateTaxiPathTo(nodes);
340  player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP);
341  player->UpdatePvP(true, true);
342  retval = true;
343  break;
344  default:
345  break;
346  }
347 
348  if (retval)
349  {
350  //Adding items
351  uint32 noSpaceForCount = 0;
352 
353  // check space and find places
354  ItemPosCountVec dest;
355 
356  int32 count = 10;
357  uint32 itemid = 24538;
358  // bomb id count
359  InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemid, count, &noSpaceForCount);
360  if (msg != EQUIP_ERR_OK) // convert to possible store amount
361  count -= noSpaceForCount;
362 
363  if (count == 0 || dest.empty()) // can't add any
364  {
365  return true;
366  }
367 
368  Item* item = player->StoreNewItem(dest, itemid, true);
369 
370  if (count > 0 && item)
371  {
372  player->SendNewItem(item, count, true, false);
373  }
374 
375  return true;
376  }
377  return false;
378 }
Definition: Unit.h:379
Definition: Player.h:526
Definition: OutdoorPvPNA.h:122
Definition: OutdoorPvPNA.h:97
Definition: OutdoorPvPNA.h:98
const uint32 FlightPathEndNodes[FLIGHT_NODES_NUM]
Definition: OutdoorPvPNA.h:115
Definition: Item.h:48
Definition: Unit.h:378
Definition: OutdoorPvPNA.h:120
Definition: Item.h:259
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
const uint32 FlightPathStartNodes[FLIGHT_NODES_NUM]
Definition: OutdoorPvPNA.h:114
Definition: OutdoorPvPNA.h:121
Definition: OutdoorPvPNA.h:96
Definition: OutdoorPvPNA.h:99
Definition: UpdateFields.h:191
InventoryResult
Definition: Item.h:46
Definition: OutdoorPvPNA.h:119
int32 OPvPCapturePointNA::HandleOpenGo ( Player player,
GameObject go 
)
overridevirtual

Reimplemented from OPvPCapturePoint.

381 {
382  int32 retval = OPvPCapturePoint::HandleOpenGo(player, go);
383  if (retval >= 0)
384  {
385  const go_type * gos = NULL;
387  gos=AllianceControlGOs;
388  else if (m_ControllingFaction == HORDE)
389  gos=HordeControlGOs;
390  else
391  return -1;
392 
393  int32 del = -1;
394  int32 del2 = -1;
395  int32 add = -1;
396  int32 add2 = -1;
397 
398  switch (retval)
399  {
401  del = NA_DESTROYED_ROOST_S;
402  add = NA_ROOST_S;
403  add2 = NA_BOMB_WAGON_S;
406  else
409  break;
411  del = NA_DESTROYED_ROOST_N;
412  add = NA_ROOST_N;
413  add2 = NA_BOMB_WAGON_N;
416  else
419  break;
421  del = NA_DESTROYED_ROOST_W;
422  add = NA_ROOST_W;
423  add2 = NA_BOMB_WAGON_W;
426  else
429  break;
431  del = NA_DESTROYED_ROOST_E;
432  add = NA_ROOST_E;
433  add2 = NA_BOMB_WAGON_E;
436  else
439  break;
440  case NA_BOMB_WAGON_S:
441  del = NA_BOMB_WAGON_S;
442  del2 = NA_ROOST_S;
443  add = NA_DESTROYED_ROOST_S;
446  else
449  break;
450  case NA_BOMB_WAGON_N:
451  del = NA_BOMB_WAGON_N;
452  del2 = NA_ROOST_N;
453  add = NA_DESTROYED_ROOST_N;
456  else
459  break;
460  case NA_BOMB_WAGON_W:
461  del = NA_BOMB_WAGON_W;
462  del2 = NA_ROOST_W;
463  add = NA_DESTROYED_ROOST_W;
466  else
469  break;
470  case NA_BOMB_WAGON_E:
471  del = NA_BOMB_WAGON_E;
472  del2 = NA_ROOST_E;
473  add = NA_DESTROYED_ROOST_E;
476  else
479  break;
480  default:
481  return -1;
482  break;
483  }
484 
485  if (del>-1)
486  DelObject(del);
487 
488  if (del2>-1)
489  DelObject(del2);
490 
491  if (add>-1)
492  AddObject(add, gos[add].entry, gos[add].map, gos[add].x, gos[add].y, gos[add].z, gos[add].o, gos[add].rot0, gos[add].rot1, gos[add].rot2, gos[add].rot3);
493 
494  if (add2>-1)
495  AddObject(add2, gos[add2].entry, gos[add2].map, gos[add2].x, gos[add2].y, gos[add2].z, gos[add2].o, gos[add2].rot0, gos[add2].rot1, gos[add2].rot2, gos[add2].rot3);
496 
497  return retval;
498  }
499  return -1;
500 }
Definition: OutdoorPvPNA.h:109
Definition: OutdoorPvPNA.h:240
uint32 m_WyvernStateNorth
Definition: OutdoorPvPNA.h:297
uint32 m_ControllingFaction
Definition: OutdoorPvPNA.h:295
Definition: OutdoorPvPNA.h:242
Definition: OutdoorPvPNA.h:97
bool DelObject(uint32 type)
Definition: OutdoorPvP.cpp:195
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: OutdoorPvPNA.h:98
Definition: OutdoorPvPNA.h:106
virtual int32 HandleOpenGo(Player *player, GameObject *go)
Definition: OutdoorPvP.cpp:546
Definition: SharedDefines.h:1000
const go_type HordeControlGOs[NA_CONTROL_GO_NUM]
Definition: OutdoorPvPNA.h:126
uint32 m_WyvernStateWest
Definition: OutdoorPvPNA.h:300
Definition: OutdoorPvPNA.h:101
G3D::int16 z
Definition: Vector3int16.h:46
int32_t int32
Definition: Define.h:146
G3D::int16 y
Definition: Vector2int16.h:38
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
uint32 m_WyvernStateEast
Definition: OutdoorPvPNA.h:299
Definition: OutdoorPvPNA.h:96
void UpdateWyvernRoostWorldState(uint32 roost)
Definition: OutdoorPvPNA.cpp:591
Definition: OutdoorPvPNA.h:108
Definition: OutdoorPvPNA.h:99
Definition: OutdoorPvPNA.h:104
Definition: OutdoorPvPNA.h:243
G3D::int16 x
Definition: Vector2int16.h:37
Definition: OutdoorPvPNA.h:107
Definition: OutdoorPvPNA.h:241
Definition: OutdoorPvPNA.h:102
uint32 m_WyvernStateSouth
Definition: OutdoorPvPNA.h:298
Definition: OutdoorPvPNA.h:103
Definition: OutdoorPvP.h:53
const go_type AllianceControlGOs[NA_CONTROL_GO_NUM]
Definition: OutdoorPvPNA.h:145

+ Here is the call graph for this function:

void OPvPCapturePointNA::SpawnGOsForTeam ( uint32  team)
protected
105 {
106  const go_type * gos = NULL;
107  if (team == ALLIANCE)
108  gos=AllianceControlGOs;
109  else if (team == HORDE)
110  gos=HordeControlGOs;
111  else
112  return;
113  for (int i = 0; i < NA_CONTROL_GO_NUM; ++i)
114  {
115  if (i == NA_ROOST_S ||
116  i == NA_ROOST_W ||
117  i == NA_ROOST_N ||
118  i == NA_ROOST_E ||
119  i == NA_BOMB_WAGON_S ||
120  i == NA_BOMB_WAGON_W ||
121  i == NA_BOMB_WAGON_N ||
122  i == NA_BOMB_WAGON_E)
123  continue; // roosts and bomb wagons are spawned when someone uses the matching destroyed roost
124  AddObject(i, gos[i].entry, gos[i].map, gos[i].x, gos[i].y, gos[i].z, gos[i].o, gos[i].rot0, gos[i].rot1, gos[i].rot2, gos[i].rot3);
125  }
126 }
Definition: OutdoorPvPNA.h:97
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: OutdoorPvPNA.h:98
Definition: SharedDefines.h:1000
const go_type HordeControlGOs[NA_CONTROL_GO_NUM]
Definition: OutdoorPvPNA.h:126
Definition: OutdoorPvPNA.h:101
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
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: OutdoorPvPNA.h:96
Definition: OutdoorPvPNA.h:99
Definition: OutdoorPvPNA.h:104
G3D::int16 x
Definition: Vector2int16.h:37
Definition: OutdoorPvPNA.h:102
Definition: OutdoorPvPNA.h:103
Definition: OutdoorPvP.h:53
const go_type AllianceControlGOs[NA_CONTROL_GO_NUM]
Definition: OutdoorPvPNA.h:145
Definition: OutdoorPvPNA.h:111

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void OPvPCapturePointNA::SpawnNPCsForTeam ( uint32  team)
protected
86 {
87  creature_type const* creatures = nullptr;
88  if (team == ALLIANCE)
89  creatures = AllianceControlNPCs;
90  else if (team == HORDE)
91  creatures = HordeControlNPCs;
92  else
93  return;
94  for (int i = 0; i < NA_CONTROL_NPC_NUM; ++i)
95  AddCreature(i, creatures[i].entry, creatures[i].map, creatures[i].x, creatures[i].y, creatures[i].z, creatures[i].o, OutdoorPvP::GetTeamIdByTeam(team), 1000000);
96 }
static TeamId GetTeamIdByTeam(uint32 team)
Definition: OutdoorPvP.h:249
Definition: SharedDefines.h:1000
G3D::int16 z
Definition: Vector3int16.h:46
G3D::int16 y
Definition: Vector2int16.h:38
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
Definition: SharedDefines.h:999
Definition: OutdoorPvP.h:68
const creature_type HordeControlNPCs[NA_CONTROL_NPC_NUM]
Definition: OutdoorPvPNA.h:190
const creature_type AllianceControlNPCs[NA_CONTROL_NPC_NUM]
Definition: OutdoorPvPNA.h:214
G3D::int16 x
Definition: Vector2int16.h:37
Definition: OutdoorPvPNA.h:187

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool OPvPCapturePointNA::Update ( uint32  diff)
overridevirtual

Reimplemented from OPvPCapturePoint.

503 {
504  // let the controlling faction advance in phase
505  bool capturable = false;
506  if (m_ControllingFaction == ALLIANCE && m_activePlayers[0].size() > m_activePlayers[1].size())
507  capturable = true;
508  else if (m_ControllingFaction == HORDE && m_activePlayers[0].size() < m_activePlayers[1].size())
509  capturable = true;
510 
511  if (m_GuardCheckTimer < diff)
512  {
514  uint32 cnt = GetAliveGuardsCount();
515  if (cnt != m_GuardsAlive)
516  {
517  m_GuardsAlive = cnt;
518  if (m_GuardsAlive == 0)
519  m_capturable = true;
520  // update the guard count for the players in zone
522  }
523  } else m_GuardCheckTimer -= diff;
524 
525  if (m_capturable || capturable)
526  {
527  if (m_RespawnTimer < diff)
528  {
529  // if the guards have been killed, then the challenger has one hour to take over halaa.
530  // in case they fail to do it, the guards are respawned, and they have to start again.
534  } else m_RespawnTimer -= diff;
535 
536  return OPvPCapturePoint::Update(diff);
537  }
538  return false;
539 }
bool m_capturable
Definition: OutdoorPvPNA.h:291
uint32 m_ControllingFaction
Definition: OutdoorPvPNA.h:295
OutdoorPvP * m_PvP
Definition: OutdoorPvP.h:177
GuidSet m_activePlayers[2]
Definition: OutdoorPvP.h:155
uint32 m_GuardCheckTimer
Definition: OutdoorPvPNA.h:306
void FactionTakeOver(uint32 team)
Definition: OutdoorPvPNA.cpp:136
uint32 m_RespawnTimer
Definition: OutdoorPvPNA.h:304
uint32 m_GuardsAlive
Definition: OutdoorPvPNA.h:293
Definition: SharedDefines.h:1000
virtual bool Update(uint32 diff)
Definition: OutdoorPvP.cpp:287
const uint32 NA_GUARD_CHECK_TIME
Definition: OutdoorPvPNA.h:55
uint32_t uint32
Definition: Define.h:150
Definition: SharedDefines.h:999
const uint32 NA_RESPAWN_TIME
Definition: OutdoorPvPNA.h:53
uint32 GetAliveGuardsCount()
Definition: OutdoorPvPNA.cpp:44
void SendUpdateWorldState(uint32 field, uint32 value)
Definition: OutdoorPvP.cpp:409
Definition: OutdoorPvPNA.h:62

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void OPvPCapturePointNA::UpdateHalaaWorldState ( )
protected
583 {
589 }
OutdoorPvP * m_PvP
Definition: OutdoorPvP.h:177
Definition: OutdoorPvPNA.h:252
Definition: OutdoorPvPNA.h:87
Definition: OutdoorPvPNA.h:249
Definition: OutdoorPvPNA.h:88
uint32 m_HalaaState
Definition: OutdoorPvPNA.h:302
Definition: OutdoorPvPNA.h:251
Definition: OutdoorPvPNA.h:84
Definition: OutdoorPvPNA.h:86
Definition: OutdoorPvPNA.h:250
uint32_t uint32
Definition: g3dmath.h:168
void SendUpdateWorldState(uint32 field, uint32 value)
Definition: OutdoorPvP.cpp:409
Definition: OutdoorPvPNA.h:85
Definition: OutdoorPvPNA.h:248

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void OPvPCapturePointNA::UpdateWyvernRoostWorldState ( uint32  roost)
protected
592 {
593  switch (roost)
594  {
595  case NA_ROOST_S:
600  break;
601  case NA_ROOST_N:
606  break;
607  case NA_ROOST_W:
612  break;
613  case NA_ROOST_E:
618  break;
619  }
620 }
Definition: OutdoorPvPNA.h:64
Definition: OutdoorPvPNA.h:240
uint32 m_WyvernStateNorth
Definition: OutdoorPvPNA.h:297
Definition: OutdoorPvPNA.h:75
Definition: OutdoorPvPNA.h:74
OutdoorPvP * m_PvP
Definition: OutdoorPvP.h:177
Definition: OutdoorPvPNA.h:242
Definition: OutdoorPvPNA.h:77
Definition: OutdoorPvPNA.h:97
Definition: OutdoorPvPNA.h:70
Definition: OutdoorPvPNA.h:82
Definition: OutdoorPvPNA.h:76
Definition: OutdoorPvPNA.h:71
Definition: OutdoorPvPNA.h:67
Definition: OutdoorPvPNA.h:98
Definition: OutdoorPvPNA.h:81
Definition: OutdoorPvPNA.h:79
Definition: OutdoorPvPNA.h:65
uint32 m_WyvernStateWest
Definition: OutdoorPvPNA.h:300
Definition: OutdoorPvPNA.h:80
Definition: OutdoorPvPNA.h:66
Definition: OutdoorPvPNA.h:69
Definition: OutdoorPvPNA.h:72
uint32 m_WyvernStateEast
Definition: OutdoorPvPNA.h:299
Definition: OutdoorPvPNA.h:96
Definition: OutdoorPvPNA.h:99
uint32_t uint32
Definition: g3dmath.h:168
Definition: OutdoorPvPNA.h:243
Definition: OutdoorPvPNA.h:241
void SendUpdateWorldState(uint32 field, uint32 value)
Definition: OutdoorPvP.cpp:409
uint32 m_WyvernStateSouth
Definition: OutdoorPvPNA.h:298

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

bool OPvPCapturePointNA::m_capturable
private
uint32 OPvPCapturePointNA::m_ControllingFaction
private
uint32 OPvPCapturePointNA::m_GuardCheckTimer
private
uint32 OPvPCapturePointNA::m_GuardsAlive
private
uint32 OPvPCapturePointNA::m_HalaaState
private
uint32 OPvPCapturePointNA::m_RespawnTimer
private
uint32 OPvPCapturePointNA::m_WyvernStateEast
private
uint32 OPvPCapturePointNA::m_WyvernStateNorth
private
uint32 OPvPCapturePointNA::m_WyvernStateSouth
private
uint32 OPvPCapturePointNA::m_WyvernStateWest
private

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