mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Bug Fix] ModernAAScalingEnabled() Calculation Error (#4469)
Current version only looks at your unspent AAs, meaning if you have 2000 spent AAs and 1 unspent AA, your scaling will be based on the 1 unspent AA instead of the 2001 total AA.
Here's the original log which is custom code found in the ModernAAScalingEnabled function:
[Wed Sep 11 14:10:19 2024] [AA] [ScaleAAXPBasedOnCurrentAATotal] AA Experience Calculation: add_aaxp = 660796, Base Bonus = 256.000000, Half-Life = 64.000000, Minimum Bonus = 1.000000, Earned AA = 1, Calculated Bonus = 253.242371
Custom code looks like this:
uint64 totalWithExpMod = add_aaxp;
if (RuleB(AA, EnableLogrithmicClasslessAABonus)) {
float base_bonus = RuleR(AA, InitialLogrithmicClasslessAABonus);
float half_life = RuleR(AA, HalfLifeLogrithmicClasslessAABonus);
float min_bon = RuleR(AA, MinimumLogrithmicClasslessAABonus);
float bonus_expon = earnedAA / half_life;
float bonus = base_bonus * std::pow(0.5, bonus_expon);
Log(Logs::General,
Logs::AA,
"AA Experience Calculation: add_aaxp = %d, Base Bonus = %f, Half-Life = %f, Minimum Bonus = %f, Earned AA = %d, Calculated Bonus = %f",
add_aaxp, base_bonus, half_life, min_bon, earnedAA, bonus);
if (bonus < min_bon) bonus = min_bon;
totalWithExpMod = (uint64)(totalWithExpMod * bonus);
}
After the fix, the log becomes:
[Wed Sep 11 14:10:19 2024] [AA] [ScaleAAXPBasedOnCurrentAATotal] AA Experience Calculation: add_aaxp = 660796, Base Bonus = 256.000000, Half-Life = 64.000000, Minimum Bonus = 1.000000, Earned AA = 1, Calculated Bonus = 253.242371
Which is much closer to the expected behavior
This commit is contained in:
parent
40fecbfaf5
commit
913c5da70f
@ -527,7 +527,7 @@ void Client::AddEXP(ExpSource exp_source, uint64 in_add_exp, uint8 conlevel, boo
|
|||||||
// Are we also doing linear AA acceleration?
|
// Are we also doing linear AA acceleration?
|
||||||
if (RuleB(AA, ModernAAScalingEnabled) && aaexp > 0)
|
if (RuleB(AA, ModernAAScalingEnabled) && aaexp > 0)
|
||||||
{
|
{
|
||||||
aaexp = ScaleAAXPBasedOnCurrentAATotal(GetAAPoints(), aaexp);
|
aaexp = ScaleAAXPBasedOnCurrentAATotal(GetSpentAA() + GetAAPoints(), aaexp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for AA XP Cap
|
// Check for AA XP Cap
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user