示例#1
0
        private static void OnHit(Mobile from, Mobile target, INinjaWeapon weapon)
        {
            if (!from.CanBeHarmful(target))
            {
                return;
            }

            from.DoHarmful(target);

            AOS.Damage(target, from, weapon.WeaponDamage, 100, 0, 0, 0, 0);

            if (weapon.Poison != null && weapon.PoisonCharges > 0)
            {
                if (EvilOmenSpell.TryEndEffect(target))
                {
                    target.ApplyPoison(from, Poison.GetPoison(weapon.Poison.Level + 1));
                }
                else
                {
                    target.ApplyPoison(from, weapon.Poison);
                }

                weapon.PoisonCharges--;

                if (weapon.PoisonCharges < 1)
                {
                    weapon.Poison = null;
                }
            }
        }
示例#2
0
    private void ExecutePoisonTrap(Mobile from, Point3D loc)
    {
        var facet = Map;

        if (from.InRange(loc, 3))
        {
            Poison poison;

            if (_trapLevel > 0)
            {
                poison = Poison.GetPoison(Math.Max(0, Math.Min(4, _trapLevel - 1)));
            }
            else
            {
                AOS.Damage(from, _trapPower, 0, 0, 0, 100, 0);
                poison = Poison.Greater;
            }

            from.ApplyPoison(from, poison);

            // You are enveloped in a noxious green cloud!
            from.LocalOverheadMessage(MessageType.Regular, 0x44, 503004);
        }

        Effects.SendLocationEffect(loc, facet, 0x113A, 10, 20);
        Effects.PlaySound(loc, facet, 0x231);
    }
示例#3
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon == null)
            {
                return;
            }

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

            int    level = attacker.Skills[SkillName.Poisoning].Fixed / 250;
            Poison p     = Poison.GetPoison(level);

            defender.PlaySound(0xDD);
            defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist);

            if (defender.ApplyPoison(attacker, p) != ApplyPoisonResult.Immune)
            {
                attacker.SendLocalizedMessage(1008096, true, defender.Name);                   // You have poisoned your target :
                defender.SendLocalizedMessage(1008097, false, attacker.Name);                  //  : poisoned you!

                Titles.AwardKarma(attacker, -10, true);
            }
        }
示例#4
0
 public void CheckEffect(Mobile attacker, Mobile target)
 {
     if (Utility.Random(100) < 2)
     {
         target.ApplyPoison(attacker, Poison.GetPoison(Level));
     }
 }
示例#5
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                Mobile source = Caster;

                SpellHelper.Turn(source, m);

                Disturb(m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                //double damage = GetNewAosDamage( 10, 1, 3, true);

                m.PlaySound(22);
                Effects.SendTargetEffect(m, 0x923, 3, 30);

                if (Utility.RandomDouble() <= 0.15)
                {
                    m.ApplyPoison(Caster, Poison.GetPoison(0));

                    m.SendMessage("Les abeilles vous piquent et vous sentez leur venin parcourir vos veines !");
                }

                //SpellHelper.Damage( TimeSpan.Zero, m, Caster, damage, 0, 0, 0, 0, 100 );
            }

            FinishSequence();
        }
示例#6
0
        private void PoisonAttack()
        {
            Combatant.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
            Combatant.PlaySound(0x474);

            Combatant.ApplyPoison(this, Poison.GetPoison(4));
        }
示例#7
0
        private static void OnHit(object[] states)
        {
            Mobile       from   = states[0] as Mobile;
            Mobile       target = states[1] as Mobile;
            INinjaWeapon weapon = states[2] as INinjaWeapon;

            if (from.CanBeHarmful(target))
            {
                from.DoHarmful(target);

                AOS.Damage(target, from, weapon.WeaponDamage, 100, 0, 0, 0, 0);

                if (weapon.Poison != null && weapon.PoisonCharges > 0)
                {
                    if (EvilOmenSpell.TryEndEffect(target))
                    {
                        target.ApplyPoison(from, Poison.GetPoison(weapon.Poison.Level + 1));
                    }
                    else
                    {
                        target.ApplyPoison(from, weapon.Poison);
                    }

                    weapon.PoisonCharges--;

                    if (weapon.PoisonCharges < 1)
                    {
                        weapon.Poison = null;
                    }
                }
            }
        }
示例#8
0
            protected override void OnTick()
            {
                if (m_From == null)
                {
                    return;
                }

                /*
                 * if (m_Mobile == null)
                 *  return;
                 * m_loc = m_Mobile.Location;
                 * if (ExplosionRange == null)
                 *  return;
                 * if (minDamage == null)
                 *  return;
                 */
                m_Mobile.PlaySound(0x11D);
                if ((Map)map != null)
                {
                    IPooledEnumerable eable = (IPooledEnumerable)map.GetMobilesInRange(m_loc, ExplosionRange);

                    foreach (object o in eable)
                    {
                        if ((o is Mobile) && (o != m_From) && (m_Mobile == null || (SpellHelper.ValidIndirectTarget(m_From, (Mobile)o) && m_From.CanBeHarmful((Mobile)o, false))))
                        {
                            if (o is PlayerMobile)
                            {
                                AOS.Damage((Mobile)o, m_From, Utility.RandomMinMax(0, exploDamage / 4), 0, 100, 0, 0, 0);
                            }
                            else if (o is BaseCreature && ((BaseCreature)m_From).Controlled)
                            {
                                if (((BaseCreature)m_From).ControlMaster != ((BaseCreature)o).ControlMaster)
                                {
                                    AOS.Damage((Mobile)o, m_From, Utility.RandomMinMax(0, exploDamage), 0, 100, 0, 0, 0);
                                }
                                else if (o is BaseCreature)
                                {
                                    AOS.Damage((Mobile)o, m_From, Utility.RandomMinMax(0, exploDamage), 0, 100, 0, 0, 0);
                                }
                            }
                            if (Utility.RandomDouble() < ((BaseCreature)m_From).ControlMaster.Skills[SkillName.Poisoning].Value / 120.0)
                            {
                                if (Utility.RandomDouble() < ((BaseCreature)m_From).ControlMaster.Skills[SkillName.Poisoning].Value / 120.0)
                                {
                                    ++level;
                                }
                                ((Mobile)o).ApplyPoison(m_From, Poison.GetPoison(level));
                            }
                        }
                    }
                }

                if (m_Mobile != null)
                {
                    AOS.Damage(m_Mobile, m_From, Utility.RandomMinMax(minDamage, minDamage * 3), 100, 0, 0, 0, 0);
                }
            }
示例#9
0
        /// <summary>
        /// Lowers an applied poison level by one degree at <code>PerkLevel.Second</code>
        /// </summary>
        public Poison GetLowerPoison(Poison p)
        {
            if (Level < PerkLevel.Second)
            {
                return(p);
            }

            return(Poison.GetPoison(p.Level - 1));
        }
示例#10
0
 protected override void OnTarget(Mobile from, object o)
 {
     if (o is Mobile)
     {
         Mobile hurt = o as Mobile;
         hurt.ApplyPoison(source, Poison.GetPoison(3));
         hurt.Emote("You see {0} gets poisoned by {1}'s Whip", hurt.Name, source.Name);
     }
 }
示例#11
0
        public override void DoDamage(Mobile m)
        {
            AOS.Damage(m, m_Mobile, Utility.Random(5, m_Mobile.Str / 10), 100, 0, 0, 0, 0);

            if (Utility.RandomBool())
            {
                m.ApplyPoison(m_Mobile, Poison.GetPoison(2 + Utility.Random(3)));
            }
        }
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            if (!(attacker.Weapon is BaseWeapon weapon))
            {
                return;
            }

            var p = weapon.Poison;

            if (p == null || weapon.PoisonCharges <= 0)
            {
                // Your weapon must have a dose of poison to perform an infectious strike!
                attacker.SendLocalizedMessage(1061141);
                return;
            }

            --weapon.PoisonCharges;

            // Infectious strike special move now uses poisoning skill to help determine potency
            var maxLevel = Math.Max(attacker.Skills.Poisoning.Fixed / 200, 0);

            if (p.Level > maxLevel)
            {
                p = Poison.GetPoison(maxLevel);
            }

            if (attacker.Skills.Poisoning.Value / 100.0 > Utility.RandomDouble())
            {
                var level     = p.Level + 1;
                var newPoison = Poison.GetPoison(level);

                if (newPoison != null)
                {
                    p = newPoison;

                    attacker.SendLocalizedMessage(1060080); // Your precise strike has increased the level of the poison by 1
                    defender.SendLocalizedMessage(1060081); // The poison seems extra effective!
                }
            }

            defender.PlaySound(0xDD);
            defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist);

            if (defender.ApplyPoison(attacker, p) != ApplyPoisonResult.Immune)
            {
                attacker.SendLocalizedMessage(1008096, true, defender.Name);  // You have poisoned your target :
                defender.SendLocalizedMessage(1008097, false, attacker.Name); //  : poisoned you!
            }
        }
示例#13
0
            protected override void OnTick()
            {
                m_Count++;

                int poisonLevel = CurrentPoisonLevel();

                m_Room.OnPoison(Poison.GetPoison(poisonLevel), m_Count);
                m_Room.PoisonPlayers(Poison.GetPoison(poisonLevel));
                m_Room.DoGasEffect();
            }
示例#14
0
 public override void OnGotMeleeAttack(Mobile attacker)
 {
     if (!attacker.Poisoned)
     {
         int poison = Utility.RandomMinMax(0, 1);
         base.OnGotMeleeAttack(attacker);
         attacker.ApplyPoison(attacker, Poison.GetPoison(poison));
         attacker.SendMessage("You got poisoned when striking in the poisonous slimy body");
     }
 }
示例#15
0
        public override void DoDamage(Mobile m)
        {
            if (m.Player)
            {
                m.SendLocalizedMessage(1070821, m_Mobile.Name);                   // ~1_CREATURE~ spits a poisonous substance at you!
            }

            m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
            m.PlaySound(0x474);
            m.ApplyPoison(m_Mobile, Poison.GetPoison(2 + Utility.Random(3)));
        }
示例#16
0
        public void DoAbilityInfectiousWounds(BaseCreature target, Mobile attacker)
        {
            attacker.SendMessage(54, "Infection floods from your talisman");
            attacker.PublicOverheadMessage(MessageType.Label, 34, true, "Infection floods from your talisman.");
            int range   = Utility.RandomMinMax(3, 5);
            int zOffset = 10;

            Point3D src = attacker.Location.Clone3D(0, 0, zOffset);

            Point3D[] points = src.GetAllPointsInRange(attacker.Map, range, range);

            Effects.PlaySound(attacker.Location, attacker.Map, 0x19C);

            Timer.DelayCall(
                TimeSpan.FromMilliseconds(100),
                () =>
            {
                foreach (Point3D trg in points)
                {
                    int bloodID = Utility.RandomMinMax(4650, 4655);

                    new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), attacker.Map, bloodID, 1367).MovingImpact(
                        info =>
                    {
                        var blood = new Blood
                        {
                            ItemID = bloodID,
                            Hue    = 1368
                        };
                        blood.MoveToWorld(info.Target.Location, info.Map);

                        Effects.PlaySound(info.Target, info.Map, 0x028);
                    });
                }
                foreach (
                    Mobile mobile in
                    attacker.Location.GetMobilesInRange(attacker.Map, range)
                    .Where(m => m is BaseCreature && !m.IsControlled()).Take(4))
                {
                    var num = (int)Math.Floor((float)Level / 2);
                    if (num == 5)
                    {
                        num = 4;
                    }
                    mobile.ApplyPoison(attacker, Poison.GetPoison(num));
                }
                Experience++;
                if (Experience >= NextLevelExperience)
                {
                    LevelUpInfectiousWounds(_Owner);
                }
            });
            NextUse = DateTime.UtcNow + CoolDown;
        }
        //[Constructable]
        public CustomShapeshifterWeapon(int type, string name, int hue, TeiravonMobile Shifter) : base(0x2644)
        {
            int index = type;

            int ShifterLevel = Shifter.PlayerLevel;

            if (!Shifter.IsShapeshifter())
            {
                ShifterLevel = (ShifterLevel / 2);
            }

            Weight  = 0.0;
            Movable = false;

            if (name != null)
            {
                Name = name + "'s Limb";
            }
            else
            {
                Name = "Animal Limb";
            }

            Resource  = CraftResource.None;
            Hue       = 1;
            LootType  = LootType.Newbied;
            Layer     = Layer.TwoHanded;
            ItemID    = (int)(TAVShiftUtilities.ShiftInfo.Table[index].WeapID);
            Primary   = (WeaponAbility)(TAVShiftUtilities.ShiftInfo.Table[index].PrimaryAbility);
            Secondary = (WeaponAbility)(TAVShiftUtilities.ShiftInfo.Table[index].PrimaryAbility);

            PoisonCharges = 9999;
            Poison        = Poison.GetPoison(ShifterLevel / 5);

            Attributes.WeaponSpeed = (int)(TAVShiftUtilities.ShiftInfo.Table[index].SpeedScale * (ShifterLevel * 2));
            MinDamage = 8 + (int)(TAVShiftUtilities.ShiftInfo.Table[index].DamageScale * ShifterLevel);
            MaxDamage = 11 + (int)(TAVShiftUtilities.ShiftInfo.Table[index].DamageScale * ShifterLevel);

            if (index == 1)
            {
                SkillBonuses.Skill_1_Name  = SkillName.Tracking;
                SkillBonuses.Skill_1_Value = 5 * ShifterLevel;
            }
            if (index == 7)
            {
                SkillBonuses.Skill_1_Name  = SkillName.Stealth;
                SkillBonuses.Skill_1_Value = 5 * ShifterLevel;
            }
            if (index == 8)
            {
                SkillBonuses.Skill_1_Name  = SkillName.Poisoning;
                SkillBonuses.Skill_1_Value = 5 * ShifterLevel;
            }
        }
示例#18
0
        public override void OnCast()
        {
            if (!CheckSequence())
            {
                goto Return;
            }

            var map = Caster.Map;

            var level = 0;
            var pStr  = Caster.Skills[DamageSkill].Value;

            if (pStr > 100)
            {
                level = 1;
            }
            else if (pStr > 110)
            {
                level = 2;
            }
            else if (pStr > 130)
            {
                level = 3;
            }
            else if (pStr > 140)
            {
                level = 4;
            }
            else
            {
                level = 0;
            }

            if (map != null)
            {
                foreach (var m in Caster.GetMobilesInRange(1 + (int)(Caster.Skills[CastSkill].Value / 15.0)))
                {
                    if (Caster != m &&
                        SpellHelper.ValidIndirectTarget(Caster, m) &&
                        Caster.CanBeHarmful(m, false) &&
                        Caster.InLOS(m))
                    {
                        Caster.DoHarmful(m);

                        m.ApplyPoison(Caster, Poison.GetPoison(level));
                    }
                }
            }

            Caster.PlaySound(0x1e2);

Return:
            FinishSequence();
        }
示例#19
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker))
            {
                return;
            }

            ClearCurrentAbility(attacker);

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon == null)
            {
                return;
            }

            Poison p = weapon.Poison;

            if (p == null || weapon.PoisonCharges <= 0)
            {
                attacker.SendLocalizedMessage(1061141);                   // Your weapon must have a dose of poison to perform an infectious strike!
                return;
            }

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

            --weapon.PoisonCharges;

            if ((attacker.Skills[SkillName.Poisoning].Value / 100.0) > Utility.RandomDouble())
            {
                int    level     = p.Level + 1;
                Poison newPoison = Poison.GetPoison(level);

                if (newPoison != null)
                {
                    p = newPoison;

                    attacker.SendLocalizedMessage(1060080);                       // Your precise strike has increased the level of the poison by 1
                    defender.SendLocalizedMessage(1060081);                       // The poison seems extra effective!
                }
            }

            defender.PlaySound(0xDD);
            defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist);

            if (defender.ApplyPoison(attacker, p) != ApplyPoisonResult.Immune)
            {
                attacker.SendLocalizedMessage(1008096, true, defender.Name);                   // You have poisoned your target :
                defender.SendLocalizedMessage(1008097, false, attacker.Name);                  //  : poisoned you!
            }
        }
示例#20
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                m.Paralyzed = false;

                if (CheckResisted(m))
                {
                    m.SendLocalizedMessage(501783);                       // You feel yourself resisting magical energy.
                }
                else
                {
                    int level = 1;

                    if (Caster.Skills[SkillName.Magery].Value < 75)
                    {
                        level = 0;
                    }

                    if (Utility.Random(4) == 0)
                    {
                        level = 2;
                    }

                    if (m.ApplyPoison(Caster, Poison.GetPoison(level)) == ApplyPoisonResult.Poisoned)
                    {
                        if (m.PoisonTimer != null && m.PoisonTimer.Running && m.PoisonTimer.Delay > PoisonTickDelay)
                        {
                            m.PoisonTimer.Stop();
                            m.PoisonTimer.Delay = PoisonTickDelay;
                            m.PoisonTimer.Start();
                        }
                    }

                    if (m.Spell is MagerySpell && ((MagerySpell)m.Spell).State == SpellState.Casting)
                    {
                        m.Spell.OnCasterHurt((level + 1) * 5);
                    }
                }

                m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
                m.PlaySound(0x474);
            }

            FinishSequence();
        }
示例#21
0
            protected override void OnTick()
            {
                m_Count++;
                List <Mobile> list = m_Region.AliveMobiles;

                if (m_Region is PoisonRoomRegion)
                {
                    PoisonRoomRegion region = (PoisonRoomRegion)m_Region;

                    if (region.NoMobilesAlive || region.GetDarkGuardians.Count == 0)
                    {
                        region.Deactivate();
                        Stop();
                    }
                }

                foreach (Point3D point in LocationArray)
                {
                    Effects.SendLocationEffect(point, Map.Malas, 4518, 16, 1, 1166, 0);
                    Effects.PlaySound(point, Map.Malas, 0x231);
                }

                foreach (Mobile m in list)
                {
                    if (m.Poison == null || m.Poison.Level < PoisonLevel)
                    {
                        m.Poison = Poison.GetPoison(PoisonLevel);

                        int message = 0;

                        switch (PoisonLevel)
                        {
                        case 0:
                        case 1: message = 1050001; break;             // It is becoming more difficult for you to breathe as the poisons in the room become more concentrated.

                        case 2:
                        case 3: message = 1050002; break;     // You have trouble breathing...

                        case 4: message = 1050003; break;     // You begin to panic as the poison clouds thicken.
                        }

                        if (message != 0)
                        {
                            m.SendLocalizedMessage(message);
                        }
                    }

                    if (m.Hits < 20 && Utility.RandomDouble() < 0.33)
                    {
                        m.SendLocalizedMessage(1050055); // Terror grips your spirit as you realize you may never leave this room alive.
                    }
                }
            }
示例#22
0
        public static bool DoApplyWeaponPoison(BaseCreature creature)
        {
            bool success = true;

            BaseWeapon weapon = creature.Weapon as BaseWeapon;

            if (weapon == null)
            {
                return(false);
            }

            bool poisonable = (weapon.Type == WeaponType.Slashing || weapon.Type == WeaponType.Piercing || weapon.Type == WeaponType.Ranged);

            if (!poisonable)
            {
                return(false);
            }

            if (weapon.PoisonCharges > 0)
            {
                return(false);
            }

            if (creature.AIObject != null)
            {
                creature.AIObject.NextMove = DateTime.UtcNow + TimeSpan.FromSeconds(1.5);
            }
            creature.LastSwingTime = DateTime.UtcNow + TimeSpan.FromSeconds(1.5);

            if (creature.Body.IsHuman)
            {
                creature.Animate(17, 7, 1, true, false, 0);
            }

            else
            {
                creature.Animate(11, 5, 1, true, false, 0);
            }

            double poisoningSkill = creature.Skills[SkillName.Poisoning].Base;
            int    poisonLevel    = (int)(Math.Floor(poisoningSkill / 25));

            Poison m_Poison = Poison.GetPoison(poisonLevel);

            weapon.Poison        = m_Poison;
            weapon.PoisonCharges = 12 - (m_Poison.Level * 2);

            creature.PlaySound(0x4F);

            creature.PublicOverheadMessage(MessageType.Regular, 0, false, "*coats weapon in poison*");

            return(success);
        }
示例#23
0
        public void DoAbilityNoxiousBlood(BaseCreature target, BaseMetaPet pet)
        {
            int range   = Utility.RandomMinMax(3, 5);
            int zOffset = 10;

            Point3D src = pet.Location.Clone3D(0, 0, zOffset);

            Point3D[] points = src.GetAllPointsInRange(pet.Map, range, range);

            Effects.PlaySound(pet.Location, pet.Map, 0x19C);

            Timer.DelayCall(
                TimeSpan.FromMilliseconds(100),
                () =>
            {
                foreach (Point3D trg in points)
                {
                    int bloodID = Utility.RandomMinMax(4650, 4655);

                    new MovingEffectInfo(src, trg.Clone3D(0, 0, 2), pet.Map, bloodID, 1367).MovingImpact(
                        info =>
                    {
                        var blood = new Blood
                        {
                            ItemID = bloodID,
                            Hue    = 1368
                        };
                        blood.MoveToWorld(info.Target.Location, info.Map);

                        Effects.PlaySound(info.Target, info.Map, 0x028);
                    });
                }
                foreach (
                    Mobile mobile in
                    pet.Location.GetMobilesInRange(pet.Map, range)
                    .Where(m => m is BaseCreature && !m.IsControlled()).Take(4))
                {
                    var num = (int)Math.Floor((float)Level / 2);
                    if (num == 5)
                    {
                        num = 4;
                    }
                    mobile.ApplyPoison(pet, Poison.GetPoison(num));
                }
                Experience++;
                if (Experience >= NextLevelExperience)
                {
                    LevelUpNoxiousBlood(pet.ControlMaster);
                }
            });
            NextUse = DateTime.UtcNow + CoolDown;
        }
示例#24
0
文件: Poison.cs 项目: nogu3ira/xrunuo
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                if (m.Spell != null)
                {
                    m.Spell.OnCasterHurt();
                }

                m.Paralyzed = false;

                if (CheckResisted(m))
                {
                    m.SendLocalizedMessage(501783);                       // You feel yourself resisting magical energy.
                }
                else
                {
                    int level = GetPoisonLevel(Caster, m, SkillName.Poisoning, SkillName.Magery);

                    // Players with greater than GM Poisoning and GM Magery will have a 10%
                    // chance to inflict lethal poison at distance of less than 3 tiles.

                    double magery    = Caster.Skills.Magery.Value;
                    double poisoning = Caster.Skills.Poisoning.Value;

                    bool isGrandMaster = poisoning >= 100.0 && magery >= 100.0;

                    if (level == 3 && isGrandMaster && 0.1 > Utility.RandomDouble())
                    {
                        level++;
                    }

                    m.ApplyPoison(Caster, Poison.GetPoison(level));
                }

                m.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
                m.PlaySound(0x474);
            }

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

            ClearCurrentAbility(attacker);

            int level;

            double total = attacker.Skills[SkillName.Poisoning].Value + attacker.Skills[SkillName.Archery].Value + attacker.Dex;

            if (total >= 275.0 && 2 > Utility.Random(10))
            {
                level = 3;
            }
            else if (total > 200.0 && 4 > Utility.Random(10))
            {
                level = 2;
            }
            else if (total > 150.0 && 8 > Utility.Random(10))
            {
                level = 1;
            }
            else
            {
                level = 0;
            }

            if (level > 0)
            {
                attacker.SendMessage("You poisoned the target!");
                defender.SendMessage("You are poisoned!");

                defender.ApplyPoison(attacker, Poison.GetPoison(level));

                defender.FixedParticles(0x374A, 10, 15, 5021, EffectLayer.Waist);
                defender.PlaySound(0x474);

                //Possible to get Poisoning Gain
                attacker.CheckSkill(SkillName.Poisoning, 0, 100);
            }
            else
            {
                attacker.SendMessage("Your poison had no effect!");
            }
        }
示例#26
0
        public override bool OnMoveOver(Mobile mobile)
        {
            if (!UOACZSystem.IsUOACZValidMobile(mobile))
            {
                return(true);
            }

            mobile.FixedParticles(0x374A, 10, 20, 5021, 0x110, 0, EffectLayer.Head);
            mobile.PlaySound(m_HitSound);

            Poison poison = Poison.GetPoison(Utility.RandomMinMax(0, 1));

            mobile.ApplyPoison(m_Owner, poison);

            return(true);
        }
示例#27
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                Disturb(m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                int level;

                double total = (Caster.Skills[SkillName.ArtMagique].Value + Caster.Skills[SkillName.Empoisonnement].Value);

                if (total >= 200.0 && 3 > Utility.Random(10))
                {
                    level = 2;
                }
                else if (total > 140.0)
                {
                    level = 1;
                }
                else
                {
                    level = 0;
                }

                m.ApplyPoison(Caster, Poison.GetPoison(level));

                Effects.SendTargetParticles(m, 0x374A, 10, 15, 5021, EffectLayer.Waist);
                m.PlaySound(0x474);

                //double damage = GetNewAosDamage(2, 1, 2, false);

                //BaseArmor.AcidHit(m, (int)damage);

                //damage = GetNewAosDamage(12, 1, 4, false);

                //SpellHelper.Damage(this, m, damage, 0, 0, 0, 0, 100);
            }

            FinishSequence();
        }
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            ClearCurrentMove(attacker);

            if (Utility.RandomDouble() > 0.15)               //15% fail chance
            {
                int level;
                int total = (int)attacker.Skills[MoveSkill].Value;
                total += (int)attacker.Skills[SkillName.MagicResist].Value / 2;
                total /= 2;

                if (total > 82)                   // 105 Forensics & 120 MagicResist or better
                {
                    level = 4;                    // Lethal
                }
                else if (total > 74)              // GM Forensics & MagicResist
                {
                    level = 3;                    // Deadly
                }
                else if (total > 60)              // 80 in Forensics & MagicResist
                {
                    level = 2;                    // Greater
                }
                else if (total > 36)              // 50.0 in Forensics & MagicResist
                {
                    level = 1;                    // Regular
                }
                else
                {
                    level = 0;                     // Lesser
                }
                defender.ApplyPoison(attacker, Poison.GetPoison(level));
            }
            else
            {
                ClearCurrentMove(attacker);
                SetContext(attacker);
                attacker.SendMessage("Your claw attack failed. You prepare to strike again...");
                return;
            }

            BlueMageControl.CheckKnown(defender, this, CanTeach(attacker));
            CheckGain(attacker);

            attacker.SendMessage("You poison your opponent with a deadly claw attack.");
            defender.SendMessage("You were poisoned by your opponent's claws");
        }
示例#29
0
        public async Task OnTargetAsync(ITargetResponse <IPoint3D> response)
        {
            if (!response.HasValue)
            {
                return;
            }

            var point = SpellHelper.GetSurfaceTop(response.Target);

            SpellHelper.Turn(Caster, point);

            var magery = Caster.Skills.Magery.Value;
            var range  = magery / 20.0;
            var plvl   = magery / 50.0 + 2.0;

            Caster.FireHook(h => h.OnModifyWithMagicEfficiency(Caster, ref range));
            Caster.FireHook(h => h.OnModifyWithMagicEfficiency(Caster, ref plvl));

            var poison = Poison.GetPoison(Math.Min((int)plvl, Poison.Poisons.Count - 1));

            var eable = Caster.Map.GetMobilesInRange(point, (int)range);

            foreach (var mobile in eable)
            {
                if (Caster == mobile ||
                    !SpellHelper.ValidIndirectTarget(Caster, mobile) ||
                    !Caster.CanBeHarmful(mobile, false) ||
                    !Caster.InLOS(mobile) ||
                    mobile.CheckPoisonImmunity(Caster, poison))
                {
                    continue;
                }

                var level = SpellHelper.TryResistDamage(Caster, mobile, Circle, poison.Level);

                if (level > 0)
                {
                    mobile.ApplyPoison(Caster, Poison.GetPoison(level));
                }

                mobile.FixedParticles(0x3749, 7, 16, 5021, EffectLayer.Waist);
                mobile.PlaySound(0x1E1);

                mobile.Spell?.OnCasterHurt();
            }
            eable.Free();
        }
示例#30
0
        public override void OnHit(Mobile attacker, Mobile defender)
        {
            CustomRegion cR = defender.Region as CustomRegion;

            if (cR == null || cR.Controller.AllowSpecialAttacks)
            {
                if (Utility.Random(20) <= 2) // 10% chance of scoring a critical hit
                {
                    attacker.SendAsciiMessage("You poison your target!");
                    defender.PublicOverheadMessage(MessageType.Emote, 34, false, string.Format("*{0} suddenly feels very ill*", defender.Name));
                    defender.ApplyPoison(attacker, Poison.GetPoison(0));
                    new InternalTimer(defender).Start();
                }
            }

            base.OnHit(attacker, defender);
        }