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

#include <BattlegroundWS.h>

Public Member Functions

 BattlegroundWS ()
 
 ~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 constGetClosestGraveYard (Player *player) 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 ()
 
virtual ~Battleground ()
 
void Update (uint32 diff)
 
virtual void ResetBGSubclass ()
 
virtual void DestroyGate (Player *, GameObject *)
 
virtual bool IsAllNodesControlledByTeam (uint32) const
 
void StartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
std::string constGetName () const
 
uint64 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 (uint64 queueId)
 
void SetName (std::string const &name)
 
void SetTypeID (BattlegroundTypeId TypeID)
 
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 SetMaxPlayers (uint32 MaxPlayers)
 
void SetMinPlayers (uint32 MinPlayers)
 
void SetLevelRange (uint32 min, uint32 max)
 
void SetRated (bool state)
 
void SetArenaType (uint8 type)
 
void SetArenaorBGType (bool _isArena)
 
void SetWinner (BattlegroundTeamId winnerTeamId)
 
void SetScriptId (uint32 scriptId)
 
void ModifyStartDelayTime (int diff)
 
void SetStartDelayTime (int Time)
 
void SetMaxPlayersPerTeam (uint32 MaxPlayers)
 
void SetMinPlayersPerTeam (uint32 MinPlayers)
 
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 constGetPlayers () 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)
 
void SetMapId (uint32 MapID)
 
uint32 GetMapId () const
 
void SetBgMap (BattlegroundMap *map)
 
BattlegroundMapGetBgMap () const
 
BattlegroundMapFindBgMap () const
 
void SetTeamStartPosition (TeamId teamId, Position const &pos)
 
Position constGetTeamStartPosition (TeamId teamId) const
 
void SetStartMaxDist (float startMaxDist)
 
float GetStartMaxDist () const
 
void SendPacketToTeam (uint32 TeamID, WorldPacket const *packet, Player *sender=NULL, bool self=true) const
 
void SendPacketToAll (WorldPacket const *packet) const
 
void SendChatMessage (Creature *source, uint8 textId, WorldObject *target=NULL)
 
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=NULL)
 
void PSendMessageToAll (uint32 entry, ChatMsg type, Player const *source,...)
 
void SendMessage2ToAll (uint32 entry, ChatMsg type, Player const *source, uint32 strId1=0, uint32 strId2=0)
 
GroupGetBgRaid (uint32 TeamID) const
 
void SetBgRaid (uint32 TeamID, Group *bg_raid)
 
void BuildPvPLogDataPacket (WorldPackets::Battleground::PVPLogData &pvpLogData)
 
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 *=NULL)
 
virtual void DoAction (uint32, ObjectGuid)
 
virtual void HandlePlayerResurrect (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=NULL)
 
CreatureAddCreature (uint32 entry, uint32 type, Position const &pos, TeamId teamId=TEAM_NEUTRAL, uint32 respawntime=0, Transport *transport=NULL)
 
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
 

Protected Member Functions

void PostUpdateImpl (uint32 diff) override
 Post-update hook. More...
 
void GetPlayerPositionData (std::vector< WorldPackets::Battleground::BattlegroundPlayerPosition > *positions) const override
 
- Protected Member Functions inherited from Battleground
void EndNow ()
 
void PlayerAddedToBGCheckIfBGIsRunning (Player *player)
 
Player_GetPlayer (ObjectGuid guid, bool offlineRemove, const char *context) const
 
Player_GetPlayer (BattlegroundPlayerMap::iterator itr, const char *context)
 
Player_GetPlayer (BattlegroundPlayerMap::const_iterator itr, const char *context) const
 
Player_GetPlayerForTeam (uint32 teamId, BattlegroundPlayerMap::const_iterator itr, const char *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,
BattlegroundPlayer
BattlegroundPlayerMap
 
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]
 
ArenaTeamScore _arenaTeamScores [BG_TEAMS_COUNT]
 

Constructor & Destructor Documentation

BattlegroundWS::BattlegroundWS ( )
43 {
46 
52  _bothFlagsKept = false;
53  _flagDebuffState = 0;
66  m_HonorWinKills = 0;
67  m_HonorEndKills = 0;
68  _minutesElapsed = 0;
69 }
Definition: Battleground.h:199
Definition: BattlegroundWS.h:133
Definition: Battleground.h:200
int32 _flagSpellForceTimer
Definition: BattlegroundWS.h:264
uint32 _lastFlagCaptureTeam
Definition: BattlegroundWS.h:259
Definition: Language.h:636
Definition: Language.h:638
uint8 _minutesElapsed
Definition: BattlegroundWS.h:267
ObjectGuid m_DroppedFlagGUID[2]
Definition: BattlegroundWS.h:255
Definition: Battleground.h:198
Definition: Language.h:639
GuidVector BgObjects
Definition: Battleground.h:452
uint8 _flagState[2]
Definition: BattlegroundWS.h:256
GuidVector BgCreatures
Definition: Battleground.h:453
uint32 StartMessageIds[BG_STARTING_EVENT_COUNT]
Definition: Battleground.h:556
Definition: SharedDefines.h:992
Definition: Language.h:637
void Clear()
Definition: ObjectGuid.h:215
Definition: BattlegroundWS.h:114
uint32 m_HonorEndKills
Definition: BattlegroundWS.h:263
uint32 m_HonorWinKills
Definition: BattlegroundWS.h:262
bool _bothFlagsKept
Definition: BattlegroundWS.h:265
Definition: BattlegroundWS.h:91
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:254
int32 _flagsDropTimer[2]
Definition: BattlegroundWS.h:258
int32 _flagsTimer[2]
Definition: BattlegroundWS.h:257
Definition: SharedDefines.h:993
uint32 m_ReputationCapture
Definition: BattlegroundWS.h:261
Definition: Battleground.h:197
uint8 _flagDebuffState
Definition: BattlegroundWS.h:266

+ Here is the call graph for this function:

BattlegroundWS::~BattlegroundWS ( )
71 { }

Member Function Documentation

void BattlegroundWS::AddPlayer ( Player player)
overridevirtual

Reimplemented from Battleground.

252 {
253  Battleground::AddPlayer(player);
254  PlayerScores[player->GetGUID()] = new BattlegroundWGScore(player->GetGUID(), player->GetBGTeam());
255 }
Definition: BattlegroundWS.h:150
virtual void AddPlayer(Player *player)
Definition: Battleground.cpp:1079
BattlegroundScoreMap PlayerScores
Definition: Battleground.h:543

+ Here is the call graph for this function:

void BattlegroundWS::AddPoint ( uint32  TeamID,
uint32  Points = 1 
)
inline
int32 m_TeamScores[BG_TEAMS_COUNT]
Definition: Battleground.h:562
Points
Definition: ScriptedEscortAI.cpp:31
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from Battleground.

905 {
906  switch (criteriaId)
907  {
909  if (target)
910  if (Player const* playerTarget = target->ToPlayer())
911  return GetFlagState(playerTarget->GetTeam()) == BG_WS_FLAG_STATE_ON_BASE;
912  return false;
913  }
914 
915  return Battleground::CheckAchievementCriteriaMeet(criteriaId, player, target, miscValue);
916 }
uint8 GetFlagState(uint32 team)
Definition: BattlegroundWS.h:211
Definition: Battleground.h:48
Definition: BattlegroundWS.h:114
virtual bool CheckAchievementCriteriaMeet(uint32, Player const *, Unit const *=NULL, uint32=0)
Definition: Battleground.cpp:1939

+ Here is the call graph for this function:

void BattlegroundWS::EndBattleground ( uint32  winner)
overridevirtual

Reimplemented from Battleground.

789 {
790  // Win reward
791  if (winner == ALLIANCE)
793  if (winner == HORDE)
795  // Complete map_end rewards (even if no team wins)
798 
800 }
uint32 GetBonusHonorFromKill(uint32 kills) const
Definition: Battleground.cpp:907
Definition: SharedDefines.h:1000
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
Definition: Battleground.cpp:709
Definition: SharedDefines.h:999
uint32 m_HonorEndKills
Definition: BattlegroundWS.h:263
uint32 m_HonorWinKills
Definition: BattlegroundWS.h:262
virtual void EndBattleground(uint32 winner)
Definition: Battleground.cpp:744

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundWS::EventPlayerCapturedFlag ( Player player)
310 {
311  if (GetStatus() != STATUS_IN_PROGRESS)
312  return;
313 
314  uint32 winner = 0;
315 
316  player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
317  if (player->GetTeam() == ALLIANCE)
318  {
319  if (!IsHordeFlagPickedup())
320  return;
321  SetHordeFlagPicker(ObjectGuid::Empty); // must be before aura remove to prevent 2 events (drop+capture) at the same time
322  // horde flag in base (but not respawned yet)
324  // Drop Horde Flag from Player
325  player->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
326  if (_flagDebuffState == 1)
327  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
328  else if (_flagDebuffState == 2)
329  player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT);
330 
332  AddPoint(ALLIANCE, 1);
335  }
336  else
337  {
338  if (!IsAllianceFlagPickedup())
339  return;
340  SetAllianceFlagPicker(ObjectGuid::Empty); // must be before aura remove to prevent 2 events (drop+capture) at the same time
341  // alliance flag in base (but not respawned yet)
343  // Drop Alliance Flag from Player
344  player->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
345  if (_flagDebuffState == 1)
346  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
347  else if (_flagDebuffState == 2)
348  player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT);
349 
351  AddPoint(HORDE, 1);
354  }
355  //for flag capture is reward 2 honorable kills
356  RewardHonorToTeam(GetBonusHonorFromKill(2), player->GetTeam());
357 
360 
361  if (player->GetTeam() == ALLIANCE)
363  else
365 
366  UpdateFlagState(player->GetTeam(), 1); // flag state none
367  UpdateTeamScore(player->GetTeamId());
368  // only flag capture should be updated
369  UpdatePlayerScore(player, SCORE_FLAG_CAPTURES, 1); // +1 flag captures
370 
371  // update last flag capture to be used if teamscore is equal
372  SetLastFlagCapture(player->GetTeam());
373 
375  winner = ALLIANCE;
376 
378  winner = HORDE;
379 
380  if (winner)
381  {
387 
389  EndBattleground(winner);
390  }
391  else
392  {
393  _flagsTimer[GetTeamIndexByTeamId(player->GetTeam()) ? 0 : 1] = BG_WS_FLAG_RESPAWN_TIME;
394  }
395 }
Definition: BattlegroundWS.h:60
Definition: Battleground.h:159
Definition: BattlegroundScore.h:35
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID)
Definition: Battleground.cpp:716
uint32 GetBonusHonorFromKill(uint32 kills) const
Definition: Battleground.cpp:907
Definition: BattlegroundWS.h:59
void UpdateTeamScore(uint32 team)
Definition: BattlegroundWS.cpp:643
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: BattlegroundWS.h:139
Definition: BattlegroundWS.h:65
Definition: BattlegroundWS.h:66
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
Definition: BattlegroundWS.h:47
bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
Definition: BattlegroundWS.cpp:812
Definition: Language.h:641
Definition: BattlegroundWS.h:83
void AddPoint(uint32 TeamID, uint32 Points=1)
Definition: BattlegroundWS.h:240
Definition: BattlegroundWS.cpp:30
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
Definition: SharedDefines.h:1000
uint32 GetTeamScore(uint32 TeamID) const
Definition: Battleground.cpp:1924
void SendMessageToAll(uint32 entry, ChatMsg type, Player const *source=NULL)
Definition: Battleground.cpp:1706
void PlaySoundToAll(uint32 SoundID)
Definition: Battleground.cpp:681
uint8 _flagState[2]
Definition: BattlegroundWS.h:256
void SetHordeFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:206
uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM]
Definition: BattlegroundWS.cpp:36
uint32_t uint32
Definition: Define.h:150
bool IsHordeFlagPickedup() const
Definition: BattlegroundWS.h:208
Definition: BattlegroundWS.h:37
void EndBattleground(uint32 winner) override
Definition: BattlegroundWS.cpp:788
Definition: SharedDefines.h:992
Definition: BattlegroundWS.h:138
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
Definition: Battleground.cpp:709
Definition: SharedDefines.h:999
Definition: BattlegroundWS.h:36
Definition: SharedDefines.h:4268
Definition: BattlegroundWS.h:115
bool IsAllianceFlagPickedup() const
Definition: BattlegroundWS.h:207
void SetAllianceFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:205
Definition: BattlegroundWS.h:27
Definition: Language.h:642
Definition: SharedDefines.h:4269
Definition: BattlegroundWS.h:50
Definition: BattlegroundWS.h:28
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
int32 _flagsTimer[2]
Definition: BattlegroundWS.h:257
void SetLastFlagCapture(uint32 team)
Definition: BattlegroundWS.h:227
Definition: SharedDefines.h:993
Definition: BattlegroundWS.h:84
void UpdateFlagState(uint32 team, uint32 value)
Definition: BattlegroundWS.cpp:635
Definition: BattlegroundWS.h:68
uint32 m_ReputationCapture
Definition: BattlegroundWS.h:261
uint8 _flagDebuffState
Definition: BattlegroundWS.h:266
BGHonorMode m_HonorMode
Definition: Battleground.h:561

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from Battleground.

486 {
487  if (GetStatus() != STATUS_IN_PROGRESS)
488  return;
489 
490  int32 message_id = 0;
492 
493  //alliance flag picked up from base
494  if (player->GetTeam() == HORDE && GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_BASE
495  && BgObjects[BG_WS_OBJECT_A_FLAG] == target_obj->GetGUID())
496  {
497  message_id = LANG_BG_WS_PICKEDUP_AF;
501  SetAllianceFlagPicker(player->GetGUID());
503  //update world state to show correct flag carrier
506  player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG, true);
508  if (_flagState[1] == BG_WS_FLAG_STATE_ON_PLAYER)
509  _bothFlagsKept = true;
510  }
511 
512  //horde flag picked up from base
513  if (player->GetTeam() == ALLIANCE && GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_BASE
514  && BgObjects[BG_WS_OBJECT_H_FLAG] == target_obj->GetGUID())
515  {
516  message_id = LANG_BG_WS_PICKEDUP_HF;
520  SetHordeFlagPicker(player->GetGUID());
522  //update world state to show correct flag carrier
525  player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG, true);
527  if (_flagState[0] == BG_WS_FLAG_STATE_ON_PLAYER)
528  _bothFlagsKept = true;
529  }
530 
531  //Alliance flag on ground(not in base) (returned or picked up again from ground!)
532  if (GetFlagState(ALLIANCE) == BG_WS_FLAG_STATE_ON_GROUND && player->IsWithinDistInMap(target_obj, 10)
533  && target_obj->GetGOInfo()->entry == BG_OBJECT_A_FLAG_GROUND_WS_ENTRY)
534  {
535  if (player->GetTeam() == ALLIANCE)
536  {
537  message_id = LANG_BG_WS_RETURNED_AF;
540  RespawnFlag(ALLIANCE, false);
544  _bothFlagsKept = false;
545  }
546  else
547  {
548  message_id = LANG_BG_WS_PICKEDUP_AF;
552  SetAllianceFlagPicker(player->GetGUID());
553  player->CastSpell(player, BG_WS_SPELL_SILVERWING_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 
566  //Horde flag on ground(not in base) (returned or picked up again)
567  if (GetFlagState(HORDE) == BG_WS_FLAG_STATE_ON_GROUND && player->IsWithinDistInMap(target_obj, 10)
568  && target_obj->GetGOInfo()->entry == BG_OBJECT_H_FLAG_GROUND_WS_ENTRY)
569  {
570  if (player->GetTeam() == HORDE)
571  {
572  message_id = LANG_BG_WS_RETURNED_HF;
575  RespawnFlag(HORDE, false);
579  _bothFlagsKept = false;
580  }
581  else
582  {
583  message_id = LANG_BG_WS_PICKEDUP_HF;
587  SetHordeFlagPicker(player->GetGUID());
588  player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG, true);
591  if (_flagDebuffState == 1)
592  player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);
593  else if (_flagDebuffState == 2)
594  player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true);
596  }
597  //called in HandleGameObjectUseOpcode:
598  //target_obj->Delete();
599  }
600 
601  if (!message_id)
602  return;
603 
604  SendMessageToAll(message_id, type, player);
605  player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
606 }
Definition: BattlegroundWS.h:60
Definition: Battleground.h:159
Definition: Battleground.h:129
Definition: BattlegroundWS.h:40
Definition: BattlegroundWS.h:59
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: BattlegroundWS.h:139
ChatMsg
Definition: SharedDefines.h:4228
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
Definition: BattlegroundWS.h:47
bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
Definition: BattlegroundWS.cpp:812
uint8 GetFlagState(uint32 team)
Definition: BattlegroundWS.h:211
Definition: BattlegroundWS.h:83
Definition: BattlegroundWS.h:109
Definition: SharedDefines.h:1000
Definition: DBCEnums.h:186
void SendMessageToAll(uint32 entry, ChatMsg type, Player const *source=NULL)
Definition: Battleground.cpp:1706
Definition: BattlegroundWS.h:117
void PlaySoundToAll(uint32 SoundID)
Definition: Battleground.cpp:681
Definition: SharedDefines.h:4267
Definition: BattlegroundScore.h:36
GuidVector BgObjects
Definition: Battleground.h:452
uint8 _flagState[2]
Definition: BattlegroundWS.h:256
void SetHordeFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:206
Definition: BattlegroundWS.h:52
Definition: Language.h:645
int32_t int32
Definition: Define.h:146
Definition: BattlegroundWS.h:41
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:894
Definition: SharedDefines.h:992
Definition: BattlegroundWS.h:138
Definition: Battleground.h:128
uint32 entry
Definition: GameObject.h:36
Definition: SharedDefines.h:999
Definition: SharedDefines.h:4268
Definition: BattlegroundWS.h:115
Definition: BattlegroundWS.h:108
ObjectGuid const & GetGUID() const
Definition: Object.h:105
void SetAllianceFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:205
Definition: BattlegroundWS.h:49
Definition: BattlegroundWS.h:114
bool _bothFlagsKept
Definition: BattlegroundWS.h:265
Definition: SharedDefines.h:4269
Definition: BattlegroundWS.h:39
Definition: BattlegroundWS.h:50
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
Definition: Language.h:647
Definition: SharedDefines.h:993
Definition: BattlegroundWS.h:84
Definition: BattlegroundWS.h:116
void UpdateFlagState(uint32 team, uint32 value)
Definition: BattlegroundWS.cpp:635
void RespawnFlag(uint32 Team, bool captured)
Definition: BattlegroundWS.cpp:257
Definition: Language.h:648
Definition: Language.h:646
uint8 _flagDebuffState
Definition: BattlegroundWS.h:266

+ Here is the call graph for this function:

void BattlegroundWS::EventPlayerDroppedFlag ( Player player)
overridevirtual

Reimplemented from Battleground.

398 {
399  if (GetStatus() != STATUS_IN_PROGRESS)
400  {
401  // if not running, do not cast things at the dropper player (prevent spawning the "dropped" flag), neither send unnecessary messages
402  // just take off the aura
403  if (player->GetTeam() == ALLIANCE)
404  {
405  if (!IsHordeFlagPickedup())
406  return;
407 
408  if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID())
409  {
411  player->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
412  }
413  }
414  else
415  {
416  if (!IsAllianceFlagPickedup())
417  return;
418 
419  if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID())
420  {
422  player->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
423  }
424  }
425  return;
426  }
427 
428  bool set = false;
429 
430  if (player->GetTeam() == ALLIANCE)
431  {
432  if (!IsHordeFlagPickedup())
433  return;
434  if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID())
435  {
437  player->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
438  if (_flagDebuffState == 1)
439  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
440  else if (_flagDebuffState == 2)
441  player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT);
443  player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true);
444  set = true;
445  }
446  }
447  else
448  {
449  if (!IsAllianceFlagPickedup())
450  return;
451  if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID())
452  {
454  player->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
455  if (_flagDebuffState == 1)
456  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
457  else if (_flagDebuffState == 2)
458  player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT);
460  player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true);
461  set = true;
462  }
463  }
464 
465  if (set)
466  {
467  player->CastSpell(player, SPELL_RECENTLY_DROPPED_FLAG, true);
468  UpdateFlagState(player->GetTeam(), 1);
469 
470  if (player->GetTeam() == ALLIANCE)
471  {
474  }
475  else
476  {
479  }
480 
481  _flagsDropTimer[GetTeamIndexByTeamId(player->GetTeam()) ? 0 : 1] = BG_WS_FLAG_DROP_TIME;
482  }
483 }
Definition: BattlegroundWS.h:60
Definition: Battleground.h:159
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: BattlegroundWS.h:59
Definition: Language.h:644
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: BattlegroundWS.h:139
ObjectGuid GetFlagPickerGUID(int32 team) const override
Definition: BattlegroundWS.h:199
Definition: BattlegroundWS.h:47
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
Definition: SharedDefines.h:1000
void SendMessageToAll(uint32 entry, ChatMsg type, Player const *source=NULL)
Definition: Battleground.cpp:1706
Definition: BattlegroundWS.h:117
uint8 _flagState[2]
Definition: BattlegroundWS.h:256
void SetHordeFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:206
Definition: Battleground.h:113
bool IsHordeFlagPickedup() const
Definition: BattlegroundWS.h:208
Definition: SharedDefines.h:992
Definition: BattlegroundWS.h:138
Definition: BattlegroundWS.h:29
Definition: SharedDefines.h:4268
bool IsAllianceFlagPickedup() const
Definition: BattlegroundWS.h:207
void SetAllianceFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:205
Definition: BattlegroundWS.h:51
Definition: SharedDefines.h:4269
int32 _flagsDropTimer[2]
Definition: BattlegroundWS.h:258
Definition: BattlegroundWS.h:50
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
uint32_t uint32
Definition: g3dmath.h:168
Definition: Language.h:643
Definition: SharedDefines.h:993
void UpdateFlagState(uint32 team, uint32 value)
Definition: BattlegroundWS.cpp:635
Definition: BattlegroundWS.h:48
uint8 _flagDebuffState
Definition: BattlegroundWS.h:266

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from Battleground.

855 {
858 
860  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), -1);
862  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), 1);
863  else
864  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_ALLIANCE), 0);
865 
867  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), -1);
869  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), 1);
870  else
871  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_UNK_HORDE), 0);
872 
874 
875  if (GetStatus() == STATUS_IN_PROGRESS)
876  {
877  packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER_ACTIVE), 1);
878  packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER), int32(25 - _minutesElapsed));
879  }
880  else
881  packet.Worldstates.emplace_back(uint32(BG_WS_STATE_TIMER_ACTIVE), 0);
882 
884  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_HORDE), 2);
885  else
886  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_HORDE), 1);
887 
889  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_ALLIANCE), 2);
890  else
891  packet.Worldstates.emplace_back(uint32(BG_WS_FLAG_STATE_ALLIANCE), 1);
892 }
Definition: BattlegroundWS.h:60
Definition: Battleground.h:159
Definition: BattlegroundWS.h:59
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
std::list< WorldStateInfo > Worldstates
Definition: WorldStatePackets.h:47
Definition: BattlegroundWS.h:65
Definition: BattlegroundWS.h:66
Definition: BattlegroundWS.h:63
uint8 _minutesElapsed
Definition: BattlegroundWS.h:267
Definition: BattlegroundWS.h:67
uint32 GetTeamScore(uint32 TeamID) const
Definition: Battleground.cpp:1924
Definition: BattlegroundWS.h:117
uint8 _flagState[2]
Definition: BattlegroundWS.h:256
Definition: SharedDefines.h:992
Definition: BattlegroundWS.h:62
Definition: BattlegroundWS.h:27
int32_t int32
Definition: g3dmath.h:167
uint32_t uint32
Definition: g3dmath.h:168
Definition: SharedDefines.h:993
Definition: BattlegroundWS.h:116
Definition: BattlegroundWS.h:68
Definition: BattlegroundWS.h:64

+ Here is the call graph for this function:

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

Reimplemented from Battleground.

832 {
833  //if status in progress, it returns main graveyards with spiritguides
834  //else it will return the graveyard in the flagroom - this is especially good
835  //if a player dies in preparation phase - then the player can't cheat
836  //and teleport to the graveyard outside the flagroom
837  //and start running around, while the doors are still closed
838  if (player->GetTeam() == ALLIANCE)
839  {
840  if (GetStatus() == STATUS_IN_PROGRESS)
842  else
844  }
845  else
846  {
847  if (GetStatus() == STATUS_IN_PROGRESS)
848  return sWorldSafeLocsStore.LookupEntry(WS_GRAVEYARD_MAIN_HORDE);
849  else
851  }
852 }
Definition: Battleground.h:159
Definition: BattlegroundWS.h:125
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsfmt)
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: SharedDefines.h:1000
Definition: BattlegroundWS.h:124
Definition: BattlegroundWS.h:123
Definition: BattlegroundWS.h:122

+ Here is the call graph for this function:

ObjectGuid BattlegroundWS::GetDroppedFlagGUID ( uint32  TeamID)
inline
236 { return m_DroppedFlagGUID[GetTeamIndexByTeamId(TeamID)]; }
ObjectGuid m_DroppedFlagGUID[2]
Definition: BattlegroundWS.h:255
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ObjectGuid BattlegroundWS::GetFlagPickerGUID ( int32  team) const
inlineoverridevirtual

Reimplemented from Battleground.

200  {
201  if (team == TEAM_ALLIANCE || team == TEAM_HORDE)
202  return m_FlagKeepers[team];
203  return ObjectGuid::Empty;
204  }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: SharedDefines.h:992
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:254
Definition: SharedDefines.h:993

+ Here is the caller graph for this function:

uint8 BattlegroundWS::GetFlagState ( uint32  team)
inline
211 { return _flagState[GetTeamIndexByTeamId(team)]; }
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
uint8 _flagState[2]
Definition: BattlegroundWS.h:256

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundWS::GetPlayerPositionData ( std::vector< WorldPackets::Battleground::BattlegroundPlayerPosition > *  positions) const
overrideprotectedvirtual

Reimplemented from Battleground.

194 {
196  {
198  position.Guid = player->GetGUID();
199  position.Pos.x = player->GetPositionX();
200  position.Pos.y = player->GetPositionY();
203  positions->push_back(position);
204  }
205 
207  {
209  position.Guid = player->GetGUID();
210  position.Pos.x = player->GetPositionX();
211  position.Pos.y = player->GetPositionY();
214  positions->push_back(position);
215  }
216 }
int8 IconID
Definition: BattlegroundPackets.h:349
ObjectGuid Guid
Definition: BattlegroundPackets.h:347
int8 ArenaSlot
Definition: BattlegroundPackets.h:350
Definition: Battleground.h:218
BattlegroundMap * GetBgMap() const
Definition: Battleground.h:356
Definition: BattlegroundPackets.h:345
float y
Definition: Vector2.h:50
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:184
G3D::Vector2 Pos
Definition: BattlegroundPackets.h:348
Definition: SharedDefines.h:992
float x
Definition: Vector2.h:49
Definition: Battleground.h:217
Definition: Battleground.h:220
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:254
Definition: SharedDefines.h:993

+ Here is the call graph for this function:

uint32 BattlegroundWS::GetPrematureWinner ( )
overridevirtual

Reimplemented from Battleground.

895 {
897  return ALLIANCE;
899  return HORDE;
900 
902 }
virtual uint32 GetPrematureWinner()
Definition: Battleground.cpp:405
Definition: SharedDefines.h:1000
uint32 GetTeamScore(uint32 TeamID) const
Definition: Battleground.cpp:1924
Definition: SharedDefines.h:992
Definition: SharedDefines.h:999
Definition: SharedDefines.h:993

+ Here is the call graph for this function:

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

Reimplemented from Battleground.

652 {
653  if (GetStatus() != STATUS_IN_PROGRESS)
654  return;
655 
656  //uint32 SpellId = 0;
657  //uint64 buff_guid = 0;
658  switch (trigger)
659  {
660  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().
661  //buff_guid = BgObjects[BG_WS_OBJECT_SPEEDBUFF_1];
662  break;
663  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().
664  //buff_guid = BgObjects[BG_WS_OBJECT_SPEEDBUFF_2];
665  break;
666  case 3706: // Alliance elixir of regeneration spawn
667  //buff_guid = BgObjects[BG_WS_OBJECT_REGENBUFF_1];
668  break;
669  case 3708: // Horde elixir of regeneration spawn
670  //buff_guid = BgObjects[BG_WS_OBJECT_REGENBUFF_2];
671  break;
672  case 3707: // Alliance elixir of berserk spawn
673  //buff_guid = BgObjects[BG_WS_OBJECT_BERSERKBUFF_1];
674  break;
675  case 3709: // Horde elixir of berserk spawn
676  //buff_guid = BgObjects[BG_WS_OBJECT_BERSERKBUFF_2];
677  break;
678  case 3646: // Alliance Flag spawn
680  if (GetFlagPickerGUID(TEAM_HORDE) == player->GetGUID())
681  EventPlayerCapturedFlag(player);
682  break;
683  case 3647: // Horde Flag spawn
684  if (_flagState[TEAM_ALLIANCE] && !_flagState[TEAM_HORDE])
685  if (GetFlagPickerGUID(TEAM_ALLIANCE) == player->GetGUID())
686  EventPlayerCapturedFlag(player);
687  break;
688  case 3649: // unk1
689  case 3688: // unk2
690  case 4628: // unk3
691  case 4629: // unk4
692  break;
693  default:
694  Battleground::HandleAreaTrigger(player, trigger, entered);
695  break;
696  }
697 
698  //if (buff_guid)
699  // HandleTriggerBuff(buff_guid, player);
700 }
Definition: Battleground.h:159
void EventPlayerCapturedFlag(Player *player)
Definition: BattlegroundWS.cpp:309
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
ObjectGuid GetFlagPickerGUID(int32 team) const override
Definition: BattlegroundWS.h:199
uint8 _flagState[2]
Definition: BattlegroundWS.h:256
Definition: SharedDefines.h:992
virtual void HandleAreaTrigger(Player *, uint32, bool)
Definition: Battleground.cpp:1933
Definition: SharedDefines.h:993

+ Here is the call graph for this function:

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

Reimplemented from Battleground.

803 {
804  if (GetStatus() != STATUS_IN_PROGRESS)
805  return;
806 
807  EventPlayerDroppedFlag(player);
808 
809  Battleground::HandleKillPlayer(player, killer);
810 }
Definition: Battleground.h:159
virtual void HandleKillPlayer(Player *player, Player *killer)
Definition: Battleground.cpp:1784
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
void EventPlayerDroppedFlag(Player *player) override
Definition: BattlegroundWS.cpp:397

+ Here is the call graph for this function:

bool BattlegroundWS::IsAllianceFlagPickedup ( ) const
inline
207 { return !m_FlagKeepers[TEAM_ALLIANCE].IsEmpty(); }
Definition: SharedDefines.h:992
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:254
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool BattlegroundWS::IsHordeFlagPickedup ( ) const
inline
208 { return !m_FlagKeepers[TEAM_HORDE].IsEmpty(); }
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:254
Definition: SharedDefines.h:993
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

74 {
76  {
78  {
79  if (GetTeamScore(TEAM_ALLIANCE) == 0)
80  {
81  if (GetTeamScore(TEAM_HORDE) == 0) // No one scored - result is tie
82  EndBattleground(0);
83  else // Horde has more points and thus wins
85  }
86  else if (GetTeamScore(TEAM_HORDE) == 0)
87  EndBattleground(ALLIANCE); // Alliance has > 0, Horde has 0, alliance wins
88  else if (GetTeamScore(TEAM_HORDE) == GetTeamScore(TEAM_ALLIANCE)) // Team score equal, winner is team that scored the last flag
90  else if (GetTeamScore(TEAM_HORDE) > GetTeamScore(TEAM_ALLIANCE)) // Last but not least, check who has the higher score
92  else
94  }
95  // first update needed after 1 minute of game already in progress
96  else if (GetElapsedTime() > uint32(_minutesElapsed * MINUTE * IN_MILLISECONDS) + 3 * MINUTE * IN_MILLISECONDS)
97  {
100  }
101 
103  {
104  _flagsTimer[TEAM_ALLIANCE] -= diff;
105 
106  if (_flagsTimer[TEAM_ALLIANCE] < 0)
107  {
109  RespawnFlag(ALLIANCE, true);
110  }
111  }
112 
114  {
116 
118  {
121  _bothFlagsKept = false;
122  }
123  }
124 
126  {
127  _flagsTimer[TEAM_HORDE] -= diff;
128 
129  if (_flagsTimer[TEAM_HORDE] < 0)
130  {
131  _flagsTimer[TEAM_HORDE] = 0;
132  RespawnFlag(HORDE, true);
133  }
134  }
135 
137  {
138  _flagsDropTimer[TEAM_HORDE] -= diff;
139 
140  if (_flagsDropTimer[TEAM_HORDE] < 0)
141  {
144  _bothFlagsKept = false;
145  }
146  }
147 
148  if (_bothFlagsKept)
149  {
150  _flagSpellForceTimer += diff;
151  if (_flagDebuffState == 0 && _flagSpellForceTimer >= 10*MINUTE*IN_MILLISECONDS) //10 minutes
152  {
154  player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);
156  player->CastSpell(player, WS_SPELL_FOCUSED_ASSAULT, true);
157  _flagDebuffState = 1;
158  }
159  else if (_flagDebuffState == 1 && _flagSpellForceTimer >= 15*MINUTE*IN_MILLISECONDS) //15 minutes
160  {
162  {
163  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
164  player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true);
165  }
167  {
168  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
169  player->CastSpell(player, WS_SPELL_BRUTAL_ASSAULT, true);
170  }
171  _flagDebuffState = 2;
172  }
173  }
174  else
175  {
177  {
178  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
179  player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT);
180  }
182  {
183  player->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT);
184  player->RemoveAurasDueToSpell(WS_SPELL_BRUTAL_ASSAULT);
185  }
186 
187  _flagSpellForceTimer = 0; //reset timer.
188  _flagDebuffState = 0;
189  }
190  }
191 }
Definition: Battleground.h:159
int32 _flagSpellForceTimer
Definition: BattlegroundWS.h:264
uint32 _lastFlagCaptureTeam
Definition: BattlegroundWS.h:259
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: BattlegroundWS.h:139
uint8 _minutesElapsed
Definition: BattlegroundWS.h:267
void RespawnFlagAfterDrop(uint32 Team)
Definition: BattlegroundWS.cpp:281
Definition: BattlegroundWS.h:67
Definition: Common.h:97
Definition: SharedDefines.h:1000
uint32 GetTeamScore(uint32 TeamID) const
Definition: Battleground.cpp:1924
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:209
Definition: BattlegroundWS.h:117
uint8 _flagState[2]
Definition: BattlegroundWS.h:256
void EndBattleground(uint32 winner) override
Definition: BattlegroundWS.cpp:788
Definition: SharedDefines.h:992
Definition: BattlegroundWS.h:138
Definition: SharedDefines.h:999
Definition: BattlegroundWS.h:115
bool _bothFlagsKept
Definition: BattlegroundWS.h:265
Definition: Common.h:103
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:254
int32 _flagsDropTimer[2]
Definition: BattlegroundWS.h:258
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
uint32_t uint32
Definition: g3dmath.h:168
int32 _flagsTimer[2]
Definition: BattlegroundWS.h:257
Definition: SharedDefines.h:993
void RespawnFlag(uint32 Team, bool captured)
Definition: BattlegroundWS.cpp:257
uint32 GetElapsedTime() const
Definition: Battleground.h:268
uint8 _flagDebuffState
Definition: BattlegroundWS.h:266

+ Here is the call graph for this function:

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

Reimplemented from Battleground.

609 {
610  // sometimes flag aura not removed :(
612  {
613  if (!player)
614  {
615  TC_LOG_ERROR("bg.battleground", "BattlegroundWS: Removing offline player who has the FLAG!!");
617  RespawnFlag(ALLIANCE, false);
618  }
619  else
620  EventPlayerDroppedFlag(player);
621  }
622  if (IsHordeFlagPickedup() && m_FlagKeepers[TEAM_HORDE] == guid)
623  {
624  if (!player)
625  {
626  TC_LOG_ERROR("bg.battleground", "BattlegroundWS: Removing offline player who has the FLAG!!");
628  RespawnFlag(HORDE, false);
629  }
630  else
631  EventPlayerDroppedFlag(player);
632  }
633 }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: SharedDefines.h:1000
void SetHordeFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:206
bool IsHordeFlagPickedup() const
Definition: BattlegroundWS.h:208
Definition: SharedDefines.h:992
Definition: SharedDefines.h:999
bool IsAllianceFlagPickedup() const
Definition: BattlegroundWS.h:207
void SetAllianceFlagPicker(ObjectGuid guid)
Definition: BattlegroundWS.h:205
void EventPlayerDroppedFlag(Player *player) override
Definition: BattlegroundWS.cpp:397
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:254
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: SharedDefines.h:993
void RespawnFlag(uint32 Team, bool captured)
Definition: BattlegroundWS.cpp:257

+ Here is the call graph for this function:

void BattlegroundWS::RemovePoint ( uint32  TeamID,
uint32  Points = 1 
)
inline
int32 m_TeamScores[BG_TEAMS_COUNT]
Definition: Battleground.h:562
Points
Definition: ScriptedEscortAI.cpp:31
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399

+ Here is the call graph for this function:

void BattlegroundWS::Reset ( )
overridevirtual

Reimplemented from Battleground.

752 {
753  //call parent's class reset
755 
764 
765  if (sBattlegroundMgr->IsBGWeekend(GetTypeID()))
766  {
767  m_ReputationCapture = 45;
768  m_HonorWinKills = 3;
769  m_HonorEndKills = 4;
770  }
771  else
772  {
773  m_ReputationCapture = 35;
774  m_HonorWinKills = 1;
775  m_HonorEndKills = 2;
776  }
777  _minutesElapsed = 0;
779  _bothFlagsKept = false;
780  _flagDebuffState = 0;
785  _flagsTimer[TEAM_HORDE] = 0;
786 }
int32 m_TeamScores[BG_TEAMS_COUNT]
Definition: Battleground.h:562
int32 _flagSpellForceTimer
Definition: BattlegroundWS.h:264
uint32 _lastFlagCaptureTeam
Definition: BattlegroundWS.h:259
uint8 _minutesElapsed
Definition: BattlegroundWS.h:267
ObjectGuid m_DroppedFlagGUID[2]
Definition: BattlegroundWS.h:255
uint8 _flagState[2]
Definition: BattlegroundWS.h:256
virtual void Reset()
Definition: Battleground.cpp:1034
Definition: SharedDefines.h:992
void Clear()
Definition: ObjectGuid.h:215
Definition: BattlegroundWS.h:114
uint32 m_HonorEndKills
Definition: BattlegroundWS.h:263
uint32 m_HonorWinKills
Definition: BattlegroundWS.h:262
bool _bothFlagsKept
Definition: BattlegroundWS.h:265
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:254
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:181
int32 _flagsDropTimer[2]
Definition: BattlegroundWS.h:258
BattlegroundTypeId GetTypeID(bool GetRandom=false) const
Definition: Battleground.h:263
int32 _flagsTimer[2]
Definition: BattlegroundWS.h:257
Definition: SharedDefines.h:993
uint32 m_ReputationCapture
Definition: BattlegroundWS.h:261
uint8 _flagDebuffState
Definition: BattlegroundWS.h:266

+ Here is the call graph for this function:

void BattlegroundWS::RespawnFlag ( uint32  Team,
bool  captured 
)
258 {
259  if (Team == ALLIANCE)
260  {
261  TC_LOG_DEBUG("bg.battleground", "Respawn Alliance flag");
263  }
264  else
265  {
266  TC_LOG_DEBUG("bg.battleground", "Respawn Horde flag");
268  }
269 
270  if (captured)
271  {
272  //when map_update will be allowed for battlegrounds this code will be useless
276  PlaySoundToAll(BG_WS_SOUND_FLAGS_RESPAWNED); // flag respawned sound...
277  }
278  _bothFlagsKept = false;
279 }
Definition: Battleground.h:129
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: BattlegroundWS.h:83
Definition: SharedDefines.h:1000
void SendMessageToAll(uint32 entry, ChatMsg type, Player const *source=NULL)
Definition: Battleground.cpp:1706
Team
Definition: SharedDefines.h:997
void PlaySoundToAll(uint32 SoundID)
Definition: Battleground.cpp:681
Definition: SharedDefines.h:4267
uint8 _flagState[2]
Definition: BattlegroundWS.h:256
Definition: BattlegroundWS.h:42
Definition: SharedDefines.h:992
Definition: BattlegroundWS.h:114
bool _bothFlagsKept
Definition: BattlegroundWS.h:265
Definition: Language.h:649
Definition: SharedDefines.h:993
Definition: BattlegroundWS.h:84

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundWS::RespawnFlagAfterDrop ( uint32  Team)
282 {
283  if (GetStatus() != STATUS_IN_PROGRESS)
284  return;
285 
286  RespawnFlag(team, false);
287  if (team == ALLIANCE)
288  {
291  }
292  else
293  {
296  }
297 
299 
301  obj->Delete();
302  else
303  TC_LOG_ERROR("bg.battleground", "unknown dropped flag (%s)", GetDroppedFlagGUID(team).ToString().c_str());
304 
306  _bothFlagsKept = false;
307 }
Definition: Battleground.h:159
Definition: Battleground.h:129
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
Definition: Language.h:651
BattlegroundMap * GetBgMap() const
Definition: Battleground.h:356
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
Definition: BattlegroundWS.h:83
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399
Definition: SharedDefines.h:1000
Definition: Language.h:650
void SendMessageToAll(uint32 entry, ChatMsg type, Player const *source=NULL)
Definition: Battleground.cpp:1706
void PlaySoundToAll(uint32 SoundID)
Definition: Battleground.cpp:681
Definition: SharedDefines.h:4267
string ToString(int i)
Definition: strutil.h:491
Definition: BattlegroundWS.h:42
Definition: GameObject.h:880
bool _bothFlagsKept
Definition: BattlegroundWS.h:265
ObjectGuid GetDroppedFlagGUID(uint32 TeamID)
Definition: BattlegroundWS.h:236
TC_GAME_API GameObject * GetGameObject(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:143
void SetDroppedFlagGUID(ObjectGuid guid, int32 team=-1) override
Definition: BattlegroundWS.h:230
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: BattlegroundWS.h:84
void RespawnFlag(uint32 Team, bool captured)
Definition: BattlegroundWS.cpp:257

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundWS::SetAllianceFlagPicker ( ObjectGuid  guid)
inline
205 { m_FlagKeepers[TEAM_ALLIANCE] = guid; }
Definition: SharedDefines.h:992
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:254

+ Here is the caller graph for this function:

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

Reimplemented from Battleground.

231  {
232  if (team == TEAM_ALLIANCE || team == TEAM_HORDE)
233  m_DroppedFlagGUID[team] = guid;
234  }
ObjectGuid m_DroppedFlagGUID[2]
Definition: BattlegroundWS.h:255
Definition: SharedDefines.h:992
Definition: SharedDefines.h:993

+ Here is the caller graph for this function:

void BattlegroundWS::SetHordeFlagPicker ( ObjectGuid  guid)
inline
206 { m_FlagKeepers[TEAM_HORDE] = guid; }
ObjectGuid m_FlagKeepers[2]
Definition: BattlegroundWS.h:254
Definition: SharedDefines.h:993

+ Here is the caller graph for this function:

void BattlegroundWS::SetLastFlagCapture ( uint32  team)
inline
227 { _lastFlagCaptureTeam = team; }
uint32 _lastFlagCaptureTeam
Definition: BattlegroundWS.h:259

+ Here is the caller graph for this function:

void BattlegroundWS::SetTeamPoint ( uint32  TeamID,
uint32  Points = 0 
)
inline
int32 m_TeamScores[BG_TEAMS_COUNT]
Definition: Battleground.h:562
Points
Definition: ScriptedEscortAI.cpp:31
static TeamId GetTeamIndexByTeamId(uint32 Team)
Definition: Battleground.h:399

+ Here is the call graph for this function:

bool BattlegroundWS::SetupBattleground ( )
overridevirtual

Reimplemented from Battleground.

703 {
704  // flags
705  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)
706  || !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)
707  // buffs
708  || !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)
709  || !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)
710  || !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)
711  || !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)
712  || !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)
713  || !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)
714  // alliance gates
715  || !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)
716  || !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)
717  || !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)
718  || !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)
719  || !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)
720  || !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)
721  // horde gates
722  || !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)
723  || !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)
724  || !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)
725  || !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)
726 )
727  {
728  TC_LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn some object Battleground not created!");
729  return false;
730  }
731 
733  if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.124139f, TEAM_ALLIANCE))
734  {
735  TC_LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn Alliance spirit guide! Battleground not created!");
736  return false;
737  }
738 
740  if (!sg || !AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->Loc.X, sg->Loc.Y, sg->Loc.Z, 3.193953f, TEAM_HORDE))
741  {
742  TC_LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn Horde spirit guide! Battleground not created!");
743  return false;
744  }
745 
746  TC_LOG_DEBUG("bg.battleground", "BatteGroundWS: BG objects and spirit guides spawned");
747 
748  return true;
749 }
Definition: BattlegroundWS.h:88
Definition: BattlegroundWS.h:98
Definition: Battleground.h:129
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:1446
Definition: BattlegroundWS.h:104
float Z
Definition: DBCEnums.h:36
Definition: BattlegroundWS.h:125
float Y
Definition: DBCEnums.h:35
DBCStorage< WorldSafeLocsEntry > sWorldSafeLocsStore(WorldSafeLocsfmt)
virtual bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId=TEAM_NEUTRAL)
Definition: Battleground.cpp:1676
Definition: BattlegroundWS.h:76
Definition: BattlegroundWS.h:96
Definition: BattlegroundWS.h:78
Definition: Battleground.h:148
Definition: BattlegroundWS.h:79
Definition: BattlegroundWS.h:85
Definition: DBCStructure.h:1434
Definition: BattlegroundWS.h:73
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: BattlegroundWS.h:102
Definition: BattlegroundWS.h:81
Definition: BattlegroundWS.h:131
Definition: BattlegroundWS.h:83
Definition: Battleground.h:149
Definition: BattlegroundWS.h:90
Definition: BattlegroundWS.h:101
Definition: BattlegroundWS.h:97
Definition: Battleground.h:147
Definition: BattlegroundWS.h:124
Definition: BattlegroundWS.h:105
Definition: SharedDefines.h:992
float X
Definition: DBCEnums.h:34
Definition: BattlegroundWS.h:86
DBCPosition3D Loc
Definition: DBCStructure.h:1438
Definition: BattlegroundWS.h:103
Definition: Battleground.h:130
Definition: BattlegroundWS.h:82
Definition: BattlegroundWS.h:80
Definition: BattlegroundWS.h:100
Definition: BattlegroundWS.h:130
Definition: BattlegroundWS.h:74
Definition: BattlegroundWS.h:107
Definition: BattlegroundWS.h:99
Definition: BattlegroundWS.h:28
Definition: BattlegroundWS.h:77
Definition: BattlegroundWS.h:87
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207
Definition: BattlegroundWS.h:106
Definition: BattlegroundWS.h:75
Definition: BattlegroundWS.h:89
Definition: SharedDefines.h:993
Definition: BattlegroundWS.h:84

+ Here is the call graph for this function:

void BattlegroundWS::StartingEventCloseDoors ( )
overridevirtual

Reimplemented from Battleground.

219 {
221  {
222  DoorClose(i);
224  }
227 
230 }
Definition: Battleground.h:129
Definition: BattlegroundWS.h:73
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
Definition: BattlegroundWS.h:67
Definition: BattlegroundWS.h:83
Definition: BattlegroundWS.h:90
uint32_t uint32
Definition: Define.h:150
Definition: Battleground.h:128
Definition: BattlegroundWS.h:82
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
Definition: BattlegroundWS.h:68
void DoorClose(uint32 type)
Definition: Battleground.cpp:1506

+ Here is the call graph for this function:

void BattlegroundWS::StartingEventOpenDoors ( )
overridevirtual

Reimplemented from Battleground.

233 {
235  DoorOpen(i);
237  DoorOpen(i);
238 
241 
246 
247  // players joining later are not eligibles
249 }
Definition: Battleground.h:129
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: Battleground.cpp:1905
Definition: BattlegroundWS.h:78
Definition: DBCEnums.h:183
Definition: BattlegroundWS.h:79
Definition: BattlegroundWS.h:73
void SpawnBGObject(uint32 type, uint32 respawntime)
Definition: Battleground.cpp:1564
Definition: BattlegroundWS.h:81
#define WS_EVENT_START_BATTLE
Definition: BattlegroundWS.h:148
Definition: BattlegroundWS.h:83
Definition: BattlegroundWS.h:90
uint32_t uint32
Definition: Define.h:150
Definition: Battleground.h:128
Definition: BattlegroundWS.h:82
void DoorOpen(uint32 type)
Definition: Battleground.cpp:1522
Definition: BattlegroundWS.h:77

+ Here is the call graph for this function:

void BattlegroundWS::UpdateFlagState ( uint32  team,
uint32  value 
)
636 {
637  if (team == ALLIANCE)
639  else
641 }
Definition: BattlegroundWS.h:65
Definition: BattlegroundWS.h:66
Definition: SharedDefines.h:1000
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735
const FieldDescriptor value
Definition: descriptor.h:1522

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Reimplemented from Battleground.

813 {
814  if (!Battleground::UpdatePlayerScore(player, type, value, doAddHonor))
815  return false;
816 
817  switch (type)
818  {
819  case SCORE_FLAG_CAPTURES: // flags captured
821  break;
822  case SCORE_FLAG_RETURNS: // flags returned
824  break;
825  default:
826  break;
827  }
828  return true;
829 }
Definition: BattlegroundScore.h:35
Definition: BattlegroundWS.h:145
virtual bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true)
Definition: Battleground.cpp:1381
Definition: BattlegroundScore.h:36
const FieldDescriptor value
Definition: descriptor.h:1522
Definition: BattlegroundWS.h:144

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void BattlegroundWS::UpdateTeamScore ( uint32  team)
644 {
645  if (team == TEAM_ALLIANCE)
647  else
649 }
Definition: BattlegroundWS.h:63
uint32 GetTeamScore(uint32 TeamID) const
Definition: Battleground.cpp:1924
Definition: SharedDefines.h:992
Definition: BattlegroundWS.h:62
void UpdateWorldState(uint32 variable, uint32 value, bool hidden=false)
Definition: Battleground.cpp:735

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

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

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