mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[8268] ArenaTeam: new rating-system for season 6
every team will start with 0 rating here to enable this you have to set your season in the config-file thanks to danielich for initial patch Signed-off-by: balrok <der-coole-carl@gmx.net>
This commit is contained in:
parent
3557b00a13
commit
79d1c3fe6f
2 changed files with 21 additions and 3 deletions
|
|
@ -19,6 +19,7 @@
|
|||
#include "WorldPacket.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "ArenaTeam.h"
|
||||
#include "World.h"
|
||||
|
||||
ArenaTeam::ArenaTeam()
|
||||
{
|
||||
|
|
@ -34,7 +35,10 @@ ArenaTeam::ArenaTeam()
|
|||
stats.games_week = 0;
|
||||
stats.games_season = 0;
|
||||
stats.rank = 0;
|
||||
stats.rating = 1500;
|
||||
if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) >= 6)
|
||||
stats.rating = 0;
|
||||
else
|
||||
stats.rating = 1500;
|
||||
stats.wins_week = 0;
|
||||
stats.wins_season = 0;
|
||||
}
|
||||
|
|
@ -129,7 +133,17 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
|
|||
newmember.games_week = 0;
|
||||
newmember.wins_season = 0;
|
||||
newmember.wins_week = 0;
|
||||
newmember.personal_rating = 1500;
|
||||
if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) >= 6)
|
||||
{
|
||||
if (stats.rating < 1000)
|
||||
newmember.personal_rating = stats.rating;
|
||||
else
|
||||
newmember.personal_rating = 1000;
|
||||
}
|
||||
else
|
||||
{
|
||||
newmember.personal_rating = 1500;
|
||||
}
|
||||
members.push_back(newmember);
|
||||
|
||||
CharacterDatabase.PExecute("INSERT INTO arena_team_member (arenateamid, guid, personal_rating) VALUES ('%u', '%u', '%u')", Id, GUID_LOPART(newmember.guid), newmember.personal_rating );
|
||||
|
|
@ -499,6 +513,10 @@ float ArenaTeam::GetChanceAgainst(uint32 own_rating, uint32 enemy_rating)
|
|||
{
|
||||
// returns the chance to win against a team with the given rating, used in the rating adjustment calculation
|
||||
// ELO system
|
||||
|
||||
if (sWorld.getConfig(CONFIG_ARENA_SEASON_ID) >= 6)
|
||||
if (enemy_rating < 1300)
|
||||
enemy_rating = 1300;
|
||||
return 1.0f/(1.0f+exp(log(10.0f)*(float)((float)enemy_rating - (float)own_rating)/400.0f));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8267"
|
||||
#define REVISION_NR "8268"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue