749 bool guildAwarded =
false;
759 else if (winner ==
HORDE)
773 uint64 battlegroundId = 1;
781 Field* fields = result->Fetch();
782 battlegroundId = fields[0].
GetUInt64() + 1;
802 for (BattlegroundPlayerMap::iterator itr =
m_Players.begin(); itr !=
m_Players.end(); ++itr)
804 uint32 team = itr->second.Team;
814 if (!player->IsAlive())
816 player->ResurrectPlayer(1.0f);
817 player->SpawnCorpseBones();
822 player->CombatStop();
823 player->getHostileRefManager().deleteReferences();
836 BattlegroundScoreMap::const_iterator score =
PlayerScores.find(player->GetGUID());
839 stmt->
setUInt64(1, player->GetGUID().GetCounter());
840 stmt->
setBool (2, team == winner);
841 stmt->
setUInt32(3, score->second->GetKillingBlows());
842 stmt->
setUInt32(4, score->second->GetDeaths());
843 stmt->
setUInt32(5, score->second->GetHonorableKills());
844 stmt->
setUInt32(6, score->second->GetBonusHonor());
845 stmt->
setUInt32(7, score->second->GetDamageDone());
846 stmt->
setUInt32(8, score->second->GetHealingDone());
847 stmt->
setUInt32(9, score->second->GetAttr1());
848 stmt->
setUInt32(10, score->second->GetAttr2());
849 stmt->
setUInt32(11, score->second->GetAttr3());
850 stmt->
setUInt32(12, score->second->GetAttr4());
851 stmt->
setUInt32(13, score->second->GetAttr5());
862 if (!player->GetRandomWinner())
866 player->SetRandomWinner(
true);
889 player->ResetAllPowers();
890 player->CombatStopWithPets(
true);
894 player->SendDirectMessage(pvpLogData.
Write());
897 sBattlegroundMgr->BuildBattlegroundStatusActive(&battlefieldStatus,
this, player, player->GetBattlegroundQueueIndex(bgQueueTypeId), player->GetBattlegroundQueueJoinTime(bgQueueTypeId),
GetArenaType());
898 player->SendDirectMessage(battlefieldStatus.
Write());
void Execute(const char *sql)
Definition: DatabaseWorkerPool.h:87
virtual bool UpdatePlayerScore(Player *player, uint32 type, uint32 value, bool doAddHonor=true)
Definition: Battleground.cpp:1381
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:165
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: QueryResult.h:107
uint64 GetUInt64() const
Definition: Field.h:184
uint8 GetUniqueBracketId() const
Definition: Battleground.cpp:1945
uint32 GetBonusHonorFromKill(uint32 kills) const
Definition: Battleground.cpp:907
Definition: Battleground.h:58
void SetRemainingTime(uint32 Time)
Definition: Battleground.h:298
#define sGuildMgr
Definition: GuildMgr.h:61
Class used to access individual fields of database query result.
Definition: Field.h:56
void setUInt8(const uint8 index, const uint8 value)
Definition: PreparedStatement.cpp:97
static BattlegroundQueueTypeId BGQueueTypeId(BattlegroundTypeId bgTypeId, uint8 arenaType)
Definition: BattlegroundMgr.cpp:623
Definition: DBCEnums.h:199
BattlegroundPlayerMap m_Players
Definition: Battleground.h:548
arena_t NULL
Definition: jemalloc_internal.h:624
BattlegroundMap * GetBgMap() const
Definition: Battleground.h:356
Definition: DBCEnums.h:762
Definition: DBCEnums.h:210
#define sWorld
Definition: World.h:887
uint64 LowType
Definition: ObjectGuid.h:199
Definition: PreparedStatement.h:74
Definition: CharacterDatabase.h:572
Definition: Language.h:727
Definition: BattlegroundPackets.h:89
Definition: SharedDefines.h:1000
Definition: Language.h:633
void setBool(const uint8 index, const bool value)
Definition: PreparedStatement.cpp:88
bool IsRandom() const
Definition: Battleground.h:285
Definition: Battleground.h:126
void SendMessageToAll(uint32 entry, ChatMsg type, Player const *source=NULL)
Definition: Battleground.cpp:1706
uint8 GetArenaType() const
Definition: Battleground.h:281
void PlaySoundToAll(uint32 SoundID)
Definition: Battleground.cpp:681
Definition: SharedDefines.h:4267
Definition: SpellAuraDefines.h:236
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:102
Definition: Language.h:634
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
uint64_t uint64
Definition: Define.h:149
void BuildPvPLogDataPacket(WorldPackets::Battleground::PVPLogData &pvpLogData)
Definition: Battleground.cpp:1322
bool isBattleground() const
Definition: Battleground.h:327
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void RemoveFromBGFreeSlotQueue()
Definition: Battleground.cpp:1241
Definition: Language.h:728
Definition: SharedDefines.h:4552
void BlockMovement(Player *player)
Definition: Battleground.cpp:914
Definition: Battleground.h:115
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
Definition: SharedDefines.h:999
static bool IsBGWeekend(BattlegroundTypeId bgTypeId)
Definition: BattlegroundMgr.cpp:856
void SetWinner(BattlegroundTeamId winnerTeamId)
Definition: Battleground.h:306
Definition: BattlegroundScore.h:30
Definition: SharedDefines.h:4551
Definition: Battleground.h:116
BattlegroundQueueTypeId
Definition: SharedDefines.h:4732
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
Player * _GetPlayer(ObjectGuid guid, bool offlineRemove, const char *context) const
Definition: Battleground.cpp:617
BattlegroundTeamId GetWinner() const
Definition: Battleground.h:282
Definition: Battleground.h:160
Definition: BattlegroundPackets.h:170
void setUInt64(const uint8 index, const uint64 value)
Definition: PreparedStatement.cpp:124
Definition: SpellAuraDefines.h:96
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:181
BattlegroundTypeId GetTypeID(bool GetRandom=false) const
Definition: Battleground.h:263
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
Definition: CharacterDatabase.h:573
Definition: SharedDefines.h:4550
Definition: Battleground.h:57
void SetStatus(BattlegroundStatus Status)
Definition: Battleground.h:295
Definition: CharacterDatabase.h:571
BattlegroundScoreMap PlayerScores
Definition: Battleground.h:543