Exemplo n.º 1
0
        public static readonly TimeSpan BlockMountDuration = TimeSpan.FromSeconds(10.0);           // TODO: Taken from bola script, needs to be verified

        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!defender.Mounted && !AnimalForm.UnderTransformation(defender) && !defender.Flying)
            {
                attacker.SendLocalizedMessage(1060848);                   // This attack only works on mounted or flying targets
                ClearCurrentAbility(attacker);
                return;
            }

            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            IMount mount = defender.Mount;

            if (!attacker.Mounted)
            {
                defender.FixedParticles(0x376A, 9, 32, 0x13AF, 0, 0, EffectLayer.RightFoot);

                if (mount != null)
                {
                    mount.Rider = null;
                }
                else if (defender.Flying)
                {
                    defender.Flying = false;
                }
                else
                {
                    AnimalForm.RemoveContext(defender, true);
                }

                if (mount is Mobile)
                {
                    Mobile m = (Mobile)mount;

                    AOS.Damage(m, attacker, (int)(0.4 * m.Hits), 100, 0, 0, 0, 0);
                }
            }
            else
            {
                int amount = 10 + (int)(10.0 * (attacker.Skills[SkillName.Bushido].Value - 50.0) / 70.0 + 5);

                AOS.Damage(defender, attacker, amount, 100, 0, 0, 0, 0);

                ParalyzingBlow pb = new ParalyzingBlow();
                pb.IsBladeweaveAttack = true;
                pb.OnHit(attacker, defender, damage);
            }
        }
Exemplo n.º 2
0
        public static readonly TimeSpan BlockMountDuration = TimeSpan.FromSeconds( 10.0 ); // TODO: Taken from bola script, needs to be verified

        #endregion Fields

        #region Methods

        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !defender.Mounted && !AnimalForm.UnderTransformation( defender ) && !defender.Flying )
            {
                attacker.SendLocalizedMessage( 1060848 ); // This attack only works on mounted or flying targets
                ClearCurrentAbility( attacker );
                return;
            }

            if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
                return;

            ClearCurrentAbility( attacker );

            IMount mount = defender.Mount;

            if ( !attacker.Mounted )
            {
                defender.FixedParticles( 0x376A, 9, 32, 0x13AF, 0, 0, EffectLayer.RightFoot );

                if ( mount != null )
                    mount.Rider = null;
                else if ( defender.Flying )
                    defender.Flying = false;
                else
                    AnimalForm.RemoveContext( defender, true );

                if ( mount is Mobile )
                {
                    Mobile m = (Mobile) mount;

                    AOS.Damage( m, attacker, (int) ( 0.4 * m.Hits ), 100, 0, 0, 0, 0 );
                }
            }
            else
            {
                int amount = 10 + (int) ( 10.0 * ( attacker.Skills[SkillName.Bushido].Value - 50.0 ) / 70.0 + 5 );

                AOS.Damage( defender, attacker, amount, 100, 0, 0, 0, 0 );

                ParalyzingBlow pb = new ParalyzingBlow();
                pb.IsBladeweaveAttack = true;
                pb.OnHit( attacker, defender, damage );
            }
        }
Exemplo n.º 3
0
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
            {
                return;
            }

            attacker.PlaySound( 0x5BC ); // Bladeweave sound effect
            attacker.FixedParticles( 0x376A, 1, 20, 0x7F5, 0x960, 0x3, EffectLayer.Waist ); // TODO: Revisar efecto

            switch ( Utility.RandomMinMax( 1, 7 ) )
            {
                case 1:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Paralyzing Blow" ); // You weave your blade to execute a ~1_attack~.
                        ParalyzingBlow at = new ParalyzingBlow();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 2:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Bleed Attack" ); // You weave your blade to execute a ~1_attack~.
                        BleedAttack at = new BleedAttack();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 3:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Double Strike" ); // You weave your blade to execute a ~1_attack~.
                        DoubleStrike at = new DoubleStrike();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 4:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Feint" ); // You weave your blade to execute a ~1_attack~.
                        Feint at = new Feint();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 5:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Mortal Strike" ); // You weave your blade to execute a ~1_attack~.
                        MortalStrike at = new MortalStrike();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 6:
                    {
                        attacker.SendLocalizedMessage( 1072841, "block" ); // You weave your blade to execute a ~1_attack~.
                        Block at = new Block();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
                case 7:
                    {
                        attacker.SendLocalizedMessage( 1072841, "Crushing Blow" ); // You weave your blade to execute a ~1_attack~.
                        CrushingBlow at = new CrushingBlow();
                        at.IsBladeweaveAttack = true;
                        at.OnHit( attacker, defender, damage );
                        break;
                    }
            }
        }
Exemplo n.º 4
0
        public static void ApplyDamageEffect(Mobile defender, Mobile attacker, AmmoTypes typeAmmo)
        {
            double luck = attacker.Luck * .02;

            int physicaldamage = (int)((100 - defender.GetResistance(ResistanceType.Physical)) * .07 + luck);
            int colddamage     = (int)((100 - defender.GetResistance(ResistanceType.Cold)) * .07 + luck);
            int firedamage     = (int)((100 - defender.GetResistance(ResistanceType.Fire)) * .07 + luck);
            int poisondamage   = (int)((100 - defender.GetResistance(ResistanceType.Poison)) * .07 + luck);
            int energydamage   = (int)((100 - defender.GetResistance(ResistanceType.Energy)) * .07 + luck);

            if (physicaldamage < 1)
            {
                physicaldamage = 1;
            }
            if (colddamage < 1)
            {
                colddamage = 1;
            }
            if (firedamage < 1)
            {
                firedamage = 1;
            }
            if (poisondamage < 1)
            {
                poisondamage = 1;
            }
            if (energydamage < 1)
            {
                energydamage = 1;
            }

            switch (typeAmmo)
            {
            case AmmoTypes.Oak:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 5), 100, 0, 0, 0, 0);
                }

                break;
            }

            case AmmoTypes.Yew:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage + 3, attacker);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(3, 6), 100, 0, 0, 0, 0);
                }

                break;
            }

            case AmmoTypes.Ash:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    SpellHelper.Damage(new FireballSpell(attacker, null), defender, Utility.RandomMinMax(10, 30), 0, 100, 0, 0, 0);
                    attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                    attacker.PlaySound(Core.AOS ? 0x15E : 0x44B);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 5), 0, 100, 0, 0, 0);
                }

                break;
            }

            case AmmoTypes.Bloodwood:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.PlaySound(0x133);
                    defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);
                    BleedAttack.BeginBleed(defender, attacker);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 5), 100, 0, 0, 0, 0);
                }

                break;
            }

            case AmmoTypes.Heartwood:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.PlaySound(0xDD);
                    defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist);

                    if (attacker.Skills[SkillName.Poisoning].Value > Utility.RandomMinMax(50, 250))
                    {
                        defender.ApplyPoison(attacker, Poison.Deadly);
                    }
                    else
                    {
                        defender.ApplyPoison(attacker, Poison.Regular);
                    }
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 5), 0, 0, 0, 100, 0);
                }

                break;
            }

            case AmmoTypes.Frostwood:
            {
                if ((0.15 + luck) > Utility.RandomDouble())
                {
                    TimeSpan duration = defender.Player ? TimeSpan.FromSeconds(4) : TimeSpan.FromSeconds(8);
                    defender.Paralyze(duration);
                    ParalyzingBlow.BeginImmunity(defender, duration + TimeSpan.FromSeconds(4));
                    defender.FixedEffect(0x376A, 9, 32);
                    defender.PlaySound(0x204);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 5), 0, 100, 15, 0, 0);
                }

                break;
            }

            case AmmoTypes.DullCopper:
            {
                if ((0.3 + luck) > Utility.RandomDouble())
                {
                    AOS.Damage(defender, Utility.RandomMinMax(8, 18), true, 100, 0, 0, 0, 0);
                    defender.FixedParticles(0x3728, 1, 26, 0x26D6, 0, 0, EffectLayer.Waist);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, Utility.Random(1, 8), 100, 0, 0, 0, 0);
                }

                break;
            }

            case AmmoTypes.ShadowIron:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(energydamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 0, 0, 0, 0, 40);
                }
                break;
            }

            case AmmoTypes.Copper:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(energydamage, attacker);
                    defender.Damage(poisondamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 0, 0, 0, 30, 30);
                }
                break;
            }

            case AmmoTypes.Bronze:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                    defender.Damage(firedamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 15, 40, 0, 0, 0);
                }
                break;
            }

            case AmmoTypes.Gold:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                    defender.Damage(firedamage, attacker);
                    defender.Damage(colddamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 20, 15, 15, 0, 0);
                }
                break;
            }

            case AmmoTypes.Agapite:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                    defender.Damage(firedamage, attacker);
                    defender.Damage(energydamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 25, 30, 0, 0, 20);
                }
                break;
            }

            case AmmoTypes.Verite:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                    defender.Damage(poisondamage, attacker);
                    defender.Damage(energydamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 30, 0, 0, 40, 20);
                }
                break;
            }

            case AmmoTypes.Valorite:
            {
                if ((0.1 + luck) > Utility.RandomDouble())
                {
                    defender.Damage(physicaldamage, attacker);
                    defender.Damage(firedamage, attacker);
                    defender.Damage(colddamage, attacker);
                    defender.Damage(poisondamage, attacker);
                    defender.Damage(energydamage, attacker);
                    defender.PlaySound(0x56);
                }
                else
                {
                    AOS.Damage(defender, 5, 50, 10, 20, 10, 20);
                }
                break;
            }

            default: break;
            }
        }
Exemplo n.º 5
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            attacker.PlaySound(0x5BC);                                                    // Bladeweave sound effect
            attacker.FixedParticles(0x376A, 1, 20, 0x7F5, 0x960, 0x3, EffectLayer.Waist); // TODO: Revisar efecto

            switch (Utility.RandomMinMax(1, 7))
            {
            case 1:
            {
                attacker.SendLocalizedMessage(1072841, "Paralyzing Blow");                                   // You weave your blade to execute a ~1_attack~.
                ParalyzingBlow at = new ParalyzingBlow();
                at.IsBladeweaveAttack = true;
                at.OnHit(attacker, defender, damage);
                break;
            }

            case 2:
            {
                attacker.SendLocalizedMessage(1072841, "Bleed Attack");                                   // You weave your blade to execute a ~1_attack~.
                BleedAttack at = new BleedAttack();
                at.IsBladeweaveAttack = true;
                at.OnHit(attacker, defender, damage);
                break;
            }

            case 3:
            {
                attacker.SendLocalizedMessage(1072841, "Double Strike");                                   // You weave your blade to execute a ~1_attack~.
                DoubleStrike at = new DoubleStrike();
                at.IsBladeweaveAttack = true;
                at.OnHit(attacker, defender, damage);
                break;
            }

            case 4:
            {
                attacker.SendLocalizedMessage(1072841, "Feint");                                   // You weave your blade to execute a ~1_attack~.
                Feint at = new Feint();
                at.IsBladeweaveAttack = true;
                at.OnHit(attacker, defender, damage);
                break;
            }

            case 5:
            {
                attacker.SendLocalizedMessage(1072841, "Mortal Strike");                                   // You weave your blade to execute a ~1_attack~.
                MortalStrike at = new MortalStrike();
                at.IsBladeweaveAttack = true;
                at.OnHit(attacker, defender, damage);
                break;
            }

            case 6:
            {
                attacker.SendLocalizedMessage(1072841, "block");                                   // You weave your blade to execute a ~1_attack~.
                Block at = new Block();
                at.IsBladeweaveAttack = true;
                at.OnHit(attacker, defender, damage);
                break;
            }

            case 7:
            {
                attacker.SendLocalizedMessage(1072841, "Crushing Blow");                                   // You weave your blade to execute a ~1_attack~.
                CrushingBlow at = new CrushingBlow();
                at.IsBladeweaveAttack = true;
                at.OnHit(attacker, defender, damage);
                break;
            }
            }
        }