![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "Battlefield.h"
Public Types | |
| using | BfCapturePointVector = std::vector< BfCapturePoint * > |
| Vector of capture points belonging to this battlefield. | |
Public Member Functions | |
| Battlefield () | |
| Constructor. | |
| ~Battlefield () override | |
| Destructor. | |
| virtual bool | SetupBattlefield () |
| Call this to init the Battlefield. | |
| void | SendUpdateWorldState (uint32 field, uint32 value) |
| Update data of a worldstate to all players present in zone. | |
| virtual bool | Update (uint32 diff) |
| Called every time for update bf data and time. | |
| void | InvitePlayersInZoneToQueue () |
| Invite all players in zone to join the queue, called x minutes before battle start in Update() | |
| void | InvitePlayersInQueueToWar () |
| Invite all players in queue to join battle on battle start. | |
| void | InvitePlayersInZoneToWar () |
| Invite all players in zone to join battle on battle start. | |
| virtual void | HandleKill (Player *, Unit *) |
| Called when a Unit is killed in battlefield zone. | |
| uint32 | GetTypeId () const |
| uint32 | GetZoneId () const |
| void | TeamApplyBuff (TeamId team, uint32 spellId, uint32 spellId2=0) |
| bool | IsWarTime () const |
| Return true if battle is started, false if battle is not started. | |
| void | ToggleBattlefield (bool enable) |
| Enable or Disable battlefield. | |
| bool | IsEnabled () const |
| Return if battlefield is enabled. | |
| void | KickPlayerFromBattlefield (ObjectGuid guid) |
| Kick player from battlefield and teleport him to kick-point location. | |
| void | HandlePlayerEnterZone (Player *player, uint32 zone) |
| Called when player (player) enters the zone. | |
| void | HandlePlayerLeaveZone (Player *player, uint32 zone) |
| Called when player (player) leaves the zone. | |
| uint64 | GetData64 (uint32 dataId) const override |
| void | SetData64 (uint32 dataId, uint64 value) override |
| uint32 | GetData (uint32 dataId) const override |
| void | SetData (uint32 dataId, uint32 value) override |
| virtual void | UpdateData (uint32 index, int32 pad) |
| TeamId | GetDefenderTeam () const |
| TeamId | GetAttackerTeam () const |
| TeamId | GetOtherTeam (TeamId team) const |
| void | SetDefenderTeam (TeamId team) |
| Group * | GetFreeBfRaid (TeamId teamId) |
| Find a not full battlefield group, if there is no, create one. | |
| Group * | GetGroupPlayer (ObjectGuid guid, TeamId teamId) |
| Return battlefield group where player is. | |
| bool | AddOrSetPlayerToCorrectBfGroup (Player *player) |
| Force player to join a battlefield group. | |
| GraveyardStruct const * | GetClosestGraveyard (Player *player) |
| virtual void | AddPlayerToResurrectQueue (ObjectGuid npcGuid, ObjectGuid playerGuid) |
| void | RemovePlayerFromResurrectQueue (ObjectGuid playerGuid) |
| void | SetGraveyardNumber (uint32 number) |
| BfGraveyard * | GetGraveyardById (uint32 id) const |
| Creature * | SpawnCreature (uint32 entry, float x, float y, float z, float o, TeamId teamId) |
| Creature * | SpawnCreature (uint32 entry, Position pos, TeamId teamId) |
| GameObject * | SpawnGameObject (uint32 entry, float x, float y, float z, float o) |
| Creature * | GetCreature (ObjectGuid const &guid) |
| GameObject * | GetGameObject (ObjectGuid const &guid) |
| virtual void | OnBattleStart () |
| Called on start. | |
| virtual void | OnBattleEnd (bool) |
| Called at the end of battle. | |
| virtual void | OnStartGrouping () |
| Called x minutes before battle start when players in zone are invited to join queue. | |
| virtual void | OnPlayerJoinWar (Player *) |
| Called when a player accepts to join the battle. | |
| virtual void | OnPlayerLeaveWar (Player *) |
| Called when a player leaves the battle. | |
| virtual void | OnPlayerLeaveZone (Player *) |
| Called when a player leaves the battlefield zone. | |
| virtual void | OnPlayerEnterZone (Player *) |
| Called when a player enters the battlefield zone. | |
| void | SendWarning (uint8 id, WorldObject const *target=nullptr) |
| void | PlayerAcceptInviteToQueue (Player *player) |
| void | PlayerAcceptInviteToWar (Player *player) |
| uint32 | GetBattleId () const |
| void | AskToLeaveQueue (Player *player) |
| void | PlayerAskToLeave (Player *player) |
| virtual void | SendInitWorldStatesToAll ()=0 |
| Send all worldstate data to all players in zone. | |
| virtual void | FillInitialWorldStates (WorldPackets::WorldState::InitWorldStates &)=0 |
| virtual void | SendUpdateWorldStates (Player *player=nullptr)=0 |
| bool | CanFlyIn () const |
| Return if we can use mount in battlefield. | |
| void | SendAreaSpiritHealerQueryOpcode (Player *player, ObjectGuid const &guid) |
| void | StartBattle () |
| void | EndBattle (bool endByTimer) |
| void | HideNpc (Creature *creature) |
| void | ShowNpc (Creature *creature, bool aggressive) |
| GraveyardVect const & | GetGraveyardVector () const |
| uint32 | GetTimer () const |
| void | SetTimer (uint32 timer) |
| uint32 | GetPlayersInWarCount (TeamId teamId) const |
| uint32 | GetPlayersInZoneCount (TeamId teamId) const |
| uint32 | GetMaxPlayersPerTeam () const |
| bool | HasWarVacancy (TeamId teamId) const |
| Returns true if there is still room for another player on the given team in the active war. | |
| GuidUnorderedSet const & | GetPlayersQueueSet (TeamId teamId) const |
| Returns the set of players waiting in the pre-battle queue (per team, read-only). | |
| PlayerTimerMap const & | GetInvitedPlayersMap (TeamId teamId) const |
| GuidUnorderedSet const & | GetPlayersInWarSet (TeamId teamId) const |
| Returns the set of players actively fighting in the war (per team, read-only). | |
| void | DoPlaySoundToAll (uint32 soundId) |
| void | InvitePlayerToQueue (Player *player) |
| void | InvitePlayerToWar (Player *player) |
| void | InitStalker (uint32 entry, float x, float y, float z, float o) |
Public Member Functions inherited from ZoneScript | |
| ZoneScript () | |
| virtual | ~ZoneScript () |
| virtual uint32 | GetCreatureEntry (ObjectGuid::LowType, CreatureData const *data) |
| virtual uint32 | GetGameObjectEntry (ObjectGuid::LowType, uint32 entry) |
| virtual void | OnCreatureCreate (Creature *) |
| virtual void | OnCreatureRemove (Creature *) |
| virtual void | OnGameObjectCreate (GameObject *) |
| virtual void | OnGameObjectRemove (GameObject *) |
| virtual void | OnUnitDeath (Unit *) |
| virtual void | OnCreatureEvade (Creature *) |
| virtual ObjectGuid | GetGuidData (uint32) const |
| virtual void | SetGuidData (uint32, ObjectGuid) |
| virtual void | ProcessEvent (WorldObject *, uint32) |
Protected Member Functions | |
| void | KickAfkPlayers () |
| virtual void | SendRemoveWorldStates (Player *) |
| void | BroadcastPacketToZone (WorldPacket const *data) const |
| void | BroadcastPacketToQueue (WorldPacket const *data) const |
| void | BroadcastPacketToWar (WorldPacket const *data) const |
| void | AddCapturePoint (BfCapturePoint *cp) |
| void | RegisterZone (uint32 zoneId) |
| bool | HasPlayer (Player *player) const |
| void | TeamCastSpell (TeamId team, int32 spellId) |
| bool | IsPlayerInWarOrInvited (Player *player) const |
| Returns true if the player is already tracked as actively in the war or invited to join it. | |
| template<typename Func > | |
| void | ForEachPlayerInZone (Func &&fn) const |
| template<typename Func > | |
| void | ForEachPlayerInQueue (Func &&fn) const |
| template<typename Func > | |
| void | ForEachPlayerInWar (Func &&fn) const |
| template<typename Func > | |
| void | ForEachPlayerInWar (TeamId team, Func &&fn) const |
Friends | |
| class | BattlefieldMgr |
| using Battlefield::BfCapturePointVector = std::vector<BfCapturePoint*> |
Vector of capture points belonging to this battlefield.
| Battlefield::Battlefield | ( | ) |
Constructor.
|
override |
Destructor.
References CapturePoints, and GraveyardList.
|
inlineprotected |
References CapturePoints.
Referenced by BattlefieldWG::OnGameObjectCreate().
| bool Battlefield::AddOrSetPlayerToCorrectBfGroup | ( | Player * | player | ) |
Force player to join a battlefield group.
References Group::AddMember(), Group::Create(), GetFreeBfRaid(), Player::GetGroup(), Group::GetGUID(), Object::GetGUID(), Group::GetMemberGroup(), Player::GetTeamId(), Group::isBFGroup(), Group::isBGGroup(), Object::IsInWorld(), Group::IsMember(), LOG_INFO, Group::SetBattlefieldGroup(), Player::SetBattlegroundOrBattlefieldRaid(), and sGroupMgr.
Referenced by PlayerAcceptInviteToWar().
|
virtual |
References BfGraveyard::AddPlayer(), and GraveyardList.
| void Battlefield::AskToLeaveQueue | ( | Player * | player | ) |
References BattleId, BF_LEAVE_REASON_CLOSE, Object::GetGUID(), Player::GetSession(), Player::GetTeamId(), PlayersInQueue, and WorldSession::SendBfLeaveMessage().
Referenced by WorldSession::HandleBfExitRequest().
|
protected |
References ForEachPlayerInQueue(), and Player::SendDirectMessage().
|
protected |
References ForEachPlayerInWar(), and Player::SendDirectMessage().
Referenced by DoPlaySoundToAll().
|
protected |
References ForEachPlayerInZone(), and Player::SendDirectMessage().
|
inline |
Return if we can use mount in battlefield.
References Active.
Referenced by Spell::CheckCast(), spell_gen_mount::HandleMount(), and SpellArea::IsFitToRequirements().
| void Battlefield::DoPlaySoundToAll | ( | uint32 | soundId | ) |
References BroadcastPacketToWar().
Referenced by EndBattle(), and StartBattle().
| void Battlefield::EndBattle | ( | bool | endByTimer | ) |
References _scheduler, Active, BATTLEFIELD_TIMER_GROUP_WAR, BF_ALLIANCE_WINS, BF_HORDE_WINS, TaskScheduler::CancelGroup(), DoPlaySoundToAll(), GetAttackerTeam(), GetDefenderTeam(), NoWarBattleTime, OnBattleEnd(), SendInitWorldStatesToAll(), SendUpdateWorldStates(), SetDefenderTeam(), StartGrouping, and TEAM_ALLIANCE.
Referenced by bf_commandscript::HandleBattlefieldEnd(), bf_commandscript::HandleBattlefieldSwitch(), BattlefieldWG::ProcessEvent(), and Update().
|
pure virtual |
Implemented in BattlefieldWG.
Referenced by Player::SendInitWorldStates().
|
inlineprotected |
References ObjectAccessor::FindPlayer(), PlayersInQueue, and PVP_TEAMS_COUNT.
Referenced by BroadcastPacketToQueue().
|
inlineprotected |
References ObjectAccessor::FindPlayer(), PlayersInWar, and PVP_TEAMS_COUNT.
Referenced by BroadcastPacketToWar(), KickAfkPlayers(), and TeamCastSpell().
|
inlineprotected |
References ObjectAccessor::FindPlayer(), and PlayersInWar.
|
inlineprotected |
References ObjectAccessor::FindPlayer(), Players, and PVP_TEAMS_COUNT.
Referenced by BroadcastPacketToZone(), InvitePlayersInZoneToQueue(), InvitePlayersInZoneToWar(), and SendUpdateWorldState().
|
inline |
References DefenderTeam.
Referenced by BfWGGameObjectBuilding::Damaged(), EndBattle(), BattlefieldWG::FillInitialWorldStates(), npc_wg_quest_giver::GetDialogStatus(), BfWGGameObjectBuilding::Init(), BattlefieldWG::OnBattleEnd(), BattlefieldWG::OnBattleStart(), npc_wg_quest_giver::OnGossipHello(), BattlefieldWG::OnPlayerEnterZone(), BattlefieldWG::OnPlayerJoinWar(), BfWGGameObjectBuilding::Rebuild(), BattlefieldWG::SendUpdateWorldStates(), BattlefieldWG::SetupBattlefield(), BfWGGameObjectBuilding::UpdateCreatureAndGo(), BattlefieldWG::UpdateDamagedTowerCount(), BattlefieldWG::UpdatedDestroyedTowerCount(), and BfWGGameObjectBuilding::UpdateTurretAttack().
| GraveyardStruct const * Battlefield::GetClosestGraveyard | ( | Player * | player | ) |
References BfGraveyard::GetDistance(), BfGraveyard::GetGraveyardId(), Player::GetTeamId(), GraveyardList, and sGraveyard.
Referenced by BfGraveyard::RelocateDeadPlayers().
| Creature * Battlefield::GetCreature | ( | ObjectGuid const & | guid | ) |
References BfMap, and Map::GetCreature().
Referenced by BfWGGameObjectBuilding::Damaged(), BattlefieldWG::OnBattleEnd(), BattlefieldWG::OnBattleStart(), SendWarning(), BattlefieldWG::SetupBattlefield(), BfWGGameObjectBuilding::UpdateCreatureAndGo(), BattlefieldWG::UpdateTenacity(), and BfWGGameObjectBuilding::UpdateTurretAttack().
Reimplemented from ZoneScript.
Reimplemented in BattlefieldWG.
References Data32.
Referenced by npc_wg_demolisher_engineer::canBuild(), BattlefieldWG::GetData(), and SpellArea::IsFitToRequirements().
Reimplemented from ZoneScript.
|
inline |
References DefenderTeam.
Referenced by EndBattle(), BattlefieldWG::FillInitialWorldStates(), npc_wg_quest_giver::GetDialogStatus(), spell_wintergrasp_portal::HandleScript(), BfWGGameObjectBuilding::Init(), SpellArea::IsFitToRequirements(), BattlefieldWG::OnBattleEnd(), BattlefieldWG::OnBattleStart(), npc_wg_queue::OnGossipHello(), npc_wg_quest_giver::OnGossipHello(), BattlefieldWG::OnPlayerJoinWar(), BfWGGameObjectBuilding::Rebuild(), BattlefieldWG::SendUpdateWorldStates(), BattlefieldWG::SetupBattlefield(), BfWGGameObjectBuilding::UpdateCreatureAndGo(), BattlefieldWG::UpdatedDestroyedTowerCount(), WGWorkshop::UpdateGraveyardAndWorkshop(), and BfWGGameObjectBuilding::UpdateTurretAttack().
Find a not full battlefield group, if there is no, create one.
| teamId | : Id of player team for who we search a group (player->GetTeamId()) |
References sGroupMgr.
Referenced by AddOrSetPlayerToCorrectBfGroup().
| GameObject * Battlefield::GetGameObject | ( | ObjectGuid const & | guid | ) |
References BfMap, and Map::GetGameObject().
Referenced by BfWGGameObjectBuilding::Destroyed(), BfCapturePoint::GetCapturePointGo(), BattlefieldWG::GetRelic(), BfWGGameObjectBuilding::Rebuild(), and BfWGGameObjectBuilding::UpdateTurretAttack().
| BfGraveyard * Battlefield::GetGraveyardById | ( | uint32 | id | ) | const |
References GraveyardList, and LOG_ERROR.
Referenced by BattlefieldWG::GetData(), WGWorkshop::GiveControlTo(), BattlefieldWG::OnBattleEnd(), and WGWorkshop::UpdateGraveyardAndWorkshop().
|
inline |
References GraveyardList.
Referenced by npc_wg_spirit_guide::OnGossipHello(), and npc_wg_spirit_guide::OnGossipSelect().
| Group * Battlefield::GetGroupPlayer | ( | ObjectGuid | guid, |
| TeamId | teamId | ||
| ) |
Return battlefield group where player is.
References sGroupMgr.
|
inline |
Returns the map of players invited to join the active war, value is invite expiry timestamp (per team, read-only).
References InvitedPlayers.
Referenced by bf_commandscript::HandleBattlefieldQueue().
|
inline |
|
inline |
Returns the set of players actively fighting in the war (per team, read-only).
References PlayersInWar.
Referenced by bf_commandscript::HandleBattlefieldQueue().
|
inline |
Returns the set of players waiting in the pre-battle queue (per team, read-only).
References PlayersInQueue.
Referenced by bf_commandscript::HandleBattlefieldQueue().
|
inline |
References Timer.
Referenced by BattlefieldWG::FillInitialWorldStates(), bf_commandscript::HandleBattlefieldQueue(), instance_vault_of_archavon::instance_vault_of_archavon_InstanceMapScript::IsEncounterInProgress(), achievement_wg_within_our_grasp::OnCheck(), npc_wg_queue::OnGossipHello(), npc_wg_queue::OnGossipSelect(), and BattlefieldWG::SendUpdateWorldStates().
|
inline |
References TypeId.
Referenced by SpellArea::IsFitToRequirements(), and Player::SendInitWorldStates().
|
inline |
References ZoneId.
Referenced by WorldSession::HandleBfEntryInviteResponse(), KickAfkPlayers(), and KickPlayerFromBattlefield().
Called when player (player) enters the zone.
References GameTime::GetGameTime(), Object::GetGUID(), Player::GetTeamId(), HasWarVacancy(), InvitePlayerToQueue(), InvitePlayerToWar(), Player::IsGameMaster(), Unit::IsInFlight(), IsWarTime(), MINUTE, OnPlayerEnterZone(), Players, PlayersWillBeKick, sScriptMgr, and StartGroupingTimer.
Referenced by BattlefieldMgr::HandlePlayerEnterZone().
Called when player (player) leaves the zone.
References BattleId, CapturePoints, Player::GetGroup(), Object::GetGUID(), Player::GetSession(), Player::GetTeamId(), InvitedPlayers, IsWarTime(), OnPlayerLeaveWar(), OnPlayerLeaveZone(), Players, PlayersInQueue, PlayersInWar, PlayersWillBeKick, RemovePlayerFromResurrectQueue(), WorldSession::SendBfLeaveMessage(), SendRemoveWorldStates(), and sScriptMgr.
|
protected |
References Object::GetGUID(), Player::GetTeamId(), and Players.
|
inline |
Returns true if there is still room for another player on the given team in the active war.
References GetPlayersInWarCount(), and MaxPlayer.
Referenced by HandlePlayerEnterZone(), InvitePlayersInQueueToWar(), and InvitePlayersInZoneToWar().
| void Battlefield::HideNpc | ( | Creature * | creature | ) |
References Unit::CombatStop(), Creature::DisappearAndDie(), REACT_PASSIVE, Unit::SetPhaseMask(), Creature::SetReactState(), Unit::SetUnitFlag(), Unit::SetVisible(), UNIT_FLAG_NON_ATTACKABLE, and UNIT_FLAG_NOT_SELECTABLE.
Referenced by BfWGGameObjectBuilding::Damaged(), BfWGGameObjectBuilding::Init(), BattlefieldWG::OnBattleEnd(), BattlefieldWG::SetupBattlefield(), BfWGGameObjectBuilding::UpdateCreatureAndGo(), and BfWGGameObjectBuilding::UpdateTurretAttack().
| void Battlefield::InitStalker | ( | uint32 | entry, |
| float | x, | ||
| float | y, | ||
| float | z, | ||
| float | o | ||
| ) |
References LOG_ERROR, SpawnCreature(), StalkerGuid, and TEAM_NEUTRAL.
Referenced by BattlefieldWG::SetupBattlefield().
| void Battlefield::InvitePlayersInQueueToWar | ( | ) |
Invite all players in queue to join battle on battle start.
References ObjectAccessor::FindPlayer(), HasWarVacancy(), InvitePlayerToWar(), PlayersInQueue, and PVP_TEAMS_COUNT.
Referenced by StartBattle().
| void Battlefield::InvitePlayersInZoneToQueue | ( | ) |
Invite all players in zone to join the queue, called x minutes before battle start in Update()
References ForEachPlayerInZone(), and InvitePlayerToQueue().
Referenced by Update().
| void Battlefield::InvitePlayersInZoneToWar | ( | ) |
Invite all players in zone to join battle on battle start.
References ForEachPlayerInZone(), GameTime::GetGameTime(), Object::GetGUID(), Player::GetTeamId(), HasWarVacancy(), InvitePlayerToWar(), IsPlayerInWarOrInvited(), and PlayersWillBeKick.
Referenced by StartBattle().
| void Battlefield::InvitePlayerToQueue | ( | Player * | player | ) |
References BattleId, Object::GetGUID(), GetOtherTeam(), Player::GetSession(), Player::GetTeamId(), MinPlayer, PlayersInQueue, and WorldSession::SendBfInvitePlayerToQueue().
Referenced by HandlePlayerEnterZone(), InvitePlayersInZoneToQueue(), and npc_wg_queue::OnGossipSelect().
| void Battlefield::InvitePlayerToWar | ( | Player * | player | ) |
References BattleId, GameTime::GetGameTime(), Object::GetGUID(), Unit::GetLevel(), Player::GetSession(), Player::GetTeamId(), Player::InBattleground(), InvitedPlayers, Unit::IsInFlight(), IsPlayerInWarOrInvited(), MinLevel, PlayersInQueue, PlayersWillBeKick, WorldSession::SendBfInvitePlayerToWar(), sScriptMgr, TimeForAcceptInvite, and ZoneId.
Referenced by HandlePlayerEnterZone(), InvitePlayersInQueueToWar(), InvitePlayersInZoneToWar(), and npc_wg_queue::OnGossipSelect().
|
inline |
Return if battlefield is enabled.
References Enabled.
Referenced by bf_commandscript::HandleBattlefieldEnable(), and Update().
|
protected |
Returns true if the player is already tracked as actively in the war or invited to join it.
References Object::GetGUID(), Player::GetTeamId(), InvitedPlayers, and PlayersInWar.
Referenced by InvitePlayersInZoneToWar(), and InvitePlayerToWar().
|
inline |
Return true if battle is started, false if battle is not started.
References Active.
Referenced by Player::CreateCorpse(), BattlefieldWG::FillInitialWorldStates(), bf_commandscript::HandleBattlefieldQueue(), spell_wintergrasp_hide_small_elementals_aura::HandlePeriodicDummy(), HandlePlayerEnterZone(), HandlePlayerLeaveZone(), instance_vault_of_archavon::instance_vault_of_archavon_InstanceMapScript::IsEncounterInProgress(), SpellArea::IsFitToRequirements(), BattlefieldWG::OnCreatureCreate(), npc_wg_queue::OnGossipHello(), npc_wg_queue::OnGossipSelect(), BattlefieldWG::OnStartGrouping(), BattlefieldWG::OnUnitDeath(), PlayerAcceptInviteToWar(), BattlefieldWG::ProcessEvent(), BattlefieldWG::SendUpdateWorldStates(), and Update().
|
protected |
References ForEachPlayerInWar(), GetZoneId(), WorldObject::GetZoneId(), Player::isAFK(), Player::IsGameMaster(), KickPosition, and Player::TeleportTo().
Referenced by StartBattle().
| void Battlefield::KickPlayerFromBattlefield | ( | ObjectGuid | guid | ) |
Kick player from battlefield and teleport him to kick-point location.
| guid | : guid of player who must be kicked |
References ObjectAccessor::FindPlayer(), GetZoneId(), KickPosition, and PlayersInWar.
Referenced by WorldSession::HandleBfEntryInviteResponse(), BattlefieldWG::OnPlayerEnterZone(), and StartBattle().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Called when a player enters the battlefield zone.
Reimplemented in BattlefieldWG.
Referenced by HandlePlayerEnterZone().
|
inlinevirtual |
Called when a player accepts to join the battle.
Reimplemented in BattlefieldWG.
Referenced by PlayerAcceptInviteToWar().
|
inlinevirtual |
Called when a player leaves the battle.
Reimplemented in BattlefieldWG.
Referenced by HandlePlayerLeaveZone().
|
inlinevirtual |
Called when a player leaves the battlefield zone.
Reimplemented in BattlefieldWG.
Referenced by HandlePlayerLeaveZone().
|
inlinevirtual |
Called x minutes before battle start when players in zone are invited to join queue.
Reimplemented in BattlefieldWG.
Referenced by Update().
| void Battlefield::PlayerAcceptInviteToQueue | ( | Player * | player | ) |
References BattleId, Object::GetGUID(), Player::GetSession(), Player::GetTeamId(), PlayersInQueue, WorldSession::SendBfQueueInviteResponse(), and ZoneId.
Referenced by WorldSession::HandleBfQueueInviteResponse().
| void Battlefield::PlayerAcceptInviteToWar | ( | Player * | player | ) |
References AddOrSetPlayerToCorrectBfGroup(), BattleId, Object::GetGUID(), Player::GetSession(), Player::GetTeamId(), InvitedPlayers, Player::isAFK(), IsWarTime(), OnPlayerJoinWar(), PlayersInWar, WorldSession::SendBfEntered(), sScriptMgr, and Player::ToggleAFK().
Referenced by WorldSession::HandleBfEntryInviteResponse().
| void Battlefield::PlayerAskToLeave | ( | Player * | player | ) |
References Position::GetOrientation(), Player::m_homebindMapId, Player::m_homebindX, Player::m_homebindY, Player::m_homebindZ, and Player::TeleportTo().
|
protected |
| void Battlefield::RemovePlayerFromResurrectQueue | ( | ObjectGuid | playerGuid | ) |
References GraveyardList.
Referenced by HandlePlayerLeaveZone().
| void Battlefield::SendAreaSpiritHealerQueryOpcode | ( | Player * | player, |
| ObjectGuid const & | guid | ||
| ) |
References _scheduler, ASSERT, BATTLEFIELD_TIMER_GROUP_RESURRECT, TaskScheduler::GetNextGroupOccurrence(), RESURRECTION_INTERVAL, Player::SendDirectMessage(), and SMSG_AREA_SPIRIT_HEALER_TIME.
|
pure virtual |
Send all worldstate data to all players in zone.
Implemented in BattlefieldWG.
Referenced by EndBattle(), and bf_commandscript::HandleBattlefieldTimer().
|
inlineprotectedvirtual |
Referenced by HandlePlayerLeaveZone().
Update data of a worldstate to all players present in zone.
References ForEachPlayerInZone(), and Player::SendUpdateWorldState().
Referenced by BfWGGameObjectBuilding::Damaged(), BfWGGameObjectBuilding::Destroyed(), WGWorkshop::GiveControlTo(), and BfWGGameObjectBuilding::Rebuild().
|
pure virtual |
Implemented in BattlefieldWG.
Referenced by EndBattle(), StartBattle(), and Update().
| void Battlefield::SendWarning | ( | uint8 | id, |
| WorldObject const * | target = nullptr |
||
| ) |
References GetCreature(), sCreatureTextMgr, and StalkerGuid.
Referenced by BfWGGameObjectBuilding::Damaged(), BfWGGameObjectBuilding::Destroyed(), WGWorkshop::GiveControlTo(), BattlefieldWG::OnBattleEnd(), BattlefieldWG::OnBattleStart(), BattlefieldWG::OnStartGrouping(), and BattlefieldWG::PromotePlayer().
Reimplemented from ZoneScript.
References Data32.
Referenced by BattlefieldWG::OnBattleStart(), and BattlefieldWG::UpdateCounterVehicle().
Reimplemented from ZoneScript.
|
inline |
|
inline |
References GraveyardList.
Referenced by BattlefieldWG::SetupBattlefield().
|
inline |
Referenced by bf_commandscript::HandleBattlefieldTimer().
|
inlinevirtual |
Call this to init the Battlefield.
Reimplemented in BattlefieldWG.
Referenced by BattlefieldMgr::InitBattlefield().
| void Battlefield::ShowNpc | ( | Creature * | creature, |
| bool | aggressive | ||
| ) |
References Unit::IsAlive(), REACT_AGGRESSIVE, REACT_PASSIVE, Unit::RemoveUnitFlag(), Creature::Respawn(), Unit::SetPhaseMask(), Creature::SetReactState(), Unit::SetUnitFlag(), Unit::SetVisible(), UNIT_FLAG_NON_ATTACKABLE, and UNIT_FLAG_NOT_SELECTABLE.
Referenced by BattlefieldWG::OnBattleEnd(), BattlefieldWG::OnBattleStart(), BfWGGameObjectBuilding::UpdateCreatureAndGo(), and BfWGGameObjectBuilding::UpdateTurretAttack().
| Creature * Battlefield::SpawnCreature | ( | uint32 | entry, |
| float | x, | ||
| float | y, | ||
| float | z, | ||
| float | o, | ||
| TeamId | teamId | ||
| ) |
References Map::AddToMap(), BattlefieldFactions, Creature::Create(), Map::GenerateLowGuid(), LOG_ERROR, MapId, MOVE_RUN, MOVE_WALK, PHASEMASK_NORMAL, WorldObject::setActive(), Unit::SetFaction(), Creature::SetHomePosition(), Unit::SetSpeed(), sMapMgr, sObjectMgr, CreatureTemplate::speed_run, CreatureTemplate::speed_walk, TEAM_ALLIANCE, TEAM_HORDE, and Unit.
Referenced by BfWGGameObjectBuilding::Init(), InitStalker(), BattlefieldWG::SetupBattlefield(), and SpawnCreature().
References Position::m_orientation, Position::m_positionX, Position::m_positionY, Position::m_positionZ, and SpawnCreature().
| GameObject * Battlefield::SpawnGameObject | ( | uint32 | entry, |
| float | x, | ||
| float | y, | ||
| float | z, | ||
| float | o | ||
| ) |
References Map::AddToMap(), GameObject::Create(), GameObject, Map::GenerateLowGuid(), GO_STATE_READY, LOG_ERROR, MapId, PHASEMASK_NORMAL, WorldObject::setActive(), sMapMgr, and sObjectMgr.
Referenced by BfWGGameObjectBuilding::Init(), BattlefieldWG::OnBattleStart(), and BattlefieldWG::SetupBattlefield().
| void Battlefield::StartBattle | ( | ) |
References _scheduler, Active, BATTLEFIELD_TIMER_GROUP_WAR, BattleTime, BF_START, DoPlaySoundToAll(), GameTime::GetGameTime(), InvitedPlayers, InvitePlayersInQueueToWar(), InvitePlayersInZoneToWar(), KickAfkPlayers(), KickPlayerFromBattlefield(), OnBattleStart(), PlayersInWar, PlayersWillBeKick, PVP_TEAMS_COUNT, TaskContext::Repeat(), TaskScheduler::Schedule(), and SendUpdateWorldStates().
Referenced by bf_commandscript::HandleBattlefieldStart(), and Update().
References Unit::CastSpell(), ForEachPlayerInWar(), and Unit::RemoveAuraFromStack().
|
inline |
Enable or Disable battlefield.
References Enabled.
Referenced by bf_commandscript::HandleBattlefieldEnable().
|
virtual |
Called every time for update bf data and time.
| diff | : time elapsed since last call (in ms) |
Reimplemented in BattlefieldWG.
References _scheduler, Active, CapturePoints, CONFIG_WINTERGRASP_SKIP_BATTLE_SESSION_COUNT, EndBattle(), InvitePlayersInZoneToQueue(), IsEnabled(), IsWarTime(), OnStartGrouping(), SendUpdateWorldStates(), StartBattle(), StartGrouping, StartGroupingTimer, sWorld, sWorldSessionMgr, and TaskScheduler::Update().
Referenced by BattlefieldMgr::Update(), and BattlefieldWG::Update().
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by BattlefieldWG::SetupBattlefield(), and StartBattle().
|
protected |
Referenced by GetCreature(), GetGameObject(), and BattlefieldWG::SetupBattlefield().
|
protected |
Referenced by AddCapturePoint(), HandlePlayerLeaveZone(), BattlefieldWG::OnBattleStart(), Update(), and ~Battlefield().
|
protected |
Referenced by GetData(), SetData(), BattlefieldWG::SetupBattlefield(), and UpdateData().
|
protected |
|
protected |
|
protected |
Referenced by IsEnabled(), BattlefieldWG::SetupBattlefield(), and ToggleBattlefield().
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by KickAfkPlayers(), KickPlayerFromBattlefield(), and BattlefieldWG::SetupBattlefield().
|
protected |
|
protected |
Referenced by GetMaxPlayersPerTeam(), HasWarVacancy(), and BattlefieldWG::SetupBattlefield().
|
protected |
Referenced by InvitePlayerToWar(), and BattlefieldWG::SetupBattlefield().
|
protected |
Referenced by InvitePlayerToQueue(), and BattlefieldWG::SetupBattlefield().
|
protected |
Referenced by EndBattle(), and BattlefieldWG::SetupBattlefield().
|
protected |
Referenced by BattlefieldWG::CapturePointTaken(), ForEachPlayerInZone(), GetPlayersInZoneCount(), HandlePlayerEnterZone(), HandlePlayerLeaveZone(), HasPlayer(), BattlefieldWG::OnBattleEnd(), BattlefieldWG::OnBattleStart(), BattlefieldWG::SendInitWorldStatesToAll(), and BattlefieldWG::UpdateVehicleCountWG().
|
protected |
|
protected |
Referenced by ForEachPlayerInWar(), ForEachPlayerInWar(), GetPlayersInWarCount(), GetPlayersInWarSet(), BattlefieldWG::HandleKill(), HandlePlayerLeaveZone(), IsPlayerInWarOrInvited(), KickPlayerFromBattlefield(), BattlefieldWG::OnBattleEnd(), PlayerAcceptInviteToWar(), StartBattle(), BattlefieldWG::UpdatedDestroyedTowerCount(), and BattlefieldWG::UpdateTenacity().
|
protected |
Referenced by HandlePlayerEnterZone(), HandlePlayerLeaveZone(), InvitePlayersInZoneToWar(), InvitePlayerToWar(), and StartBattle().
|
protected |
Referenced by BattlefieldWG::SetupBattlefield().
|
protected |
Referenced by InitStalker(), and SendWarning().
|
protected |
Referenced by EndBattle(), BattlefieldWG::SetupBattlefield(), and Update().
|
protected |
Referenced by HandlePlayerEnterZone(), BattlefieldWG::SetupBattlefield(), and Update().
|
protected |
Referenced by InvitePlayerToWar(), and BattlefieldWG::SetupBattlefield().
|
protected |
Referenced by GetTimer().
|
protected |
Referenced by GetTypeId(), and BattlefieldWG::SetupBattlefield().
|
protected |