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

#include "BattlegroundNA.h"

Inheritance diagram for BattlegroundNA:
Arena Battleground

Public Member Functions

 BattlegroundNA ()
 
void StartingEventCloseDoors () override
 
void StartingEventOpenDoors () override
 
void HandleAreaTrigger (Player *player, uint32 trigger) override
 
bool SetupBattleground () override
 
void FillInitialWorldStates (WorldPacket &d) override
 
bool HandlePlayerUnderMap (Player *player) 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
 
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
 

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 Arena
 Arena ()
 
void AddPlayer (Player *player) override
 
void RemovePlayer (Player *) override
 
void FillInitialWorldStates (WorldPacket &data) override
 
void UpdateArenaWorldState ()
 
void HandleKillPlayer (Player *player, Player *killer) override
 
- 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

◆ BattlegroundNA()

BattlegroundNA::BattlegroundNA ( )
23{
25}
@ BG_NA_OBJECT_MAX
Definition: BattlegroundNA.h:33
BGObjects BgObjects
Definition: Battleground.h:532

References BG_NA_OBJECT_MAX, and Battleground::BgObjects.

Member Function Documentation

◆ FillInitialWorldStates()

void BattlegroundNA::FillInitialWorldStates ( WorldPacket d)
overridevirtual

Reimplemented from Arena.

68{
69 data << uint32(0xa11) << uint32(1); // 9
71}
std::uint32_t uint32
Definition: Define.h:107
void FillInitialWorldStates(WorldPacket &data) override
Definition: Arena.cpp:149

References Arena::FillInitialWorldStates().

◆ HandleAreaTrigger()

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

Reimplemented from Battleground.

49{
51 return;
52
53 switch (trigger)
54 {
55 case 4536: // buff trigger?
56 case 4537: // buff trigger?
57 break;
58 // OUTSIDE OF ARENA, TELEPORT!
59 case 4917:
60 case 5006:
61 case 5008:
62 player->NearTeleportTo(4054.15f, 2923.7f, 13.4f, player->GetOrientation());
63 break;
64 }
65}
@ STATUS_IN_PROGRESS
Definition: Battleground.h:197
BattlegroundStatus GetStatus() const
Definition: Battleground.h:327
float GetOrientation() const
Definition: Position.h:120
void NearTeleportTo(Position &pos, bool casting=false, bool vehicleTeleport=false, bool withPet=false, bool removeTransport=false)
Definition: Unit.cpp:19937

References Position::GetOrientation(), Battleground::GetStatus(), Unit::NearTeleportTo(), and STATUS_IN_PROGRESS.

◆ HandlePlayerUnderMap()

bool BattlegroundNA::HandlePlayerUnderMap ( Player player)
overridevirtual

Reimplemented from Battleground.

43{
44 player->NearTeleportTo(4055.504395f, 2919.660645f, 13.611241f, player->GetOrientation());
45 return true;
46}

References Position::GetOrientation(), and Unit::NearTeleportTo().

◆ SetupBattleground()

bool BattlegroundNA::SetupBattleground ( )
overridevirtual

Reimplemented from Battleground.

74{
75 // gates
76 if (!AddObject(BG_NA_OBJECT_DOOR_1, BG_NA_OBJECT_TYPE_DOOR_1, 4031.854f, 2966.833f, 12.0462f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, RESPAWN_IMMEDIATELY)
77 || !AddObject(BG_NA_OBJECT_DOOR_2, BG_NA_OBJECT_TYPE_DOOR_2, 4081.179f, 2874.97f, 12.00171f, 0.4928045f, 0, 0, 0.2439165f, 0.9697962f, RESPAWN_IMMEDIATELY)
78 || !AddObject(BG_NA_OBJECT_DOOR_3, BG_NA_OBJECT_TYPE_DOOR_3, 4023.709f, 2981.777f, 10.70117f, -2.648788f, 0, 0, 0.9697962f, -0.2439165f, RESPAWN_IMMEDIATELY)
79 || !AddObject(BG_NA_OBJECT_DOOR_4, BG_NA_OBJECT_TYPE_DOOR_4, 4090.064f, 2858.438f, 10.23631f, 0.4928045f, 0, 0, 0.2439165f, 0.9697962f, RESPAWN_IMMEDIATELY)
80 // buffs
81 || !AddObject(BG_NA_OBJECT_BUFF_1, BG_NA_OBJECT_TYPE_BUFF_1, 4009.189941f, 2895.250000f, 13.052700f, -1.448624f, 0, 0, 0.6626201f, -0.7489557f, 120)
82 || !AddObject(BG_NA_OBJECT_BUFF_2, BG_NA_OBJECT_TYPE_BUFF_2, 4103.330078f, 2946.350098f, 13.051300f, -0.06981307f, 0, 0, 0.03489945f, -0.9993908f, 120)
83 // Arena Ready Marker
84 || !AddObject(BG_NA_OBJECT_READY_MARKER_1, ARENA_READY_MARKER_ENTRY, 4090.46f, 2875.43f, 12.16f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 300)
85 || !AddObject(BG_NA_OBJECT_READY_MARKER_2, ARENA_READY_MARKER_ENTRY, 4022.82f, 2966.61f, 12.17f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 300))
86 {
87 LOG_ERROR("sql.sql", "BatteGroundNA: Failed to spawn some object!");
88 return false;
89 }
90
91 return true;
92}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:156
@ BG_NA_OBJECT_DOOR_1
Definition: BattlegroundNA.h:25
@ BG_NA_OBJECT_DOOR_4
Definition: BattlegroundNA.h:28
@ BG_NA_OBJECT_BUFF_2
Definition: BattlegroundNA.h:30
@ BG_NA_OBJECT_DOOR_2
Definition: BattlegroundNA.h:26
@ BG_NA_OBJECT_READY_MARKER_1
Definition: BattlegroundNA.h:31
@ BG_NA_OBJECT_BUFF_1
Definition: BattlegroundNA.h:29
@ BG_NA_OBJECT_DOOR_3
Definition: BattlegroundNA.h:27
@ BG_NA_OBJECT_READY_MARKER_2
Definition: BattlegroundNA.h:32
@ BG_NA_OBJECT_TYPE_DOOR_1
Definition: BattlegroundNA.h:38
@ BG_NA_OBJECT_TYPE_DOOR_2
Definition: BattlegroundNA.h:39
@ BG_NA_OBJECT_TYPE_BUFF_2
Definition: BattlegroundNA.h:43
@ BG_NA_OBJECT_TYPE_BUFF_1
Definition: BattlegroundNA.h:42
@ BG_NA_OBJECT_TYPE_DOOR_3
Definition: BattlegroundNA.h:40
@ BG_NA_OBJECT_TYPE_DOOR_4
Definition: BattlegroundNA.h:41
@ RESPAWN_IMMEDIATELY
Definition: Battleground.h:164
#define ARENA_READY_MARKER_ENTRY
Definition: Battleground.h:280
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:1405

References Battleground::AddObject(), ARENA_READY_MARKER_ENTRY, BG_NA_OBJECT_BUFF_1, BG_NA_OBJECT_BUFF_2, BG_NA_OBJECT_DOOR_1, BG_NA_OBJECT_DOOR_2, BG_NA_OBJECT_DOOR_3, BG_NA_OBJECT_DOOR_4, BG_NA_OBJECT_READY_MARKER_1, BG_NA_OBJECT_READY_MARKER_2, BG_NA_OBJECT_TYPE_BUFF_1, BG_NA_OBJECT_TYPE_BUFF_2, BG_NA_OBJECT_TYPE_DOOR_1, BG_NA_OBJECT_TYPE_DOOR_2, BG_NA_OBJECT_TYPE_DOOR_3, BG_NA_OBJECT_TYPE_DOOR_4, LOG_ERROR, and RESPAWN_IMMEDIATELY.

◆ StartingEventCloseDoors()

void BattlegroundNA::StartingEventCloseDoors ( )
overridevirtual

Reimplemented from Battleground.

28{
31}
void SpawnBGObject(uint32 type, uint32 respawntime, uint32 forceRespawnDelay=0)
Definition: Battleground.cpp:1507

References BG_NA_OBJECT_DOOR_1, BG_NA_OBJECT_DOOR_4, RESPAWN_IMMEDIATELY, and Battleground::SpawnBGObject().

◆ StartingEventOpenDoors()

void BattlegroundNA::StartingEventOpenDoors ( )
overridevirtual

Reimplemented from Battleground.

34{
36 DoorOpen(i);
37
39 SpawnBGObject(i, 90);
40}
void DoorOpen(uint32 type)
Definition: Battleground.cpp:1477

References BG_NA_OBJECT_BUFF_1, BG_NA_OBJECT_BUFF_2, BG_NA_OBJECT_DOOR_1, BG_NA_OBJECT_DOOR_2, Battleground::DoorOpen(), and Battleground::SpawnBGObject().