public override int EatMessage => 1074846;// 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); int power = CleansingWindsSpell.RemoveCurses(from); power = Math.Min(power, 15); from.SendLocalizedMessage(EatMessage); StartInfluence(from, FoodID, Duration, TimeSpan.FromSeconds(30 + power)); Consume(); return(true); } } return(false); }
public override Spell GetRandomHealingSpell() { Spell spell = null; if (m_Mobile.Hits < (m_Mobile.HitsMax - 50)) { if (m_Mobile.Skills[SkillName.Mysticism].Value >= 70.0) { spell = new CleansingWindsSpell(m_Mobile, null); } else { spell = new GreaterHealSpell(m_Mobile, null); } if (spell == null) { spell = new HealSpell(m_Mobile, null); } } else if (m_Mobile.Hits < (m_Mobile.HitsMax - 10)) { spell = new HealSpell(m_Mobile, null); } return(spell); }
}// 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.TOL) { int power = CleansingWindsSpell.RemoveCurses(from); power = Math.Min(power, 15); from.SendLocalizedMessage(EatMessage); StartInfluence(from, FoodID, Duration, TimeSpan.FromSeconds(30 + power)); Consume(); return(true); } else 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 bool TryToHeal() { if (this.m_Mobile.Summoned) { return(false); } else if (DateTime.UtcNow < this.m_NextHealTime) { return(false); } int diff = this.m_Mobile.HitsMax - this.m_Mobile.Hits; diff = ((this.m_Mobile.HitsMax * (100 - diff)) / 100); diff = 100 - diff; if ((int)(Utility.RandomDouble() * 100.0) > diff) { return(false); } Spell spell = null; this.m_NextHealTime = DateTime.UtcNow + TimeSpan.FromSeconds(20); if (this.m_CanUseMagery) { if (this.m_Mobile.Poisoned) { spell = new CureSpell(this.m_Mobile, null); } spell = new GreaterHealSpell(this.m_Mobile, null); if (spell == null) { spell = new HealSpell(this.m_Mobile, null); } } else if (this.m_CanUseNecromancy) { this.m_Mobile.UseSkill(SkillName.SpiritSpeak); this.m_NextHealTime = DateTime.UtcNow + TimeSpan.FromSeconds(10); } else if (this.m_CanUseChivalry) { if (this.m_Mobile.Poisoned) { spell = new CleanseByFireSpell(this.m_Mobile, null); } else { spell = new CloseWoundsSpell(this.m_Mobile, null); } } else if (this.m_CanUseMystic) { spell = new CleansingWindsSpell(this.m_Mobile, null); } else if (this.m_Mobile.Skills[SkillName.Healing].Value > 10.0) { int delay = (int)(5.0 + (0.5 * ((120 - this.m_Mobile.Dex) / 10))); new BandageContext(this.m_Mobile, this.m_Mobile, TimeSpan.FromSeconds(delay), false); this.m_NextHealTime = DateTime.UtcNow + TimeSpan.FromSeconds(delay + 1); return(true); } if (spell != null) { spell.Cast(); } return(true); }