105 virtual bool HandlePlayerEnter(
Player* player);
106 virtual GuidSet::iterator HandlePlayerLeave(
Player* player);
110 bool IsInsideObjective(
Player* player)
const;
113 virtual bool Update(
uint32 diff);
115 virtual void SendChangePhase();
117 bool SetCapturePointData(
GameObject* capturePoint);
124 bool DelCapturePoint();
169 void GiveControlTo(
TeamId team);
173 float GetDistance(
Player* player);
191 void RelocateDeadPlayers();
231 void SendInitWorldStatesTo(
Player* player);
234 void SendUpdateWorldState(
uint32 variable,
uint32 value);
243 virtual bool Update(
uint32 diff);
246 void InvitePlayersInZoneToQueue();
248 void InvitePlayersInQueueToWar();
250 void InvitePlayersInZoneToWar();
272 void KickPlayerFromBattlefield(
ObjectGuid guid);
275 void HandlePlayerEnterZone(
Player* player,
uint32 zone);
277 void HandlePlayerLeaveZone(
Player* player,
uint32 zone);
303 bool AddOrSetPlayerToCorrectBfGroup(
Player* player);
310 void RemovePlayerFromResurrectQueue(
ObjectGuid player_guid);
340 void PlayerAcceptInviteToQueue(
Player* player);
341 void PlayerAcceptInviteToWar(
Player* player);
343 void AskToLeaveQueue(
Player* player);
344 void PlayerAskToLeave(
Player* player);
358 void EndBattle(
bool endByTimer);
361 void ShowNpc(
Creature* creature,
bool aggressive);
368 void DoPlaySoundToAll(
uint32 soundID);
370 void InvitePlayerToQueue(
Player* player);
371 void InvitePlayerToWar(
Player* player);
422 void KickAfkPlayers();
428 void BroadcastPacketToZone(
WorldPacket const* data)
const;
429 void BroadcastPacketToQueue(
WorldPacket const* data)
const;
430 void BroadcastPacketToWar(
WorldPacket const* data)
const;
437 Battlefield::BfCapturePointMap::const_iterator itr = m_capturePoints.find(lowguid);
438 if (itr != m_capturePoints.end())
443 void RegisterZone(
uint32 zoneid);
444 bool HasPlayer(
Player* player)
const;
std::map< ObjectGuid, time_t > PlayerTimerMap
std::vector< BfGraveyard * > GraveyardVect
@ BATTLEFIELD_OBJECTIVE_UPDATE_INTERVAL
BattlefieldObjectiveStates
@ BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE
@ BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE
@ BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE
@ BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE
@ BF_CAPTUREPOINT_OBJECTIVESTATE_ALLIANCE
@ BF_CAPTUREPOINT_OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE
@ BF_CAPTUREPOINT_OBJECTIVESTATE_NEUTRAL
@ BATTLEFIELD_BATTLEID_WG
std::unordered_set< ObjectGuid > GuidUnorderedSet
std::set< ObjectGuid > GuidSet
uint8 constexpr PVP_TEAMS_COUNT
void Resurrect(Creature *target)
GraveyardVect m_GraveyardList
Battlefield(Battlefield const &)=delete
uint32 GetBattleId() const
std::map< ObjectGuid::LowType, BfCapturePoint * > BfCapturePointMap
typedef of map witch store capturepoint and the associate gameobject entry
virtual uint64 GetData64(uint32 dataId) const override
void AddCapturePoint(BfCapturePoint *cp)
Battlefield & operator=(Battlefield &&)=delete
std::vector< uint32 > m_Data32
void SetTimer(uint32 timer)
virtual void SendInitWorldStatesToAll()=0
Send all worldstate data to all player in zone.
virtual void OnBattleEnd(bool)
Called at the end of battle.
virtual void SetData(uint32 dataId, uint32 value) override
Battlefield(Battlefield &&)=delete
bool IsWarTime() const
Return true if battle is start, false if battle is not started.
virtual void UpdateData(uint32 index, int32 pad)
GraveyardVect GetGraveyardVector() const
virtual void DoCompleteOrIncrementAchievement(uint32, Player *, uint8)
virtual bool SetupBattlefield()
Call this to init the Battlefield.
virtual void SendRemoveWorldStates(Player *)
uint32 m_StartGroupingTimer
virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &)=0
void SetDefenderTeam(TeamId team)
uint32 m_uiKickAfkPlayersTimer
virtual void OnPlayerJoinWar(Player *)
Called when a player accept to join the battle.
uint32 m_TimeForAcceptInvite
std::vector< uint64 > m_Data64
virtual void OnBattleStart()
Called on start.
virtual void SetData64(uint32 dataId, uint64 value) override
Battlefield & operator=(Battlefield const &)=delete
uint32 m_RestartAfterCrash
TeamId GetAttackerTeam() const
virtual void HandleKill(Player *, Unit *)
Called when a Unit is kill in battlefield zone.
bool CanFlyIn()
Return if we can use mount in battlefield.
TeamId GetDefenderTeam() const
virtual uint32 GetData(uint32 dataId) const override
uint32 m_LastResurrectTimer
virtual void OnPlayerLeaveZone(Player *)
Called when a player leave battlefield zone.
BfCapturePoint * GetCapturePoint(ObjectGuid::LowType lowguid) const
BfCapturePointMap m_capturePoints
uint32 m_uiKickDontAcceptTimer
void ToggleBattlefield(bool enable)
Enable or Disable battlefield.
virtual void OnStartGrouping()
Called x minutes before battle start when player in zone are invite to join queue.
WorldLocation KickPosition
virtual void OnPlayerLeaveWar(Player *)
Called when a player leave the battle.
void SetGraveyardNumber(uint32 number)
void TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2=0)
TeamId GetOtherTeam(TeamId team) const
bool IsEnabled() const
Return if battlefield is enable.
virtual void OnPlayerEnterZone(Player *)
Called when a player enter in battlefield zone.
virtual void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates &)
uint32 GetCapturePointEntry() const
BattlefieldObjectiveStates m_OldState
virtual void ChangeTeam(TeamId)
BfCapturePoint(BfCapturePoint const &)=delete
BfCapturePoint & operator=(BfCapturePoint &&)=delete
BfCapturePoint & operator=(BfCapturePoint const &)=delete
uint32 m_capturePointEntry
ObjectGuid m_capturePointGUID
BattlefieldObjectiveStates m_State
virtual ~BfCapturePoint()
BfCapturePoint(BfCapturePoint &&)=delete
bool HasPlayer(ObjectGuid guid)
BfGraveyard(BfGraveyard const &)=delete
BfGraveyard(BfGraveyard &&)=delete
BfGraveyard & operator=(BfGraveyard const &)=delete
BfGraveyard & operator=(BfGraveyard &&)=delete
TeamId GetControlTeamId() const
uint32 GetGraveyardId() const