82 snprintf(str,
sizeof(str), text, arg1str, arg2str);
100 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
158 for (
uint32 i = 0; i < size; ++i)
162 for (
uint32 i = 0; i < size; ++i)
270 for (BattlegroundPlayerMap::const_iterator itr =
GetPlayers().begin(); itr !=
GetPlayers().end(); ++itr)
273 player->GetPosition(&pos);
277 SF_LOG_DEBUG(
"bg.battleground",
"BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", player->GetName().c_str(),
GetMapId());
278 player->TeleportTo(
GetMapId(), x, y, z, o);
292 if (itr->second.OfflineRemoveTime <=
sWorld->GetGameTime())
316 for (std::vector<uint64>::const_iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
335 (itr->second).clear();
427 for (BattlegroundPlayerMap::const_iterator itr =
GetPlayers().begin(); itr !=
GetPlayers().end(); ++itr)
429 player->ResetAllPowers();
438 data <<
uint32(countdownMaxForBGType);
442 for (BattlegroundPlayerMap::const_iterator itr =
GetPlayers().begin(); itr !=
GetPlayers().end(); ++itr)
444 player->GetSession()->SendPacket(&data);
499 for (BattlegroundPlayerMap::const_iterator itr =
GetPlayers().begin(); itr !=
GetPlayers().end(); ++itr)
505 uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId);
508 player->GetSession()->SendPacket(&status);
514 player->ResetAllPowers();
515 if (!player->IsGameMaster())
519 for (Unit::AuraApplicationMap::iterator iter = auraMap.begin(); iter != auraMap.end();)
528 player->RemoveAura(iter);
541 for (BattlegroundPlayerMap::const_iterator itr =
GetPlayers().begin(); itr !=
GetPlayers().end(); ++itr)
545 player->ResetAllPowers();
567 BattlegroundPlayerMap::iterator itr, next;
586 SF_LOG_ERROR(
"bg.battleground",
"Battleground::%s: player (GUID: %u) not found for BG (map: %u, instance id: %u)!",
594 return _GetPlayer(itr->first, itr->second.OfflineRemoveTime, context);
599 return _GetPlayer(itr->first, itr->second.OfflineRemoveTime, context);
607 uint32 team = itr->second.Team;
627 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
629 player->SendDirectMessage(packet);
634 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
638 if (self || sender != player)
639 player->SendDirectMessage(packet);
654 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
658 player->SendDirectMessage(&data);
664 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
666 player->CastSpell(player, SpellID,
true);
671 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
673 player->RemoveAura(SpellID);
678 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
683 player->SendDirectMessage(&data);
689 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
697 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
699 player->GetReputationMgr().ModifyReputation(factionEntry, Reputation);
723 uint32 loserTeamRating = 0;
724 uint32 loserMatchmakerRating = 0;
725 int32 loserChange = 0;
726 int32 loserMatchmakerChange = 0;
727 uint32 winnerTeamRating = 0;
728 uint32 winnerMatchmakerRating = 0;
729 int32 winnerChange = 0;
730 int32 winnerMatchmakerChange = 0;
742 else if (winner ==
HORDE)
765 if (winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam)
769 loserTeamRating = loserArenaTeam->
GetRating();
771 winnerTeamRating = winnerArenaTeam->
GetRating();
773 winnerMatchmakerChange = winnerArenaTeam->
WonAgainst(winnerMatchmakerRating, loserMatchmakerRating, winnerChange);
774 loserMatchmakerChange = loserArenaTeam->
LostAgainst(loserMatchmakerRating, winnerMatchmakerRating, loserChange);
775 SF_LOG_DEBUG(
"bg.arena",
"match Type: %u --- Winner: old rating: %u, rating gain: %d, old MMR: %u, MMR gain: %d --- Loser: old rating: %u, rating loss: %d, old MMR: %u, MMR loss: %d ---",
m_ArenaType, winnerTeamRating, winnerChange, winnerMatchmakerRating,
776 winnerMatchmakerChange, loserTeamRating, loserChange, loserMatchmakerRating, loserMatchmakerChange);
786 SF_LOG_DEBUG(
"bg.arena",
"Statistics match Type: %u for %s (GUID: " UI64FMTD ", IP: %s): %u damage, %u healing, %u killing blows",
787 m_ArenaType, player->GetName().c_str(), itr->first, player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone,
788 itr->second->KillingBlows);
807 bool guildAwarded =
false;
814 for (BattlegroundPlayerMap::iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
816 uint32 team = itr->second.Team;
818 if (itr->second.OfflineRemoveTime)
821 if (
isArena() &&
isRated() && winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam)
824 winnerArenaTeam->
OfflineMemberLost(itr->first, loserMatchmakerRating, winnerMatchmakerChange);
826 loserArenaTeam->
OfflineMemberLost(itr->first, winnerMatchmakerRating, loserMatchmakerChange);
856 if (
isArena() &&
isRated() && winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam)
866 winnerArenaTeam->
MemberWon(player, loserMatchmakerRating, winnerMatchmakerChange);
870 loserArenaTeam->
MemberLost(player, winnerMatchmakerRating, loserMatchmakerChange);
908 if (
isArena() &&
isRated() && winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam)
933 if (
isArena() &&
isRated() && winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam)
965 bool participant =
false;
967 BattlegroundPlayerMap::iterator itr =
m_Players.find(guid);
976 BattlegroundScoreMap::iterator itr2 =
PlayerScores.find(guid);
1011 if (!team) team = player->
GetTeam();
1027 if (winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam)
1049 if (others_arena_team && players_arena_team)
1057 if (!group->RemoveMember(guid))
1087 SF_LOG_DEBUG(
"bg.battleground",
"Removed player %s from Battleground.", player->
GetName().c_str());
1107 SF_LOG_ERROR(
"bg.battleground",
"Battleground::Reset: one of the counters is not 0 (alliance: %u, horde: %u) for BG (map: %u, instance id: %u)!",
1210 data <<
uint32(countdownMaxForBGType);
1256 if (originalGroup->IsLeader(playerGuid))
1376 diff = std::min(diff, diff2);
1378 return std::min(diff, diff3);
1398 itr->second->KillingBlows += value;
1401 itr->second->Deaths += value;
1404 itr->second->HonorableKills += value;
1414 itr->second->BonusHonor += value;
1419 itr->second->DamageDone += value;
1422 itr->second->HealingDone += value;
1425 SF_LOG_ERROR(
"bg.battleground",
"Battleground::UpdatePlayerScore: unknown score type (%u) for BG (map: %u, instance id: %u)!",
1446 for (std::vector<uint64>::iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
1448 if (*itr2 == player_guid)
1450 (itr->second).erase(itr2);
1463 if (!ghostList.empty())
1466 for (std::vector<uint64>::const_iterator itr = ghostList.begin(); itr != ghostList.end(); ++itr)
1482bool Battleground::AddObject(
uint32 type,
uint32 entry,
float x,
float y,
float z,
float o,
float rotation0,
float rotation1,
float rotation2,
float rotation3,
uint32 )
1497 SF_LOG_ERROR(
"sql.sql",
"Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
1499 SF_LOG_ERROR(
"bg.battleground",
"Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
1553 SF_LOG_ERROR(
"bg.battleground",
"Battleground::DoorClose: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
1565 SF_LOG_ERROR(
"bg.battleground",
"Battleground::DoorOpen: door gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
1573 SF_LOG_ERROR(
"bg.battleground",
"Battleground::GetBGObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
1582 SF_LOG_ERROR(
"bg.battleground",
"Battleground::GetBGCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
1598 obj->SetRespawnTime(respawntime);
1615 SF_LOG_ERROR(
"bg.battleground",
"Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
1626 SF_LOG_ERROR(
"bg.battleground",
"Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!",
1656 creature->AddObjectToRemoveList();
1661 SF_LOG_ERROR(
"bg.battleground",
"Battleground::DelCreature: creature (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
1674 obj->SetRespawnTime(0);
1679 SF_LOG_ERROR(
"bg.battleground",
"Battleground::DelObject: gameobject (type: %u, GUID: %u) not found for BG (map: %u, instance id: %u)!",
1706 SF_LOG_ERROR(
"bg.battleground",
"Battleground::AddSpiritGuide: cannot create spirit guide (type: %u, entry: %u) for BG (map: %u, instance id: %u)!",
1728 va_start(ap, source);
1742 std::map<uint32, WorldPacket> localizedPackets;
1744 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
1747 if (localizedPackets.find(player->GetSession()->GetSessionDbLocaleIndex()) == localizedPackets.end())
1749 char const* format =
sObjectMgr->GetSkyFireString(entry, player->GetSession()->GetSessionDbLocaleIndex());
1753 va_start(ap, entry);
1760 player->SendDirectMessage(&localizedPackets[player->GetSession()->GetSessionDbLocaleIndex()]);
1782 return sObjectMgr->GetSkyFireStringForDBCLocale(entry);
1796 while (index >= 0 &&
BgObjects[index] != go_guid)
1800 SF_LOG_ERROR(
"bg.battleground",
"Battleground::HandleTriggerBuff: cannot find buff gameobject (GUID: %u, entry: %u, type: %u) in internal data for BG (map: %u, instance id: %u)!",
1806 uint8 buff = std::rand() % 2;
1813 for (
uint8 currBuffTypeIndex = 0; currBuffTypeIndex < 3; ++currBuffTypeIndex)
1816 index -= currBuffTypeIndex;
1834 if (killer == victim)
1840 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
1843 if (!creditedPlayer || creditedPlayer == killer)
1863 BattlegroundPlayerMap::const_iterator itr =
m_Players.find(guid);
1865 return itr->second.Team;
1871 BattlegroundPlayerMap::const_iterator itr =
m_Players.find(guid);
1873 return itr->second.ActiveSpec;
1884 BattlegroundPlayerMap::const_iterator itr =
m_Players.find(guid);
1910 for (BattlegroundPlayerMap::const_iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
1912 if (itr->second.Team ==
Team)
1932 SF_LOG_ERROR(
"bg.battleground",
"Battleground::GetObjectType: player used gameobject (GUID: %u) which is not in internal data for BG (map: %u, instance id: %u), cheating?",
1975 for (BattlegroundPlayerMap::const_iterator itr =
GetPlayers().begin(); itr !=
GetPlayers().end(); ++itr)
1977 player->StartTimedAchievement(type, entry);
2003 SF_LOG_DEBUG(
"bg.battleground",
"Unhandled AreaTrigger %u in Battleground %u. Player coords (x: %f, y: %f, z: %f)",
2009 SF_LOG_ERROR(
"bg.battleground",
"Battleground::CheckAchievementCriteriaMeet: No implementation for criteria %u", criteriaId);
@ TIME_AUTOCLOSE_BATTLEGROUND
@ BATTLEGROUND_COUNTDOWN_MAX
@ CHECK_PLAYER_POSITION_INVERVAL
@ BG_CREATURE_ENTRY_H_SPIRITGUIDE
@ BG_CREATURE_ENTRY_A_SPIRITGUIDE
uint32 const Buff_Entries[3]
@ SPELL_ALLIANCE_GOLD_FLAG
@ SPELL_THE_LAST_STANDING
@ SPELL_SPIRIT_HEAL_CHANNEL
@ SPELL_ARENA_PREPARATION
@ SPELL_HONORABLE_DEFENDER_25Y
@ SPELL_RESURRECTION_VISUAL
@ SPELL_ALLIANCE_GREEN_FLAG
@ SPELL_WAITING_FOR_RESURRECT
@ SPELL_HONORABLE_DEFENDER_60Y
#define ARENA_TIMELIMIT_POINTS_LOSS
@ BG_STARTING_EVENT_THIRD
@ BG_STARTING_EVENT_SECOND
@ BG_STARTING_EVENT_FIRST
@ BG_STARTING_EVENT_FOURTH
@ CURRENCY_TYPE_CONQUEST_META_ARENA
AchievementCriteriaTimedTypes
@ ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE
@ ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP
@ ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET
@ ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL
@ ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND
@ ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE
@ ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL
@ ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE
@ ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA
@ ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE
@ ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA
@ ACHIEVEMENT_CRITERIA_TYPE_WIN_BG
@ ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL
@ ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE
@ ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS
@ ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA
DBCStorage< FactionEntry > sFactionStore(FactionEntryfmt)
@ LANG_BG_STARTED_ANNOUNCE_WORLD
@ LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING
@ LANG_BG_WS_START_ONE_MINUTE
@ LANG_BG_WS_START_HALF_MINUTE
@ LANG_BATTLEGROUND_PREMATURE_FINISH_WARNING_SECS
@ LANG_BG_WS_START_TWO_MINUTES
#define SF_LOG_DEBUG(filterType__,...)
#define SF_LOG_ERROR(filterType__,...)
uint32 GUID_LOPART(uint64 x)
uint64 MAKE_NEW_GUID(uint32 l, uint32 e, uint32 h)
@ SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY
@ CHAT_MSG_BG_SYSTEM_NEUTRAL
@ CHAT_MSG_RAID_BOSS_EMOTE
@ SPELL_AURA_MOD_SHAPESHIFT
@ SPELL_AURA_SPIRIT_OF_REDEMPTION
@ SPELL_AURA_MOD_INVISIBILITY
@ FORM_SPIRITOFREDEMPTION
@ UNIT_FIELD_MOD_CASTING_SPEED
@ UNIT_FIELD_CHANNEL_OBJECT
@ UNIT_FIELD_SHAPESHIFT_FORM
@ UNIT_FIELD_MOD_SPELL_HASTE
@ UNIT_FIELD_CHANNEL_SPELL
@ PLAYER_FIELD_PLAYER_FLAGS
int32 WonAgainst(uint32 ownMMRating, uint32 opponentMMRating, int32 &rating_change)
void OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating, int32 matchmakerRatingChange=-12)
void MemberWon(Player *player, uint32 againstMatchmakerRating, int32 matchmakerRatingChange=12)
void FinishGame(int32 mod)
void NotifyStatsChanged()
void MemberLost(Player *player, uint32 againstMatchmakerRating, int32 matchmakerRatingChange=-12)
int32 LostAgainst(uint32 ownMMRating, uint32 opponentMMRating, int32 &rating_change)
int32 GetDuration() const
bool HasEffectType(AuraType type) const
SpellInfo const * GetSpellInfo() const
void UnSummonCurrentBattlePet(bool temporary)
void GetTeamStartLoc(uint32 TeamID, float &X, float &Y, float &Z, float &O) const
virtual void AddPlayer(Player *player)
void SetRemainingTime(uint32 Time)
uint32 GetAlivePlayersCountByTeam(uint32 Team) const
BattlegroundTypeId GetTypeID(bool GetRandom=false) const
void EndBattleground(uint32 winner)
virtual void HandleKillUnit(Creature *, Player *)
uint32 GetReviveQueueSize() const
char const * GetName() const
Group * m_BgRaids[BG_TEAMS_COUNT]
uint32 GetMinLevel() const
void ModifyStartDelayTime(int diff)
uint32 m_ArenaTeamIds[BG_TEAMS_COUNT]
void CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
void SetElapsedTime(uint32 Time)
virtual void HandleKillPlayer(Player *player, Player *killer)
static TeamId GetTeamIndexByTeamId(uint32 Team)
virtual bool SetupBattleground()
float m_TeamStartLocX[BG_TEAMS_COUNT]
void DoorOpen(uint32 type)
uint32 GetMinPlayersPerTeam() const
void PlayerAddedToBGCheckIfBGIsRunning(Player *player)
bool DelCreature(uint32 type)
uint8 GetArenaType() const
float m_TeamStartLocY[BG_TEAMS_COUNT]
BattlegroundPlayerMap m_Players
void SpawnBGObject(uint32 type, uint32 respawntime)
uint32 GetMaxPlayersPerTeam() const
uint32 m_ValidStartPositionTimer
void SendPacketToAll(WorldPacket *packet)
void UpdateWorldStateForPlayer(uint32 Field, uint32 Value, Player *player)
void HandleTriggerBuff(uint64 go_guid)
void YellToAll(Creature *creature, const char *text, Language language)
void AddOrSetPlayerToCorrectBgGroup(Player *player, uint32 team)
void PlaySoundToAll(uint32 SoundID)
uint32 GetArenaMatchmakerRating(uint32 Team) const
uint32 m_ClientInstanceID
void AddToBGFreeSlotQueue()
BattlegroundTypeId m_TypeID
std::map< uint64, std::vector< uint64 > > m_ReviveQueue
void PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
Group * GetBgRaid(uint32 TeamID) const
uint32 GetPlayerActiveSpec(uint64 guid) const
uint32 m_LastResurrectTime
uint32 GetOtherTeam(uint32 teamId) const
uint32 GetMaxPlayers() const
BattlegroundMap * GetBgMap() const
virtual void PostUpdateImpl(uint32)
Post-update hook.
BattlegroundTypeId m_RandomTypeID
void SetBracket(PvPDifficultyEntry const *bracketEntry)
void DecreaseInvitedCount(uint32 team)
void _ProcessRessurect(uint32 diff)
void CheckArenaWinConditions()
uint32 m_ArenaTeamMMR[BG_TEAMS_COUNT]
uint32 GetArenaTeamIdForTeam(uint32 Team) const
BattlegroundMap * FindBgMap() const
void BlockMovement(Player *player)
uint32 GetRemainingTime() const
void RemoveAuraOnTeam(uint32 SpellID, uint32 TeamID)
virtual void ResetBGSubclass()
void DoorClose(uint32 type)
float m_TeamStartLocZ[BG_TEAMS_COUNT]
void RelocateDeadPlayers(uint64 queueIndex)
Relocate all players in ReviveQueue to the closest graveyard.
void SetBgRaid(uint32 TeamID, Group *bg_raid)
bool m_PrematureCountDown
uint32 GetInstanceID() const
uint32 m_PrematureCountDownTimer
virtual void RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket)
int32 GetObjectType(uint64 guid)
BattlegroundScoreMap::const_iterator GetPlayerScoresBegin() const
void SetLevelRange(uint32 min, uint32 max)
void EventPlayerLoggedOut(Player *player)
void UpdateWorldState(uint32 Field, uint32 Value)
const char * GetSkyFireString(int32 entry)
Player * _GetPlayer(uint64 guid, bool offlineRemove, const char *context) const
void RewardXPAtKill(Player *killer, Player *victim)
void SetStatus(BattlegroundStatus Status)
virtual void StartingEventCloseDoors()
BattlegroundBracketId m_BracketId
void BroadcastWorker(Do &_do)
BattlegroundStartTimeIntervals StartDelayTimes[BG_STARTING_EVENT_COUNT]
void SetWinner(uint8 winner)
void SetArenaMatchmakerRating(uint32 Team, uint32 MMR)
void AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid)
int32 m_ArenaTeamRatingChanges[BG_TEAMS_COUNT]
bool DelObject(uint32 type)
BattlegroundPlayerMap const & GetPlayers() const
int32 GetStartDelayTime() const
virtual void RemovePlayer(Player *, uint64, uint32)
BattlegroundScoreMap PlayerScores
virtual void StartingEventOpenDoors()
float GetStartMaxDist() const
bool isBattleground() const
uint32 m_MinPlayersPerTeam
virtual bool ShouldDelayStartForDebug() const
void SetLastResurrectTime(uint32 Time)
void RewardHonorToTeam(uint32 Honor, uint32 TeamID)
void SendWarningToAll(int32 entry,...)
bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, uint32 team)
void SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, float O)
BattlegroundStatus GetStatus() const
bool HasFreeSlots() const
virtual bool CheckAchievementCriteriaMeet(uint32, Player const *, Unit const *=NULL, uint32=0)
virtual WorldSafeLocsEntry const * GetClosestGraveYard(Player *player)
uint32 m_PlayersCount[BG_TEAMS_COUNT]
virtual void HandleAreaTrigger(Player *, uint32)
void _ProcessOfflineQueue()
void RemoveFromBGFreeSlotQueue()
void _ProcessProgress(uint32 diff)
float m_TeamStartLocO[BG_TEAMS_COUNT]
void SetHoliday(bool is_holiday)
GameObject * GetBGObject(uint32 type)
uint32 GetPlayersCountByTeam(uint32 Team) const
virtual bool PreUpdateImpl(uint32)
Pre-update hook.
void UpdateArenaWorldState()
uint32 GetTeamScore(uint32 TeamID) const
void StartTimedAchievement(AchievementCriteriaTimedTypes type, uint32 entry)
uint32 m_MaxPlayersPerTeam
void EventPlayerLoggedIn(Player *player)
void SetArenaTeamRatingChangeForTeam(uint32 Team, int32 RatingChange)
void SendMessage2ToAll(int32 entry, ChatMsg type, Player const *source, int32 strId1=0, int32 strId2=0)
void _CheckSafePositions(uint32 diff)
std::vector< uint64 > m_ResurrectQueue
void _ProcessJoin(uint32 diff)
BattlegroundBracketId GetBracketId() const
void UpdatePlayersCountByTeam(uint32 Team, bool remove)
void SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *sender=NULL, bool self=true)
bool IsPlayerInBattleground(uint64 guid) const
uint32 GetBonusHonorFromKill(uint32 kills) const
void RewardReputationToTeam(uint32 faction_id, uint32 Reputation, uint32 TeamID)
uint32 GetMaxLevel() const
virtual void UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true)
BattlegroundScoreMap::const_iterator GetPlayerScoresEnd() const
Creature * AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime=0)
uint32 GetElapsedTime() const
uint32 GetPlayersSize() const
uint32 GetPlayerTeam(uint64 guid) const
void PSendMessageToAll(int32 entry, ChatMsg type, Player const *source,...)
void SendMessageToAll(int32 entry, ChatMsg type, Player const *source=NULL)
int32 m_TeamScores[BG_TEAMS_COUNT]
std::deque< uint64 > m_OfflineQueue
Creature * GetBGCreature(uint32 type)
void SetStartDelayTime(int Time)
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)
uint32 GetFreeSlotsForTeam(uint32 Team) const
void RemovePlayerFromResurrectQueue(uint64 player_guid)
uint32 GetInvitedCount(uint32 team) const
void _ProcessLeave(uint32 diff)
virtual uint32 GetPrematureWinner()
Player * _GetPlayerForTeam(uint32 teamId, BattlegroundPlayerMap::const_iterator itr, const char *context) const
BattlegroundStatus m_Status
void CheckArenaAfterTimerConditions()
uint32 StartMessageIds[BG_STARTING_EVENT_COUNT]
static BattlegroundQueueTypeId BGQueueTypeId(BattlegroundTypeId bgTypeId, uint8 arenaType)
static bool IsBGWeekend(BattlegroundTypeId bgTypeId)
static size_t BuildChatPacket(WorldPacket &data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string const &message, uint8 chatTag, std::string const &senderName="", std::string const &receiverName="", uint32 achievementId=0, bool gmMessage=false, std::string const &channelName="", std::string const &addonPrefix="")
void SetHomePosition(float x, float y, float z, float o)
void SetRespawnDelay(uint32 delay)
bool Create(uint32 guidlow, Map *map, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData *data=NULL)
bool Create(uint32 guidlow, uint32 name_id, Map *map, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit=0)
static GameObject * GetGameObject(WorldObject &object, uint64 guid)
GameobjectTypes GetGoType() const
bool SetPhased(uint32 id, bool update, bool apply) OVERRIDE
bool AddMember(Player *player)
uint8 GetMemberGroup(uint64 guid) const
void SetBattlegroundGroup(Battleground *bg)
bool IsMember(uint64 guid) const
bool Create(Player *leader)
void ChangeLeader(uint64 guid)
GameObject * GetGameObject(uint64 guid)
Creature * GetCreature(uint64 guid)
static Player * FindPlayer(uint64)
void SetFlag(uint16 index, uint32 newFlag)
bool HasFlag(uint16 index, uint32 flag) const
bool HasByteFlag(uint16 index, uint8 offset, uint8 flag) const
void SetBGTeam(uint32 team)
BattlePetMgr * GetBattlePetMgr()
uint32 GetTalentSpecialization(uint8 spec) const
void SendDirectMessage(WorldPacket *data)
uint32 GetBattlegroundQueueJoinTime(BattlegroundTypeId bgTypeId) const
uint32 GetArenaPersonalRating(uint8) const
bool IsAtGroupRewardDistance(WorldObject const *pRewardSource) const
WorldSession * GetSession() const
void DestroyConjuredItems(bool update)
void UnsummonPetTemporaryIfAny()
void RemoveBattlegroundQueueId(BattlegroundQueueTypeId val)
bool GetRandomWinner() const
void RewardPlayerAndGroupAtKill(Unit *victim, bool isBattleGround)
void ModifyCurrency(uint32 id, int32 count, bool printLog=true, bool ignoreMultipliers=false)
void ResetAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1=0, uint64 miscValue2=0, bool evenIfCriteriaComplete=false)
void RemovePet(Pet *pet, PetSaveMode mode, bool returnreagent=false)
bool TeleportToBGEntryPoint()
void RemoveBattlegroundQueueJoinTime(BattlegroundTypeId bgTypeId)
void SetClientControl(Unit *target, uint8 allowMove)
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, Unit *unit=NULL)
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0)
uint8 GetActiveSpec() const
uint32 GetBattlegroundQueueIndex(BattlegroundQueueTypeId bgQueueTypeId) const
bool RewardHonor(Unit *victim, uint32 groupsize, int32 honor=-1, bool pvptoken=false)
void ResummonPetTemporaryUnSummonedIfAny()
void SetBattlegroundId(uint32 val, BattlegroundTypeId bgTypeId)
Group * GetOriginalGroup()
void SetBattlegroundOrBattlefieldRaid(Group *group, int8 subgroup=-1)
void RemoveArenaEnchantments(EnchantmentSlot slot)
void SetRandomWinner(bool isWinner)
void ResurrectPlayer(float restore_percent, bool applySickness=false)
void operator()(WorldPacket &data, LocaleConstant loc_idx)
Battleground2ChatBuilder(ChatMsg msgtype, int32 textId, int32 arg1, int32 arg2, Player const *source=NULL, Player const *target=NULL)
void do_helper(WorldPacket &data, char const *text)
void operator()(WorldPacket &data, LocaleConstant loc_idx)
BattlegroundChatBuilder(ChatMsg msgtype, int32 textId, Player const *source, Player *const target=NULL, va_list *args=NULL)
void CombatStop(bool includingCast=false)
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
std::multimap< uint32, AuraApplication * > AuraApplicationMap
bool HasAuraType(AuraType auraType) const
HostileRefManager & getHostileRefManager()
void RemoveAurasByType(AuraType auraType, uint64 casterGUID=0, Aura *except=NULL, bool negative=true, bool positive=true)
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
void CombatStopWithPets(bool includingCast=false)
std::set< uint32 > const & GetPhases() const
std::string const & GetName() const
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
@ CONFIG_BG_REWARD_WINNER_HONOR_FIRST
@ CONFIG_BG_REWARD_WINNER_HONOR_LAST
@ CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD
@ CONFIG_BG_REWARD_WINNER_CONQUEST_LAST
@ CONFIG_BG_REWARD_LOSER_HONOR_FIRST
@ CONFIG_BG_REWARD_LOSER_HONOR_LAST
@ CONFIG_BG_REWARD_WINNER_CONQUEST_FIRST
@ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE
@ CONFIG_ARENA_LOG_EXTENDED_INFO
uint32 hk_honor_at_level(uint8 level, float multiplier=1.0f)
float GetPositionZ() const
float GetOrientation() const
float GetPositionX() const
float GetPositionY() const
float GetExactDistSq(float x, float y, float z) const
BattlegroundBracketId GetBracketId() const