AzerothCore 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
 
bool isTemplate () const
 
bool isMaxLevel () const
 
uint32 GetMaxPlayersPerTeam () const
 
uint32 GetMinPlayersPerTeam () const
 
int32 GetStartDelayTime () const
 
uint8 GetArenaType () const
 
PvPTeamId GetWinner () const
 
uint32 GetScriptId () const
 
uint32 GetBonusHonorFromKill (uint32 kills) const
 
void SpiritOfCompetitionEvent (PvPTeamId winnerTeamId) 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)
 
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 ( )
36{
39
43
50}
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ TEAM_HORDE
Definition: SharedDefines.h:761
@ BG_STARTING_EVENT_THIRD
Definition: Battleground.h:241
@ BG_STARTING_EVENT_SECOND
Definition: Battleground.h:240
@ BG_STARTING_EVENT_FOURTH
Definition: Battleground.h:242
@ 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
BGObjects BgObjects
Definition: Battleground.h:549
BGCreatures BgCreatures
Definition: Battleground.h:550
uint32 StartMessageIds[BG_STARTING_EVENT_COUNT]
Definition: Battleground.h:642
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
53{
54}

Member Function Documentation

◆ AddPlayer()

void BattlegroundWS::AddPlayer ( Player player)
overridevirtual

Reimplemented from Battleground.

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

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:648

Referenced by EventPlayerCapturedFlag().

◆ CheckFlagKeeperInArea()

void BattlegroundWS::CheckFlagKeeperInArea ( TeamId  teamId)
172{
174 {
175 return;
176 }
177
179 AreaTrigger const* areaTrigger = sObjectMgr->GetAreaTrigger(triggerId);
181 {
182 if (areaTrigger && player->IsInAreaTriggerRadius(areaTrigger))
183 {
184 HandleAreaTrigger(player, triggerId);
185 }
186 }
187}
std::uint32_t uint32
Definition: Define.h:107
#define sObjectMgr
Definition: ObjectMgr.h:1635
@ STATUS_IN_PROGRESS
Definition: Battleground.h:202
@ 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
Player * GetPlayer(Map const *, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:220
BattlegroundMap * FindBgMap() const
Definition: Battleground.h:450
BattlegroundStatus GetStatus() const
Definition: Battleground.h:332
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:397
Definition: Player.h:1081
Definition: ObjectMgr.h:420

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.

503{
504 // Win reward
506
507 // Complete map_end rewards (even if no team wins)
510
511 Battleground::EndBattleground(winnerTeamId);
512}
void EndBattleground(PvPTeamId winnerTeamId)
Definition: Battleground.cpp:787
uint32 GetBonusHonorFromKill(uint32 kills) const
Definition: Battleground.cpp:959
void RewardHonorToTeam(uint32 honor, TeamId teamId)
Definition: Battleground.cpp:729

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)
190{
192 return;
193
196
197 AddPoints(player->GetTeamId(), 1);
200
201 if (player->GetTeamId() == TEAM_ALLIANCE)
202 {
207 }
208 else
209 {
214 }
215
218
220 UpdatePlayerScore(player, SCORE_FLAG_CAPTURES, 1); // +1 flag captures
222
224
226 {
229 }
230 else
232
235}
@ CHAT_MSG_BG_SYSTEM_ALLIANCE
Definition: SharedDefines.h:3189
@ CHAT_MSG_BG_SYSTEM_HORDE
Definition: SharedDefines.h:3190
@ AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT
Definition: SpellDefines.h:66
@ SCORE_FLAG_CAPTURES
Definition: BattlegroundScore.h:36
@ 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
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:1509
void RewardReputationToTeam(uint32 factionId, uint32 reputation, TeamId teamId)
Definition: Battleground.cpp:736
static TeamId GetOtherTeamId(TeamId teamId)
Definition: Battleground.cpp:1754
uint32 GetTeamScore(TeamId teamId) const
Definition: Battleground.cpp:1837
void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
Definition: Battleground.cpp:687
void UpdateWorldState(uint32 variable, uint32 value)
Definition: Battleground.cpp:779
void PlaySoundToAll(uint32 soundId)
Definition: Battleground.cpp:700
void RemoveAssaultAuras()
Definition: BattlegroundWS.cpp:580
EventMap _bgEvents
Definition: BattlegroundWS.h:266
void EndBattleground(TeamId winnerTeamId) override
Definition: BattlegroundWS.cpp:502
void AddPoints(TeamId teamId, uint32 points)
Definition: BattlegroundWS.h:258
void UpdateFlagState(TeamId teamId, uint32 value)
Definition: BattlegroundWS.cpp:391
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:523
static ObjectGuid const Empty
Definition: ObjectGuid.h:120
TeamId GetTeamId(bool original=false) const
Definition: Player.h:2108
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0, bool isAutoshot=false)
Definition: Unit.cpp:5181

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.

268{
270 return;
271
273
274 // Alliance Flag picked up from base
276 {
280 player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG, true);
282
285
287 {
290 }
291 return;
292 }
293
294 // Horde Flag picked up from base
296 {
298 SetFlagPicker(player->GetGUID(), TEAM_HORDE);
300 player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG, true);
302
305
307 {
310 }
311 return;
312 }
313 if (player->IsMounted())
314 {
315 player->Dismount();
317 }
318 // Alliance Flag on ground
320 {
322 if (player->GetTeamId() == TEAM_ALLIANCE)
323 {
327
333
335 return;
336 }
337 else
338 {
341 player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG, true);
342 if (uint32 assaultSpellId = GetAssaultSpellId())
343 player->CastSpell(player, assaultSpellId, true);
344
347 return;
348 }
349 }
350
351 // Horde Flag on ground
353 {
355 if (player->GetTeamId() == TEAM_HORDE)
356 {
360
366
368 return;
369 }
370 else
371 {
372 SetFlagPicker(player->GetGUID(), TEAM_HORDE);
374 player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG, true);
375 if (uint32 assaultSpellId = GetAssaultSpellId())
376 player->CastSpell(player, assaultSpellId, true);
377
380 return;
381 }
382 }
383}
@ ACHIEVEMENT_TIMED_TYPE_SPELL_TARGET
Definition: DBCEnums.h:113
@ SPELL_AURA_MOUNTED
Definition: SpellAuraDefines.h:141
@ SCORE_FLAG_RETURNS
Definition: BattlegroundScore.h:37
@ RESPAWN_IMMEDIATELY
Definition: Battleground.h:169
@ RESPAWN_ONE_DAY
Definition: Battleground.h:168
@ 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
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:570
void CheckFlagKeeperInArea(TeamId teamId)
Definition: BattlegroundWS.cpp:171
uint32 GetEntry() const
Definition: Object.h:115
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1332
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry, uint32 timeLost=0)
Definition: Player.cpp:13956
void Dismount()
Definition: Unit.cpp:13524
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:1167
bool IsMounted() const
Definition: Unit.h:1747
void RemoveAurasByType(AuraType auraType, ObjectGuid casterGUID=ObjectGuid::Empty, Aura *except=nullptr, bool negative=true, bool positive=true)
Definition: Unit.cpp:5110

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.

238{
240 return;
241
246
248 return;
249
250 player->CastSpell(player, SPELL_RECENTLY_DROPPED_FLAG, true);
251 if (player->GetTeamId() == TEAM_ALLIANCE)
252 {
254 player->CastSpell(player, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true);
257 }
258 else
259 {
261 player->CastSpell(player, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true);
264 }
265}
@ SPELL_RECENTLY_DROPPED_FLAG
Definition: Battleground.h:144
@ 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.

542{
545 else
547}
#define sGraveyard
Definition: GameGraveyard.h:74
@ 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

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:53
constexpr auto MINUTE
Definition: Common.h:47
@ BG_WS_TOTAL_GAME_TIME
Definition: BattlegroundWS.h:41
uint32 GetStartTime() const
Definition: Battleground.h:334

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.

398{
399 if (GetStatus() != STATUS_IN_PROGRESS || !player->IsAlive())
400 return;
401
402 switch (trigger)
403 {
404 case BG_WS_TRIGGER_ALLIANCE_FLAG_SPAWN: // Alliance Flag spawn
407 break;
408 case BG_WS_TRIGGER_HORDE_FLAG_SPAWN: // Horde Flag spawn
411 break;
412 case 3649: // Not used
413 case 3688: // Not used
414 case 4628: // Not used
415 case 4629: // Not used
416 case BG_WS_TRIGGER_ALLIANCE_ELIXIR_SPEED_SPAWN: // Alliance elixir of speed spawn
417 case BG_WS_TRIGGER_HORDE_ELIXIR_SPEED_SPAWN: // Horde elixir of speed spawn
418 case BG_WS_TRIGGER_ALLIANCE_ELIXIR_REGEN_SPAWN: // Alliance elixir of regeneration spawn
419 case BG_WS_TRIGGER_HORDE_ELIXIR_REGEN_SPAWN: // Horde elixir of regeneration spawn
420 case BG_WS_TRIGGER_ALLIANCE_ELIXIR_BERSERK_SPAWN: // Alliance elixir of berserk spawn
421 case BG_WS_TRIGGER_HORDE_ELIXIR_BERSERK_SPAWN: // Horde elixir of berserk spawn
422 break;
423 }
424}
@ 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:189
bool IsAlive() const
Definition: Unit.h:1654

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.

515{
517 return;
518
520 Battleground::HandleKillPlayer(player, killer);
521}
virtual void HandleKillPlayer(Player *player, Player *killer)
Definition: Battleground.cpp:1719
void EventPlayerDroppedFlag(Player *player) override
Definition: BattlegroundWS.cpp:237

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

◆ Init()

void BattlegroundWS::Init ( )
overridevirtual

Reimplemented from Battleground.

475{
476 //call parent's class reset
478
487
488 if (sBattlegroundMgr->IsBGWeekend(GetBgTypeID(true)))
489 {
491 _honorWinKills = 3;
492 _honorEndKills = 4;
493 }
494 else
495 {
497 _honorWinKills = 1;
498 _honorEndKills = 2;
499 }
500}
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:186
void Reset()
Definition: EventMap.cpp:21
virtual void Init()
Definition: Battleground.cpp:1066
BattlegroundTypeId GetBgTypeID(bool GetRandom=false) const
Definition: Battleground.h:329
void Clear()
Definition: ObjectGuid.h:138

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.

57{
59 {
60 _bgEvents.Update(diff);
61 switch (_bgEvents.ExecuteEvent())
62 {
66 break;
70 else
72 break;
78 break;
81 break;
84 break;
87 player->CastSpell(player, BG_WS_SPELL_FOCUSED_ASSAULT, true);
89 player->CastSpell(player, BG_WS_SPELL_FOCUSED_ASSAULT, true);
90 break;
93 {
94 player->RemoveAurasDueToSpell(BG_WS_SPELL_FOCUSED_ASSAULT);
95 player->CastSpell(player, BG_WS_SPELL_BRUTAL_ASSAULT, true);
96 }
98 {
99 player->RemoveAurasDueToSpell(BG_WS_SPELL_FOCUSED_ASSAULT);
100 player->CastSpell(player, BG_WS_SPELL_BRUTAL_ASSAULT, true);
101 }
102 break;
106 break;
107 }
108 }
109}
@ CHAT_MSG_BG_SYSTEM_NEUTRAL
Definition: SharedDefines.h:3188
@ 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
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
void RespawnFlagAfterDrop(TeamId teamId)
Definition: BattlegroundWS.cpp:150

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)
151{
153 return;
154
159
160 if (GameObject* flag = GetBgMap()->GetGameObject(GetDroppedFlagGUID(teamId)))
161 flag->Delete();
162
167
169}
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:184
BattlegroundMap * GetBgMap() const
Definition: Battleground.h:449
ObjectGuid GetDroppedFlagGUID(TeamId teamId) const
Definition: BattlegroundWS.h:254
Definition: GameObject.h:120

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.

427{
428 // flags
429 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);
430 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);
431 // buffs
432 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);
433 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);
434 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);
435 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);
436 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);
437 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);
438 // alliance gates
439 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);
440 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);
441 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);
442 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);
443 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);
444 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);
445 // horde gates
446 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);
447 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);
448 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);
449 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);
450
451 GraveyardStruct const* sg = sGraveyard->GetGraveyard(WS_GRAVEYARD_MAIN_ALLIANCE);
452 AddSpiritGuide(WS_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE);
453
454 sg = sGraveyard->GetGraveyard(WS_GRAVEYARD_MAIN_HORDE);
455 AddSpiritGuide(WS_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, TEAM_HORDE);
456
458 if (!BgObjects[i])
459 {
460 LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn some object Battleground not created!");
461 return false;
462 }
463
465 if (!BgCreatures[i])
466 {
467 LOG_ERROR("sql.sql", "BatteGroundWS: Failed to spawn spirit guides Battleground not created!");
468 return false;
469 }
470
471 return true;
472}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:157
#define SPEED_BUFF_RESPAWN_TIME
Definition: Battleground.h:175
@ BG_OBJECTID_REGENBUFF_ENTRY
Definition: Battleground.h:191
@ BG_OBJECTID_BERSERKERBUFF_ENTRY
Definition: Battleground.h:192
@ BG_OBJECTID_SPEEDBUFF_ENTRY
Definition: Battleground.h:190
#define RESTORATION_BUFF_RESPAWN_TIME
Definition: Battleground.h:173
#define BERSERKING_BUFF_RESPAWN_TIME
Definition: Battleground.h:174
@ 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:1631
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:1407
Definition: GameGraveyard.h:27
float z
Definition: GameGraveyard.h:32
float x
Definition: GameGraveyard.h:30
float y
Definition: GameGraveyard.h:31

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.

123{
125 DoorOpen(i);
127 DoorOpen(i);
128
131
136
142}
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition: DBCEnums.h:110
@ WS_EVENT_START_BATTLE
Definition: BattlegroundWS.h:169
@ BG_WS_DOOR_DESPAWN_TIME
Definition: BattlegroundWS.h:46
void DoorOpen(uint32 type)
Definition: Battleground.cpp:1479
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: Battleground.cpp:1831

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.

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

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