Exemplo n.º 1
0
        public override bool CheckSkills(Mobile from)
        {
            if (!base.CheckSkills(from))
            {
                return(false);
            }

            BaseWeapon weapon = from.Weapon as BaseWeapon;

            if (weapon != null)
            {
                SkillName req = weapon.AbilitySkill;

                Skill bushido  = from.Skills[SkillName.Bushido];
                Skill ninjitsu = from.Skills[SkillName.Ninjitsu];

                bool enoughBushido  = bushido != null && bushido.Value >= SkillRequirement;
                bool enoughNinjitsu = ninjitsu != null && ninjitsu.Value >= SkillRequirement;

                bool ok = false;

                int message = -1;

                if (req == SkillName.Bushido)
                {
                    message = 1070768;                     // You need ~1_SKILL_REQUIREMENT~ Bushido skill to perform that attack!
                    ok      = enoughBushido;
                }
                else if (req == SkillName.Ninjitsu)
                {
                    message = 1063352;                     // You need ~1_SKILL_REQUIREMENT~ Ninjitsu skill to perform that attack!
                    ok      = enoughNinjitsu;
                }
                else
                {
                    message = 1063347;                     // You need ~1_SKILL_REQUIREMENT~ Bushido or Ninjitsu skill to perform that attack!
                    ok      = enoughBushido || enoughNinjitsu;
                }

                if (!ok)
                {
                    from.SendLocalizedMessage(message, SkillRequirement.ToString());
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("Effect", true, out subEle);
            Effect.WriteXML(subEle, master);

            ele.TryPathTo("SkillRequirement", true, out subEle);
            subEle.Value = SkillRequirement.ToString("G15");

            ele.TryPathTo("DamageMult", true, out subEle);
            subEle.Value = DamageMult.ToString("G15");

            ele.TryPathTo("APCost", true, out subEle);
            subEle.Value = APCost.ToString("G15");

            ele.TryPathTo("IsSilent", true, out subEle);
            subEle.Value = IsSilent.ToString();

            ele.TryPathTo("RequiresMod", true, out subEle);
            subEle.Value = RequiresMod.ToString();

            WriteUnusedXML(ele, master);
        }