Beispiel #1
0
        public virtual void OnCastSuccessful(Mobile caster)
        {
            Evasion.EndEvasion(caster);
            Confidence.EndConfidence(caster);
            CounterAttack.StopCountering(caster);

            var spellID = SpellRegistry.GetRegistryNumber(this);

            if (spellID > 0)
            {
                caster.NetState.SendToggleSpecialAbility(spellID + 1, true);
            }
        }
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (Evasion.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0x93, 0));

                Evasion.m_Table.Remove(Caster);
            }

            if (CounterAttack.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0x94, 0));

                CounterAttack.m_Table.Remove(Caster);
            }

            return(true);
        }
Beispiel #3
0
        public virtual void OnCastSuccessful(Mobile caster)
        {
            if (Evasion.IsEvading(caster))
            {
                Evasion.EndEvasion(caster);
            }

            if (Confidence.IsConfident(caster))
            {
                Confidence.EndConfidence(caster);
            }

            if (CounterAttack.IsCountering(caster))
            {
                CounterAttack.StopCountering(caster);
            }

            int spellID = SpellRegistry.GetRegistryNumber(this);

            if (spellID > 0)
            {
                caster.Send(new ToggleSpecialAbility(spellID + 1, true));
            }
        }
Beispiel #4
0
        public override bool CheckCast()
        {
            if (!base.CheckCast())
            {
                return(false);
            }

            if (Confidence.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0x92, 0));

                Confidence.m_Table.Remove(Caster);
            }

            if (CounterAttack.UnderEffect(Caster))
            {
                Caster.Send(new SetNewSpell(0x94, 0));

                CounterAttack.m_Table.Remove(Caster);
            }

            BaseShield shield = Caster.FindItemOnLayer(Layer.TwoHanded) as BaseShield;

            BaseWeapon weapon1 = Caster.FindItemOnLayer(Layer.OneHanded) as BaseWeapon;

            BaseWeapon weapon2 = Caster.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon;

            if (shield == null && weapon1 == null && weapon2 == null)
            {
                Caster.SendLocalizedMessage(1062944);                   // You must have a weapon or a shield equipped to use this ability!

                return(false);
            }

            return(true);
        }
		public void UseBushidoStance()
		{
			Spell spell = null;

			if ( m_Mobile.Debug )
				m_Mobile.Say( 2117, "Using a samurai stance" );

			BaseWeapon weapon = m_Mobile.Weapon as BaseWeapon;

			if ( weapon == null )
				return;

			int whichone = Utility.RandomMinMax( 1, 3 );

			if ( whichone == 3 && m_Mobile.Skills[SkillName.Bushido].Value >= 60.0 )
				spell = new Evasion( m_Mobile, null );
			else if ( whichone >= 2 && m_Mobile.Skills[SkillName.Bushido].Value >= 40.0 )
				spell = new CounterAttack( m_Mobile, null );
			else if ( whichone >= 1 && m_Mobile.Skills[SkillName.Bushido].Value >= 25.0 )
				spell = new Confidence( m_Mobile, null );

			if ( spell != null )
				spell.Cast();
		}