diff options
author | click <none@none> | 2010-12-02 22:25:32 +0100 |
---|---|---|
committer | click <none@none> | 2010-12-02 22:25:32 +0100 |
commit | 2338eae0ff984c2b0e3e18f3dbb0301a47674613 (patch) | |
tree | 4973ffd4c173797ed0317a6c5ffa3470b82f2f2a /src | |
parent | 94fd1487d0f0c60a28a132385affbd16933f0bc2 (diff) |
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
Diffstat (limited to 'src')
7 files changed, 53 insertions, 10 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index be341350964..43b416928fa 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -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)) diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 91991cf8c31..e64ea010ae2 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -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(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp index df789444a49..60e00ec8dc8 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp @@ -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() diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index ee53d70d05a..5bc621d6639 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -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()) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp index a6ccce37afe..0524a35af04 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp @@ -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() diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp index f0b17ad710a..190d57bc5b2 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp @@ -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() diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp index e2367d8e0f3..6a5b60fc928 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -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; |