private void EndHeal() { if (Context.ContainsKey(Healer)) Context.Remove(Healer); if (Patient != Healer && Patient.InRange(Healer.Location, 2)) { Healer.PlaySound(0x57); if (EnchantedApple.GetTotalCurses(Patient) == 0) Healer.SendLocalizedMessage(500968); // You apply the bandages, but they barely help. else Healer.SendLocalizedMessage(500969); // You finish applying the bandages. EvilOmenSpell.TryEndEffect(Patient); StrangleSpell.RemoveCurse(Patient); CorpseSkinSpell.RemoveCurse(Patient); WeakenSpell.RemoveEffects(Patient); FeeblemindSpell.RemoveEffects(Patient); ClumsySpell.RemoveEffects(Patient); CurseSpell.RemoveEffect(Patient); MortalStrike.EndWound(Patient); BloodOathSpell.RemoveCurse(Patient); MindRotSpell.ClearMindRotScalar(Patient); SpellPlagueSpell.RemoveFromList(Patient); SleepSpell.EndSleep(Patient); BuffInfo.RemoveBuff(Patient, BuffIcon.MassCurse); } else { Healer.SendLocalizedMessage(500295); // You are too far away to do that. } }
}// A tasty bite of the enchanted apple lifts all curses from your soul. public override bool Eat(Mobile from) { if (!IsUnderInfluence(from, FoodID)) { if (CoolingDown(from, FoodID)) { from.SendLocalizedMessage(1151180); // You must wait a while before eating another enchanted apple. } else { from.PlaySound(0xF6); from.PlaySound(0x1F7); from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); IEntity mfrom = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z - 10), from.Map); IEntity mto = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map); Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100); if (Core.SA) { int totalCurses = GetTotalCurses(from); if (totalCurses > 2 && totalCurses > Utility.Random(10)) { from.SendLocalizedMessage(1150174); // The apple was not strong enough to purify you. Consume(); return(false); } } EvilOmenSpell.TryEndEffect(from); StrangleSpell.RemoveCurse(from); CorpseSkinSpell.RemoveCurse(from); WeakenSpell.RemoveEffects(from); FeeblemindSpell.RemoveEffects(from); ClumsySpell.RemoveEffects(from); CurseSpell.RemoveEffect(from); MortalStrike.EndWound(from); BloodOathSpell.RemoveCurse(from); MindRotSpell.ClearMindRotScalar(from); SpellPlagueSpell.RemoveFromList(from); SleepSpell.EndSleep(from); BuffInfo.RemoveBuff(from, BuffIcon.MassCurse); from.SendLocalizedMessage(EatMessage); StartInfluence(from, FoodID, Duration, Cooldown); Consume(); return(true); } } return(false); }
public static void RemoveCurses(Mobile m) { // play the sound m.PlaySound(0xF6); m.PlaySound(0x1F7); // do the effects m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); IEntity from = new DummyEntity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), m.Map); IEntity to = new DummyEntity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), m.Map); Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100); // remove stat mods StatMod mod; foreach (string 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 static void DoRemoveCurses(Mobile m) { StatMod mod; mod = m.GetStatMod("[Magic] Str Malus"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Str Malus"); } mod = m.GetStatMod("[Magic] Dex Malus"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Dex Malus"); } mod = m.GetStatMod("[Magic] Int Malus"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Int Malus"); } m.Paralyzed = false; EvilOmenSpell.CheckEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); MortalStrike.EndWound(m); BloodOathSpell.EndEffect(m); SpellPlagueSpell.RemoveEffect(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); // TODO: Should this remove blood oath? Pain spike? }
}// A tasty bite of the enchanted apple lifts all curses from your soul. public override bool Eat(Mobile from) { if (base.Eat(from)) { from.PlaySound(0xF6); from.PlaySound(0x1F7); from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); IEntity mfrom = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z - 10), from.Map); IEntity mto = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map); Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100); from.RemoveStatMod("[Magic] Str Curse"); from.RemoveStatMod("[Magic] Dex Curse"); from.RemoveStatMod("[Magic] Int Curse"); from.Asleep = false; EvilOmenSpell.TryEndEffect(from); StrangleSpell.RemoveCurse(from); CorpseSkinSpell.RemoveCurse(from); CurseSpell.RemoveEffect(from); MortalStrike.EndWound(from); BloodOathSpell.RemoveCurse(from); MindRotSpell.ClearMindRotScalar(from); SpellPlagueSpell.RemoveFromList(from); BuffInfo.RemoveBuff(from, BuffIcon.Clumsy); BuffInfo.RemoveBuff(from, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(from, BuffIcon.Weaken); BuffInfo.RemoveBuff(from, BuffIcon.MassCurse); BuffInfo.RemoveBuff(from, BuffIcon.Curse); BuffInfo.RemoveBuff(from, BuffIcon.MortalStrike); BuffInfo.RemoveBuff(from, BuffIcon.Mindrot); BuffInfo.RemoveBuff(from, BuffIcon.CorpseSkin); return(true); } return(false); }
public static void SuperHealXML(BaseCreature bc, Mobile player) { if (!bc.Alive) { bc.Resurrect(); } if (bc.Hits < bc.HitsMax) { bc.Hits = bc.HitsMax; } if (bc.Mana < bc.ManaMax) { bc.Mana = bc.ManaMax; } if (bc.Stam < bc.StamMax) { bc.Stam = bc.StamMax; } if (bc.Poison != null) { bc.Poison = null; } if (bc.Paralyzed == true) { bc.Paralyzed = false; } EvilOmenSpell.TryEndEffect(bc); StrangleSpell.RemoveCurse(bc); CorpseSkinSpell.RemoveCurse(bc); CurseSpell.RemoveEffect(bc); MortalStrike.EndWound(bc); BloodOathSpell.RemoveCurse(bc); MindRotSpell.ClearMindRotScalar(bc); bc.Loyalty = BaseCreature.MaxLoyalty; Effects.SendTargetEffect(bc, 0x3709, 32); Effects.SendTargetEffect(bc, 0x376A, 32); bc.PlaySound(0x208); bc.Emote("*you see {0} looks refreshed!*", bc.Name); }
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); }
protected override void OnTarget(object o) { Mobile m = o as Mobile; if (m != null) { if (m.IsDeadBondedPet) { Caster.SendLocalizedMessage(1046439); // That is not a valid target. } else if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead) { Caster.SendLocalizedMessage(1046439); // That is not a valid target. } else if (m is Golem) { Caster.SendLocalizedMessage(1046439); // That is not a valid target. } else if (m.Hits > m.HitsMax && m.Stam >= m.StamMax && m.Mana >= m.ManaMax) { Caster.SendLocalizedMessage(1155788); // Your target is already at full health, mana and stamina! } else if (CheckBSequence(m)) { double rejuv = (GetMasteryLevel() * 33.3) / 100; if (rejuv > 1.0) { rejuv = 1.0; } int hitsNeeds = m.HitsMax - m.Hits; int stamNeeds = m.StamMax - m.Stam; int manaNeeds = m.ManaMax - m.Mana; int toRejuv = 0; if (hitsNeeds > 0) { toRejuv = (int)Math.Ceiling(hitsNeeds * rejuv); if (toRejuv > 0) { SpellHelper.Heal(toRejuv, m, Caster, false); } } if (stamNeeds > 0) { toRejuv = (int)Math.Ceiling(stamNeeds * rejuv); if (toRejuv > 0) { m.Stam += toRejuv; } } if (manaNeeds > 0) { toRejuv = (int)Math.Ceiling(manaNeeds * rejuv); if (toRejuv > 0) { m.Mana += toRejuv; } } if (Caster.Karma > Utility.Random(5000)) { if (m.Poison != null) { m.CurePoison(Caster); } StatMod mod; mod = m.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Str Offset"); } mod = m.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Dex Offset"); } mod = m.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Int Offset"); } m.Paralyzed = false; EvilOmenSpell.TryEndEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); MortalStrike.EndWound(m); BloodOathSpell.RemoveCurse(m); MindRotSpell.ClearMindRotScalar(m); 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); } Caster.PlaySound(0x102); m.SendLocalizedMessage(1155789); // You feel completely rejuvenated! if (Caster != m) { m.PlaySound(0x102); Caster.SendLocalizedMessage(1155790); // Your target has been rejuvenated! } int skill = ((int)Caster.Skills[CastSkill].Value + GetWeaponSkill() + GetMasteryLevel() * 40) / 3; int duration; if (skill >= 120) { duration = 60; } else if (skill >= 110) { duration = 120; } else { duration = 180; } TimeSpan d; if (Caster.AccessLevel == AccessLevel.Player) { d = TimeSpan.FromMinutes(duration); } else { d = TimeSpan.FromSeconds(10); } AddToCooldown(d); } } else { Caster.SendLocalizedMessage(1046439); // That is not a valid target. } }
protected override void OnTarget(Mobile from, object targeted) { var m = targeted as Mobile; if (m == null) { from.SendMessage("This is not a mobile!"); return; } CommandLogging.WriteLine(from, "{0} {1} completely restoring {2}", from.AccessLevel, CommandLogging.Format(from), CommandLogging.Format(m)); if (!m.Alive) { m.Resurrect(); } m.Hits = m.HitsMax; m.Mana = m.ManaMax; m.Stam = m.StamMax; m.Hunger = 20; m.Thirst = 20; m.Poison = null; m.Paralyzed = false; StatMod mod; mod = m.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Str Offset"); } mod = m.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Dex Offset"); } mod = m.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Int Offset"); } EvilOmenSpell.TryEndEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); MortalStrike.EndWound(m); BloodOathSpell.RemoveCurse(m); MindRotSpell.ClearMindRotScalar(m); 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); from.SendMessage("{0} has been completely restored!", m.Name); }
public virtual Spell ChooseSpell(Mobile c) { Spell spell = CheckCastHealingSpell(); if (spell != null) { return(spell); } double damage = ((m_Mobile.Skills[SkillName.SpiritSpeak].Value - c.Skills[SkillName.MagicResist].Value) / 10) + (c.Player ? 18 : 30); if (damage > c.Hits) { return(new PainSpikeSpell(m_Mobile, null)); } switch (Utility.Random(20)) { case 0: case 1: case 2: // Poison them { m_Mobile.DebugSay("Attempting to poison"); if (!c.Poisoned) { spell = new PoisonSpell(m_Mobile, null); } break; } case 3: // Bless ourselves. { m_Mobile.DebugSay("Blessing myself"); spell = new BlessSpell(m_Mobile, null); break; } case 4: case 5: case 6: // Curse them. { m_Mobile.DebugSay("Attempting to curse"); spell = GetRandomCurseSpell(); break; } case 7: // Paralyze them. { m_Mobile.DebugSay("Attempting to paralyze"); if (m_Mobile.Skills[SkillName.Magery].Value > 50.0) { spell = new ParalyzeSpell(m_Mobile, null); } break; } case 8: // Drain mana { m_Mobile.DebugSay("Attempting to drain mana"); spell = GetRandomManaDrainSpell(); break; } case 9: case 10: // Blood oath them { m_Mobile.DebugSay("Attempting to blood oath"); if (m_Mobile.Skills[SkillName.Necromancy].Value > 30 && BloodOathSpell.GetBloodOath(c) != m_Mobile) { spell = new BloodOathSpell(m_Mobile, null); } break; } case 11: case 12: // Animate dead { m_Mobile.DebugSay("Attempting to animate dead"); if ((m_Animated == null || !m_Animated.Alive) && m_Mobile.Skills[SkillName.Necromancy].Value > 40) { spell = new AnimateDeadSpell(m_Mobile, null); } break; } case 13: case 14: { m_Mobile.DebugSay("Attempting to cast vengeful spirit"); if (m_Mobile.Skills[SkillName.Necromancy].Value > 80 && (m_Mobile.Followers + 3) < m_Mobile.FollowersMax) { spell = new VengefulSpiritSpell(m_Mobile, null); } break; } default: // Damage them. { m_Mobile.DebugSay("Just doing damage"); spell = GetRandomDamageSpell(); break; } } return(spell); }
public void Target(Mobile m) { if (CheckBSequence(m) && CheckFizzle()) { SpellHelper.Turn(Caster, m); int chance = 0; int karma = Caster.Karma * -1; if (karma < -5000) { chance = 0; } else if (karma < 0) { chance = (int)Math.Sqrt(20000 + karma) - 122; } else if (karma < 5625) { chance = (int)Math.Sqrt(karma) + 25; } else { chance = 100; } if (chance > Utility.Random(100)) { m.PlaySound(0xF6); m.PlaySound(0x1F7); m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), Caster.Map); IEntity to = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), Caster.Map); Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100); StatMod mod; mod = m.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Str Offset"); } mod = m.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Dex Offset"); } mod = m.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Int Offset"); } m.Paralyzed = false; EvilOmenSpell.TryEndEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); MortalStrike.EndWound(m); if (Core.ML) { BloodOathSpell.RemoveCurse(m); } MindRotSpell.ClearMindRotScalar(m); 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); } else { m.PlaySound(0x1DF); } } FinishSequence(); }
public virtual Spell ChooseSpell(Mobile c) { Spell spell = this.CheckCastHealingSpell(); if (spell != null) { return(spell); } double damage = ((this.m_Mobile.Skills[SkillName.SpiritSpeak].Value - c.Skills[SkillName.MagicResist].Value) / 10) + (c.Player ? 18 : 30); if (damage > c.Hits) { spell = new ManaDrainSpell(this.m_Mobile, null); } switch (Utility.Random(16)) { case 0: case 1: case 2: // Poison them { this.m_Mobile.DebugSay("Attempting to BloodOath"); if (!c.Poisoned) { spell = new BloodOathSpell(this.m_Mobile, null); } break; } case 3: // Bless ourselves. { this.m_Mobile.DebugSay("Blessing myself"); spell = new BlessSpell(this.m_Mobile, null); break; } case 4: case 5: case 6: // Curse them. { this.m_Mobile.DebugSay("Attempting to curse"); spell = this.GetRandomCurseSpell(); break; } case 7: // Paralyze them. { this.m_Mobile.DebugSay("Attempting to paralyze"); if (this.m_Mobile.Skills[SkillName.Magery].Value > 50.0) { spell = new ParalyzeSpell(this.m_Mobile, null); } break; } case 8: // Drain mana { this.m_Mobile.DebugSay("Attempting to drain mana"); spell = this.GetRandomManaDrainSpell(); break; } case 9: // Blood oath them { this.m_Mobile.DebugSay("Attempting to blood oath"); if (this.m_Mobile.Skills[SkillName.Necromancy].Value > 30 && BloodOathSpell.GetBloodOath(c) != this.m_Mobile) { spell = new BloodOathSpell(this.m_Mobile, null); } break; } } return(spell); }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (CheckBSequence(m, false)) { SpellHelper.Turn(Caster, m); m.PlaySound(0xF6); m.PlaySound(0x1F7); m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), Caster.Map); IEntity to = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), Caster.Map); Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100); StatMod mod; mod = m.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Str Offset"); } mod = m.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Dex Offset"); } mod = m.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Int Offset"); } m.Paralyzed = false; EvilOmenSpell.TryEndEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); MortalStrike.EndWound(m); if (Core.ML) { BloodOathSpell.RemoveCurse(m); } MindRotSpell.ClearMindRotScalar(m); 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); } FinishSequence(); }
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(); }
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); StatMod mod; 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 chanceToCure = (10000 + (int)(((prim + sec) / 2) * 75) - ((m.Poison.RealLevel + 1) * 1750)) / 100; if (chanceToCure > Utility.Random(100) && m.CurePoison(Caster)) { toHealMod /= 3; } else { toHealMod = 0; } } if (MortalStrike.IsWounded(m)) { MortalStrike.EndWound(m); toHealMod = 0; } if (toHealMod > 0) { m.Heal(toHealMod + Utility.RandomMinMax(1, 6)); } m.RemoveStatMod("[Magic] Str Curse"); m.RemoveStatMod("[Magic] Dex Curse"); m.RemoveStatMod("[Magic] Int Curse"); SleepSpell.EndSleep(m); EvilOmenSpell.TryEndEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); BloodOathSpell.RemoveCurse(m); MindRotSpell.ClearMindRotScalar(m); 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); //TODO: Message/Effects??? } } FinishSequence(); }
public static int GetTotalCurses(Mobile m) { int curses = 0; if (EvilOmenSpell.UnderEffects(m)) { curses++; } if (StrangleSpell.UnderEffects(m)) { curses++; } if (CorpseSkinSpell.IsUnderEffects(m)) { curses++; } if (BloodOathSpell.GetBloodOath(m) != null) { curses++; } if (MindRotSpell.HasMindRotScalar(m)) { curses++; } if (SpellPlagueSpell.HasSpellPlague(m)) { curses++; } if (SleepSpell.IsUnderSleepEffects(m)) { curses++; } if (CurseSpell.UnderEffect(m)) { curses++; } if (FeeblemindSpell.IsUnderEffects(m)) { curses++; } if (ClumsySpell.IsUnderEffects(m)) { curses++; } if (WeakenSpell.IsUnderEffects(m)) { curses++; } return(curses); }
public override void OnTarget(Object o) { IPoint3D p = o as IPoint3D; if (p == null) { return; } List <Mobile> targets = new List <Mobile>(); StatMod mod; foreach (Mobile mob in Caster.Map.GetMobilesInRange(new Point3D(p), 3)) { if (mob == null) { continue; } if (Caster is PlayerMobile) { if (Caster.CanBeBeneficial(mob, false)) { targets.Add(mob); } } } Mobile m; int toheal = (int)(Caster.Skills[SkillName.EvalInt].Value * 0.5); Caster.PlaySound(0x64D); for (int i = 0; i < targets.Count; i++) { m = targets[i]; if (!m.Alive) { continue; } m.Heal(toheal + Utility.RandomMinMax(11, 15)); mod = m.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Str Offset"); } mod = m.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Dex Offset"); } mod = m.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { m.RemoveStatMod("[Magic] Int Offset"); } m.Paralyzed = false; m.Sleep = false; // SA Mysticism Edit m.CurePoison(Caster); EvilOmenSpell.TryEndEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); MortalStrike.EndWound(m); if (Core.ML) { BloodOathSpell.RemoveCurse(m); } MindRotSpell.ClearMindRotScalar(m); 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); } }
public Spell GetNecromancerSpell() { Spell spell = null; switch (Utility.Random(12)) { case 0: case 1: // Create an army for our ourselves case 2: case 3: // Curse them { if (m_Mobile.Debug) { m_Mobile.Say(1109, "Cusing Them"); } spell = GetNecromancerCurseSpell(); break; } case 4: case 5: // Reverse combat { if (m_Mobile.Debug) { m_Mobile.Say(1109, "Casting Blood Oath"); } if (m_Mobile.Skills[SkillName.Necromancy].Value > 30.0) { spell = new BloodOathSpell(m_Mobile, null); } break; } case 6: // Shapeshift { if (m_CanShapeShift) { if (m_Mobile.Debug) { m_Mobile.Say(1109, "Shapechange "); } spell = GetNecromancerShapeshiftSpell(); } else { goto case 3; // Curse them } break; } default: // Damage them { if (m_Mobile.Debug) { m_Mobile.Say(1109, "Random damage spell"); } spell = GetNecromancerDamageSpell(); break; } } return(spell); }
public override bool OnBeforeDeath(Mobile m) { if (!(m is PlayerMobile)) { return(base.OnBeforeDeath(m)); } //Remove the player's items acquired in the dream for (int x = m.Items.Count - 1; x >= 0; x--) { if (!(m.Items[x] is Backpack)) { m.RemoveItem(m.Items[x]); } } for (int y = m.Backpack.Items.Count - 1; y >= 0; y--) { if ((m.Backpack.Items[y] is HelmOfCourage) || (m.Backpack.Items[y] is CrystalRoseOfLove) || (m.Backpack.Items[y] is MirrorOfTruth) || (m.Backpack.Items[y] is StaffOrb)) { } else { m.RemoveItem(m.Backpack.Items[y]); } } //Find the player's item container Item[] Items = Map.SerpentIsle.GetItemsInRange(new Point3D(0, 0, 0)).CastToArray <Item>(); foreach (Item found in Items) { if (found is MetalBox) { MetalBox box = found as MetalBox; if (box.Name == m.Name) { //Give them back their stuff for (int x = box.Items.Count - 1; x >= 0; x--) { if (box.Items[x] is MetalBox) { MetalBox itemBox = box.Items[x] as MetalBox; for (int y = itemBox.Items.Count - 1; y >= 0; y--) { m.AddToBackpack(itemBox.Items[y]); } if (itemBox.Items.Count == 0) { itemBox.Delete(); } } else { m.EquipItem(box.Items[x]); } } if (box.Items.Count == 0) { box.Delete(); } } } } //Move pets back foreach (Mobile mobile in ((PlayerMobile)m).AllFollowers) { mobile.MoveToWorld(new Point3D(650, 881, 0), Map.SerpentIsle); mobile.Frozen = false; } switch (Utility.Random(2)) { case 0: m.MoveToWorld(new Point3D(643, 881, 0), Map.SerpentIsle); break; case 1: m.MoveToWorld(new Point3D(662, 882, 0), Map.SerpentIsle); break; } m.SendMessage("Thou hast awoken from thy dream."); //Restore player to full ((PlayerMobile)m).Hits = m.HitsMax; ((PlayerMobile)m).Mana = m.ManaMax; ((PlayerMobile)m).Stam = m.StamMax; ((PlayerMobile)m).Hunger = 20; ((PlayerMobile)m).Thirst = 20; ((PlayerMobile)m).Paralyzed = false; ((PlayerMobile)m).Poison = null; EvilOmenSpell.TryEndEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); MortalStrike.EndWound(m); BloodOathSpell.RemoveCurse(m); MindRotSpell.ClearMindRotScalar(m); 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); return(false); }
public override bool DoActionCombat() { IDamageable c = m_Mobile.Combatant; m_Mobile.Warmode = true; if (c == null || c.Deleted || !c.Alive || c is Mobile mobile && mobile.IsDeadBondedPet || !m_Mobile.CanSee(c) || !m_Mobile.CanBeHarmful(c, false) || c.Map != m_Mobile.Map) { // Our combatant is deleted, dead, hidden, or we cannot hurt them // Try to find another combatant if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false)) { m_Mobile.DebugSay("Something happened to my combatant, so I am going to fight {0}", m_Mobile.FocusMob.Name); m_Mobile.Combatant = c = m_Mobile.FocusMob; m_Mobile.FocusMob = null; } else { m_Mobile.DebugSay("Something happened to my combatant, and nothing is around. I am on guard."); Action = ActionType.Guard; return(true); } } if (!m_Mobile.InLOS(c)) { if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false)) { m_Mobile.Combatant = c = m_Mobile.FocusMob; m_Mobile.FocusMob = null; } } if (!m_Mobile.InRange(c, m_Mobile.RangePerception)) { // They are somewhat far away, can we find something else? if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false)) { m_Mobile.Combatant = m_Mobile.FocusMob; m_Mobile.FocusMob = null; } else if (!m_Mobile.InRange(c, m_Mobile.RangePerception * 3)) { m_Mobile.Combatant = null; } c = m_Mobile.Combatant; if (c == null) { m_Mobile.DebugSay("My combatant has fled, so I am on guard"); Action = ActionType.Guard; return(true); } } if (!m_Mobile.Controlled && !m_Mobile.Summoned && m_Mobile.CheckCanFlee()) { m_Mobile.DebugSay("I am going to flee from {0}", c.Name); Action = ActionType.Flee; return(true); } if (m_Mobile.Spell == null && DateTime.UtcNow > m_NextCastTime && m_Mobile.InRange(c, 12)) { // We are ready to cast a spell Spell spell; Mobile toDispel = FindDispelTarget(true); if (m_Mobile.Poisoned) // Top cast priority is cure { m_Mobile.DebugSay("I am going to cure myself"); spell = new CureSpell(m_Mobile, null); } else if (toDispel != null) // Something dispellable is attacking us { m_Mobile.DebugSay("I am going to dispel {0}", toDispel); spell = DoDispel(toDispel); } else if (c is Mobile hMobile && (hMobile.Spell is HealSpell || hMobile.Spell is GreaterHealSpell) && !hMobile.Poisoned) // They have a heal spell out { spell = new BloodOathSpell(m_Mobile, null); } else { spell = ChooseSpell(c); } // Now we have a spell picked // Move first before casting if (toDispel != null) { if (m_Mobile.InRange(toDispel, 10)) { RunFrom(toDispel); } else if (!m_Mobile.InRange(toDispel, 12)) { RunTo(toDispel); } } else if (c is Mobile m) { RunTo(m); } spell?.Cast(); TimeSpan delay; delay = spell is DispelSpell?TimeSpan.FromSeconds(m_Mobile.ActiveSpeed) : GetDelay(); m_NextCastTime = DateTime.UtcNow + delay; }
public static int GetCursePower(Mobile m) { int power = 0; // 1st circle debuffs foreach (string statModName in StatModNames) { if (m.GetStatMod(statModName) != null) { power += 1; } } // 3rd circle debuffs if (EvilOmenSpell.UnderEffect(m)) { power += 3; } if (BloodOathSpell.UnderEffect(m)) { power += 3; } if (CorpseSkinSpell.UnderEffect(m)) { power += 3; } if (MindRotSpell.HasMindRotScalar(m)) { power += 3; } if (SleepSpell.IsSlept(m)) { power += 3; } // 4th circle debuffs if (CurseSpell.UnderEffect(m)) { power += 4; } // 6th circle debuffs if (StrangleSpell.UnderEffect(m)) { power += 6; } // 7th circle debuffs if (SpellPlagueSpell.UnderEffect(m)) { power += 7; } if (MortalStrike.IsWounded(m)) { power += 7; } return(power); }
public override bool DoActionCombat() { IDamageable c = m_Mobile.Combatant; m_Mobile.Warmode = true; if (c == null || c.Deleted || !c.Alive || (c is Mobile && ((Mobile)c).IsDeadBondedPet) || !m_Mobile.CanSee(c) || !m_Mobile.CanBeHarmful(c, false) || c.Map != m_Mobile.Map) { // Our combatant is deleted, dead, hidden, or we cannot hurt them // Try to find another combatant if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true)) { m_Mobile.DebugSay("Something happened to my combatant, so I am going to fight {0}", m_Mobile.FocusMob.Name); m_Mobile.Combatant = c = m_Mobile.FocusMob; m_Mobile.FocusMob = null; } else { m_Mobile.DebugSay("Something happened to my combatant, and nothing is around. I am on guard."); Action = ActionType.Guard; return(true); } } if (!m_Mobile.InLOS(c)) { if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true)) { m_Mobile.Combatant = c = m_Mobile.FocusMob; m_Mobile.FocusMob = null; } } if (!m_Mobile.StunReady && m_Mobile.Skills[SkillName.Wrestling].Value >= 80.0 && m_Mobile.Skills[SkillName.Anatomy].Value >= 80.0) { EventSink.InvokeStunRequest(new StunRequestEventArgs(m_Mobile)); } if (!m_Mobile.InRange(c, m_Mobile.RangePerception)) { // They are somewhat far away, can we find something else? if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true)) { m_Mobile.Combatant = m_Mobile.FocusMob; m_Mobile.FocusMob = null; } else if (!m_Mobile.InRange(c, m_Mobile.RangePerception * 3)) { m_Mobile.Combatant = null; } c = m_Mobile.Combatant; if (c == null) { m_Mobile.DebugSay("My combatant has fled, so I am on guard"); Action = ActionType.Guard; return(true); } } if (!m_Mobile.Controlled && !m_Mobile.Summoned && m_Mobile.CanFlee) { if (m_Mobile.Hits < m_Mobile.HitsMax * 20 / 100) { // We are low on health, should we flee? if (Utility.Random(100) <= Math.Max(10, 10 + c.Hits - m_Mobile.Hits)) { m_Mobile.DebugSay("I am going to flee from {0}", c.Name); Action = ActionType.Flee; return(true); } } } if (m_Mobile.Spell == null && DateTime.UtcNow > m_NextCastTime && m_Mobile.InRange(c, 12)) { // We are ready to cast a spell Spell spell = null; Mobile toDispel = FindDispelTarget(true); if (m_Mobile.Poisoned) // Top cast priority is cure { m_Mobile.DebugSay("I am going to cure myself"); spell = new CureSpell(m_Mobile, null); } else if (toDispel != null) // Something dispellable is attacking us { m_Mobile.DebugSay("I am going to dispel {0}", toDispel); spell = DoDispel(toDispel); } else if (c is Mobile && (((Mobile)c).Spell is HealSpell || ((Mobile)c).Spell is GreaterHealSpell) && !((Mobile)c).Poisoned) // They have a heal spell out { spell = new BloodOathSpell(m_Mobile, null); } else { spell = ChooseSpell(c); } // Now we have a spell picked // Move first before casting if (toDispel != null) { if (m_Mobile.InRange(toDispel, 10)) { RunFrom(toDispel); } else if (!m_Mobile.InRange(toDispel, 12)) { RunTo(toDispel); } } else if (c is Mobile) { RunTo((Mobile)c); } if (spell != null) { spell.Cast(); } TimeSpan delay; if (spell is DispelSpell) { delay = TimeSpan.FromSeconds(m_Mobile.ActiveSpeed); } else { delay = GetDelay(); } m_NextCastTime = DateTime.UtcNow + delay; } else if (c is Mobile && (m_Mobile.Spell == null || !m_Mobile.Spell.IsCasting)) { RunTo((Mobile)c); } return(true); }
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 Spell GetNecromancerSpell() { Spell spell = null; switch (Utility.Random(12)) { case 0: case 1: // Create an army for our ourselves { int whichone = Utility.RandomMinMax(1, 2); if (whichone == 2 && m_Mobile.Skills[SkillName.Necromancy].Value > 50.0) { if (m_Mobile.Debug) { m_Mobile.Say(1109, "Undead: Casting Animate Dead"); } spell = new AnimateDeadSpell(m_Mobile, null); } else if (m_Mobile.Followers == 0 || m_Mobile.Followers == 3) { if (m_Mobile.Debug) { m_Mobile.Say(1109, "Undead: Summoning Familiar "); } CreateNecromancerFamiliar(); } else { goto default; } break; } case 2: case 3: // Curse them { if (m_Mobile.Debug) { m_Mobile.Say(1109, "Cursing Them"); } spell = GetNecromancerCurseSpell(); break; } case 4: case 5: // Reverse combat { if (m_Mobile.Debug) { m_Mobile.Say(1109, "Casting Blood Oath"); } if (m_Mobile.Skills[SkillName.Necromancy].Value > 30.0) { spell = new BloodOathSpell(m_Mobile, null); } break; } case 6: // Shapeshift { if (m_CanShapeShift) { if (m_Mobile.Debug) { m_Mobile.Say(1109, "Shapechange "); } spell = GetNecromancerShapeshiftSpell(); } else { goto case 3; // Curse them } break; } default: // Damage them { if (m_Mobile.Debug) { m_Mobile.Say(1109, "Random damage spell"); } spell = GetNecromancerDamageSpell(); break; } } return(spell); }
private void OnBeginDream(PlayerMobile m) { if ((!m.Alive)) { return; } m.SendMessage("Thou hast fallen asleep."); //Create the player's box and label it MetalBox playerBox = new MetalBox(); playerBox.Name = m.Name; //Items list so we can remove them List <Item> equipItems = m.Items; //Remove clothing/equipment for (int x = m.Items.Count - 1; x >= 0; x--) { if (!(m.Items[x] is Backpack)) { playerBox.AddItem(m.Items[x]); } } //Create the box for the backpack items MetalBox backpackBox = new MetalBox(); playerBox.AddItem(backpackBox); //Remove backpack items for (int y = m.Backpack.Items.Count - 1; y >= 0; y--) { if ((m.Backpack.Items[y] is HelmOfCourage) || (m.Backpack.Items[y] is CrystalRoseOfLove) || (m.Backpack.Items[y] is MirrorOfTruth) || (m.Backpack.Items[y] is StaffOrb)) { } else { backpackBox.AddItem(m.Backpack.Items[y]); } } //Move the container away playerBox.MoveToWorld(new Point3D(0, 0, 0), Map.SerpentIsle); //Move pets away foreach (Mobile mobile in m.AllFollowers) { mobile.MoveToWorld(new Point3D(0, 0, 0), Map.SerpentIsle); mobile.Frozen = true; } //Send to random destination in the dream switch (Utility.Random(4)) { case 0: m.MoveToWorld(new Point3D(1988, 1536, 0), Map.SerpentIsle); m.SetDirection(Direction.East); break; case 1: m.MoveToWorld(new Point3D(2050, 1491, 0), Map.SerpentIsle); m.SetDirection(Direction.North); break; case 2: m.MoveToWorld(new Point3D(2040, 1389, 0), Map.SerpentIsle); m.SetDirection(Direction.East); break; case 3: m.MoveToWorld(new Point3D(1904, 1376, 0), Map.SerpentIsle); m.SetDirection(Direction.West); break; } //Restore player to full ((PlayerMobile)m).Hits = m.HitsMax; ((PlayerMobile)m).Mana = m.ManaMax; ((PlayerMobile)m).Stam = m.StamMax; ((PlayerMobile)m).Hunger = 20; ((PlayerMobile)m).Thirst = 20; ((PlayerMobile)m).Paralyzed = false; ((PlayerMobile)m).Poison = null; EvilOmenSpell.TryEndEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); MortalStrike.EndWound(m); BloodOathSpell.RemoveCurse(m); MindRotSpell.ClearMindRotScalar(m); 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); //Additionally, remove any polymorphs PolymorphSpell.EndPolymorph(m); StoneFormSpell.EndEffect(m); m.BodyMod = 0; m.HueMod = -1; }
public void Target(Mobile m) { if (this.CheckBSequence(m)) { SpellHelper.Turn(this.Caster, m); /* Attempts to remove all Curse effects from Target. * Curses include Mage spells such as Clumsy, Weaken, Feeblemind and Paralyze * as well as all Necromancer curses. * Chance of removing curse is affected by Caster's Karma. */ int chance = 0; if (this.Caster.Karma < -5000) { chance = 0; } else if (this.Caster.Karma < 0) { chance = (int)Math.Sqrt(20000 + this.Caster.Karma) - 122; } else if (this.Caster.Karma < 5625) { chance = (int)Math.Sqrt(this.Caster.Karma) + 25; } else { chance = 100; } if (chance > Utility.Random(100)) { m.PlaySound(0xF6); m.PlaySound(0x1F7); m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), this.Caster.Map); IEntity to = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), this.Caster.Map); Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100); m.RemoveStatMod("[Magic] Str Curse"); m.RemoveStatMod("[Magic] Dex Curse"); m.RemoveStatMod("[Magic] Int Curse"); m.Paralyzed = false; EvilOmenSpell.TryEndEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); MortalStrike.EndWound(m); if (Core.ML) { BloodOathSpell.RemoveCurse(m); } MindRotSpell.ClearMindRotScalar(m); 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); // TODO: Should this remove blood oath? Pain spike? } else { m.PlaySound(0x1DF); } } this.FinishSequence(); }
public override bool DoActionCombat() { Mobile c = this.m_Mobile.Combatant; this.m_Mobile.Warmode = true; if (c == null || c.Deleted || !c.Alive || c.IsDeadBondedPet || !this.m_Mobile.CanSee(c) || !this.m_Mobile.CanBeHarmful(c, false) || c.Map != this.m_Mobile.Map) { // Our combatant is deleted, dead, hidden, or we cannot hurt them // Try to find another combatant if (this.AcquireFocusMob(this.m_Mobile.RangePerception, this.m_Mobile.FightMode, false, false, true)) { if (this.m_Mobile.Debug) { this.m_Mobile.DebugSay("Something happened to my combatant, so I am going to fight {0}", this.m_Mobile.FocusMob.Name); } this.m_Mobile.Combatant = c = this.m_Mobile.FocusMob; this.m_Mobile.FocusMob = null; } else { this.m_Mobile.DebugSay("Something happened to my combatant, and nothing is around. I am on guard."); this.Action = ActionType.Guard; return(true); } } if (!this.m_Mobile.InLOS(c)) { if (this.AcquireFocusMob(this.m_Mobile.RangePerception, this.m_Mobile.FightMode, false, false, true)) { this.m_Mobile.Combatant = c = this.m_Mobile.FocusMob; this.m_Mobile.FocusMob = null; } } if (!this.m_Mobile.StunReady && this.m_Mobile.Skills[SkillName.Wrestling].Value >= 80.0 && this.m_Mobile.Skills[SkillName.Anatomy].Value >= 80.0) { EventSink.InvokeStunRequest(new StunRequestEventArgs(this.m_Mobile)); } if (!this.m_Mobile.InRange(c, this.m_Mobile.RangePerception)) { // They are somewhat far away, can we find something else? if (this.AcquireFocusMob(this.m_Mobile.RangePerception, this.m_Mobile.FightMode, false, false, true)) { this.m_Mobile.Combatant = this.m_Mobile.FocusMob; this.m_Mobile.FocusMob = null; } else if (!this.m_Mobile.InRange(c, this.m_Mobile.RangePerception * 3)) { this.m_Mobile.Combatant = null; } c = this.m_Mobile.Combatant; if (c == null) { this.m_Mobile.DebugSay("My combatant has fled, so I am on guard"); this.Action = ActionType.Guard; return(true); } } if (!this.m_Mobile.Controlled && !this.m_Mobile.Summoned && !this.m_Mobile.IsParagon) { if (this.m_Mobile.Hits < this.m_Mobile.HitsMax * 20 / 100) { // We are low on health, should we flee? bool flee = false; if (this.m_Mobile.Hits < c.Hits) { // We are more hurt than them int diff = c.Hits - this.m_Mobile.Hits; flee = (Utility.Random(0, 100) > (10 + diff)); // (10 + diff)% chance to flee } else { flee = Utility.Random(0, 100) > 10; // 10% chance to flee } if (flee) { if (this.m_Mobile.Debug) { this.m_Mobile.DebugSay("I am going to flee from {0}", c.Name); } this.Action = ActionType.Flee; return(true); } } } if (this.m_Mobile.Spell == null && DateTime.Now > this.m_NextCastTime && this.m_Mobile.InRange(c, 12)) { // We are ready to cast a spell Spell spell = null; Mobile toDispel = this.FindDispelTarget(true); if (this.m_Mobile.Poisoned) // Top cast priority is cure { this.m_Mobile.DebugSay("I am going to cure myself"); spell = new CureSpell(this.m_Mobile, null); } else if (toDispel != null) // Something dispellable is attacking us { this.m_Mobile.DebugSay("I am going to dispel {0}", toDispel); spell = this.DoDispel(toDispel); } else if ((c.Spell is HealSpell || c.Spell is GreaterHealSpell) && !c.Poisoned) // They have a heal spell out { spell = new BloodOathSpell(this.m_Mobile, null); } else { spell = this.ChooseSpell(c); } // Now we have a spell picked // Move first before casting if (toDispel != null) { if (this.m_Mobile.InRange(toDispel, 10)) { this.RunFrom(toDispel); } else if (!this.m_Mobile.InRange(toDispel, 12)) { this.RunTo(toDispel); } } else { this.RunTo(c); } if (spell != null) { spell.Cast(); } TimeSpan delay; if (spell is DispelSpell) { delay = TimeSpan.FromSeconds(this.m_Mobile.ActiveSpeed); } else { delay = this.GetDelay(); } this.m_NextCastTime = DateTime.Now + delay; } else if (this.m_Mobile.Spell == null || !this.m_Mobile.Spell.IsCasting) { this.RunTo(c); } return(true); }
public static void NegateEffects(Mobile target, bool curses, bool buffs, bool damage, bool morph) { if (target == null) { return; } if (damage) { if (target.Poisoned) { var p = target.Poison; target.Poison = null; target.OnCured(target, p); } target.Frozen = false; target.Paralyzed = false; target.SetPropertyValue("Asleep", false); BuffInfo.RemoveBuff(target, BuffIcon.Paralyze); BuffInfo.RemoveBuff(target, BuffIcon.Sleep); } if (buffs) { ReactiveArmorSpell.EndArmor(target); MagicReflectSpell.EndReflect(target); } if (curses) { #region Pain Spike IDictionary table; if (typeof(PainSpikeSpell).GetFieldValue("m_Table", out table) && table.Contains(target)) { var t = table[target] as Timer; if (t != null) { t.Stop(); } table.Remove(target); BuffInfo.RemoveBuff(target, BuffIcon.PainSpike); } #endregion CurseSpell.RemoveEffect(target); EvilOmenSpell.TryEndEffect(target); StrangleSpell.RemoveCurse(target); CorpseSkinSpell.RemoveCurse(target); BloodOathSpell.RemoveCurse(target); MindRotSpell.ClearMindRotScalar(target); } if (damage) { MortalStrike.EndWound(target); BleedAttack.EndBleed(target, target.Alive); MeerMage.StopEffect(target, target.Alive); } if (morph) { AnimalForm.RemoveContext(target, true); PolymorphSpell.StopTimer(target); IncognitoSpell.StopTimer(target); target.Send(SpeedControl.Disable); target.EndAction(typeof(PolymorphSpell)); target.EndAction(typeof(IncognitoSpell)); BuffInfo.RemoveBuff(target, BuffIcon.AnimalForm); BuffInfo.RemoveBuff(target, BuffIcon.Polymorph); BuffInfo.RemoveBuff(target, BuffIcon.Incognito); } if (buffs) { RemoveStatBonus(target, StatType.All); } if (curses) { RemoveStatCurse(target, StatType.All); } }