Exemplo n.º 1
0
        public void Target(Mobile m)
        {
            /*
             * Puts one or more Targets within a radius around the Target's Location
             * into a temporary Sleep state. In this state, Slept Targets will be
             * unable to attack or cast spells, and will move at a much slower speed.
             * They will awaken if harmed or after a set amount of time. The Sleep
             * duration is determined by a comparison between the Caster's Mysticism
             * and either Focus or Imbuing (whichever is greater) skills and the
             * Target's Resisting Spells skill.
             */

            if (CheckSequence())
            {
                SpellHelper.Turn(Caster, m);

                Map map = Caster.Map;

                if (map != null)
                {
                    foreach (Mobile target in m.GetMobilesInRange(2))
                    {
                        if (Caster != target && Caster.InLOS(target) && SpellHelper.ValidIndirectTarget(Caster, target) && Caster.CanBeHarmful(target, false) && !target.Hidden)
                        {
                            if (SleepSpell.CheckSleep(Caster, target))
                            {
                                SleepSpell.DoSleep(Caster, target);
                            }
                        }
                    }
                }
            }

            FinishSequence();
        }
Exemplo n.º 2
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                Map map = Caster.Map;

                if (map == null)
                {
                    return;
                }

                foreach (var m in AcquireIndirectTargets(p, 3).OfType <Mobile>())
                {
                    double duration = ((Caster.Skills[CastSkill].Value + Caster.Skills[DamageSkill].Value) / 20) + 3;
                    duration -= GetResistSkill(m) / 10;

                    if (duration > 0)
                    {
                        Caster.DoHarmful(m);

                        SleepSpell.DoSleep(Caster, m, TimeSpan.FromSeconds(duration));
                    }
                }
            }

            FinishSequence();
        }
Exemplo n.º 3
0
        public void Target(IPoint3D p)
        {
            if (!Caster.CanSee(p))
            {
                Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (SpellHelper.CheckTown(p, Caster) && CheckSequence())
            {
                Map map = Caster.Map;

                if (map == null)
                {
                    return;
                }

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

                IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 3);
                foreach (Mobile m in eable)
                {
                    if (Caster != m && Caster.InLOS(m) && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false) && !SleepSpell.IsUnderSleepEffects(m) && !m.Paralyzed)
                    {
                        targets.Add(m);
                    }
                }
                eable.Free();

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

                    double duration = ((Caster.Skills[CastSkill].Value + Caster.Skills[DamageSkill].Value) / 20) + 3;
                    duration -= GetResistSkill(m) / 10;

                    if (duration > 0)
                    {
                        Caster.DoHarmful(m);

                        SleepSpell.DoSleep(Caster, m, TimeSpan.FromSeconds(duration));
                    }
                }
            }

            FinishSequence();
        }
        public override void OnTarget(Object o)
        {
            Mobile target = o as Mobile;

            if (target == null)
            {
                return;
            }
            else if (CheckHSequence(target))
            {
                Map map = Caster.Map;

                if (map != null)
                {
                    List <Mobile> targets = new List <Mobile>();

                    IPooledEnumerable eable = target.GetMobilesInRange(3);
                    foreach (Mobile m in eable)
                    {
                        if (Caster != m && target.InLOS(m) && SpellHelper.ValidIndirectTarget(Caster, m) && Caster.CanBeHarmful(m, false) && !SleepSpell.IsUnderSleepEffects(m) && !m.Paralyzed)
                        {
                            targets.Add(m);
                        }
                    }
                    eable.Free();

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

                        double duration = ((Caster.Skills[CastSkill].Value + Caster.Skills[DamageSkill].Value) / 20) + 3;
                        duration -= target.Skills[SkillName.MagicResist].Value / 10;

                        if (duration > 0)
                        {
                            Caster.DoHarmful(m);

                            SleepSpell.DoSleep(Caster, m, TimeSpan.FromSeconds(duration));
                        }
                    }
                }
            }

            FinishSequence();
        }