aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Battlegrounds/ArenaTeam.cpp
diff options
context:
space:
mode:
authorLiberate <tbaart@gmail.com>2010-08-28 13:31:13 +0200
committerLiberate <tbaart@gmail.com>2010-08-28 13:31:13 +0200
commit2228a8f8d9b46995f6e4644496d2c5cd507a51a2 (patch)
treea8f51ea679c5212a57dc460aa853315d1000db24 /src/server/game/Battlegrounds/ArenaTeam.cpp
parent350ba75fc4eecc667ddc83617b4b362d88844c60 (diff)
Change the Arena Rating system to reflect the official system more.
Under 1000 rating the max rating gained should be 48. Between 1000 rating and 1300 rating the max rating gained should move from 48 to 24. Above 1300 rating the max rating gained is 24. Team Rating and Personal Rating use this formula now. --HG-- branch : trunk
Diffstat (limited to 'src/server/game/Battlegrounds/ArenaTeam.cpp')
-rw-r--r--src/server/game/Battlegrounds/ArenaTeam.cpp44
1 files changed, 31 insertions, 13 deletions
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index 0a4a5b7c11c..e8b79b3088a 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -654,8 +654,10 @@ int32 ArenaTeam::WonAgainst(uint32 againstRating)
// calculate the rating modification
// simulation on how it works. Not much info on how it really works
int32 mod;
- if (m_stats.rating < 1500)
- mod = (int32)ceil(48.0f * (1.0f - chance) * (1.0f - chance));
+ if (m_stats.rating < 1000)
+ mod = (int32)ceil(48.0f * (1.0f - chance));
+ else if (m_stats.rating < 1300)
+ mod = (int32)ceil((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (1.0f - chance));
else
mod = (int32)ceil(24.0f * (1.0f - chance));
@@ -668,21 +670,19 @@ int32 ArenaTeam::WonAgainst(uint32 againstRating)
return mod;
}
-int32 ArenaTeam::LostAgainst(uint32 againstRating, bool winnerlowrating)
+int32 ArenaTeam::LostAgainst(uint32 againstRating)
{
// called when the team has lost
//'chance' calculation - to loose to the opponent
float chance = GetChanceAgainst(m_stats.rating, againstRating);
- if (m_stats.rating < 1000)
- {
- FinishGame(0);
- return 0;
- }
+
// calculate the rating lost
// there is not much info on the formula, but this is a very good simulation
int32 mod;
- if (winnerlowrating)
- mod = (int32)floor(48.0f * chance * chance) * -1;
+ if (m_stats.rating < 1000)
+ mod = (int32)floor(48.0f * (0.0f - chance));
+ else if (m_stats.rating < 1300)
+ mod = (int32)floor((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (0.0f - chance));
else
mod = (int32)floor(24.0f * (0.0f - chance));
@@ -703,7 +703,13 @@ void ArenaTeam::MemberLost(Player * plr, uint32 againstMatchmakerRating)
// update personal rating
float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating);
// calculate the rating modification
- int32 mod = (int32)floor(24.0f * (0.0f - chance));
+ int32 mod;
+ if (itr->personal_rating < 1000)
+ mod = (int32)floor(48.0f * (0.0f - chance));
+ else if (itr->personal_rating < 1300)
+ mod = (int32)floor((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (0.0f - chance));
+ else
+ mod = (int32)floor(24.0f * (0.0f - chance));
itr->ModifyPersonalRating(plr, mod, GetSlot());
// update matchmaker rating
chance = GetChanceAgainst(itr->matchmaker_rating, againstMatchmakerRating);
@@ -731,7 +737,13 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstMatchmakerRating)
// update personal rating
float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating);
// calculate the rating modification
- int32 mod = (int32)ceil(24.0f * (0.0f - chance));
+ int32 mod;
+ if (itr->personal_rating < 1000)
+ mod = (int32)floor(48.0f * (0.0f - chance));
+ else if (itr->personal_rating < 1300)
+ mod = (int32)floor((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (0.0f - chance));
+ else
+ mod = (int32)floor(24.0f * (0.0f - chance));
itr->ModifyPersonalRating(NULL, mod, GetSlot());
// update matchmaker rating
chance = GetChanceAgainst(itr->matchmaker_rating, againstMatchmakerRating);
@@ -757,7 +769,13 @@ void ArenaTeam::MemberWon(Player * plr, uint32 againstMatchmakerRating)
// update personal rating
float chance = GetChanceAgainst(itr->personal_rating, m_stats.rating);
// calculate the rating modification
- int32 mod = (int32)ceil(24.0f * (1.0f - chance));
+ int32 mod;
+ if (itr->personal_rating < 1000)
+ mod = (int32)ceil(48.0f * (1.0f - chance) * (1.0f - chance));
+ else if (itr->personal_rating < 1300)
+ mod = (int32)ceil((24.0f + (24.0f * (1300 - m_stats.rating) / 300)) * (1.0f - chance));
+ else
+ mod = (int32)ceil(24.0f * (1.0f - chance));
itr->ModifyPersonalRating(plr, mod, GetSlot());
// update matchmaker rating
chance = GetChanceAgainst(matchmakerrating, againstMatchmakerRating);