void Player::Update(long time) { // assert(NUMBER_OF_PERKS - GetNumberOfUnusedPerks() < level); for (int i=0; i < NUMBER_OF_SPELL_INDICES; i++) spellList[i]->Update(time); float modifier; if (HasPerk(OVERACHIEVER)) // Overachiever perk increases mana recharge by 5% modifier=1.05f; else modifier=1.0f; if (HasPerk(MORE_SACRIFICES)) // More sacrifices perk increases mana recharge by 5% modifier*=1.05f; if (HasPerk(MANA_BURN)) // Mana burn increases recharge rate by 10% modifier*=1.1f; mana += MANA_REGENERATION_RATE * time * modifier; if (mana > GetMaxMana()) mana=GetMaxMana(); }
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()) { // kind of weird to do it here w/e // client does some base medding regen for shrouds here if (GetClass() != BARD) { auto skill = GetSkill(EQEmu::skills::SkillMeditate); if (skill > 0) { regen++; if (skill > 1) regen++; if (skill >= 15) regen += skill / 15; } } if (old) regen = std::max(regen, 2); } else if (old) { regen = std::max(regen, 1); } } if (level > 61) { regen++; if (level > 63) regen++; } regen += aabonuses.ManaRegen; // add in + 1 bonus for SE_CompleteHeal, but we don't do anything for it yet? int item_bonus = itembonuses.ManaRegen; // this is capped already int heroic_bonus = 0; switch (GetCasterClass()) { case 'W': heroic_bonus = GetHeroicWIS(); break; default: heroic_bonus = GetHeroicINT(); break; } item_bonus += heroic_bonus / 25; regen += item_bonus; if (level <= 70 && regen > 65) regen = 65; regen = regen * 100.0f * AreaManaRegen * 0.01f + 0.5f; if (!bCombat && CanFastRegen() && (IsSitting() || CanMedOnHorse())) { auto max_mana = GetMaxMana(); int fast_regen = 6 * (max_mana / zone->newzone_data.FastRegenMana); if (regen < fast_regen) // weird, but what the client is doing regen = fast_regen; } regen += spellbonuses.ManaRegen; // TODO: live does this in buff tick return (regen * RuleI(Character, ManaRegenMultiplier) / 100); }