public bool MissTest(Object spellTarget,Mobile from) { // return true if casters spell miss target int roll; int hitChance = this.HitChanceCalculation(from,spellTarget as Mobile); roll = Utility.Random(100); if (roll > hitChance) { from.SpellStateMSG(0,from.cast.id,from,spellTarget as Mobile,2); return true; } return false; }
public bool MissAndRessistTest(Object spellTarget,Mobile from) { // return true if casters spell miss or target resist spell int roll; float resistChance = 0f; int hitChance = this.HitChanceCalculation(from,spellTarget as Mobile); if(this.IsBinary()) { resistChance = this.ResistCalculation(from,spellTarget as Mobile); } else {resistChance = 0f;} roll = Utility.Random(100); if (roll > hitChance*(1f - resistChance)) { from.SpellStateMSG(0,from.cast.id,from,spellTarget as Mobile,2); return true; } return false; }