TrinityCore
Battlefield Class Reference

#include <Battlefield.h>

+ Inheritance diagram for Battlefield:

Public Types

typedef std::unordered_map< uint32, std::unique_ptr< BattlefieldControlZoneHandler > > ControlZoneHandlerMap
 typedef of map witch store capturepoint and the associate gameobject entry More...
 

Public Member Functions

 Battlefield (Map *map)
 Constructor. More...
 
 Battlefield (Battlefield const &right)=delete
 
 Battlefield (Battlefield &&right)=delete
 
Battlefieldoperator= (Battlefield const &right)=delete
 
Battlefieldoperator= (Battlefield &&right)=delete
 
virtual ~Battlefield ()
 Destructor. More...
 
virtual bool SetupBattlefield ()
 Call this to init the Battlefield. More...
 
virtual bool Update (uint32 diff)
 Called every time for update bf data and time. More...
 
void InvitePlayersInZoneToQueue ()
 Invite all players in zone to join the queue, called x minutes before battle start in Update() More...
 
void InvitePlayersInQueueToWar ()
 Invite all players in queue to join battle on battle start. More...
 
void InvitePlayersInZoneToWar ()
 Invite all players in zone to join battle on battle start. More...
 
virtual void HandleKill (Player *, Unit *)
 Called when a Unit is kill in battlefield zone. More...
 
uint32 GetTypeId () const
 
uint32 GetZoneId () const
 
uint32 GetMapId () const
 
MapGetMap () const
 
uint64 GetQueueId () const
 
void TeamApplyBuff (TeamId team, uint32 spellId, uint32 spellId2=0)
 
bool IsWarTime () const
 Return true if battle is start, false if battle is not started. More...
 
int8 GetState () const
 
void ToggleBattlefield (bool enable)
 Enable or Disable battlefield. More...
 
bool IsEnabled () const
 Return if battlefield is enable. More...
 
void KickPlayerFromBattlefield (ObjectGuid guid)
 Kick player from battlefield and teleport him to kick-point location. More...
 
void HandlePlayerEnterZone (Player *player, uint32 zone)
 Called when player (player) enter in zone. More...
 
void HandlePlayerLeaveZone (Player *player, uint32 zone)
 Called when player (player) leave the zone. More...
 
virtual uint64 GetData64 (uint32 dataId) const override
 
virtual void SetData64 (uint32 dataId, uint64 value) override
 
virtual uint32 GetData (uint32 dataId) const override
 
virtual void SetData (uint32 dataId, uint32 value) override
 
virtual void UpdateData (uint32 index, int32 pad)
 
TeamId GetDefenderTeam () const
 
TeamId GetAttackerTeam () const
 
TeamId GetOtherTeam (TeamId team) const
 
void SetDefenderTeam (TeamId team)
 
GroupGetFreeBfRaid (TeamId TeamId)
 Find a not full battlefield group, if there is no, create one. More...
 
GroupGetGroupPlayer (ObjectGuid guid, TeamId TeamId)
 Return battlefield group where player is. More...
 
bool AddOrSetPlayerToCorrectBfGroup (Player *player)
 Force player to join a battlefield group. More...
 
WorldSafeLocsEntry const * GetClosestGraveyard (Player *player)
 
void SetGraveyardNumber (uint32 number)
 
BfGraveyardGetGraveyardById (uint32 id) const
 
CreatureSpawnCreature (uint32 entry, Position const &pos)
 
GameObjectSpawnGameObject (uint32 entry, Position const &pos, QuaternionData const &rot)
 
CreatureGetCreature (ObjectGuid guid)
 
GameObjectGetGameObject (ObjectGuid guid)
 
virtual void OnBattleStart ()
 Called on start. More...
 
virtual void OnBattleEnd (bool)
 Called at the end of battle. More...
 
virtual void OnStartGrouping ()
 Called x minutes before battle start when player in zone are invite to join queue. More...
 
virtual void OnPlayerJoinWar (Player *)
 Called when a player accept to join the battle. More...
 
virtual void OnPlayerLeaveWar (Player *)
 Called when a player leave the battle. More...
 
virtual void OnPlayerLeaveZone (Player *)
 Called when a player leave battlefield zone. More...
 
virtual void OnPlayerEnterZone (Player *)
 Called when a player enter in battlefield zone. More...
 
void SendWarning (uint8 id, WorldObject const *target=nullptr)
 
void PlayerAcceptInviteToQueue (Player *player)
 
void PlayerAcceptInviteToWar (Player *player)
 
uint32 GetBattleId () const
 
void AskToLeaveQueue (Player *player)
 
void PlayerAskToLeave (Player *player)
 
virtual void DoCompleteOrIncrementAchievement (uint32, Player *, uint8)
 
bool CanFlyIn ()
 Return if we can use mount in battlefield. More...
 
void StartBattle ()
 
void EndBattle (bool endByTimer)
 
void HideNpc (Creature *creature)
 
void ShowNpc (Creature *creature, bool aggressive)
 
GraveyardVect GetGraveyardVector () const
 
uint32 GetTimer () const
 
void SetTimer (uint32 timer)
 
void DoPlaySoundToAll (uint32 SoundID)
 
void InvitePlayerToQueue (Player *player)
 
void InvitePlayerToWar (Player *player)
 
void InitStalker (uint32 entry, Position const &pos)
 
void ProcessEvent (WorldObject *target, uint32 eventId, WorldObject *invoker) override
 
- Public Member Functions inherited from ZoneScript
 ZoneScript ()
 
 ZoneScript (ZoneScript const &right)
 
 ZoneScript (ZoneScript &&right) noexcept
 
ZoneScriptoperator= (ZoneScript const &right)
 
ZoneScriptoperator= (ZoneScript &&right) noexcept
 
virtual ~ZoneScript ()
 
virtual uint32 GetCreatureEntry (ObjectGuid::LowType, CreatureData const *data)
 
virtual uint32 GetGameObjectEntry (ObjectGuid::LowType, uint32 entry)
 
virtual void OnCreatureCreate (Creature *)
 
virtual void OnCreatureRemove (Creature *)
 
virtual void OnGameObjectCreate (GameObject *)
 
virtual void OnGameObjectRemove (GameObject *)
 
virtual void OnAreaTriggerCreate (AreaTrigger *areaTrigger)
 
virtual void OnAreaTriggerRemove (AreaTrigger *areaTrigger)
 
virtual void OnUnitDeath (Unit *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 TriggerGameEvent (uint32 gameEventId, WorldObject *source=nullptr, WorldObject *target=nullptr)
 
virtual void ProcessEvent (WorldObject *, uint32, WorldObject *)
 
virtual void DoAction (uint32 actionId, WorldObject *source=nullptr, WorldObject *target=nullptr)
 
virtual void OnFlagStateChange (GameObject *flagInBase, FlagState oldValue, FlagState newValue, Player *player)
 
virtual bool CanCaptureFlag (AreaTrigger *areaTrigger, Player *player)
 
virtual void OnCaptureFlag (AreaTrigger *areaTrigger, Player *player)
 

Protected Member Functions

void KickAfkPlayers ()
 
virtual void SendRemoveWorldStates (Player *)
 
void BroadcastPacketToZone (WorldPacket const *data) const
 
void BroadcastPacketToQueue (WorldPacket const *data) const
 
void BroadcastPacketToWar (WorldPacket const *data) const
 
void RegisterZone (uint32 zoneid)
 
bool HasPlayer (Player *player) const
 
void TeamCastSpell (TeamId team, int32 spellId)
 

Protected Attributes

ObjectGuid StalkerGuid
 
uint32 m_Timer
 
bool m_IsEnabled
 
bool m_isActive
 
TeamId m_DefenderTeam
 
ControlZoneHandlerMap ControlZoneHandlers
 
GuidUnorderedSet m_players [PVP_TEAMS_COUNT]
 
GuidUnorderedSet m_PlayersInQueue [PVP_TEAMS_COUNT]
 
GuidUnorderedSet m_PlayersInWar [PVP_TEAMS_COUNT]
 
PlayerTimerMap m_InvitedPlayers [PVP_TEAMS_COUNT]
 
PlayerTimerMap m_PlayersWillBeKick [PVP_TEAMS_COUNT]
 
uint32 m_TypeId
 
uint32 m_BattleId
 
uint32 m_ZoneId
 
uint32 m_MapId
 
Mapm_Map
 
uint32 m_MaxPlayer
 
uint32 m_MinPlayer
 
uint32 m_MinLevel
 
uint32 m_BattleTime
 
uint32 m_NoWarBattleTime
 
uint32 m_RestartAfterCrash
 
uint32 m_TimeForAcceptInvite
 
uint32 m_uiKickDontAcceptTimer
 
WorldLocation KickPosition
 
uint32 m_uiKickAfkPlayersTimer
 
GraveyardVect m_GraveyardList
 
uint32 m_StartGroupingTimer
 
bool m_StartGrouping
 
GuidUnorderedSet m_Groups [PVP_TEAMS_COUNT]
 
std::vector< uint64m_Data64
 
std::vector< uint32m_Data32
 

Friends

class BattlefieldMgr
 

Detailed Description

Definition at line 140 of file Battlefield.h.

Member Typedef Documentation

◆ ControlZoneHandlerMap

typedef std::unordered_map<uint32 , std::unique_ptr<BattlefieldControlZoneHandler> > Battlefield::ControlZoneHandlerMap

typedef of map witch store capturepoint and the associate gameobject entry

Definition at line 156 of file Battlefield.h.

Constructor & Destructor Documentation

◆ Battlefield() [1/3]

Battlefield::Battlefield ( Map map)
explicit

Constructor.

Definition at line 36 of file Battlefield.cpp.

+ Here is the call graph for this function:

◆ Battlefield() [2/3]

Battlefield::Battlefield ( Battlefield const &  right)
delete

◆ Battlefield() [3/3]

Battlefield::Battlefield ( Battlefield &&  right)
delete

◆ ~Battlefield()

Battlefield::~Battlefield ( )
virtual

Destructor.

Definition at line 63 of file Battlefield.cpp.

Member Function Documentation

◆ AddOrSetPlayerToCorrectBfGroup()

bool Battlefield::AddOrSetPlayerToCorrectBfGroup ( Player player)

Force player to join a battlefield group.

Definition at line 517 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AskToLeaveQueue()

void Battlefield::AskToLeaveQueue ( Player player)

Definition at line 385 of file Battlefield.cpp.

+ Here is the call graph for this function:

◆ BroadcastPacketToQueue()

void Battlefield::BroadcastPacketToQueue ( WorldPacket const *  data) const
protected

Definition at line 441 of file Battlefield.cpp.

+ Here is the call graph for this function:

◆ BroadcastPacketToWar()

void Battlefield::BroadcastPacketToWar ( WorldPacket const *  data) const
protected

Definition at line 449 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BroadcastPacketToZone()

void Battlefield::BroadcastPacketToZone ( WorldPacket const *  data) const
protected

Definition at line 433 of file Battlefield.cpp.

+ Here is the call graph for this function:

◆ CanFlyIn()

bool Battlefield::CanFlyIn ( )
inline

Return if we can use mount in battlefield.

Definition at line 277 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ DoCompleteOrIncrementAchievement()

virtual void Battlefield::DoCompleteOrIncrementAchievement ( uint32  ,
Player ,
uint8   
)
inlinevirtual

Reimplemented in BattlefieldWG.

Definition at line 274 of file Battlefield.h.

◆ DoPlaySoundToAll()

void Battlefield::DoPlaySoundToAll ( uint32  SoundID)

Definition at line 367 of file Battlefield.cpp.

+ Here is the call graph for this function:

◆ EndBattle()

void Battlefield::EndBattle ( bool  endByTimer)

Definition at line 349 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAttackerTeam()

TeamId Battlefield::GetAttackerTeam ( ) const
inline

Definition at line 220 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ GetBattleId()

uint32 Battlefield::GetBattleId ( ) const
inline

Definition at line 270 of file Battlefield.h.

◆ GetClosestGraveyard()

WorldSafeLocsEntry const * Battlefield::GetClosestGraveyard ( Player player)

Definition at line 569 of file Battlefield.cpp.

+ Here is the call graph for this function:

◆ GetCreature()

Creature * Battlefield::GetCreature ( ObjectGuid  guid)

Definition at line 713 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetData()

virtual uint32 Battlefield::GetData ( uint32  dataId) const
inlineoverridevirtual

Reimplemented from ZoneScript.

Reimplemented in BattlefieldWG.

Definition at line 214 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ GetData64()

virtual uint64 Battlefield::GetData64 ( uint32  dataId) const
inlineoverridevirtual

Reimplemented from ZoneScript.

Definition at line 210 of file Battlefield.h.

◆ GetDefenderTeam()

TeamId Battlefield::GetDefenderTeam ( ) const
inline

Definition at line 219 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ GetFreeBfRaid()

Group * Battlefield::GetFreeBfRaid ( TeamId  TeamId)

Find a not full battlefield group, if there is no, create one.

Parameters
TeamId: Id of player team for who we search a group (player->GetTeamId())

Definition at line 497 of file Battlefield.cpp.

+ Here is the caller graph for this function:

◆ GetGameObject()

GameObject * Battlefield::GetGameObject ( ObjectGuid  guid)

Definition at line 720 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetGraveyardById()

BfGraveyard * Battlefield::GetGraveyardById ( uint32  id) const

Definition at line 554 of file Battlefield.cpp.

+ Here is the caller graph for this function:

◆ GetGraveyardVector()

GraveyardVect Battlefield::GetGraveyardVector ( ) const
inline

Definition at line 285 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ GetGroupPlayer()

Group * Battlefield::GetGroupPlayer ( ObjectGuid  guid,
TeamId  TeamId 
)

Return battlefield group where player is.

Definition at line 507 of file Battlefield.cpp.

◆ GetMap()

Map * Battlefield::GetMap ( ) const
inline

Definition at line 183 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ GetMapId()

uint32 Battlefield::GetMapId ( ) const
inline

Definition at line 182 of file Battlefield.h.

◆ GetOtherTeam()

TeamId Battlefield::GetOtherTeam ( TeamId  team) const
inline

Definition at line 221 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ GetQueueId()

uint64 Battlefield::GetQueueId ( ) const

Definition at line 232 of file Battlefield.cpp.

+ Here is the call graph for this function:

◆ GetState()

int8 Battlefield::GetState ( ) const
inline

Definition at line 191 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ GetTimer()

uint32 Battlefield::GetTimer ( ) const
inline

Definition at line 287 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ GetTypeId()

uint32 Battlefield::GetTypeId ( ) const
inline

Definition at line 180 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ GetZoneId()

uint32 Battlefield::GetZoneId ( ) const
inline

Definition at line 181 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ HandleKill()

virtual void Battlefield::HandleKill ( Player ,
Unit  
)
inlinevirtual

Called when a Unit is kill in battlefield zone.

Reimplemented in BattlefieldTB, and BattlefieldWG.

Definition at line 178 of file Battlefield.h.

◆ HandlePlayerEnterZone()

void Battlefield::HandlePlayerEnterZone ( Player player,
uint32  zone 
)

Called when player (player) enter in zone.

Todo:
Send a packet to announce it to player

Definition at line 70 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandlePlayerLeaveZone()

void Battlefield::HandlePlayerLeaveZone ( Player player,
uint32  zone 
)

Called when player (player) leave the zone.

Definition at line 99 of file Battlefield.cpp.

+ Here is the call graph for this function:

◆ HasPlayer()

bool Battlefield::HasPlayer ( Player player) const
protected

Definition at line 372 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HideNpc()

void Battlefield::HideNpc ( Creature creature)

Definition at line 468 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InitStalker()

void Battlefield::InitStalker ( uint32  entry,
Position const &  pos 
)

Definition at line 269 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InvitePlayersInQueueToWar()

void Battlefield::InvitePlayersInQueueToWar ( )

Invite all players in queue to join battle on battle start.

Definition at line 193 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InvitePlayersInZoneToQueue()

void Battlefield::InvitePlayersInZoneToQueue ( )

Invite all players in zone to join the queue, called x minutes before battle start in Update()

Definition at line 176 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InvitePlayersInZoneToWar()

void Battlefield::InvitePlayersInZoneToWar ( )

Invite all players in zone to join battle on battle start.

Definition at line 213 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InvitePlayerToQueue()

void Battlefield::InvitePlayerToQueue ( Player player)

Definition at line 184 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InvitePlayerToWar()

void Battlefield::InvitePlayerToWar ( Player player)
Todo:
needed ?

Definition at line 237 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsEnabled()

bool Battlefield::IsEnabled ( ) const
inline

Return if battlefield is enable.

Definition at line 196 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ IsWarTime()

bool Battlefield::IsWarTime ( ) const
inline

Return true if battle is start, false if battle is not started.

Definition at line 189 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ KickAfkPlayers()

void Battlefield::KickAfkPlayers ( )
protected

Definition at line 313 of file Battlefield.cpp.

+ Here is the call graph for this function:

◆ KickPlayerFromBattlefield()

void Battlefield::KickPlayerFromBattlefield ( ObjectGuid  guid)

Kick player from battlefield and teleport him to kick-point location.

Parameters
guid: guid of player who must be kick

Definition at line 322 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ OnBattleEnd()

virtual void Battlefield::OnBattleEnd ( bool  )
inlinevirtual

Called at the end of battle.

Reimplemented in BattlefieldTB, and BattlefieldWG.

Definition at line 254 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ OnBattleStart()

virtual void Battlefield::OnBattleStart ( )
inlinevirtual

Called on start.

Reimplemented in BattlefieldTB, and BattlefieldWG.

Definition at line 252 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ OnPlayerEnterZone()

virtual void Battlefield::OnPlayerEnterZone ( Player )
inlinevirtual

Called when a player enter in battlefield zone.

Reimplemented in BattlefieldTB, and BattlefieldWG.

Definition at line 264 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ OnPlayerJoinWar()

virtual void Battlefield::OnPlayerJoinWar ( Player )
inlinevirtual

Called when a player accept to join the battle.

Reimplemented in BattlefieldTB, and BattlefieldWG.

Definition at line 258 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ OnPlayerLeaveWar()

virtual void Battlefield::OnPlayerLeaveWar ( Player )
inlinevirtual

Called when a player leave the battle.

Reimplemented in BattlefieldTB, and BattlefieldWG.

Definition at line 260 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ OnPlayerLeaveZone()

virtual void Battlefield::OnPlayerLeaveZone ( Player )
inlinevirtual

Called when a player leave battlefield zone.

Reimplemented in BattlefieldTB, and BattlefieldWG.

Definition at line 262 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ OnStartGrouping()

virtual void Battlefield::OnStartGrouping ( )
inlinevirtual

Called x minutes before battle start when player in zone are invite to join queue.

Reimplemented in BattlefieldTB, and BattlefieldWG.

Definition at line 256 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ operator=() [1/2]

Battlefield & Battlefield::operator= ( Battlefield &&  right)
delete

◆ operator=() [2/2]

Battlefield & Battlefield::operator= ( Battlefield const &  right)
delete

◆ PlayerAcceptInviteToQueue()

void Battlefield::PlayerAcceptInviteToQueue ( Player player)

Definition at line 378 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PlayerAcceptInviteToWar()

void Battlefield::PlayerAcceptInviteToWar ( Player player)

Definition at line 400 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PlayerAskToLeave()

void Battlefield::PlayerAskToLeave ( Player player)

Definition at line 392 of file Battlefield.cpp.

+ Here is the call graph for this function:

◆ ProcessEvent()

void Battlefield::ProcessEvent ( WorldObject target,
uint32  eventId,
WorldObject invoker 
)
overridevirtual

Reimplemented from ZoneScript.

Reimplemented in BattlefieldTB, and BattlefieldWG.

Definition at line 277 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RegisterZone()

void Battlefield::RegisterZone ( uint32  zoneid)
protected

Definition at line 463 of file Battlefield.cpp.

+ Here is the caller graph for this function:

◆ SendRemoveWorldStates()

virtual void Battlefield::SendRemoveWorldStates ( Player )
inlineprotectedvirtual

Definition at line 347 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ SendWarning()

void Battlefield::SendWarning ( uint8  id,
WorldObject const *  target = nullptr 
)

Definition at line 457 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetData()

virtual void Battlefield::SetData ( uint32  dataId,
uint32  value 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

Definition at line 215 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ SetData64()

virtual void Battlefield::SetData64 ( uint32  dataId,
uint64  value 
)
inlineoverridevirtual

Reimplemented from ZoneScript.

Definition at line 211 of file Battlefield.h.

◆ SetDefenderTeam()

void Battlefield::SetDefenderTeam ( TeamId  team)
inline

Definition at line 222 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ SetGraveyardNumber()

void Battlefield::SetGraveyardNumber ( uint32  number)
inline

Definition at line 239 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ SetTimer()

void Battlefield::SetTimer ( uint32  timer)
inline

Definition at line 288 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ SetupBattlefield()

virtual bool Battlefield::SetupBattlefield ( )
inlinevirtual

Call this to init the Battlefield.

Reimplemented in BattlefieldTB, and BattlefieldWG.

Definition at line 159 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ ShowNpc()

void Battlefield::ShowNpc ( Creature creature,
bool  aggressive 
)

Definition at line 478 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SpawnCreature()

Creature * Battlefield::SpawnCreature ( uint32  entry,
Position const &  pos 
)

Definition at line 663 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SpawnGameObject()

GameObject * Battlefield::SpawnGameObject ( uint32  entry,
Position const &  pos,
QuaternionData const &  rot 
)

Definition at line 689 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ StartBattle()

void Battlefield::StartBattle ( )

Definition at line 329 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TeamApplyBuff()

void Battlefield::TeamApplyBuff ( TeamId  team,
uint32  spellId,
uint32  spellId2 = 0 
)

◆ TeamCastSpell()

void Battlefield::TeamCastSpell ( TeamId  team,
int32  spellId 
)
protected

Definition at line 417 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToggleBattlefield()

void Battlefield::ToggleBattlefield ( bool  enable)
inline

Enable or Disable battlefield.

Definition at line 194 of file Battlefield.h.

+ Here is the caller graph for this function:

◆ Update()

bool Battlefield::Update ( uint32  diff)
virtual

Called every time for update bf data and time.

  • Update timer for start/end battle
  • Invite player in zone to queue m_StartGroupingTimer minutes before start
  • Kick Afk players
    Parameters
    diff: time ellapsed since last call (in ms)

Reimplemented in BattlefieldTB.

Definition at line 121 of file Battlefield.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateData()

virtual void Battlefield::UpdateData ( uint32  index,
int32  pad 
)
inlinevirtual

Definition at line 216 of file Battlefield.h.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ BattlefieldMgr

friend class BattlefieldMgr
friend

Definition at line 142 of file Battlefield.h.

Member Data Documentation

◆ ControlZoneHandlers

ControlZoneHandlerMap Battlefield::ControlZoneHandlers
protected

Definition at line 306 of file Battlefield.h.

◆ KickPosition

WorldLocation Battlefield::KickPosition
protected

Definition at line 329 of file Battlefield.h.

◆ m_BattleId

uint32 Battlefield::m_BattleId
protected

Definition at line 317 of file Battlefield.h.

◆ m_BattleTime

uint32 Battlefield::m_BattleTime
protected

Definition at line 324 of file Battlefield.h.

◆ m_Data32

std::vector<uint32> Battlefield::m_Data32
protected

Definition at line 342 of file Battlefield.h.

◆ m_Data64

std::vector<uint64> Battlefield::m_Data64
protected

Definition at line 341 of file Battlefield.h.

◆ m_DefenderTeam

TeamId Battlefield::m_DefenderTeam
protected

Definition at line 303 of file Battlefield.h.

◆ m_GraveyardList

GraveyardVect Battlefield::m_GraveyardList
protected

Definition at line 334 of file Battlefield.h.

◆ m_Groups

GuidUnorderedSet Battlefield::m_Groups[PVP_TEAMS_COUNT]
protected

Definition at line 339 of file Battlefield.h.

◆ m_InvitedPlayers

PlayerTimerMap Battlefield::m_InvitedPlayers[PVP_TEAMS_COUNT]
protected

Definition at line 312 of file Battlefield.h.

◆ m_isActive

bool Battlefield::m_isActive
protected

Definition at line 302 of file Battlefield.h.

◆ m_IsEnabled

bool Battlefield::m_IsEnabled
protected

Definition at line 301 of file Battlefield.h.

◆ m_Map

Map* Battlefield::m_Map
protected

Definition at line 320 of file Battlefield.h.

◆ m_MapId

uint32 Battlefield::m_MapId
protected

Definition at line 319 of file Battlefield.h.

◆ m_MaxPlayer

uint32 Battlefield::m_MaxPlayer
protected

Definition at line 321 of file Battlefield.h.

◆ m_MinLevel

uint32 Battlefield::m_MinLevel
protected

Definition at line 323 of file Battlefield.h.

◆ m_MinPlayer

uint32 Battlefield::m_MinPlayer
protected

Definition at line 322 of file Battlefield.h.

◆ m_NoWarBattleTime

uint32 Battlefield::m_NoWarBattleTime
protected

Definition at line 325 of file Battlefield.h.

◆ m_players

GuidUnorderedSet Battlefield::m_players[PVP_TEAMS_COUNT]
protected

Definition at line 309 of file Battlefield.h.

◆ m_PlayersInQueue

GuidUnorderedSet Battlefield::m_PlayersInQueue[PVP_TEAMS_COUNT]
protected

Definition at line 310 of file Battlefield.h.

◆ m_PlayersInWar

GuidUnorderedSet Battlefield::m_PlayersInWar[PVP_TEAMS_COUNT]
protected

Definition at line 311 of file Battlefield.h.

◆ m_PlayersWillBeKick

PlayerTimerMap Battlefield::m_PlayersWillBeKick[PVP_TEAMS_COUNT]
protected

Definition at line 313 of file Battlefield.h.

◆ m_RestartAfterCrash

uint32 Battlefield::m_RestartAfterCrash
protected

Definition at line 326 of file Battlefield.h.

◆ m_StartGrouping

bool Battlefield::m_StartGrouping
protected

Definition at line 337 of file Battlefield.h.

◆ m_StartGroupingTimer

uint32 Battlefield::m_StartGroupingTimer
protected

Definition at line 336 of file Battlefield.h.

◆ m_TimeForAcceptInvite

uint32 Battlefield::m_TimeForAcceptInvite
protected

Definition at line 327 of file Battlefield.h.

◆ m_Timer

uint32 Battlefield::m_Timer
protected

Definition at line 300 of file Battlefield.h.

◆ m_TypeId

uint32 Battlefield::m_TypeId
protected

Definition at line 316 of file Battlefield.h.

◆ m_uiKickAfkPlayersTimer

uint32 Battlefield::m_uiKickAfkPlayersTimer
protected

Definition at line 331 of file Battlefield.h.

◆ m_uiKickDontAcceptTimer

uint32 Battlefield::m_uiKickDontAcceptTimer
protected

Definition at line 328 of file Battlefield.h.

◆ m_ZoneId

uint32 Battlefield::m_ZoneId
protected

Definition at line 318 of file Battlefield.h.

◆ StalkerGuid

ObjectGuid Battlefield::StalkerGuid
protected

Definition at line 299 of file Battlefield.h.


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