AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
BattlegroundAB Class Reference

#include "BattlegroundAB.h"

Inheritance diagram for BattlegroundAB:
Battleground

Classes

struct  CapturePointInfo
 

Public Member Functions

 BattlegroundAB ()
 
 ~BattlegroundAB () override
 
void AddPlayer (Player *player) override
 
void StartingEventCloseDoors () override
 
void StartingEventOpenDoors () override
 
void RemovePlayer (Player *player) override
 
void HandleAreaTrigger (Player *player, uint32 trigger) override
 
bool SetupBattleground () override
 
void Init () override
 
void EndBattleground (TeamId winnerTeamId) override
 
GraveyardStruct const * GetClosestGraveyard (Player *player) override
 
bool UpdatePlayerScore (Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
 
void FillInitialWorldStates (WorldPacket &data) override
 
void EventPlayerClickedOnFlag (Player *source, GameObject *gameObject) override
 
bool AllNodesConrolledByTeam (TeamId teamId) const override
 
bool IsTeamScores500Disadvantage (TeamId teamId) const
 
TeamId GetPrematureWinner () override
 
- 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.
 
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.
 
void DeleteBanner (uint8 node)
 
void CreateBanner (uint8 node, bool delay)
 
void SendNodeUpdate (uint8 node)
 
void NodeOccupied (uint8 node)
 
void NodeDeoccupied (uint8 node)
 
void ApplyPhaseMask ()
 

Private Attributes

CapturePointInfo _capturePointInfo [BG_AB_DYNAMIC_NODES_COUNT]
 
EventMap _bgEvents
 
uint32 _honorTics
 
uint32 _reputationTics
 
uint8 _controlledPoints [PVP_TEAMS_COUNT] {}
 
bool _teamScores500Disadvantage [PVP_TEAMS_COUNT] {}
 

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

◆ BattlegroundAB()

BattlegroundAB::BattlegroundAB ( )
36{
37 m_BuffChange = true;
39 BgCreatures.resize(BG_AB_ALL_NODES_COUNT + BG_AB_DYNAMIC_NODES_COUNT); // xinef: +BG_AB_DYNAMIC_NODES_COUNT buff triggers
40
45 _honorTics = 0;
47}
@ BG_AB_OBJECT_MAX
Definition: BattlegroundAB.h:134
@ BG_AB_ALL_NODES_COUNT
Definition: BattlegroundAB.h:148
@ BG_AB_DYNAMIC_NODES_COUNT
Definition: BattlegroundAB.h:144
@ TEAM_ALLIANCE
Definition: SharedDefines.h:732
@ TEAM_HORDE
Definition: SharedDefines.h:733
BGObjects BgObjects
Definition: Battleground.h:531
bool m_BuffChange
Definition: Battleground.h:626
BGCreatures BgCreatures
Definition: Battleground.h:532
uint32 _honorTics
Definition: BattlegroundAB.h:340
uint32 _reputationTics
Definition: BattlegroundAB.h:341
uint8 _controlledPoints[PVP_TEAMS_COUNT]
Definition: BattlegroundAB.h:342
bool _teamScores500Disadvantage[PVP_TEAMS_COUNT]
Definition: BattlegroundAB.h:343

References _controlledPoints, _honorTics, _reputationTics, _teamScores500Disadvantage, BG_AB_ALL_NODES_COUNT, BG_AB_DYNAMIC_NODES_COUNT, BG_AB_OBJECT_MAX, Battleground::BgCreatures, Battleground::BgObjects, Battleground::m_BuffChange, TEAM_ALLIANCE, and TEAM_HORDE.

◆ ~BattlegroundAB()

BattlegroundAB::~BattlegroundAB ( )
overridedefault

Member Function Documentation

◆ AddPlayer()

void BattlegroundAB::AddPlayer ( Player player)
overridevirtual

Reimplemented from Battleground.

177{
179 PlayerScores.emplace(player->GetGUID().GetCounter(), new BattlegroundABScore(player->GetGUID()));
180}
virtual void AddPlayer(Player *player)
Definition: Battleground.cpp:1077
BattlegroundScoreMap PlayerScores
Definition: Battleground.h:611
Definition: BattlegroundAB.h:258
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.

◆ AllNodesConrolledByTeam()

bool BattlegroundAB::AllNodesConrolledByTeam ( TeamId  teamId) const
overridevirtual

Reimplemented from Battleground.

539{
541}

References _controlledPoints, and BG_AB_DYNAMIC_NODES_COUNT.

◆ ApplyPhaseMask()

void BattlegroundAB::ApplyPhaseMask ( )
private
544{
545 uint32 phaseMask = 1;
547 if (_capturePointInfo[i]._ownerTeamId != TEAM_NEUTRAL)
548 phaseMask |= 1 << (i * 2 + 1 + _capturePointInfo[i]._ownerTeamId);
549
550 const BattlegroundPlayerMap& bgPlayerMap = GetPlayers();
551
552 for (auto const& itr : bgPlayerMap)
553 {
554 itr.second->SetPhaseMask(phaseMask, false);
555 itr.second->UpdateObjectVisibility(true, false);
556 }
557}
std::uint32_t uint32
Definition: Define.h:108
@ BG_AB_NODE_STABLES
Definition: BattlegroundAB.h:139
@ TEAM_NEUTRAL
Definition: SharedDefines.h:734
std::map< ObjectGuid, Player * > BattlegroundPlayerMap
Definition: Battleground.h:392
BattlegroundPlayerMap const & GetPlayers() const
Definition: Battleground.h:393
CapturePointInfo _capturePointInfo[BG_AB_DYNAMIC_NODES_COUNT]
Definition: BattlegroundAB.h:338
TeamId _ownerTeamId
Definition: BattlegroundAB.h:330

References _capturePointInfo, BattlegroundAB::CapturePointInfo::_ownerTeamId, BG_AB_DYNAMIC_NODES_COUNT, BG_AB_NODE_STABLES, Battleground::GetPlayers(), and TEAM_NEUTRAL.

Referenced by EventPlayerClickedOnFlag(), and NodeOccupied().

◆ CreateBanner()

void BattlegroundAB::CreateBanner ( uint8  node,
bool  delay 
)
private
220{
221 // Just put it into the queue
222 if (delay)
223 {
225 return;
226 }
227
230}
@ RESPAWN_IMMEDIATELY
Definition: Battleground.h:164
@ BG_AB_OBJECTS_PER_NODE
Definition: BattlegroundAB.h:114
@ BG_AB_OBJECT_AURA_ALLY
Definition: BattlegroundAB.h:111
@ BG_AB_EVENT_UPDATE_BANNER_STABLE
Definition: BattlegroundAB.h:27
@ BG_AB_BANNER_UPDATE_TIME
Definition: BattlegroundAB.h:215
void RescheduleEvent(uint32 eventId, uint32 time, uint32 groupId=0, uint32 phase=0)
Definition: EventMap.cpp:81
void SpawnBGObject(uint32 type, uint32 respawntime, uint32 forceRespawnDelay=0)
Definition: Battleground.cpp:1471
EventMap _bgEvents
Definition: BattlegroundAB.h:339

References _bgEvents, _capturePointInfo, BG_AB_BANNER_UPDATE_TIME, BG_AB_EVENT_UPDATE_BANNER_STABLE, BG_AB_OBJECT_AURA_ALLY, BG_AB_OBJECTS_PER_NODE, EventMap::RescheduleEvent(), RESPAWN_IMMEDIATELY, and Battleground::SpawnBGObject().

Referenced by EventPlayerClickedOnFlag(), and PostUpdateImpl().

◆ DeleteBanner()

void BattlegroundAB::DeleteBanner ( uint8  node)
private

◆ EndBattleground()

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

Reimplemented from Battleground.

485{
489 Battleground::EndBattleground(winnerTeamId);
491}
void Reset()
Definition: EventMap.cpp:21
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 _bgEvents, Battleground::EndBattleground(), Battleground::GetBonusHonorFromKill(), EventMap::Reset(), Battleground::RewardHonorToTeam(), TEAM_ALLIANCE, and TEAM_HORDE.

Referenced by PostUpdateImpl().

◆ EventPlayerClickedOnFlag()

void BattlegroundAB::EventPlayerClickedOnFlag ( Player source,
GameObject gameObject 
)
overridevirtual

Reimplemented from Battleground.

306{
307 if (GetStatus() != STATUS_IN_PROGRESS || !player->IsWithinDistInMap(gameObject, 10.0f))
308 return;
309
311 for (; node < BG_AB_DYNAMIC_NODES_COUNT; ++node)
312 if (player->GetDistance2d(BG_AB_NodePositions[node][0], BG_AB_NodePositions[node][1]) < 10.0f)
313 break;
314
315 if (node == BG_AB_DYNAMIC_NODES_COUNT || _capturePointInfo[node]._ownerTeamId == player->GetTeamId() ||
316 (_capturePointInfo[node]._state == BG_AB_NODE_STATE_ALLY_CONTESTED && player->GetTeamId() == TEAM_ALLIANCE) ||
317 (_capturePointInfo[node]._state == BG_AB_NODE_STATE_HORDE_CONTESTED && player->GetTeamId() == TEAM_HORDE))
318 return;
319
320 player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
321
322 uint32 sound = 0;
323 TeamId teamid = player->GetTeamId();
324
325 DeleteBanner(node);
326 CreateBanner(node, true);
327
329 {
330 player->KilledMonsterCredit(BG_AB_QUEST_CREDIT_BASE + node);
332 _capturePointInfo[node]._state = static_cast<uint8>(BG_AB_NODE_STATE_ALLY_CONTESTED) + player->GetTeamId();
336
337 if (teamid == TEAM_ALLIANCE)
338 {
339 SendBroadcastText(ABNodes[node].TextAllianceClaims, CHAT_MSG_BG_SYSTEM_ALLIANCE, player);
340 }
341 else
342 {
343 SendBroadcastText(ABNodes[node].TextHordeClaims, CHAT_MSG_BG_SYSTEM_HORDE, player);
344 }
345 }
347 {
348 if (!_capturePointInfo[node]._captured)
349 {
350 player->KilledMonsterCredit(BG_AB_QUEST_CREDIT_BASE + node);
352 _capturePointInfo[node]._state = static_cast<uint8>(BG_AB_NODE_STATE_ALLY_CONTESTED) + player->GetTeamId();
355
356 if (teamid == TEAM_ALLIANCE)
357 {
358 SendBroadcastText(ABNodes[node].TextAllianceAssaulted, CHAT_MSG_BG_SYSTEM_ALLIANCE, player);
359 }
360 else
361 {
362 SendBroadcastText(ABNodes[node].TextHordeAssaulted, CHAT_MSG_BG_SYSTEM_HORDE, player);
363 }
364 }
365 else
366 {
368 _capturePointInfo[node]._state = static_cast<uint8>(BG_AB_NODE_STATE_ALLY_OCCUPIED) + player->GetTeamId();
369 _capturePointInfo[node]._ownerTeamId = player->GetTeamId();
371 NodeOccupied(node); // after setting team owner
372
373 if (teamid == TEAM_ALLIANCE)
374 {
375 SendBroadcastText(ABNodes[node].TextAllianceDefended, CHAT_MSG_BG_SYSTEM_ALLIANCE, player);
376 }
377 else
378 {
379 SendBroadcastText(ABNodes[node].TextHordeDefended, CHAT_MSG_BG_SYSTEM_HORDE, player);
380 }
381 }
382
384 }
385 else
386 {
387 player->KilledMonsterCredit(BG_AB_QUEST_CREDIT_BASE + node);
389 NodeDeoccupied(node); // before setting team owner to neutral
390
391 _capturePointInfo[node]._state = static_cast<uint8>(BG_AB_NODE_STATE_ALLY_CONTESTED) + player->GetTeamId();
392
396
397 if (teamid == TEAM_ALLIANCE)
398 {
399 SendBroadcastText(ABNodes[node].TextAllianceAssaulted, CHAT_MSG_BG_SYSTEM_ALLIANCE, player);
400 }
401 else
402 {
403 SendBroadcastText(ABNodes[node].TextHordeAssaulted, CHAT_MSG_BG_SYSTEM_HORDE, player);
404 }
405 }
406
407 SendNodeUpdate(node);
408 PlaySoundToAll(sound);
409}
std::uint8_t uint8
Definition: Define.h:110
@ STATUS_IN_PROGRESS
Definition: Battleground.h:197
@ SCORE_BASES_ASSAULTED
Definition: BattlegroundScore.h:41
@ SCORE_BASES_DEFENDED
Definition: BattlegroundScore.h:42
@ BG_AB_NODE_STATE_NEUTRAL
Definition: BattlegroundAB.h:181
@ BG_AB_NODE_STATE_ALLY_OCCUPIED
Definition: BattlegroundAB.h:182
@ BG_AB_NODE_STATE_HORDE_CONTESTED
Definition: BattlegroundAB.h:185
@ BG_AB_NODE_STATE_ALLY_CONTESTED
Definition: BattlegroundAB.h:184
@ BG_AB_EVENT_CAPTURE_STABLE
Definition: BattlegroundAB.h:33
ABNodeInfo const ABNodes[BG_AB_DYNAMIC_NODES_COUNT]
Definition: BattlegroundAB.h:170
@ BG_AB_FLAG_CAPTURING_TIME
Definition: BattlegroundAB.h:214
@ BG_AB_QUEST_CREDIT_BASE
Definition: BattlegroundAB.h:204
const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4]
Definition: BattlegroundAB.h:231
@ BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE
Definition: BattlegroundAB.h:193
@ BG_AB_SOUND_NODE_ASSAULTED_HORDE
Definition: BattlegroundAB.h:194
@ BG_AB_SOUND_NODE_CLAIMED
Definition: BattlegroundAB.h:190
@ 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
TeamId
Definition: SharedDefines.h:731
void CancelEvent(uint32 eventId)
Definition: EventMap.cpp:190
void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
Definition: Battleground.cpp:678
BattlegroundStatus GetStatus() const
Definition: Battleground.h:322
void PlaySoundToAll(uint32 soundId)
Definition: Battleground.cpp:691
void ApplyPhaseMask()
Definition: BattlegroundAB.cpp:543
void NodeOccupied(uint8 node)
Definition: BattlegroundAB.cpp:268
void NodeDeoccupied(uint8 node)
Definition: BattlegroundAB.cpp:290
void DeleteBanner(uint8 node)
Definition: BattlegroundAB.cpp:232
bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
Definition: BattlegroundAB.cpp:518
void CreateBanner(uint8 node, bool delay)
Definition: BattlegroundAB.cpp:219
void SendNodeUpdate(uint8 node)
Definition: BattlegroundAB.cpp:258
uint8 _state
Definition: BattlegroundAB.h:333

References _bgEvents, _capturePointInfo, BattlegroundAB::CapturePointInfo::_ownerTeamId, BattlegroundAB::CapturePointInfo::_state, ABNodes, ApplyPhaseMask(), AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT, BG_AB_DYNAMIC_NODES_COUNT, BG_AB_EVENT_CAPTURE_STABLE, BG_AB_FLAG_CAPTURING_TIME, BG_AB_NODE_STABLES, BG_AB_NODE_STATE_ALLY_CONTESTED, BG_AB_NODE_STATE_ALLY_OCCUPIED, BG_AB_NODE_STATE_HORDE_CONTESTED, BG_AB_NODE_STATE_NEUTRAL, BG_AB_NodePositions, BG_AB_QUEST_CREDIT_BASE, BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE, BG_AB_SOUND_NODE_ASSAULTED_HORDE, BG_AB_SOUND_NODE_CLAIMED, EventMap::CancelEvent(), CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, CreateBanner(), DeleteBanner(), WorldObject::GetDistance2d(), Battleground::GetStatus(), Player::GetTeamId(), WorldObject::IsWithinDistInMap(), Player::KilledMonsterCredit(), NodeDeoccupied(), NodeOccupied(), Battleground::PlaySoundToAll(), Unit::RemoveAurasWithInterruptFlags(), EventMap::RescheduleEvent(), SCORE_BASES_ASSAULTED, SCORE_BASES_DEFENDED, Battleground::SendBroadcastText(), SendNodeUpdate(), STATUS_IN_PROGRESS, TEAM_ALLIANCE, TEAM_HORDE, TEAM_NEUTRAL, and UpdatePlayerScore().

◆ FillInitialWorldStates()

void BattlegroundAB::FillInitialWorldStates ( WorldPacket data)
overridevirtual

Reimplemented from Battleground.

239{
240 for (auto& node : _capturePointInfo)
241 {
242 if (node._state == BG_AB_NODE_STATE_NEUTRAL)
243 data << uint32(node._iconNone) << uint32(1);
244
246 data << uint32(node._iconCapture + i - 1) << uint32(node._state == i);
247 }
248
255 data << uint32(0x745) << uint32(0x2); // 37 1861 unk
256}
@ BG_AB_WARNING_NEAR_VICTORY_SCORE
Definition: BattlegroundAB.h:211
@ BG_AB_MAX_TEAM_SCORE
Definition: BattlegroundAB.h:212
@ BG_AB_OP_RESOURCES_ALLY
Definition: BattlegroundAB.h:47
@ BG_AB_OP_RESOURCES_MAX
Definition: BattlegroundAB.h:49
@ BG_AB_OP_OCCUPIED_BASES_HORDE
Definition: BattlegroundAB.h:45
@ BG_AB_OP_RESOURCES_HORDE
Definition: BattlegroundAB.h:48
@ BG_AB_OP_RESOURCES_WARNING
Definition: BattlegroundAB.h:50
@ BG_AB_OP_OCCUPIED_BASES_ALLY
Definition: BattlegroundAB.h:46
int32 m_TeamScores[PVP_TEAMS_COUNT]
Definition: Battleground.h:630

References _capturePointInfo, _controlledPoints, BG_AB_MAX_TEAM_SCORE, BG_AB_NODE_STATE_ALLY_OCCUPIED, BG_AB_NODE_STATE_HORDE_CONTESTED, BG_AB_NODE_STATE_NEUTRAL, BG_AB_OP_OCCUPIED_BASES_ALLY, BG_AB_OP_OCCUPIED_BASES_HORDE, BG_AB_OP_RESOURCES_ALLY, BG_AB_OP_RESOURCES_HORDE, BG_AB_OP_RESOURCES_MAX, BG_AB_OP_RESOURCES_WARNING, BG_AB_WARNING_NEAR_VICTORY_SCORE, Battleground::m_TeamScores, TEAM_ALLIANCE, and TEAM_HORDE.

◆ GetClosestGraveyard()

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

Reimplemented from Battleground.

494{
495 GraveyardStruct const* entry = sGraveyard->GetGraveyard(BG_AB_GraveyardIds[static_cast<uint8>(BG_AB_SPIRIT_ALIANCE) + player->GetTeamId()]);
496 GraveyardStruct const* nearestEntry = entry;
497
498 float pX = player->GetPositionX();
499 float pY = player->GetPositionY();
500 float dist = (entry->x - pX) * (entry->x - pX) + (entry->y - pY) * (entry->y - pY);
501 float minDist = dist;
502
504 if (_capturePointInfo[i]._ownerTeamId == player->GetTeamId())
505 {
506 entry = sGraveyard->GetGraveyard(BG_AB_GraveyardIds[i]);
507 dist = (entry->x - pX) * (entry->x - pX) + (entry->y - pY) * (entry->y - pY);
508 if (dist < minDist)
509 {
510 minDist = dist;
511 nearestEntry = entry;
512 }
513 }
514
515 return nearestEntry;
516}
const uint32 BG_AB_GraveyardIds[BG_AB_ALL_NODES_COUNT]
Definition: BattlegroundAB.h:220
@ BG_AB_SPIRIT_ALIANCE
Definition: BattlegroundAB.h:146
#define sGraveyard
Definition: GameGraveyard.h:75
float GetPositionX() const
Definition: Position.h:117
float GetPositionY() const
Definition: Position.h:118
TeamId GetTeamId(bool original=false) const
Definition: Player.h:2059
Definition: GameGraveyard.h:28
float x
Definition: GameGraveyard.h:31
float y
Definition: GameGraveyard.h:32

References _capturePointInfo, BG_AB_DYNAMIC_NODES_COUNT, BG_AB_GraveyardIds, BG_AB_NODE_STABLES, BG_AB_SPIRIT_ALIANCE, Position::GetPositionX(), Position::GetPositionY(), Player::GetTeamId(), sGraveyard, GraveyardStruct::x, and GraveyardStruct::y.

◆ GetPrematureWinner()

TeamId BattlegroundAB::GetPrematureWinner ( )
overridevirtual

◆ HandleAreaTrigger()

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

Reimplemented from Battleground.

188{
190 return;
191
192 switch (trigger)
193 {
194 case 3948: // Arathi Basin Alliance Exit.
195 if (player->GetTeamId() != TEAM_ALLIANCE)
196 player->GetSession()->SendAreaTriggerMessage("Only The Alliance can use that portal");
197 else
198 player->LeaveBattleground();
199 break;
200 case 3949: // Arathi Basin Horde Exit.
201 if (player->GetTeamId() != TEAM_HORDE)
202 player->GetSession()->SendAreaTriggerMessage("Only The Horde can use that portal");
203 else
204 player->LeaveBattleground();
205 break;
206 case 3866: // Stables
207 case 3869: // Gold Mine
208 case 3867: // Farm
209 case 3868: // Lumber Mill
210 case 3870: // Black Smith
211 case 4020: // Unk1
212 case 4021: // Unk2
213 break;
214 default:
215 break;
216 }
217}
WorldSession * GetSession() const
Definition: Player.h:1948
void LeaveBattleground(Battleground *bg=nullptr)
Definition: Player.cpp:11216
void SendAreaTriggerMessage(const char *Text,...) ATTR_PRINTF(2
Definition: MiscHandler.cpp:714

References Player::GetSession(), Battleground::GetStatus(), Player::GetTeamId(), Player::LeaveBattleground(), WorldSession::SendAreaTriggerMessage(), STATUS_IN_PROGRESS, TEAM_ALLIANCE, and TEAM_HORDE.

◆ Init()

void BattlegroundAB::Init ( )
overridevirtual

Reimplemented from Battleground.

463{
464 //call parent's class reset
466
468
471
482}
@ BG_AB_REP_TICK_NORMAL
Definition: BattlegroundAB.h:208
@ BG_AB_REP_TICK_WEEKEND
Definition: BattlegroundAB.h:209
@ BG_AB_HONOR_TICK_NORMAL
Definition: BattlegroundAB.h:206
@ BG_AB_HONOR_TICK_WEEKEND
Definition: BattlegroundAB.h:207
@ BG_AB_NODE_BLACKSMITH
Definition: BattlegroundAB.h:140
@ BG_AB_NODE_LUMBER_MILL
Definition: BattlegroundAB.h:142
@ BG_AB_NODE_FARM
Definition: BattlegroundAB.h:141
@ BG_AB_NODE_GOLD_MINE
Definition: BattlegroundAB.h:143
@ BG_AB_OP_FARM_ICON
Definition: BattlegroundAB.h:58
@ BG_AB_OP_LUMBERMILL_STATE_ALIENCE
Definition: BattlegroundAB.h:71
@ BG_AB_OP_GOLDMINE_ICON
Definition: BattlegroundAB.h:76
@ BG_AB_OP_BLACKSMITH_ICON
Definition: BattlegroundAB.h:64
@ BG_AB_OP_STABLE_ICON
Definition: BattlegroundAB.h:52
@ BG_AB_OP_GOLDMINE_STATE_ALIENCE
Definition: BattlegroundAB.h:77
@ BG_AB_OP_LUMBERMILL_ICON
Definition: BattlegroundAB.h:70
@ BG_AB_OP_STABLE_STATE_ALIENCE
Definition: BattlegroundAB.h:53
@ BG_AB_OP_FARM_STATE_ALIENCE
Definition: BattlegroundAB.h:59
@ BG_AB_OP_BLACKSMITH_STATE_ALIENCE
Definition: BattlegroundAB.h:65
virtual void Init()
Definition: Battleground.cpp:1028
BattlegroundTypeId GetBgTypeID(bool GetRandom=false) const
Definition: Battleground.h:319
static bool IsBGWeekend(BattlegroundTypeId bgTypeId)
Definition: BattlegroundMgr.cpp:895
uint32 _iconNone
Definition: BattlegroundAB.h:331
uint32 _iconCapture
Definition: BattlegroundAB.h:332

References _bgEvents, _capturePointInfo, _honorTics, BattlegroundAB::CapturePointInfo::_iconCapture, BattlegroundAB::CapturePointInfo::_iconNone, _reputationTics, BG_AB_HONOR_TICK_NORMAL, BG_AB_HONOR_TICK_WEEKEND, BG_AB_NODE_BLACKSMITH, BG_AB_NODE_FARM, BG_AB_NODE_GOLD_MINE, BG_AB_NODE_LUMBER_MILL, BG_AB_NODE_STABLES, BG_AB_OP_BLACKSMITH_ICON, BG_AB_OP_BLACKSMITH_STATE_ALIENCE, BG_AB_OP_FARM_ICON, BG_AB_OP_FARM_STATE_ALIENCE, BG_AB_OP_GOLDMINE_ICON, BG_AB_OP_GOLDMINE_STATE_ALIENCE, BG_AB_OP_LUMBERMILL_ICON, BG_AB_OP_LUMBERMILL_STATE_ALIENCE, BG_AB_OP_STABLE_ICON, BG_AB_OP_STABLE_STATE_ALIENCE, BG_AB_REP_TICK_NORMAL, BG_AB_REP_TICK_WEEKEND, Battleground::GetBgTypeID(), Battleground::Init(), BattlegroundMgr::IsBGWeekend(), and EventMap::Reset().

◆ IsTeamScores500Disadvantage()

bool BattlegroundAB::IsTeamScores500Disadvantage ( TeamId  teamId) const
inline

◆ NodeDeoccupied()

void BattlegroundAB::NodeDeoccupied ( uint8  node)
private
291{
293
295
296 _reviveEvents.AddEventAtOffset([this, node]()
297 {
299 DelCreature(node); // Delete spirit healer
300 }, 500ms);
301
302 DelCreature(BG_AB_ALL_NODES_COUNT + node); // Delete aura trigger
303}
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
Definition: EventProcessor.h:109
bool DelCreature(uint32 type)
Definition: Battleground.cpp:1554
void RelocateDeadPlayers(ObjectGuid queueIndex)
Relocate all players in ReviveQueue to the closest graveyard.
Definition: Battleground.cpp:1345
EventProcessor _reviveEvents
Definition: Battleground.h:637

References _capturePointInfo, _controlledPoints, BattlegroundAB::CapturePointInfo::_ownerTeamId, Battleground::_reviveEvents, EventProcessor::AddEventAtOffset(), BG_AB_ALL_NODES_COUNT, Battleground::BgCreatures, Battleground::DelCreature(), Battleground::RelocateDeadPlayers(), and TEAM_NEUTRAL.

Referenced by EventPlayerClickedOnFlag().

◆ NodeOccupied()

void BattlegroundAB::NodeOccupied ( uint8  node)
private
269{
271 AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], _capturePointInfo[node]._ownerTeamId);
272
274 if (_controlledPoints[_capturePointInfo[node]._ownerTeamId] >= 5)
276 if (_controlledPoints[_capturePointInfo[node]._ownerTeamId] >= 4)
278
280 if (!trigger)
282
283 if (trigger)
284 {
286 trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false);
287 }
288}
@ SPELL_HONORABLE_DEFENDER_25Y
Definition: Battleground.h:141
@ SPELL_AB_QUEST_REWARD_4_BASES
Definition: Battleground.h:94
@ SPELL_AB_QUEST_REWARD_5_BASES
Definition: Battleground.h:95
const float BG_AB_SpiritGuidePos[BG_AB_ALL_NODES_COUNT][4]
Definition: BattlegroundAB.h:246
#define WORLD_TRIGGER
Definition: Unit.h:36
@ FACTION_ALLIANCE_GENERIC
Definition: SharedDefines.h:178
@ FACTION_HORDE_GENERIC
Definition: SharedDefines.h:177
bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId)
Definition: Battleground.cpp:1593
BattlegroundMap * GetBgMap() const
Definition: Battleground.h:424
Creature * AddCreature(uint32 entry, uint32 type, float x, float y, float z, float o, uint32 respawntime=0, MotionTransport *transport=nullptr)
Definition: Battleground.cpp:1491
void CastSpellOnTeam(uint32 spellId, TeamId teamId)
Definition: Battleground.cpp:696
Definition: Creature.h:46
void SetFaction(uint32 faction)
Definition: Unit.cpp:10029
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:1169
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3293

References _capturePointInfo, _controlledPoints, BattlegroundAB::CapturePointInfo::_ownerTeamId, Battleground::AddCreature(), Battleground::AddSpiritGuide(), ApplyPhaseMask(), BG_AB_ALL_NODES_COUNT, BG_AB_NodePositions, BG_AB_SpiritGuidePos, Battleground::BgCreatures, Unit::CastSpell(), Battleground::CastSpellOnTeam(), FACTION_ALLIANCE_GENERIC, FACTION_HORDE_GENERIC, Battleground::GetBgMap(), Map::GetCreature(), Unit::SetFaction(), SPELL_AB_QUEST_REWARD_4_BASES, SPELL_AB_QUEST_REWARD_5_BASES, SPELL_HONORABLE_DEFENDER_25Y, TEAM_ALLIANCE, and WORLD_TRIGGER.

Referenced by EventPlayerClickedOnFlag(), and PostUpdateImpl().

◆ PostUpdateImpl()

void BattlegroundAB::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.

52{
54 {
55 _bgEvents.Update(diff);
56 while (uint32 eventId = _bgEvents.ExecuteEvent())
57 switch (eventId)
58 {
65 break;
71 {
72 uint8 node = eventId - BG_AB_EVENT_CAPTURE_STABLE;
74 DeleteBanner(node);
75 _capturePointInfo[node]._ownerTeamId = teamId;
77 _capturePointInfo[node]._captured = true;
78
79 CreateBanner(node, false);
80 NodeOccupied(node);
81 SendNodeUpdate(node);
82
83 if (teamId == TEAM_ALLIANCE)
84 {
87 }
88 else
89 {
92 }
93
94 break;
95 }
98 {
99 auto teamId = TeamId(eventId - BG_AB_EVENT_ALLIANCE_TICK);
100 uint8 controlledPoints = _controlledPoints[teamId];
101 if (controlledPoints == 0)
102 {
103 _bgEvents.ScheduleEvent(eventId, 3000);
104 break;
105 }
106
107 auto honorRewards = uint8(m_TeamScores[teamId] / _honorTics);
108 auto reputationRewards = uint8(m_TeamScores[teamId] / _reputationTics);
109 auto information = uint8(m_TeamScores[teamId] / BG_AB_WARNING_NEAR_VICTORY_SCORE);
110 m_TeamScores[teamId] += BG_AB_TickPoints[controlledPoints];
113
114 if (honorRewards < uint8(m_TeamScores[teamId] / _honorTics))
116 if (reputationRewards < uint8(m_TeamScores[teamId] / _reputationTics))
117 RewardReputationToTeam(teamId == TEAM_ALLIANCE ? 509 : 510, 10, teamId);
118 if (information < uint8(m_TeamScores[teamId] / BG_AB_WARNING_NEAR_VICTORY_SCORE))
119 {
120 if (teamId == TEAM_ALLIANCE)
121 {
124 }
125 else
126 {
129 }
130 }
131
133 if (m_TeamScores[teamId] > m_TeamScores[GetOtherTeamId(teamId)] + 500)
135 if (m_TeamScores[teamId] >= BG_AB_MAX_TEAM_SCORE)
136 EndBattleground(teamId);
137
138 _bgEvents.ScheduleEvent(eventId, BG_AB_TickIntervals[controlledPoints]);
139 break;
140 }
141 default:
142 break;
143 }
144 }
145}
@ BG_AB_TEXT_ALLIANCE_NEAR_VICTORY
Definition: BattlegroundAB.h:153
@ BG_AB_TEXT_HORDE_NEAR_VICTORY
Definition: BattlegroundAB.h:154
@ BG_AB_NODE_STATE_HORDE_OCCUPIED
Definition: BattlegroundAB.h:183
@ BG_AB_EVENT_UPDATE_BANNER_GOLDMINE
Definition: BattlegroundAB.h:31
@ BG_AB_EVENT_ALLIANCE_TICK
Definition: BattlegroundAB.h:39
@ BG_AB_EVENT_UPDATE_BANNER_FARM
Definition: BattlegroundAB.h:28
@ BG_AB_EVENT_CAPTURE_GOLDMINE
Definition: BattlegroundAB.h:37
@ BG_AB_EVENT_UPDATE_BANNER_LUMBERMILL
Definition: BattlegroundAB.h:30
@ BG_AB_EVENT_UPDATE_BANNER_BLACKSMITH
Definition: BattlegroundAB.h:29
@ BG_AB_EVENT_CAPTURE_LUMBERMILL
Definition: BattlegroundAB.h:36
@ BG_AB_EVENT_HORDE_TICK
Definition: BattlegroundAB.h:40
@ BG_AB_EVENT_CAPTURE_BLACKSMITH
Definition: BattlegroundAB.h:35
@ BG_AB_EVENT_CAPTURE_FARM
Definition: BattlegroundAB.h:34
const uint32 BG_AB_TickPoints[BG_AB_DYNAMIC_NODES_COUNT+1]
Definition: BattlegroundAB.h:219
const uint32 BG_AB_TickIntervals[BG_AB_DYNAMIC_NODES_COUNT+1]
Definition: BattlegroundAB.h:218
@ BG_AB_SOUND_NEAR_VICTORY_ALLIANCE
Definition: BattlegroundAB.h:195
@ BG_AB_SOUND_NODE_CAPTURED_HORDE
Definition: BattlegroundAB.h:192
@ BG_AB_SOUND_NEAR_VICTORY_HORDE
Definition: BattlegroundAB.h:196
@ BG_AB_SOUND_NODE_CAPTURED_ALLIANCE
Definition: BattlegroundAB.h:191
@ CHAT_MSG_BG_SYSTEM_NEUTRAL
Definition: SharedDefines.h:3160
uint32 ExecuteEvent()
Definition: EventMap.cpp:114
void Update(uint32 time)
Definition: EventMap.h:54
void ScheduleEvent(uint32 eventId, uint32 time, uint32 group=0, uint32 phase=0)
Definition: EventMap.cpp:56
void RewardReputationToTeam(uint32 factionId, uint32 reputation, TeamId teamId)
Definition: Battleground.cpp:727
static TeamId GetOtherTeamId(TeamId teamId)
Definition: Battleground.cpp:1773
void UpdateWorldState(uint32 variable, uint32 value)
Definition: Battleground.cpp:770
void EndBattleground(TeamId winnerTeamId) override
Definition: BattlegroundAB.cpp:484
bool _captured
Definition: BattlegroundAB.h:335

References _bgEvents, BattlegroundAB::CapturePointInfo::_captured, _capturePointInfo, _controlledPoints, _honorTics, BattlegroundAB::CapturePointInfo::_ownerTeamId, _reputationTics, BattlegroundAB::CapturePointInfo::_state, _teamScores500Disadvantage, ABNodes, BG_AB_EVENT_ALLIANCE_TICK, BG_AB_EVENT_CAPTURE_BLACKSMITH, BG_AB_EVENT_CAPTURE_FARM, BG_AB_EVENT_CAPTURE_GOLDMINE, BG_AB_EVENT_CAPTURE_LUMBERMILL, BG_AB_EVENT_CAPTURE_STABLE, BG_AB_EVENT_HORDE_TICK, BG_AB_EVENT_UPDATE_BANNER_BLACKSMITH, BG_AB_EVENT_UPDATE_BANNER_FARM, BG_AB_EVENT_UPDATE_BANNER_GOLDMINE, BG_AB_EVENT_UPDATE_BANNER_LUMBERMILL, BG_AB_EVENT_UPDATE_BANNER_STABLE, BG_AB_MAX_TEAM_SCORE, BG_AB_NODE_STATE_ALLY_CONTESTED, BG_AB_NODE_STATE_ALLY_OCCUPIED, BG_AB_NODE_STATE_HORDE_OCCUPIED, BG_AB_OP_RESOURCES_ALLY, BG_AB_OP_RESOURCES_HORDE, BG_AB_SOUND_NEAR_VICTORY_ALLIANCE, BG_AB_SOUND_NEAR_VICTORY_HORDE, BG_AB_SOUND_NODE_CAPTURED_ALLIANCE, BG_AB_SOUND_NODE_CAPTURED_HORDE, BG_AB_TEXT_ALLIANCE_NEAR_VICTORY, BG_AB_TEXT_HORDE_NEAR_VICTORY, BG_AB_TickIntervals, BG_AB_TickPoints, BG_AB_WARNING_NEAR_VICTORY_SCORE, CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, CHAT_MSG_BG_SYSTEM_NEUTRAL, CreateBanner(), DeleteBanner(), EndBattleground(), EventMap::ExecuteEvent(), Battleground::GetBonusHonorFromKill(), Battleground::GetOtherTeamId(), Battleground::GetStatus(), Battleground::m_TeamScores, NodeOccupied(), Battleground::PlaySoundToAll(), Battleground::RewardHonorToTeam(), Battleground::RewardReputationToTeam(), EventMap::ScheduleEvent(), Battleground::SendBroadcastText(), SendNodeUpdate(), STATUS_IN_PROGRESS, TEAM_ALLIANCE, TEAM_HORDE, EventMap::Update(), and Battleground::UpdateWorldState().

◆ RemovePlayer()

void BattlegroundAB::RemovePlayer ( Player player)
overridevirtual

Reimplemented from Battleground.

183{
184 player->SetPhaseMask(1, false);
185}
void SetPhaseMask(uint32 newPhaseMask, bool update) override
Definition: Unit.cpp:19217

References Unit::SetPhaseMask().

◆ SendNodeUpdate()

◆ SetupBattleground()

bool BattlegroundAB::SetupBattleground ( )
overridevirtual

Reimplemented from Battleground.

419{
420 for (uint32 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
421 {
430 }
431
434
435 for (uint32 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
436 {
440 }
441
444
446 if (!BgObjects[i])
447 {
448 LOG_ERROR("sql.sql", "BatteGroundAB: Failed to spawn some object Battleground not created!");
449 return false;
450 }
451
453 if (!BgCreatures[i])
454 {
455 LOG_ERROR("sql.sql", "BatteGroundAB: Failed to spawn spirit guides Battleground not created!");
456 return false;
457 }
458
459 return true;
460}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
const uint32 Buff_Entries[3]
Definition: Battleground.h:190
@ BG_AB_OBJECTID_BANNER_CONT_A
Definition: BattlegroundAB.h:92
@ BG_AB_OBJECTID_BANNER_A
Definition: BattlegroundAB.h:91
@ BG_AB_OBJECTID_AURA_A
Definition: BattlegroundAB.h:96
@ BG_AB_OBJECTID_BANNER_H
Definition: BattlegroundAB.h:93
@ BG_AB_OBJECTID_AURA_C
Definition: BattlegroundAB.h:98
@ BG_AB_OBJECTID_AURA_H
Definition: BattlegroundAB.h:97
@ BG_AB_OBJECTID_GATE_A
Definition: BattlegroundAB.h:100
@ BG_AB_OBJECTID_NODE_BANNER_0
Definition: BattlegroundAB.h:85
@ BG_AB_OBJECTID_BANNER_CONT_H
Definition: BattlegroundAB.h:94
@ BG_AB_OBJECTID_GATE_H
Definition: BattlegroundAB.h:101
@ BG_AB_OBJECT_BANNER_HORDE
Definition: BattlegroundAB.h:108
@ BG_AB_OBJECT_BANNER_ALLY
Definition: BattlegroundAB.h:107
@ BG_AB_OBJECT_GATE_A
Definition: BattlegroundAB.h:116
@ BG_AB_OBJECT_AURA_HORDE
Definition: BattlegroundAB.h:112
@ BG_AB_OBJECT_GATE_H
Definition: BattlegroundAB.h:117
@ BG_AB_OBJECT_BANNER_NEUTRAL
Definition: BattlegroundAB.h:106
@ BG_AB_OBJECT_BANNER_CONT_H
Definition: BattlegroundAB.h:110
@ BG_AB_OBJECT_SPEEDBUFF_STABLES
Definition: BattlegroundAB.h:119
@ BG_AB_OBJECT_BANNER_CONT_A
Definition: BattlegroundAB.h:109
@ BG_AB_OBJECT_AURA_CONTESTED
Definition: BattlegroundAB.h:113
const float BG_AB_BuffPositions[BG_AB_DYNAMIC_NODES_COUNT][4]
Definition: BattlegroundAB.h:222
const float BG_AB_DoorPositions[2][8]
Definition: BattlegroundAB.h:240
@ BG_AB_SPIRIT_HORDE
Definition: BattlegroundAB.h:147
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

References Battleground::AddObject(), Battleground::AddSpiritGuide(), BG_AB_BuffPositions, BG_AB_DoorPositions, BG_AB_DYNAMIC_NODES_COUNT, BG_AB_NodePositions, BG_AB_OBJECT_AURA_ALLY, BG_AB_OBJECT_AURA_CONTESTED, BG_AB_OBJECT_AURA_HORDE, BG_AB_OBJECT_BANNER_ALLY, BG_AB_OBJECT_BANNER_CONT_A, BG_AB_OBJECT_BANNER_CONT_H, BG_AB_OBJECT_BANNER_HORDE, BG_AB_OBJECT_BANNER_NEUTRAL, BG_AB_OBJECT_GATE_A, BG_AB_OBJECT_GATE_H, BG_AB_OBJECT_MAX, BG_AB_OBJECT_SPEEDBUFF_STABLES, BG_AB_OBJECTID_AURA_A, BG_AB_OBJECTID_AURA_C, BG_AB_OBJECTID_AURA_H, BG_AB_OBJECTID_BANNER_A, BG_AB_OBJECTID_BANNER_CONT_A, BG_AB_OBJECTID_BANNER_CONT_H, BG_AB_OBJECTID_BANNER_H, BG_AB_OBJECTID_GATE_A, BG_AB_OBJECTID_GATE_H, BG_AB_OBJECTID_NODE_BANNER_0, BG_AB_OBJECTS_PER_NODE, BG_AB_SPIRIT_ALIANCE, BG_AB_SPIRIT_HORDE, BG_AB_SpiritGuidePos, Battleground::BgCreatures, Battleground::BgObjects, Buff_Entries, LOG_ERROR, RESPAWN_IMMEDIATELY, RESPAWN_ONE_DAY, TEAM_ALLIANCE, and TEAM_HORDE.

◆ StartingEventCloseDoors()

◆ StartingEventOpenDoors()

void BattlegroundAB::StartingEventOpenDoors ( )
overridevirtual

Reimplemented from Battleground.

162{
165
166 for (uint32 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
168
174}
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ BG_AB_EVENT_START_BATTLE
Definition: BattlegroundAB.h:203
@ 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_AB_DYNAMIC_NODES_COUNT, BG_AB_EVENT_ALLIANCE_TICK, BG_AB_EVENT_HORDE_TICK, BG_AB_EVENT_START_BATTLE, BG_AB_OBJECT_BANNER_NEUTRAL, BG_AB_OBJECT_GATE_A, BG_AB_OBJECT_GATE_H, BG_AB_OBJECT_SPEEDBUFF_STABLES, BG_AB_OBJECTS_PER_NODE, Battleground::DoorOpen(), RESPAWN_IMMEDIATELY, EventMap::ScheduleEvent(), Battleground::SpawnBGObject(), Battleground::StartTimedAchievement(), and urand().

◆ UpdatePlayerScore()

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

Reimplemented from Battleground.

519{
520 if (!Battleground::UpdatePlayerScore(player, type, value, doAddHonor))
521 return false;
522
523 switch (type)
524 {
527 break;
530 break;
531 default:
532 break;
533 }
534
535 return true;
536}
@ BG_AB_OBJECTIVE_ASSAULT_BASE
Definition: BattlegroundAB.h:201
@ BG_AB_OBJECTIVE_DEFEND_BASE
Definition: BattlegroundAB.h:202
@ 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, BG_AB_OBJECTIVE_ASSAULT_BASE, BG_AB_OBJECTIVE_DEFEND_BASE, SCORE_BASES_ASSAULTED, SCORE_BASES_DEFENDED, Player::UpdateAchievementCriteria(), and Battleground::UpdatePlayerScore().

Referenced by EventPlayerClickedOnFlag().

Member Data Documentation

◆ _bgEvents

◆ _capturePointInfo

◆ _controlledPoints

◆ _honorTics

uint32 BattlegroundAB::_honorTics
private

◆ _reputationTics

uint32 BattlegroundAB::_reputationTics
private

◆ _teamScores500Disadvantage

bool BattlegroundAB::_teamScores500Disadvantage[PVP_TEAMS_COUNT] {}
private

Referenced by BattlegroundAB(), and PostUpdateImpl().