public void Target(IPoint3D p) { if (!this.Caster.CanSee(p)) { this.Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SpellHelper.CheckTown(p, this.Caster) && this.CheckSequence()) { SpellHelper.Turn(this.Caster, p); SpellHelper.GetSurfaceTop(ref p); List <Mobile> targets = new List <Mobile>(); Map map = this.Caster.Map; if (map != null) { IPooledEnumerable eable = map.GetMobilesInRange(new Point3D(p), 2); foreach (Mobile m in eable) { if (Core.AOS && m == this.Caster) { continue; } if (SpellHelper.ValidIndirectTarget(this.Caster, m) && this.Caster.CanSee(m) && this.Caster.CanBeHarmful(m, false)) { targets.Add(m); } } eable.Free(); } for (int i = 0; i < targets.Count; ++i) { Mobile m = targets[i]; CurseSpell.DoCurse(this.Caster, m, true); } } this.FinishSequence(); }
public void Target(IPoint3D p) { if (!this.Caster.CanSee(p)) { this.Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SpellHelper.CheckTown(p, this.Caster) && this.CheckSequence()) { SpellHelper.Turn(this.Caster, p); SpellHelper.GetSurfaceTop(ref p); foreach (var m in AcquireIndirectTargets(p, 2).OfType <Mobile>()) { CurseSpell.DoCurse(this.Caster, m, true); } } this.FinishSequence(); }
public void Target(IPoint3D p) { if (!Caster.CanSee(p)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (SpellHelper.CheckTown(p, Caster) && CheckSequence()) { SpellHelper.Turn(Caster, p); SpellHelper.GetSurfaceTop(ref p); foreach (IDamageable target in AcquireIndirectTargets(p, 2)) { if (target is Mobile m) { CurseSpell.DoCurse(Caster, m, true); } } } FinishSequence(); }