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. } }
protected override void OnTick() { if (m_From is BaseCreature && m_Target != null) { ((BaseCreature)m_From).AlterSpellDamageTo(m_Target, ref m_Damage); } if (m_Target is BaseCreature && m_From != null) { ((BaseCreature)m_Target).AlterSpellDamageFrom(m_From, ref m_Damage); } WeightOverloading.DFA = m_DFA; int damageGiven = AOS.Damage(m_Target, m_From, m_Damage, m_Phys, m_Fire, m_Cold, m_Pois, m_Nrgy); WeightOverloading.DFA = DFAlgorithm.Standard; SpellPlagueSpell.CheckPlague(m_Target); if (m_Target is BaseCreature && m_From != null) { ((BaseCreature)m_Target).OnDamagedBySpell(m_From); } }
public static void Damage(TimeSpan delay, Mobile target, Mobile from, double damage, int phys, int fire, int cold, int pois, int nrgy, DFAlgorithm dfa) { int iDamage = (int)damage; if (delay == TimeSpan.Zero) { if (from is BaseCreature) { ((BaseCreature)from).AlterSpellDamageTo(target, ref iDamage); } if (target is BaseCreature) { ((BaseCreature)target).AlterSpellDamageFrom(from, ref iDamage); } WeightOverloading.DFA = dfa; int damageGiven = AOS.Damage(target, from, iDamage, phys, fire, cold, pois, nrgy); WeightOverloading.DFA = DFAlgorithm.Standard; SpellPlagueSpell.CheckPlague(target); if (target is BaseCreature && from != null) { ((BaseCreature)target).OnDamagedBySpell(from); } } else { new SpellDamageTimerAOS(target, from, iDamage, phys, fire, cold, pois, nrgy, delay, dfa).Start(); } }
}// 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 Spell GetMysticSpell() { Spell spell = null; switch (Utility.Random(8)) { case 0: case 1: { if (this.CheckForSleep(this.m_Mobile.Combatant)) { this.m_Mobile.DebugSay("Casting Sleep"); spell = new SleepSpell(this.m_Mobile, null); break; } else { goto case 7; } } case 2: { if (this.m_Mobile.Followers < 2) { int whichone = Utility.Random(3); if (this.m_Mobile.Skills[SkillName.Mysticism].Value > 80.0 && whichone > 0) { this.m_Mobile.DebugSay("Casting Rising Colossus"); spell = new RisingColossusSpell(this.m_Mobile, null); } else if (this.m_Mobile.Skills[SkillName.Mysticism].Value > 30.0) { this.m_Mobile.DebugSay("Casting Animated Weapon"); spell = new AnimatedWeaponSpell(this.m_Mobile, null); } } if (spell != null) { break; } else { goto case 7; } } case 3: { if (this.m_CanShapeShift && this.m_Mobile.Skills[SkillName.Mysticism].Value > 30.0) { this.m_Mobile.DebugSay("Casting Stone Form"); spell = new StoneFormSpell(this.m_Mobile, null); break; } else { goto case 7; } } case 4: case 5: { if (!SpellPlagueSpell.HasSpellPlague(this.m_Mobile.Combatant) && this.m_Mobile.Skills[SkillName.Mysticism].Value > 70.0) { this.m_Mobile.DebugSay("Casting Spell Plague"); spell = new SpellPlagueSpell(this.m_Mobile, null); break; } else { goto case 7; } } case 6: case 7: { switch (Utility.Random((int)(this.m_Mobile.Skills[SkillName.Mysticism].Value / 20))) { default: spell = new NetherBoltSpell(this.m_Mobile, null); break; case 1: spell = new EagleStrikeSpell(this.m_Mobile, null); break; case 2: spell = new BombardSpell(this.m_Mobile, null); break; case 3: spell = new HailStormSpell(this.m_Mobile, null); break; case 4: spell = new NetherCycloneSpell(this.m_Mobile, null); break; } break; } } return(spell); }
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 void Target(Mobile m) { if (CheckBSequence(m)) { SpellHelper.Turn(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 (Caster.Karma < -5000) { chance = 0; } else if (Caster.Karma < 0) { chance = (int)Math.Sqrt(20000 + Caster.Karma) - 122; } else if (Caster.Karma < 5625) { chance = (int)Math.Sqrt(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), 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); m.Paralyzed = false; EvilOmenSpell.TryEndEffect(m); StrangleSpell.RemoveCurse(m); CorpseSkinSpell.RemoveCurse(m); CurseSpell.RemoveEffect(m); MortalStrike.EndWound(m); WeakenSpell.RemoveEffects(m); FeeblemindSpell.RemoveEffects(m); ClumsySpell.RemoveEffects(m); BloodOathSpell.RemoveCurse(m); MindRotSpell.ClearMindRotScalar(m); SpellPlagueSpell.RemoveFromList(m); BuffInfo.RemoveBuff(m, BuffIcon.MassCurse); } else { m.PlaySound(0x1DF); } } FinishSequence(); }
public InternalTarget(SpellPlagueSpell owner) : base(12, false, TargetFlags.Harmful) =>
public SpellPlagueContext(SpellPlagueSpell owner, Mobile target) { m_Owner = owner; m_Target = target; }
public SpellPlagueTimer(SpellPlagueSpell owner, Mobile target) : base(TimeSpan.FromSeconds(8.0)) { m_Owner = owner; m_Target = target; }
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); }