示例#1
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            // Necromancers under Lich or Wraith Form are immune to Bleed Attacks.
            TransformContext context = TransformationSpell.GetContext(defender);

            if ((context != null && (context.Type == typeof(LichFormSpell) || context.Type == typeof(WraithFormSpell))) ||
                (defender is BaseCreature && ((BaseCreature)defender).BleedImmune))
            {
                attacker.SendLocalizedMessage(1062052);                   // Your target is not affected by the bleed attack!
                return;
            }

            attacker.SendLocalizedMessage(1060159);               // Your target is bleeding!
            defender.SendLocalizedMessage(1060160);               // You are bleeding!

            if (defender is PlayerMobile)
            {
                defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757);                   // You are bleeding profusely
                defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name); // ~1_NAME~ is bleeding profusely
            }

            defender.PlaySound(0x133);
            defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

            BeginBleed(defender, attacker);
        }
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            if (defender != null && ((BaseCreature)defender).BleedImmune)
            {
                attacker.SendLocalizedMessage(1062052);                   // Your target is not affected by the bleed attack!

                return;
            }

            TransformContext context = TransformationSpell.GetContext(defender);

            // Necromancers under Lich Form or Wraith Form are immune to Bleed Attacks.
            if (context == null || (context.Type != typeof(LichFormSpell) && context.Type != typeof(WraithFormSpell)))
            {
                attacker.SendLocalizedMessage(1060159);                   // Your target is bleeding!
                defender.SendLocalizedMessage(1060160);                   // You are bleeding!

                defender.PlaySound(0x133);
                defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

                BeginBleed(defender, attacker);
            }
            else
            {
                attacker.SendLocalizedMessage(1062052);                   // Your target is not affected by the bleed attack!
            }
        }
示例#3
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!IsBladeweaveAttack)
            {
                if (!Validate(attacker))
                {
                    return;
                }
                if (!CheckMana(attacker, true))
                {
                    return;
                }
            }

            ClearCurrentAbility(attacker);

            if (defender is BaseCreature)
            {
                if (defender != null && ((BaseCreature)defender).BleedImmune)
                {
                    attacker.SendLocalizedMessage(1062052);                       // Your target is not affected by the bleed attack!

                    return;
                }
            }

            TransformContext context = TransformationSpell.GetContext(defender);

            // Necromancers under Lich Form or Wraith Form are immune to Bleed Attacks.
            if (context == null || (context.Type != typeof(LichFormSpell) && context.Type != typeof(WraithFormSpell)))
            {
                attacker.SendLocalizedMessage(1060159);                   // Your target is bleeding!
                defender.SendLocalizedMessage(1060160);                   // You are bleeding!

                if (defender is PlayerMobile)
                {
                    defender.LocalOverheadMessage(MessageType.Regular, 0x21, 1060757);                       // You are bleeding profusely
                    defender.NonlocalOverheadMessage(MessageType.Regular, 0x21, 1060758, defender.Name);     // ~1_NAME~ is bleeding profusely
                }

                defender.PlaySound(0x133);
                defender.FixedParticles(0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist);

                TimeSpan duration = ComputeDuration(defender);

                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.Bleed, 1075829, duration, defender, String.Format("{0}\t{1}\t{2}", 5, 10, 2)));

                BeginBleed(defender, attacker, duration);
            }
            else
            {
                attacker.SendLocalizedMessage(1062052);                   // Your target is not affected by the bleed attack!
            }
        }
示例#4
0
        public override void OnCast()
        {
            if (CheckSequence())
            {
                ArrayList targets = new ArrayList();

                foreach (Mobile m in Caster.GetMobilesInRange(8))
                {
                    if (Caster != m && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false))
                    {
                        targets.Add(m);
                    }
                }

                Caster.PlaySound(0x299);
                Caster.FixedParticles(0x37C4, 1, 25, 9922, 14, 3, EffectLayer.Head);

                int dispelSkill = ComputePowerValue(2);

                double chiv = Caster.Skills.Chivalry.Value;

                for (int i = 0; i < targets.Count; ++i)
                {
                    Mobile       m  = (Mobile)targets[i];
                    BaseCreature bc = m as BaseCreature;

                    if (bc != null)
                    {
                        bool dispellable = bc.Summoned && !bc.IsAnimatedDead;

                        if (dispellable)
                        {
                            double dispelChance = (50.0 + ((100 * (chiv - bc.DispelDifficulty)) / (bc.DispelFocus * 2))) / 100;
                            dispelChance *= dispelSkill / 100.0;

                            if (dispelChance > Utility.RandomDouble())
                            {
                                Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
                                Effects.PlaySound(m, m.Map, 0x201);

                                m.Delete();
                                continue;
                            }
                        }

                        bool evil = !bc.Controled && bc.Karma < 0;

                        if (evil)
                        {
                            // TODO: Is this right?
                            double fleeChance = (100 - Math.Sqrt(m.Fame / 2)) * chiv * dispelSkill;
                            fleeChance /= 1000000;

                            if (fleeChance > Utility.RandomDouble())
                            {
                                // guide says 2 seconds, it's longer
                                bc.BeginFlee(TimeSpan.FromSeconds(30.0));
                            }
                        }
                    }

                    if (TransformationSpell.GetContext(m) != null)
                    {
                        // transformed ..

                        double drainChance = 0.5 * (Caster.Skills.Chivalry.Value / Math.Max(m.Skills.Necromancy.Value, 1));

                        if (drainChance > Utility.RandomDouble())
                        {
                            int drain = (5 * dispelSkill) / 100;

                            m.Stam -= drain;
                            m.Mana -= drain;
                        }
                    }
                }
            }

            FinishSequence();
        }