public override void OnDoubleClick( Mobile from ) { if ( !IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it. } else if ( !from.CanBeginAction( typeof( Bola ) ) ) { from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola! } else if ( from.Target is BolaTarget ) { from.SendLocalizedMessage( 1049631 ); // This bola is already being used. } else if ( from.FindItemOnLayer( Layer.OneHanded ) != null || from.FindItemOnLayer( Layer.TwoHanded ) != null ) { from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this } else if ( from.Mounted ) { from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount } else { from.Target = new BolaTarget( this ); from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...* from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola... } }
public static void TossBola(Mobile from) { if (from == null) { return; } Mobile target = from.Combatant; if (target == null) { return; } else if (!target.Mounted) { return; } from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola... from.Direction = from.GetDirectionTo(target); from.Animate(11, 5, 1, true, false, 0); from.MovingEffect(target, 0x26AC, 10, 0, false, false); IMount mt = target.Mount; if (mt != null) { mt.Rider = null; target.SendLocalizedMessage(1040023); // You have been knocked off of your mount! BaseMount.SetMountPrevention(target, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0)); } }
public override void OnDoubleClick( Mobile from ) { if ( !IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it. } else if ( !from.CanBeginAction( typeof( Bola ) ) ) { from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola! } else if ( from.Target is BolaTarget ) { from.SendLocalizedMessage( 1049631 ); // This bola is already being used. } else if ( !BasePotion.HasFreeHand( from ) ) { from.SendMessage( "You need a free hand to throw this." ); } else if ( from.Mounted ) { from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount } else { EtherealMount.StopMounting( from ); from.Target = new BolaTarget( this ); from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...* from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola... } }
public override void OnDoubleClick( Mobile from ) { if ( !IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it. } else if ( !from.CanBeginAction( typeof( Bola ) ) ) { from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola! } else if ( from.Target is BolaTarget ) { from.SendLocalizedMessage( 1049631 ); // This bola is already being used. } else if ( !HasFreeHands( from ) ) { from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this } else if ( from.Mounted ) { from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount } else if ( Server.Spells.Ninjitsu.AnimalForm.UnderTransformation( from ) ) { from.SendLocalizedMessage( 1070902 ); // You can't use this while in an animal form! } else { EtherealMount.StopMounting( from ); from.Target = new BolaTarget( this ); from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...* from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola... } }
protected override void OnTick() { if ((Core.AOS && m_Poison.Level < 4 && TransformationSpell.UnderTransformation(m_Mobile, typeof(VampiricEmbraceSpell))) || (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile))) { 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; } AOS.Damage(m_Mobile, damage, 0, 0, 0, 100, 0); if ((m_Index % m_Poison.m_MessageInterval) == 0) { m_Mobile.OnPoisoned(m_Mobile, m_Poison, m_Poison); } }
protected override void OnTick() { Interval = m_baseInterval + TimeSpan.FromSeconds(Utility.Random(4)); m_skillLevel -= 50; if (m_Index++ == m_Poison.m_Count || m_skillLevel < 50) { m_Mobile.SendLocalizedMessage(502136); // The poison seems to have worn off. m_Mobile.Poison = null; Stop(); return; } if (m_skillLevel < 800 && m_PLevel == 3) { m_PLevel = 2; m_dmg -= 2; } if (m_skillLevel < 400 && m_PLevel == 2) { m_PLevel = 1; m_dmg -= 2; } if (m_skillLevel < 200 && m_PLevel == 1) { m_PLevel = 0; m_dmg -= 2; } m_LastDamage = m_dmg; if (m_From != null) { m_From.DoHarmful(m_Mobile, true); } AOS.Damage(m_Mobile, m_From, m_dmg, 0, 0, 0, 100, 0); if (0.60 <= Utility.RandomDouble()) // 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.LocalOverheadMessage(MessageType.Regular, 0x21, true, "You feel " + m_messages[m_PLevel]); m_Mobile.NonlocalOverheadMessage(MessageType.Regular, 0x21, true, "looks " + m_messages[m_PLevel]); } m_Mobile.OnPoisoned(m_From, m_Poison, m_Poison); }
protected override void OnTick() { Random dmg = new Random(); this.m_Damage = dmg.Next(25, 33); this.m_Count++; if (this.m_Count > this.m_MaxCount || this.m_Mobile == null) { m_Mobile.SendLocalizedMessage(502136); // The poison seems to have worn off. m_Mobile.Poison = null; this.Stop(); return; } m_Mobile.LocalOverheadMessage( MessageType.Emote, 0x3F, true, "* You feel extremely weak and are in severe pain *"); m_Mobile.NonlocalOverheadMessage( MessageType.Emote, 0x3F, true, String.Format("* {0} is wracked with extreme pain *", m_Mobile.Name)); int toHeal = Math.Min(m_From.HitsMax - m_From.Hits, m_Damage); if (toHeal > 0) { m_From.SendLocalizedMessage(1060203, toHeal.ToString(CultureInfo.InvariantCulture)); // You have had ~1_HEALED_AMOUNT~ hit points of damage healed. m_From.Heal(toHeal, m_Mobile, false); } if (m_Mobile != null) { AOS.Damage(m_Mobile, m_From, m_Damage, 0, 0, 0, 100, 0); } if (0.60 <= Utility.RandomDouble()) // 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(m_From, m_Poison, m_Poison); } }
protected override void OnTick() { Random dmg = new Random(); this.m_Damage = dmg.Next(14, 21); this.m_Count++; if (this.m_Count > this.m_MaxCount || this.m_Mobile == null) { m_Mobile.SendLocalizedMessage(502136); // The poison seems to have worn off. m_Mobile.Poison = null; this.Stop(); return; } m_Mobile.LocalOverheadMessage( MessageType.Emote, 0x3F, true, "* You begin to feel pain throughout your body *"); m_Mobile.NonlocalOverheadMessage( MessageType.Emote, 0x3F, true, String.Format("* {0} stumbles around in confusion and pain *", m_Mobile.Name)); if (m_Mobile != null) { AOS.Damage(m_Mobile, m_From, m_Damage, 0, 0, 0, 100, 0); } if (0.60 <= Utility.RandomDouble()) // 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(m_From, m_Poison, m_Poison); } }
protected override void OnTarget( Mobile from, object targeted ) { if ( m_Thorn.Deleted ) return; if ( !m_Thorn.IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it. return; } if ( !from.CanBeginAction( typeof( GreenThorns ) ) ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061908 ); // * You must wait a while before planting another thorn. * return; } if ( from.Map != Map.Trammel && from.Map != Map.Felucca ) { from.LocalOverheadMessage( MessageType.Regular, 0x2B2, true, "No solen lairs exist on this facet. Try again in Trammel or Felucca." ); return; } LandTarget land = targeted as LandTarget; if ( land == null ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061912 ); // * You cannot plant a green thorn there! * } else { GreenThornsEffect effect = GreenThornsEffect.Create( from, land ); if ( effect == null ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061913 ); // * You sense it would be useless to plant a green thorn there. * } else { m_Thorn.Consume(); from.LocalOverheadMessage( MessageType.Emote, 0x961, 1061914 ); // * You push the strange green thorn into the ground * from.NonlocalOverheadMessage( MessageType.Emote, 0x961, 1061915, from.Name ); // * ~1_PLAYER_NAME~ pushes a strange green thorn into the ground. * from.BeginAction( typeof( GreenThorns ) ); new GreenThorns.EndActionTimer( from ).Start(); effect.Start(); } } }
public override void OnDoubleClick( Mobile from ) { from.RevealingAction(); if ( !Movable ) return; if ( from.InRange( this.GetWorldLocation(), 1 ) ) { from.Target = new ThrowTarget( this ); if ( m_Timer == null ) { from.LocalOverheadMessage( Network.MessageType.Emote, from.SpeechHue, true, "You begin to prepare the Holy Hand Grenade..." ); from.NonlocalOverheadMessage(Network.MessageType.Emote, from.SpeechHue, true, String.Format("{0} begins to prepare a Holy Hand Grenade...", from.Name)); m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.75 ), TimeSpan.FromSeconds( 1.0 ), 5, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, 4 } ); } } else { from.SendLocalizedMessage( 502138 ); } }
protected override void OnTick() { if (CheckResistPoison()) { // Curing this way cause we don't want to trigger the PoisonCured event, // so that the resistance timer is not refreshed. m_Mobile.Poison = null; BuffInfo.RemoveBuff(m_Mobile, BuffIcon.Poison); 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 = 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; } #region Darkglow var poisoner = DarkglowPotion.GetPoisoner(m_Mobile); if (poisoner != null) { int distance = (int)m_Mobile.GetDistanceToSqrt(poisoner.Location); if (distance > 1) { if (distance > 20) { distance = 20; } damage += AOS.Scale(damage, distance * 5); poisoner.SendLocalizedMessage(1072850); // Darkglow poison increases your damage! } } #endregion var honorTarget = m_Mobile as IHonorTarget; if (honorTarget != null && honorTarget.ReceivedHonorContext != null) { honorTarget.ReceivedHonorContext.OnTargetPoisoned(); } AOS.Damage(m_Mobile, damage, 0, 0, 0, 100, 0); if ((m_Index % m_Poison.m_MessageInterval) == 0) { m_Mobile.OnPoisoned(m_Mobile, m_Poison, m_Poison); } #region Parasitic poisoner = ParasiticPotion.GetPoisoner(m_Mobile); if (poisoner != null && m_Mobile.InRange(poisoner.Location, 1)) { int toHeal = Math.Min(damage, poisoner.HitsMax - poisoner.Hits); if (toHeal > 0) { poisoner.SendLocalizedMessage(1060203, toHeal.ToString()); // You have had ~1_HEALED_AMOUNT~ hit points of damage healed. poisoner.Hits += toHeal; } } #endregion }
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.SendAsciiMessage("You feel yourself resisting the effects of the poison"); m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x22, 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(); } AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0); //if (0.60 <= Utility.RandomDouble()) // 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(m_From, m_Poison, m_Poison); } }
public override void OnDoubleClick( Mobile from ) { from.RevealingAction(); if ( !Movable ) return; if ( from.InRange( this.GetWorldLocation(), 1 ) ) { from.Target = new ThrowTarget( this ); if ( m_Timer == null ) { from.LocalOverheadMessage( Network.MessageType.Emote, from.SpeechHue, true, "An ugly smell floats around along with a wierd ticker..." ); from.NonlocalOverheadMessage(Network.MessageType.Emote, from.SpeechHue, true, String.Format("{0} uses the Krofin Bomb...", from.Name)); m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.75 ), TimeSpan.FromSeconds( 1.0 ), 5, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, 4 } ); } } else { from.SendLocalizedMessage( 502138 ); } }
protected override void OnTarget( Mobile from, object targeted ) { from.RevealingAction(); if ( targeted is Mobile ) { if ( targeted is BaseCreature ) { BaseCreature creature = (BaseCreature)targeted; if ( !creature.Tamable ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, "That creature cannot be tamed.", from.NetState ); // That creature cannot be tamed. } else if ( creature.Controlled ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, "That animal looks tame already.", from.NetState ); // That animal looks tame already. } else if ( from.Female && !creature.AllowFemaleTamer ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1049653, from.NetState ); // That creature can only be tamed by males. } else if ( !from.Female && !creature.AllowMaleTamer ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1049652, from.NetState ); // That creature can only be tamed by females. } else if ( from.Followers + creature.ControlSlots > from.FollowersMax ) { from.SendLocalizedMessage( 1049611 ); // You have too many followers to tame that creature. } else if ( creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains( from ) ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, "This animal has had too many owners and is too upset for you to tame.", from.NetState ); // This animal has had too many owners and is too upset for you to tame. } else if ( MustBeSubdued( creature ) ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, "You must subdue this creature before you can tame it!", from.NetState ); // You must subdue this creature before you can tame it! } else if (CheckMastery(from, creature) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill) { FactionWarHorse warHorse = creature as FactionWarHorse; if ( warHorse != null ) { Faction faction = Faction.Find( from ); if ( faction == null || faction != warHorse.Faction ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, "You cannot tame this creature.", from.NetState ); // You cannot tame this creature. return; } } if ( m_BeingTamed.Contains( targeted ) ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, "Someone else is already taming this.", from.NetState ); // Someone else is already taming this. } else if ( creature.CanAngerOnTame && 0.95 >= Utility.RandomDouble() ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, "You seem to anger the beast!", from.NetState ); // You seem to anger the beast! creature.PlaySound( creature.GetAngerSound() ); creature.Direction = creature.GetDirectionTo( from ); creature.Combatant = from; } else { m_BeingTamed[targeted] = from; from.LocalOverheadMessage( MessageType.Emote, 0x59, true, String.Format("*You start to tame {0}.*", creature.Name) ); // You start to tame the creature. from.NonlocalOverheadMessage(MessageType.Emote, 0x59, true, String.Format("*{0} starts to tame {1}*", from.Name, creature.Name)); // *begins taming a creature.* new InternalTimer( from, creature, 3 ).Start(); m_SetSkillTime = false; } } else { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, "You have no chance of taming this creature.", from.NetState ); // You have no chance of taming this creature. } } else { ((Mobile)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, "That being cannot be tamed.", from.NetState ); // That being cannot be tamed. } } else { from.SendAsciiMessage( "You can't tame that!" ); // You can't tame that! } }
public override void OnDoubleClick( Mobile from ) { if ( !IsChildOf( from.Backpack ) ) { from.SendAsciiMessage( "The bola must be in your pack to use it." ); } else if ( !from.CanBeginAction( typeof( Bola ) ) ) { from.SendAsciiMessage( "You have to wait a few moments before you can use another bola!" ); } else if ( from.Target is BolaTarget ) { from.SendAsciiMessage( "This bola is already being used." ); } else if ( !Core.AOS && (from.FindItemOnLayer( Layer.OneHanded ) != null || from.FindItemOnLayer( Layer.TwoHanded ) != null) ) { from.SendAsciiMessage( "Your hands must be free to use this" ); } else if ( from.Mounted ) { from.SendAsciiMessage( "You cannot use this while riding a mount." ); } else { EtherealMount.StopMounting( from ); Item one = from.FindItemOnLayer( Layer.OneHanded ); Item two = from.FindItemOnLayer( Layer.TwoHanded ); if ( one != null ) from.AddToBackpack( one ); if ( two != null ) from.AddToBackpack( two ); from.Target = new BolaTarget( this ); from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...* from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola... } }
public void ApplyShock(Mobile m, int tick) { if (m == null || !m.Alive || this.Deleted) { if (m_DamageTimer != null) m_DamageTimer.Stop(); } else { int damage = (int)(75 / Math.Max(1, tick - 1)) + Utility.RandomMinMax(1, 9); AOS.Damage(m, damage, 0, 0, 0, 0, 100); m.BoltEffect(0); m.FixedParticles(0x3818, 1, 11, 0x13A8, 0, 0, EffectLayer.CenterFeet); m.FixedParticles(0x3818, 1, 11, 0x13A8, 0, 0, EffectLayer.Waist); m.FixedParticles(0x3818, 1, 11, 0x13A8, 0, 0, EffectLayer.Head); m.PlaySound(0x1DC); m.LocalOverheadMessage(Server.Network.MessageType.Regular, 0x21, 1114443); // * Your body convulses from electric shock * m.NonlocalOverheadMessage(Server.Network.MessageType.Regular, 0x21, 1114443, m.Name); // * ~1_NAME~ spasms from electric shock * } }
protected override void OnTick() { if (m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)) { 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 (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; } double Moddamage = damage; if (m_Mobile is BaseCreature) { ((BaseCreature)m_Mobile).CheckSpellImmunity(Server.Spells.SpellDamageType.Posion, (double)damage, out Moddamage); //Console.WriteLine("Old Damage {0}, new Damage {1}",damage,Moddamage); } AOS.Damage(m_Mobile, (int)Moddamage, 0, 0, 0, 100, 0); if ((m_Index % m_Poison.m_MessageInterval) == 0) { m_Mobile.OnPoisoned(m_Mobile, m_Poison, m_Poison); } }
protected override void OnTick() { if (Core.UOR && m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile)) { 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 (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; } // Note: Poison has no damage source after initial application pre AOS IHonorTarget honorTarget = m_Mobile as IHonorTarget; if (honorTarget != null && honorTarget.ReceivedHonorContext != null) { honorTarget.ReceivedHonorContext.OnTargetPoisoned(); } AOS.Damage(m_Mobile, damage, 0, 0, 0, 100, 0); if ((m_Index % m_Poison.m_MessageInterval) == 0) { m_Mobile.OnPoisoned(m_Mobile, 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, 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(); } // Genova: suporte ao UO:ML. #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); } }
public override void OnHit( Mobile attacker, Mobile defender ) { if ( !( attacker.Weapon is BaseSword || attacker.Weapon is BaseKnife || attacker.Weapon is BaseAxe || attacker.Weapon is BasePoleArm || attacker.Weapon is BaseSpear ) ) attacker.SendMessage( "This attack cannot be used with that weapon." ); if ( (defender is BaseCreature && ((BaseCreature)defender).BleedImmune) ) { attacker.SendLocalizedMessage( 1062052 ); // Your target is not affected by the bleed attack! return; } attacker.SendLocalizedMessage( 1060159 ); // Your target is bleeding! defender.SendLocalizedMessage( 1060160 ); // You are bleeding! if ( defender is PlayerMobile ) { defender.LocalOverheadMessage( MessageType.Regular, 0x21, 1060757 ); // You are bleeding profusely defender.NonlocalOverheadMessage( MessageType.Regular, 0x21, 1060758, defender.Name ); // ~1_NAME~ is bleeding profusely } defender.PlaySound( 0x133 ); defender.FixedParticles( 0x377A, 244, 25, 9950, 31, 0, EffectLayer.Waist ); BeginBleed( defender, attacker ); }
protected override void OnTick() { #region Mondain's Legacy 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))) { 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; } } #endregion 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 (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! Stop(); new DarkglowTimer(m_Mobile, m_From, m_Poison, m_Index).Start(); } 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 { Stop(); new ParasiticTimer(m_Mobile, m_From, m_Poison, m_Index).Start(); } } #endregion AOS.Damage(m_Mobile, m_From, damage, 0, 0, 0, 100, 0); if (0.60 <= Utility.RandomDouble()) // 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(m_From, m_Poison, m_Poison); } }
public void OnDeath( Mobile mob, Container corpse ) { if ( !m_Registered || !m_Started ) return; DuelPlayer pl = Find( mob ); if ( pl != null && !pl.Eliminated ) { if ( m_EventGame != null && !m_EventGame.OnDeath( mob, corpse ) ) return; pl.Eliminated = true; if ( mob.Poison != null ) mob.Poison = null; Requip( mob, corpse ); DelayBounce( TimeSpan.FromSeconds( 4.0 ), mob, corpse ); Participant winner = CheckCompletion(); if ( winner != null ) { Finish( winner ); } else if ( !m_Yielding ) { mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have been defeated." ); mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has been defeated.", mob.Name ) ); } } }
protected override void OnTick() { if (m_Mobile is NubiaPlayer) { if (((NubiaPlayer)m_Mobile).hasDon(DonEnum.CorpDiamant)) { m_Mobile.LocalOverheadMessage(MessageType.Emote, 0x3F, true, "* Votre corps est imunisé contre le poison *"); m_Mobile.NonlocalOverheadMessage(MessageType.Emote, 0x3F, true, String.Format("* {0} ne semble pas affecté par le poison *", m_Mobile.Name)); Stop(); return; } } 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(); } 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); } }
public void OnLocationChanged( Mobile mob ) { if ( !m_Registered || !m_StartedBeginCountdown || m_Finished ) return; Arena arena = m_Arena; if ( arena == null ) return; if ( mob.Map == arena.Facet && arena.Bounds.Contains( mob.Location ) ) return; DuelPlayer pl = Find( mob ); if ( pl == null || pl.Eliminated ) return; if ( mob.Map == Map.Internal ) { // they've logged out if ( mob.LogoutMap == arena.Facet && arena.Bounds.Contains( mob.LogoutLocation ) ) { // they logged out inside the arena.. set them to eject on login mob.LogoutLocation = arena.Outside; } } pl.Eliminated = true; mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have forfeited your position in the duel." ); mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has forfeited by leaving the dueling arena.", mob.Name ) ); Participant winner = CheckCompletion(); if ( winner != null ) Finish( winner ); }
public override void OnDoubleClick( Mobile from ) { if ( !IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it. } else if ( !from.CanBeginAction( typeof( Bola ) ) ) { from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola! } else if ( from.Target is BolaTarget ) { from.SendLocalizedMessage( 1049631 ); // This bola is already being used. } else if ( !Core.AOS && (from.FindItemOnLayer( Layer.OneHanded ) != null || from.FindItemOnLayer( Layer.TwoHanded ) != null) ) { from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this } else if ( from.Mounted ) { from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount } else if ( Server.Spells.ExoticWeaponry.AnimalForm.UnderTransformation( from ) ) { from.SendLocalizedMessage( 1070902 ); // You can't use this while in an animal form! } else { //EtherealMount.StopMounting( from ); Item one = from.FindItemOnLayer( Layer.OneHanded ); Item two = from.FindItemOnLayer( Layer.TwoHanded ); if ( one != null ) from.AddToBackpack( one ); if ( two != null ) from.AddToBackpack( two ); from.Target = new BolaTarget( this ); from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...* from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola... } }
public static void TossBola(Mobile from) { if (from == null) return; var target = from.Combatant; if (target == null) return; if (!target.Mounted) return; from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola... from.Direction = from.GetDirectionTo(target); from.Animate(11, 5, 1, true, false, 0); from.MovingEffect(target, 0x26AC, 10, 0, false, false); var mt = target.Mount; if (mt != null) { mt.Rider = null; target.SendLocalizedMessage(1040023); // You have been knocked off of your mount! BaseMount.SetMountPrevention(target, BlockMountType.Dazed, TimeSpan.FromSeconds(3.0)); } }
protected override void OnTick() { if ((m_Poison.Level < 3 && OrangePetals.UnderEffect(m_Mobile))) { 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; } if (Interval == m_Poison.m_Delay) { Interval = m_Poison.m_Interval; } else //if ( Delay == m_Poison.m_Interval ) { Interval = m_Poison.m_Delay; } int damage; if (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); } if (XmlScript.HasTrigger(m_Mobile, TriggerName.onPoisonTick) && UberScriptTriggers.Trigger(m_Mobile, m_From, TriggerName.onPoisonTick, null, null, null, damage)) { return; } m_Mobile.Damage(damage, m_From); //if ( Utility.RandomBool() ) // 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(m_From, m_Poison, m_Poison); } }
protected override void OnTarget( Mobile from, object targeted ) { from.RevealingAction(); if ( targeted is Mobile ) { if ( targeted is BaseCreature ) { BaseCreature creature = (BaseCreature)targeted; if ( !creature.Tamable ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1049655, from.NetState ); // That creature cannot be tamed. } else if ( creature.Controlled ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502804, from.NetState ); // That animal looks tame already. } else if ( from.Female && !creature.AllowFemaleTamer ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1049653, from.NetState ); // That creature can only be tamed by males. } else if ( !from.Female && !creature.AllowMaleTamer ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1049652, from.NetState ); // That creature can only be tamed by females. } else if ( creature is CuSidhe && from.Race != Race.Elf ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502801, from.NetState ); // You can't tame that! } else if ( from.Followers + creature.ControlSlots > from.FollowersMax ) { from.SendLocalizedMessage( 1049611 ); // You have too many followers to tame that creature. } else if ( creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains( from ) ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1005615, from.NetState ); // This animal has had too many owners and is too upset for you to tame. } else if ( MustBeSubdued( creature ) ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1054025, from.NetState ); // You must subdue this creature before you can tame it! } else if ( CheckMastery( from, creature ) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill ) { FactionWarHorse warHorse = creature as FactionWarHorse; if ( warHorse != null ) { Faction faction = Faction.Find( from ); if ( faction == null || faction != warHorse.Faction ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1042590, from.NetState ); // You cannot tame this creature. return; } } if ( m_BeingTamed.Contains( targeted ) ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502802, from.NetState ); // Someone else is already taming this. } else if ( creature.CanAngerOnTame && 0.95 >= Utility.RandomDouble() ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502805, from.NetState ); // You seem to anger the beast! creature.PlaySound( creature.GetAngerSound() ); creature.Direction = creature.GetDirectionTo( from ); if( creature.BardPacified && Utility.RandomDouble() > .24) { Timer.DelayCall( TimeSpan.FromSeconds( 2.0 ), new TimerStateCallback( ResetPacify ), creature ); } else { creature.BardEndTime = DateTime.Now; } creature.BardPacified = false; creature.Move( creature.Direction ); if ( from is PlayerMobile && !(( (PlayerMobile)from ).HonorActive )) creature.Combatant = from; } else { m_BeingTamed[targeted] = from; from.LocalOverheadMessage( MessageType.Emote, 0x59, 1010597 ); // You start to tame the creature. from.NonlocalOverheadMessage( MessageType.Emote, 0x59, 1010598 ); // *begins taming a creature.* new InternalTimer( from, creature, Utility.Random( 3, 2 ) ).Start(); m_SetSkillTime = false; } } else { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502806, from.NetState ); // You have no chance of taming this creature. } } else { ((Mobile)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502469, from.NetState ); // That being cannot be tamed. } } else { from.SendLocalizedMessage( 502801 ); // You can't tame that! } }
protected override void OnTarget( Mobile from, object targeted ) { from.RevealingAction(); if ( targeted is Mobile ) { if ( targeted is BaseCreature ) { BaseCreature creature = (BaseCreature)targeted; if( from is PlayerMobile && !Server.Misc.BreedingSystem.Utilities.RaciallyCompatible( (PlayerMobile)from, creature ) ) return; if( creature is SkullcrusherOgre && (creature.Hue != 0 || creature.Name.ToLower() != "a skullcrusher ogre") ) { from.SendMessage( "That creature cannot be tamed." ); return; } if ( !creature.Tamable ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1049655, from.NetState ); // That creature cannot be tamed. } else if ( creature.Controlled ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502804, from.NetState ); // That animal looks tame already. } else if ( from.Female && !creature.AllowFemaleTamer ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1049653, from.NetState ); // That creature can only be tamed by males. } else if ( !from.Female && !creature.AllowMaleTamer ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1049652, from.NetState ); // That creature can only be tamed by females. } else if ( from.Followers + creature.ControlSlots > from.FollowersMax ) { from.SendLocalizedMessage( 1049611 ); // You have too many followers to tame that creature. } else if ( creature.Owners.Count >= BaseCreature.MaxOwners && !creature.Owners.Contains( from ) ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1005615, from.NetState ); // This animal has had too many owners and is too upset for you to tame. } else if ( MustBeSubdued( creature ) ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1054025, from.NetState ); // You must subdue this creature before you can tame it! } else if ( CheckMastery( from, creature ) || from.Skills[SkillName.AnimalTaming].Value >= creature.MinTameSkill ) { FactionWarHorse warHorse = creature as FactionWarHorse; if ( warHorse != null ) { Faction faction = Faction.Find( from ); if ( faction == null || faction != warHorse.Faction ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1042590, from.NetState ); // You cannot tame this creature. return; } } if ( m_BeingTamed.Contains( targeted ) ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502802, from.NetState ); // Someone else is already taming this. } else if ( creature.CanAngerOnTame && 0.95 >= Utility.RandomDouble() ) { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502805, from.NetState ); // You seem to anger the beast! creature.PlaySound( creature.GetAngerSound() ); creature.Direction = creature.GetDirectionTo( from ); creature.Combatant = from; } else { m_BeingTamed[targeted] = from; from.LocalOverheadMessage( MessageType.Emote, 0x59, 1010597 ); // You start to tame the creature. from.NonlocalOverheadMessage( MessageType.Emote, 0x59, 1010598 ); // *begins taming a creature.* new InternalTimer( from, creature, Utility.Random( 3, 2 ) ).Start(); m_SetSkillTime = false; } } else { creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502806, from.NetState ); // You have no chance of taming this creature. } } else { ((Mobile)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502469, from.NetState ); // That being cannot be tamed. } } else { from.SendLocalizedMessage( 502801 ); // You can't tame that! } }
private void DoDestroyEquipment( Mobile target ) { if ( target.AccessLevel == AccessLevel.Player && InRange( target, 1 ) && 0.25 > Utility.RandomDouble() ) //15% chance { List<Item> items = new List<Item>(); for ( int i = 0; i < target.Items.Count; i++ ) { Item item = target.Items[i]; if ( item is IDurability && !item.Deleted && ((IDurability)item).MaxHitPoints > 0 && item.LootType != LootType.Blessed && item.BlessedFor == null && !(Mobile.InsuranceEnabled && item.Insured) ) items.Add( item ); } if ( items.Count > 0 ) { Item toDestroy = items[Utility.Random( items.Count )]; string name = toDestroy.Name; if ( String.IsNullOrEmpty( name ) ) name = toDestroy.ItemData.Name; toDestroy.Delete(); target.NonlocalOverheadMessage( MessageType.Regular, 0x3B2, 1080034, name ); // Their ~1_NAME~ is destroyed by the attack. target.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1080035, name ); // Your ~1_NAME~ is destroyed by the attack. } } }
public bool TryArrest(Mobile m) { if (ControlMaster != null) { m.SendLocalizedMessage(1152247); // That person is already under arrest. } else if (m is PlayerMobile && ((PlayerMobile)m).AllFollowers.FirstOrDefault(mob => mob is Raider) != null) { m.SendLocalizedMessage(1152249); // You already have a prisoner. } else if (Hits > ((double)HitsMax / 10)) { m.SendLocalizedMessage(1152229); // That person won't sit still for it! A more aggressive approach is in order. m.NonlocalOverheadMessage(MessageType.Regular, 0x3B2, 1152237, String.Format("{0}\t{1}", m.Name, this.Name, "raider")); } else { DeleteTime = DateTime.UtcNow + TimeSpan.FromHours(1); SetControlMaster(m); IsBonded = false; ControlTarget = m; ControlOrder = OrderType.Follow; m.SendLocalizedMessage(1152236, this.Name); // You arrest the ~1_name~. Take the criminal to the guard captain. m.NonlocalOverheadMessage(MessageType.Regular, 0x3B2, 1152238, String.Format("{0}\t{1}", m.Name, this.Name)); return true; } return false; }
public void DoDamage( Mobile to ) { to.Send( new UnicodeMessage( Serial, ItemID, MessageType.Regular, 0x3B2, 3, "", "", "The generator shoots an arc of electricity at you!" ) ); to.BoltEffect( 0 ); to.LocalOverheadMessage( MessageType.Regular, 0xC9, true, "* Your body convulses from electric shock *" ); to.NonlocalOverheadMessage( MessageType.Regular, 0xC9, true, string.Format( "* {0} spasms from electric shock *", to.Name ) ); AOS.Damage( to, to, 60, 0, 0, 0, 0, 100, 0, 0, 0 ); if ( !to.Alive ) return; if ( m_DamageTable[to] == null ) { to.Frozen = true; DamageTimer timer = new DamageTimer( this, to ); m_DamageTable[to] = timer; timer.Start(); } }
protected override void OnTick() { bool usingPetals = OrangePetals.UnderEffect(m_Mobile); if (Core.SA && 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 ((Core.AOS && 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; 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); } }
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 ); }
public override void OnSingleClick( Mobile from ) { if ( IsLockedDown && Utility.InRange( from.Location, this.Location, 1 )) { if ( 25 > Utility.Random( 100 ) ) { Effects.PlaySound( this.Location, this.Map, 221 ); from.LocalOverheadMessage( Network.MessageType.Emote, from.SpeechHue, true, "*You are bitten by the worm!*" ); from.NonlocalOverheadMessage( Network.MessageType.Emote, from.SpeechHue, true, String.Format( "*{0} is bitten by the worm!*", from.Name ) ); from.Poison = Poison.Deadly; } } base.OnSingleClick(from); }