Fix mana regen issue with old skill progression

This commit is contained in:
Michael Cook (mackal) 2017-10-15 21:35:03 -04:00
parent 75e60b7f8e
commit 0f1ca0856c
2 changed files with 9 additions and 0 deletions

View File

@ -66,6 +66,7 @@ RULE_INT(Character, AutosaveIntervalS, 300) //0=disabled
RULE_INT(Character, HPRegenMultiplier, 100)
RULE_INT(Character, ManaRegenMultiplier, 100)
RULE_INT(Character, EnduranceRegenMultiplier, 100)
RULE_BOOL(Character, OldMinMana, false) // this is used for servers that want to follow older skill cap formulas so they can still have some regen w/o mediate
RULE_INT(Character, ConsumptionMultiplier, 100) //item's hunger restored = this value * item's food level, 100 = normal, 50 = people eat 2x as fast, 200 = people eat 2x as slow
RULE_BOOL(Character, HealOnLevel, false)
RULE_BOOL(Character, FeignKillsPet, false)

View File

@ -1240,6 +1240,10 @@ int32 Client::CalcManaRegen(bool bCombat)
{
int regen = 0;
auto level = GetLevel();
// so the new formulas break down with older skill caps where you don't have the skill until 4 or 8
// so for servers that want to use the old skill progression they can set this rule so they
// will get at least 1 for standing and 2 for sitting.
bool old = RuleB(Character, OldMinMana);
if (!IsStarved()) {
// client does some base regen for shrouds here
if (IsSitting() || CanMedOnHorse()) {
@ -1255,6 +1259,10 @@ int32 Client::CalcManaRegen(bool bCombat)
regen += skill / 15;
}
}
if (old)
regen = std::max(regen, 2);
} else if (old) {
regen = std::max(regen, 1);
}
}