mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
Core/Arena: Create more arena configs (#97)
This commit is contained in:
@@ -655,7 +655,7 @@ int32 ArenaTeam::GetMatchmakerRatingMod(uint32 ownRating, uint32 opponentRating,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Real rating modification
|
// Real rating modification
|
||||||
mod *= 24.0f;
|
mod *= sWorld->getFloatConfig(CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER);
|
||||||
|
|
||||||
return (int32)ceil(mod);
|
return (int32)ceil(mod);
|
||||||
}
|
}
|
||||||
@@ -665,21 +665,27 @@ int32 ArenaTeam::GetRatingMod(uint32 ownRating, uint32 opponentRating, bool won
|
|||||||
// 'Chance' calculation - to beat the opponent
|
// 'Chance' calculation - to beat the opponent
|
||||||
// This is a simulation. Not much info on how it really works
|
// This is a simulation. Not much info on how it really works
|
||||||
float chance = GetChanceAgainst(ownRating, opponentRating);
|
float chance = GetChanceAgainst(ownRating, opponentRating);
|
||||||
float won_mod = (won) ? 1.0f : 0.0f;
|
|
||||||
|
|
||||||
// Calculate the rating modification
|
// Calculate the rating modification
|
||||||
float mod;
|
float mod;
|
||||||
|
|
||||||
// TODO: Replace this hack with using the confidence factor (limiting the factor to 2.0f)
|
// TODO: Replace this hack with using the confidence factor (limiting the factor to 2.0f)
|
||||||
if (won && ownRating < 1300)
|
if (won)
|
||||||
{
|
{
|
||||||
if (ownRating < 1000)
|
if (ownRating < 1300)
|
||||||
mod = 48.0f * (won_mod - chance);
|
{
|
||||||
|
float win_rating_modifier1 = sWorld->getFloatConfig(CONFIG_ARENA_WIN_RATING_MODIFIER_1);
|
||||||
|
|
||||||
|
if (ownRating < 1000)
|
||||||
|
mod = win_rating_modifier1 * (1.0f - chance);
|
||||||
|
else
|
||||||
|
mod = ((win_rating_modifier1 / 2.0f) + ((win_rating_modifier1 / 2.0f) * (1300.0f - float(ownRating)) / 300.0f)) * (1.0f - chance);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
mod = (24.0f + (24.0f * (1300.0f - float(ownRating)) / 300.0f)) * (won_mod - chance);
|
mod = sWorld->getFloatConfig(CONFIG_ARENA_WIN_RATING_MODIFIER_2) * (1.0f - chance);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mod = 24.0f * (won_mod - chance);
|
mod = sWorld->getFloatConfig(CONFIG_ARENA_LOSE_RATING_MODIFIER) * (-chance);
|
||||||
|
|
||||||
return (int32)ceil(mod);
|
return (int32)ceil(mod);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1071,6 +1071,10 @@ void World::LoadConfigSettings(bool reload)
|
|||||||
m_int_configs[CONFIG_ARENA_START_PERSONAL_RATING] = sConfigMgr->GetIntDefault ("Arena.ArenaStartPersonalRating", 1000);
|
m_int_configs[CONFIG_ARENA_START_PERSONAL_RATING] = sConfigMgr->GetIntDefault ("Arena.ArenaStartPersonalRating", 1000);
|
||||||
m_int_configs[CONFIG_ARENA_START_MATCHMAKER_RATING] = sConfigMgr->GetIntDefault ("Arena.ArenaStartMatchmakerRating", 1500);
|
m_int_configs[CONFIG_ARENA_START_MATCHMAKER_RATING] = sConfigMgr->GetIntDefault ("Arena.ArenaStartMatchmakerRating", 1500);
|
||||||
m_bool_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = sConfigMgr->GetBoolDefault("Arena.ArenaSeason.InProgress", true);
|
m_bool_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = sConfigMgr->GetBoolDefault("Arena.ArenaSeason.InProgress", true);
|
||||||
|
m_float_configs[CONFIG_ARENA_WIN_RATING_MODIFIER_1] = sConfigMgr->GetFloatDefault("Arena.ArenaWinRatingModifier1", 48.0f);
|
||||||
|
m_float_configs[CONFIG_ARENA_WIN_RATING_MODIFIER_2] = sConfigMgr->GetFloatDefault("Arena.ArenaWinRatingModifier2", 24.0f);
|
||||||
|
m_float_configs[CONFIG_ARENA_LOSE_RATING_MODIFIER] = sConfigMgr->GetFloatDefault("Arena.ArenaLoseRatingModifier", 24.0f);
|
||||||
|
m_float_configs[CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER] = sConfigMgr->GetFloatDefault("Arena.ArenaMatchmakerRatingModifier", 24.0f);
|
||||||
|
|
||||||
m_bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfigMgr->GetBoolDefault("OffhandCheckAtSpellUnlearn", true);
|
m_bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfigMgr->GetBoolDefault("OffhandCheckAtSpellUnlearn", true);
|
||||||
|
|
||||||
|
|||||||
@@ -173,6 +173,10 @@ enum WorldFloatConfigs
|
|||||||
CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS,
|
CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS,
|
||||||
CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS,
|
CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS,
|
||||||
CONFIG_CHANCE_OF_GM_SURVEY,
|
CONFIG_CHANCE_OF_GM_SURVEY,
|
||||||
|
CONFIG_ARENA_WIN_RATING_MODIFIER_1,
|
||||||
|
CONFIG_ARENA_WIN_RATING_MODIFIER_2,
|
||||||
|
CONFIG_ARENA_LOSE_RATING_MODIFIER,
|
||||||
|
CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER,
|
||||||
FLOAT_CONFIG_VALUE_COUNT
|
FLOAT_CONFIG_VALUE_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2666,6 +2666,39 @@ Arena.ArenaStartPersonalRating = 0
|
|||||||
|
|
||||||
Arena.ArenaStartMatchmakerRating = 1500
|
Arena.ArenaStartMatchmakerRating = 1500
|
||||||
|
|
||||||
|
#
|
||||||
|
# Arena.ArenaWinRatingModifier1
|
||||||
|
# Description: Modifier of rating addition when winner team rating is less than 1300
|
||||||
|
# be aware that from 1000 to 1300 it gradually decreases automatically down to the half of it
|
||||||
|
# (increasing this value will give more rating)
|
||||||
|
# Default: 48
|
||||||
|
|
||||||
|
Arena.ArenaWinRatingModifier1 = 48
|
||||||
|
|
||||||
|
#
|
||||||
|
# Arena.ArenaWinRatingModifier2
|
||||||
|
# Description: Modifier of rating addition when winner team rating is equal or more than 1300
|
||||||
|
# (increasing this value will give more rating)
|
||||||
|
# Default: 24
|
||||||
|
|
||||||
|
Arena.ArenaWinRatingModifier2 = 24
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Arena.ArenaLoseRatingModifier
|
||||||
|
# Description: Modifier of rating subtraction for loser team
|
||||||
|
# (increasing this value will subtract more rating)
|
||||||
|
# Default: 24
|
||||||
|
|
||||||
|
Arena.ArenaLoseRatingModifier = 24
|
||||||
|
|
||||||
|
#
|
||||||
|
# Arena.ArenaMatchmakerRatingModifier
|
||||||
|
# Description: Modifier of matchmaker rating
|
||||||
|
# Default: 24
|
||||||
|
|
||||||
|
Arena.ArenaMatchmakerRatingModifier = 24
|
||||||
|
|
||||||
#
|
#
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user