TrinityCore
BattlegroundWS Class Reference

#include <BattlegroundWS.h>

Public Member Functions

 BattlegroundWS (BattlegroundTemplate const *battlegroundTemplate)
 
 ~BattlegroundWS ()
 
void AddPlayer (Player *player) override
 
void StartingEventCloseDoors () override
 
void StartingEventOpenDoors () override
 
ObjectGuid GetFlagPickerGUID (int32 team) const override
 
void SetAllianceFlagPicker (ObjectGuid guid)
 
void SetHordeFlagPicker (ObjectGuid guid)
 
bool IsAllianceFlagPickedup () const
 
bool IsHordeFlagPickedup () const
 
void RespawnFlag (uint32 Team, bool captured)
 
void RespawnFlagAfterDrop (uint32 Team)
 
uint8 GetFlagState (uint32 team)
 
void EventPlayerDroppedFlag (Player *player) override
 
void EventPlayerClickedOnFlag (Player *player, GameObject *target_obj) override
 
void EventPlayerCapturedFlag (Player *player)
 
void RemovePlayer (Player *player, ObjectGuid guid, uint32 team) override
 
void HandleAreaTrigger (Player *player, uint32 trigger, bool entered) override
 
void HandleKillPlayer (Player *player, Player *killer) override
 
bool SetupBattleground () override
 
void Reset () override
 
void EndBattleground (uint32 winner) override
 
WorldSafeLocsEntry const * GetClosestGraveyard (Player *player) override
 
WorldSafeLocsEntry const * GetExploitTeleportLocation (Team team) override
 
void UpdateFlagState (uint32 team, uint32 value)
 
void SetLastFlagCapture (uint32 team)
 
void UpdateTeamScore (uint32 team)
 
bool UpdatePlayerScore (Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
 
void SetDroppedFlagGUID (ObjectGuid guid, int32 team=-1) override
 
ObjectGuid GetDroppedFlagGUID (uint32 TeamID)
 
void FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &packet) override
 
void AddPoint (uint32 TeamID, uint32 Points=1)
 
void SetTeamPoint (uint32 TeamID, uint32 Points=0)
 
void RemovePoint (uint32 TeamID, uint32 Points=1)
 
uint32 GetPrematureWinner () override
 
bool CheckAchievementCriteriaMeet (uint32 criteriaId, Player const *source, Unit const *target=nullptr, uint32 miscvalue1=0) override
 
- Public Member Functions inherited from Battleground
 Battleground (BattlegroundTemplate const *battlegroundTemplate)
 
 Battleground (Battleground const &)
 
virtual ~Battleground ()
 
Battlegroundoperator= (Battleground const &)=delete
 
void Update (uint32 diff)
 
virtual void ResetBGSubclass ()
 
virtual void DestroyGate (Player *, GameObject *)
 
virtual bool IsAllNodesControlledByTeam (uint32) const
 
void StartCriteriaTimer (CriteriaStartEvent startEvent, uint32 entry)
 
char const * GetName () const
 
BattlegroundQueueTypeId GetQueueId () const
 
BattlegroundTypeId GetTypeID (bool getRandom=false) const
 
BattlegroundBracketId GetBracketId () const
 
uint32 GetInstanceID () const
 
BattlegroundStatus GetStatus () const
 
uint32 GetClientInstanceID () const
 
uint32 GetElapsedTime () const
 
uint32 GetRemainingTime () const
 
uint32 GetLastResurrectTime () const
 
uint32 GetMaxPlayers () const
 
uint32 GetMinPlayers () const
 
uint32 GetMinLevel () const
 
uint32 GetMaxLevel () const
 
uint32 GetMaxPlayersPerTeam () const
 
uint32 GetMinPlayersPerTeam () const
 
int32 GetStartDelayTime () const
 
uint8 GetArenaType () const
 
BattlegroundTeamId GetWinner () const
 
uint32 GetScriptId () const
 
uint32 GetBonusHonorFromKill (uint32 kills) const
 
bool IsRandom () const
 
void SetQueueId (BattlegroundQueueTypeId queueId)
 
void SetRandomTypeID (BattlegroundTypeId TypeID)
 
void SetBracket (PVPDifficultyEntry const *bracketEntry)
 
void SetInstanceID (uint32 InstanceID)
 
void SetStatus (BattlegroundStatus Status)
 
void SetClientInstanceID (uint32 InstanceID)
 
void SetElapsedTime (uint32 Time)
 
void SetRemainingTime (uint32 Time)
 
void SetLastResurrectTime (uint32 Time)
 
void SetRated (bool state)
 
void SetArenaType (uint8 type)
 
void SetWinner (BattlegroundTeamId winnerTeamId)
 
void ModifyStartDelayTime (int diff)
 
void SetStartDelayTime (int Time)
 
void AddToBGFreeSlotQueue ()
 
void RemoveFromBGFreeSlotQueue ()
 
void DecreaseInvitedCount (uint32 team)
 
void IncreaseInvitedCount (uint32 team)
 
void SetRandom (bool isRandom)
 
uint32 GetInvitedCount (uint32 team) const
 
bool HasFreeSlots () const
 
uint32 GetFreeSlotsForTeam (uint32 Team) const
 
bool isArena () const
 
bool isBattleground () const
 
bool isRated () const
 
BattlegroundPlayerMap const & GetPlayers () const
 
uint32 GetPlayersSize () const
 
uint32 GetPlayerScoresSize () const
 
uint32 GetReviveQueueSize () const
 
void AddPlayerToResurrectQueue (ObjectGuid npc_guid, ObjectGuid player_guid)
 
void RemovePlayerFromResurrectQueue (ObjectGuid player_guid)
 
void RelocateDeadPlayers (ObjectGuid guideGuid)
 Relocate all players in ReviveQueue to the closest graveyard. More...
 
void StartBattleground ()
 
GameObjectGetBGObject (uint32 type, bool logError=true)
 
CreatureGetBGCreature (uint32 type, bool logError=true)
 
uint32 GetMapId () const
 
void SetBgMap (BattlegroundMap *map)
 
BattlegroundMapGetBgMap () const
 
BattlegroundMapFindBgMap () const
 
WorldSafeLocsEntry const * GetTeamStartPosition (TeamId teamId) const
 
float GetStartMaxDist () const
 
void SendPacketToTeam (uint32 teamId, WorldPacket const *packet, Player *except=nullptr) const
 
void SendPacketToAll (WorldPacket const *packet) const
 
void SendChatMessage (Creature *source, uint8 textId, WorldObject *target=nullptr)
 
void SendBroadcastText (uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
 
template<class Do >
void BroadcastWorker (Do &_do)
 
void PlaySoundToTeam (uint32 SoundID, uint32 TeamID)
 
void PlaySoundToAll (uint32 SoundID)
 
void CastSpellOnTeam (uint32 SpellID, uint32 TeamID)
 
void RemoveAuraOnTeam (uint32 SpellID, uint32 TeamID)
 
void RewardHonorToTeam (uint32 Honor, uint32 TeamID)
 
void RewardReputationToTeam (uint32 faction_id, uint32 Reputation, uint32 TeamID)
 
void UpdateWorldState (uint32 variable, uint32 value, bool hidden=false)
 
void BlockMovement (Player *player)
 
void SendMessageToAll (uint32 entry, ChatMsg type, Player const *source=nullptr)
 
void PSendMessageToAll (uint32 entry, ChatMsg type, Player const *source,...)
 
GroupGetBgRaid (uint32 TeamID) const
 
void SetBgRaid (uint32 TeamID, Group *bg_raid)
 
virtual void BuildPvPLogDataPacket (WorldPackets::Battleground::PVPMatchStatistics &pvpLogData) const
 
uint32 GetPlayersCountByTeam (uint32 Team) const
 
uint32 GetAlivePlayersCountByTeam (uint32 Team) const
 
void UpdatePlayersCountByTeam (uint32 Team, bool remove)
 
virtual void CheckWinConditions ()
 
void SetArenaTeamIdForTeam (uint32 Team, uint32 ArenaTeamId)
 
uint32 GetArenaTeamIdForTeam (uint32 Team) const
 
uint32 GetArenaTeamIdByIndex (uint32 index) const
 
void SetArenaMatchmakerRating (uint32 Team, uint32 MMR)
 
uint32 GetArenaMatchmakerRating (uint32 Team) const
 
virtual void HandleKillUnit (Creature *, Player *)
 
void EventPlayerLoggedIn (Player *player)
 
void EventPlayerLoggedOut (Player *player)
 
virtual void ProcessEvent (WorldObject *, uint32, WorldObject *=nullptr)
 
virtual void DoAction (uint32, ObjectGuid)
 
virtual void HandlePlayerResurrect (Player *)
 
void TeleportPlayerToExploitLocation (Player *player)
 
void AddOrSetPlayerToCorrectBgGroup (Player *player, uint32 team)
 
virtual void RemovePlayerAtLeave (ObjectGuid guid, bool Transport, bool SendPacket)
 
void HandleTriggerBuff (ObjectGuid go_guid)
 
void SetHoliday (bool is_holiday)
 
void SpawnBGObject (uint32 type, uint32 respawntime)
 
virtual bool AddObject (uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime=0, GOState goState=GO_STATE_READY)
 
bool AddObject (uint32 type, uint32 entry, Position const &pos, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime=0, GOState goState=GO_STATE_READY)
 
virtual CreatureAddCreature (uint32 entry, uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL, uint32 respawntime=0, Transport *transport=nullptr)
 
CreatureAddCreature (uint32 entry, uint32 type, Position const &pos, TeamId teamId=TEAM_NEUTRAL, uint32 respawntime=0, Transport *transport=nullptr)
 
bool DelCreature (uint32 type)
 
bool DelObject (uint32 type)
 
virtual bool AddSpiritGuide (uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL)
 
bool AddSpiritGuide (uint32 type, Position const &pos, TeamId teamId=TEAM_NEUTRAL)
 
int32 GetObjectType (ObjectGuid guid)
 
void DoorOpen (uint32 type)
 
void DoorClose (uint32 type)
 
virtual bool HandlePlayerUnderMap (Player *)
 
uint32 GetPlayerTeam (ObjectGuid guid) const
 
uint32 GetOtherTeam (uint32 teamId) const
 
bool IsPlayerInBattleground (ObjectGuid guid) const
 
bool ToBeDeleted () const
 
void SetDeleteThis ()
 
void RewardXPAtKill (Player *killer, Player *victim)
 
bool CanAwardArenaPoints () const
 
virtual void HandleQuestComplete (uint32, Player *)
 
virtual bool CanActivateGO (int32, uint32) const
 
virtual bool IsSpellAllowed (uint32, Player const *) const
 
uint32 GetTeamScore (uint32 TeamID) const
 
uint8 GetUniqueBracketId () const
 
void AddPlayerPosition (WorldPackets::Battleground::BattlegroundPlayerPosition const &position)
 
void RemovePlayerPosition (ObjectGuid guid)
 

Protected Member Functions

void PostUpdateImpl (uint32 diff) override
 Post-update hook. More...
 
- Protected Member Functions inherited from Battleground
void EndNow ()
 
void PlayerAddedToBGCheckIfBGIsRunning (Player *player)
 
Player_GetPlayer (ObjectGuid guid, bool offlineRemove, char const *context) const
 
Player_GetPlayer (BattlegroundPlayerMap::iterator itr, char const *context)
 
Player_GetPlayer (BattlegroundPlayerMap::const_iterator itr, char const *context) const
 
Player_GetPlayerForTeam (uint32 teamId, BattlegroundPlayerMap::const_iterator itr, char const *context) const
 
virtual bool PreUpdateImpl (uint32)
 Pre-update hook. More...
 
void _ProcessOfflineQueue ()
 
void _ProcessResurrect (uint32 diff)
 
void _ProcessProgress (uint32 diff)
 
void _ProcessLeave (uint32 diff)
 
void _ProcessJoin (uint32 diff)
 
void _CheckSafePositions (uint32 diff)
 
void _ProcessPlayerPositionBroadcast (uint32 diff)
 

Private Attributes

ObjectGuid m_FlagKeepers [2]
 
ObjectGuid m_DroppedFlagGUID [2]
 
uint8 _flagState [2]
 
int32 _flagsTimer [2]
 
int32 _flagsDropTimer [2]
 
uint32 _lastFlagCaptureTeam
 
uint32 m_ReputationCapture
 
uint32 m_HonorWinKills
 
uint32 m_HonorEndKills
 
int32 _flagSpellForceTimer
 
bool _bothFlagsKept
 
uint8 _flagDebuffState
 
uint8 _minutesElapsed
 

Additional Inherited Members

- Public Types inherited from Battleground
typedef std::map< ObjectGuid, BattlegroundPlayerBattlegroundPlayerMap
 
typedef std::map< ObjectGuid, BattlegroundScore * > BattlegroundScoreMap
 
- Static Public Member Functions inherited from Battleground
static TeamId GetTeamIndexByTeamId (uint32 Team)
 
- Public Attributes inherited from Battleground
GuidVector BgObjects
 
GuidVector BgCreatures
 
- Protected Attributes inherited from Battleground
BattlegroundScoreMap PlayerScores
 
BattlegroundPlayerMap m_Players
 
std::map< ObjectGuid, GuidVectorm_ReviveQueue
 
uint8 m_Events
 
BattlegroundStartTimeIntervals StartDelayTimes [BG_STARTING_EVENT_COUNT]
 
uint32 StartMessageIds [BG_STARTING_EVENT_COUNT]
 
bool m_BuffChange
 
bool m_IsRandom
 
BGHonorMode m_HonorMode
 
int32 m_TeamScores [BG_TEAMS_COUNT]
 

Constructor & Destructor Documentation

◆ BattlegroundWS()

BattlegroundWS::BattlegroundWS ( BattlegroundTemplate const *  battlegroundTemplate)
46  : Battleground(battlegroundTemplate)
47 {
50 
54 
56  _bothFlagsKept = false;
57  _flagDebuffState = 0;
70  m_HonorWinKills = 0;
71  m_HonorEndKills = 0;
72  _minutesElapsed = 0;
73 }
Definition: Battleground.h:205
Definition: BattlegroundWS.h:36
Battleground(BattlegroundTemplate const *battlegroundTemplate)
Definition: Battleground.cpp:54
Definition: BattlegroundWS.h:155
Definition: Battleground.h:206
int32 _flagSpellForceTimer
Definition: BattlegroundWS.h:288
uint32 _lastFlagCaptureTeam
Definition: BattlegroundWS.h:283
Definition: BattlegroundWS.h:37
uint8 _minutesElapsed
Definition: BattlegroundWS.h:291
ObjectGuid m_DroppedFlagGUID[2]
Definition: BattlegroundWS.h:279
Definition: Battleground.h:204
GuidVector BgObjects
Definition: Battleground.h:468
uint8 _flagState[2]
Definition: BattlegroundWS.h:280
GuidVector BgCreatures
Definition: Battleground.h:469
uint32 StartMessageIds[BG_STARTING_EVENT_COUNT]
Definition: Battleground.h:574
Definition: SharedDefines.h:1073
void Clear()
Definition: ObjectGuid.h:266
Definition: BattlegroundWS.h:130
uint32 m_HonorEndKills
Definition: BattlegroundWS.h:287
uint32 m_HonorWinKills
Definition: BattlegroundWS.h:286
bool _bothFlagsKept
Definition: BattlegroundWS.h:289
Definition: BattlegroundWS.h:107
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:278
int32 _flagsDropTimer[2]
Definition: BattlegroundWS.h:282
Definition: BattlegroundWS.h:35
int32 _flagsTimer[2]
Definition: BattlegroundWS.h:281
Definition: SharedDefines.h:1074
uint32 m_ReputationCapture
Definition: BattlegroundWS.h:285
uint8 _flagDebuffState
Definition: BattlegroundWS.h:290
+ Here is the call graph for this function:

◆ ~BattlegroundWS()

BattlegroundWS::~BattlegroundWS ( )
75 { }

Member Function Documentation

◆ AddPlayer()

void BattlegroundWS::AddPlayer ( Player player)
overridevirtual

Reimplemented from Battleground.

231 {
232  Battleground::AddPlayer(player);
233  PlayerScores[player->GetGUID()] = new BattlegroundWGScore(player->GetGUID(), player->GetBGTeam());
234 }
ObjectGuid const & GetGUID() const
Definition: Object.h:154
uint32 GetBGTeam() const
Definition: Player.cpp:23638
Definition: BattlegroundWS.h:172
virtual void AddPlayer(Player *player)
Definition: Battleground.cpp:1032
BattlegroundScoreMap PlayerScores
Definition: Battleground.h:561
+ Here is the call graph for this function:

◆ AddPoint()

void BattlegroundWS::AddPoint ( uint32  TeamID,
uint32  Points = 1 
)
inline
int32 m_TeamScores[BG_TEAMS_COUNT]
Definition: Battleground.h:580
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:411
+ Here is the caller graph for this function:

◆ CheckAchievementCriteriaMeet()

bool BattlegroundWS::CheckAchievementCriteriaMeet ( uint32  criteriaId,
Player const *  source,
Unit const *  target = nullptr,
uint32  miscvalue1 = 0 
)
overridevirtual

Reimplemented from Battleground.

873 {
874  switch (criteriaId)
875  {
877  if (target)
878  if (Player const* playerTarget = target->ToPlayer())
879  return GetFlagState(playerTarget->GetTeam()) == BG_WS_FLAG_STATE_ON_BASE;
880  return false;
881  }
882 
883  return Battleground::CheckAchievementCriteriaMeet(criteriaId, player, target, miscValue);
884 }
uint8 GetFlagState(uint32 team)
Definition: BattlegroundWS.h:235
Player * ToPlayer()
Definition: Object.h:192
virtual bool CheckAchievementCriteriaMeet(uint32, Player const *, Unit const *=nullptr, uint32=0)
Definition: Battleground.cpp:1895
Definition: Battleground.h:59
Definition: BattlegroundWS.h:130
Definition: Player.h:1056
+ Here is the call graph for this function:

◆ EndBattleground()

void BattlegroundWS::EndBattleground ( uint32  winner)
overridevirtual

Reimplemented from Battleground.

752 {
753  // Win reward
754  if (winner == ALLIANCE)
756  if (winner == HORDE)
758  // Complete map_end rewards (even if no team wins)
761 
763 }
uint32 GetBonusHonorFromKill(uint32 kills) const
Definition: Battleground.cpp:854
Definition: SharedDefines.h:1081
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
Definition: Battleground.cpp:657
Definition: SharedDefines.h:1080
uint32 m_HonorEndKills
Definition: BattlegroundWS.h:287
uint32 m_HonorWinKills
Definition: BattlegroundWS.h:286
virtual void EndBattleground(uint32 winner)
Definition: Battleground.cpp:692
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EventPlayerCapturedFlag()

void BattlegroundWS::EventPlayerCapturedFlag ( Player player)
284 {
285  if (GetStatus() != STATUS_IN_PROGRESS)
286  return;
287 
288  uint32 winner = 0;
289 
291  if (player->GetTeam() == ALLIANCE)
292  {
293  if (!IsHordeFlagPickedup())
294  return;
295  SetHordeFlagPicker(ObjectGuid::Empty); // must be before aura remove to prevent 2 events (drop+capture) at the same time
296  // horde flag in base (but not respawned yet)
298  // Drop Horde Flag from Player
300  if (_flagDebuffState == 1)
302  else if (_flagDebuffState == 2)
304 
306  AddPoint(ALLIANCE, 1);
309  }
310  else
311  {
312  if (!IsAllianceFlagPickedup())
313  return;
314  SetAllianceFlagPicker(ObjectGuid::Empty); // must be before aura remove to prevent 2 events (drop+capture) at the same time
315  // alliance flag in base (but not respawned yet)
317  // Drop Alliance Flag from Player
319  if (_flagDebuffState == 1)
321  else if (_flagDebuffState == 2)
323 
325  AddPoint(HORDE, 1);
328  }
329  //for flag capture is reward 2 honorable kills
331 
334 
335  if (player->GetTeam() == ALLIANCE)
337  else
339 
340  UpdateFlagState(player->GetTeam(), 1); // flag state none
341  UpdateTeamScore(player->GetTeamId());
342  // only flag capture should be updated
343  UpdatePlayerScore(player, SCORE_FLAG_CAPTURES, 1); // +1 flag captures
344 
345  // update last flag capture to be used if teamscore is equal
346  SetLastFlagCapture(player->GetTeam());
347 
349  winner = ALLIANCE;
350 
352  winner = HORDE;
353 
354  if (winner)
355  {
361 
363  EndBattleground(winner);
364  }
365  else
366  {
368  }
369 }
Definition: BattlegroundWS.h:76
Definition: Battleground.h:165
Definition: BattlegroundScore.h:36
bool IsAllianceFlagPickedup() const
Definition: BattlegroundWS.h:231
uint32 GetBonusHonorFromKill(uint32 kills) const
Definition: Battleground.cpp:854
Definition: SharedDefines.h:5582
static ObjectGuid const Empty
Definition: ObjectGuid.h:255
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID)
Definition: Battleground.cpp:664
Definition: BattlegroundWS.h:75
void UpdateTeamScore(uint32 team)
Definition: BattlegroundWS.cpp:604
void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
Definition: Battleground.cpp:620
Definition: BattlegroundWS.h:161
Definition: SharedDefines.h:5581
Definition: BattlegroundWS.h:81
Definition: BattlegroundWS.h:82
Definition: BattlegroundWS.h:39
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1523
Definition: BattlegroundWS.h:63
bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
Definition: BattlegroundWS.cpp:775
Definition: BattlegroundWS.h:99
void AddPoint(uint32 TeamID, uint32 Points=1)
Definition: BattlegroundWS.h:265
Definition: BattlegroundWS.cpp:34
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:411
void RemoveAurasWithInterruptFlags(InterruptFlags flag, uint32 except=0)
Definition: Unit.cpp:3905
Definition: SharedDefines.h:1081
BattlegroundStatus GetStatus() const
Definition: Battleground.h:293
void PlaySoundToAll(uint32 SoundID)
Definition: Battleground.cpp:633
uint8 _flagState[2]
Definition: BattlegroundWS.h:280
void SetHordeFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:230
uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM]
Definition: BattlegroundWS.cpp:40
uint32_t uint32
Definition: Define.h:152
Definition: BattlegroundWS.h:53
void EndBattleground(uint32 winner) override
Definition: BattlegroundWS.cpp:751
Definition: SharedDefines.h:1073
Definition: BattlegroundWS.h:160
uint32 GetTeamScore(uint32 TeamID) const
Definition: Battleground.cpp:1880
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
Definition: Battleground.cpp:657
Definition: SharedDefines.h:1080
Definition: BattlegroundWS.h:52
Definition: BattlegroundWS.h:131
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3654
void SetAllianceFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:229
bool IsHordeFlagPickedup() const
Definition: BattlegroundWS.h:232
Definition: BattlegroundWS.h:26
Definition: BattlegroundWS.h:40
TeamId GetTeamId() const
Definition: Player.h:2106
uint32 GetTeam() const
Definition: Player.h:2105
Definition: BattlegroundWS.h:66
Definition: BattlegroundWS.h:27
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:683
int32 _flagsTimer[2]
Definition: BattlegroundWS.h:281
void SetLastFlagCapture(uint32 team)
Definition: BattlegroundWS.h:252
Definition: SharedDefines.h:1074
Definition: BattlegroundWS.h:100
void UpdateFlagState(uint32 team, uint32 value)
Definition: BattlegroundWS.cpp:596
Definition: BattlegroundWS.h:84
uint32 m_ReputationCapture
Definition: BattlegroundWS.h:285
uint8 _flagDebuffState
Definition: BattlegroundWS.h:290
BGHonorMode m_HonorMode
Definition: Battleground.h:579
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EventPlayerClickedOnFlag()

void BattlegroundWS::EventPlayerClickedOnFlag ( Player player,
GameObject target_obj 
)
overridevirtual

Reimplemented from Battleground.

460 {
461  if (GetStatus() != STATUS_IN_PROGRESS)
462  return;
463 
464  //alliance flag picked up from base
466  && BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID())
467  {
471  SetAllianceFlagPicker(player->GetGUID());
473  //update world state to show correct flag carrier
476  player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG, true);
478  if (_flagState[1] == BG_WS_FLAG_STATE_ON_PLAYER)
479  _bothFlagsKept = true;
480  }
481 
482  //horde flag picked up from base
484  && BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID())
485  {
489  SetHordeFlagPicker(player->GetGUID());
491  //update world state to show correct flag carrier
494  player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG, true);
496  if (_flagState[0] == BG_WS_FLAG_STATE_ON_PLAYER)
497  _bothFlagsKept = true;
498  }
499 
500  //Alliance flag on ground(not in base) (returned or picked up again from ground!)
501  if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && player->IsWithinDistInMap(target_obj, 10)
502  && target_obj->GetGOInfo()->entry == BG_OBJECT_A_FLAG_GROUND_WS_ENTRY)
503  {
504  if (player->GetTeam() == ALLIANCE)
505  {
508  RespawnFlag(ALLIANCE, false);
512  _bothFlagsKept = false;
513  }
514  else
515  {
519  SetAllianceFlagPicker(player->GetGUID());
520  player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG, true);
523  if (_flagDebuffState == 1)
524  player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);
525  else if (_flagDebuffState == 2)
526  player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true);
528  }
529  //called in HandleGameObjectUseOpcode:
530  //target_obj->Delete();
531  }
532 
533  //Horde flag on ground(not in base) (returned or picked up again)
534  if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && player->IsWithinDistInMap(target_obj, 10)
535  && target_obj->GetGOInfo()->entry == BG_OBJECT_H_FLAG_GROUND_WS_ENTRY)
536  {
537  if (player->GetTeam() == HORDE)
538  {
541  RespawnFlag(HORDE, false);
545  _bothFlagsKept = false;
546  }
547  else
548  {
552  SetHordeFlagPicker(player->GetGUID());
553  player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG, true);
556  if (_flagDebuffState == 1)
557  player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);
558  else if (_flagDebuffState == 2)
559  player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true);
561  }
562  //called in HandleGameObjectUseOpcode:
563  //target_obj->Delete();
564  }
565 
567 }
Definition: BattlegroundWS.h:76
Definition: Battleground.h:165
Definition: Battleground.h:135
Definition: BattlegroundWS.h:56
Definition: SharedDefines.h:5582
Definition: BattlegroundWS.h:75
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition: Object.cpp:1094
Definition: BattlegroundWS.h:47
void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
Definition: Battleground.cpp:620
Definition: BattlegroundWS.h:161
Definition: SharedDefines.h:5581
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1523
Definition: BattlegroundWS.h:63
bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
Definition: BattlegroundWS.cpp:775
uint8 GetFlagState(uint32 team)
Definition: BattlegroundWS.h:235
Definition: BattlegroundWS.h:99
Definition: BattlegroundWS.h:44
Definition: BattlegroundWS.h:125
void RemoveAurasWithInterruptFlags(InterruptFlags flag, uint32 except=0)
Definition: Unit.cpp:3905
Definition: SharedDefines.h:1081
BattlegroundStatus GetStatus() const
Definition: Battleground.h:293
ObjectGuid const & GetGUID() const
Definition: Object.h:154
Definition: BattlegroundWS.h:42
Definition: BattlegroundWS.h:133
void PlaySoundToAll(uint32 SoundID)
Definition: Battleground.cpp:633
Definition: BattlegroundScore.h:37
GuidVector BgObjects
Definition: Battleground.h:468
uint8 _flagState[2]
Definition: BattlegroundWS.h:280
void SetHordeFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:230
Definition: BattlegroundWS.h:68
Definition: BattlegroundWS.h:57
Definition: SharedDefines.h:1073
Definition: BattlegroundWS.h:160
Definition: Battleground.h:134
uint32 entry
Definition: GameObjectData.h:32
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:107
Definition: SharedDefines.h:1080
Definition: BattlegroundWS.h:131
Definition: BattlegroundWS.h:124
void SetAllianceFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:229
Definition: BattlegroundWS.h:65
Definition: BattlegroundWS.h:130
bool _bothFlagsKept
Definition: BattlegroundWS.h:289
Definition: BattlegroundWS.h:55
uint32 GetTeam() const
Definition: Player.h:2105
Definition: BattlegroundWS.h:66
void CastSpell(SpellCastTargets const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2631
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:683
Definition: BattlegroundWS.h:46
Definition: SharedDefines.h:1074
Definition: BattlegroundWS.h:100
Definition: BattlegroundWS.h:132
void UpdateFlagState(uint32 team, uint32 value)
Definition: BattlegroundWS.cpp:596
void RespawnFlag(uint32 Team, bool captured)
Definition: BattlegroundWS.cpp:236
void StartCriteriaTimer(CriteriaStartEvent startEvent, uint32 entry, uint32 timeLost=0)
Definition: Player.cpp:26576
uint8 _flagDebuffState
Definition: BattlegroundWS.h:290
+ Here is the call graph for this function:

◆ EventPlayerDroppedFlag()

void BattlegroundWS::EventPlayerDroppedFlag ( Player player)
overridevirtual

Reimplemented from Battleground.

372 {
373  if (GetStatus() != STATUS_IN_PROGRESS)
374  {
375  // if not running, do not cast things at the dropper player (prevent spawning the "dropped" flag), neither send unnecessary messages
376  // just take off the aura
377  if (player->GetTeam() == ALLIANCE)
378  {
379  if (!IsHordeFlagPickedup())
380  return;
381 
382  if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID())
383  {
386  }
387  }
388  else
389  {
390  if (!IsAllianceFlagPickedup())
391  return;
392 
393  if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID())
394  {
397  }
398  }
399  return;
400  }
401 
402  bool set = false;
403 
404  if (player->GetTeam() == ALLIANCE)
405  {
406  if (!IsHordeFlagPickedup())
407  return;
408  if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID())
409  {
412  if (_flagDebuffState == 1)
414  else if (_flagDebuffState == 2)
417  player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true);
418  set = true;
419  }
420  }
421  else
422  {
423  if (!IsAllianceFlagPickedup())
424  return;
425  if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID())
426  {
429  if (_flagDebuffState == 1)
431  else if (_flagDebuffState == 2)
434  player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true);
435  set = true;
436  }
437  }
438 
439  if (set)
440  {
441  player->CastSpell(player, SPELL_RECENTLY_DROPPED_FLAG, true);
442  UpdateFlagState(player->GetTeam(), 1);
443 
444  if (player->GetTeam() == ALLIANCE)
445  {
448  }
449  else
450  {
453  }
454 
456  }
457 }
Definition: BattlegroundWS.h:76
Definition: Battleground.h:165
bool IsAllianceFlagPickedup() const
Definition: BattlegroundWS.h:231
Definition: SharedDefines.h:5582
static ObjectGuid const Empty
Definition: ObjectGuid.h:255
Definition: BattlegroundWS.h:75
void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
Definition: Battleground.cpp:620
Definition: BattlegroundWS.h:161
Definition: SharedDefines.h:5581
ObjectGuid GetFlagPickerGUID(int32 team) const override
Definition: BattlegroundWS.h:223
Definition: BattlegroundWS.h:63
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:411
Definition: BattlegroundWS.h:45
Definition: SharedDefines.h:1081
BattlegroundStatus GetStatus() const
Definition: Battleground.h:293
ObjectGuid const & GetGUID() const
Definition: Object.h:154
Definition: BattlegroundWS.h:133
uint8 _flagState[2]
Definition: BattlegroundWS.h:280
void SetHordeFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:230
Definition: BattlegroundWS.h:43
Definition: Battleground.h:119
uint32_t uint32
Definition: Define.h:152
Definition: SharedDefines.h:1073
Definition: BattlegroundWS.h:160
Definition: BattlegroundWS.h:28
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3654
void SetAllianceFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:229
bool IsHordeFlagPickedup() const
Definition: BattlegroundWS.h:232
Definition: BattlegroundWS.h:67
int32 _flagsDropTimer[2]
Definition: BattlegroundWS.h:282
uint32 GetTeam() const
Definition: Player.h:2105
Definition: BattlegroundWS.h:66
void CastSpell(SpellCastTargets const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
Definition: Object.cpp:2631
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:683
Definition: SharedDefines.h:1074
void UpdateFlagState(uint32 team, uint32 value)
Definition: BattlegroundWS.cpp:596
Definition: BattlegroundWS.h:64
uint8 _flagDebuffState
Definition: BattlegroundWS.h:290
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FillInitialWorldStates()

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

Reimplemented from Battleground.

823 {
826 
828  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), -1);
830  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), 1);
831  else
832  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), 0);
833 
835  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), -1);
837  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), 1);
838  else
839  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), 0);
840 
842 
843  if (GetStatus() == STATUS_IN_PROGRESS)
844  {
845  packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER_ACTIVE), 1);
846  packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER), int32(25 - _minutesElapsed));
847  }
848  else
849  packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER_ACTIVE), 0);
850 
852  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_HORDE), 2);
853  else
854  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_HORDE), 1);
855 
857  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_ALLIANCE), 2);
858  else
859  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_ALLIANCE), 1);
860 }
Definition: BattlegroundWS.h:76
Definition: Battleground.h:165
Definition: BattlegroundWS.h:75
Definition: BattlegroundWS.h:81
Definition: BattlegroundWS.h:82
Definition: BattlegroundWS.h:79
uint8 _minutesElapsed
Definition: BattlegroundWS.h:291
Definition: BattlegroundWS.h:83
std::vector< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
BattlegroundStatus GetStatus() const
Definition: Battleground.h:293
Definition: BattlegroundWS.h:133
uint8 _flagState[2]
Definition: BattlegroundWS.h:280
int32_t int32
Definition: Define.h:148
uint32_t uint32
Definition: Define.h:152
Definition: SharedDefines.h:1073
uint32 GetTeamScore(uint32 TeamID) const
Definition: Battleground.cpp:1880
Definition: BattlegroundWS.h:78
Definition: BattlegroundWS.h:26
Definition: SharedDefines.h:1074
Definition: BattlegroundWS.h:132
Definition: BattlegroundWS.h:84
Definition: BattlegroundWS.h:80
+ Here is the call graph for this function:

◆ GetClosestGraveyard()

WorldSafeLocsEntry const * BattlegroundWS::GetClosestGraveyard ( Player player)
overridevirtual

Reimplemented from Battleground.

795 {
796  //if status in progress, it returns main graveyards with spiritguides
797  //else it will return the graveyard in the flagroom - this is especially good
798  //if a player dies in preparation phase - then the player can't cheat
799  //and teleport to the graveyard outside the flagroom
800  //and start running around, while the doors are still closed
801  if (player->GetTeam() == ALLIANCE)
802  {
803  if (GetStatus() == STATUS_IN_PROGRESS)
804  return sObjectMgr->GetWorldSafeLoc(WS_GRAVEYARD_MAIN_ALLIANCE);
805  else
806  return sObjectMgr->GetWorldSafeLoc(WS_GRAVEYARD_FLAGROOM_ALLIANCE);
807  }
808  else
809  {
810  if (GetStatus() == STATUS_IN_PROGRESS)
811  return sObjectMgr->GetWorldSafeLoc(WS_GRAVEYARD_MAIN_HORDE);
812  else
813  return sObjectMgr->GetWorldSafeLoc(WS_GRAVEYARD_FLAGROOM_HORDE);
814  }
815 }
Definition: Battleground.h:165
Definition: BattlegroundWS.h:141
#define sObjectMgr
Definition: ObjectMgr.h:1847
Definition: SharedDefines.h:1081
BattlegroundStatus GetStatus() const
Definition: Battleground.h:293
Definition: BattlegroundWS.h:140
uint32 GetTeam() const
Definition: Player.h:2105
Definition: BattlegroundWS.h:139
Definition: BattlegroundWS.h:138
+ Here is the call graph for this function:

◆ GetDroppedFlagGUID()

ObjectGuid BattlegroundWS::GetDroppedFlagGUID ( uint32  TeamID)
inline
261 { return m_DroppedFlagGUID[GetTeamIndexByTeamId(TeamID)]; }
ObjectGuid m_DroppedFlagGUID[2]
Definition: BattlegroundWS.h:279
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:411
+ Here is the caller graph for this function:

◆ GetExploitTeleportLocation()

WorldSafeLocsEntry const * BattlegroundWS::GetExploitTeleportLocation ( Team  team)
overridevirtual

Reimplemented from Battleground.

818 {
820 }
Definition: BattlegroundWS.h:146
#define sObjectMgr
Definition: ObjectMgr.h:1847
Definition: SharedDefines.h:1081
Definition: BattlegroundWS.h:147

◆ GetFlagPickerGUID()

ObjectGuid BattlegroundWS::GetFlagPickerGUID ( int32  team) const
inlineoverridevirtual

Reimplemented from Battleground.

224  {
225  if (team == TEAM_ALLIANCE || team == TEAM_HORDE)
226  return m_FlagKeepers[team];
227  return ObjectGuid::Empty;
228  }
static ObjectGuid const Empty
Definition: ObjectGuid.h:255
Definition: SharedDefines.h:1073
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:278
Definition: SharedDefines.h:1074
+ Here is the caller graph for this function:

◆ GetFlagState()

uint8 BattlegroundWS::GetFlagState ( uint32  team)
inline
235 { return _flagState[GetTeamIndexByTeamId(team)]; }
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:411
uint8 _flagState[2]
Definition: BattlegroundWS.h:280
+ Here is the caller graph for this function:

◆ GetPrematureWinner()

uint32 BattlegroundWS::GetPrematureWinner ( )
overridevirtual

Reimplemented from Battleground.

863 {
865  return ALLIANCE;
867  return HORDE;
868 
870 }
virtual uint32 GetPrematureWinner()
Definition: Battleground.cpp:346
Definition: SharedDefines.h:1081
Definition: SharedDefines.h:1073
uint32 GetTeamScore(uint32 TeamID) const
Definition: Battleground.cpp:1880
Definition: SharedDefines.h:1080
Definition: SharedDefines.h:1074
+ Here is the call graph for this function:

◆ HandleAreaTrigger()

void BattlegroundWS::HandleAreaTrigger ( Player player,
uint32  trigger,
bool  entered 
)
overridevirtual

Reimplemented from Battleground.

613 {
614  //uint32 SpellId = 0;
615  //uint64 buff_guid = 0;
616  switch (trigger)
617  {
618  case 8965: // Horde Start
619  case 8966: // Alliance Start
620  if (GetStatus() == STATUS_WAIT_JOIN && !entered)
622  break;
623  case 3686: // Alliance elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
624  //buff_guid = BgObjects[BG_WS_OBJECT_SPEEDBUFF_1];
625  break;
626  case 3687: // Horde elixir of speed spawn. Trigger not working, because located inside other areatrigger, can be replaced by IsWithinDist(object, dist) in Battleground::Update().
627  //buff_guid = BgObjects[BG_WS_OBJECT_SPEEDBUFF_2];
628  break;
629  case 3706: // Alliance elixir of regeneration spawn
630  //buff_guid = BgObjects[BG_WS_OBJECT_REGENBUFF_1];
631  break;
632  case 3708: // Horde elixir of regeneration spawn
633  //buff_guid = BgObjects[BG_WS_OBJECT_REGENBUFF_2];
634  break;
635  case 3707: // Alliance elixir of berserk spawn
636  //buff_guid = BgObjects[BG_WS_OBJECT_BERSERKBUFF_1];
637  break;
638  case 3709: // Horde elixir of berserk spawn
639  //buff_guid = BgObjects[BG_WS_OBJECT_BERSERKBUFF_2];
640  break;
641  case 3646: // Alliance Flag spawn
643  if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID())
644  EventPlayerCapturedFlag(player);
645  break;
646  case 3647: // Horde Flag spawn
647  if (_flagState[TEAM_ALLIANCE] && !_flagState[TEAM_HORDE])
648  if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID())
649  EventPlayerCapturedFlag(player);
650  break;
651  case 3649: // unk1
652  case 3688: // unk2
653  case 4628: // unk3
654  case 4629: // unk4
655  break;
656  default:
657  Battleground::HandleAreaTrigger(player, trigger, entered);
658  break;
659  }
660 
661  //if (buff_guid)
662  // HandleTriggerBuff(buff_guid, player);
663 }
void EventPlayerCapturedFlag(Player *player)
Definition: BattlegroundWS.cpp:283
void TeleportPlayerToExploitLocation(Player *player)
Definition: Battleground.cpp:1026
ObjectGuid GetFlagPickerGUID(int32 team) const override
Definition: BattlegroundWS.h:223
BattlegroundStatus GetStatus() const
Definition: Battleground.h:293
ObjectGuid const & GetGUID() const
Definition: Object.h:154
Definition: Battleground.h:164
uint8 _flagState[2]
Definition: BattlegroundWS.h:280
Definition: SharedDefines.h:1073
virtual void HandleAreaTrigger(Player *, uint32, bool)
Definition: Battleground.cpp:1889
Definition: SharedDefines.h:1074
+ Here is the call graph for this function:

◆ HandleKillPlayer()

void BattlegroundWS::HandleKillPlayer ( Player player,
Player killer 
)
overridevirtual

Reimplemented from Battleground.

766 {
767  if (GetStatus() != STATUS_IN_PROGRESS)
768  return;
769 
770  EventPlayerDroppedFlag(player);
771 
772  Battleground::HandleKillPlayer(player, killer);
773 }
Definition: Battleground.h:165
virtual void HandleKillPlayer(Player *player, Player *killer)
Definition: Battleground.cpp:1747
BattlegroundStatus GetStatus() const
Definition: Battleground.h:293
void EventPlayerDroppedFlag(Player *player) override
Definition: BattlegroundWS.cpp:371
+ Here is the call graph for this function:

◆ IsAllianceFlagPickedup()

bool BattlegroundWS::IsAllianceFlagPickedup ( ) const
inline
231 { return !m_FlagKeepers[TEAM_ALLIANCE].IsEmpty(); }
Definition: SharedDefines.h:1073
bool IsEmpty() const
Definition: ObjectGuid.h:299
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:278
+ Here is the caller graph for this function:

◆ IsHordeFlagPickedup()

bool BattlegroundWS::IsHordeFlagPickedup ( ) const
inline
232 { return !m_FlagKeepers[TEAM_HORDE].IsEmpty(); }
bool IsEmpty() const
Definition: ObjectGuid.h:299
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:278
Definition: SharedDefines.h:1074
+ Here is the caller graph for this function:

◆ PostUpdateImpl()

void BattlegroundWS::PostUpdateImpl ( uint32  )
overrideprotectedvirtual

Post-update hook.

Will be called after battleground update has passed. May be used to implement custom update effects in subclasses.

Parameters
diffa time difference between two worldserver update loops in milliseconds.
See also
Update(), PreUpdateImpl().

Reimplemented from Battleground.

78 {
80  {
82  {
83  if (GetTeamScore(TEAM_ALLIANCE) == 0)
84  {
85  if (GetTeamScore(TEAM_HORDE) == 0) // No one scored - result is tie
86  EndBattleground(0);
87  else // Horde has more points and thus wins
89  }
90  else if (GetTeamScore(TEAM_HORDE) == 0)
91  EndBattleground(ALLIANCE); // Alliance has > 0, Horde has 0, alliance wins
92  else if (GetTeamScore(TEAM_HORDE) == GetTeamScore(TEAM_ALLIANCE)) // Team score equal, winner is team that scored the last flag
94  else if (GetTeamScore(TEAM_HORDE) > GetTeamScore(TEAM_ALLIANCE)) // Last but not least, check who has the higher score
96  else
98  }
99  // first update needed after 1 minute of game already in progress
100  else if (GetElapsedTime() > uint32(_minutesElapsed * MINUTE * IN_MILLISECONDS) + 3 * MINUTE * IN_MILLISECONDS)
101  {
102  ++_minutesElapsed;
104  }
105 
107  {
108  _flagsTimer[TEAM_ALLIANCE] -= diff;
109 
110  if (_flagsTimer[TEAM_ALLIANCE] < 0)
111  {
113  RespawnFlag(ALLIANCE, true);
114  }
115  }
116 
118  {
120 
122  {
125  _bothFlagsKept = false;
126  }
127  }
128 
130  {
131  _flagsTimer[TEAM_HORDE] -= diff;
132 
133  if (_flagsTimer[TEAM_HORDE] < 0)
134  {
135  _flagsTimer[TEAM_HORDE] = 0;
136  RespawnFlag(HORDE, true);
137  }
138  }
139 
141  {
142  _flagsDropTimer[TEAM_HORDE] -= diff;
143 
144  if (_flagsDropTimer[TEAM_HORDE] < 0)
145  {
148  _bothFlagsKept = false;
149  }
150  }
151 
152  if (_bothFlagsKept)
153  {
154  _flagSpellForceTimer += diff;
155  if (_flagDebuffState == 0 && _flagSpellForceTimer >= 10*MINUTE*IN_MILLISECONDS) //10 minutes
156  {
158  player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);
160  player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);
161  _flagDebuffState = 1;
162  }
163  else if (_flagDebuffState == 1 && _flagSpellForceTimer >= 15*MINUTE*IN_MILLISECONDS) //15 minutes
164  {
166  {
167  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
168  player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true);
169  }
171  {
172  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
173  player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true);
174  }
175  _flagDebuffState = 2;
176  }
177  }
178  else
179  {
181  {
182  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
183  player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT);
184  }
186  {
187  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
188  player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT);
189  }
190 
191  _flagSpellForceTimer = 0; //reset timer.
192  _flagDebuffState = 0;
193  }
194  }
195 }
Definition: Battleground.h:165
int32 _flagSpellForceTimer
Definition: BattlegroundWS.h:288
uint32 _lastFlagCaptureTeam
Definition: BattlegroundWS.h:283
Definition: BattlegroundWS.h:161
uint8 _minutesElapsed
Definition: BattlegroundWS.h:291
void RespawnFlagAfterDrop(uint32 Team)
Definition: BattlegroundWS.cpp:260
Definition: BattlegroundWS.h:83
Definition: SharedDefines.h:1081
uint32 GetElapsedTime() const
Definition: Battleground.h:295
Definition: Common.h:62
BattlegroundStatus GetStatus() const
Definition: Battleground.h:293
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:254
Definition: BattlegroundWS.h:133
uint8 _flagState[2]
Definition: BattlegroundWS.h:280
Definition: Common.h:68
uint32_t uint32
Definition: Define.h:152
void EndBattleground(uint32 winner) override
Definition: BattlegroundWS.cpp:751
Definition: SharedDefines.h:1073
Definition: BattlegroundWS.h:160
uint32 GetTeamScore(uint32 TeamID) const
Definition: Battleground.cpp:1880
Definition: SharedDefines.h:1080
Definition: BattlegroundWS.h:131
bool _bothFlagsKept
Definition: BattlegroundWS.h:289
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:278
int32 _flagsDropTimer[2]
Definition: BattlegroundWS.h:282
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:683
int32 _flagsTimer[2]
Definition: BattlegroundWS.h:281
Definition: SharedDefines.h:1074
Definition: Player.h:1056
void RespawnFlag(uint32 Team, bool captured)
Definition: BattlegroundWS.cpp:236
uint8 _flagDebuffState
Definition: BattlegroundWS.h:290
+ Here is the call graph for this function:

◆ RemovePlayer()

void BattlegroundWS::RemovePlayer ( Player player,
ObjectGuid  guid,
uint32  team 
)
overridevirtual

Reimplemented from Battleground.

570 {
571  // sometimes flag aura not removed :(
573  {
574  if (!player)
575  {
576  TC_LOG_ERROR("bg.battleground", "BattlegroundWS: Removing offline player who has the FLAG!!");
578  RespawnFlag(ALLIANCE, false);
579  }
580  else
581  EventPlayerDroppedFlag(player);
582  }
583  if (IsHordeFlagPickedup() && m_FlagKeepers[TEAM_HORDE] == guid)
584  {
585  if (!player)
586  {
587  TC_LOG_ERROR("bg.battleground", "BattlegroundWS: Removing offline player who has the FLAG!!");
589  RespawnFlag(HORDE, false);
590  }
591  else
592  EventPlayerDroppedFlag(player);
593  }
594 }
bool IsAllianceFlagPickedup() const
Definition: BattlegroundWS.h:231
static ObjectGuid const Empty
Definition: ObjectGuid.h:255
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:186
Definition: SharedDefines.h:1081
void SetHordeFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:230
Definition: SharedDefines.h:1073
Definition: SharedDefines.h:1080
void SetAllianceFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:229
bool IsHordeFlagPickedup() const
Definition: BattlegroundWS.h:232
void EventPlayerDroppedFlag(Player *player) override
Definition: BattlegroundWS.cpp:371
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:278
Definition: SharedDefines.h:1074
void RespawnFlag(uint32 Team, bool captured)
Definition: BattlegroundWS.cpp:236
+ Here is the call graph for this function:

◆ RemovePoint()

void BattlegroundWS::RemovePoint ( uint32  TeamID,
uint32  Points = 1 
)
inline
int32 m_TeamScores[BG_TEAMS_COUNT]
Definition: Battleground.h:580
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:411

◆ Reset()

void BattlegroundWS::Reset ( )
overridevirtual

Reimplemented from Battleground.

715 {
716  //call parent's class reset
718 
727 
728  if (sBattlegroundMgr->IsBGWeekend(GetTypeID()))
729  {
730  m_ReputationCapture = 45;
731  m_HonorWinKills = 3;
732  m_HonorEndKills = 4;
733  }
734  else
735  {
736  m_ReputationCapture = 35;
737  m_HonorWinKills = 1;
738  m_HonorEndKills = 2;
739  }
740  _minutesElapsed = 0;
742  _bothFlagsKept = false;
743  _flagDebuffState = 0;
748  _flagsTimer[TEAM_HORDE] = 0;
749 }
int32 m_TeamScores[BG_TEAMS_COUNT]
Definition: Battleground.h:580
BattlegroundTypeId GetTypeID(bool getRandom=false) const
Definition: Battleground.cpp:1906
int32 _flagSpellForceTimer
Definition: BattlegroundWS.h:288
uint32 _lastFlagCaptureTeam
Definition: BattlegroundWS.h:283
uint8 _minutesElapsed
Definition: BattlegroundWS.h:291
ObjectGuid m_DroppedFlagGUID[2]
Definition: BattlegroundWS.h:279
uint8 _flagState[2]
Definition: BattlegroundWS.h:280
virtual void Reset()
Definition: Battleground.cpp:982
Definition: SharedDefines.h:1073
void Clear()
Definition: ObjectGuid.h:266
Definition: BattlegroundWS.h:130
uint32 m_HonorEndKills
Definition: BattlegroundWS.h:287
uint32 m_HonorWinKills
Definition: BattlegroundWS.h:286
bool _bothFlagsKept
Definition: BattlegroundWS.h:289
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:278
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:197
int32 _flagsDropTimer[2]
Definition: BattlegroundWS.h:282
int32 _flagsTimer[2]
Definition: BattlegroundWS.h:281
Definition: SharedDefines.h:1074
uint32 m_ReputationCapture
Definition: BattlegroundWS.h:285
uint8 _flagDebuffState
Definition: BattlegroundWS.h:290
+ Here is the call graph for this function:

◆ RespawnFlag()

void BattlegroundWS::RespawnFlag ( uint32  Team,
bool  captured 
)
237 {
238  if (Team == ALLIANCE)
239  {
240  TC_LOG_DEBUG("bg.battleground", "Respawn Alliance flag");
242  }
243  else
244  {
245  TC_LOG_DEBUG("bg.battleground", "Respawn Horde flag");
247  }
248 
249  if (captured)
250  {
251  //when map_update will be allowed for battlegrounds this code will be useless
255  PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED); // flag respawned sound...
256  }
257  _bothFlagsKept = false;
258 }
Definition: Battleground.h:135
void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
Definition: Battleground.cpp:620
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1523
Definition: BattlegroundWS.h:99
Definition: SharedDefines.h:5580
Definition: BattlegroundWS.h:41
Definition: SharedDefines.h:1081
Team
Definition: SharedDefines.h:1078
void PlaySoundToAll(uint32 SoundID)
Definition: Battleground.cpp:633
uint8 _flagState[2]
Definition: BattlegroundWS.h:280
Definition: BattlegroundWS.h:58
Definition: SharedDefines.h:1073
Definition: BattlegroundWS.h:130
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:177
bool _bothFlagsKept
Definition: BattlegroundWS.h:289
Definition: SharedDefines.h:1074
Definition: BattlegroundWS.h:100
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ RespawnFlagAfterDrop()

void BattlegroundWS::RespawnFlagAfterDrop ( uint32  Team)
261 {
262  if (GetStatus() != STATUS_IN_PROGRESS)
263  return;
264 
265  RespawnFlag(team, false);
266  if (team == ALLIANCE)
268  else
270 
273 
275  obj->Delete();
276  else
277  TC_LOG_ERROR("bg.battleground", "unknown dropped flag (%s)", GetDroppedFlagGUID(team).ToString().c_str());
278 
280  _bothFlagsKept = false;
281 }
Definition: Battleground.h:165
Definition: Battleground.h:135
static ObjectGuid const Empty
Definition: ObjectGuid.h:255
void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
Definition: Battleground.cpp:620
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:186
BattlegroundMap * GetBgMap() const
Definition: Battleground.cpp:581
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1523
Definition: BattlegroundWS.h:99
Definition: SharedDefines.h:5580
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:411
Definition: BattlegroundWS.h:41
Definition: SharedDefines.h:1081
BattlegroundStatus GetStatus() const
Definition: Battleground.h:293
void PlaySoundToAll(uint32 SoundID)
Definition: Battleground.cpp:633
string ToString(int i)
Definition: strutil.h:491
Definition: BattlegroundWS.h:58
Definition: GameObject.h:81
bool _bothFlagsKept
Definition: BattlegroundWS.h:289
ObjectGuid GetDroppedFlagGUID(uint32 TeamID)
Definition: BattlegroundWS.h:261
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:178
void SetDroppedFlagGUID(ObjectGuid guid, int32 team=-1) override
Definition: BattlegroundWS.h:255
Definition: BattlegroundWS.h:100
void RespawnFlag(uint32 Team, bool captured)
Definition: BattlegroundWS.cpp:236
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetAllianceFlagPicker()

void BattlegroundWS::SetAllianceFlagPicker ( ObjectGuid  guid)
inline
229 { m_FlagKeepers[TEAM_ALLIANCE] = guid; }
Definition: SharedDefines.h:1073
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:278
+ Here is the caller graph for this function:

◆ SetDroppedFlagGUID()

void BattlegroundWS::SetDroppedFlagGUID ( ObjectGuid  guid,
int32  team = -1 
)
inlineoverridevirtual

Reimplemented from Battleground.

256  {
257  if (team == TEAM_ALLIANCE || team == TEAM_HORDE)
258  m_DroppedFlagGUID[team] = guid;
259  }
ObjectGuid m_DroppedFlagGUID[2]
Definition: BattlegroundWS.h:279
Definition: SharedDefines.h:1073
Definition: SharedDefines.h:1074
+ Here is the caller graph for this function:

◆ SetHordeFlagPicker()

void BattlegroundWS::SetHordeFlagPicker ( ObjectGuid  guid)
inline
230 { m_FlagKeepers[TEAM_HORDE] = guid; }
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:278
Definition: SharedDefines.h:1074
+ Here is the caller graph for this function:

◆ SetLastFlagCapture()

void BattlegroundWS::SetLastFlagCapture ( uint32  team)
inline
252 { _lastFlagCaptureTeam = team; }
uint32 _lastFlagCaptureTeam
Definition: BattlegroundWS.h:283
+ Here is the caller graph for this function:

◆ SetTeamPoint()

void BattlegroundWS::SetTeamPoint ( uint32  TeamID,
uint32  Points = 0 
)
inline
int32 m_TeamScores[BG_TEAMS_COUNT]
Definition: Battleground.h:580
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:411

◆ SetupBattleground()

bool BattlegroundWS::SetupBattleground ( )
overridevirtual

Reimplemented from Battleground.

666 {
667  // flags
668  if (!AddObject(BG_WS_OBJECT_A_FLAG, BG_OBJECT_A_FLAG_WS_ENTRY, 1540.423f, 1481.325f, 351.8284f, 3.089233f, 0, 0, 0.9996573f, 0.02617699f, BG_WS_FLAG_RESPAWN_TIME/1000)
669  || !AddObject(BG_WS_OBJECT_H_FLAG, BG_OBJECT_H_FLAG_WS_ENTRY, 916.0226f, 1434.405f, 345.413f, 0.01745329f, 0, 0, 0.008726535f, 0.9999619f, BG_WS_FLAG_RESPAWN_TIME/1000)
670  // buffs
671  || !AddObject(BG_WS_OBJECT_SPEEDBUFF_1, BG_OBJECTID_SPEEDBUFF_ENTRY, 1449.93f, 1470.71f, 342.6346f, -1.64061f, 0, 0, 0.7313537f, -0.6819983f, BUFF_RESPAWN_TIME)
672  || !AddObject(BG_WS_OBJECT_SPEEDBUFF_2, BG_OBJECTID_SPEEDBUFF_ENTRY, 1005.171f, 1447.946f, 335.9032f, 1.64061f, 0, 0, 0.7313537f, 0.6819984f, BUFF_RESPAWN_TIME)
673  || !AddObject(BG_WS_OBJECT_REGENBUFF_1, BG_OBJECTID_REGENBUFF_ENTRY, 1317.506f, 1550.851f, 313.2344f, -0.2617996f, 0, 0, 0.1305263f, -0.9914448f, BUFF_RESPAWN_TIME)
674  || !AddObject(BG_WS_OBJECT_REGENBUFF_2, BG_OBJECTID_REGENBUFF_ENTRY, 1110.451f, 1353.656f, 316.5181f, -0.6806787f, 0, 0, 0.333807f, -0.9426414f, BUFF_RESPAWN_TIME)
675  || !AddObject(BG_WS_OBJECT_BERSERKBUFF_1, BG_OBJECTID_BERSERKERBUFF_ENTRY, 1320.09f, 1378.79f, 314.7532f, 1.186824f, 0, 0, 0.5591929f, 0.8290376f, BUFF_RESPAWN_TIME)
676  || !AddObject(BG_WS_OBJECT_BERSERKBUFF_2, BG_OBJECTID_BERSERKERBUFF_ENTRY, 1139.688f, 1560.288f, 306.8432f, -2.443461f, 0, 0, 0.9396926f, -0.3420201f, BUFF_RESPAWN_TIME)
677  // alliance gates
678  || !AddObject(BG_WS_OBJECT_DOOR_A_1, BG_OBJECT_DOOR_A_1_WS_ENTRY, 1503.335f, 1493.466f, 352.1888f, 3.115414f, 0, 0, 0.9999143f, 0.01308903f, RESPAWN_IMMEDIATELY)
679  || !AddObject(BG_WS_OBJECT_DOOR_A_2, BG_OBJECT_DOOR_A_2_WS_ENTRY, 1492.478f, 1457.912f, 342.9689f, 3.115414f, 0, 0, 0.9999143f, 0.01308903f, RESPAWN_IMMEDIATELY)
680  || !AddObject(BG_WS_OBJECT_DOOR_A_3, BG_OBJECT_DOOR_A_3_WS_ENTRY, 1468.503f, 1494.357f, 351.8618f, 3.115414f, 0, 0, 0.9999143f, 0.01308903f, RESPAWN_IMMEDIATELY)
681  || !AddObject(BG_WS_OBJECT_DOOR_A_4, BG_OBJECT_DOOR_A_4_WS_ENTRY, 1471.555f, 1458.778f, 362.6332f, 3.115414f, 0, 0, 0.9999143f, 0.01308903f, RESPAWN_IMMEDIATELY)
682  || !AddObject(BG_WS_OBJECT_DOOR_A_5, BG_OBJECT_DOOR_A_5_WS_ENTRY, 1492.347f, 1458.34f, 342.3712f, -0.03490669f, 0, 0, 0.01745246f, -0.9998477f, RESPAWN_IMMEDIATELY)
683  || !AddObject(BG_WS_OBJECT_DOOR_A_6, BG_OBJECT_DOOR_A_6_WS_ENTRY, 1503.466f, 1493.367f, 351.7352f, -0.03490669f, 0, 0, 0.01745246f, -0.9998477f, RESPAWN_IMMEDIATELY)
684  // horde gates
685  || !AddObject(BG_WS_OBJECT_DOOR_H_1, BG_OBJECT_DOOR_H_1_WS_ENTRY, 949.1663f, 1423.772f, 345.6241f, -0.5756807f, -0.01673368f, -0.004956111f, -0.2839723f, 0.9586737f, RESPAWN_IMMEDIATELY)
686  || !AddObject(BG_WS_OBJECT_DOOR_H_2, BG_OBJECT_DOOR_H_2_WS_ENTRY, 953.0507f, 1459.842f, 340.6526f, -1.99662f, -0.1971825f, 0.1575096f, -0.8239487f, 0.5073641f, RESPAWN_IMMEDIATELY)
687  || !AddObject(BG_WS_OBJECT_DOOR_H_3, BG_OBJECT_DOOR_H_3_WS_ENTRY, 949.9523f, 1422.751f, 344.9273f, 0.0f, 0, 0, 0, 1, RESPAWN_IMMEDIATELY)
688  || !AddObject(BG_WS_OBJECT_DOOR_H_4, BG_OBJECT_DOOR_H_4_WS_ENTRY, 950.7952f, 1459.583f, 342.1523f, 0.05235988f, 0, 0, 0.02617695f, 0.9996573f, RESPAWN_IMMEDIATELY)
689 )
690  {
691  TC_LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn some object Battleground not created!");
692  return false;
693  }
694 
695  WorldSafeLocsEntry const* sg = sObjectMgr->GetWorldSafeLoc(WS_GRAVEYARD_MAIN_ALLIANCE);
697  {
698  TC_LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
699  return false;
700  }
701 
702  sg = sObjectMgr->GetWorldSafeLoc(WS_GRAVEYARD_MAIN_HORDE);
703  if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->Loc.GetPositionX(), sg->Loc.GetPositionY(), sg->Loc.GetPositionZ(), 3.193953f, TEAM_HORDE))
704  {
705  TC_LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!");
706  return false;
707  }
708 
709  TC_LOG_DEBUG("bg.battleground", "BatteGroundWS: BG objects and spirit guides spawned");
710 
711  return true;
712 }
Definition: BattlegroundWS.h:104
Definition: BattlegroundWS.h:114
Definition: Battleground.h:135
virtual bool AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime=0, GOState goState=GO_STATE_READY)
Definition: Battleground.cpp:1391
Definition: BattlegroundWS.h:120
Definition: BattlegroundWS.h:141
virtual bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL)
Definition: Battleground.cpp:1633
Definition: BattlegroundWS.h:92
Definition: BattlegroundWS.h:112
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:186
Definition: BattlegroundWS.h:94
Definition: Battleground.h:154
Definition: BattlegroundWS.h:95
Definition: BattlegroundWS.h:101
Definition: ObjectMgr.h:770
Definition: BattlegroundWS.h:89
Definition: BattlegroundWS.h:118
Definition: BattlegroundWS.h:97
Definition: BattlegroundWS.h:153
#define sObjectMgr
Definition: ObjectMgr.h:1847
Definition: BattlegroundWS.h:99
Definition: Battleground.h:155
Definition: BattlegroundWS.h:106
Definition: BattlegroundWS.h:117
float GetPositionY() const
Definition: Position.h:102
Definition: BattlegroundWS.h:113
Definition: Battleground.h:153
Definition: BattlegroundWS.h:140
Definition: BattlegroundWS.h:121
Definition: SharedDefines.h:1073
float GetPositionZ() const
Definition: Position.h:103
Definition: BattlegroundWS.h:102
Definition: BattlegroundWS.h:119
Definition: Battleground.h:136
WorldLocation Loc
Definition: ObjectMgr.h:773
Definition: BattlegroundWS.h:98
float GetPositionX() const
Definition: Position.h:101
Definition: BattlegroundWS.h:96
Definition: BattlegroundWS.h:116
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:177
Definition: BattlegroundWS.h:152
Definition: BattlegroundWS.h:90
Definition: BattlegroundWS.h:123
Definition: BattlegroundWS.h:115
Definition: BattlegroundWS.h:27
Definition: BattlegroundWS.h:93
Definition: BattlegroundWS.h:103
Definition: BattlegroundWS.h:122
Definition: BattlegroundWS.h:91
Definition: BattlegroundWS.h:105
Definition: SharedDefines.h:1074
Definition: BattlegroundWS.h:100
+ Here is the call graph for this function:

◆ StartingEventCloseDoors()

void BattlegroundWS::StartingEventCloseDoors ( )
overridevirtual

Reimplemented from Battleground.

198 {
200  {
201  DoorClose(i);
203  }
206 
209 }
Definition: Battleground.h:135
Definition: BattlegroundWS.h:89
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1523
Definition: BattlegroundWS.h:83
Definition: BattlegroundWS.h:99
Definition: BattlegroundWS.h:106
uint32_t uint32
Definition: Define.h:152
Definition: Battleground.h:134
Definition: BattlegroundWS.h:98
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:683
Definition: BattlegroundWS.h:84
void DoorClose(uint32 type)
Definition: Battleground.cpp:1460
+ Here is the call graph for this function:

◆ StartingEventOpenDoors()

void BattlegroundWS::StartingEventOpenDoors ( )
overridevirtual

Reimplemented from Battleground.

212 {
214  DoorOpen(i);
216  DoorOpen(i);
217 
220 
225 
226  // players joining later are not eligibles
228 }
Definition: Battleground.h:135
void StartCriteriaTimer(CriteriaStartEvent startEvent, uint32 entry)
Definition: Battleground.cpp:1862
Definition: BattlegroundWS.h:94
Definition: BattlegroundWS.h:95
Definition: BattlegroundWS.h:89
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1523
Definition: BattlegroundWS.h:97
#define WS_EVENT_START_BATTLE
Definition: BattlegroundWS.h:170
Definition: BattlegroundWS.h:99
Definition: BattlegroundWS.h:106
uint32_t uint32
Definition: Define.h:152
Definition: Battleground.h:134
Definition: BattlegroundWS.h:98
void DoorOpen(uint32 type)
Definition: Battleground.cpp:1476
Definition: BattlegroundWS.h:93
+ Here is the call graph for this function:

◆ UpdateFlagState()

void BattlegroundWS::UpdateFlagState ( uint32  team,
uint32  value 
)
597 {
598  if (team == ALLIANCE)
600  else
602 }
Definition: BattlegroundWS.h:81
Definition: BattlegroundWS.h:82
Definition: SharedDefines.h:1081
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:683
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdatePlayerScore()

bool BattlegroundWS::UpdatePlayerScore ( Player player,
uint32  type,
uint32  value,
bool  doAddHonor = true 
)
overridevirtual

Reimplemented from Battleground.

776 {
777  if (!Battleground::UpdatePlayerScore(player, type, value, doAddHonor))
778  return false;
779 
780  switch (type)
781  {
782  case SCORE_FLAG_CAPTURES: // flags captured
784  break;
785  case SCORE_FLAG_RETURNS: // flags returned
787  break;
788  default:
789  break;
790  }
791  return true;
792 }
Definition: BattlegroundScore.h:36
Definition: BattlegroundWS.h:167
virtual bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true)
Definition: Battleground.cpp:1326
void UpdateCriteria(CriteriaType type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, WorldObject *ref=nullptr)
Definition: Player.cpp:26592
Definition: BattlegroundScore.h:37
Definition: BattlegroundWS.h:166
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateTeamScore()

void BattlegroundWS::UpdateTeamScore ( uint32  team)
605 {
606  if (team == TEAM_ALLIANCE)
608  else
610 }
Definition: BattlegroundWS.h:79
Definition: SharedDefines.h:1073
uint32 GetTeamScore(uint32 TeamID) const
Definition: Battleground.cpp:1880
Definition: BattlegroundWS.h:78
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:683
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _bothFlagsKept

bool BattlegroundWS::_bothFlagsKept
private

◆ _flagDebuffState

uint8 BattlegroundWS::_flagDebuffState
private

◆ _flagsDropTimer

int32 BattlegroundWS::_flagsDropTimer[2]
private

◆ _flagSpellForceTimer

int32 BattlegroundWS::_flagSpellForceTimer
private

◆ _flagState

uint8 BattlegroundWS::_flagState[2]
private

◆ _flagsTimer

int32 BattlegroundWS::_flagsTimer[2]
private

◆ _lastFlagCaptureTeam

uint32 BattlegroundWS::_lastFlagCaptureTeam
private

◆ _minutesElapsed

uint8 BattlegroundWS::_minutesElapsed
private

◆ m_DroppedFlagGUID

ObjectGuid BattlegroundWS::m_DroppedFlagGUID[2]
private

◆ m_FlagKeepers

ObjectGuid BattlegroundWS::m_FlagKeepers[2]
private

◆ m_HonorEndKills

uint32 BattlegroundWS::m_HonorEndKills
private

◆ m_HonorWinKills

uint32 BattlegroundWS::m_HonorWinKills
private

◆ m_ReputationCapture

uint32 BattlegroundWS::m_ReputationCapture
private

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