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(); }
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(); }
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(); }
private void RemoveCurses(Mobile m) { StatMod mod; foreach (var statModName in StatModNames) { mod = m.GetStatMod(statModName); if (mod != null && mod.Offset < 0) { m.RemoveStatMod(statModName); } } m.Paralyzed = false; EvilOmenSpell.CheckEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); MortalStrike.EndWound(m); BloodOathSpell.EndEffect(m); SpellPlagueSpell.RemoveEffect(m); SleepSpell.RemoveEffect(m); MindRotSpell.ClearMindRotScalar(m); BuffInfo.RemoveBuff(m, BuffIcon.Clumsy); BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(m, BuffIcon.Weaken); BuffInfo.RemoveBuff(m, BuffIcon.MassCurse); BuffInfo.RemoveBuff(m, BuffIcon.Curse); BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen); BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike); BuffInfo.RemoveBuff(m, BuffIcon.Sleep); BuffInfo.RemoveBuff(m, BuffIcon.MassSleep); BuffInfo.RemoveBuff(m, BuffIcon.Mindrot); }
public InternalTarget(SleepSpell owner, bool allowland) : base(12, allowland, TargetFlags.Harmful) { Owner = owner; }
public InternalTarget(SleepSpell owner) : this(owner, false) { }
public static int RemoveCurses(Mobile m) { int curseLevel = 0; if (SleepSpell.IsUnderSleepEffects(m)) { SleepSpell.EndSleep(m); curseLevel += 2; } if (EvilOmenSpell.TryEndEffect(m)) { curseLevel += 1; } if (StrangleSpell.RemoveCurse(m)) { curseLevel += 2; } if (CorpseSkinSpell.RemoveCurse(m)) { curseLevel += 3; } if (CurseSpell.UnderEffect(m)) { CurseSpell.RemoveEffect(m); curseLevel += 4; } if (BloodOathSpell.RemoveCurse(m)) { curseLevel += 3; } if (MindRotSpell.HasMindRotScalar(m)) { MindRotSpell.ClearMindRotScalar(m); curseLevel += 2; } if (SpellPlagueSpell.HasSpellPlague(m)) { SpellPlagueSpell.RemoveFromList(m); curseLevel += 4; } if (FeeblemindSpell.IsUnderEffects(m)) { FeeblemindSpell.RemoveEffects(m); curseLevel += 1; } if (ClumsySpell.IsUnderEffects(m)) { ClumsySpell.RemoveEffects(m); curseLevel += 1; } if (WeakenSpell.IsUnderEffects(m)) { WeakenSpell.RemoveEffects(m); curseLevel += 1; } if (MortalStrike.IsWounded(m)) { MortalStrike.EndWound(m); curseLevel += 2; } BuffInfo.RemoveBuff(m, BuffIcon.Clumsy); BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(m, BuffIcon.Weaken); BuffInfo.RemoveBuff(m, BuffIcon.Curse); BuffInfo.RemoveBuff(m, BuffIcon.MassCurse); BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike); BuffInfo.RemoveBuff(m, BuffIcon.Mindrot); BuffInfo.RemoveBuff(m, BuffIcon.CorpseSkin); BuffInfo.RemoveBuff(m, BuffIcon.Strangle); BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen); return(curseLevel); }
public InternalTarget(SleepSpell owner, bool allowland, TargetFlags flags) : base(12, allowland, flags) { Owner = owner; }
public InternalTarget(SleepSpell owner, TargetFlags flags) : this(owner, false, flags) { }
public InternalTarget( SleepSpell owner ) : base(12, false, TargetFlags.Harmful) { m_Owner = owner; }
public InternalTarget(SleepSpell owner) : base(12, false, TargetFlags.Harmful) { m_Owner = owner; }
public override void OnTarget(Object o) { IPoint3D p = o as IPoint3D; if (p == null) { return; } if (CheckSequence()) { List <Mobile> targets = new List <Mobile>(); Party party = Party.Get(Caster); double prim = Caster.Skills[CastSkill].Value; double sec = Caster.Skills[DamageSkill].Value; IPooledEnumerable eable = Caster.Map.GetMobilesInRange(new Point3D(p), 3); foreach (Mobile mob in eable) { if (mob == null) { continue; } if (mob == Caster) { targets.Add(mob); } if (Caster.CanBeBeneficial(mob, false) && party != null && party.Contains(mob)) { targets.Add(mob); } } eable.Free(); Mobile m; int toheal = (int)(((prim + sec) / 2) * 0.3) - 6; Caster.PlaySound(0x64C); for (int i = 0; i < targets.Count; i++) { m = targets[i]; int toHealMod = toheal; if (!m.Alive) { continue; } if (m.Poisoned) { int level = m.Poison.RealLevel + 1; int chanceToCure = (10000 + (int)(((prim + sec) / 2) * 75) - (level * 1750)) / 100; if (chanceToCure > Utility.Random(100) && m.CurePoison(Caster)) { toHealMod /= level; } else { toHealMod = 0; } } if (MortalStrike.IsWounded(m)) { MortalStrike.EndWound(m); toHealMod = 0; } int curselevel = 0; if (SleepSpell.IsUnderSleepEffects(m)) { SleepSpell.EndSleep(m); curselevel += 2; } if (EvilOmenSpell.TryEndEffect(m)) { curselevel += 1; } if (StrangleSpell.RemoveCurse(m)) { curselevel += 2; } if (CorpseSkinSpell.RemoveCurse(m)) { curselevel += 3; } if (CurseSpell.UnderEffect(m)) { CurseSpell.RemoveEffect(m); curselevel += 4; } if (BloodOathSpell.RemoveCurse(m)) { curselevel += 3; } if (MindRotSpell.HasMindRotScalar(m)) { MindRotSpell.ClearMindRotScalar(m); curselevel += 2; } if (SpellPlagueSpell.HasSpellPlague(m)) { SpellPlagueSpell.RemoveFromList(m); curselevel += 4; } if (m.GetStatMod("[Magic] Str Curse") != null) { m.RemoveStatMod("[Magic] Str Curse"); curselevel += 1; } if (m.GetStatMod("[Magic] Dex Curse") != null) { m.RemoveStatMod("[Magic] Dex Curse"); curselevel += 1; } if (m.GetStatMod("[Magic] Int Curse") != null) { m.RemoveStatMod("[Magic] Int Curse"); curselevel += 1; } BuffInfo.RemoveBuff(m, BuffIcon.Clumsy); BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(m, BuffIcon.Weaken); BuffInfo.RemoveBuff(m, BuffIcon.Curse); BuffInfo.RemoveBuff(m, BuffIcon.MassCurse); BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike); BuffInfo.RemoveBuff(m, BuffIcon.Mindrot); BuffInfo.RemoveBuff(m, BuffIcon.CorpseSkin); BuffInfo.RemoveBuff(m, BuffIcon.Strangle); BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen); if (toHealMod > 0 && curselevel > 0) { int toHealMod1 = toHealMod - (curselevel * 3); int toHealMod2 = toHealMod - (int)((double)toHealMod * ((double)curselevel / 100)); toHealMod -= toHealMod1 + toHealMod2; } if (toHealMod > 0) { SpellHelper.Heal(toHealMod + Utility.RandomMinMax(1, 6), m, Caster); } } } FinishSequence(); }