Esempio n. 1
0
        public static bool SetCurrentAbility(Mobile m, WeaponAbility a)
        {
            if (!Core.AOS)
            {
                ClearCurrentAbility(m);
                return(false);
            }

            TAVFlourish flourish = (TAVFlourish)XmlAttach.FindAttachmentOnMobile(m, typeof(TAVFlourish), "flourish");

            bool f = (flourish == null && m is TeiravonMobile && ((TeiravonMobile)m).ChargedMissileReady);

            if (!IsWeaponAbility(m, a, f))
            {
                ClearCurrentAbility(m);
                return(false);
            }

            if (a != null && !a.Validate(m))
            {
                ClearCurrentAbility(m);
                return(false);
            }

            if (a == null)
            {
                m_Table.Remove(m);
            }
            else
            {
                m_Table[m] = a;
            }

            return(true);
        }
Esempio n. 2
0
        public virtual bool CheckWeaponSkill(Mobile from)
        {
            BaseWeapon weapon = from.Weapon as BaseWeapon;

            if (weapon == null)
            {
                return(false);
            }

            Skill  skill    = from.Skills[weapon.Skill];
            double reqSkill = GetRequiredSkill(from);

            if (skill != null && skill.Base >= reqSkill)
            {
                return(true);
            }

            /* <UBWS> */
            if (weapon.WeaponAttributes.UseBestSkill > 0 && (from.Skills[SkillName.Swords].Base >= reqSkill || from.Skills[SkillName.Macing].Base >= reqSkill || from.Skills[SkillName.Fencing].Base >= reqSkill))
            {
                return(true);
            }
            /* </UBWS> */

            TAVFlourish flourish = (TAVFlourish)XmlAttach.FindAttachmentOnMobile(from, typeof(TAVFlourish), "flourish");

            bool f = (flourish != null);

            bool t = (from is TeiravonMobile && ((TeiravonMobile)from).ChargedMissileReady);

            if (f && t)
            {
                return(true);
            }

            from.SendLocalizedMessage(1060182, reqSkill.ToString());               // You need ~1_SKILL_REQUIREMENT~ weapon skill to perform that attack
            //from.SendMessage("flourish? {0} ; Ready? {1}",f,t);
            return(false);
        }
Esempio n. 3
0
        public static WeaponAbility GetCurrentAbility(Mobile m)
        {
            if (!Core.AOS)
            {
                ClearCurrentAbility(m);
                return(null);
            }

            TAVFlourish flourish = (TAVFlourish)XmlAttach.FindAttachmentOnMobile(m, typeof(TAVFlourish), "flourish");

            bool          f = (flourish != null && m is TeiravonMobile && ((TeiravonMobile)m).ChargedMissileReady);
            WeaponAbility a;

            if (f)
            {
                a = flourish.WeaponAbility;
            }
            else
            {
                a = (WeaponAbility)m_Table[m];
            }


            if (!IsWeaponAbility(m, a, f))
            {
                ClearCurrentAbility(m);
                return(null);
            }

            if (a != null && !a.Validate(m))
            {
                ClearCurrentAbility(m);
                return(null);
            }

            return(a);
        }