Esempio n. 1
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !IsBladeweaveAttack && ( !Validate( attacker ) || !CheckMana( attacker, true ) ) )
                return;

            ClearCurrentAbility( attacker );

            if ( m_Table.ContainsKey( attacker ) )
            {
                Timer t = m_Table[attacker].Timer;

                if ( t != null )
                    t.Stop();
            }

            Timer expireTimer = Timer.DelayCall( EffectDuration, new TimerCallback(
                delegate
                {
                    m_Table.Remove( attacker );
                } ) );

            double skill = Math.Max( attacker.Skills.Bushido.Value, attacker.Skills.Ninjitsu.Value );

            int damageModifier = (int) ( skill * 50.0 / 120.0 );

            m_Table[attacker] = new FeintContext( expireTimer, defender, damageModifier );

            attacker.SendLocalizedMessage( 1063360 ); // You baffle your target with a feint!
            defender.SendLocalizedMessage( 1063361 ); // You were deceived by an attacker's feint!

            attacker.FixedParticles( 0x3728, 1, 13, 0x7F3, 0x962, 0, EffectLayer.Waist );

            BuffInfo.AddBuff( attacker, new BuffInfo( BuffIcon.Feint, 1151308, 1151307, EffectDuration, attacker, String.Format( "{0}\t{1}", defender.Name, damageModifier ) ) );
        }
Esempio n. 2
0
        private static void AlterDamage(Mobile attacker, Mobile defender, ref int damage)
        {
            if (m_Table.ContainsKey(defender))
            {
                FeintContext context = m_Table[defender];

                if (context.Target == attacker)
                {
                    damage -= (int)(damage * context.DamageModifier / 100.0);
                }
            }
        }
Esempio n. 3
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!IsBladeweaveAttack && (!Validate(attacker) || !CheckMana(attacker, true)))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            if (m_Table.ContainsKey(attacker))
            {
                Timer t = m_Table[attacker].Timer;

                if (t != null)
                {
                    t.Stop();
                }
            }

            Timer expireTimer = Timer.DelayCall(EffectDuration, new TimerCallback(
                                                    delegate
            {
                m_Table.Remove(attacker);
            }));

            double skill = Math.Max(attacker.Skills.Bushido.Value, attacker.Skills.Ninjitsu.Value);

            int damageModifier = (int)(skill * 50.0 / 120.0);

            m_Table[attacker] = new FeintContext(expireTimer, defender, damageModifier);

            attacker.SendLocalizedMessage(1063360);               // You baffle your target with a feint!
            defender.SendLocalizedMessage(1063361);               // You were deceived by an attacker's feint!

            attacker.FixedParticles(0x3728, 1, 13, 0x7F3, 0x962, 0, EffectLayer.Waist);

            BuffInfo.AddBuff(attacker, new BuffInfo(BuffIcon.Feint, 1151308, 1151307, EffectDuration, attacker, String.Format("{0}\t{1}", defender.Name, damageModifier)));
        }