示例#1
0
        public override bool CheckCast()
        {
            ToleranceSpell spell = GetSpell(Caster, typeof(ToleranceSpell)) as ToleranceSpell;

            if (spell != null)
            {
                spell.Expire();
                return(false);
            }

            return(base.CheckCast());
        }
示例#2
0
        public static bool OnPoisonApplied(Mobile m)
        {
            ToleranceSpell spell = GetSpell(m, typeof(ToleranceSpell)) as ToleranceSpell;

            if (spell != null)
            {
                double stamCost = (m.Skills[spell.CastSkill].Base + ((MasteryInfo.GetMasteryLevel(m, SkillName.Poisoning) * 30) + 10)) / 2;

                stamCost /= 4;
                stamCost  = Math.Max(18, (25 - stamCost) + 18);

                if (m.Stam < (int)stamCost)
                {
                    spell.Caster.SendLocalizedMessage(1156036, ((int)stamCost).ToString());                      // You must have at least ~1_STAM_REQUIREMENT~ Stamina to use this ability.
                    return(false);
                }

                spell.Caster.Stam -= (int)stamCost;
                return(true);
            }

            return(false);
        }