Exemplo n.º 1
0
        public static WeaponAbility GetCurrentAbility(Mobile m)
        {
            if (!Core.AOS)
            {
                ClearCurrentAbility(m);
                return(null);
            }

            WeaponAbility a = (WeaponAbility)m_Table[m];

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

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

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

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

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

            if (a == null)
            {
                m_Table.Remove(m);
            }
            else
            {
                SpecialMove.ClearCurrentMove(m);

                m_Table[m] = a;
            }

            return true;
        }
Exemplo n.º 3
0
        public static bool SetCurrentAbility( Mobile m, WeaponAbility a )
        {
            if ( !IsWeaponAbility( m, a ) )
            {
                ClearCurrentAbility( m );
                return false;
            }

            if ( m.Spell != null )
            {
                m.SendLocalizedMessage( 1063024 ); // You cannot perform this special move right now.

                ClearCurrentAbility( m );
                return false;
            }

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

            if ( a == null )
            {
                m_Table.Remove( m );
            }
            else
            {
                SpecialMove.ClearCurrentMove( m );

                m_Table[m] = a;
            }

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

            if (!IsWeaponAbility(m, a))
            {
                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;
            }

            m.CanReveal = true;

            if (HonorableExecution.UnderEffect(m))
            {
                m.Send(new SetNewSpell(0x91, 0));

                HonorableExecution.m_Table.Remove(m);
            }

            if (LightningStrike.UnderEffect(m))
            {
                m.Send(new SetNewSpell(0x95, 0));

                LightningStrike.m_Table.Remove(m);
            }

            if (MomentumStrike.UnderEffect(m))
            {
                m.Send(new SetNewSpell(0x96, 0));

                MomentumStrike.m_Table.Remove(m);
            }

            if (FocusAttack.UnderEffect(m))
            {
                m.Send(new SetNewSpell(0xF5, 0));

                FocusAttack.m_Table.Remove(m);

                BaseWeapon weapon = m.Weapon as BaseWeapon;

                if (weapon != null)
                {
                    FocusAttack.RemoveBonus(weapon);
                }
            }

            if (DeathStrike.UnderEffect(m))
            {
                m.Send(new SetNewSpell(0xF6, 0));

                DeathStrike.m_Table.Remove(m);
            }

            if (KiAttack.UnderEffect(m))
            {
                m.Send(new SetNewSpell(0xF8, 0));

                KiAttack.m_Table.Remove(m);
            }

            if (SurpriseAttack.UnderEffect(m))
            {
                m.Send(new SetNewSpell(0xF9, 0));

                SurpriseAttack.m_Table.Remove(m);
            }

            if (Backstab.UnderEffect(m))
            {
                m.Send(new SetNewSpell(0xFA, 0));

                Backstab.m_Table.Remove(m);
            }

            return(true);
        }