Darwin
Member
Hello. I'm experimenting with getting a skill to provide an inherent AOS property bonus. I'm trying to get meditation to provide an lmc bonus that goes beyond cap. I sort of based the code off the sdi bonus provided from inscription. However, I must have something wrong with my math because when I log in game, no bonus is given. The mana cost remains the same with or without the skill. The code was written as it is to give the mobile with meditation skill a 1% LMC bonus for every 10 skill points. Does anyone see what I'm doing wrong and/or have any suggestions to fix it?
public virtual int GetNewLMC(int bonus, int dice, int sides, double scalar, Mobile caster)
{
int totallmc = Utility.Dice(dice, sides, bonus) * 100;
int lowermanacostBonus = 0;
int MeditationSkill = GetMeditationFixed(m_Caster);
int MeditationLMCBonus = (MeditationSkill + (1000 * (MeditationSkill / 1000))) / 200;
lowermanacostBonus += MeditationLMCBonus;
MeditationLMCBonus += Spell.GetlmcBonus(m_Caster);
totallmc = AOS.Scale(totallmc, 100 + MeditationLMCBonus);
totallmc = AOS.Scale(totallmc, (int)(scalar * 100));
return totallmc / 100;
}
public static int GetlmcBonus(Mobile caster)
{
int lmcBonus = AosAttributes.GetValue(caster, AosAttribute.LowerManaCost);
return lmcBonus;
}