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

            ClearCurrentAbility(attacker);

            attacker.SendLocalizedMessage(1063358); // You deliver a talon strike!
            defender.SendLocalizedMessage(1063359); // Your attacker delivers a talon strike!

            defender.FixedParticles(0x373A, 1, 17, 0x26BC, 0x662, 0, EffectLayer.Waist);

            Timer t = new InternalTimer(defender, (int)(10.0 * (attacker.Skills[SkillName.Ninjitsu].Value - 50.0) / 70.0 + 5), attacker);       //5 - 15 damage

            BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.TalonStrike, 1028856, 1151309, TimeSpan.FromSeconds(5.0), defender, "40"));

            t.Start();

            Registry.Add(defender, t);

            if (attacker is BaseCreature)
            {
                PetTrainingHelper.OnWeaponAbilityUsed((BaseCreature)attacker, SkillName.Ninjitsu);
            }
        }
Esempio n. 2
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))    //Mana check after check that there are targets
            {
                return;
            }

            ClearCurrentAbility(attacker);

            Map map = attacker.Map;

            if (map == null)
            {
                return;
            }

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon == null)
            {
                return;
            }

            List <Mobile> targets = SpellHelper.AcquireIndirectTargets(attacker, attacker.Location, attacker.Map, 2).OfType <Mobile>().ToList();

            if (targets.Count > 0)
            {
                if (!CheckMana(attacker, true))
                {
                    return;
                }

                attacker.FixedEffect(0x3728, 10, 15);
                attacker.PlaySound(0x2A1);

                if (m_Registry.ContainsKey(attacker))
                {
                    RemoveFromRegistry(attacker);
                }

                m_Registry[attacker] = new InternalTimer(attacker, targets);

                foreach (PlayerMobile pm in targets.OfType <PlayerMobile>())
                {
                    BuffInfo.AddBuff(pm, new BuffInfo(BuffIcon.SplinteringEffect, 1153804, 1028852, TimeSpan.FromSeconds(2.0), pm));
                }

                if (defender is PlayerMobile && attacker is PlayerMobile)
                {
                    defender.SendSpeedControl(SpeedControlType.WalkSpeed);
                    BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.SplinteringEffect, 1153804, 1152144, TimeSpan.FromSeconds(2.0), defender));
                    Timer.DelayCall(TimeSpan.FromSeconds(2), mob => mob.SendSpeedControl(SpeedControlType.Disable), defender);
                }

                if (attacker is BaseCreature)
                {
                    PetTrainingHelper.OnWeaponAbilityUsed((BaseCreature)attacker, SkillName.Ninjitsu);
                }
            }
        }
Esempio n. 3
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            attacker.SendLocalizedMessage(1063345); // You block an attack!
            defender.SendLocalizedMessage(1063346); // Your attack was blocked!

            attacker.FixedParticles(0x37C4, 1, 16, 0x251D, 0x39D, 0x3, EffectLayer.RightHand);

            int parry = (int)attacker.Skills[SkillName.Parry].Value;

            bool   creature = attacker is BaseCreature;
            double skill    = creature ? attacker.Skills[SkillName.Bushido].Value :
                              Math.Max(attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value);

            int dcibonus   = (int)(10.0 * ((skill - 50.0) / 70.0 + 5));
            int spellblock = parry <= 70 ? 70 : parry <= 100 ? 40 : 20;
            int meleeblock = parry <= 70 ? 80 : parry <= 100 ? 65 : 55;

            BeginBlock(attacker, dcibonus, spellblock, meleeblock);

            if (creature)
            {
                PetTrainingHelper.OnWeaponAbilityUsed((BaseCreature)attacker, SkillName.Bushido);
            }
        }
Esempio n. 4
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            bool immune    = Server.Items.ParalyzingBlow.IsImmune(defender);
            bool doEffects = false;

            if (Core.ML)
            {
                AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + Utility.Random(10)), true, 100, 0, 0, 0, 0);     //0-25

                if (!immune && ((150.0 / 7.0 + (4.0 * attacker.Skills[SkillName.Bushido].Value) / 7.0) / 100.0) > Utility.RandomDouble())
                {
                    defender.Paralyze(TimeSpan.FromSeconds(2.0));
                    doEffects = true;
                }

                if (attacker is BaseCreature)
                {
                    PetTrainingHelper.OnWeaponAbilityUsed((BaseCreature)attacker, SkillName.Bushido);
                }
            }
            else
            {
                AOS.Damage(defender, attacker, (int)(15.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 10), true, 100, 0, 0, 0, 0); //10-25

                if (!immune)
                {
                    defender.Freeze(TimeSpan.FromSeconds(2.0));
                    doEffects = true;
                }
            }

            if (!immune)
            {
                attacker.SendLocalizedMessage(1063356); // You cripple your target with a nerve strike!
                defender.SendLocalizedMessage(1063357); // Your attacker dealt a crippling nerve strike!
            }
            else
            {
                attacker.SendLocalizedMessage(1070804); // Your target resists paralysis.
                defender.SendLocalizedMessage(1070813); // You resist paralysis.
            }

            if (doEffects)
            {
                attacker.PlaySound(0x204);
                defender.FixedEffect(0x376A, 9, 32);
                defender.FixedParticles(0x37C4, 1, 8, 0x13AF, 0, 0, EffectLayer.Waist);
            }

            Server.Items.ParalyzingBlow.BeginImmunity(defender, Server.Items.ParalyzingBlow.FreezeDelayDuration);
        }
Esempio n. 5
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            if (Registry.ContainsKey(attacker))
            {
                if (m_Registry[attacker] != null)
                {
                    m_Registry[attacker].Stop();
                }

                Registry.Remove(attacker);
            }

            bool creature = attacker is BaseCreature;

            ClearCurrentAbility(attacker);

            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);
            attacker.PlaySound(0x525);

            double skill = creature ? attacker.Skills[SkillName.Bushido].Value :
                           Math.Max(attacker.Skills[SkillName.Ninjitsu].Value, attacker.Skills[SkillName.Bushido].Value);

            int bonus = (int)(20.0 + 3.0 * (skill - 50.0) / 7.0);

            FeintTimer t = new FeintTimer(attacker, defender, bonus);                   //20-50 % decrease

            t.Start();
            m_Registry[attacker] = t;

            string args = String.Format("{0}\t{1}", defender.Name, bonus);

            BuffInfo.AddBuff(attacker, new BuffInfo(BuffIcon.Feint, 1151308, 1151307, TimeSpan.FromSeconds(6), attacker, args));

            if (creature)
            {
                PetTrainingHelper.OnWeaponAbilityUsed((BaseCreature)attacker, SkillName.Bushido);
            }
        }
Esempio n. 6
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))    //Mana check after check that there are targets
            {
                return;
            }

            ClearCurrentAbility(attacker);

            Map map = attacker.Map;

            if (map == null)
            {
                return;
            }

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon == null)
            {
                return;
            }

            List <Mobile> targets = new List <Mobile>();

            targets.Add(defender);

            IPooledEnumerable eable = attacker.GetMobilesInRange(2);

            foreach (Mobile m in eable)
            {
                if (m != attacker && SpellHelper.ValidIndirectTarget(attacker, m))
                {
                    if (m == null || m.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.CanSee(m) ||
                        !attacker.CanBeHarmful(m) || !attacker.InLOS(m))
                    {
                        continue;
                    }

                    if (m is PlayerMobile)
                    {
                        BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.SplinteringEffect, 1153804, 1028852, TimeSpan.FromSeconds(2.0), m));
                    }

                    targets.Add(m);
                }
            }
            eable.Free();

            if (targets.Count > 0)
            {
                if (!CheckMana(attacker, true))
                {
                    return;
                }

                attacker.FixedEffect(0x3728, 10, 15);
                attacker.PlaySound(0x2A1);

                if (m_Registry.ContainsKey(attacker))
                {
                    RemoveFromRegistry(attacker);
                }

                m_Registry[attacker] = new InternalTimer(attacker, targets);

                if (defender is PlayerMobile && attacker is PlayerMobile)
                {
                    defender.SendSpeedControl(SpeedControlType.WalkSpeed);
                    BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.SplinteringEffect, 1153804, 1152144, TimeSpan.FromSeconds(2.0), defender));
                    Timer.DelayCall <Mobile>(TimeSpan.FromSeconds(2), mob => mob.SendSpeedControl(SpeedControlType.Disable), defender);
                }

                if (attacker is BaseCreature)
                {
                    PetTrainingHelper.OnWeaponAbilityUsed((BaseCreature)attacker, SkillName.Ninjitsu);
                }
            }
        }