AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
BattlegroundWS Class Reference

#include "BattlegroundWS.h"

Inheritance diagram for BattlegroundWS:
Battleground

Public Member Functions

 BattlegroundWS ()
 
 ~BattlegroundWS () override
 
void AddPlayer (Player *player) override
 
void StartingEventCloseDoors () override
 
void StartingEventOpenDoors () override
 
ObjectGuid GetFlagPickerGUID (TeamId teamId) const override
 
void SetFlagPicker (ObjectGuid guid, TeamId teamId)
 
void RespawnFlagAfterDrop (TeamId teamId)
 
uint8 GetFlagState (TeamId teamId) const
 
void CheckFlagKeeperInArea (TeamId teamId)
 
void EventPlayerDroppedFlag (Player *player) override
 
void EventPlayerClickedOnFlag (Player *player, GameObject *gameObject) override
 
void EventPlayerCapturedFlag (Player *player)
 
void RemovePlayer (Player *player) override
 
void HandleAreaTrigger (Player *player, uint32 trigger) override
 
void HandleKillPlayer (Player *player, Player *killer) override
 
bool SetupBattleground () override
 
void Init () override
 
void EndBattleground (TeamId winnerTeamId) override
 
GraveyardStruct const * GetClosestGraveyard (Player *player) override
 
void UpdateFlagState (TeamId teamId, uint32 value)
 
bool UpdatePlayerScore (Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
 
void SetDroppedFlagGUID (ObjectGuid guid, TeamId teamId) override
 
ObjectGuid GetDroppedFlagGUID (TeamId teamId) const
 
void FillInitialWorldStates (WorldPacket &data) override
 
void AddPoints (TeamId teamId, uint32 points)
 
TeamId GetPrematureWinner () override
 
uint32 GetMatchTime () const
 
uint32 GetAssaultSpellId () const
 
void RemoveAssaultAuras ()
 
- Public Member Functions inherited from Battleground
 Battleground ()
 
virtual ~Battleground ()
 
void Update (uint32 diff)
 
virtual bool SetupBattleground ()
 
virtual void Init ()
 
virtual void StartingEventCloseDoors ()
 
virtual void StartingEventOpenDoors ()
 
virtual void ResetBGSubclass ()
 
virtual void DestroyGate (Player *, GameObject *)
 
virtual bool AllNodesConrolledByTeam (TeamId) const
 
void StartTimedAchievement (AchievementCriteriaTimedTypes type, uint32 entry)
 
std::string GetName () const
 
BattlegroundTypeId GetBgTypeID (bool GetRandom=false) const
 
BattlegroundBracketId GetBracketId () const
 
uint32 GetInstanceID () const
 
BattlegroundStatus GetStatus () const
 
uint32 GetClientInstanceID () const
 
uint32 GetStartTime () const
 
uint32 GetEndTime () const
 
uint32 GetLastResurrectTime () const
 
uint32 GetMinLevel () const
 
uint32 GetMaxLevel () const
 
uint32 GetMaxPlayersPerTeam () const
 
uint32 GetMinPlayersPerTeam () const
 
int32 GetStartDelayTime () const
 
uint8 GetArenaType () const
 
PvPTeamId GetWinner () const
 
uint32 GetScriptId () const
 
uint32 GetBonusHonorFromKill (uint32 kills) const
 
bool IsRandom ()
 
void SetName (std::string_view name)
 
void SetBgTypeID (BattlegroundTypeId TypeID)
 
void SetRandomTypeID (BattlegroundTypeId TypeID)
 
void SetBracket (PvPDifficultyEntry const *bracketEntry)
 
void SetInstanceID (uint32 InstanceID)
 
void SetStatus (BattlegroundStatus Status)
 
void SetClientInstanceID (uint32 InstanceID)
 
void SetStartTime (uint32 Time)
 
void SetEndTime (uint32 Time)
 
void SetLastResurrectTime (uint32 Time)
 
void SetLevelRange (uint32 min, uint32 max)
 
void SetRated (bool state)
 
void SetArenaType (uint8 type)
 
void SetArenaorBGType (bool _isArena)
 
void SetWinner (PvPTeamId winner)
 
void SetScriptId (uint32 scriptId)
 
void SetRandom (bool isRandom)
 
void ModifyStartDelayTime (int32 diff)
 
void SetStartDelayTime (int32 Time)
 
void SetMaxPlayersPerTeam (uint32 MaxPlayers)
 
void SetMinPlayersPerTeam (uint32 MinPlayers)
 
void AddToBGFreeSlotQueue ()
 
void RemoveFromBGFreeSlotQueue ()
 
void DecreaseInvitedCount (TeamId teamId)
 
void IncreaseInvitedCount (TeamId teamId)
 
uint32 GetInvitedCount (TeamId teamId) const
 
bool HasFreeSlots () const
 
uint32 GetFreeSlotsForTeam (TeamId teamId) const
 
uint32 GetMaxFreeSlots () const
 
void AddSpectator (Player *p)
 
void RemoveSpectator (Player *p)
 
bool HaveSpectators ()
 
const SpectatorListGetSpectators () const
 
void AddToBeTeleported (ObjectGuid spectator, ObjectGuid participant)
 
void RemoveToBeTeleported (ObjectGuid spectator)
 
void SpectatorsSendPacket (WorldPacket &data)
 
bool isArena () const
 
bool isBattleground () const
 
bool isRated () const
 
BattlegroundPlayerMap const & GetPlayers () const
 
uint32 GetPlayersSize () const
 
void ReadyMarkerClicked (Player *p)
 
BattlegroundScoreMap const * GetPlayerScores () const
 
std::size_t GetPlayerScoresSize () const
 
uint32 GetReviveQueueSize () const
 
void AddPlayerToResurrectQueue (ObjectGuid npc_guid, ObjectGuid player_guid)
 
void RemovePlayerFromResurrectQueue (Player *player)
 
void RelocateDeadPlayers (ObjectGuid queueIndex)
 Relocate all players in ReviveQueue to the closest graveyard. More...
 
void StartBattleground ()
 
GameObjectGetBGObject (uint32 type)
 
CreatureGetBGCreature (uint32 type)
 
void SetMapId (uint32 MapID)
 
uint32 GetMapId () const
 
void SetBgMap (BattlegroundMap *map)
 
BattlegroundMapGetBgMap () const
 
BattlegroundMapFindBgMap () const
 
void SetTeamStartPosition (TeamId teamId, Position const &pos)
 
Position const * GetTeamStartPosition (TeamId teamId) const
 
void SetStartMaxDist (float startMaxDist)
 
float GetStartMaxDist () const
 
virtual void FillInitialWorldStates (WorldPacket &)
 
void SendPacketToTeam (TeamId teamId, WorldPacket const *packet, Player *sender=nullptr, bool self=true)
 
void SendPacketToAll (WorldPacket const *packet)
 
void YellToAll (Creature *creature, const char *text, uint32 language)
 
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 PlaySoundToAll (uint32 soundId)
 
void CastSpellOnTeam (uint32 spellId, TeamId teamId)
 
void RemoveAuraOnTeam (uint32 spellId, TeamId teamId)
 
void RewardHonorToTeam (uint32 honor, TeamId teamId)
 
void RewardReputationToTeam (uint32 factionId, uint32 reputation, TeamId teamId)
 
uint32 GetRealRepFactionForPlayer (uint32 factionId, Player *player)
 
void UpdateWorldState (uint32 variable, uint32 value)
 
void EndBattleground (PvPTeamId winnerTeamId)
 
virtual void EndBattleground (TeamId winnerTeamId)
 
void BlockMovement (Player *player)
 
void SendWarningToAll (uint32 entry,...)
 
void SendMessageToAll (uint32 entry, ChatMsg type, Player const *source=nullptr)
 
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 (TeamId teamId) const
 
void SetBgRaid (TeamId teamId, Group *bg_raid)
 
void BuildPvPLogDataPacket (WorldPacket &data)
 
virtual bool UpdatePlayerScore (Player *player, uint32 type, uint32 value, bool doAddHonor=true)
 
uint32 GetPlayersCountByTeam (TeamId teamId) const
 
uint32 GetAlivePlayersCountByTeam (TeamId teamId) const
 
void UpdatePlayersCountByTeam (TeamId teamId, bool remove)
 
virtual void CheckWinConditions ()
 
void SetArenaTeamIdForTeam (TeamId teamId, uint32 ArenaTeamId)
 
uint32 GetArenaTeamIdForTeam (TeamId teamId) const
 
void SetArenaMatchmakerRating (TeamId teamId, uint32 MMR)
 
uint32 GetArenaMatchmakerRating (TeamId teamId) const
 
virtual void HandleAreaTrigger (Player *, uint32)
 
virtual void HandleKillPlayer (Player *player, Player *killer)
 
virtual void HandleKillUnit (Creature *, Player *)
 
virtual void EventPlayerDroppedFlag (Player *)
 
virtual void EventPlayerClickedOnFlag (Player *, GameObject *)
 
virtual void EventPlayerDamagedGO (Player *, GameObject *, uint32)
 
virtual void EventPlayerUsedGO (Player *, GameObject *)
 
virtual void DoAction (uint32, ObjectGuid)
 
virtual void HandlePlayerResurrect (Player *)
 
virtual GraveyardStruct const * GetClosestGraveyard (Player *player)
 
virtual void AddPlayer (Player *player)
 
void AddOrSetPlayerToCorrectBgGroup (Player *player, TeamId teamId)
 
virtual void RemovePlayerAtLeave (Player *player)
 
void HandleTriggerBuff (GameObject *gameObject)
 
void SetHoliday (bool is_holiday)
 
void SpawnBGObject (uint32 type, uint32 respawntime, uint32 forceRespawnDelay=0)
 
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)
 
CreatureAddCreature (uint32 entry, uint32 type, float x, float y, float z, float o, uint32 respawntime=0, MotionTransport *transport=nullptr)
 
bool DelCreature (uint32 type)
 
bool DelObject (uint32 type)
 
bool AddSpiritGuide (uint32 type, float x, float y, float z, float o, TeamId teamId)
 
int32 GetObjectType (ObjectGuid guid)
 
void DoorOpen (uint32 type)
 
void DoorClose (uint32 type)
 
const char * GetAcoreString (int32 entry)
 
virtual bool HandlePlayerUnderMap (Player *)
 
bool IsPlayerInBattleground (ObjectGuid guid) const
 
bool ToBeDeleted () const
 
void RewardXPAtKill (Player *killer, Player *victim)
 
virtual ObjectGuid GetFlagPickerGUID (TeamId=TEAM_NEUTRAL) const
 
virtual void SetDroppedFlagGUID (ObjectGuid, TeamId=TEAM_NEUTRAL)
 
uint32 GetTeamScore (TeamId teamId) const
 
virtual TeamId GetPrematureWinner ()
 
uint8 GetUniqueBracketId () const
 
BattlegroundAVToBattlegroundAV ()
 
BattlegroundAV const * ToBattlegroundAV () const
 
BattlegroundWSToBattlegroundWS ()
 
BattlegroundWS const * ToBattlegroundWS () const
 
BattlegroundABToBattlegroundAB ()
 
BattlegroundAB const * ToBattlegroundAB () const
 
BattlegroundNAToBattlegroundNA ()
 
BattlegroundNA const * ToBattlegroundNA () const
 
BattlegroundBEToBattlegroundBE ()
 
BattlegroundBE const * ToBattlegroundBE () const
 
BattlegroundEYToBattlegroundEY ()
 
BattlegroundEY const * ToBattlegroundEY () const
 
BattlegroundRLToBattlegroundRL ()
 
BattlegroundRL const * ToBattlegroundRL () const
 
BattlegroundSAToBattlegroundSA ()
 
BattlegroundSA const * ToBattlegroundSA () const
 
BattlegroundDSToBattlegroundDS ()
 
BattlegroundDS const * ToBattlegroundDS () const
 
BattlegroundRVToBattlegroundRV ()
 
BattlegroundRV const * ToBattlegroundRV () const
 
BattlegroundICToBattlegroundIC ()
 
BattlegroundIC const * ToBattlegroundIC () const
 

Private Member Functions

void PostUpdateImpl (uint32 diff) override
 Post-update hook. More...
 

Private Attributes

EventMap _bgEvents
 
ObjectGuid _flagKeepers [2]
 
ObjectGuid _droppedFlagGUID [2]
 
uint8 _flagState [2]
 
TeamId _lastFlagCaptureTeam
 
uint32 _reputationCapture
 
uint32 _honorWinKills
 
uint32 _honorEndKills
 

Additional Inherited Members

- Public Types inherited from Battleground
typedef std::set< Player * > SpectatorList
 
typedef std::map< ObjectGuid, ObjectGuidToBeTeleportedMap
 
typedef std::map< ObjectGuid, Player * > BattlegroundPlayerMap
 
typedef std::unordered_map< ObjectGuid::LowType, BattlegroundScore * > BattlegroundScoreMap
 
typedef std::unordered_map< ObjectGuid, ArenaLogEntryDataArenaLogEntryDataMap
 
typedef GuidVector BGObjects
 
typedef GuidVector BGCreatures
 
- Static Public Member Functions inherited from Battleground
static TeamId GetOtherTeamId (TeamId teamId)
 
- Public Attributes inherited from Battleground
GuidSet readyMarkerClickedSet
 
ArenaLogEntryDataMap ArenaLogEntries
 
BGObjects BgObjects
 
BGCreatures BgCreatures
 
- Protected Member Functions inherited from Battleground
void EndNow ()
 
void PlayerAddedToBGCheckIfBGIsRunning (Player *player)
 
void _ProcessResurrect (uint32 diff)
 
void _ProcessProgress (uint32 diff)
 
void _ProcessLeave (uint32 diff)
 
void _ProcessJoin (uint32 diff)
 
void _CheckSafePositions (uint32 diff)
 
virtual void RemovePlayer (Player *)
 
- 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 [PVP_TEAMS_COUNT]
 
ArenaTeamScore _arenaTeamScores [PVP_TEAMS_COUNT]
 
uint32 m_UpdateTimer
 
EventProcessor _reviveEvents
 

Detailed Description

Constructor & Destructor Documentation

◆ BattlegroundWS()

BattlegroundWS::BattlegroundWS ( )
37{
40
44
51}
@ BG_STARTING_EVENT_THIRD
Definition: Battleground.h:236
@ BG_STARTING_EVENT_SECOND
Definition: Battleground.h:235
@ BG_STARTING_EVENT_FOURTH
Definition: Battleground.h:237
@ BG_WS_FLAG_STATE_ON_BASE
Definition: BattlegroundWS.h:143
@ BG_WS_OBJECT_MAX
Definition: BattlegroundWS.h:120
@ BG_CREATURES_MAX_WS
Definition: BattlegroundWS.h:161
@ BG_WS_TEXT_START_HALF_MINUTE
Definition: BattlegroundWS.h:52
@ BG_WS_TEXT_BATTLE_HAS_BEGUN
Definition: BattlegroundWS.h:53
@ BG_WS_TEXT_START_ONE_MINUTE
Definition: BattlegroundWS.h:51
@ TEAM_NEUTRAL
Definition: SharedDefines.h:734
@ TEAM_ALLIANCE
Definition: SharedDefines.h:732
@ TEAM_HORDE
Definition: SharedDefines.h:733
BGObjects BgObjects
Definition: Battleground.h:531
BGCreatures BgCreatures
Definition: Battleground.h:532
uint32 StartMessageIds[BG_STARTING_EVENT_COUNT]
Definition: Battleground.h:624
TeamId _lastFlagCaptureTeam
Definition: BattlegroundWS.h:271
uint32 _honorEndKills
Definition: BattlegroundWS.h:274
uint8 _flagState[2]
Definition: BattlegroundWS.h:270
uint32 _reputationCapture
Definition: BattlegroundWS.h:272
uint32 _honorWinKills
Definition: BattlegroundWS.h:273

References _flagState, _honorEndKills, _honorWinKills, _lastFlagCaptureTeam, _reputationCapture, BG_CREATURES_MAX_WS, BG_STARTING_EVENT_FOURTH, BG_STARTING_EVENT_SECOND, BG_STARTING_EVENT_THIRD, BG_WS_FLAG_STATE_ON_BASE, BG_WS_OBJECT_MAX, BG_WS_TEXT_BATTLE_HAS_BEGUN, BG_WS_TEXT_START_HALF_MINUTE, BG_WS_TEXT_START_ONE_MINUTE, Battleground::BgCreatures, Battleground::BgObjects, Battleground::StartMessageIds, TEAM_ALLIANCE, TEAM_HORDE, and TEAM_NEUTRAL.

◆ ~BattlegroundWS()

BattlegroundWS::~BattlegroundWS ( )
override
54{
55}

Member Function Documentation

◆ AddPlayer()

void BattlegroundWS::AddPlayer ( Player player)
overridevirtual

Reimplemented from Battleground.

146{
148 PlayerScores.emplace(player->GetGUID().GetCounter(), new BattlegroundWGScore(player->GetGUID()));
149}
virtual void AddPlayer(Player *player)
Definition: Battleground.cpp:1077
BattlegroundScoreMap PlayerScores
Definition: Battleground.h:611
Definition: BattlegroundWS.h:188
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:106
LowType GetCounter() const
Definition: ObjectGuid.h:147

References Battleground::AddPlayer(), ObjectGuid::GetCounter(), Object::GetGUID(), and Battleground::PlayerScores.

◆ AddPoints()

void BattlegroundWS::AddPoints ( TeamId  teamId,
uint32  points 
)
inline
258{ m_TeamScores[teamId] += points; }
int32 m_TeamScores[PVP_TEAMS_COUNT]
Definition: Battleground.h:630

Referenced by EventPlayerCapturedFlag().

◆ CheckFlagKeeperInArea()

void BattlegroundWS::CheckFlagKeeperInArea ( TeamId  teamId)
173{
175 {
176 return;
177 }
178
180 AreaTrigger const* areaTrigger = sObjectMgr->GetAreaTrigger(triggerId);
182 {
183 if (areaTrigger && player->IsInAreaTriggerRadius(areaTrigger))
184 {
185 HandleAreaTrigger(player, triggerId);
186 }
187 }
188}
std::uint32_t uint32
Definition: Define.h:108
@ STATUS_IN_PROGRESS
Definition: Battleground.h:197
@ BG_WS_FLAG_STATE_ON_PLAYER
Definition: BattlegroundWS.h:144
@ BG_WS_TRIGGER_HORDE_FLAG_SPAWN
Definition: BattlegroundWS.h:175
@ BG_WS_TRIGGER_ALLIANCE_FLAG_SPAWN
Definition: BattlegroundWS.h:174
#define sObjectMgr
Definition: ObjectMgr.h:1606
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:225
BattlegroundMap * FindBgMap() const
Definition: Battleground.h:425
BattlegroundStatus GetStatus() const
Definition: Battleground.h:322
uint8 GetFlagState(TeamId teamId) const
Definition: BattlegroundWS.h:235
ObjectGuid GetFlagPickerGUID(TeamId teamId) const override
Definition: BattlegroundWS.h:232
void HandleAreaTrigger(Player *player, uint32 trigger) override
Definition: BattlegroundWS.cpp:398
Definition: Player.h:1046
Definition: ObjectMgr.h:421

References BG_WS_FLAG_STATE_ON_PLAYER, BG_WS_TRIGGER_ALLIANCE_FLAG_SPAWN, BG_WS_TRIGGER_HORDE_FLAG_SPAWN, Battleground::FindBgMap(), GetFlagPickerGUID(), GetFlagState(), ObjectAccessor::GetPlayer(), Battleground::GetStatus(), HandleAreaTrigger(), sObjectMgr, STATUS_IN_PROGRESS, and TEAM_ALLIANCE.

Referenced by EventPlayerClickedOnFlag(), and RespawnFlagAfterDrop().

◆ EndBattleground()

void BattlegroundWS::EndBattleground ( TeamId  winnerTeamId)
overridevirtual
Deprecated:
need delete

Reimplemented from Battleground.

504{
505 // Win reward
507
508 // Complete map_end rewards (even if no team wins)
511
512 Battleground::EndBattleground(winnerTeamId);
513}
void EndBattleground(PvPTeamId winnerTeamId)
Definition: Battleground.cpp:778
uint32 GetBonusHonorFromKill(uint32 kills) const
Definition: Battleground.cpp:922
void RewardHonorToTeam(uint32 honor, TeamId teamId)
Definition: Battleground.cpp:720

References _honorEndKills, _honorWinKills, Battleground::EndBattleground(), Battleground::GetBonusHonorFromKill(), Battleground::RewardHonorToTeam(), TEAM_ALLIANCE, and TEAM_HORDE.

Referenced by EventPlayerCapturedFlag(), and PostUpdateImpl().

◆ EventPlayerCapturedFlag()

void BattlegroundWS::EventPlayerCapturedFlag ( Player player)
191{
193 return;
194
197
198 AddPoints(player->GetTeamId(), 1);
201
202 if (player->GetTeamId() == TEAM_ALLIANCE)
203 {
208 }
209 else
210 {
215 }
216
219
221 UpdatePlayerScore(player, SCORE_FLAG_CAPTURES, 1); // +1 flag captures
223
225
227 {
230 }
231 else
233
236}
@ SCORE_FLAG_CAPTURES
Definition: BattlegroundScore.h:37
@ BG_WS_OBJECT_A_FLAG
Definition: BattlegroundWS.h:112
@ BG_WS_OBJECT_H_FLAG
Definition: BattlegroundWS.h:113
@ BG_WS_SPELL_WARSONG_FLAG
Definition: BattlegroundWS.h:79
@ BG_WS_SPELL_SILVERWING_FLAG
Definition: BattlegroundWS.h:82
@ BG_WS_SOUND_FLAG_CAPTURED_HORDE
Definition: BattlegroundWS.h:69
@ BG_WS_SOUND_FLAG_CAPTURED_ALLIANCE
Definition: BattlegroundWS.h:68
@ BG_WS_EVENT_BOTH_FLAGS_KEPT15
Definition: BattlegroundWS.h:33
@ BG_WS_EVENT_RESPAWN_BOTH_FLAGS
Definition: BattlegroundWS.h:29
@ BG_WS_EVENT_BOTH_FLAGS_KEPT10
Definition: BattlegroundWS.h:32
@ BG_WS_TEXT_CAPTURED_HORDE_FLAG
Definition: BattlegroundWS.h:55
@ BG_WS_TEXT_CAPTURED_ALLIANCE_FLAG
Definition: BattlegroundWS.h:56
@ BG_WS_FLAG_RESPAWN_TIME
Definition: BattlegroundWS.h:42
@ BG_WS_MAX_TEAM_SCORE
Definition: BattlegroundWS.h:39
@ BG_WS_FLAG_CAPTURES_HORDE
Definition: BattlegroundWS.h:92
@ BG_WS_STATE_TIMER_ACTIVE
Definition: BattlegroundWS.h:97
@ BG_WS_FLAG_CAPTURES_ALLIANCE
Definition: BattlegroundWS.h:91
@ AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT
Definition: SpellDefines.h:67
@ CHAT_MSG_BG_SYSTEM_ALLIANCE
Definition: SharedDefines.h:3161
@ CHAT_MSG_BG_SYSTEM_HORDE
Definition: SharedDefines.h:3162
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
void CancelEvent(uint32 eventId)
Definition: EventMap.cpp:190
void SpawnBGObject(uint32 type, uint32 respawntime, uint32 forceRespawnDelay=0)
Definition: Battleground.cpp:1471
void RewardReputationToTeam(uint32 factionId, uint32 reputation, TeamId teamId)
Definition: Battleground.cpp:727
static TeamId GetOtherTeamId(TeamId teamId)
Definition: Battleground.cpp:1773
uint32 GetTeamScore(TeamId teamId) const
Definition: Battleground.cpp:1855
void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
Definition: Battleground.cpp:678
void UpdateWorldState(uint32 variable, uint32 value)
Definition: Battleground.cpp:770
void PlaySoundToAll(uint32 soundId)
Definition: Battleground.cpp:691
void RemoveAssaultAuras()
Definition: BattlegroundWS.cpp:581
EventMap _bgEvents
Definition: BattlegroundWS.h:266
void EndBattleground(TeamId winnerTeamId) override
Definition: BattlegroundWS.cpp:503
void AddPoints(TeamId teamId, uint32 points)
Definition: BattlegroundWS.h:258
void UpdateFlagState(TeamId teamId, uint32 value)
Definition: BattlegroundWS.cpp:392
void SetFlagPicker(ObjectGuid guid, TeamId teamId)
Definition: BattlegroundWS.h:233
bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
Definition: BattlegroundWS.cpp:524
static ObjectGuid const Empty
Definition: ObjectGuid.h:122
TeamId GetTeamId(bool original=false) const
Definition: Player.h:2058
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4823
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0, bool isAutoshot=false)
Definition: Unit.cpp:5084

References _bgEvents, _lastFlagCaptureTeam, _reputationCapture, AddPoints(), AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT, BG_WS_EVENT_BOTH_FLAGS_KEPT10, BG_WS_EVENT_BOTH_FLAGS_KEPT15, BG_WS_EVENT_RESPAWN_BOTH_FLAGS, BG_WS_FLAG_CAPTURES_ALLIANCE, BG_WS_FLAG_CAPTURES_HORDE, BG_WS_FLAG_RESPAWN_TIME, BG_WS_FLAG_STATE_ON_BASE, BG_WS_MAX_TEAM_SCORE, BG_WS_OBJECT_A_FLAG, BG_WS_OBJECT_H_FLAG, BG_WS_SOUND_FLAG_CAPTURED_ALLIANCE, BG_WS_SOUND_FLAG_CAPTURED_HORDE, BG_WS_SPELL_SILVERWING_FLAG, BG_WS_SPELL_WARSONG_FLAG, BG_WS_STATE_TIMER_ACTIVE, BG_WS_TEXT_CAPTURED_ALLIANCE_FLAG, BG_WS_TEXT_CAPTURED_HORDE_FLAG, EventMap::CancelEvent(), CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, ObjectGuid::Empty, EndBattleground(), Battleground::GetBonusHonorFromKill(), Battleground::GetOtherTeamId(), Battleground::GetStatus(), Player::GetTeamId(), Battleground::GetTeamScore(), Battleground::PlaySoundToAll(), RemoveAssaultAuras(), Unit::RemoveAurasDueToSpell(), Unit::RemoveAurasWithInterruptFlags(), Battleground::RewardHonorToTeam(), Battleground::RewardReputationToTeam(), EventMap::ScheduleEvent(), SCORE_FLAG_CAPTURES, Battleground::SendBroadcastText(), SetFlagPicker(), Battleground::SpawnBGObject(), STATUS_IN_PROGRESS, TEAM_ALLIANCE, TEAM_HORDE, UpdateFlagState(), UpdatePlayerScore(), and Battleground::UpdateWorldState().

Referenced by HandleAreaTrigger().

◆ EventPlayerClickedOnFlag()

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

Reimplemented from Battleground.

269{
271 return;
272
274
275 // Alliance Flag picked up from base
277 {
281 player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG, true);
283
286
288 {
291 }
292 return;
293 }
294
295 // Horde Flag picked up from base
297 {
299 SetFlagPicker(player->GetGUID(), TEAM_HORDE);
301 player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG, true);
303
306
308 {
311 }
312 return;
313 }
314 if (player->IsMounted())
315 {
316 player->Dismount();
318 }
319 // Alliance Flag on ground
321 {
323 if (player->GetTeamId() == TEAM_ALLIANCE)
324 {
328
334
336 return;
337 }
338 else
339 {
342 player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG, true);
343 if (uint32 assaultSpellId = GetAssaultSpellId())
344 player->CastSpell(player, assaultSpellId, true);
345
348 return;
349 }
350 }
351
352 // Horde Flag on ground
354 {
356 if (player->GetTeamId() == TEAM_HORDE)
357 {
361
367
369 return;
370 }
371 else
372 {
373 SetFlagPicker(player->GetGUID(), TEAM_HORDE);
375 player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG, true);
376 if (uint32 assaultSpellId = GetAssaultSpellId())
377 player->CastSpell(player, assaultSpellId, true);
378
381 return;
382 }
383 }
384}
@ RESPAWN_IMMEDIATELY
Definition: Battleground.h:164
@ RESPAWN_ONE_DAY
Definition: Battleground.h:163
@ SCORE_FLAG_RETURNS
Definition: BattlegroundScore.h:38
@ BG_WS_FLAG_STATE_ON_GROUND
Definition: BattlegroundWS.h:145
@ BG_WS_SPELL_SILVERWING_FLAG_PICKED
Definition: BattlegroundWS.h:84
@ BG_WS_SPELL_WARSONG_FLAG_PICKED
Definition: BattlegroundWS.h:81
@ BG_WS_SOUND_HORDE_FLAG_PICKED_UP
Definition: BattlegroundWS.h:72
@ BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP
Definition: BattlegroundWS.h:73
@ BG_WS_SOUND_FLAG_RETURNED
Definition: BattlegroundWS.h:71
@ BG_WS_TEXT_HORDE_FLAG_PICKED_UP
Definition: BattlegroundWS.h:60
@ BG_WS_TEXT_ALLIANCE_FLAG_RETURNED
Definition: BattlegroundWS.h:62
@ BG_WS_TEXT_ALLIANCE_FLAG_PICKED_UP
Definition: BattlegroundWS.h:58
@ BG_WS_TEXT_HORDE_FLAG_RETURNED
Definition: BattlegroundWS.h:63
@ BG_OBJECT_H_FLAG_GROUND_WS_ENTRY
Definition: BattlegroundWS.h:138
@ BG_OBJECT_A_FLAG_GROUND_WS_ENTRY
Definition: BattlegroundWS.h:137
@ BG_WS_SPELL_FORCE_TIME
Definition: BattlegroundWS.h:44
@ BG_WS_SPELL_BRUTAL_TIME
Definition: BattlegroundWS.h:45
@ SPELL_AURA_MOUNTED
Definition: SpellAuraDefines.h:141
@ ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET
Definition: DBCEnums.h:119
void RescheduleEvent(uint32 eventId, uint32 time, uint32 groupId=0, uint32 phase=0)
Definition: EventMap.cpp:81
void SetDroppedFlagGUID(ObjectGuid guid, TeamId teamId) override
Definition: BattlegroundWS.h:253
uint32 GetAssaultSpellId() const
Definition: BattlegroundWS.cpp:571
void CheckFlagKeeperInArea(TeamId teamId)
Definition: BattlegroundWS.cpp:172
uint32 GetEntry() const
Definition: Object.h:109
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1321
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost=0)
Definition: Player.cpp:13614
void Dismount()
Definition: Unit.cpp:13428
SpellCastResult CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=nullptr, AuraEffect const *triggeredByAura=nullptr, ObjectGuid originalCaster=ObjectGuid::Empty)
Definition: Unit.cpp:1168
bool IsMounted() const
Definition: Unit.h:1543
void RemoveAurasByType(AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=nullptr, bool negative=true, bool positive=true)
Definition: Unit.cpp:5013

References _bgEvents, ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET, AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT, BG_OBJECT_A_FLAG_GROUND_WS_ENTRY, BG_OBJECT_H_FLAG_GROUND_WS_ENTRY, BG_WS_EVENT_BOTH_FLAGS_KEPT10, BG_WS_EVENT_BOTH_FLAGS_KEPT15, BG_WS_FLAG_STATE_ON_BASE, BG_WS_FLAG_STATE_ON_GROUND, BG_WS_FLAG_STATE_ON_PLAYER, BG_WS_OBJECT_A_FLAG, BG_WS_OBJECT_H_FLAG, BG_WS_SOUND_ALLIANCE_FLAG_PICKED_UP, BG_WS_SOUND_FLAG_RETURNED, BG_WS_SOUND_HORDE_FLAG_PICKED_UP, BG_WS_SPELL_BRUTAL_TIME, BG_WS_SPELL_FORCE_TIME, BG_WS_SPELL_SILVERWING_FLAG, BG_WS_SPELL_SILVERWING_FLAG_PICKED, BG_WS_SPELL_WARSONG_FLAG, BG_WS_SPELL_WARSONG_FLAG_PICKED, BG_WS_TEXT_ALLIANCE_FLAG_PICKED_UP, BG_WS_TEXT_ALLIANCE_FLAG_RETURNED, BG_WS_TEXT_HORDE_FLAG_PICKED_UP, BG_WS_TEXT_HORDE_FLAG_RETURNED, Battleground::BgObjects, EventMap::CancelEvent(), Unit::CastSpell(), CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, CheckFlagKeeperInArea(), Unit::Dismount(), ObjectGuid::Empty, GetAssaultSpellId(), Object::GetEntry(), GetFlagState(), Object::GetGUID(), Battleground::GetStatus(), Player::GetTeamId(), Unit::IsMounted(), WorldObject::IsWithinDistInMap(), Battleground::PlaySoundToAll(), RemoveAssaultAuras(), Unit::RemoveAurasByType(), Unit::RemoveAurasWithInterruptFlags(), EventMap::RescheduleEvent(), RESPAWN_IMMEDIATELY, RESPAWN_ONE_DAY, SCORE_FLAG_RETURNS, Battleground::SendBroadcastText(), SetDroppedFlagGUID(), SetFlagPicker(), Battleground::SpawnBGObject(), SPELL_AURA_MOUNTED, Player::StartTimedAchievement(), STATUS_IN_PROGRESS, TEAM_ALLIANCE, TEAM_HORDE, UpdateFlagState(), and UpdatePlayerScore().

◆ EventPlayerDroppedFlag()

void BattlegroundWS::EventPlayerDroppedFlag ( Player player)
overridevirtual

Reimplemented from Battleground.

239{
241 return;
242
247
249 return;
250
251 player->CastSpell(player, SPELL_RECENTLY_DROPPED_FLAG, true);
252 if (player->GetTeamId() == TEAM_ALLIANCE)
253 {
255 player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true);
258 }
259 else
260 {
262 player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true);
265 }
266}
@ SPELL_RECENTLY_DROPPED_FLAG
Definition: Battleground.h:139
@ BG_WS_SPELL_BRUTAL_ASSAULT
Definition: BattlegroundWS.h:86
@ BG_WS_SPELL_SILVERWING_FLAG_DROPPED
Definition: BattlegroundWS.h:83
@ BG_WS_SPELL_FOCUSED_ASSAULT
Definition: BattlegroundWS.h:85
@ BG_WS_SPELL_WARSONG_FLAG_DROPPED
Definition: BattlegroundWS.h:80
@ BG_WS_EVENT_ALLIANCE_DROP_FLAG
Definition: BattlegroundWS.h:30
@ BG_WS_EVENT_HORDE_DROP_FLAG
Definition: BattlegroundWS.h:31
@ BG_WS_TEXT_ALLIANCE_FLAG_DROPPED
Definition: BattlegroundWS.h:59
@ BG_WS_TEXT_HORDE_FLAG_DROPPED
Definition: BattlegroundWS.h:61
@ BG_WS_FLAG_DROP_TIME
Definition: BattlegroundWS.h:43

References _bgEvents, BG_WS_EVENT_ALLIANCE_DROP_FLAG, BG_WS_EVENT_HORDE_DROP_FLAG, BG_WS_FLAG_DROP_TIME, BG_WS_FLAG_STATE_ON_GROUND, BG_WS_SPELL_BRUTAL_ASSAULT, BG_WS_SPELL_FOCUSED_ASSAULT, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, BG_WS_SPELL_WARSONG_FLAG, BG_WS_SPELL_WARSONG_FLAG_DROPPED, BG_WS_TEXT_ALLIANCE_FLAG_DROPPED, BG_WS_TEXT_HORDE_FLAG_DROPPED, Unit::CastSpell(), CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, ObjectGuid::Empty, GetFlagPickerGUID(), Object::GetGUID(), Battleground::GetOtherTeamId(), Battleground::GetStatus(), Player::GetTeamId(), Unit::RemoveAurasDueToSpell(), EventMap::RescheduleEvent(), Battleground::SendBroadcastText(), SetFlagPicker(), SPELL_RECENTLY_DROPPED_FLAG, STATUS_IN_PROGRESS, TEAM_ALLIANCE, TEAM_HORDE, and UpdateFlagState().

Referenced by HandleKillPlayer(), and RemovePlayer().

◆ FillInitialWorldStates()

void BattlegroundWS::FillInitialWorldStates ( WorldPacket data)
overridevirtual

◆ GetAssaultSpellId()

◆ GetClosestGraveyard()

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

Reimplemented from Battleground.

543{
546 else
548}
@ WS_GRAVEYARD_FLAGROOM_ALLIANCE
Definition: BattlegroundWS.h:150
@ WS_GRAVEYARD_MAIN_ALLIANCE
Definition: BattlegroundWS.h:152
@ WS_GRAVEYARD_FLAGROOM_HORDE
Definition: BattlegroundWS.h:151
@ WS_GRAVEYARD_MAIN_HORDE
Definition: BattlegroundWS.h:153
#define sGraveyard
Definition: GameGraveyard.h:75

References Battleground::GetStatus(), Player::GetTeamId(), sGraveyard, STATUS_IN_PROGRESS, TEAM_ALLIANCE, WS_GRAVEYARD_FLAGROOM_ALLIANCE, WS_GRAVEYARD_FLAGROOM_HORDE, WS_GRAVEYARD_MAIN_ALLIANCE, and WS_GRAVEYARD_MAIN_HORDE.

◆ GetDroppedFlagGUID()

ObjectGuid BattlegroundWS::GetDroppedFlagGUID ( TeamId  teamId) const
inline
254{ return _droppedFlagGUID[teamId];}
ObjectGuid _droppedFlagGUID[2]
Definition: BattlegroundWS.h:269

Referenced by RespawnFlagAfterDrop().

◆ GetFlagPickerGUID()

ObjectGuid BattlegroundWS::GetFlagPickerGUID ( TeamId  teamId) const
inlineoverridevirtual

Reimplemented from Battleground.

232{ return _flagKeepers[teamId]; }
ObjectGuid _flagKeepers[2]
Definition: BattlegroundWS.h:268

Referenced by CheckFlagKeeperInArea(), EventPlayerDroppedFlag(), GetAssaultSpellId(), HandleAreaTrigger(), PostUpdateImpl(), RemoveAssaultAuras(), and RemovePlayer().

◆ GetFlagState()

◆ GetMatchTime()

uint32 BattlegroundWS::GetMatchTime ( ) const
inline
constexpr auto IN_MILLISECONDS
Definition: Common.h:62
constexpr auto MINUTE
Definition: Common.h:56
@ BG_WS_TOTAL_GAME_TIME
Definition: BattlegroundWS.h:41
uint32 GetStartTime() const
Definition: Battleground.h:324

References BG_WS_TOTAL_GAME_TIME, Battleground::GetStartTime(), IN_MILLISECONDS, and MINUTE.

Referenced by FillInitialWorldStates(), and PostUpdateImpl().

◆ GetPrematureWinner()

TeamId BattlegroundWS::GetPrematureWinner ( )
overridevirtual

◆ HandleAreaTrigger()

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

Reimplemented from Battleground.

399{
400 if (GetStatus() != STATUS_IN_PROGRESS || !player->IsAlive())
401 return;
402
403 switch (trigger)
404 {
405 case BG_WS_TRIGGER_ALLIANCE_FLAG_SPAWN: // Alliance Flag spawn
408 break;
409 case BG_WS_TRIGGER_HORDE_FLAG_SPAWN: // Horde Flag spawn
412 break;
413 case 3649: // Not used
414 case 3688: // Not used
415 case 4628: // Not used
416 case 4629: // Not used
417 case BG_WS_TRIGGER_ALLIANCE_ELIXIR_SPEED_SPAWN: // Alliance elixir of speed spawn
418 case BG_WS_TRIGGER_HORDE_ELIXIR_SPEED_SPAWN: // Horde elixir of speed spawn
419 case BG_WS_TRIGGER_ALLIANCE_ELIXIR_REGEN_SPAWN: // Alliance elixir of regeneration spawn
420 case BG_WS_TRIGGER_HORDE_ELIXIR_REGEN_SPAWN: // Horde elixir of regeneration spawn
421 case BG_WS_TRIGGER_ALLIANCE_ELIXIR_BERSERK_SPAWN: // Alliance elixir of berserk spawn
422 case BG_WS_TRIGGER_HORDE_ELIXIR_BERSERK_SPAWN: // Horde elixir of berserk spawn
423 break;
424 }
425}
@ BG_WS_TRIGGER_HORDE_ELIXIR_SPEED_SPAWN
Definition: BattlegroundWS.h:178
@ BG_WS_TRIGGER_ALLIANCE_ELIXIR_REGEN_SPAWN
Definition: BattlegroundWS.h:180
@ BG_WS_TRIGGER_ALLIANCE_ELIXIR_SPEED_SPAWN
Definition: BattlegroundWS.h:177
@ BG_WS_TRIGGER_HORDE_ELIXIR_REGEN_SPAWN
Definition: BattlegroundWS.h:181
@ BG_WS_TRIGGER_HORDE_ELIXIR_BERSERK_SPAWN
Definition: BattlegroundWS.h:184
@ BG_WS_TRIGGER_ALLIANCE_ELIXIR_BERSERK_SPAWN
Definition: BattlegroundWS.h:183
void EventPlayerCapturedFlag(Player *player)
Definition: BattlegroundWS.cpp:190
bool IsAlive() const
Definition: Unit.h:1808

References BG_WS_FLAG_STATE_ON_BASE, BG_WS_TRIGGER_ALLIANCE_ELIXIR_BERSERK_SPAWN, BG_WS_TRIGGER_ALLIANCE_ELIXIR_REGEN_SPAWN, BG_WS_TRIGGER_ALLIANCE_ELIXIR_SPEED_SPAWN, BG_WS_TRIGGER_ALLIANCE_FLAG_SPAWN, BG_WS_TRIGGER_HORDE_ELIXIR_BERSERK_SPAWN, BG_WS_TRIGGER_HORDE_ELIXIR_REGEN_SPAWN, BG_WS_TRIGGER_HORDE_ELIXIR_SPEED_SPAWN, BG_WS_TRIGGER_HORDE_FLAG_SPAWN, EventPlayerCapturedFlag(), GetFlagPickerGUID(), GetFlagState(), Object::GetGUID(), Battleground::GetStatus(), Unit::IsAlive(), STATUS_IN_PROGRESS, TEAM_ALLIANCE, and TEAM_HORDE.

Referenced by CheckFlagKeeperInArea().

◆ HandleKillPlayer()

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

Reimplemented from Battleground.

516{
518 return;
519
521 Battleground::HandleKillPlayer(player, killer);
522}
virtual void HandleKillPlayer(Player *player, Player *killer)
Definition: Battleground.cpp:1738
void EventPlayerDroppedFlag(Player *player) override
Definition: BattlegroundWS.cpp:238

References EventPlayerDroppedFlag(), Battleground::GetStatus(), Battleground::HandleKillPlayer(), and STATUS_IN_PROGRESS.

◆ Init()

void BattlegroundWS::Init ( )
overridevirtual

Reimplemented from Battleground.

476{
477 //call parent's class reset
479
488
489 if (sBattlegroundMgr->IsBGWeekend(GetBgTypeID(true)))
490 {
492 _honorWinKills = 3;
493 _honorEndKills = 4;
494 }
495 else
496 {
498 _honorWinKills = 1;
499 _honorEndKills = 2;
500 }
501}
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:188
void Reset()
Definition: EventMap.cpp:21
virtual void Init()
Definition: Battleground.cpp:1028
BattlegroundTypeId GetBgTypeID(bool GetRandom=false) const
Definition: Battleground.h:319
void Clear()
Definition: ObjectGuid.h:140

References _bgEvents, _droppedFlagGUID, _flagKeepers, _flagState, _honorEndKills, _honorWinKills, _lastFlagCaptureTeam, _reputationCapture, BG_WS_FLAG_STATE_ON_BASE, ObjectGuid::Clear(), Battleground::GetBgTypeID(), Battleground::Init(), EventMap::Reset(), sBattlegroundMgr, TEAM_ALLIANCE, TEAM_HORDE, and TEAM_NEUTRAL.

◆ PostUpdateImpl()

void BattlegroundWS::PostUpdateImpl ( uint32  )
overrideprivatevirtual

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.

58{
60 {
61 _bgEvents.Update(diff);
62 switch (_bgEvents.ExecuteEvent())
63 {
67 break;
71 else
73 break;
79 break;
82 break;
85 break;
88 player->CastSpell(player, BG_WS_SPELL_FOCUSED_ASSAULT, true);
90 player->CastSpell(player, BG_WS_SPELL_FOCUSED_ASSAULT, true);
91 break;
94 {
95 player->RemoveAurasDueToSpell(BG_WS_SPELL_FOCUSED_ASSAULT);
96 player->CastSpell(player, BG_WS_SPELL_BRUTAL_ASSAULT, true);
97 }
99 {
100 player->RemoveAurasDueToSpell(BG_WS_SPELL_FOCUSED_ASSAULT);
101 player->CastSpell(player, BG_WS_SPELL_BRUTAL_ASSAULT, true);
102 }
103 break;
107 break;
108 }
109 }
110}
@ BG_WS_OBJECT_DOOR_H_1
Definition: BattlegroundWS.h:108
@ BG_WS_OBJECT_DOOR_H_2
Definition: BattlegroundWS.h:109
@ BG_WS_SOUND_FLAGS_RESPAWNED
Definition: BattlegroundWS.h:74
@ BG_WS_EVENT_UPDATE_GAME_TIME
Definition: BattlegroundWS.h:27
@ BG_WS_EVENT_DESPAWN_DOORS
Definition: BattlegroundWS.h:34
@ BG_WS_EVENT_NO_TIME_LEFT
Definition: BattlegroundWS.h:28
@ BG_WS_TEXT_FLAGS_PLACED
Definition: BattlegroundWS.h:57
@ CHAT_MSG_BG_SYSTEM_NEUTRAL
Definition: SharedDefines.h:3160
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
void RespawnFlagAfterDrop(TeamId teamId)
Definition: BattlegroundWS.cpp:151

References _bgEvents, _lastFlagCaptureTeam, BG_WS_EVENT_ALLIANCE_DROP_FLAG, BG_WS_EVENT_BOTH_FLAGS_KEPT10, BG_WS_EVENT_BOTH_FLAGS_KEPT15, BG_WS_EVENT_DESPAWN_DOORS, BG_WS_EVENT_HORDE_DROP_FLAG, BG_WS_EVENT_NO_TIME_LEFT, BG_WS_EVENT_RESPAWN_BOTH_FLAGS, BG_WS_EVENT_UPDATE_GAME_TIME, BG_WS_OBJECT_A_FLAG, BG_WS_OBJECT_DOOR_H_1, BG_WS_OBJECT_DOOR_H_2, BG_WS_OBJECT_H_FLAG, BG_WS_SOUND_FLAGS_RESPAWNED, BG_WS_SPELL_BRUTAL_ASSAULT, BG_WS_SPELL_FOCUSED_ASSAULT, BG_WS_STATE_TIMER, BG_WS_TEXT_FLAGS_PLACED, BG_WS_TOTAL_GAME_TIME, CHAT_MSG_BG_SYSTEM_NEUTRAL, EndBattleground(), EventMap::ExecuteEvent(), Battleground::FindBgMap(), GetFlagPickerGUID(), GetMatchTime(), ObjectAccessor::GetPlayer(), Battleground::GetStartTime(), Battleground::GetStatus(), Battleground::GetTeamScore(), IN_MILLISECONDS, MINUTE, Battleground::PlaySoundToAll(), RESPAWN_IMMEDIATELY, RESPAWN_ONE_DAY, RespawnFlagAfterDrop(), EventMap::ScheduleEvent(), Battleground::SendBroadcastText(), Battleground::SpawnBGObject(), STATUS_IN_PROGRESS, TEAM_ALLIANCE, TEAM_HORDE, EventMap::Update(), and Battleground::UpdateWorldState().

◆ RemoveAssaultAuras()

void BattlegroundWS::RemoveAssaultAuras ( )

◆ RemovePlayer()

void BattlegroundWS::RemovePlayer ( Player player)
overridevirtual

◆ RespawnFlagAfterDrop()

void BattlegroundWS::RespawnFlagAfterDrop ( TeamId  teamId)
152{
154 return;
155
160
161 if (GameObject* flag = GetBgMap()->GetGameObject(GetDroppedFlagGUID(teamId)))
162 flag->Delete();
163
168
170}
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:189
BattlegroundMap * GetBgMap() const
Definition: Battleground.h:424
ObjectGuid GetDroppedFlagGUID(TeamId teamId) const
Definition: BattlegroundWS.h:254
Definition: GameObject.h:813

References _bgEvents, BG_WS_EVENT_BOTH_FLAGS_KEPT10, BG_WS_EVENT_BOTH_FLAGS_KEPT15, BG_WS_FLAG_STATE_ON_BASE, BG_WS_FLAG_STATE_ON_GROUND, BG_WS_OBJECT_A_FLAG, BG_WS_OBJECT_H_FLAG, BG_WS_SOUND_FLAGS_RESPAWNED, BG_WS_TEXT_FLAGS_PLACED, EventMap::CancelEvent(), CHAT_MSG_BG_SYSTEM_NEUTRAL, CheckFlagKeeperInArea(), ObjectGuid::Empty, Battleground::GetBgMap(), GetDroppedFlagGUID(), GetFlagState(), Battleground::GetStatus(), Battleground::PlaySoundToAll(), RemoveAssaultAuras(), RESPAWN_IMMEDIATELY, Battleground::SendBroadcastText(), SetDroppedFlagGUID(), Battleground::SpawnBGObject(), STATUS_IN_PROGRESS, TEAM_ALLIANCE, TEAM_HORDE, and UpdateFlagState().

Referenced by PostUpdateImpl().

◆ SetDroppedFlagGUID()

void BattlegroundWS::SetDroppedFlagGUID ( ObjectGuid  guid,
TeamId  teamId 
)
inlineoverridevirtual

Reimplemented from Battleground.

253{ _droppedFlagGUID[teamId] = guid; }

Referenced by EventPlayerClickedOnFlag(), and RespawnFlagAfterDrop().

◆ SetFlagPicker()

void BattlegroundWS::SetFlagPicker ( ObjectGuid  guid,
TeamId  teamId 
)
inline

◆ SetupBattleground()

bool BattlegroundWS::SetupBattleground ( )
overridevirtual

Reimplemented from Battleground.

428{
429 // flags
430 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, RESPAWN_IMMEDIATELY);
431 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, RESPAWN_IMMEDIATELY);
432 // buffs
433 AddObject(BG_WS_OBJECT_SPEEDBUFF_1, BG_OBJECTID_SPEEDBUFF_ENTRY, 1449.93f, 1470.71f, 342.6346f, -1.64061f, 0, 0, 0.7313537f, -0.6819983f, SPEED_BUFF_RESPAWN_TIME);
434 AddObject(BG_WS_OBJECT_SPEEDBUFF_2, BG_OBJECTID_SPEEDBUFF_ENTRY, 1005.171f, 1447.946f, 335.9032f, 1.64061f, 0, 0, 0.7313537f, 0.6819984f, SPEED_BUFF_RESPAWN_TIME);
435 AddObject(BG_WS_OBJECT_REGENBUFF_1, BG_OBJECTID_REGENBUFF_ENTRY, 1317.506f, 1550.851f, 313.2344f, -0.2617996f, 0, 0, 0.1305263f, -0.9914448f, RESTORATION_BUFF_RESPAWN_TIME);
436 AddObject(BG_WS_OBJECT_REGENBUFF_2, BG_OBJECTID_REGENBUFF_ENTRY, 1110.451f, 1353.656f, 316.5181f, -0.6806787f, 0, 0, 0.333807f, -0.9426414f, RESTORATION_BUFF_RESPAWN_TIME);
437 AddObject(BG_WS_OBJECT_BERSERKBUFF_1, BG_OBJECTID_BERSERKERBUFF_ENTRY, 1320.09f, 1378.79f, 314.7532f, 1.186824f, 0, 0, 0.5591929f, 0.8290376f, BERSERKING_BUFF_RESPAWN_TIME);
438 AddObject(BG_WS_OBJECT_BERSERKBUFF_2, BG_OBJECTID_BERSERKERBUFF_ENTRY, 1139.688f, 1560.288f, 306.8432f, -2.443461f, 0, 0, 0.9396926f, -0.3420201f, BERSERKING_BUFF_RESPAWN_TIME);
439 // alliance gates
440 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);
441 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);
442 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);
443 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);
444 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);
445 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);
446 // horde gates
447 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);
448 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);
449 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);
450 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);
451
452 GraveyardStruct const* sg = sGraveyard->GetGraveyard(WS_GRAVEYARD_MAIN_ALLIANCE);
453 AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE);
454
455 sg = sGraveyard->GetGraveyard(WS_GRAVEYARD_MAIN_HORDE);
456 AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, TEAM_HORDE);
457
459 if (!BgObjects[i])
460 {
461 LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn some object Battleground not created!");
462 return false;
463 }
464
466 if (!BgCreatures[i])
467 {
468 LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn spirit guides Battleground not created!");
469 return false;
470 }
471
472 return true;
473}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
#define SPEED_BUFF_RESPAWN_TIME
Definition: Battleground.h:170
@ BG_OBJECTID_REGENBUFF_ENTRY
Definition: Battleground.h:186
@ BG_OBJECTID_BERSERKERBUFF_ENTRY
Definition: Battleground.h:187
@ BG_OBJECTID_SPEEDBUFF_ENTRY
Definition: Battleground.h:185
#define RESTORATION_BUFF_RESPAWN_TIME
Definition: Battleground.h:168
#define BERSERKING_BUFF_RESPAWN_TIME
Definition: Battleground.h:169
@ BG_WS_OBJECT_DOOR_H_3
Definition: BattlegroundWS.h:110
@ BG_WS_OBJECT_DOOR_A_5
Definition: BattlegroundWS.h:106
@ BG_WS_OBJECT_DOOR_A_4
Definition: BattlegroundWS.h:105
@ BG_WS_OBJECT_BERSERKBUFF_1
Definition: BattlegroundWS.h:118
@ BG_WS_OBJECT_REGENBUFF_2
Definition: BattlegroundWS.h:117
@ BG_WS_OBJECT_DOOR_A_1
Definition: BattlegroundWS.h:102
@ BG_WS_OBJECT_DOOR_A_2
Definition: BattlegroundWS.h:103
@ BG_WS_OBJECT_SPEEDBUFF_1
Definition: BattlegroundWS.h:114
@ BG_WS_OBJECT_DOOR_H_4
Definition: BattlegroundWS.h:111
@ BG_WS_OBJECT_DOOR_A_6
Definition: BattlegroundWS.h:107
@ BG_WS_OBJECT_REGENBUFF_1
Definition: BattlegroundWS.h:116
@ BG_WS_OBJECT_SPEEDBUFF_2
Definition: BattlegroundWS.h:115
@ BG_WS_OBJECT_DOOR_A_3
Definition: BattlegroundWS.h:104
@ BG_WS_OBJECT_BERSERKBUFF_2
Definition: BattlegroundWS.h:119
@ WS_SPIRIT_MAIN_HORDE
Definition: BattlegroundWS.h:159
@ WS_SPIRIT_MAIN_ALLIANCE
Definition: BattlegroundWS.h:158
@ BG_OBJECT_DOOR_A_4_WS_ENTRY
Definition: BattlegroundWS.h:128
@ BG_OBJECT_DOOR_A_1_WS_ENTRY
Definition: BattlegroundWS.h:125
@ BG_OBJECT_DOOR_A_3_WS_ENTRY
Definition: BattlegroundWS.h:127
@ BG_OBJECT_DOOR_A_6_WS_ENTRY
Definition: BattlegroundWS.h:130
@ BG_OBJECT_DOOR_H_2_WS_ENTRY
Definition: BattlegroundWS.h:132
@ BG_OBJECT_DOOR_H_4_WS_ENTRY
Definition: BattlegroundWS.h:134
@ BG_OBJECT_DOOR_H_1_WS_ENTRY
Definition: BattlegroundWS.h:131
@ BG_OBJECT_DOOR_A_2_WS_ENTRY
Definition: BattlegroundWS.h:126
@ BG_OBJECT_DOOR_A_5_WS_ENTRY
Definition: BattlegroundWS.h:129
@ BG_OBJECT_DOOR_H_3_WS_ENTRY
Definition: BattlegroundWS.h:133
@ BG_OBJECT_A_FLAG_WS_ENTRY
Definition: BattlegroundWS.h:135
@ BG_OBJECT_H_FLAG_WS_ENTRY
Definition: BattlegroundWS.h:136
bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId)
Definition: Battleground.cpp:1593
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:1369
Definition: GameGraveyard.h:28
float z
Definition: GameGraveyard.h:33
float x
Definition: GameGraveyard.h:31
float y
Definition: GameGraveyard.h:32

References Battleground::AddObject(), Battleground::AddSpiritGuide(), BERSERKING_BUFF_RESPAWN_TIME, BG_CREATURES_MAX_WS, BG_OBJECT_A_FLAG_WS_ENTRY, BG_OBJECT_DOOR_A_1_WS_ENTRY, BG_OBJECT_DOOR_A_2_WS_ENTRY, BG_OBJECT_DOOR_A_3_WS_ENTRY, BG_OBJECT_DOOR_A_4_WS_ENTRY, BG_OBJECT_DOOR_A_5_WS_ENTRY, BG_OBJECT_DOOR_A_6_WS_ENTRY, BG_OBJECT_DOOR_H_1_WS_ENTRY, BG_OBJECT_DOOR_H_2_WS_ENTRY, BG_OBJECT_DOOR_H_3_WS_ENTRY, BG_OBJECT_DOOR_H_4_WS_ENTRY, BG_OBJECT_H_FLAG_WS_ENTRY, BG_OBJECTID_BERSERKERBUFF_ENTRY, BG_OBJECTID_REGENBUFF_ENTRY, BG_OBJECTID_SPEEDBUFF_ENTRY, BG_WS_OBJECT_A_FLAG, BG_WS_OBJECT_BERSERKBUFF_1, BG_WS_OBJECT_BERSERKBUFF_2, BG_WS_OBJECT_DOOR_A_1, BG_WS_OBJECT_DOOR_A_2, BG_WS_OBJECT_DOOR_A_3, BG_WS_OBJECT_DOOR_A_4, BG_WS_OBJECT_DOOR_A_5, BG_WS_OBJECT_DOOR_A_6, BG_WS_OBJECT_DOOR_H_1, BG_WS_OBJECT_DOOR_H_2, BG_WS_OBJECT_DOOR_H_3, BG_WS_OBJECT_DOOR_H_4, BG_WS_OBJECT_H_FLAG, BG_WS_OBJECT_MAX, BG_WS_OBJECT_REGENBUFF_1, BG_WS_OBJECT_REGENBUFF_2, BG_WS_OBJECT_SPEEDBUFF_1, BG_WS_OBJECT_SPEEDBUFF_2, Battleground::BgCreatures, Battleground::BgObjects, LOG_ERROR, RESPAWN_IMMEDIATELY, RESTORATION_BUFF_RESPAWN_TIME, sGraveyard, SPEED_BUFF_RESPAWN_TIME, TEAM_ALLIANCE, TEAM_HORDE, WS_GRAVEYARD_MAIN_ALLIANCE, WS_GRAVEYARD_MAIN_HORDE, WS_SPIRIT_MAIN_ALLIANCE, WS_SPIRIT_MAIN_HORDE, GraveyardStruct::x, GraveyardStruct::y, and GraveyardStruct::z.

◆ StartingEventCloseDoors()

void BattlegroundWS::StartingEventCloseDoors ( )
overridevirtual

◆ StartingEventOpenDoors()

void BattlegroundWS::StartingEventOpenDoors ( )
overridevirtual

Reimplemented from Battleground.

124{
126 DoorOpen(i);
128 DoorOpen(i);
129
132
137
143}
@ WS_EVENT_START_BATTLE
Definition: BattlegroundWS.h:169
@ BG_WS_DOOR_DESPAWN_TIME
Definition: BattlegroundWS.h:46
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition: DBCEnums.h:116
void DoorOpen(uint32 type)
Definition: Battleground.cpp:1441
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: Battleground.cpp:1849

References _bgEvents, ACHIEVEMENT_TIMED_TYPE_EVENT, BG_WS_DOOR_DESPAWN_TIME, BG_WS_EVENT_DESPAWN_DOORS, BG_WS_EVENT_NO_TIME_LEFT, BG_WS_EVENT_UPDATE_GAME_TIME, BG_WS_OBJECT_A_FLAG, BG_WS_OBJECT_BERSERKBUFF_2, BG_WS_OBJECT_DOOR_A_1, BG_WS_OBJECT_DOOR_A_5, BG_WS_OBJECT_DOOR_A_6, BG_WS_OBJECT_DOOR_H_1, BG_WS_OBJECT_DOOR_H_3, BG_WS_OBJECT_DOOR_H_4, BG_WS_STATE_TIMER_ACTIVE, BG_WS_TOTAL_GAME_TIME, Battleground::DoorOpen(), IN_MILLISECONDS, MINUTE, RESPAWN_IMMEDIATELY, RESPAWN_ONE_DAY, EventMap::ScheduleEvent(), Battleground::SpawnBGObject(), Battleground::StartTimedAchievement(), Battleground::UpdateWorldState(), and WS_EVENT_START_BATTLE.

◆ UpdateFlagState()

◆ UpdatePlayerScore()

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

Reimplemented from Battleground.

525{
526 if (!Battleground::UpdatePlayerScore(player, type, value, doAddHonor))
527 return false;
528
529 switch (type)
530 {
533 break;
536 break;
537 }
538
539 return true;
540}
@ WS_OBJECTIVE_RETURN_FLAG
Definition: BattlegroundWS.h:167
@ WS_OBJECTIVE_CAPTURE_FLAG
Definition: BattlegroundWS.h:166
@ ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE
Definition: DBCEnums.h:150
virtual bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true)
Definition: Battleground.cpp:1308
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, Unit *unit=nullptr)
Definition: PlayerUpdates.cpp:2128

References ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, SCORE_FLAG_CAPTURES, SCORE_FLAG_RETURNS, Player::UpdateAchievementCriteria(), Battleground::UpdatePlayerScore(), WS_OBJECTIVE_CAPTURE_FLAG, and WS_OBJECTIVE_RETURN_FLAG.

Referenced by EventPlayerCapturedFlag(), and EventPlayerClickedOnFlag().

Member Data Documentation

◆ _bgEvents

◆ _droppedFlagGUID

ObjectGuid BattlegroundWS::_droppedFlagGUID[2]
private

Referenced by Init().

◆ _flagKeepers

ObjectGuid BattlegroundWS::_flagKeepers[2]
private

Referenced by Init().

◆ _flagState

uint8 BattlegroundWS::_flagState[2]
private

◆ _honorEndKills

uint32 BattlegroundWS::_honorEndKills
private

◆ _honorWinKills

uint32 BattlegroundWS::_honorWinKills
private

◆ _lastFlagCaptureTeam

TeamId BattlegroundWS::_lastFlagCaptureTeam
private

◆ _reputationCapture

uint32 BattlegroundWS::_reputationCapture
private