public void DoCure( Mobile from ) { bool cure = false; CureLevelInfo[] info = LevelInfo; for ( int i = 0; i < info.Length; ++i ) { CureLevelInfo li = info[i]; if ( li.Poison == from.Poison && Scale( from, li.Chance ) > Utility.RandomDouble() ) { cure = true; break; } } if ( cure && from.CurePoison( from ) ) { from.SendAsciiMessage( "You feel cured of poison!" ); // You feel cured of poison! from.FixedEffect( 0x373A, 10, 15 ); from.PlaySound( 0x1E0 ); } else if ( !cure ) { from.SendAsciiMessage( "That potion was not strong enough to cure your ailment!" ); // That potion was not strong enough to cure your ailment! } }
public void DoCure( Mobile from ) { bool cure = false; CureLevelInfo[] info = LevelInfo; for ( int i = 0; i < info.Length; ++i ) { CureLevelInfo li = info[i]; #region Mondain's Legacy mod if ( li.Poison.RealLevel == from.Poison.RealLevel && Scale( from, li.Chance ) > Utility.RandomDouble() ) { cure = true; break; } #endregion } if ( cure && from.CurePoison( from ) ) { from.SendLocalizedMessage( 500231 ); // You feel cured of poison! from.FixedEffect( 0x373A, 10, 15 ); from.PlaySound( 0x1E0 ); } else if ( !cure ) { from.SendLocalizedMessage( 500232 ); // That potion was not strong enough to cure your ailment! } }
public void DoCure(Mobile from, double scalar) { bool cure = false; CureLevelInfo[] info = LevelInfo; for (int i = 0; i < info.Length; ++i) { CureLevelInfo li = info[i]; if (li.Poison == from.Poison && Scale(from, li.Chance - (int)Math.Floor(li.Chance * scalar) + (IntensifiedStrength ? 0.1 : 0)) > Utility.RandomDouble()) { cure = true; break; } } if (cure && from.CurePoison(from)) { from.SendLocalizedMessage(500231); // You feel cured of poison! from.FixedEffect(0x373A, 10, 15); from.PlaySound(0x1E0); } else if (!cure) { from.SendLocalizedMessage(500232); // That potion was not strong enough to cure your ailment! } }
public override void OnDoubleClick(Mobile from) { if ( from.Player && from.InRange( this, 1 ) && from.InLOS( this ) ) { object o = m_Table[from]; if ( o == null || ( o is DateTime && ((DateTime)o)+TimeSpan.FromHours( 6 ) < DateTime.Now ) ) { from.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist ); from.PlaySound( 0x202 ); from.SendAsciiMessage( "You feel a magical energy surround you." ); from.Hits = from.HitsMax; from.Mana = from.ManaMax; from.Stam = from.StamMax; from.CurePoison( from ); m_Table[from] = DateTime.Now; } } }
public void Target( BaseTalisman talis, Mobile owner, Mobile m ) { if ( this.Parent == owner ) { //Curse Removal if ( talis.m_TalismanType == TalismanType.CurseRemoval ) { m.PlaySound( 0xF6 ); m.PlaySound( 0x1F7 ); m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head ); 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 ); 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 ); StrangleSpell.RemoveCurse( m ); CorpseSkinSpell.RemoveCurse( m ); if ( owner != m ) owner.SendLocalizedMessage( 1072409 ); // Your targets curses have been lifted m.SendLocalizedMessage( 1072408 ); // Any curses on you have been lifted } //Damage Removal if ( talis.m_TalismanType == TalismanType.DamageRemoval ) { Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 8 ); Effects.PlaySound( m, m.Map, 0x201 ); BleedAttack.EndBleed( m, false ); MortalStrike.EndWound( m ); m.CurePoison( m ); BuffInfo.RemoveBuff( m, BuffIcon.Bleed ); BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike ); if ( owner != m ) owner.SendLocalizedMessage( 1072406 ); // Your Targets lasting damage effects have been removed! m.SendLocalizedMessage( 1072405 ); // Your lasting damage effects have been removed! } //Ward Removal if ( talis.m_TalismanType == TalismanType.WardRemoval ) { Effects.SendLocationEffect( m.Location, m.Map, 0x3728, 8 ); Effects.PlaySound( m, m.Map, 0x201 ); ProtectionSpell.RemoveWard( m ); ReactiveArmorSpell.RemoveWard( m ); MagicReflectSpell.RemoveWard( m ); TransformationSpell.RemoveContext( m, true ); ReaperFormSpell.RemoveEffects( m ); if ( StoneFormSpell.UnderEffect( m ) ) StoneFormSpell.RemoveEffects( m ); if ( owner != m ) owner.SendLocalizedMessage( 1072403 ); // Your target's wards have been removed! m.SendLocalizedMessage( 1072402 ); // Your wards have been removed! } //Wildfire Removal if ( talis.m_TalismanType == TalismanType.WildfireRemoval ) owner.SendLocalizedMessage( 1042753, "Wildfire Removal" ); // ~1_SOMETHING~ has been temporarily disabled. //CARGE TIMER ChargeTimeLeft = 1200; m_ChargeTimer = new ChargeTimeLeftTimer( this ); m_ChargeTimer.Start(); m_ChargeTimeLeft3 = DateTime.Now; } else if ( m_TalismanType != 0 ) m.SendLocalizedMessage( 502641 ); // You must equip this item to use it. }
public override void OnMovement( Mobile m, Point3D oldLocation ) { if ( this.InRange( m, 2 ) && !this.InRange( oldLocation, 2 ) && !m_Table.ContainsKey( m ) ) { if ( !m.Alive ) { m.CloseGump( typeof( ResurrectGump ) ); m.SendGump( new FoFResurrectGump( m ) ); } else if ( m.Poisoned || IsCursed( m ) ) { RemoveCurseSpell.DoGraphicalEffect( m ); RemoveCurseSpell.DoRemoveCurses( m ); if ( m.Poisoned && m.CurePoison( m ) ) m.SendLocalizedMessage( 1010059 ); // You have been cured of all poisons. AddCooldown( m ); } else if ( m.Hits < ( m.HitsMax / 2.0 ) ) { m.Hits = m.HitsMax; m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist ); m.PlaySound( 0x202 ); m.SendLocalizedMessage( 1113365 ); // Your wounds have been mended. AddCooldown( m ); } } }
public override void OnDoubleClick( Mobile from ) { if ( !from.InRange( this.GetWorldLocation(), 1 ) ) { from.SendLocalizedMessage( 502138 ); // That is too far away for you to use return; } else if ( from != m_Caster ) { } else if (!BasePotion.HasFreeHand(from)) { from.SendLocalizedMessage(1080116); // You must have a free hand to use a Healing Stone. } else if (from.Hits >= from.HitsMax && !from.Poisoned) { from.SendLocalizedMessage(1049547); //You are already at full health. } else if (from.BeginAction(typeof(HealingStone))) { if (m_MaxHeal > m_LifeForce) m_MaxHeal = m_LifeForce; if (from.Poisoned) { int toUse = Math.Min(120, from.Poison.RealLevel * 25); if (m_MaxLifeForce < toUse) from.SendLocalizedMessage(1115265); //Your Mysticism, Focus, or Imbuing Skills are not enough to use the heal stone to cure yourself. else if (m_LifeForce < toUse) { from.SendLocalizedMessage(1115264); //Your healing stone does not have enough energy to remove the poison. m_LifeForce -= toUse / 3; } else { from.CurePoison(from); from.SendLocalizedMessage(500231); // You feel cured of poison! from.FixedEffect(0x373A, 10, 15); from.PlaySound(0x1E0); m_LifeForce -= toUse; } if (m_LifeForce <= 0) this.Consume(); Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseHealLock), from); return; } else { int toHeal = Math.Min(m_MaxHeal, from.HitsMax - from.Hits); from.Heal(toHeal); Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(ReleaseHealLock), from); from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist); from.PlaySound(0x202); m_LifeForce -= toHeal; m_MaxHeal = 1; } if (m_LifeForce <= 0) { from.SendLocalizedMessage(1115266); //The healing stone has used up all its energy and has been destroyed. this.Consume(); } else { if (m_Timer != null) m_Timer.Stop(); m_Timer = new InternalTimer(this); } } else from.SendLocalizedMessage(1095172); // You must wait a few seconds before using another Healing Stone. }
/// <summary> /// Remove all ill effects from a player. /// </summary> /// <param name="pm"></param> public void CleanPlayer(Mobile pm) { //Cure Poison pm.CurePoison(pm); //Reset Hit Points pm.Hits = pm.HitsMax; //Rest Mana pm.Mana = pm.ManaMax; //Reset Stam pm.Stam = pm.StamMax; //Cancel any targeting Targeting.Target.Cancel(pm); //remove abosorption for magic pm.MagicDamageAbsorb = 0; //remove absorption for melee pm.MeleeDamageAbsorb = 0; //clear protection spell Spells.Second.ProtectionSpell.Registry.Remove(pm); //clear curse effect Spells.Fourth.CurseSpell.RemoveEffect(pm); //clear corpseskin Server.Spells.Necromancy.CorpseSkinSpell.RemoveCurse(pm); //clear blodd oath Server.Spells.Necromancy.BloodOathSpell.RemoveCurse(pm); //clear evil omen //Server.Spells.Necromancy.EvilOmenSpell.RemoveCurse(pm); //remove strangle Server.Spells.Necromancy.StrangleSpell.RemoveCurse(pm); //clear Paralyzed pm.Paralyzed = false; //clear defensive spell DefensiveSpell.Nullify(pm); //remove any combatant pm.Combatant = null; //remove war mode pm.Warmode = false; //remove criminal pm.Criminal = false; //clear agressed list pm.Aggressed.Clear(); //clear agressor list pm.Aggressors.Clear(); //clear delta notoriety pm.Delta(MobileDelta.Noto); //invalidate any properties due to the previous changes pm.InvalidateProperties(); }
private void CleanPlayer(Mobile pm) { pm.CurePoison(pm); pm.Hits = pm.HitsMax; pm.Mana = pm.ManaMax; pm.Stam = pm.StamMax; Targeting.Target.Cancel(pm); pm.MagicDamageAbsorb = 0; pm.MeleeDamageAbsorb = 0; Spells.Second.ProtectionSpell.Registry.Remove(pm); Spells.Fourth.CurseSpell.RemoveEffect(pm); Server.Spells.Necromancy.CorpseSkinSpell.RemoveCurse(pm); Server.Spells.Necromancy.BloodOathSpell.RemoveCurse(pm); Server.Spells.Necromancy.StrangleSpell.RemoveCurse(pm); pm.Blessed = false; pm.Paralyzed = false; pm.Hidden = false; DefensiveSpell.Nullify(pm); pm.Combatant = null; pm.Warmode = false; pm.Criminal = false; pm.Blessed = false; pm.Aggressed.Clear(); pm.Aggressors.Clear(); pm.Delta(MobileDelta.Noto); pm.InvalidateProperties(); }
public virtual void Heal(Mobile patient) { if ( !Alive || this.Map == Map.Internal || !CanBeBeneficial( patient, true, true ) || patient.Map != this.Map || !InRange( patient, HealEndRange ) ) { StopHeal(); return; } bool onSelf = ( patient == this ); if ( !patient.Alive ) { } else if (patient.Poisoned) { int poisonLevel = patient.Poison.Level; double healing = Skills.Healing.Value; double anatomy = Skills.Anatomy.Value; double chance = ( healing - 30.0 ) / 50.0 - poisonLevel * 0.1; if ((healing >= 60.0 && anatomy >= 60.0) && chance > Utility.RandomDouble()) { if (patient.CurePoison(this)) { patient.SendLocalizedMessage(1010059); // You have been cured of all poisons. CheckSkill( SkillName.Healing, 0.0, 60.0 + poisonLevel * 10.0 ); // TODO: Verify formula CheckSkill(SkillName.Anatomy, 0.0, 100.0); } } } else if (BleedAttack.IsBleeding(patient)) { patient.SendLocalizedMessage(1060167); // The bleeding wounds have healed, you are no longer bleeding! BleedAttack.EndBleed( patient, false ); } else { double healing = Skills.Healing.Value; double anatomy = Skills.Anatomy.Value; double chance = (healing + 10.0) / 100.0; if (chance > Utility.RandomDouble()) { double min, max; min = (anatomy / 10.0) + (healing / 6.0) + 4.0; max = (anatomy / 8.0) + (healing / 3.0) + 4.0; if ( onSelf ) max += 10; double toHeal = min + (Utility.RandomDouble() * (max - min)); toHeal *= HealScalar; patient.Heal((int)toHeal); CheckSkill( SkillName.Healing, 0.0, 90.0 ); CheckSkill(SkillName.Anatomy, 0.0, 100.0); } } HealEffect( patient ); StopHeal(); if ( ( onSelf && HealFully && Hits >= HealTrigger * HitsMax && Hits < HitsMax ) || ( !onSelf && HealOwnerFully && patient.Hits >= HealOwnerTrigger * patient.HitsMax && patient.Hits < patient.HitsMax ) ) HealStart( patient ); }
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 void FinalPrep(Mobile from) { if(!from.Alive) from.Resurrect(); from.CurePoison(from); from.Blessed = false; from.Frozen = false; from.StatMods.Clear(); from.Hits = from.HitsMax; from.Mana = from.ManaMax; from.Stam = from.StamMax; Targeting.Target.Cancel( from ); from.MagicDamageAbsorb = 0; from.MeleeDamageAbsorb = 0; ProtectionSpell.Registry.Remove( from ); DefensiveSpell.Nullify( from ); from.Combatant = null; from.Delta( MobileDelta.Noto ); //Update notoriety }
public static void OnDoubleClick(Mobile from, bool chaos) { bool good = (from.Karma >= 0 && from.Kills < 5); bool heal = false; if (chaos) { if (!good) { from.SendMessage("Thy efforts for the resistance are rewarded."); heal = true; } } else { if (good) { from.SendMessage("Strive to continue on the path of benevolence."); heal = true; } } if (heal) { //from.Hits = from.HitsMax; //from.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist); //from.PlaySound(0x202); if (from.Poison != null) { if (from.CurePoison(from)) { from.SendLocalizedMessage(1010059); // You have been cured of all poisons. from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist); from.PlaySound(0x1E0); } } } else { if (chaos) from.SendMessage("The weak deserve their fate."); else from.SendMessage("Do more to help others."); if (from.Hits > 1) { from.Hits /= 2; from.FixedParticles(0x374A, 10, 15, 5013, EffectLayer.Waist); from.PlaySound(0x1F1); } } }
protected override void OnTick() { if ((Core.AOS && m_Poison.Level < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) || (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)) || AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn))) { if (m_Mobile.CurePoison(m_Mobile)) { m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true, "* You feel yourself resisting the effects of the poison *"); m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true, String.Format("* {0} seems resistant to the poison *", m_Mobile.Name)); Stop(); return; } } if (m_Index++ == m_Poison.m_Count) { m_Mobile.SendLocalizedMessage(502136); // The poison seems to have worn off. m_Mobile.Poison = null; Stop(); return; } int damage; if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool()) { damage = m_LastDamage; } else { damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar); if (damage < m_Poison.m_Minimum) { damage = m_Poison.m_Minimum; } else if (damage > m_Poison.m_Maximum) { damage = m_Poison.m_Maximum; } m_LastDamage = damage; } if (m_From != null) { m_From.DoHarmful(m_Mobile, true); } IHonorTarget honorTarget = m_Mobile as IHonorTarget; if (honorTarget != null && honorTarget.ReceivedHonorContext != null) { honorTarget.ReceivedHonorContext.OnTargetPoisoned(); } #region Mondain's Legacy if (m_Mobile != m_From && m_From.InRange(m_Mobile.Location, 1) && Utility.InsensitiveCompare(m_Poison.Name, "Parasitic") == 0) { m_From.Heal((int)(damage * 0.4)); // TODO check } #endregion AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0); if ((m_Index % m_Poison.m_MessageInterval) == 0) { m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison); } }
protected override void OnTick() { #region Mondain's Legacy mod if ((Core.AOS && m_Poison.RealLevel < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) || (m_Poison.RealLevel < 3 && OrangePetals.UnderEffect(m_Mobile)) || AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn))) #endregion { if (m_Mobile.CurePoison(m_Mobile)) { m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true, "* You feel yourself resisting the effects of the poison *"); m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true, String.Format("* {0} seems resistant to the poison *", m_Mobile.Name)); Stop(); return; } } if (m_Index++ == m_Poison.m_Count) { m_Mobile.SendLocalizedMessage(502136); // The poison seems to have worn off. m_Mobile.Poison = null; if (m_Mobile is PlayerMobile) { BuffInfo.RemoveBuff((PlayerMobile)m_Mobile, BuffIcon.Poison); } Stop(); return; } int damage; if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool()) { damage = m_LastDamage; } else { damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar); if (damage < m_Poison.m_Minimum) { damage = m_Poison.m_Minimum; } else if (damage > m_Poison.m_Maximum) { damage = m_Poison.m_Maximum; } m_LastDamage = damage; } if (m_From != null) { m_From.DoHarmful(m_Mobile, true); } IHonorTarget honorTarget = m_Mobile as IHonorTarget; if (honorTarget != null && honorTarget.ReceivedHonorContext != null) { honorTarget.ReceivedHonorContext.OnTargetPoisoned(); } #region Mondain's Legacy if (Core.ML) { if (m_From != null && m_Mobile != m_From && !m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 10 && m_Poison.m_Level <= 13) // darkglow { m_From.SendLocalizedMessage(1072850); // Darkglow poison increases your damage! damage = (int)Math.Floor(damage * 1.1); } if (m_From != null && m_Mobile != m_From && m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 14 && m_Poison.m_Level <= 18) // parasitic { int toHeal = Math.Min(m_From.HitsMax - m_From.Hits, damage); if (toHeal > 0) { m_From.SendLocalizedMessage(1060203, toHeal.ToString()); // You have had ~1_HEALED_AMOUNT~ hit points of damage healed. m_From.Heal(toHeal, m_Mobile, false); } } } #endregion AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0); if ((m_Index % m_Poison.m_MessageInterval) == 0) { m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison); } }
private void HandleMatchEnd(Mobile from, bool kick) { if(!from.Alive) { from.Resurrect(); if(from.Corpse != null && from.Corpse is Corpse) { Corpse c = (Corpse)from.Corpse; for ( int i = 0; i < c.Items.Count; ++i ) { Item item = c.Items[i]; c.SetRestoreInfo( item, item.Location ); } c.Open(from, true); c.Delete(); } } from.Criminal = false; from.Blessed = false; from.Frozen = false; from.CurePoison(from); from.StatMods.Clear(); from.Hits = from.HitsMax; from.Mana = from.ManaMax; from.Stam = from.StamMax; Targeting.Target.Cancel( from ); from.MagicDamageAbsorb = 0; from.MeleeDamageAbsorb = 0; ProtectionSpell.Registry.Remove( from ); DefensiveSpell.Nullify( from ); from.Combatant = null; from.Delta( MobileDelta.Noto ); //Update notoriety from.Location = m_SpectatorDest; if(kick && from.NetState == null) { Match m = FindMatch(from); if(m.Attackers.Contains(from)) m.Attackers.Remove(from); else if(m.Defenders.Contains(from)) m.Defenders.Remove(from); } }
private void PrepFighter(Mobile from) { if(!from.Alive) from.Resurrect(); if(from.Mount != null) from.Mount.Rider = null; from.CurePoison(from); from.Blessed = true; from.Frozen = true; from.StatMods.Clear(); from.Hits = from.HitsMax; from.Mana = from.ManaMax; from.Stam = from.StamMax; Targeting.Target.Cancel( from ); from.MagicDamageAbsorb = 0; from.MeleeDamageAbsorb = 0; ProtectionSpell.Registry.Remove( from ); DefensiveSpell.Nullify( from ); from.Combatant = null; from.Delta( MobileDelta.Noto ); //Update notoriety from.SendMessage("The fight will begin in ten seconds."); }
public virtual void Heal(Mobile patient) { if (!Alive || !patient.Alive || !InRange(patient, 2)) { } else if (patient.Poisoned) { double healing = Skills.Healing.Value; double anatomy = Skills.Anatomy.Value; double chance = (healing - 30.0) / 50.0 - patient.Poison.Level * 0.1; if ((healing >= 60.0 && anatomy >= 60.0) && chance > Utility.RandomDouble()) { if (patient.CurePoison(this)) { patient.SendLocalizedMessage(1010059); // You have been cured of all poisons. patient.PlaySound(0x57); CheckSkill(SkillName.Healing, 0.0, 100.0); CheckSkill(SkillName.Anatomy, 0.0, 100.0); } } } else if (BleedAttack.IsBleeding(patient)) { patient.SendLocalizedMessage(1060167); // The bleeding wounds have healed, you are no longer bleeding! BleedAttack.EndBleed(patient, true); patient.PlaySound(0x57); } else { double healing = Skills.Healing.Value; double anatomy = Skills.Anatomy.Value; double chance = (healing + 10.0) / 100.0; if (chance > Utility.RandomDouble()) { double min, max; min = (anatomy / 10.0) + (healing / 6.0) + 4.0; max = (anatomy / 8.0) + (healing / 3.0) + 4.0; if (patient == this) max += 10; double toHeal = min + (Utility.RandomDouble() * (max - min)); toHeal *= HealScalar; patient.Heal((int)toHeal); patient.PlaySound(0x57); CheckSkill(SkillName.Healing, 0.0, 100.0); CheckSkill(SkillName.Anatomy, 0.0, 100.0); } } if (m_HealTimer != null) m_HealTimer.Stop(); m_HealTimer = null; m_NextHealTime = DateTime.Now + TimeSpan.FromSeconds(MinHealDelay + (Utility.RandomDouble() * MaxHealDelay)); }
protected override void OnTick() { if ((Core.AOS && m_Poison.Level < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) || (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)) || AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn))) { if (m_Mobile.CurePoison(m_Mobile)) { m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true, "* You feel yourself resisting the effects of the poison *"); m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true, String.Format("* {0} seems resistant to the poison *", m_Mobile.Name)); Stop(); return; } } if (m_Index++ == m_Poison.m_Count) { m_Mobile.SendAsciiMessage("The poison seems to have worn off."); // The poison seems to have worn off. m_Mobile.Poison = null; Stop(); return; } int damage; if (!Core.AOS && m_LastDamage != 0 && Utility.RandomMinMax(1, 3) != 1) { damage = m_LastDamage; } else { //damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar); damage = 2 + (int)(m_Mobile.Hits * m_Poison.m_Scalar); m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison); /*if ( damage < m_Poison.m_Minimum ) * damage = m_Poison.m_Minimum; * else if ( damage > m_Poison.m_Maximum ) * damage = m_Poison.m_Maximum;*/ m_LastDamage = damage; } if (m_From != null) { m_From.DoHarmful(m_Mobile, true); } IHonorTarget honorTarget = m_Mobile as IHonorTarget; if (honorTarget != null && honorTarget.ReceivedHonorContext != null) { honorTarget.ReceivedHonorContext.OnTargetPoisoned(); } AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0); //if ( (m_Index % m_Poison.m_MessageInterval) == 0 ) // m_Mobile.OnPoisoned( m_From, m_Poison, m_Poison ); }
protected override void OnTick() { bool usingPetals = OrangePetals.UnderEffect(m_Mobile); if (usingPetals && m_Poison.RealLevel >= 3 && 0.25 > Utility.RandomDouble()) { OrangePetals.RemoveContext(m_Mobile); usingPetals = false; m_Mobile.LocalOverheadMessage(MessageType.Regular, 0x3F, 1053093); // * The strength of the poison overcomes your resistance! * } if ((m_Poison.RealLevel < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) || (m_Poison.RealLevel <= 3 && usingPetals) || AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn))) { if (m_Mobile.CurePoison(m_Mobile)) { m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, 1053092); // * You feel yourself resisting the effects of the poison * m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, 1114442, m_Mobile.Name); // * ~1_NAME~ seems resistant to the poison * Stop(); return; } } if (m_Index++ == m_Poison.m_Count) { m_Mobile.SendLocalizedMessage(502136); // The poison seems to have worn off. m_Mobile.Poison = null; if (m_Mobile is PlayerMobile) { BuffInfo.RemoveBuff((PlayerMobile)m_Mobile, BuffIcon.Poison); } Stop(); return; } int damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar); if (damage < m_Poison.m_Minimum) { damage = m_Poison.m_Minimum; } else if (damage > m_Poison.m_Maximum) { damage = m_Poison.m_Maximum; } m_LastDamage = damage; if (m_From != null) { if (m_From is BaseCreature && ((BaseCreature)m_From).RecentSetControl && ((BaseCreature)m_From).GetMaster() == m_Mobile) { m_From = null; } else { m_From.DoHarmful(m_Mobile, true); } } IHonorTarget honorTarget = m_Mobile as IHonorTarget; if (honorTarget != null && honorTarget.ReceivedHonorContext != null) { honorTarget.ReceivedHonorContext.OnTargetPoisoned(); } if (m_From != null && m_Mobile != m_From && !m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 10 && m_Poison.m_Level <= 13) // darkglow { m_From.SendLocalizedMessage(1072850); // Darkglow poison increases your damage! damage = (int)Math.Floor(damage * 1.1); } if (m_From != null && m_Mobile != m_From && m_From.InRange(m_Mobile.Location, 1) && m_Poison.m_Level >= 14 && m_Poison.m_Level <= 18) // parasitic { int toHeal = Math.Min(m_From.HitsMax - m_From.Hits, damage); if (toHeal > 0) { m_From.SendLocalizedMessage(1060203, toHeal.ToString()); // You have had ~1_HEALED_AMOUNT~ hit points of damage healed. m_From.Heal(toHeal, m_Mobile, false); } } AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0); if (damage > 0) { m_Mobile.RevealingAction(); } if ((m_Index % m_Poison.m_MessageInterval) == 0) { m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison); } }
protected override void OnTick() { if ((Core.AOS && m_Poison.Level < 4 && TransformationSpellHelper.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) || (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)) || AnimalForm.UnderTransformation(m_Mobile, typeof(Unicorn))) { if (m_Mobile.CurePoison(m_Mobile)) { m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true, "* You feel yourself resisting the effects of the poison *"); m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true, $"* {m_Mobile.Name} seems resistant to the poison *"); Stop(); return; } } if (m_Index++ == m_Poison.m_Count) { m_Mobile.SendLocalizedMessage(502136); // The poison seems to have worn off. m_Mobile.Poison = null; Stop(); return; } int damage; if (!Core.AOS && m_LastDamage != 0 && Utility.RandomBool()) { damage = m_LastDamage; } else { damage = 1 + (int)(m_Mobile.Hits * m_Poison.m_Scalar); if (damage < m_Poison.m_Minimum) { damage = m_Poison.m_Minimum; } else if (damage > m_Poison.m_Maximum) { damage = m_Poison.m_Maximum; } m_LastDamage = damage; } From?.DoHarmful(m_Mobile, true); if (m_Mobile is IHonorTarget honorTarget) { honorTarget.ReceivedHonorContext?.OnTargetPoisoned(); } AOS.Damage(m_Mobile, From, damage, 0, 0, 0, 100, 0); if (Utility.RandomDouble() >= 0.60) // OSI: randomly revealed between first and third damage tick, guessing 60% chance { m_Mobile.RevealingAction(); } if (m_Index % m_Poison.m_MessageInterval == 0) { m_Mobile.OnPoisoned(From, m_Poison, m_Poison); } }