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

#include <OutdoorPvPTF.h>

Public Member Functions

 OutdoorPvPTF ()
 
bool SetupOutdoorPvP () override
 
void HandlePlayerEnterZone (Player *player, uint32 zone) override
 
void HandlePlayerLeaveZone (Player *player, uint32 zone) override
 
bool Update (uint32 diff) override
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet) override
 
void SendRemoveWorldStates (Player *player) override
 
uint32 GetAllianceTowersControlled () const
 
void SetAllianceTowersControlled (uint32 count)
 
uint32 GetHordeTowersControlled () const
 
void SetHordeTowersControlled (uint32 count)
 
bool IsLocked () const
 
- Public Member Functions inherited from OutdoorPvP
 OutdoorPvP ()
 
virtual ~OutdoorPvP ()
 
void DeleteSpawns ()
 
virtual bool HandleAreaTrigger (Player *, uint32, bool)
 
virtual bool HandleCustomSpell (Player *player, uint32 spellId, GameObject *go)
 
virtual bool HandleOpenGo (Player *player, GameObject *go)
 
void OnGameObjectCreate (GameObject *go) override
 
void OnGameObjectRemove (GameObject *go) override
 
void OnCreatureCreate (Creature *) override
 
void SendUpdateWorldState (uint32 field, uint32 value)
 
virtual void HandleKill (Player *killer, Unit *killed)
 
virtual void HandleKillImpl (Player *, Unit *)
 
bool IsInsideObjective (Player *player) const
 
virtual void AwardKillBonus (Player *)
 
uint32 GetTypeId () const
 
virtual bool HandleDropFlag (Player *player, uint32 spellId)
 
virtual bool HandleGossipOption (Player *player, Creature *creature, uint32 gossipid)
 
virtual bool CanTalkTo (Player *player, Creature *c, GossipMenuItems const &gso)
 
void TeamApplyBuff (TeamId team, uint32 spellId, uint32 spellId2=0)
 
void SendDefenseMessage (uint32 zoneId, uint32 id)
 
MapGetMap () const
 
- Public Member Functions inherited from ZoneScript
 ZoneScript ()
 
virtual ~ZoneScript ()
 
virtual uint32 GetCreatureEntry (ObjectGuid::LowType, CreatureData const *data)
 
virtual uint32 GetGameObjectEntry (ObjectGuid::LowType, uint32 entry)
 
virtual void OnCreatureRemove (Creature *)
 
virtual void OnUnitDeath (Unit *)
 
virtual ObjectGuid GetGuidData (uint32) const
 
virtual void SetGuidData (uint32, ObjectGuid)
 
virtual uint64 GetData64 (uint32) const
 
virtual void SetData64 (uint32, uint64)
 
virtual uint32 GetData (uint32) const
 
virtual void SetData (uint32, uint32)
 
virtual void ProcessEvent (WorldObject *, uint32)
 

Private Attributes

bool m_IsLocked
 
uint32 m_LockTimer
 
uint32 m_LockTimerUpdate
 
uint32 m_AllianceTowersControlled
 
uint32 m_HordeTowersControlled
 
uint32 hours_left
 
uint32 second_digit
 
uint32 first_digit
 

Additional Inherited Members

- Public Types inherited from OutdoorPvP
typedef std::map
< ObjectGuid::LowType,
OPvPCapturePoint * > 
OPvPCapturePointMap
 
- Static Public Member Functions inherited from OutdoorPvP
static TeamId GetTeamIdByTeam (uint32 team)
 
- Protected Member Functions inherited from OutdoorPvP
void BroadcastPacket (WorldPacket const *data) const
 
virtual void HandlePlayerResurrects (Player *player, uint32 zone)
 
void AddCapturePoint (OPvPCapturePoint *cp)
 
OPvPCapturePointGetCapturePoint (ObjectGuid::LowType guid) const
 
void RegisterZone (uint32 zoneid)
 
bool HasPlayer (Player const *player) const
 
void TeamCastSpell (TeamId team, int32 spellId)
 
template<class Worker >
void BroadcastWorker (Worker &_worker, uint32 zoneId)
 
void SetMapFromZone (uint32 zone)
 
- Protected Attributes inherited from OutdoorPvP
OPvPCapturePointMap m_capturePoints
 
GuidSet m_players [2]
 
uint32 m_TypeId
 
bool m_sendUpdate
 
Mapm_map
 

Constructor & Destructor Documentation

OutdoorPvPTF::OutdoorPvPTF ( )
28 {
30 
31  m_IsLocked = false;
34 
37 
38  hours_left = 6;
39  second_digit = 0;
40  first_digit = 0;
41 }
uint32 hours_left
Definition: OutdoorPvPTF.h:181
uint32 second_digit
Definition: OutdoorPvPTF.h:181
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPTF.h:178
uint32 first_digit
Definition: OutdoorPvPTF.h:181
uint32 m_LockTimerUpdate
Definition: OutdoorPvPTF.h:176
const uint32 TF_LOCK_TIME
Definition: OutdoorPvPTF.h:45
bool m_IsLocked
Definition: OutdoorPvPTF.h:174
uint32 m_TypeId
Definition: OutdoorPvP.h:273
Definition: OutdoorPvP.h:32
uint32 m_LockTimer
Definition: OutdoorPvPTF.h:175
uint32 m_HordeTowersControlled
Definition: OutdoorPvPTF.h:179

Member Function Documentation

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

Reimplemented from OutdoorPvP.

57 {
64 
68 
69  for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
70  itr->second->FillInitialWorldStates(packet);
71 }
uint32 hours_left
Definition: OutdoorPvPTF.h:181
Definition: OutdoorPvPTF.h:116
std::list< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
uint32 second_digit
Definition: OutdoorPvPTF.h:181
Definition: OutdoorPvPTF.h:120
OPvPCapturePointMap m_capturePoints
Definition: OutdoorPvP.h:269
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPTF.h:178
uint32 first_digit
Definition: OutdoorPvPTF.h:181
Definition: OutdoorPvPTF.h:112
Definition: OutdoorPvPTF.h:111
Definition: OutdoorPvPTF.h:119
bool m_IsLocked
Definition: OutdoorPvPTF.h:174
Definition: OutdoorPvPTF.h:115
Definition: OutdoorPvPTF.h:118
int32_t int32
Definition: g3dmath.h:167
Definition: OutdoorPvPTF.h:117
uint32_t uint32
Definition: g3dmath.h:168
uint32 m_HordeTowersControlled
Definition: OutdoorPvPTF.h:179
Definition: OutdoorPvPTF.h:113
uint32 OutdoorPvPTF::GetAllianceTowersControlled ( ) const
192 {
194 }
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPTF.h:178
uint32 OutdoorPvPTF::GetHordeTowersControlled ( ) const
202 {
204 }
uint32 m_HordeTowersControlled
Definition: OutdoorPvPTF.h:179
void OutdoorPvPTF::HandlePlayerEnterZone ( Player player,
uint32  zone 
)
overridevirtual

Reimplemented from OutdoorPvP.

170 {
171  if (player->GetTeam() == ALLIANCE)
172  {
174  player->CastSpell(player, TF_CAPTURE_BUFF, true);
175  }
176  else
177  {
179  player->CastSpell(player, TF_CAPTURE_BUFF, true);
180  }
181  OutdoorPvP::HandlePlayerEnterZone(player, zone);
182 }
virtual void HandlePlayerEnterZone(Player *player, uint32 zone)
Definition: OutdoorPvP.cpp:257
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPTF.h:178
Definition: SharedDefines.h:1000
Definition: OutdoorPvPTF.h:63
#define TF_CAPTURE_BUFF
Definition: OutdoorPvPTF.h:51
uint32 m_HordeTowersControlled
Definition: OutdoorPvPTF.h:179

+ Here is the call graph for this function:

void OutdoorPvPTF::HandlePlayerLeaveZone ( Player player,
uint32  zone 
)
overridevirtual

Reimplemented from OutdoorPvP.

185 {
186  // remove buffs
187  player->RemoveAurasDueToSpell(TF_CAPTURE_BUFF);
188  OutdoorPvP::HandlePlayerLeaveZone(player, zone);
189 }
#define TF_CAPTURE_BUFF
Definition: OutdoorPvPTF.h:51
virtual void HandlePlayerLeaveZone(Player *player, uint32 zone)
Definition: OutdoorPvP.cpp:262

+ Here is the call graph for this function:

bool OutdoorPvPTF::IsLocked ( ) const
212 {
213  return m_IsLocked;
214 }
bool m_IsLocked
Definition: OutdoorPvPTF.h:174
void OutdoorPvPTF::SendRemoveWorldStates ( Player player)
overridevirtual

Reimplemented from OutdoorPvP.

74 {
75  player->SendUpdateWorldState(TF_UI_TOWER_COUNT_H, uint32(0));
76  player->SendUpdateWorldState(TF_UI_TOWER_COUNT_A, uint32(0));
77  player->SendUpdateWorldState(TF_UI_TOWERS_CONTROLLED_DISPLAY, uint32(0));
78 
79  player->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT, uint32(0));
80  player->SendUpdateWorldState(TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT, uint32(0));
81  player->SendUpdateWorldState(TF_UI_LOCKED_TIME_HOURS, uint32(0));
82 
83  player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_NEUTRAL, uint32(0));
84  player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE, uint32(0));
85  player->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE, uint32(0));
86 
87  for (int i = 0; i < TF_TOWER_NUM; ++i)
88  {
89  player->SendUpdateWorldState(uint32(TFTowerWorldStates[i].n), uint32(0));
90  player->SendUpdateWorldState(uint32(TFTowerWorldStates[i].h), uint32(0));
91  player->SendUpdateWorldState(uint32(TFTowerWorldStates[i].a), uint32(0));
92  }
93 }
Definition: OutdoorPvPTF.h:116
Definition: OutdoorPvPTF.h:120
Definition: OutdoorPvPTF.h:112
Definition: OutdoorPvPTF.h:63
Definition: OutdoorPvPTF.h:111
Definition: OutdoorPvPTF.h:119
const tf_tower_world_state TFTowerWorldStates[TF_TOWER_NUM]
Definition: OutdoorPvPTF.h:82
Definition: OutdoorPvPTF.h:115
Definition: OutdoorPvPTF.h:118
Definition: OutdoorPvPTF.h:117
uint32_t uint32
Definition: g3dmath.h:168
Definition: OutdoorPvPTF.h:113
void OutdoorPvPTF::SetAllianceTowersControlled ( uint32  count)
197 {
199 }
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPTF.h:178
void OutdoorPvPTF::SetHordeTowersControlled ( uint32  count)
207 {
208  m_HordeTowersControlled = count;
209 }
uint32 m_HordeTowersControlled
Definition: OutdoorPvPTF.h:179
bool OutdoorPvPTF::SetupOutdoorPvP ( )
overridevirtual

Reimplemented from OutdoorPvP.

217 {
220 
221  m_IsLocked = false;
223  m_LockTimerUpdate = 0;
224  hours_left = 6;
225  second_digit = 0;
226  first_digit = 0;
227 
229 
230  // add the zones affected by the pvp buff
231  for (uint8 i = 0; i < OutdoorPvPTFBuffZonesNum; ++i)
233 
239 
240  return true;
241 }
uint32 hours_left
Definition: OutdoorPvPTF.h:181
Definition: OutdoorPvPTF.h:62
void SetMapFromZone(uint32 zone)
Definition: OutdoorPvP.cpp:651
uint32 second_digit
Definition: OutdoorPvPTF.h:181
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPTF.h:178
uint32 first_digit
Definition: OutdoorPvPTF.h:181
uint32 m_LockTimerUpdate
Definition: OutdoorPvPTF.h:176
const uint32 TF_LOCK_TIME
Definition: OutdoorPvPTF.h:45
Definition: OutdoorPvPTF.h:61
void RegisterZone(uint32 zoneid)
Definition: OutdoorPvP.cpp:583
bool m_IsLocked
Definition: OutdoorPvPTF.h:174
void AddCapturePoint(OPvPCapturePoint *cp)
Definition: OutdoorPvP.cpp:564
const uint32 OutdoorPvPTFBuffZones[OutdoorPvPTFBuffZonesNum]
Definition: OutdoorPvPTF.h:35
uint8_t uint8
Definition: Define.h:152
Definition: OutdoorPvPTF.h:60
Definition: OutdoorPvPTF.h:130
uint32 m_LockTimer
Definition: OutdoorPvPTF.h:175
Definition: OutdoorPvPTF.h:58
Definition: OutdoorPvPTF.h:59
const uint8 OutdoorPvPTFBuffZonesNum
Definition: OutdoorPvPTF.h:33
uint32 m_HordeTowersControlled
Definition: OutdoorPvPTF.h:179

+ Here is the call graph for this function:

bool OutdoorPvPTF::Update ( uint32  diff)
overridevirtual

Reimplemented from OutdoorPvP.

103 {
104  bool changed = OutdoorPvP::Update(diff);
105 
106  if (changed)
107  {
109  {
111  m_IsLocked = true;
116  }
118  {
120  m_IsLocked = true;
125  }
126  else
127  {
130  }
133  }
134  if (m_IsLocked)
135  {
136  // lock timer is down, release lock
137  if (m_LockTimer < diff)
138  {
140  m_LockTimerUpdate = 0;
141  m_IsLocked = false;
146  }
147  else
148  {
149  // worldstateui update timer is down, update ui with new time data
150  if (m_LockTimerUpdate < diff)
151  {
153  uint32 minutes_left = m_LockTimer / 60000;
154  hours_left = minutes_left / 60;
155  minutes_left -= hours_left * 60;
156  second_digit = minutes_left % 10;
157  first_digit = minutes_left / 10;
158 
162  } else m_LockTimerUpdate -= diff;
163  m_LockTimer -= diff;
164  }
165  }
166  return changed;
167 }
uint32 hours_left
Definition: OutdoorPvPTF.h:181
const uint32 TF_LOCK_TIME_UPDATE
Definition: OutdoorPvPTF.h:48
void TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2=0)
Definition: OutdoorPvP.cpp:610
void TeamCastSpell(TeamId team, int32 spellId)
Definition: OutdoorPvP.cpp:594
Definition: OutdoorPvPTF.h:116
uint32 second_digit
Definition: OutdoorPvPTF.h:181
Definition: OutdoorPvPTF.h:120
uint32 m_AllianceTowersControlled
Definition: OutdoorPvPTF.h:178
uint32 first_digit
Definition: OutdoorPvPTF.h:181
uint32 m_LockTimerUpdate
Definition: OutdoorPvPTF.h:176
Definition: OutdoorPvPTF.h:112
const uint32 TF_LOCK_TIME
Definition: OutdoorPvPTF.h:45
Definition: OutdoorPvPTF.h:63
Definition: OutdoorPvPTF.h:111
uint32_t uint32
Definition: Define.h:150
Definition: SharedDefines.h:992
Definition: OutdoorPvPTF.h:119
bool m_IsLocked
Definition: OutdoorPvPTF.h:174
Definition: OutdoorPvPTF.h:115
Definition: OutdoorPvPTF.h:118
Definition: OutdoorPvPTF.h:117
virtual bool Update(uint32 diff)
Definition: OutdoorPvP.cpp:276
uint32_t uint32
Definition: g3dmath.h:168
#define TF_CAPTURE_BUFF
Definition: OutdoorPvPTF.h:51
Definition: SharedDefines.h:993
void SendUpdateWorldState(uint32 field, uint32 value)
Definition: OutdoorPvP.cpp:409
uint32 m_LockTimer
Definition: OutdoorPvPTF.h:175
uint32 m_HordeTowersControlled
Definition: OutdoorPvPTF.h:179
Definition: OutdoorPvPTF.h:113

+ Here is the call graph for this function:

Member Data Documentation

uint32 OutdoorPvPTF::first_digit
private
uint32 OutdoorPvPTF::hours_left
private
uint32 OutdoorPvPTF::m_AllianceTowersControlled
private
uint32 OutdoorPvPTF::m_HordeTowersControlled
private
bool OutdoorPvPTF::m_IsLocked
private
uint32 OutdoorPvPTF::m_LockTimer
private
uint32 OutdoorPvPTF::m_LockTimerUpdate
private
uint32 OutdoorPvPTF::second_digit
private

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