}// 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.Paralyzed = false; from.Asleep = false; CurseSpell.RemoveEffect(from); BuffInfo.RemoveBuff(from, BuffIcon.Clumsy); BuffInfo.RemoveBuff(from, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(from, BuffIcon.Weaken); BuffInfo.RemoveBuff(from, BuffIcon.MassCurse); return(true); } return(false); }
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. } }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendAsciiMessage("Target is not in line of sight."); DoFizzle();//One line so i could use VS Replace, feel free to change/remove comment:p } else if (CheckBSequence(m)) { if ((m.Player && m.Int <= 150 && m.Str <= 150 && m.Dex <= 150 && m.RawStatTotal <= 400) || (!m.Player)) { if (CurseSpell.UnderEffect(m)) { bool message = true; if (m.Str < m.RawStr) { m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Str)); message = false; } if (m.Dex < m.RawDex) { m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Dex)); message = false; } if (m.Int < m.RawInt) { m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Int)); message = false; } if (message) { m.SendAsciiMessage("You are under the effect of a curse spell and cannot get any stat bonuses"); } } else { SpellHelper.AddStatBonus(Caster, m, StatType.Str); SpellHelper.DisableSkillCheck = true; SpellHelper.AddStatBonus(Caster, m, StatType.Dex); SpellHelper.AddStatBonus(Caster, m, StatType.Int); SpellHelper.DisableSkillCheck = false; } } m.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist); m.PlaySound(Sound); int percentage = (int)(SpellHelper.GetOffsetScalar(Caster, m, false) * 100); TimeSpan length = SpellHelper.GetDuration(Caster, m); m_UnderEffect[m] = Timer.DelayCall(length, new TimerStateCallback(RemoveEffect), m); string args = String.Format("{0}\t{1}\t{2}", percentage, percentage, percentage); BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.Bless, 1075847, 1075848, length, m, args)); } FinishSequence(); }
}// 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); }
}// 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); StatMod mod; mod = from.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { from.RemoveStatMod("[Magic] Str Offset"); } mod = from.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { from.RemoveStatMod("[Magic] Dex Offset"); } mod = from.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { from.RemoveStatMod("[Magic] Int Offset"); } from.Paralyzed = false; from.Asleep = false; EvilOmenSpell.TryEndEffect(from); StrangleSpell.RemoveCurse(from); CorpseSkinSpell.RemoveCurse(from); CurseSpell.RemoveEffect(from); BuffInfo.RemoveBuff(from, BuffIcon.Clumsy); BuffInfo.RemoveBuff(from, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(from, BuffIcon.Weaken); BuffInfo.RemoveBuff(from, BuffIcon.MassCurse); 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 override bool DoEffect(Mobile from, Mobile target) { bool result = false; if (!SpellHelper.HasStatEffect(target, m_Stat) && from.CanSee(target) && from.InLOS(target) && target.Alive && from.CanBeHarmful(target)) { from.DoHarmful(target); SpellHelper.Turn(from, target); SpellHelper.CheckReflect(2, from, ref target); if (m_Stat != StatType.All) { SpellHelper.AddStatCurse(null, target, m_Stat); result = true; } else { if (from.Player && target.Player && !CurseSpell.UnderEffect(target)) { SpellHelper.AddStatCurse(null, target, StatType.Str); SpellHelper.DisableSkillCheck = true; SpellHelper.AddStatCurse(null, target, StatType.Dex); SpellHelper.AddStatCurse(null, target, StatType.Int); SpellHelper.DisableSkillCheck = false; TimeSpan duration = SpellHelper.GetDuration(from, target); CurseSpell.PutUnderEffect(target, Timer.DelayCall(duration, new TimerStateCallback(CurseSpell.RemoveEffect), target)); target.UpdateResistances(); result = true; } else { result = false; } } if (result) { target.Paralyzed = false; target.FixedParticles(m_EffIID, m_EffSpd, m_Dur, m_Eff, m_ELayer); target.PlaySound(m_Snd); } } return(result); }
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 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? }
public virtual Spell GetRandomCurseSpell(Mobile c) { if (!CurseSpell.UnderEffect(c) && Utility.RandomBool()) { if (m_Mobile.Skills[SkillName.Magery].Value >= 40.0) { return(new CurseSpell(m_Mobile, null)); } } switch (Utility.Random(3)) { default: case 0: return(new WeakenSpell(m_Mobile, null)); case 1: return(new ClumsySpell(m_Mobile, null)); case 2: return(new FeeblemindSpell(m_Mobile, null)); } }
}// 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 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(); }
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); }
public void Target(Mobile m) { if (!Caster.CanSee(m)) { Caster.SendLocalizedMessage(500237); // Target can not be seen. } else if (CheckBSequence(m)) { if ((m.Player && m.Dex <= 120) || (!m.Player)) { if (CurseSpell.UnderEffect(m)) { if (m.Dex < m.RawDex) { m.RemoveStatMod(String.Format("[Magic] {0} Offset", StatType.Dex)); } else { m.SendAsciiMessage("You are under the effect of a curse spell and cannot get any stat bonuses"); } } else { SpellHelper.AddStatBonus(Caster, m, StatType.Dex); } } else { m.SendAsciiMessage(33, "You are too fast to benefit from that!"); return; } m.FixedParticles(0x373A, 10, 15, 5010, EffectLayer.Waist); m.PlaySound(Sound); } FinishSequence(); }
public override Spell ChooseSpell(IDamageable c) { var select = 2; if (c == null || !c.Alive) { return(null); } Spell spell = null; switch (Utility.Random(select)) { case 0: spell = new HarmSpell(m_Mobile, null); break; case 1: spell = new CurseSpell(m_Mobile, null); break; } return(spell); }
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 override bool Think() { Mobile combatant = m_Guard.Combatant; if (combatant == null || combatant.Deleted || !combatant.Alive || combatant.IsDeadBondedPet || !m_Mobile.CanSee(combatant) || !m_Mobile.CanBeHarmful(combatant, false) || combatant.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.Combatant = combatant = m_Mobile.FocusMob; m_Mobile.FocusMob = null; } else { m_Mobile.Combatant = combatant = null; } } if (combatant != null && (!m_Mobile.InLOS(combatant) || !m_Mobile.InRange(combatant, 12))) { if (AcquireFocusMob(m_Mobile.RangePerception, m_Mobile.FightMode, false, false, true)) { m_Mobile.Combatant = combatant = m_Mobile.FocusMob; m_Mobile.FocusMob = null; } else if (!m_Mobile.InRange(combatant, 36)) { m_Mobile.Combatant = combatant = null; } } Mobile dispelTarget = FindDispelTarget(true); if (m_Guard.Target != null && m_ReleaseTarget == DateTime.MinValue) { m_ReleaseTarget = DateTime.Now + TimeSpan.FromSeconds(10.0); } if (m_Guard.Target != null && DateTime.Now > m_ReleaseTarget) { Target targ = m_Guard.Target; Mobile toHarm = (dispelTarget == null ? combatant : dispelTarget); if ((targ.Flags & TargetFlags.Harmful) != 0 && toHarm != null) { if (m_Guard.Map == toHarm.Map && (targ.Range < 0 || m_Guard.InRange(toHarm, targ.Range)) && m_Guard.CanSee(toHarm) && m_Guard.InLOS(toHarm)) { targ.Invoke(m_Guard, toHarm); } else if (targ is DispelSpell.InternalTarget) { targ.Cancel(m_Guard, TargetCancelType.Canceled); } } else if ((targ.Flags & TargetFlags.Beneficial) != 0) { targ.Invoke(m_Guard, m_Guard); } else { targ.Cancel(m_Guard, TargetCancelType.Canceled); } m_ReleaseTarget = DateTime.MinValue; } if (dispelTarget != null) { if (Action != ActionType.Combat) { Action = ActionType.Combat; } m_Guard.Warmode = true; RunFrom(dispelTarget); } else if (combatant != null) { if (Action != ActionType.Combat) { Action = ActionType.Combat; } m_Guard.Warmode = true; RunTo(combatant); } else if (m_Guard.Orders.Movement != MovementType.Stand) { Mobile toFollow = null; if (m_Guard.Town != null && m_Guard.Orders.Movement == MovementType.Follow) { toFollow = m_Guard.Orders.Follow; if (toFollow == null) { toFollow = m_Guard.Town.Sheriff; } } if (toFollow != null && toFollow.Map == m_Guard.Map && toFollow.InRange(m_Guard, m_Guard.RangePerception * 3) && Town.FromRegion(toFollow.Region) == m_Guard.Town) { if (Action != ActionType.Combat) { Action = ActionType.Combat; } if (m_Mobile.CurrentSpeed != m_Mobile.ActiveSpeed) { m_Mobile.CurrentSpeed = m_Mobile.ActiveSpeed; } m_Guard.Warmode = true; RunTo(toFollow); } else { if (Action != ActionType.Wander) { Action = ActionType.Wander; } if (m_Mobile.CurrentSpeed != m_Mobile.PassiveSpeed) { m_Mobile.CurrentSpeed = m_Mobile.PassiveSpeed; } m_Guard.Warmode = false; WalkRandomInHome(2, 2, 1); } } else { if (Action != ActionType.Wander) { Action = ActionType.Wander; } m_Guard.Warmode = false; } if ((IsDamaged || IsPoisoned) && m_Guard.Skills.Healing.Base > 20.0) { TimeSpan ts = TimeUntilBandage; if (ts == TimeSpan.MaxValue) { StartBandage(); } } if (m_Mobile.Spell == null && DateTime.Now >= m_Mobile.NextSpellTime) { Spell spell = null; DateTime toRelease = DateTime.MinValue; if (IsPoisoned) { Poison p = m_Guard.Poison; TimeSpan ts = TimeUntilBandage; if (p != Poison.Lesser || ts == TimeSpan.MaxValue || TimeUntilBandage < TimeSpan.FromSeconds(1.5) || (m_Guard.HitsMax - m_Guard.Hits) > Utility.Random(250)) { if (IsAllowed(GuardAI.Bless)) { spell = new CureSpell(m_Guard, null); } else { UseItemByType(typeof(BaseCurePotion)); } } } else if (IsDamaged && (m_Guard.HitsMax - m_Guard.Hits) > Utility.Random(200)) { if (IsAllowed(GuardAI.Magic) && ((m_Guard.Hits * 100) / Math.Max(m_Guard.HitsMax, 1)) < 10 && m_Guard.Home != Point3D.Zero && !m_Guard.InRange(m_Guard.Home, 15) && m_Guard.Mana >= 11) { spell = new RecallSpell(m_Guard, null, new RunebookEntry(m_Guard.Home, m_Guard.Map, "Guard's Home", null, 0), null); } else if (IsAllowed(GuardAI.Bless)) { if (m_Guard.Mana >= 11 && (m_Guard.Hits + 30) < m_Guard.HitsMax) { spell = new GreaterHealSpell(m_Guard, null); } else if ((m_Guard.Hits + 10) < m_Guard.HitsMax && (m_Guard.Mana < 11 || (m_Guard.NextCombatTime - DateTime.Now) > TimeSpan.FromSeconds(2.0))) { spell = new HealSpell(m_Guard, null); } } else if (m_Guard.CanBeginAction(typeof(BaseHealPotion))) { UseItemByType(typeof(BaseHealPotion)); } } else if (dispelTarget != null && (IsAllowed(GuardAI.Magic) || IsAllowed(GuardAI.Bless) || IsAllowed(GuardAI.Curse))) { if (!dispelTarget.Paralyzed && m_Guard.Mana > (ManaReserve + 20) && 40 > Utility.Random(100)) { spell = new ParalyzeSpell(m_Guard, null); } else { spell = new DispelSpell(m_Guard, null); } } if (combatant != null) { if (m_Combo != null) { if (spell == null) { spell = SpellCombo.Process(m_Guard, combatant, ref m_Combo, ref m_ComboIndex, ref toRelease); } else { m_Combo = null; m_ComboIndex = -1; } } else if (20 > Utility.Random(100) && IsAllowed(GuardAI.Magic)) { if (80 > Utility.Random(100)) { m_Combo = (IsAllowed(GuardAI.Smart) ? SpellCombo.Simple : SpellCombo.Strong); m_ComboIndex = -1; if (m_Guard.Mana >= (ManaReserve + m_Combo.Mana)) { spell = SpellCombo.Process(m_Guard, combatant, ref m_Combo, ref m_ComboIndex, ref toRelease); } else { m_Combo = null; if (m_Guard.Mana >= (ManaReserve + 40)) { spell = RandomOffenseSpell(); } } } else if (m_Guard.Mana >= (ManaReserve + 40)) { spell = RandomOffenseSpell(); } } if (spell == null && 2 > Utility.Random(100) && m_Guard.Mana >= (ManaReserve + 10)) { int strMod = GetStatMod(m_Guard, StatType.Str); int dexMod = GetStatMod(m_Guard, StatType.Dex); int intMod = GetStatMod(m_Guard, StatType.Int); List <Type> types = new List <Type>(); if (strMod <= 0) { types.Add(typeof(StrengthSpell)); } if (dexMod <= 0 && IsAllowed(GuardAI.Melee)) { types.Add(typeof(AgilitySpell)); } if (intMod <= 0 && IsAllowed(GuardAI.Magic)) { types.Add(typeof(CunningSpell)); } if (IsAllowed(GuardAI.Bless)) { if (types.Count > 1) { spell = new BlessSpell(m_Guard, null); } else if (types.Count == 1) { spell = (Spell)Activator.CreateInstance(types[0], new object[] { m_Guard, null }); } } else if (types.Count > 0) { if (types[0] == typeof(StrengthSpell)) { UseItemByType(typeof(BaseStrengthPotion)); } else if (types[0] == typeof(AgilitySpell)) { UseItemByType(typeof(BaseAgilityPotion)); } } } if (spell == null && 2 > Utility.Random(100) && m_Guard.Mana >= (ManaReserve + 10) && IsAllowed(GuardAI.Curse)) { if (!combatant.Poisoned && 40 > Utility.Random(100)) { spell = new PoisonSpell(m_Guard, null); } else { int strMod = GetStatMod(combatant, StatType.Str); int dexMod = GetStatMod(combatant, StatType.Dex); int intMod = GetStatMod(combatant, StatType.Int); ArrayList types = new ArrayList(); if (strMod >= 0) { types.Add(typeof(WeakenSpell)); } if (dexMod >= 0 && IsAllowed(GuardAI.Melee)) { types.Add(typeof(ClumsySpell)); } if (intMod >= 0 && IsAllowed(GuardAI.Magic)) { types.Add(typeof(FeeblemindSpell)); } if (types.Count > 1) { spell = new CurseSpell(m_Guard, null); } else if (types.Count == 1) { spell = (Spell)Activator.CreateInstance((Type)types[0], new object[] { m_Guard, null }); } } } } if (spell != null && (m_Guard.HitsMax - m_Guard.Hits + 10) > Utility.Random(100)) { Type type = null; if (spell is GreaterHealSpell) { type = typeof(BaseHealPotion); } else if (spell is CureSpell) { type = typeof(BaseCurePotion); } else if (spell is StrengthSpell) { type = typeof(BaseStrengthPotion); } else if (spell is AgilitySpell) { type = typeof(BaseAgilityPotion); } if (type == typeof(BaseHealPotion) && !m_Guard.CanBeginAction(type)) { type = null; } if (type != null && m_Guard.Target == null && UseItemByType(type)) { if (spell is GreaterHealSpell) { if ((m_Guard.Hits + 30) > m_Guard.HitsMax && (m_Guard.Hits + 10) < m_Guard.HitsMax) { spell = new HealSpell(m_Guard, null); } } else { spell = null; } } } else if (spell == null && m_Guard.Stam < (m_Guard.StamMax / 3) && IsAllowed(GuardAI.Melee)) { UseItemByType(typeof(BaseRefreshPotion)); } if (spell == null || !spell.Cast()) { EquipWeapon(); } } else if (m_Mobile.Spell is Spell && ((Spell)m_Mobile.Spell).State == SpellState.Sequencing) { EquipWeapon(); } return(true); }
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 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 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 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 virtual Spell ChooseSpell(Mobile c) { Spell spell = null; int healChance = (m_Mobile.Hits == 0 ? m_Mobile.HitsMax : (m_Mobile.HitsMax / m_Mobile.Hits)); int spellResult; double witherChance = .10; //05% chance to wither per enemy in range m_Mobile.DebugSay("Choosing a Spell"); spellResult = Utility.Random(4 + healChance); m_Mobile.DebugSay("Chose " + spellResult); switch (spellResult) { case 0: // Heal myself { m_Mobile.DebugSay("0. Heal"); if (m_Mobile.Hits < (m_Mobile.HitsMax - 50)) { spell = new GreaterHealSpell(m_Mobile, null); } else if (m_Mobile.Hits < (m_Mobile.HitsMax - 20)) { spell = new HealSpell(m_Mobile, null); } break; } case 1: // PoisonStrike them { m_Mobile.DebugSay("1. Poison Strike or Pfield or Ffield"); if (!c.Poisoned && (!(c is BaseCreature) || (((BaseCreature)c).PoisonImmune != null && ((BaseCreature)m_Mobile).HitPoison != null && ((BaseCreature)c).PoisonImmune.Level < ((BaseCreature)m_Mobile).HitPoison.Level) || ((BaseCreature)c).PoisonImmune == null)) { if (Utility.RandomDouble() > .5) { spell = new PoisonStrikeSpell(m_Mobile, null); } else { spell = new PoisonFieldSpell(m_Mobile, null); //need to do targeting on fields } } else if (Utility.RandomDouble() > .5) { spell = new FireFieldSpell(m_Mobile, null); } else { spell = new FlameStrikeSpell(m_Mobile, null); } break; } case 2: // Deal some damage { List <Mobile> targets = new List <Mobile>(); BaseCreature cbc = m_Mobile as BaseCreature; bool isMonster = (cbc != null && !cbc.Controlled && !cbc.Summoned); //check if enough wither targets. foreach (Mobile m in m_Mobile.GetMobilesInRange(Core.ML ? 4 : 5)) { if (m_Mobile != m && m_Mobile.InLOS(m) && (isMonster || SpellHelper.ValidIndirectTarget(m_Mobile, m)) && m_Mobile.CanBeHarmful(m, false)) { /* * if (isMonster) * { * if (m is BaseCreature) * { * BaseCreature bc = (BaseCreature)m; * * if (!bc.Controlled && !bc.Summoned && bc.Team == cbc.Team) * continue; * } * else if (!m.Player) * { * continue; * } * } */ targets.Add(m); } } if (targets.Count * witherChance > Utility.RandomDouble()) { m_Mobile.DebugSay("2. Wither"); spell = new WitherSpell(m_Mobile, null); } else { spell = GetRandomDamageSpell(); m_Mobile.DebugSay("2. Random Spell"); } break; } case 3: // Set up a combo of attacks { if (m_Mobile.Mana < 30 && m_Mobile.Mana > 15) { if (c.Paralyzed && !c.Poisoned) { m_Mobile.DebugSay("I am going to meditate"); m_Mobile.UseSkill(SkillName.Meditation); } else if (!c.Poisoned && (!(c is BaseCreature) || (((BaseCreature)c).PoisonImmune != null && ((BaseCreature)m_Mobile).HitPoison != null && ((BaseCreature)c).PoisonImmune.Level < ((BaseCreature)m_Mobile).HitPoison.Level) || ((BaseCreature)c).PoisonImmune == null)) { m_Mobile.DebugSay("3. Casting Poison"); spell = new PoisonSpell(m_Mobile, null); } } else if (m_Mobile.Mana > 30 && m_Mobile.Mana < 80) { if (Utility.Random(2) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned) { m_Mobile.DebugSay("3. Pain Spike (Explo)"); m_Combo = 0; spell = new PainSpikeSpell(m_Mobile, null); } else { m_Mobile.DebugSay("3. Mind Rot or Curse (FS)"); m_Combo = 1; if (Utility.RandomBool()) { spell = new CurseSpell(m_Mobile, null); } else { spell = new MindRotSpell(m_Mobile, null); } } } else { if (Utility.Random(2) == 0 && !c.Paralyzed && !c.Frozen && !c.Poisoned) { m_Mobile.DebugSay("4. Vengeful Spirit (Explo)"); m_Combo = 0; spell = new VengefulSpiritSpell(m_Mobile, null); } else { m_Mobile.DebugSay("4. Poison Strike (FS)"); m_Combo = 1; spell = new PoisonStrikeSpell(m_Mobile, null); } } break; } } return(spell); }
public override void SpellEffect(Mobile target) { if (Caster.Backpack == null || !(Caster.Backpack is Container)) { Caster.SendMessage("You need a backpack to use this spell."); return; } if (AosAttributes.GetValue(Caster, AosAttribute.LowerRegCost) < 100) // Nothing less than 100% will do { Item item = Caster.Backpack.FindItemByType(typeof(RefreshPotion)); if (item == null) { Caster.SendMessage("You do not have enough Refresh Potions"); return; } item = Caster.Backpack.FindItemByType(typeof(LesserHealPotion)); if (item == null) { Caster.SendMessage("You do not have enough Heal Potions"); return; } item = Caster.Backpack.FindItemByType(typeof(LesserCurePotion)); if (item == null) { Caster.SendMessage("You do not have enough Cure Potions"); return; } // We just checked for the items. Caster.Backpack.ConsumeTotal(typeof(RefreshPotion), 1); Caster.Backpack.ConsumeTotal(typeof(LesserHealPotion), 1); Caster.Backpack.ConsumeTotal(typeof(LesserCurePotion), 1); } StatMod mod; mod = target.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Str Offset"); } mod = target.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Dex Offset"); } mod = target.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Int Offset"); } BuffInfo.RemoveBuff(target, BuffIcon.Clumsy); BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(target, BuffIcon.Weaken); BuffInfo.RemoveBuff(target, BuffIcon.MassCurse); target.Paralyzed = false; // Don't cure others of Lethal Poison if (target.Poison != Poison.Lethal || target == Caster) { target.CurePoison(Caster); } EvilOmenSpell.TryEndEffect(target); StrangleSpell.RemoveCurse(target); CorpseSkinSpell.RemoveCurse(target); CurseSpell.RemoveEffect(target); // Cure Status aliments (is the system being used?) BlindSpell.EndBlind(target); SilenceSpell.EndSilence(target); SlowSpell.EndSlow(target); StillSpell.EndStill(target); Effects.SendLocationParticles( EffectItem.Create(new Point3D(target.X, target.Y, target.Z), target.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 5020); // Play a random eating sound target.PlaySound(Utility.Random(0x3A, 3)); int bonus = AosAttributes.GetValue(Caster, AosAttribute.EnhancePotions) / 2; if (bonus > 20) { bonus = 20; } target.Hits += bonus; target.Stam += bonus; target.SendMessage("You have been cured of all ailments"); Caster.SendMessage("You have cured " + target.Name + " of all alignments."); // It is a party effect, no way to ever get hit by it. // BlueMageControl.CheckKnown( target, this, CanTeach( target ) ); }
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); } }
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. } }
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 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(); }
protected override void OnTarget(Mobile from, object o) { if (m_Talisman == null || m_Talisman.Deleted) { return; } Mobile target = o as Mobile; if (from.Talisman != m_Talisman) { from.SendLocalizedMessage(502641); // You must equip this item to use it. } else if (target == null) { from.SendLocalizedMessage(1046439); // That is not a valid target. } else if (m_Talisman.ChargeTime > 0) { from.SendLocalizedMessage(1074882, m_Talisman.ChargeTime.ToString()); // You must wait ~1_val~ seconds for this to recharge. } else if (m_Talisman.Charges == 0 && m_Talisman.MaxCharges > 0) { from.SendLocalizedMessage(1042544); // This item is out of charges. } else { switch (m_Talisman.Removal) { case TalismanRemoval.Curse: target.PlaySound(0xF6); target.PlaySound(0x1F7); target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map); IEntity mto = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map); Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100); StatMod mod; mod = target.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Str Offset"); } mod = target.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Dex Offset"); } mod = target.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Int Offset"); } target.Paralyzed = false; EvilOmenSpell.TryEndEffect(target); StrangleSpell.RemoveCurse(target); CorpseSkinSpell.RemoveCurse(target); CurseSpell.RemoveEffect(target); BuffInfo.RemoveBuff(target, BuffIcon.Clumsy); BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(target, BuffIcon.Weaken); BuffInfo.RemoveBuff(target, BuffIcon.MassCurse); target.SendLocalizedMessage(1072408); // Any curses on you have been lifted if (target != from) { from.SendLocalizedMessage(1072409); // Your targets curses have been lifted } break; case TalismanRemoval.Damage: target.PlaySound(0x201); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); BleedAttack.EndBleed(target, true); MortalStrike.EndWound(target); BuffInfo.RemoveBuff(target, BuffIcon.Bleed); BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike); target.SendLocalizedMessage(1072405); // Your lasting damage effects have been removed! if (target != from) { from.SendLocalizedMessage(1072406); // Your Targets lasting damage effects have been removed! } break; case TalismanRemoval.Ward: target.PlaySound(0x201); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); MagicReflectSpell.EndReflect(target); ReactiveArmorSpell.EndArmor(target); ProtectionSpell.EndProtection(target); target.SendLocalizedMessage(1072402); // Your wards have been removed! if (target != from) { from.SendLocalizedMessage(1072403); // Your target's wards have been removed! } break; case TalismanRemoval.Wildfire: // TODO break; } m_Talisman.OnAfterUse(from); } }
protected override void OnTarget(Mobile from, object o) { if (!(o is Mobile)) { from.SendLocalizedMessage(1046439); // That is not a valid target. return; } Mobile target = (Mobile)o; switch (m_Talisman.Removal) { case TalismanRemoval.Curse: target.PlaySound(0xF6); target.PlaySound(0x1F7); target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map); IEntity mto = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map); Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100); StatMod mod; mod = target.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Str Offset"); } mod = target.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Dex Offset"); } mod = target.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Int Offset"); } target.Paralyzed = false; EvilOmenSpell.CheckEffect(target); StrangleSpell.RemoveCurse(target); CorpseSkinSpell.RemoveCurse(target); CurseSpell.RemoveEffect(target); BuffInfo.RemoveBuff(target, BuffIcon.Clumsy); BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(target, BuffIcon.Weaken); BuffInfo.RemoveBuff(target, BuffIcon.MassCurse); if (target == from) { from.SendLocalizedMessage(1072408); // Any curses on you have been lifted } else { from.SendLocalizedMessage(1072409); // Your targets curses have been lifted target.SendLocalizedMessage(1072408); // Any curses on you have been lifted } break; case TalismanRemoval.Damage: target.PlaySound(0x201); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); BleedAttack.EndBleed(target, false); MortalStrike.EndWound(target); BuffInfo.RemoveBuff(target, BuffIcon.Bleed); BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike); if (target == from) { from.SendLocalizedMessage(1072405); // Your lasting damage effects have been removed! } else { from.SendLocalizedMessage(1072406); // Your Targets lasting damage effects have been removed! target.SendLocalizedMessage(1072405); // Your lasting damage effects have been removed! } break; case TalismanRemoval.Ward: target.PlaySound(0x201); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); // Magic reflect Hashtable m_Table = MagicReflectSpell.m_Table; if (m_Table == null) { return; } ResistanceMod[] mods = (ResistanceMod[])m_Table[target]; m_Table.Remove(target); if (mods != null) { for (int i = 0; i < mods.Length; ++i) { target.RemoveResistanceMod(mods[i]); } } BuffInfo.RemoveBuff(target, BuffIcon.MagicReflection); // Reactive armor m_Table = ReactiveArmorSpell.m_Table; if (m_Table == null) { return; } mods = (ResistanceMod[])m_Table[target]; if (mods != null) { m_Table.Remove(target); for (int i = 0; i < mods.Length; ++i) { target.RemoveResistanceMod(mods[i]); } } BuffInfo.RemoveBuff(target, BuffIcon.ReactiveArmor); // Protection m_Table = ProtectionSpell.m_Table; if (m_Table == null) { return; } object[] pmods = (object[])m_Table[target]; if (mods != null) { m_Table.Remove(target); ProtectionSpell.Registry.Remove(target); target.RemoveResistanceMod((ResistanceMod)pmods[0]); target.RemoveSkillMod((SkillMod)pmods[1]); } BuffInfo.RemoveBuff(target, BuffIcon.Protection); if (target == from) { from.SendLocalizedMessage(1072402); // Your wards have been removed! } else { from.SendLocalizedMessage(1072403); // Your target's wards have been removed! target.SendLocalizedMessage(1072402); // Your wards have been removed! } break; } m_Talisman.ChargeTime = m_Talisman.MaxChargeTime; if (m_Talisman.Charges > 0) { m_Talisman.Charges -= 1; } m_Talisman.StartTimer(); m_Talisman.InvalidateProperties(); }