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

#include "BattlegroundEY.h"

Inheritance diagram for BattlegroundEY:
Battleground

Classes

struct  CapturePointInfo
 

Public Member Functions

 BattlegroundEY ()
 
 ~BattlegroundEY () override
 
void AddPlayer (Player *player) override
 
void StartingEventCloseDoors () override
 
void StartingEventOpenDoors () override
 
ObjectGuid GetFlagPickerGUID (TeamId=TEAM_NEUTRAL) const override
 
void SetFlagPicker (ObjectGuid guid)
 
uint8 GetFlagState () const
 
void RespawnFlag ()
 
void RespawnFlagAfterDrop ()
 
void RemovePlayer (Player *player) override
 
void HandleBuffUse (ObjectGuid buff_guid)
 
void HandleAreaTrigger (Player *player, uint32 trigger) override
 
void HandleKillPlayer (Player *player, Player *killer) override
 
GraveyardStruct const * GetClosestGraveyard (Player *player) override
 
bool SetupBattleground () override
 
void Init () override
 
void EndBattleground (TeamId winnerTeamId) override
 
bool UpdatePlayerScore (Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
 
void FillInitialWorldStates (WorldPacket &data) override
 
void SetDroppedFlagGUID (ObjectGuid guid, TeamId=TEAM_NEUTRAL) override
 
ObjectGuid GetDroppedFlagGUID () const
 
void EventPlayerClickedOnFlag (Player *player, GameObject *gameObject) override
 
void EventPlayerDroppedFlag (Player *player) override
 
bool AllNodesConrolledByTeam (TeamId teamId) const override
 
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
 
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...
 
void EventPlayerCapturedFlag (Player *Source, uint32 BgObjectType)
 
void EventTeamLostPoint (Player *player, uint32 point)
 
void EventTeamCapturedPoint (Player *player, TeamId teamId, uint32 point)
 
void UpdatePointsCount ()
 
void UpdatePointsIcons (uint32 point)
 
void UpdatePointsState ()
 
void AddPoints (TeamId teamId, uint32 points)
 

Private Attributes

CapturePointInfo _capturePointInfo [EY_POINTS_MAX]
 
EventMap _bgEvents
 
uint32 _honorTics
 
uint8 _ownedPointsCount [PVP_TEAMS_COUNT]
 
ObjectGuid _flagKeeperGUID
 
ObjectGuid _droppedFlagGUID
 
uint8 _flagState
 
uint32 _flagCapturedObject
 

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

◆ BattlegroundEY()

BattlegroundEY::BattlegroundEY ( )
37{
38 m_BuffChange = true;
41
46 _honorTics = 0;
51}
@ TEAM_ALLIANCE
Definition: SharedDefines.h:760
@ TEAM_HORDE
Definition: SharedDefines.h:761
@ AT_BLOOD_ELF_BUFF
Definition: BattlegroundEY.h:119
@ AT_MAGE_TOWER_BUFF
Definition: BattlegroundEY.h:121
@ AT_FEL_REAVER_BUFF
Definition: BattlegroundEY.h:120
@ AT_DRAENEI_RUINS_BUFF
Definition: BattlegroundEY.h:122
@ BG_EY_FLAG_STATE_ON_BASE
Definition: BattlegroundEY.h:240
@ POINT_BLOOD_ELF
Definition: BattlegroundEY.h:138
@ POINT_DRAENEI_RUINS
Definition: BattlegroundEY.h:139
@ POINT_FEL_REAVER
Definition: BattlegroundEY.h:137
@ POINT_MAGE_TOWER
Definition: BattlegroundEY.h:140
@ BG_EY_OBJECT_MAX
Definition: BattlegroundEY.h:223
@ BG_EY_CREATURES_MAX
Definition: BattlegroundEY.h:158
BGObjects BgObjects
Definition: Battleground.h:549
bool m_BuffChange
Definition: Battleground.h:644
BGCreatures BgCreatures
Definition: Battleground.h:550
uint8 _ownedPointsCount[PVP_TEAMS_COUNT]
Definition: BattlegroundEY.h:454
uint32 _honorTics
Definition: BattlegroundEY.h:453
CapturePointInfo _capturePointInfo[EY_POINTS_MAX]
Definition: BattlegroundEY.h:451
uint32 _flagCapturedObject
Definition: BattlegroundEY.h:458
uint8 _flagState
Definition: BattlegroundEY.h:457
uint32 _areaTrigger
Definition: BattlegroundEY.h:442

References BattlegroundEY::CapturePointInfo::_areaTrigger, _capturePointInfo, _flagCapturedObject, _flagState, _honorTics, _ownedPointsCount, AT_BLOOD_ELF_BUFF, AT_DRAENEI_RUINS_BUFF, AT_FEL_REAVER_BUFF, AT_MAGE_TOWER_BUFF, BG_EY_CREATURES_MAX, BG_EY_FLAG_STATE_ON_BASE, BG_EY_OBJECT_MAX, Battleground::BgCreatures, Battleground::BgObjects, Battleground::m_BuffChange, POINT_BLOOD_ELF, POINT_DRAENEI_RUINS, POINT_FEL_REAVER, POINT_MAGE_TOWER, TEAM_ALLIANCE, and TEAM_HORDE.

◆ ~BattlegroundEY()

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

Member Function Documentation

◆ AddPlayer()

void BattlegroundEY::AddPlayer ( Player player)
overridevirtual

Reimplemented from Battleground.

210{
212 PlayerScores.emplace(player->GetGUID().GetCounter(), new BattlegroundEYScore(player->GetGUID()));
213}
virtual void AddPlayer(Player *player)
Definition: Battleground.cpp:1115
BattlegroundScoreMap PlayerScores
Definition: Battleground.h:629
Definition: BattlegroundEY.h:352
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 BattlegroundEY::AddPoints ( TeamId  teamId,
uint32  points 
)
private
113{
114 uint8 honorRewards = uint8(m_TeamScores[teamId] / _honorTics);
115 m_TeamScores[teamId] += points;
118
119 for (; honorRewards < uint8(m_TeamScores[teamId] / _honorTics); ++honorRewards)
121
123 if (m_TeamScores[teamId] >= BG_EY_MAX_TEAM_SCORE)
124 EndBattleground(teamId);
125}
std::uint8_t uint8
Definition: Define.h:109
@ BG_EY_MAX_TEAM_SCORE
Definition: BattlegroundEY.h:229
@ EY_HORDE_RESOURCES
Definition: BattlegroundEY.h:44
@ EY_ALLIANCE_RESOURCES
Definition: BattlegroundEY.h:43
int32 m_TeamScores[PVP_TEAMS_COUNT]
Definition: Battleground.h:648
void UpdateWorldState(uint32 variable, uint32 value)
Definition: Battleground.cpp:779
uint32 GetBonusHonorFromKill(uint32 kills) const
Definition: Battleground.cpp:959
void RewardHonorToTeam(uint32 honor, TeamId teamId)
Definition: Battleground.cpp:729
void EndBattleground(TeamId winnerTeamId) override
Definition: BattlegroundEY.cpp:179

References _honorTics, BG_EY_MAX_TEAM_SCORE, EndBattleground(), EY_ALLIANCE_RESOURCES, EY_HORDE_RESOURCES, Battleground::GetBonusHonorFromKill(), Battleground::m_TeamScores, Battleground::RewardHonorToTeam(), TEAM_ALLIANCE, and Battleground::UpdateWorldState().

Referenced by EventPlayerCapturedFlag(), and PostUpdateImpl().

◆ AllNodesConrolledByTeam()

bool BattlegroundEY::AllNodesConrolledByTeam ( TeamId  teamId) const
overridevirtual

Reimplemented from Battleground.

624{
625 uint32 count = 0;
626 for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
627 if (_capturePointInfo[i].IsUnderControl(teamId))
628 ++count;
629
630 return count == EY_POINTS_MAX;
631}
std::uint32_t uint32
Definition: Define.h:107
@ EY_POINTS_MAX
Definition: BattlegroundEY.h:141

References _capturePointInfo, and EY_POINTS_MAX.

◆ EndBattleground()

void BattlegroundEY::EndBattleground ( TeamId  winnerTeamId)
overridevirtual

◆ EventPlayerCapturedFlag()

void BattlegroundEY::EventPlayerCapturedFlag ( Player Source,
uint32  BgObjectType 
)
private
528{
531 player->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
532 player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
533
534 SpawnBGObject(BgObjectType, RESPAWN_IMMEDIATELY);
536 _flagCapturedObject = BgObjectType;
537
538 if (player->GetTeamId() == TEAM_ALLIANCE)
539 {
542 }
543 else
544 {
547 }
548
550 if (_ownedPointsCount[player->GetTeamId()] > 0)
551 AddPoints(player->GetTeamId(), BG_EY_FlagPoints[_ownedPointsCount[player->GetTeamId()] - 1]);
552}
@ 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
@ RESPAWN_IMMEDIATELY
Definition: Battleground.h:169
@ BG_EY_TEXT_ALLIANCE_CAPTURED_FLAG
Definition: BattlegroundEY.h:270
@ BG_EY_TEXT_HORDE_CAPTURED_FLAG
Definition: BattlegroundEY.h:271
const uint32 BG_EY_FlagPoints[EY_POINTS_MAX]
Definition: BattlegroundEY.h:324
@ BG_EY_FLAG_RESPAWN_TIME
Definition: BattlegroundEY.h:35
@ BG_EY_SOUND_FLAG_CAPTURED_HORDE
Definition: BattlegroundEY.h:85
@ BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE
Definition: BattlegroundEY.h:87
@ BG_EY_NETHERSTORM_FLAG_SPELL
Definition: BattlegroundEY.h:93
@ BG_EY_EVENT_RESPAWN_FLAG
Definition: BattlegroundEY.h:29
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:1509
void SendBroadcastText(uint32 id, ChatMsg msgType, WorldObject const *target=nullptr)
Definition: Battleground.cpp:687
void PlaySoundToAll(uint32 soundId)
Definition: Battleground.cpp:700
void SetFlagPicker(ObjectGuid guid)
Definition: BattlegroundEY.h:391
void AddPoints(TeamId teamId, uint32 points)
Definition: BattlegroundEY.cpp:112
EventMap _bgEvents
Definition: BattlegroundEY.h:452
bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true) override
Definition: BattlegroundEY.cpp:554
static ObjectGuid const Empty
Definition: ObjectGuid.h:120

References _bgEvents, _flagCapturedObject, _flagState, _ownedPointsCount, AddPoints(), AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT, BG_EY_EVENT_RESPAWN_FLAG, BG_EY_FLAG_RESPAWN_TIME, BG_EY_FLAG_STATE_ON_BASE, BG_EY_FlagPoints, BG_EY_NETHERSTORM_FLAG_SPELL, BG_EY_SOUND_FLAG_CAPTURED_ALLIANCE, BG_EY_SOUND_FLAG_CAPTURED_HORDE, BG_EY_TEXT_ALLIANCE_CAPTURED_FLAG, BG_EY_TEXT_HORDE_CAPTURED_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, ObjectGuid::Empty, Player::GetTeamId(), Battleground::PlaySoundToAll(), Unit::RemoveAurasDueToSpell(), Unit::RemoveAurasWithInterruptFlags(), EventMap::RescheduleEvent(), RESPAWN_IMMEDIATELY, SCORE_FLAG_CAPTURES, Battleground::SendBroadcastText(), SetFlagPicker(), Battleground::SpawnBGObject(), TEAM_ALLIANCE, and UpdatePlayerScore().

Referenced by HandleAreaTrigger().

◆ EventPlayerClickedOnFlag()

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

Reimplemented from Battleground.

426{
427 if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() || !player->IsWithinDistInMap(gameObject, 10.0f))
428 return;
429
432 SetFlagPicker(player->GetGUID());
434
435 player->CastSpell(player, BG_EY_NETHERSTORM_FLAG_SPELL, true);
437
440
441 if (player->GetTeamId() == TEAM_ALLIANCE)
443 else
445}
@ RESPAWN_ONE_DAY
Definition: Battleground.h:168
@ STATUS_IN_PROGRESS
Definition: Battleground.h:202
@ BG_EY_FLAG_STATE_ON_PLAYER
Definition: BattlegroundEY.h:241
@ BG_EY_OBJECT_FLAG_NETHERSTORM
Definition: BattlegroundEY.h:205
@ NETHERSTORM_FLAG
Definition: BattlegroundEY.h:62
@ BG_EY_TEXT_TAKEN_FLAG
Definition: BattlegroundEY.h:267
@ BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE
Definition: BattlegroundEY.h:84
@ BG_EY_SOUND_FLAG_PICKED_UP_HORDE
Definition: BattlegroundEY.h:86
BattlegroundStatus GetStatus() const
Definition: Battleground.h:332
void SetDroppedFlagGUID(ObjectGuid guid, TeamId=TEAM_NEUTRAL) override
Definition: BattlegroundEY.h:406
ObjectGuid GetFlagPickerGUID(TeamId=TEAM_NEUTRAL) const override
Definition: BattlegroundEY.h:390
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1332
TeamId GetTeamId(bool original=false) const
Definition: Player.h:2108
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
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0, bool isAutoshot=false)
Definition: Unit.cpp:5181

References _flagState, AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT, BG_EY_FLAG_STATE_ON_PLAYER, BG_EY_NETHERSTORM_FLAG_SPELL, BG_EY_OBJECT_FLAG_NETHERSTORM, BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE, BG_EY_SOUND_FLAG_PICKED_UP_HORDE, BG_EY_TEXT_TAKEN_FLAG, Unit::CastSpell(), CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, ObjectGuid::Empty, GetFlagPickerGUID(), Object::GetGUID(), Battleground::GetStatus(), Player::GetTeamId(), WorldObject::IsWithinDistInMap(), NETHERSTORM_FLAG, Battleground::PlaySoundToAll(), Unit::RemoveAurasWithInterruptFlags(), RESPAWN_ONE_DAY, Battleground::SendBroadcastText(), SetDroppedFlagGUID(), SetFlagPicker(), Battleground::SpawnBGObject(), STATUS_IN_PROGRESS, TEAM_ALLIANCE, and Battleground::UpdateWorldState().

◆ EventPlayerDroppedFlag()

void BattlegroundEY::EventPlayerDroppedFlag ( Player player)
overridevirtual

Reimplemented from Battleground.

404{
405 if (GetFlagPickerGUID() != player->GetGUID())
406 return;
407
411 return;
412
415
416 player->CastSpell(player, SPELL_RECENTLY_DROPPED_FLAG, true);
417 player->CastSpell(player, BG_EY_PLAYER_DROPPED_FLAG_SPELL, true);
418
419 if (player->GetTeamId() == TEAM_ALLIANCE)
421 else
423}
@ SPELL_RECENTLY_DROPPED_FLAG
Definition: Battleground.h:144
@ BG_EY_FLAG_STATE_ON_GROUND
Definition: BattlegroundEY.h:242
@ BG_EY_TEXT_FLAG_DROPPED
Definition: BattlegroundEY.h:268
@ BG_EY_FLAG_ON_GROUND_TIME
Definition: BattlegroundEY.h:36
@ BG_EY_PLAYER_DROPPED_FLAG_SPELL
Definition: BattlegroundEY.h:94
@ BG_EY_EVENT_FLAG_ON_GROUND
Definition: BattlegroundEY.h:28
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:4909

References _bgEvents, _flagState, BG_EY_EVENT_FLAG_ON_GROUND, BG_EY_FLAG_ON_GROUND_TIME, BG_EY_FLAG_STATE_ON_GROUND, BG_EY_NETHERSTORM_FLAG_SPELL, BG_EY_PLAYER_DROPPED_FLAG_SPELL, BG_EY_TEXT_FLAG_DROPPED, Unit::CastSpell(), CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, ObjectGuid::Empty, GetFlagPickerGUID(), Object::GetGUID(), Battleground::GetStatus(), Player::GetTeamId(), Unit::RemoveAurasDueToSpell(), EventMap::RescheduleEvent(), Battleground::SendBroadcastText(), SetFlagPicker(), SPELL_RECENTLY_DROPPED_FLAG, STATUS_IN_PROGRESS, and TEAM_ALLIANCE.

Referenced by HandleKillPlayer(), and RemovePlayer().

◆ EventTeamCapturedPoint()

void BattlegroundEY::EventTeamCapturedPoint ( Player player,
TeamId  teamId,
uint32  point 
)
private
485{
486 SpawnBGObject(m_CapturingPointTypes[point].DespawnNeutralObjectType, RESPAWN_ONE_DAY);
487 SpawnBGObject(m_CapturingPointTypes[point].DespawnNeutralObjectType + 1, RESPAWN_ONE_DAY);
488 SpawnBGObject(m_CapturingPointTypes[point].DespawnNeutralObjectType + 2, RESPAWN_ONE_DAY);
489
490 if (teamId == TEAM_ALLIANCE)
491 {
493 SpawnBGObject(m_CapturingPointTypes[point].SpawnObjectTypeAlliance, RESPAWN_IMMEDIATELY);
494 SpawnBGObject(m_CapturingPointTypes[point].SpawnObjectTypeAlliance + 1, RESPAWN_IMMEDIATELY);
495 SpawnBGObject(m_CapturingPointTypes[point].SpawnObjectTypeAlliance + 2, RESPAWN_IMMEDIATELY);
497 }
498 else
499 {
501 SpawnBGObject(m_CapturingPointTypes[point].SpawnObjectTypeHorde, RESPAWN_IMMEDIATELY);
502 SpawnBGObject(m_CapturingPointTypes[point].SpawnObjectTypeHorde + 1, RESPAWN_IMMEDIATELY);
503 SpawnBGObject(m_CapturingPointTypes[point].SpawnObjectTypeHorde + 2, RESPAWN_IMMEDIATELY);
505 }
506
507 _capturePointInfo[point]._ownerTeamId = teamId;
508
509 GraveyardStruct const* sg = sGraveyard->GetGraveyard(m_CapturingPointTypes[point].GraveYardId);
510 AddSpiritGuide(point, sg->x, sg->y, sg->z, 3.124139f, teamId);
511
512 UpdatePointsIcons(point);
514
515 // Xinef: done this way to avoid errors in console
517 if (!trigger)
519
520 if (trigger)
521 {
523 trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, true);
524 }
525}
@ FACTION_ALLIANCE_GENERIC
Definition: SharedDefines.h:206
@ FACTION_HORDE_GENERIC
Definition: SharedDefines.h:205
#define sGraveyard
Definition: GameGraveyard.h:74
#define WORLD_TRIGGER
Definition: Unit.h:37
@ SPELL_HONORABLE_DEFENDER_25Y
Definition: Battleground.h:146
@ BG_EY_TRIGGER_FEL_REAVER
Definition: BattlegroundEY.h:153
const BattlegroundEYCapturingPointStruct m_CapturingPointTypes[EY_POINTS_MAX]
Definition: BattlegroundEY.h:343
const float BG_EY_TriggerPositions[EY_POINTS_MAX][4]
Definition: BattlegroundEY.h:283
bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, TeamId teamId)
Definition: Battleground.cpp:1631
BattlegroundMap * GetBgMap() const
Definition: Battleground.h:449
Creature * AddCreature(uint32 entry, uint32 type, float x, float y, float z, float o, uint32 respawntime=0, MotionTransport *transport=nullptr)
Definition: Battleground.cpp:1529
void UpdatePointsCount()
Definition: BattlegroundEY.cpp:187
void UpdatePointsIcons(uint32 point)
Definition: BattlegroundEY.cpp:193
TeamId _ownerTeamId
Definition: BattlegroundEY.h:440
Definition: Creature.h:43
void SetFaction(uint32 faction)
Definition: Unit.cpp:10056
Creature * GetCreature(ObjectGuid const guid)
Definition: Map.cpp:3317
Definition: GameGraveyard.h:27
float z
Definition: GameGraveyard.h:32
float x
Definition: GameGraveyard.h:30
float y
Definition: GameGraveyard.h:31

References _capturePointInfo, _ownedPointsCount, BattlegroundEY::CapturePointInfo::_ownerTeamId, Battleground::AddCreature(), Battleground::AddSpiritGuide(), BG_EY_TRIGGER_FEL_REAVER, BG_EY_TriggerPositions, Battleground::BgCreatures, Unit::CastSpell(), CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, FACTION_ALLIANCE_GENERIC, FACTION_HORDE_GENERIC, Battleground::GetBgMap(), Map::GetCreature(), m_CapturingPointTypes, RESPAWN_IMMEDIATELY, RESPAWN_ONE_DAY, Battleground::SendBroadcastText(), Unit::SetFaction(), sGraveyard, Battleground::SpawnBGObject(), SPELL_HONORABLE_DEFENDER_25Y, TEAM_ALLIANCE, TEAM_HORDE, UpdatePointsCount(), UpdatePointsIcons(), WORLD_TRIGGER, GraveyardStruct::x, GraveyardStruct::y, and GraveyardStruct::z.

Referenced by UpdatePointsState().

◆ EventTeamLostPoint()

void BattlegroundEY::EventTeamLostPoint ( Player player,
uint32  point 
)
private
448{
449 TeamId oldTeamId = _capturePointInfo[point]._ownerTeamId;
450 if (oldTeamId == TEAM_ALLIANCE)
451 {
453 SpawnBGObject(m_LosingPointTypes[point].DespawnObjectTypeAlliance, RESPAWN_ONE_DAY);
454 SpawnBGObject(m_LosingPointTypes[point].DespawnObjectTypeAlliance + 1, RESPAWN_ONE_DAY);
455 SpawnBGObject(m_LosingPointTypes[point].DespawnObjectTypeAlliance + 2, RESPAWN_ONE_DAY);
456 SendBroadcastText(m_LosingPointTypes[point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, player);
457 }
458 else
459 {
461 SpawnBGObject(m_LosingPointTypes[point].DespawnObjectTypeHorde, RESPAWN_ONE_DAY);
462 SpawnBGObject(m_LosingPointTypes[point].DespawnObjectTypeHorde + 1, RESPAWN_ONE_DAY);
463 SpawnBGObject(m_LosingPointTypes[point].DespawnObjectTypeHorde + 2, RESPAWN_ONE_DAY);
464 SendBroadcastText(m_LosingPointTypes[point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, player);
465 }
466
467 SpawnBGObject(m_LosingPointTypes[point].SpawnNeutralObjectType, RESPAWN_IMMEDIATELY);
468 SpawnBGObject(m_LosingPointTypes[point].SpawnNeutralObjectType + 1, RESPAWN_IMMEDIATELY);
469 SpawnBGObject(m_LosingPointTypes[point].SpawnNeutralObjectType + 2, RESPAWN_IMMEDIATELY);
470
472
473 UpdatePointsIcons(point);
476
477 _reviveEvents.AddEventAtOffset([this, point]()
478 {
480 DelCreature(point);
481 }, 500ms);
482}
TeamId
Definition: SharedDefines.h:759
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
const BattlegroundEYLosingPointStruct m_LosingPointTypes[EY_POINTS_MAX]
Definition: BattlegroundEY.h:335
void AddEventAtOffset(BasicEvent *event, Milliseconds offset)
Definition: EventProcessor.h:107
bool DelCreature(uint32 type)
Definition: Battleground.cpp:1592
void RelocateDeadPlayers(ObjectGuid queueIndex)
Relocate all players in ReviveQueue to the closest graveyard.
Definition: Battleground.cpp:1383
EventProcessor _reviveEvents
Definition: Battleground.h:655

References _capturePointInfo, _ownedPointsCount, BattlegroundEY::CapturePointInfo::_ownerTeamId, Battleground::_reviveEvents, EventProcessor::AddEventAtOffset(), BG_EY_TRIGGER_FEL_REAVER, Battleground::BgCreatures, CHAT_MSG_BG_SYSTEM_ALLIANCE, CHAT_MSG_BG_SYSTEM_HORDE, Battleground::DelCreature(), m_LosingPointTypes, Battleground::RelocateDeadPlayers(), RESPAWN_IMMEDIATELY, RESPAWN_ONE_DAY, Battleground::SendBroadcastText(), Battleground::SpawnBGObject(), TEAM_ALLIANCE, TEAM_HORDE, TEAM_NEUTRAL, UpdatePointsCount(), and UpdatePointsIcons().

Referenced by UpdatePointsState().

◆ FillInitialWorldStates()

void BattlegroundEY::FillInitialWorldStates ( WorldPacket data)
overridevirtual

Reimplemented from Battleground.

572{
592 data << uint32(PROGRESS_BAR_SHOW) << uint32(0);
594 data << uint32(PROGRESS_BAR_STATUS) << uint32(0);
595}
@ BLOOD_ELF_HORDE_CONTROL
Definition: BattlegroundEY.h:56
@ NETHERSTORM_FLAG_STATE_ALLIANCE
Definition: BattlegroundEY.h:64
@ BLOOD_ELF_UNCONTROL
Definition: BattlegroundEY.h:58
@ FEL_REAVER_UNCONTROL
Definition: BattlegroundEY.h:55
@ MAGE_TOWER_ALLIANCE_CONTROL
Definition: BattlegroundEY.h:50
@ PROGRESS_BAR_SHOW
Definition: BattlegroundEY.h:61
@ EY_ALLIANCE_BASE
Definition: BattlegroundEY.h:45
@ FEL_REAVER_ALLIANCE_CONTROL
Definition: BattlegroundEY.h:54
@ DRAENEI_RUINS_UNCONTROL
Definition: BattlegroundEY.h:49
@ NETHERSTORM_FLAG_STATE_HORDE
Definition: BattlegroundEY.h:65
@ DRAENEI_RUINS_ALLIANCE_CONTROL
Definition: BattlegroundEY.h:48
@ BLOOD_ELF_ALLIANCE_CONTROL
Definition: BattlegroundEY.h:57
@ DRAENEI_RUINS_HORDE_CONTROL
Definition: BattlegroundEY.h:47
@ EY_HORDE_BASE
Definition: BattlegroundEY.h:46
@ MAGE_TOWER_HORDE_CONTROL
Definition: BattlegroundEY.h:51
@ PROGRESS_BAR_PERCENT_GREY
Definition: BattlegroundEY.h:59
@ MAGE_TOWER_UNCONTROL
Definition: BattlegroundEY.h:52
@ PROGRESS_BAR_STATUS
Definition: BattlegroundEY.h:60
@ FEL_REAVER_HORDE_CONTROL
Definition: BattlegroundEY.h:53
uint32 GetTeamScore(TeamId teamId) const
Definition: Battleground.cpp:1837

References _capturePointInfo, _flagState, _ownedPointsCount, BG_EY_FLAG_STATE_ON_BASE, BLOOD_ELF_ALLIANCE_CONTROL, BLOOD_ELF_HORDE_CONTROL, BLOOD_ELF_UNCONTROL, DRAENEI_RUINS_ALLIANCE_CONTROL, DRAENEI_RUINS_HORDE_CONTROL, DRAENEI_RUINS_UNCONTROL, EY_ALLIANCE_BASE, EY_ALLIANCE_RESOURCES, EY_HORDE_BASE, EY_HORDE_RESOURCES, FEL_REAVER_ALLIANCE_CONTROL, FEL_REAVER_HORDE_CONTROL, FEL_REAVER_UNCONTROL, Battleground::GetTeamScore(), MAGE_TOWER_ALLIANCE_CONTROL, MAGE_TOWER_HORDE_CONTROL, MAGE_TOWER_UNCONTROL, NETHERSTORM_FLAG, NETHERSTORM_FLAG_STATE_ALLIANCE, NETHERSTORM_FLAG_STATE_HORDE, POINT_BLOOD_ELF, POINT_DRAENEI_RUINS, POINT_FEL_REAVER, POINT_MAGE_TOWER, PROGRESS_BAR_PERCENT_GREY, PROGRESS_BAR_SHOW, PROGRESS_BAR_STATUS, TEAM_ALLIANCE, and TEAM_HORDE.

◆ GetClosestGraveyard()

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

Reimplemented from Battleground.

598{
599 GraveyardStruct const* entry = sGraveyard->GetGraveyard(static_cast<uint16>(BG_EY_GRAVEYARD_MAIN_ALLIANCE) + player->GetTeamId());
600 GraveyardStruct const* nearestEntry = entry;
601
602 float pX = player->GetPositionX();
603 float pY = player->GetPositionY();
604 float pZ = player->GetPositionZ();
605 float dist = (entry->x - pX) * (entry->x - pX) + (entry->y - pY) * (entry->y - pY) + (entry->z - pZ) * (entry->z - pZ);
606 float minDist = dist;
607
608 for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
609 if (_capturePointInfo[i].IsUnderControl(player->GetTeamId()))
610 {
611 entry = sGraveyard->GetGraveyard(m_CapturingPointTypes[i].GraveYardId);
612 dist = (entry->x - pX) * (entry->x - pX) + (entry->y - pY) * (entry->y - pY) + (entry->z - pZ) * (entry->z - pZ);
613 if (dist < minDist)
614 {
615 minDist = dist;
616 nearestEntry = entry;
617 }
618 }
619
620 return nearestEntry;
621}
std::uint16_t uint16
Definition: Define.h:108
@ BG_EY_GRAVEYARD_MAIN_ALLIANCE
Definition: BattlegroundEY.h:127
float GetPositionZ() const
Definition: Position.h:118
float GetPositionX() const
Definition: Position.h:116
float GetPositionY() const
Definition: Position.h:117

References _capturePointInfo, BG_EY_GRAVEYARD_MAIN_ALLIANCE, EY_POINTS_MAX, Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), Player::GetTeamId(), m_CapturingPointTypes, sGraveyard, GraveyardStruct::x, GraveyardStruct::y, and GraveyardStruct::z.

◆ GetDroppedFlagGUID()

ObjectGuid BattlegroundEY::GetDroppedFlagGUID ( ) const
inline
407{ return _droppedFlagGUID; }
ObjectGuid _droppedFlagGUID
Definition: BattlegroundEY.h:456

Referenced by RespawnFlagAfterDrop().

◆ GetFlagPickerGUID()

ObjectGuid BattlegroundEY::GetFlagPickerGUID ( TeamId  = TEAM_NEUTRAL) const
inlineoverridevirtual

Reimplemented from Battleground.

390{ return _flagKeeperGUID; }
ObjectGuid _flagKeeperGUID
Definition: BattlegroundEY.h:455

Referenced by EventPlayerClickedOnFlag(), EventPlayerDroppedFlag(), HandleAreaTrigger(), and RemovePlayer().

◆ GetFlagState()

uint8 BattlegroundEY::GetFlagState ( ) const
inline
392{ return _flagState; }

◆ GetPrematureWinner()

TeamId BattlegroundEY::GetPrematureWinner ( )
overridevirtual

◆ HandleAreaTrigger()

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

Reimplemented from Battleground.

222{
223 if (GetStatus() != STATUS_IN_PROGRESS || !player->IsAlive())
224 return;
225
226 switch (trigger)
227 {
229 if (_capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(player->GetTeamId()))
232 break;
234 if (_capturePointInfo[POINT_FEL_REAVER].IsUnderControl(player->GetTeamId()))
237 break;
239 if (_capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(player->GetTeamId()))
242 break;
244 if (_capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(player->GetTeamId()))
247 break;
248 case 4512:
249 case 4515:
250 case 4517:
251 case 4519:
252 case 4530:
253 case 4531:
254 case 5866:
259 break;
260 }
261}
@ AT_MAGE_TOWER_POINT
Definition: BattlegroundEY.h:117
@ AT_FEL_REAVER_POINT
Definition: BattlegroundEY.h:116
@ AT_BLOOD_ELF_POINT
Definition: BattlegroundEY.h:115
@ AT_DRAENEI_RUINS_POINT
Definition: BattlegroundEY.h:118
@ BG_EY_OBJECT_FLAG_BLOOD_ELF
Definition: BattlegroundEY.h:207
@ BG_EY_OBJECT_FLAG_FEL_REAVER
Definition: BattlegroundEY.h:206
@ BG_EY_OBJECT_FLAG_MAGE_TOWER
Definition: BattlegroundEY.h:209
@ BG_EY_OBJECT_FLAG_DRAENEI_RUINS
Definition: BattlegroundEY.h:208
void EventPlayerCapturedFlag(Player *Source, uint32 BgObjectType)
Definition: BattlegroundEY.cpp:527
bool IsAlive() const
Definition: Unit.h:1654

References _capturePointInfo, _flagState, AT_BLOOD_ELF_BUFF, AT_BLOOD_ELF_POINT, AT_DRAENEI_RUINS_BUFF, AT_DRAENEI_RUINS_POINT, AT_FEL_REAVER_BUFF, AT_FEL_REAVER_POINT, AT_MAGE_TOWER_BUFF, AT_MAGE_TOWER_POINT, BG_EY_FLAG_STATE_ON_PLAYER, BG_EY_OBJECT_FLAG_BLOOD_ELF, BG_EY_OBJECT_FLAG_DRAENEI_RUINS, BG_EY_OBJECT_FLAG_FEL_REAVER, BG_EY_OBJECT_FLAG_MAGE_TOWER, EventPlayerCapturedFlag(), GetFlagPickerGUID(), Object::GetGUID(), Battleground::GetStatus(), Player::GetTeamId(), Unit::IsAlive(), POINT_BLOOD_ELF, POINT_DRAENEI_RUINS, POINT_FEL_REAVER, POINT_MAGE_TOWER, and STATUS_IN_PROGRESS.

Referenced by UpdatePointsState().

◆ HandleBuffUse()

void BattlegroundEY::HandleBuffUse ( ObjectGuid  buff_guid)

◆ HandleKillPlayer()

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

Reimplemented from Battleground.

395{
397 return;
398
399 Battleground::HandleKillPlayer(player, killer);
401}
virtual void HandleKillPlayer(Player *player, Player *killer)
Definition: Battleground.cpp:1719
void EventPlayerDroppedFlag(Player *player) override
Definition: BattlegroundEY.cpp:403

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

◆ Init()

void BattlegroundEY::Init ( )
overridevirtual

Reimplemented from Battleground.

352{
353 //call parent's class reset
355
364}
@ BG_EY_HONOR_TICK_NORMAL
Definition: BattlegroundEY.h:232
@ BG_EY_HONOR_TICK_WEEKEND
Definition: BattlegroundEY.h:231
void Reset()
Definition: EventMap.cpp:21
virtual void Init()
Definition: Battleground.cpp:1066
BattlegroundTypeId GetBgTypeID(bool GetRandom=false) const
Definition: Battleground.h:329
static bool IsBGWeekend(BattlegroundTypeId bgTypeId)
Definition: BattlegroundMgr.cpp:896
void Clear()
Definition: ObjectGuid.h:138

References _bgEvents, _droppedFlagGUID, _flagCapturedObject, _flagKeeperGUID, _flagState, _honorTics, _ownedPointsCount, BG_EY_FLAG_STATE_ON_BASE, BG_EY_HONOR_TICK_NORMAL, BG_EY_HONOR_TICK_WEEKEND, ObjectGuid::Clear(), Battleground::GetBgTypeID(), Battleground::Init(), BattlegroundMgr::IsBGWeekend(), EventMap::Reset(), TEAM_ALLIANCE, and TEAM_HORDE.

◆ PostUpdateImpl()

void BattlegroundEY::PostUpdateImpl ( uint32  )
overrideprivatevirtual

Post-update hook.

Will be called after battleground update has passed. May be used to implement custom update effects in subclasses.

Parameters
diffa time difference between two worldserver update loops in milliseconds.
See also
Update(), PreUpdateImpl().

Reimplemented from Battleground.

58{
60 {
61 _bgEvents.Update(diff);
62 while (uint32 eventId = _bgEvents.ExecuteEvent())
63 switch (eventId)
64 {
71 break;
74 break;
77 break;
81 break;
82 }
83 }
84}
@ BG_EY_FPOINTS_CHECK_TIME
Definition: BattlegroundEY.h:37
@ BG_EY_FPOINTS_TICK_TIME
Definition: BattlegroundEY.h:38
const uint32 BG_EY_TickPoints[EY_POINTS_MAX]
Definition: BattlegroundEY.h:323
@ BG_EY_EVENT_CHECK_CPOINTS
Definition: BattlegroundEY.h:30
@ BG_EY_EVENT_ADD_POINTS
Definition: BattlegroundEY.h:27
Milliseconds GetGameTimeMS()
Definition: GameTime.cpp:43
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 RespawnFlag()
Definition: BattlegroundEY.cpp:366
void RespawnFlagAfterDrop()
Definition: BattlegroundEY.cpp:382
void UpdatePointsState()
Definition: BattlegroundEY.cpp:127

References _bgEvents, _ownedPointsCount, AddPoints(), BG_EY_EVENT_ADD_POINTS, BG_EY_EVENT_CHECK_CPOINTS, BG_EY_EVENT_FLAG_ON_GROUND, BG_EY_EVENT_RESPAWN_FLAG, BG_EY_FPOINTS_CHECK_TIME, BG_EY_FPOINTS_TICK_TIME, BG_EY_TickPoints, EventMap::ExecuteEvent(), GameTime::GetGameTimeMS(), Battleground::GetStatus(), RespawnFlag(), RespawnFlagAfterDrop(), EventMap::ScheduleEvent(), STATUS_IN_PROGRESS, TEAM_ALLIANCE, TEAM_HORDE, EventMap::Update(), and UpdatePointsState().

◆ RemovePlayer()

void BattlegroundEY::RemovePlayer ( Player player)
overridevirtual

Reimplemented from Battleground.

216{
217 if (GetFlagPickerGUID() == player->GetGUID())
219}

References EventPlayerDroppedFlag(), GetFlagPickerGUID(), and Object::GetGUID().

◆ RespawnFlag()

◆ RespawnFlagAfterDrop()

void BattlegroundEY::RespawnFlagAfterDrop ( )
383{
385 return;
386
388 RespawnFlag();
390 flag->Delete();
392}
GameObject * GetGameObject(WorldObject const &u, ObjectGuid const guid)
Definition: ObjectAccessor.cpp:184
BattlegroundMap * FindBgMap() const
Definition: Battleground.h:450
ObjectGuid GetDroppedFlagGUID() const
Definition: BattlegroundEY.h:407
Definition: GameObject.h:120

References _flagState, BG_EY_FLAG_STATE_ON_BASE, BG_EY_FLAG_STATE_ON_GROUND, ObjectGuid::Empty, Battleground::FindBgMap(), GetDroppedFlagGUID(), RespawnFlag(), and SetDroppedFlagGUID().

Referenced by PostUpdateImpl().

◆ SetDroppedFlagGUID()

void BattlegroundEY::SetDroppedFlagGUID ( ObjectGuid  guid,
TeamId  = TEAM_NEUTRAL 
)
inlineoverridevirtual

Reimplemented from Battleground.

406{ _droppedFlagGUID = guid; }

Referenced by EventPlayerClickedOnFlag(), and RespawnFlagAfterDrop().

◆ SetFlagPicker()

void BattlegroundEY::SetFlagPicker ( ObjectGuid  guid)
inline

◆ SetupBattleground()

bool BattlegroundEY::SetupBattleground ( )
overridevirtual

Reimplemented from Battleground.

264{
265 // doors
266 AddObject(BG_EY_OBJECT_DOOR_A, BG_OBJECT_A_DOOR_EY_ENTRY, 2527.6f, 1596.91f, 1262.13f, -3.12414f, -0.173642f, -0.001515f, 0.98477f, -0.008594f, RESPAWN_IMMEDIATELY);
267 AddObject(BG_EY_OBJECT_DOOR_H, BG_OBJECT_H_DOOR_EY_ENTRY, 1803.21f, 1539.49f, 1261.09f, 3.14159f, 0.173648f, 0, 0.984808f, 0, RESPAWN_IMMEDIATELY);
268 // banners (alliance)
269 AddObject(BG_EY_OBJECT_A_BANNER_FEL_REAVER_CENTER, BG_OBJECT_A_BANNER_EY_ENTRY, 2057.46f, 1735.07f, 1187.91f, -0.925024f, 0, 0, 0.446198f, -0.894934f, RESPAWN_ONE_DAY);
270 AddObject(BG_EY_OBJECT_A_BANNER_FEL_REAVER_LEFT, BG_OBJECT_A_BANNER_EY_ENTRY, 2032.25f, 1729.53f, 1190.33f, 1.8675f, 0, 0, 0.803857f, 0.594823f, RESPAWN_ONE_DAY);
271 AddObject(BG_EY_OBJECT_A_BANNER_FEL_REAVER_RIGHT, BG_OBJECT_A_BANNER_EY_ENTRY, 2092.35f, 1775.46f, 1187.08f, -0.401426f, 0, 0, 0.199368f, -0.979925f, RESPAWN_ONE_DAY);
272 AddObject(BG_EY_OBJECT_A_BANNER_BLOOD_ELF_CENTER, BG_OBJECT_A_BANNER_EY_ENTRY, 2047.19f, 1349.19f, 1189.0f, -1.62316f, 0, 0, 0.725374f, -0.688354f, RESPAWN_ONE_DAY);
273 AddObject(BG_EY_OBJECT_A_BANNER_BLOOD_ELF_LEFT, BG_OBJECT_A_BANNER_EY_ENTRY, 2074.32f, 1385.78f, 1194.72f, 0.488692f, 0, 0, 0.241922f, 0.970296f, RESPAWN_ONE_DAY);
274 AddObject(BG_EY_OBJECT_A_BANNER_BLOOD_ELF_RIGHT, BG_OBJECT_A_BANNER_EY_ENTRY, 2025.13f, 1386.12f, 1192.74f, 2.3911f, 0, 0, 0.930418f, 0.366501f, RESPAWN_ONE_DAY);
275 AddObject(BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_CENTER, BG_OBJECT_A_BANNER_EY_ENTRY, 2276.8f, 1400.41f, 1196.33f, 2.44346f, 0, 0, 0.939693f, 0.34202f, RESPAWN_ONE_DAY);
276 AddObject(BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_LEFT, BG_OBJECT_A_BANNER_EY_ENTRY, 2305.78f, 1404.56f, 1199.38f, 1.74533f, 0, 0, 0.766044f, 0.642788f, RESPAWN_ONE_DAY);
277 AddObject(BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_RIGHT, BG_OBJECT_A_BANNER_EY_ENTRY, 2245.4f, 1366.41f, 1195.28f, 2.21657f, 0, 0, 0.894934f, 0.446198f, RESPAWN_ONE_DAY);
278 AddObject(BG_EY_OBJECT_A_BANNER_MAGE_TOWER_CENTER, BG_OBJECT_A_BANNER_EY_ENTRY, 2270.84f, 1784.08f, 1186.76f, 2.42601f, 0, 0, 0.936672f, 0.350207f, RESPAWN_ONE_DAY);
279 AddObject(BG_EY_OBJECT_A_BANNER_MAGE_TOWER_LEFT, BG_OBJECT_A_BANNER_EY_ENTRY, 2269.13f, 1737.7f, 1186.66f, 0.994838f, 0, 0, 0.477159f, 0.878817f, RESPAWN_ONE_DAY);
280 AddObject(BG_EY_OBJECT_A_BANNER_MAGE_TOWER_RIGHT, BG_OBJECT_A_BANNER_EY_ENTRY, 2300.86f, 1741.25f, 1187.7f, -0.785398f, 0, 0, 0.382683f, -0.92388f, RESPAWN_ONE_DAY);
281 // banners (horde)
282 AddObject(BG_EY_OBJECT_H_BANNER_FEL_REAVER_CENTER, BG_OBJECT_H_BANNER_EY_ENTRY, 2057.46f, 1735.07f, 1187.91f, -0.925024f, 0, 0, 0.446198f, -0.894934f, RESPAWN_ONE_DAY);
283 AddObject(BG_EY_OBJECT_H_BANNER_FEL_REAVER_LEFT, BG_OBJECT_H_BANNER_EY_ENTRY, 2032.25f, 1729.53f, 1190.33f, 1.8675f, 0, 0, 0.803857f, 0.594823f, RESPAWN_ONE_DAY);
284 AddObject(BG_EY_OBJECT_H_BANNER_FEL_REAVER_RIGHT, BG_OBJECT_H_BANNER_EY_ENTRY, 2092.35f, 1775.46f, 1187.08f, -0.401426f, 0, 0, 0.199368f, -0.979925f, RESPAWN_ONE_DAY);
285 AddObject(BG_EY_OBJECT_H_BANNER_BLOOD_ELF_CENTER, BG_OBJECT_H_BANNER_EY_ENTRY, 2047.19f, 1349.19f, 1189.0f, -1.62316f, 0, 0, 0.725374f, -0.688354f, RESPAWN_ONE_DAY);
286 AddObject(BG_EY_OBJECT_H_BANNER_BLOOD_ELF_LEFT, BG_OBJECT_H_BANNER_EY_ENTRY, 2074.32f, 1385.78f, 1194.72f, 0.488692f, 0, 0, 0.241922f, 0.970296f, RESPAWN_ONE_DAY);
287 AddObject(BG_EY_OBJECT_H_BANNER_BLOOD_ELF_RIGHT, BG_OBJECT_H_BANNER_EY_ENTRY, 2025.13f, 1386.12f, 1192.74f, 2.3911f, 0, 0, 0.930418f, 0.366501f, RESPAWN_ONE_DAY);
288 AddObject(BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_CENTER, BG_OBJECT_H_BANNER_EY_ENTRY, 2276.8f, 1400.41f, 1196.33f, 2.44346f, 0, 0, 0.939693f, 0.34202f, RESPAWN_ONE_DAY);
289 AddObject(BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_LEFT, BG_OBJECT_H_BANNER_EY_ENTRY, 2305.78f, 1404.56f, 1199.38f, 1.74533f, 0, 0, 0.766044f, 0.642788f, RESPAWN_ONE_DAY);
290 AddObject(BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_RIGHT, BG_OBJECT_H_BANNER_EY_ENTRY, 2245.4f, 1366.41f, 1195.28f, 2.21657f, 0, 0, 0.894934f, 0.446198f, RESPAWN_ONE_DAY);
291 AddObject(BG_EY_OBJECT_H_BANNER_MAGE_TOWER_CENTER, BG_OBJECT_H_BANNER_EY_ENTRY, 2270.84f, 1784.08f, 1186.76f, 2.42601f, 0, 0, 0.936672f, 0.350207f, RESPAWN_ONE_DAY);
292 AddObject(BG_EY_OBJECT_H_BANNER_MAGE_TOWER_LEFT, BG_OBJECT_H_BANNER_EY_ENTRY, 2269.13f, 1737.7f, 1186.66f, 0.994838f, 0, 0, 0.477159f, 0.878817f, RESPAWN_ONE_DAY);
293 AddObject(BG_EY_OBJECT_H_BANNER_MAGE_TOWER_RIGHT, BG_OBJECT_H_BANNER_EY_ENTRY, 2300.86f, 1741.25f, 1187.7f, -0.785398f, 0, 0, 0.382683f, -0.92388f, RESPAWN_ONE_DAY);
294 // banners (natural)
295 AddObject(BG_EY_OBJECT_N_BANNER_FEL_REAVER_CENTER, BG_OBJECT_N_BANNER_EY_ENTRY, 2057.46f, 1735.07f, 1187.91f, -0.925024f, 0, 0, 0.446198f, -0.894934f, RESPAWN_ONE_DAY);
296 AddObject(BG_EY_OBJECT_N_BANNER_FEL_REAVER_LEFT, BG_OBJECT_N_BANNER_EY_ENTRY, 2032.25f, 1729.53f, 1190.33f, 1.8675f, 0, 0, 0.803857f, 0.594823f, RESPAWN_ONE_DAY);
297 AddObject(BG_EY_OBJECT_N_BANNER_FEL_REAVER_RIGHT, BG_OBJECT_N_BANNER_EY_ENTRY, 2092.35f, 1775.46f, 1187.08f, -0.401426f, 0, 0, 0.199368f, -0.979925f, RESPAWN_ONE_DAY);
298 AddObject(BG_EY_OBJECT_N_BANNER_BLOOD_ELF_CENTER, BG_OBJECT_N_BANNER_EY_ENTRY, 2047.19f, 1349.19f, 1189.0f, -1.62316f, 0, 0, 0.725374f, -0.688354f, RESPAWN_ONE_DAY);
299 AddObject(BG_EY_OBJECT_N_BANNER_BLOOD_ELF_LEFT, BG_OBJECT_N_BANNER_EY_ENTRY, 2074.32f, 1385.78f, 1194.72f, 0.488692f, 0, 0, 0.241922f, 0.970296f, RESPAWN_ONE_DAY);
300 AddObject(BG_EY_OBJECT_N_BANNER_BLOOD_ELF_RIGHT, BG_OBJECT_N_BANNER_EY_ENTRY, 2025.13f, 1386.12f, 1192.74f, 2.3911f, 0, 0, 0.930418f, 0.366501f, RESPAWN_ONE_DAY);
301 AddObject(BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_CENTER, BG_OBJECT_N_BANNER_EY_ENTRY, 2276.8f, 1400.41f, 1196.33f, 2.44346f, 0, 0, 0.939693f, 0.34202f, RESPAWN_ONE_DAY);
302 AddObject(BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_LEFT, BG_OBJECT_N_BANNER_EY_ENTRY, 2305.78f, 1404.56f, 1199.38f, 1.74533f, 0, 0, 0.766044f, 0.642788f, RESPAWN_ONE_DAY);
303 AddObject(BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_RIGHT, BG_OBJECT_N_BANNER_EY_ENTRY, 2245.4f, 1366.41f, 1195.28f, 2.21657f, 0, 0, 0.894934f, 0.446198f, RESPAWN_ONE_DAY);
304 AddObject(BG_EY_OBJECT_N_BANNER_MAGE_TOWER_CENTER, BG_OBJECT_N_BANNER_EY_ENTRY, 2270.84f, 1784.08f, 1186.76f, 2.42601f, 0, 0, 0.936672f, 0.350207f, RESPAWN_ONE_DAY);
305 AddObject(BG_EY_OBJECT_N_BANNER_MAGE_TOWER_LEFT, BG_OBJECT_N_BANNER_EY_ENTRY, 2269.13f, 1737.7f, 1186.66f, 0.994838f, 0, 0, 0.477159f, 0.878817f, RESPAWN_ONE_DAY);
306 AddObject(BG_EY_OBJECT_N_BANNER_MAGE_TOWER_RIGHT, BG_OBJECT_N_BANNER_EY_ENTRY, 2300.86f, 1741.25f, 1187.7f, -0.785398f, 0, 0, 0.382683f, -0.92388f, RESPAWN_ONE_DAY);
307 // flags
308 AddObject(BG_EY_OBJECT_FLAG_NETHERSTORM, BG_OBJECT_FLAG2_EY_ENTRY, 2174.782227f, 1569.054688f, 1160.361938f, -1.448624f, 0, 0, 0.662620f, -0.748956f, RESPAWN_ONE_DAY);
309 AddObject(BG_EY_OBJECT_FLAG_FEL_REAVER, BG_OBJECT_FLAG1_EY_ENTRY, 2044.28f, 1729.68f, 1189.96f, -0.017453f, 0, 0, 0.008727f, -0.999962f, RESPAWN_ONE_DAY);
310 AddObject(BG_EY_OBJECT_FLAG_BLOOD_ELF, BG_OBJECT_FLAG1_EY_ENTRY, 2048.83f, 1393.65f, 1194.49f, 0.20944f, 0, 0, 0.104528f, 0.994522f, RESPAWN_ONE_DAY);
311 AddObject(BG_EY_OBJECT_FLAG_DRAENEI_RUINS, BG_OBJECT_FLAG1_EY_ENTRY, 2286.56f, 1402.36f, 1197.11f, 3.72381f, 0, 0, 0.957926f, -0.287016f, RESPAWN_ONE_DAY);
312 AddObject(BG_EY_OBJECT_FLAG_MAGE_TOWER, BG_OBJECT_FLAG1_EY_ENTRY, 2284.48f, 1731.23f, 1189.99f, 2.89725f, 0, 0, 0.992546f, 0.121869f, RESPAWN_ONE_DAY);
313 // tower cap
314 AddObject(BG_EY_OBJECT_TOWER_CAP_FEL_REAVER, BG_OBJECT_FR_TOWER_CAP_EY_ENTRY, 2024.600708f, 1742.819580f, 1195.157715f, 2.443461f, 0, 0, 0.939693f, 0.342020f, RESPAWN_ONE_DAY);
315 AddObject(BG_EY_OBJECT_TOWER_CAP_BLOOD_ELF, BG_OBJECT_BE_TOWER_CAP_EY_ENTRY, 2050.493164f, 1372.235962f, 1194.563477f, 1.710423f, 0, 0, 0.754710f, 0.656059f, RESPAWN_ONE_DAY);
316 AddObject(BG_EY_OBJECT_TOWER_CAP_DRAENEI_RUINS, BG_OBJECT_DR_TOWER_CAP_EY_ENTRY, 2301.010498f, 1386.931641f, 1197.183472f, 1.570796f, 0, 0, 0.707107f, 0.707107f, RESPAWN_ONE_DAY);
317 AddObject(BG_EY_OBJECT_TOWER_CAP_MAGE_TOWER, BG_OBJECT_HU_TOWER_CAP_EY_ENTRY, 2282.121582f, 1760.006958f, 1189.707153f, 1.919862f, 0, 0, 0.819152f, 0.573576f, RESPAWN_ONE_DAY);
318
319 for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
320 {
321 AreaTrigger const* at = sObjectMgr->GetAreaTrigger(_capturePointInfo[i]._areaTrigger);
322 AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 0, Buff_Entries[0], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY);
323 AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 1, Buff_Entries[1], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY);
324 AddObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + i * 3 + 2, Buff_Entries[2], at->x, at->y, at->z, 0.907571f, 0, 0, 0.438371f, 0.898794f, RESPAWN_ONE_DAY);
325 }
326
327 GraveyardStruct const* sg = nullptr;
328 sg = sGraveyard->GetGraveyard(BG_EY_GRAVEYARD_MAIN_ALLIANCE);
329 AddSpiritGuide(BG_EY_SPIRIT_MAIN_ALLIANCE, sg->x, sg->y, sg->z, 3.124139f, TEAM_ALLIANCE);
330
331 sg = sGraveyard->GetGraveyard(BG_EY_GRAVEYARD_MAIN_HORDE);
332 AddSpiritGuide(BG_EY_SPIRIT_MAIN_HORDE, sg->x, sg->y, sg->z, 3.193953f, TEAM_HORDE);
333
335 if (!BgObjects[i])
336 {
337 LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn some object Battleground not created!");
338 return false;
339 }
340
342 if (!BgCreatures[i])
343 {
344 LOG_ERROR("sql.sql", "BatteGroundEY: Failed to spawn spirit guides Battleground not created!");
345 return false;
346 }
347
348 return true;
349}
#define LOG_ERROR(filterType__,...)
Definition: Log.h:157
#define sObjectMgr
Definition: ObjectMgr.h:1635
const uint32 Buff_Entries[3]
Definition: Battleground.h:195
@ BG_EY_OBJECT_DOOR_H
Definition: BattlegroundEY.h:164
@ BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_LEFT
Definition: BattlegroundEY.h:196
@ BG_EY_OBJECT_N_BANNER_MAGE_TOWER_RIGHT
Definition: BattlegroundEY.h:200
@ BG_EY_OBJECT_N_BANNER_MAGE_TOWER_CENTER
Definition: BattlegroundEY.h:198
@ BG_EY_OBJECT_H_BANNER_FEL_REAVER_RIGHT
Definition: BattlegroundEY.h:179
@ BG_EY_OBJECT_A_BANNER_MAGE_TOWER_RIGHT
Definition: BattlegroundEY.h:176
@ BG_EY_OBJECT_TOWER_CAP_BLOOD_ELF
Definition: BattlegroundEY.h:202
@ BG_EY_OBJECT_TOWER_CAP_FEL_REAVER
Definition: BattlegroundEY.h:201
@ BG_EY_OBJECT_H_BANNER_BLOOD_ELF_CENTER
Definition: BattlegroundEY.h:180
@ BG_EY_OBJECT_TOWER_CAP_DRAENEI_RUINS
Definition: BattlegroundEY.h:203
@ BG_EY_OBJECT_N_BANNER_FEL_REAVER_LEFT
Definition: BattlegroundEY.h:190
@ BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_CENTER
Definition: BattlegroundEY.h:171
@ BG_EY_OBJECT_A_BANNER_BLOOD_ELF_RIGHT
Definition: BattlegroundEY.h:170
@ BG_EY_OBJECT_H_BANNER_MAGE_TOWER_CENTER
Definition: BattlegroundEY.h:186
@ BG_EY_OBJECT_A_BANNER_BLOOD_ELF_CENTER
Definition: BattlegroundEY.h:168
@ BG_EY_OBJECT_N_BANNER_FEL_REAVER_CENTER
Definition: BattlegroundEY.h:189
@ BG_EY_OBJECT_N_BANNER_BLOOD_ELF_RIGHT
Definition: BattlegroundEY.h:194
@ BG_EY_OBJECT_A_BANNER_FEL_REAVER_RIGHT
Definition: BattlegroundEY.h:167
@ BG_EY_OBJECT_A_BANNER_MAGE_TOWER_CENTER
Definition: BattlegroundEY.h:174
@ BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_RIGHT
Definition: BattlegroundEY.h:185
@ BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER
Definition: BattlegroundEY.h:211
@ BG_EY_OBJECT_DOOR_A
Definition: BattlegroundEY.h:163
@ BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_LEFT
Definition: BattlegroundEY.h:184
@ BG_EY_OBJECT_H_BANNER_MAGE_TOWER_RIGHT
Definition: BattlegroundEY.h:188
@ BG_EY_OBJECT_N_BANNER_BLOOD_ELF_CENTER
Definition: BattlegroundEY.h:192
@ BG_EY_OBJECT_H_BANNER_BLOOD_ELF_LEFT
Definition: BattlegroundEY.h:181
@ BG_EY_OBJECT_A_BANNER_BLOOD_ELF_LEFT
Definition: BattlegroundEY.h:169
@ BG_EY_OBJECT_N_BANNER_FEL_REAVER_RIGHT
Definition: BattlegroundEY.h:191
@ BG_EY_OBJECT_A_BANNER_FEL_REAVER_LEFT
Definition: BattlegroundEY.h:166
@ BG_EY_OBJECT_H_BANNER_MAGE_TOWER_LEFT
Definition: BattlegroundEY.h:187
@ BG_EY_OBJECT_A_BANNER_MAGE_TOWER_LEFT
Definition: BattlegroundEY.h:175
@ BG_EY_OBJECT_H_BANNER_FEL_REAVER_LEFT
Definition: BattlegroundEY.h:178
@ BG_EY_OBJECT_TOWER_CAP_MAGE_TOWER
Definition: BattlegroundEY.h:204
@ BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_RIGHT
Definition: BattlegroundEY.h:173
@ BG_EY_OBJECT_H_BANNER_BLOOD_ELF_RIGHT
Definition: BattlegroundEY.h:182
@ BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_CENTER
Definition: BattlegroundEY.h:183
@ BG_EY_OBJECT_H_BANNER_FEL_REAVER_CENTER
Definition: BattlegroundEY.h:177
@ BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_LEFT
Definition: BattlegroundEY.h:172
@ BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_CENTER
Definition: BattlegroundEY.h:195
@ BG_EY_OBJECT_A_BANNER_FEL_REAVER_CENTER
Definition: BattlegroundEY.h:165
@ BG_EY_OBJECT_N_BANNER_BLOOD_ELF_LEFT
Definition: BattlegroundEY.h:193
@ BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_RIGHT
Definition: BattlegroundEY.h:197
@ BG_EY_OBJECT_N_BANNER_MAGE_TOWER_LEFT
Definition: BattlegroundEY.h:199
@ BG_EY_SPIRIT_MAIN_HORDE
Definition: BattlegroundEY.h:151
@ BG_EY_SPIRIT_MAIN_ALLIANCE
Definition: BattlegroundEY.h:150
@ BG_OBJECT_HU_TOWER_CAP_EY_ENTRY
Definition: BattlegroundEY.h:109
@ BG_OBJECT_BE_TOWER_CAP_EY_ENTRY
Definition: BattlegroundEY.h:107
@ BG_OBJECT_H_BANNER_EY_ENTRY
Definition: BattlegroundEY.h:105
@ BG_OBJECT_FLAG2_EY_ENTRY
Definition: BattlegroundEY.h:102
@ BG_OBJECT_FR_TOWER_CAP_EY_ENTRY
Definition: BattlegroundEY.h:108
@ BG_OBJECT_A_DOOR_EY_ENTRY
Definition: BattlegroundEY.h:99
@ BG_OBJECT_H_DOOR_EY_ENTRY
Definition: BattlegroundEY.h:100
@ BG_OBJECT_FLAG1_EY_ENTRY
Definition: BattlegroundEY.h:101
@ BG_OBJECT_A_BANNER_EY_ENTRY
Definition: BattlegroundEY.h:104
@ BG_OBJECT_N_BANNER_EY_ENTRY
Definition: BattlegroundEY.h:106
@ BG_OBJECT_DR_TOWER_CAP_EY_ENTRY
Definition: BattlegroundEY.h:110
@ BG_EY_GRAVEYARD_MAIN_HORDE
Definition: BattlegroundEY.h:128
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: ObjectMgr.h:420
float x
Definition: ObjectMgr.h:423
float y
Definition: ObjectMgr.h:424
float z
Definition: ObjectMgr.h:425

References _capturePointInfo, Battleground::AddObject(), Battleground::AddSpiritGuide(), BG_EY_GRAVEYARD_MAIN_ALLIANCE, BG_EY_GRAVEYARD_MAIN_HORDE, BG_EY_OBJECT_A_BANNER_BLOOD_ELF_CENTER, BG_EY_OBJECT_A_BANNER_BLOOD_ELF_LEFT, BG_EY_OBJECT_A_BANNER_BLOOD_ELF_RIGHT, BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_CENTER, BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_LEFT, BG_EY_OBJECT_A_BANNER_DRAENEI_RUINS_RIGHT, BG_EY_OBJECT_A_BANNER_FEL_REAVER_CENTER, BG_EY_OBJECT_A_BANNER_FEL_REAVER_LEFT, BG_EY_OBJECT_A_BANNER_FEL_REAVER_RIGHT, BG_EY_OBJECT_A_BANNER_MAGE_TOWER_CENTER, BG_EY_OBJECT_A_BANNER_MAGE_TOWER_LEFT, BG_EY_OBJECT_A_BANNER_MAGE_TOWER_RIGHT, BG_EY_OBJECT_DOOR_A, BG_EY_OBJECT_DOOR_H, BG_EY_OBJECT_FLAG_BLOOD_ELF, BG_EY_OBJECT_FLAG_DRAENEI_RUINS, BG_EY_OBJECT_FLAG_FEL_REAVER, BG_EY_OBJECT_FLAG_MAGE_TOWER, BG_EY_OBJECT_FLAG_NETHERSTORM, BG_EY_OBJECT_H_BANNER_BLOOD_ELF_CENTER, BG_EY_OBJECT_H_BANNER_BLOOD_ELF_LEFT, BG_EY_OBJECT_H_BANNER_BLOOD_ELF_RIGHT, BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_CENTER, BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_LEFT, BG_EY_OBJECT_H_BANNER_DRAENEI_RUINS_RIGHT, BG_EY_OBJECT_H_BANNER_FEL_REAVER_CENTER, BG_EY_OBJECT_H_BANNER_FEL_REAVER_LEFT, BG_EY_OBJECT_H_BANNER_FEL_REAVER_RIGHT, BG_EY_OBJECT_H_BANNER_MAGE_TOWER_CENTER, BG_EY_OBJECT_H_BANNER_MAGE_TOWER_LEFT, BG_EY_OBJECT_H_BANNER_MAGE_TOWER_RIGHT, BG_EY_OBJECT_MAX, BG_EY_OBJECT_N_BANNER_BLOOD_ELF_CENTER, BG_EY_OBJECT_N_BANNER_BLOOD_ELF_LEFT, BG_EY_OBJECT_N_BANNER_BLOOD_ELF_RIGHT, BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_CENTER, BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_LEFT, BG_EY_OBJECT_N_BANNER_DRAENEI_RUINS_RIGHT, BG_EY_OBJECT_N_BANNER_FEL_REAVER_CENTER, BG_EY_OBJECT_N_BANNER_FEL_REAVER_LEFT, BG_EY_OBJECT_N_BANNER_FEL_REAVER_RIGHT, BG_EY_OBJECT_N_BANNER_MAGE_TOWER_CENTER, BG_EY_OBJECT_N_BANNER_MAGE_TOWER_LEFT, BG_EY_OBJECT_N_BANNER_MAGE_TOWER_RIGHT, BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER, BG_EY_OBJECT_TOWER_CAP_BLOOD_ELF, BG_EY_OBJECT_TOWER_CAP_DRAENEI_RUINS, BG_EY_OBJECT_TOWER_CAP_FEL_REAVER, BG_EY_OBJECT_TOWER_CAP_MAGE_TOWER, BG_EY_SPIRIT_MAIN_ALLIANCE, BG_EY_SPIRIT_MAIN_HORDE, BG_OBJECT_A_BANNER_EY_ENTRY, BG_OBJECT_A_DOOR_EY_ENTRY, BG_OBJECT_BE_TOWER_CAP_EY_ENTRY, BG_OBJECT_DR_TOWER_CAP_EY_ENTRY, BG_OBJECT_FLAG1_EY_ENTRY, BG_OBJECT_FLAG2_EY_ENTRY, BG_OBJECT_FR_TOWER_CAP_EY_ENTRY, BG_OBJECT_H_BANNER_EY_ENTRY, BG_OBJECT_H_DOOR_EY_ENTRY, BG_OBJECT_HU_TOWER_CAP_EY_ENTRY, BG_OBJECT_N_BANNER_EY_ENTRY, Battleground::BgCreatures, Battleground::BgObjects, Buff_Entries, EY_POINTS_MAX, LOG_ERROR, RESPAWN_IMMEDIATELY, RESPAWN_ONE_DAY, sGraveyard, sObjectMgr, TEAM_ALLIANCE, TEAM_HORDE, AreaTrigger::x, GraveyardStruct::x, AreaTrigger::y, GraveyardStruct::y, AreaTrigger::z, and GraveyardStruct::z.

◆ StartingEventCloseDoors()

◆ StartingEventOpenDoors()

void BattlegroundEY::StartingEventOpenDoors ( )
overridevirtual

Reimplemented from Battleground.

96{
99
102
103 for (uint32 i = 0; i < EY_POINTS_MAX; ++i)
105
106 // Achievement: Flurry
110}
uint32 urand(uint32 min, uint32 max)
Definition: Random.cpp:44
@ ACHIEVEMENT_TIMED_TYPE_EVENT
Definition: DBCEnums.h:110
@ BG_EY_EVENT_START_BATTLE
Definition: BattlegroundEY.h:234
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
Definition: Battleground.cpp:1831

References _bgEvents, ACHIEVEMENT_TIMED_TYPE_EVENT, BG_EY_EVENT_ADD_POINTS, BG_EY_EVENT_CHECK_CPOINTS, BG_EY_EVENT_START_BATTLE, BG_EY_OBJECT_DOOR_A, BG_EY_OBJECT_DOOR_H, BG_EY_OBJECT_FLAG_NETHERSTORM, BG_EY_OBJECT_N_BANNER_FEL_REAVER_CENTER, BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER, EY_POINTS_MAX, RESPAWN_IMMEDIATELY, RESPAWN_ONE_DAY, EventMap::ScheduleEvent(), Battleground::SpawnBGObject(), Battleground::StartTimedAchievement(), and urand().

◆ UpdatePlayerScore()

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

Reimplemented from Battleground.

555{
556 if (!Battleground::UpdatePlayerScore(player, type, value, doAddHonor))
557 return false;
558
559 switch (type)
560 {
563 break;
564 default:
565 break;
566 }
567
568 return true;
569}
@ ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE
Definition: DBCEnums.h:144
@ BG_EY_OBJECTIVE_CAPTURE_FLAG
Definition: BattlegroundEY.h:235
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, BG_EY_OBJECTIVE_CAPTURE_FLAG, SCORE_FLAG_CAPTURES, Player::UpdateAchievementCriteria(), and Battleground::UpdatePlayerScore().

Referenced by EventPlayerCapturedFlag().

◆ UpdatePointsCount()

◆ UpdatePointsIcons()

void BattlegroundEY::UpdatePointsIcons ( uint32  point)
private
194{
195 if (_capturePointInfo[point].IsUnderControl())
196 {
197 UpdateWorldState(m_PointsIconStruct[point].WorldStateControlIndex, 0);
198 UpdateWorldState(m_PointsIconStruct[point].WorldStateAllianceControlledIndex, _capturePointInfo[point].IsUnderControl(TEAM_ALLIANCE));
199 UpdateWorldState(m_PointsIconStruct[point].WorldStateHordeControlledIndex, _capturePointInfo[point].IsUnderControl(TEAM_HORDE));
200 }
201 else
202 {
203 UpdateWorldState(m_PointsIconStruct[point].WorldStateAllianceControlledIndex, 0);
204 UpdateWorldState(m_PointsIconStruct[point].WorldStateHordeControlledIndex, 0);
205 UpdateWorldState(m_PointsIconStruct[point].WorldStateControlIndex, 1);
206 }
207}
const BattlegroundEYPointIconsStruct m_PointsIconStruct[EY_POINTS_MAX]
Definition: BattlegroundEY.h:327

References _capturePointInfo, m_PointsIconStruct, TEAM_ALLIANCE, TEAM_HORDE, and Battleground::UpdateWorldState().

Referenced by EventTeamCapturedPoint(), and EventTeamLostPoint().

◆ UpdatePointsState()

void BattlegroundEY::UpdatePointsState ( )
private
128{
129 std::vector<GameObject*> pointsVec;
130 for (uint8 point = 0; point < EY_POINTS_MAX; ++point)
131 {
132 pointsVec.push_back(GetBGObject(BG_EY_OBJECT_TOWER_CAP_FEL_REAVER + point));
135 }
136
137 const BattlegroundPlayerMap& bgPlayerMap = GetPlayers();
138 for (BattlegroundPlayerMap::const_iterator itr = bgPlayerMap.begin(); itr != bgPlayerMap.end(); ++itr)
139 {
140 itr->second->SendUpdateWorldState(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_DONT_SHOW);
141 for (uint8 point = 0; point < EY_POINTS_MAX; ++point)
142 if (GameObject* pointObject = pointsVec[point])
143 if (itr->second->CanCaptureTowerPoint() && itr->second->IsWithinDistInMap(pointObject, BG_EY_POINT_RADIUS))
144 {
145 itr->second->SendUpdateWorldState(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_SHOW);
146 itr->second->SendUpdateWorldState(PROGRESS_BAR_PERCENT_GREY, BG_EY_PROGRESS_BAR_PERCENT_GREY);
147 itr->second->SendUpdateWorldState(PROGRESS_BAR_STATUS, _capturePointInfo[point]._barStatus);
148 ++_capturePointInfo[point]._playersCount[itr->second->GetTeamId()];
149 _capturePointInfo[point].player = itr->second;
150
151 // Xinef: ugly hax... area trigger is no longer called by client...
152 if (pointObject->GetEntry() == BG_OBJECT_FR_TOWER_CAP_EY_ENTRY && itr->second->GetDistance2d(2043.96f, 1729.68f) < 3.0f)
154 }
155 }
156
157 for (uint8 point = 0; point < EY_POINTS_MAX; ++point)
158 {
159 _capturePointInfo[point]._barStatus += std::max<int8>(std::min<int8>(_capturePointInfo[point]._playersCount[TEAM_ALLIANCE] - _capturePointInfo[point]._playersCount[TEAM_HORDE], BG_EY_POINT_MAX_CAPTURERS_COUNT), -BG_EY_POINT_MAX_CAPTURERS_COUNT);
161
162 TeamId pointOwnerTeamId = TEAM_NEUTRAL;
163 if (_capturePointInfo[point]._barStatus <= BG_EY_PROGRESS_BAR_NEUTRAL_LOW)
164 pointOwnerTeamId = TEAM_HORDE;
165 else if (_capturePointInfo[point]._barStatus >= BG_EY_PROGRESS_BAR_NEUTRAL_HIGH)
166 pointOwnerTeamId = TEAM_ALLIANCE;
167
168 if (pointOwnerTeamId != _capturePointInfo[point]._ownerTeamId)
169 {
170 if (_capturePointInfo[point].IsUncontrolled())
171 EventTeamCapturedPoint(_capturePointInfo[point].player, pointOwnerTeamId, point);
172
173 if (pointOwnerTeamId == TEAM_NEUTRAL && _capturePointInfo[point].IsUnderControl())
174 EventTeamLostPoint(_capturePointInfo[point].player, point);
175 }
176 }
177}
@ BG_EY_PROGRESS_BAR_NEUTRAL_HIGH
Definition: BattlegroundEY.h:78
@ BG_EY_PROGRESS_BAR_NEUTRAL_LOW
Definition: BattlegroundEY.h:77
@ BG_EY_PROGRESS_BAR_DONT_SHOW
Definition: BattlegroundEY.h:72
@ BG_EY_PROGRESS_BAR_ALI_CONTROLLED
Definition: BattlegroundEY.h:79
@ BG_EY_PROGRESS_BAR_HORDE_CONTROLLED
Definition: BattlegroundEY.h:76
@ BG_EY_POINT_MAX_CAPTURERS_COUNT
Definition: BattlegroundEY.h:70
@ BG_EY_PROGRESS_BAR_PERCENT_GREY
Definition: BattlegroundEY.h:74
@ BG_EY_POINT_RADIUS
Definition: BattlegroundEY.h:71
@ BG_EY_PROGRESS_BAR_SHOW
Definition: BattlegroundEY.h:73
std::map< ObjectGuid, Player * > BattlegroundPlayerMap
Definition: Battleground.h:417
BattlegroundPlayerMap const & GetPlayers() const
Definition: Battleground.h:418
GameObject * GetBGObject(uint32 type)
Definition: Battleground.cpp:1491
void EventTeamCapturedPoint(Player *player, TeamId teamId, uint32 point)
Definition: BattlegroundEY.cpp:484
void HandleAreaTrigger(Player *player, uint32 trigger) override
Definition: BattlegroundEY.cpp:221
void EventTeamLostPoint(Player *player, uint32 point)
Definition: BattlegroundEY.cpp:447
int8 _barStatus
Definition: BattlegroundEY.h:441
int8 _playersCount[PVP_TEAMS_COUNT]
Definition: BattlegroundEY.h:443
Player * player
Definition: BattlegroundEY.h:444

References BattlegroundEY::CapturePointInfo::_barStatus, _capturePointInfo, BattlegroundEY::CapturePointInfo::_playersCount, AT_FEL_REAVER_POINT, BG_EY_OBJECT_TOWER_CAP_FEL_REAVER, BG_EY_POINT_MAX_CAPTURERS_COUNT, BG_EY_POINT_RADIUS, BG_EY_PROGRESS_BAR_ALI_CONTROLLED, BG_EY_PROGRESS_BAR_DONT_SHOW, BG_EY_PROGRESS_BAR_HORDE_CONTROLLED, BG_EY_PROGRESS_BAR_NEUTRAL_HIGH, BG_EY_PROGRESS_BAR_NEUTRAL_LOW, BG_EY_PROGRESS_BAR_PERCENT_GREY, BG_EY_PROGRESS_BAR_SHOW, BG_OBJECT_FR_TOWER_CAP_EY_ENTRY, EventTeamCapturedPoint(), EventTeamLostPoint(), EY_POINTS_MAX, Battleground::GetBGObject(), Battleground::GetPlayers(), HandleAreaTrigger(), BattlegroundEY::CapturePointInfo::player, PROGRESS_BAR_PERCENT_GREY, PROGRESS_BAR_SHOW, PROGRESS_BAR_STATUS, TEAM_ALLIANCE, TEAM_HORDE, and TEAM_NEUTRAL.

Referenced by PostUpdateImpl().

Member Data Documentation

◆ _bgEvents

◆ _capturePointInfo

◆ _droppedFlagGUID

ObjectGuid BattlegroundEY::_droppedFlagGUID
private

Referenced by Init().

◆ _flagCapturedObject

uint32 BattlegroundEY::_flagCapturedObject
private

◆ _flagKeeperGUID

ObjectGuid BattlegroundEY::_flagKeeperGUID
private

Referenced by Init().

◆ _flagState

◆ _honorTics

uint32 BattlegroundEY::_honorTics
private

Referenced by AddPoints(), BattlegroundEY(), and Init().

◆ _ownedPointsCount