mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-10 20:19:49 +01:00
Core/Battlegrounds: Stop arena matches after 45 minutes of no win/loss candidate, and deduct 16 points from each team (blizzlike) - Thanks to Alez
Closes issue 2017 --HG-- branch : trunk
This commit is contained in:
@@ -724,7 +724,7 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
{
|
||||
winner_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(winner));
|
||||
loser_arena_team = sObjectMgr.GetArenaTeamById(GetArenaTeamIdForTeam(GetOtherTeam(winner)));
|
||||
if (winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team)
|
||||
if (winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team && !((winner == WINNER_NONE))
|
||||
{
|
||||
loser_team_rating = loser_arena_team->GetRating();
|
||||
loser_matchmaker_rating = GetArenaMatchmakerRating(GetOtherTeam(winner));
|
||||
@@ -742,6 +742,12 @@ void Battleground::EndBattleground(uint32 winner)
|
||||
if (Player* player = sObjectMgr.GetPlayer(itr->first))
|
||||
sLog.outArena("Statistics for %s (GUID: " UI64FMTD ", Team: %d, IP: %s): %u damage, %u healing, %u killing blows", player->GetName(), itr->first, player->GetArenaTeamId(m_ArenaType == 5 ? 2 : m_ArenaType == 3), player->GetSession()->GetRemoteAddress().c_str(), itr->second->DamageDone, itr->second->HealingDone, itr->second->KillingBlows);
|
||||
}
|
||||
// Deduct 16 points from each teams arena-rating if there are no winners after 45+2 minutes
|
||||
else if(winner_arena_team && loser_arena_team && winner_arena_team != loser_arena_team && (winner == WINNER_NONE))
|
||||
{
|
||||
SetArenaTeamRatingChangeForTeam(ALLIANCE, -16);
|
||||
SetArenaTeamRatingChangeForTeam(HORDE, -16);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetArenaTeamRatingChangeForTeam(ALLIANCE, 0);
|
||||
@@ -1856,6 +1862,11 @@ void Battleground::HandleKillUnit(Creature * /*creature*/, Player * /*killer*/)
|
||||
{
|
||||
}
|
||||
|
||||
void Battleground::CheckArenaAfterTimerConditions()
|
||||
{
|
||||
EndBattleground(WINNER_NONE);
|
||||
}
|
||||
|
||||
void Battleground::CheckArenaWinConditions()
|
||||
{
|
||||
if (!GetAlivePlayersCountByTeam(ALLIANCE) && GetPlayersCountByTeam(HORDE))
|
||||
|
||||
@@ -513,6 +513,7 @@ class Battleground
|
||||
int32 GetArenaTeamRatingChangeForTeam(uint32 Team) const { return m_ArenaTeamRatingChanges[GetTeamIndexByTeamId(Team)]; }
|
||||
void SetArenaMatchmakerRating(uint32 Team, uint32 MMR){ m_ArenaTeamMMR[GetTeamIndexByTeamId(Team)] = MMR; }
|
||||
uint32 GetArenaMatchmakerRating(uint32 Team) { return m_ArenaTeamMMR[GetTeamIndexByTeamId(Team)]; }
|
||||
void CheckArenaAfterTimerConditions();
|
||||
void CheckArenaWinConditions();
|
||||
void UpdateArenaWorldState();
|
||||
|
||||
|
||||
@@ -48,10 +48,14 @@ void BattlegroundBE::Update(uint32 diff)
|
||||
{
|
||||
Battleground::Update(diff);
|
||||
|
||||
/*if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
// update something
|
||||
}*/
|
||||
if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS) // after 47 minutes without one team losing, the arena closes with no winner and no rating change
|
||||
{
|
||||
UpdateArenaWorldState();
|
||||
CheckArenaAfterTimerConditions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundBE::StartingEventCloseDoors()
|
||||
|
||||
@@ -47,6 +47,16 @@ BattlegroundDS::~BattlegroundDS()
|
||||
void BattlegroundDS::Update(uint32 diff)
|
||||
{
|
||||
Battleground::Update(diff);
|
||||
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS) // after 47 minutes without one team losing, the arena closes with no winner and no rating change
|
||||
{
|
||||
UpdateArenaWorldState();
|
||||
CheckArenaAfterTimerConditions();
|
||||
}
|
||||
}
|
||||
|
||||
if (getWaterFallTimer() < diff)
|
||||
{
|
||||
if (isWaterFallActive())
|
||||
|
||||
@@ -48,10 +48,14 @@ void BattlegroundNA::Update(uint32 diff)
|
||||
{
|
||||
Battleground::Update(diff);
|
||||
|
||||
/*if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
// update something
|
||||
}*/
|
||||
if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS) // after 47 minutes without one team losing, the arena closes with no winner and no rating change
|
||||
{
|
||||
UpdateArenaWorldState();
|
||||
CheckArenaAfterTimerConditions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundNA::StartingEventCloseDoors()
|
||||
|
||||
@@ -48,10 +48,14 @@ void BattlegroundRL::Update(uint32 diff)
|
||||
{
|
||||
Battleground::Update(diff);
|
||||
|
||||
/*if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
// update something
|
||||
}*/
|
||||
if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS) // after 47 minutes without one team losing, the arena closes with no winner and no rating change
|
||||
{
|
||||
UpdateArenaWorldState();
|
||||
CheckArenaAfterTimerConditions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BattlegroundRL::StartingEventCloseDoors()
|
||||
|
||||
@@ -48,6 +48,15 @@ void BattlegroundRV::Update(uint32 diff)
|
||||
{
|
||||
Battleground::Update(diff);
|
||||
|
||||
if (GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS) // after 47 minutes without one team losing, the arena closes with no winner and no rating change
|
||||
{
|
||||
UpdateArenaWorldState();
|
||||
CheckArenaAfterTimerConditions();
|
||||
}
|
||||
}
|
||||
|
||||
if (getTimer() < diff)
|
||||
{
|
||||
uint32 i;
|
||||
|
||||
Reference in New Issue
Block a user