private static TimeSpan Mobile_ManaRegenRate( Mobile from )
{
if ( from.Skills == null )
return Mobile.DefaultManaRate;
if ( !from.Meditating )
CheckBonusSkill( from, from.Mana, from.ManaMax, SkillName.Meditation );
double rate;
double armorPenalty = GetArmorOffset( from );
double medPoints = (from.Int + from.Skills[SkillName.Meditation].Value) * 0.5;
if ( medPoints <= 0 )
rate = 7.0;
else if ( medPoints <= 100 )
rate = 7.0 - (239*medPoints/2400) + (19*medPoints*medPoints/48000);
else if ( medPoints < 120 )
rate = 1.0;
else
rate = 0.75;
rate += armorPenalty;
if ( from.Meditating )
rate *= 0.5;
if ( rate < 0.5 )
rate = 0.5;
else if ( rate > 7.0 )
rate = 7.0;
return TimeSpan.FromSeconds( rate );
}