From 0f1ca0856cee22d4fd02f481907e95ca638e6c16 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Sun, 15 Oct 2017 21:35:03 -0400 Subject: [PATCH] Fix mana regen issue with old skill progression --- common/ruletypes.h | 1 + zone/client_mods.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/common/ruletypes.h b/common/ruletypes.h index e1475fa79..c3a8fd5dc 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -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) diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 541454a58..696214113 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -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); } }