public override void OnDoubleClick( Mobile from ) { if ( IsChildOf( from.Backpack ) ) { if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) ) { from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed. } else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) ) { from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed. } else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask ) { from.SendLocalizedMessage( 501605 ); // You are already disguised. } else { from.BodyMod = ( from.Female ? 184 : 183 ); from.HueMod = 0; if ( from is PlayerMobile ) ((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays( 7.0 ); from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth. Consume(); } } else { from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } }
public override void OnDoubleClick( Mobile from ) { if ( IsChildOf( from.Backpack ) ) { if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) ) from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed. else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) ) from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed. else if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from ) ) from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed. else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask ) from.SendLocalizedMessage( 501605 ); // You are already disguised. else { /* TODO: Desde el Publish 37 OSI no modifica el body del personaje al * usar la TribalPaint, para que los elfos se sigan viendo con body * de elfo. No obstante, no podemos eliminar esto ya que RunUO basa * todo el código del efecto en si el personaje tiene este body o no. */ from.BodyMod = ( from.Female ? 184 : 183 ); from.HueMod = 0; if ( from is PlayerMobile ) ( (PlayerMobile) from ).SavagePaintExpiration = TimeSpan.FromDays( 7.0 ); from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth. Consume(); } } else { from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } }
public void Polymorph( Mobile m ) { if ( !m.CanBeginAction( typeof( PolymorphSpell ) ) || !m.CanBeginAction( typeof( IncognitoSpell ) ) || m.IsBodyMod ) return; IMount mount = m.Mount; if ( mount != null ) mount.Rider = null; if ( m.Mounted ) return; if ( m.BeginAction( typeof( PolymorphSpell ) ) ) { Item disarm = m.FindItemOnLayer( Layer.OneHanded ); if ( disarm != null && disarm.Movable ) m.AddToBackpack( disarm ); disarm = m.FindItemOnLayer( Layer.TwoHanded ); if ( disarm != null && disarm.Movable ) m.AddToBackpack( disarm ); m.BodyMod = 42; m.HueMod = 0; new ExpirePolymorphTimer( m ).Start(); } }
public bool ValidateUse( Mobile from ) { PlayerMobile pm = from as PlayerMobile; if ( !IsChildOf( from.Backpack ) ) { // That must be in your pack for you to use it. from.SendLocalizedMessage( 1042001 ); } else if ( pm == null || pm.NpcGuild != NpcGuild.ThievesGuild ) { // Only Members of the thieves guild are trained to use this item. from.SendLocalizedMessage( 501702 ); } else if ( Stealing.SuspendOnMurder && pm.Kills > 0 ) { // You are currently suspended from the thieves guild. They would frown upon your actions. from.SendLocalizedMessage( 501703 ); } else if ( !from.CanBeginAction( typeof( IncognitoSpell ) ) ) { // You cannot disguise yourself while incognitoed. from.SendLocalizedMessage( 501704 ); } else if ( Factions.Sigil.ExistsOn( from ) ) { from.SendLocalizedMessage( 1010465 ); // You cannot disguise yourself while holding a sigil } else if ( TransformationSpellHelper.UnderTransformation( from ) ) { // You cannot disguise yourself while in that form. from.SendLocalizedMessage( 1061634 ); } else if ( from.BodyMod == 183 || from.BodyMod == 184 ) { // You cannot disguise yourself while wearing body paint from.SendLocalizedMessage( 1040002 ); } else if ( !from.CanBeginAction( typeof( PolymorphSpell ) ) || from.IsBodyMod ) { // You cannot disguise yourself while polymorphed. from.SendLocalizedMessage( 501705 ); } else { return true; } return false; }
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... } }
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 Nullify(Mobile from) { if (!from.CanBeginAction(typeof(DefensiveSpell))) { new InternalTimer(from).Start(); } }
private bool CheckUse( Mobile from ) { if ( !this.IsAccessibleTo( from ) ) return false; if ( from.Map != this.Map || !from.InRange( GetWorldLocation(), 2 ) ) { from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that. return false; } if ( !from.CanBeginAction( typeof( FireHorn ) ) ) { from.SendLocalizedMessage( 1049615 ); // You must take a moment to catch your breath. return false; } int sulfAsh = Core.AOS ? 4 : 15; if ( from.Backpack == null || from.Backpack.GetAmount( typeof( SulfurousAsh ) ) < sulfAsh ) { from.SendLocalizedMessage( 1049617 ); // You do not have enough sulfurous ash. return false; } return true; }
public override void OnMovement( Mobile m, Point3D oldLocation ) { base.OnMovement( m, oldLocation ); Tournament tourny = null; if ( m_Tournament != null ) tourny = m_Tournament.Tournament; if ( InRange( m, 4 ) && !InRange( oldLocation, 4 ) && tourny != null && tourny.Stage == TournamentStage.Signup && m.CanBeginAction( this ) ) { Ladder ladder = Ladder.Instance; if ( ladder != null ) { LadderEntry entry = ladder.Find( m ); if ( entry != null && Ladder.GetLevel( entry.Experience ) < tourny.LevelRequirement ) return; } if ( tourny.HasParticipant( m ) ) return; PrivateOverheadMessage( MessageType.Regular, 0x35, false, String.Format( "Hello m'{0}. Dost thou wish to enter this tournament? You need only to write your name in this book.", m.Female ? "Lady" : "Lord" ), m.NetState ); m.BeginAction( this ); Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerStateCallback( ReleaseLock_Callback ), m ); } }
public override void OnDoubleClick( Mobile from ) { if ( IsChildOf( from.Backpack ) ) { if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) ) { //from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed. from.SendMessage( "You decide against eating it while incognitoed " ); } else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) ) { //from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed. from.SendMessage( "You can not be polymorphed at this time" ); } else if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from ) ) { //from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed. from.SendMessage( "You decide against eating it while polymorphed" ); } else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask || from.FindItemOnLayer( Layer.Helm ) is OrcishKinRPMask ) { //from.SendLocalizedMessage( 501605 ); // You are already disguised. from.SendMessage( "You decide against eating it while as your disguised" ); } else { from.BodyMod = ( from.Female ? 186 : 185 ); from.HueMod = 0; if ( from is PlayerMobile ) ((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays( 7.0 ); //from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth. from.SendMessage( "You now bear the markings of the undead pirates. This will last about a week" ); from.PlaySound( Utility.Random( 0x3A, 3 ) ); if ( from.Body.IsHuman && !from.Mounted ) from.Animate( 34, 5, 1, true, false, 0 ); from.ApplyPoison( from, Poison.Lethal ); Consume(); } } else { from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } }
public override void OnDoubleClick( Mobile from ) { if ( IsChildOf( from.Backpack ) ) { if ( Factions.Sigil.ExistsOn( from ) ) { from.SendLocalizedMessage( 1010465 ); // You cannot disguise yourself while holding a sigil. } else if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) ) { from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed. } else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) ) { from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed. } else if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from ) ) { from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed. } else if ( Spells.Ninjitsu.AnimalForm.UnderTransformation( from ) ) { from.SendLocalizedMessage( 1061634 ); // You cannot disguise yourself while in that form. } else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask ) { from.SendLocalizedMessage( 501605 ); // You are already disguised. } else { from.BodyMod = ( from.Female ? 184 : 183 ); from.HueMod = this.Hue; if ( from is PlayerMobile ) ((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays( 7.0 ); from.SendMessage( "You now paint your body. Your body paint will last about a week or you can remove it with an oil cloth."); Consume(); } } else { from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } }
public static double GetScalar( Mobile m ) { double val = 1.0; if ( m.CanBeginAction( typeof( RangerHuntersAimSpell ) ) ) val = 1.5; return val; }
public override void OnDoubleClick(Mobile from) { if (IsChildOf(from.Backpack)) { if (Factions.Sigil.ExistsOn(from)) { from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil. } else if (!from.CanBeginAction(typeof(Spells.Fifth.IncognitoSpell))) { from.SendLocalizedMessage(501698); // You cannot disguise yourself while incognitoed. } else if (!from.CanBeginAction(typeof(Spells.Seventh.PolymorphSpell))) { from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed. } else if (TransformationSpellHelper.UnderTransformation(from)) { from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed. } else if (from.IsBodyMod || from.FindItemOnLayer(Layer.Helm) is OrcishKinMask) { from.SendLocalizedMessage(501605); // You are already disguised. } else { from.BodyMod = (from.Female ? 184 : 183); from.HueMod = 400; if (from is PlayerMobile) ((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays(2.0); from.SendMessage("You now bear the markings of a Blackthorn Coven member. This will wear off in 2 days."); Consume(); } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } }
public static TimeSpan OnUse( Mobile m ) { if ( !m.Hidden ) { m.SendLocalizedMessage( 502725 ); // You must hide first } else if ( m.Skills[SkillName.Hiding].Base < 30.0 ) { m.SendLocalizedMessage( 502726 ); // You are not hidden well enough. Become better at hiding. m.RevealingAction(); } else if ( !m.CanBeginAction( typeof( Stealth ) ) ) { m.SendLocalizedMessage( 1063086 ); // You cannot use this skill right now. m.RevealingAction(); } else if ( m.Flying ) { m.SendLocalizedMessage( 1113415 ); // You cannot use this ability while flying. m.RevealingAction(); } else { int armorRating = GetArmorRating( m ); if ( armorRating >= 42 ) // I have a hunch '42' was chosen cause someone's a fan of DNA { m.SendLocalizedMessage( 502727 ); // You could not hope to move quietly wearing this much armor. m.RevealingAction(); } else if ( m.CheckSkill( SkillName.Stealth, -20.0 + ( armorRating * 2 ), 60.0 + ( armorRating * 2 ) ) ) { int steps = (int) ( m.Skills[SkillName.Stealth].Value / 5.0 ); if ( steps < 1 ) steps = 1; m.AllowedStealthSteps = steps; m.IsStealthing = true; m.SendLocalizedMessage( 502730 ); // You begin to move quietly. return TimeSpan.FromSeconds( 10.0 ); } else { m.SendLocalizedMessage( 502731 ); // You fail in your attempt to move unnoticed. m.RevealingAction(); } } return TimeSpan.FromSeconds( 10.0 ); }
public override void OnDoubleClick( Mobile from ) { if ( !from.CanBeginAction( typeof( SnakeCharmerFlute ) ) ) { from.SendLocalizedMessage( 1072306 ); // You must wait a moment for it to recharge. } else { from.SendLocalizedMessage( 1112175 ); // Target the serpent you wish to entice. from.Target = new CharmTarget( this ); } }
public override void OnDoubleClick( Mobile from ) { if ( IsChildOf( from.Backpack ) ) { if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) ) from.SendMessage( "You decide against eating it while in incognito." ); else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) ) from.SendMessage( "You can not be polymorphed at this time." ); //else if ( TransformationSpellHelper.UnderTransformation( Caster, typeof( WraithFormSpell ) ) ) // from.SendMessage( "You decide against eating it while polymorphed." ); else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask ) from.SendMessage( "You decide against eating it while in your disguise." ); else { if ( from is PlayerMobile ) { PlayerMobile pm = from as PlayerMobile; if ( pm.SavagePaintExpiration > TimeSpan.Zero ) from.SendMessage( "You already have the markings of another tribe." ); else { from.BodyMod = ( from.Female ? 186 : 185 ); from.HueMod = 0; pm.SavagePaintExpiration = TimeSpan.FromDays( 7.0 ); //from.SendLocalizedMessage( 1042537 ); // You now bear the markings of the savage tribe. Your body paint will last about a week or you can remove it with an oil cloth. from.SendMessage( "You now bear the markings of the undead pirates. This will last about a week." ); from.PlaySound( Utility.Random( 0x3A, 3 ) ); if ( from.Body.IsHuman && !from.Mounted ) from.Animate( 34, 5, 1, true, false, 0 ); from.ApplyPoison( from, Poison.Greater ); Consume(); } } } } else from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. }
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 ) { if ( from.CanBeginAction( this ) ) { from.BeginAction( this ); Timer.DelayCall<Mobile>( m_ShoutCooldown, EndLock, from ); } MLQuestSystem.TurnToFace( this, from ); from.SendGump( m_Gump ); // Paperdoll doesn't open //base.OnDoubleClick( from ); }
public override void OnDoubleClick( Mobile from ) { if ( !IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 1042010 ); // You must have the object in your backpack to use it. } else if ( from.CanBeginAction( typeof( SnowPile ) ) ) { from.SendLocalizedMessage( 1005575 ); // You carefully pack the snow into a ball... from.Target = new SnowTarget( from, this ); } else { from.SendLocalizedMessage( 1005574 ); // The snow is not ready to be packed yet. Keep trying. } }
public override void OnDoubleClick( Mobile from ) { if ( !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; } from.Target = new InternalTarget( this ); from.SendLocalizedMessage( 1061906 ); // Choose a spot to plant the thorn. }
public override void OnDoubleClick( Mobile from ) { if ( !from.CanBeginAction( typeof( TeleportRing ) ) ) return; if ( !Multis.DesignContext.Check( from ) ) return; if ( !IsChildOf( from.Backpack ) && this != from.FindItemOnLayer( Layer.Ring ) ) { from.SendMessage( "That must be either worn or in your pack to use it." ); return; } if ( Charges == 0 ) { from.SendLocalizedMessage( 1019073 ); // This item is out of charges. return; } from.Target = new InternalTarget( this ); }
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 override void ApplyEffect( Mobile to, Mobile source, int intensity, Item itemSource ) { if ( source != to && intensity < 0 ) source.DoHarmful( to ); if ( intensity > 0 ) { if ( to.CanBeginAction( typeof( StaminaRegenerationEffect ) ) ) { to.BeginAction( typeof( StaminaRegenerationEffect ) ); Timer.DelayCall( TimeSpan.FromSeconds( 20 ), new TimerStateCallback( ReleaseStamRegenLock ), to ); // 20 sec delay } else return; } BeginRegenerating( to, intensity, source ); }
public override void ApplyEffect( Mobile to, Mobile source, int intensity, Item itemSource ) { if ( intensity > 0 ) { if ( to.CanBeginAction( typeof( StaminaRestorationEffect ) ) && to.Stam < to.StamMax ) { to.Stam += BasePotion.Scale( to, (int)(intensity * Divisor) ); to.BeginAction( typeof( StaminaRestorationEffect ) ); Timer.DelayCall( TimeSpan.FromSeconds( 10 ), new TimerStateCallback( ReleaseStamLock ), to ); // 10 sec delay } } else { to.Stam -= BasePotion.Scale( to, (int)(-1 * intensity * Divisor) ); if ( source != to ) // if it was thrown or something source.DoHarmful( to ); } }
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 override void Drink( Mobile from ) { if(!from.CanBeginAction(typeof(BaseExplosionPotion))) //Checking the block { from.SendMessage("You should wait before reusing this potion"); return; } if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) ) { from.SendLocalizedMessage( 1062725 ); // You can not use a purple potion while paralyzed. return; } ThrowTarget targ = from.Target as ThrowTarget; this.Stackable = false; // Scavenged explosion potions won't stack with those ones in backpack, and still will explode. if ( targ != null && targ.Potion == this ) return; from.RevealingAction(); if ( m_Users == null ) m_Users = new List<Mobile>(); if ( !m_Users.Contains( from ) ) m_Users.Add( from ); from.Target = new ThrowTarget( this ); if ( m_Timer == null ) { from.SendLocalizedMessage( 500236 ); // You should throw it now! if( Core.ML ) m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.25 ), 5, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, 3 } ); // 3.6 seconds explosion delay else m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.75 ), TimeSpan.FromSeconds( 1.0 ), 5, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, Utility.RandomMinMax(3, 4) } ); // 2.6 seconds explosion delay } }
public override void OnDoubleClick( Mobile from ) { if ( !IsChildOf( from.Backpack ) ) { from.SendMessage( "This Must be in your Pack to use" ); // The bola must be in your pack to use it. } else if ( !from.CanBeginAction( typeof( NecroCrystal ) ) ) { from.SendMessage( "You must wait a few moments" ); // You have to wait a few moments before you can use another bola! } else if ( from.Target is CrystalTarget ) { from.SendMessage( "This is already being used" ); // This bola is already being used. } else if ( from.FindItemOnLayer( Layer.OneHanded ) != null || from.FindItemOnLayer( Layer.TwoHanded ) != null ) { from.SendMessage( "Your hands must be free!" ); // Your hands must be free to use this } else { from.Target = new CrystalTarget( this ); from.SendMessage( "You Focus your energy on the necromatic crystal" ); // * You begin to swing the bola...* } }
public static int MobileNotoriety( Mobile source, Mobile target ) { if( Core.AOS && (target.Blessed || (target is BaseVendor && ((BaseVendor)target).IsInvulnerable) || target is PlayerVendor || target is TownCrier) ) return Notoriety.Invulnerable; if( target.AccessLevel > AccessLevel.Player ) return Notoriety.CanBeAttacked; if( source.Player && !target.Player && source is PlayerMobile && target is BaseCreature ) { BaseCreature bc = (BaseCreature)target; Mobile master = bc.GetMaster(); if ( master != null && master.AccessLevel > AccessLevel.Player ) return Notoriety.CanBeAttacked; master = bc.ControlMaster; if ( Core.ML && master != null ) { if ( ( source == master && CheckAggressor( target.Aggressors, source ) ) || ( CheckAggressor( source.Aggressors, bc ) ) ) return Notoriety.CanBeAttacked; else if (bc is BaseEscortable || bc is BaseEscort) return Notoriety.Innocent; else return MobileNotoriety( source, master ); } if( !bc.Summoned && !bc.Controlled && ((PlayerMobile)source).EnemyOfOneType == target.GetType() ) return Notoriety.Enemy; } if ( target.Kills >= 5 || ( target.Body.IsMonster && IsSummoned( target as BaseCreature ) && !( target is BaseFamiliar ) && !( target is ArcaneFey ) && !( target is Golem ) ) || ( target is BaseCreature && ( ( (BaseCreature)target ).AlwaysMurderer || ( (BaseCreature)target ).IsAnimatedDead ) ) ) return Notoriety.Murderer; #region Mondain's Legacy if ( target is Gregorio ) { Gregorio gregorio = (Gregorio) target; if ( Gregorio.IsMurderer( source ) ) return Notoriety.Murderer; return Notoriety.Innocent; } else if ( source.Player && target is Engines.Quests.BaseEscort ) return Notoriety.Innocent; #endregion if( target.Criminal ) return Notoriety.Criminal; Guild sourceGuild = GetGuildFor( source.Guild as Guild, source ); Guild targetGuild = GetGuildFor( target.Guild as Guild, target ); if( sourceGuild != null && targetGuild != null ) { if( sourceGuild == targetGuild || sourceGuild.IsAlly( targetGuild ) ) return Notoriety.Ally; else if( sourceGuild.IsEnemy( targetGuild ) ) return Notoriety.Enemy; } Faction srcFaction = Faction.Find( source, true, true ); Faction trgFaction = Faction.Find( target, true, true ); if( srcFaction != null && trgFaction != null && srcFaction != trgFaction && source.Map == Faction.Facet ) return Notoriety.Enemy; if( SkillHandlers.Stealing.ClassicMode && target is PlayerMobile && ((PlayerMobile)target).PermaFlags.Contains( source ) ) return Notoriety.CanBeAttacked; if( target is BaseCreature && ((BaseCreature)target).AlwaysAttackable ) return Notoriety.CanBeAttacked; if( CheckHouseFlag( source, target, target.Location, target.Map ) ) return Notoriety.CanBeAttacked; if( !(target is BaseCreature && ((BaseCreature)target).InitialInnocent) ) //If Target is NOT A baseCreature, OR it's a BC and the BC is initial innocent... { if( !target.Body.IsHuman && !target.Body.IsGhost && !IsPet( target as BaseCreature ) && !(target is PlayerMobile) || !Core.ML && !target.CanBeginAction( typeof( Server.Spells.Seventh.PolymorphSpell ) ) ) return Notoriety.CanBeAttacked; } if( CheckAggressor( source.Aggressors, target ) ) return Notoriety.CanBeAttacked; if( CheckAggressed( source.Aggressed, target ) ) return Notoriety.CanBeAttacked; if( target is BaseCreature ) { BaseCreature bc = (BaseCreature)target; if( bc.Controlled && bc.ControlOrder == OrderType.Guard && bc.ControlTarget == source ) return Notoriety.CanBeAttacked; } if( source is BaseCreature ) { BaseCreature bc = (BaseCreature)source; Mobile master = bc.GetMaster(); if( master != null ) if( CheckAggressor( master.Aggressors, target ) || MobileNotoriety( master, target ) == Notoriety.CanBeAttacked ) return Notoriety.CanBeAttacked; } return Notoriety.Innocent; }
public static bool Check( Mobile m ) { if ( !m.Alive ) m.SendLocalizedMessage( 1073646 ); // Only the living may proceed... else if ( m.Mounted ) m.SendLocalizedMessage( 1073647 ); // You may not continue while mounted... else if ( m.IsBodyMod || m.HueMod > 0 || !m.CanBeginAction( typeof( IncognitoSpell ) ) ) m.SendLocalizedMessage( 1073648 ); // You may only proceed while in your original state... else if ( m.Spell != null && m.Spell.IsCasting ) m.SendLocalizedMessage( 1073649 ); // One may not proceed while embracing magic... else if ( IsUnburdened( m ) ) m.SendLocalizedMessage( 1073650 ); // To proceed you must be unburdened by equipment... else if ( m.Hits < m.HitsMax ) m.SendLocalizedMessage( 1073652 ); // You must be healthy to proceed... else return true; return false; }
public override void OnDoubleClick(Mobile from) { base.OnDoubleClick(from); if (!Visible) { if (from.AccessLevel == AccessLevel.Player) { return; } } PlayerMobile player = from as PlayerMobile; if (player == null) { return; } UOACZPersistance.CheckAndCreateUOACZAccountEntry(player); if (!player.Alive) { player.SendMessage("You are dead and cannot do that."); return; } //UOACZ Restrictions if (player.AccessLevel == AccessLevel.Player) { if (Utility.GetDistance(from.Location, Location) >= 3) { return; } switch (m_GateDirection) { case GateDirectionType.Entrance: if (player.Criminal) { player.SendMessage("You are currently a criminal and cannot enter."); return; } if (player.Followers > 0) { player.SendMessage("You must stable your followers before entering."); return; } if (player.HasTrade) { player.SendMessage("You must cancel your pending trade before entering."); return; } if (!from.CanBeginAction(typeof(IncognitoSpell))) { from.SendMessage("You may not enter while under the effects of incognito."); return; } if (!from.CanBeginAction(typeof(PolymorphSpell))) { from.SendMessage("You may not enter while under the effects of polymorph."); return; } if (DisguiseTimers.IsDisguised(from)) { from.SendMessage("You may not enter while being disguised."); } if (DateTime.UtcNow < player.LastCombatTime + UOACZSystem.CombatDelayBeforeEnteringMoongate) { DateTime cooldown = player.LastCombatTime + UOACZSystem.CombatDelayBeforeEnteringMoongate; string nextActivationAllowed = Utility.CreateTimeRemainingString(DateTime.UtcNow, cooldown, false, false, false, true, true); player.SendMessage("You have been in combat recently and must wait another " + nextActivationAllowed + " before entering."); return; } if (player.m_UOACZAccountEntry.NextEntryAllowed > DateTime.UtcNow && player.AccessLevel == AccessLevel.Player) { string nextEntranceAllowed = Utility.CreateTimeRemainingString(DateTime.UtcNow, player.m_UOACZAccountEntry.NextEntryAllowed, false, false, false, true, true); from.SendMessage("You may not use this for another " + nextEntranceAllowed + "."); return; } break; case GateDirectionType.Exit: if (player.HasTrade) { player.SendMessage("You must cancel your pending trade before exiting."); return; } if (DateTime.UtcNow < player.LastPlayerCombatTime + UOACZSystem.TunnelDigPvPThreshold) { DateTime cooldown = player.LastPlayerCombatTime + UOACZSystem.TunnelDigPvPThreshold; string nextActivationAllowed = Utility.CreateTimeRemainingString(DateTime.UtcNow, cooldown, false, false, false, true, true); player.SendMessage("You have been in PvP recently and must wait another " + nextActivationAllowed + " before exiting."); return; } if (player.m_UOACZAccountEntry.NextEntryAllowed > DateTime.UtcNow && player.AccessLevel == AccessLevel.Player) { string nextEntranceAllowed = Utility.CreateTimeRemainingString(DateTime.UtcNow, player.m_UOACZAccountEntry.NextEntryAllowed, false, false, false, true, true); from.SendMessage("You may not use this for another " + nextEntranceAllowed + "."); return; } break; } } switch (m_GateDirection) { case GateDirectionType.Entrance: player.SendSound(0x103); if (player.AccessLevel > AccessLevel.Player) { player.MoveToWorld(UOACZPersistance.DefaultHumanLocation, UOACZPersistance.DefaultMap); return; } UOACZSystem.PlayerEnterUOACZRegion(player); break; case GateDirectionType.Exit: player.SendSound(0x0FC); if (player.AccessLevel > AccessLevel.Player) { player.MoveToWorld(UOACZPersistance.DefaultBritainLocation, UOACZPersistance.DefaultBritainMap); return; } UOACZDestination destination = UOACZDestination.GetRandomExit(player.Murderer); if (destination != null) { player.MoveToWorld(destination.Location, destination.Map); } else { player.MoveToWorld(UOACZPersistance.DefaultBritainLocation, UOACZPersistance.DefaultBritainMap); } break; } if (player.AccessLevel == AccessLevel.Player) { player.m_UOACZAccountEntry.NextEntryAllowed = DateTime.UtcNow + UOACZSystem.DelayBetweenMoongateActivation; } }
public void CheckCancelMorph(Mobile m) { if (m == null) { return; } double minSkill, maxSkill; AnimalFormContext acontext = AnimalForm.GetContext(m); TransformContext context = TransformationSpellHelper.GetContext(m); if (context != null) { Spell spell = context.Spell as Spell; spell.GetCastSkills(out minSkill, out maxSkill); if (m.Skills[spell.CastSkill].Value < minSkill) { TransformationSpellHelper.RemoveContext(m, context, true); } } if (acontext != null) { int i; for (i = 0; i < AnimalForm.Entries.Length; ++i) { if (AnimalForm.Entries[i].Type == acontext.Type) { break; } } if (m.Skills[SkillName.Ninjitsu].Value < AnimalForm.Entries[i].ReqSkill) { AnimalForm.RemoveContext(m, true); } } if (!m.CanBeginAction(typeof(PolymorphSpell)) && m.Skills[SkillName.Magery].Value < 66.1) { m.BodyMod = 0; m.HueMod = -1; m.NameMod = null; m.EndAction(typeof(PolymorphSpell)); BaseArmor.ValidateMobile(m); BaseClothing.ValidateMobile(m); } if (!m.CanBeginAction(typeof(IncognitoSpell)) && m.Skills[SkillName.Magery].Value < 38.1) { if (m is PlayerMobile) { ((PlayerMobile)m).SetHairMods(-1, -1); } m.BodyMod = 0; m.HueMod = -1; m.NameMod = null; m.EndAction(typeof(IncognitoSpell)); BaseArmor.ValidateMobile(m); BaseClothing.ValidateMobile(m); BuffInfo.RemoveBuff(m, BuffIcon.Incognito); } return; }
public static void Nullify(Mobile from) { if (!from.CanBeginAction(typeof(DefensiveSpell))) new InternalTimer(from).Start(); }