public void OnTarget( Mobile from, object targeted, object state )
		{
			object[] states = (object[])state;
			BaseCommand command = (BaseCommand)states[0];
			string[] args = (string[])states[1];

			if ( !BaseCommand.IsAccessible( from, targeted ) )
			{
				from.SendMessage( "That is not accessible." );
				from.BeginTarget( -1, command.ObjectTypes == ObjectTypes.All, TargetFlags.None, new TargetStateCallback( OnTarget ), new object[]{ command, args } );
				return;
			}

			switch ( command.ObjectTypes )
			{
				case ObjectTypes.Both:
				{
					if ( !(targeted is Item) && !(targeted is Mobile) )
					{
						from.SendMessage( "This command does not work on that." );
						return;
					}

					break;
				}
				case ObjectTypes.Items:
				{
					if ( !(targeted is Item) )
					{
						from.SendMessage( "This command only works on items." );
						return;
					}

					break;
				}
				case ObjectTypes.Mobiles:
				{
					if ( !(targeted is Mobile) )
					{
						from.SendMessage( "This command only works on mobiles." );
						return;
					}

					break;
				}
			}

			RunCommand( from, targeted, command, args );

			from.BeginTarget( -1, command.ObjectTypes == ObjectTypes.All, TargetFlags.None, new TargetStateCallback( OnTarget ), new object[]{ command, args } );
		}
Example #2
0
		private static void Link_OnFirstTarget( Mobile from, object targeted )
		{
			BaseDoor door = targeted as BaseDoor;

			if ( door == null )
			{
				from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( Link_OnFirstTarget ) );
				from.SendMessage( "That is not a door. Try again." );
			}
			else
			{
				from.BeginTarget( -1, false, TargetFlags.None, new TargetStateCallback( Link_OnSecondTarget ), door );
				from.SendMessage( "Target the second door to link." );
			}
		}
Example #3
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
				return;
			}

			if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) )
			{
				//to prevent exploiting for pvp
				from.SendLocalizedMessage( 1075857 ); // You can not use that while paralyzed.
				return;
			} 

			if ( m_Timer == null )
			{
				m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1 ), TimeSpan.FromSeconds( 1 ), new TimerCallback( OnFirebombTimerTick ) );
				m_LitBy = from;
				from.SendLocalizedMessage( 1060581 ); //You light the firebomb! Throw it now!
			}
			else
				from.SendLocalizedMessage( 1060582 ); //You've already lit it! Better throw it now!

			from.BeginTarget( 12, true, TargetFlags.None, new TargetCallback( OnFirebombTarget ) );
		}
Example #4
0
 public override void OnDoubleClick(Mobile from)
 {
     if (IsChildOf(from.Backpack))
     {
         from.SendMessage("What would you like to scour?");
         from.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, new TargetCallback(OnTarget));
     }
 }
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendMessage("You must have the Retouching Tool in your backpack!");
     }
     from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
 }
		public override void OnDoubleClick( Mobile from )
		{
            if (from.Mounted && !TrapHelper.CanWorkMounted)
            {
                from.SendMessage( "You cannot deploy a Lobster Trap while mounted." );
                return;
            }

            from.BeginTarget(-1, true, TargetFlags.None, new TargetCallback(OnTarget));
		}
		public override void OnDoubleClick(Mobile from)
		{
			if (from == null || from.Backpack == null)
				return;

			if (!IsChildOf(from.Backpack))
				from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
			else
				from.BeginTarget(1, false, TargetFlags.None, new TargetCallback(CellKey_OnTarget));
		}
Example #8
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this))
            {
                from.SendLocalizedMessage(501816);
                return;
            }

            from.SendMessage("Dans quoi souhaitez-vous l'enfoncer?");
            from.BeginTarget(1, false, TargetFlags.Harmful, new TargetCallback(OnTarget));
        }
Example #9
0
  public override void OnDoubleClick(Mobile from)
 {
     if (from.Karma > -2500)
     {
         base.OnDoubleClick(from);
         return;
     }
     
     from.SendMessage("Vous seriez assez méchant pour en faire une décoration!");
     from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
 }
Example #10
0
 public override void OnDoubleClick(Mobile from)
 {
     if (from.EquipItem(this) || IsChildOf(from))
     {
         from.PlaySound(0x166);
         from.PublicOverheadMessage(MessageType.Emote, 33, true, "*The Daemon claws demand a soul*");
         from.BeginTarget(-1, true, TargetFlags.None, OnTarget);
     }
     else
         from.SendAsciiMessage("You must equip the claws to use them");
 }
Example #11
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
			else
			{
				from.BeginTarget( 2, false, TargetFlags.None, new TargetCallback( OnTarget ) );
				from.SendMessage( "What do you wish to use the gem on?" );
			}
		}
Example #12
0
                public override void OnDoubleClick( Mobile from ) 
                { 
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
                        } 
                        else 
                        { 
                                from.BeginTarget( -1, false, TargetFlags.Harmful, new TargetCallback( VampKnife4Target_Callback ) );
				from.SendMessage( "Target the corpse of Ulic." );
			}         
		}
Example #13
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( OnTarget ) );
				from.SendLocalizedMessage( 1005424 ); // Select the weapon or armor you wish to use the cloth on.
			}
			else
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
		}
Example #14
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				from.BeginTarget( 3, false, TargetFlags.None, new TargetCallback( OnTarget ) );
				from.SendMessage( "Select a Dawn's music box to add this gears to." );
			}
			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 ) )
			{
				from.BeginTarget( 6, false, TargetFlags.None, new TargetCallback( OnTarget ) );
				from.SendLocalizedMessage( 1053024 ); // Select the swamp dragon you wish to place the barding on.
			}
			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))
     {
         from.BeginTarget(2, false, TargetFlags.Beneficial, new TargetCallback(OnTarget));
         from.SendMessage("Who would you like to resurrect?");
     }
     else
     {
         from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
     }
 }
Example #17
0
        public override void OnDoubleClick(Mobile from)
        {
            if (m_Harvested)
            {
                from.SendMessage("Vous ne décelez rien sous ces écailles");
                return;
            }

            from.SendMessage("Vous dénotez certains gravats sur les écailles");
            from.SendMessage("Peut-être qu'un liquide ennemi pourrait les faire partir?");
            from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
        }
 public static void Copy_Monster_From(Mobile from, Object o)
 {
     if (o is BaseCreature)
     {
         currentAttributesClipboard = new MonsterAttributes((BaseCreature)o);
         from.SendMessage("Select a monster to copy these attributes to.");
         from.BeginTarget(-1, true, TargetFlags.None, new TargetCallback(Copy_Monster_To));
     }
     else
     {
         from.SendMessage("Not a valid target!");
     }
 }
Example #19
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsModified )
				from.SendMessage( "That has already been modified." );
			else if ( !IsChildOf( from.Backpack ) )
				from.SendMessage( "This must be in your backpack to modify it." );
			else if ( from.Skills[SkillName.Fletching].Base < 100.0 )
				from.SendMessage( "Only a grandmaster bowcrafter can modify this weapon." );
			else
			{
				from.BeginTarget( 2, false, Targeting.TargetFlags.None, new TargetCallback( OnTargetGears ) );
				from.SendLocalizedMessage( 1010614 ); // Which set of gears will you use?
			}
		}
Example #20
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsSigned || !CheckSeason( from ) )
				return;

			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1080063 ); // This must be in your backpack to use it.
				return;
			}

			from.BeginTarget( 10, false, TargetFlags.None, new TargetCallback( OnTarget ) );
			from.SendMessage( "Who do you wish to use this on?" );
		}
Example #21
0
 /// <summary>
 /// Checking that the target is a mobile and that its guild is not null to return its GuildID.
 /// </summary>
 /// <param name="from">The command invoker.</param>
 /// <param name="targeted">Whos GuildID we want to view.</param>
 private static void GetGuildID_OnTarget(Mobile from, object targeted)
 {
     if (targeted is Mobile)
     {
         Mobile m = (Mobile)targeted;
         if (m.Guild == null || m.Guild.Disbanded)
         {
             from.BeginTarget(-1, false, TargetFlags.None, GetGuildID_OnTarget);
             from.SendMessage("That mobile is not in a guild.");
         }
         else
         {
             from.SendMessage("GuildID: {0}", m.Guild.Id);
         }
     }
 }
		public override void OnDoubleClick( Mobile from )
		{
			if ( m_InUse )
			{
				from.SendLocalizedMessage( 1010483 ); // Someone is already using that net!
			}
			else if ( IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1010484 ); // Where do you wish to use the net?
				from.BeginTarget( -1, true, TargetFlags.None, OnTarget );
			}
			else
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
		}
		public override void OnDoubleClick(Mobile from)
		{
			if (m_To == null)
			{
				if (this.IsChildOf(from))
				{
					from.BeginTarget(10, false, TargetFlags.None, new TargetCallback(OnTarget));

					from.SendLocalizedMessage(1077497); //To whom do you wish to give this card?
				}
				else
				{
					from.SendLocalizedMessage(1080063); // This must be in your backpack to use it.
				}
			}
		}
Example #24
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this))
            {
                from.SendLocalizedMessage(501816);
                return;
            }

            if(m_Possessed != null)
            {
                from.SendMessage("Cette poupée ressemble à quelqu'un... ne la laissez pas entre de mauvaises mains...");
                return;
            }
            from.SendMessage("Cette poupée serait plus terrible avec des cheveux!");
            from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
        }
        public override void OnDoubleClick(Mobile from)
        {
            if (from == null || from.Backpack == null)
            {
                return;
            }

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                 // That must be in your pack for you to use it.
            }
            else
            {
                from.RevealingAction();
                from.BeginTarget(1, false, TargetFlags.None, new TargetCallback(RechargeOrb_OnTarget));
            }
        }
Example #26
0
        private static void Link_OnSecondTarget(Mobile from, object targeted, object state)
        {
            PortcullisS first  = (PortcullisS)state;
            PortcullisS second = targeted as PortcullisS;

            if (second == null)
            {
                from.BeginTarget(-1, false, TargetFlags.None, new TargetStateCallback(Link_OnSecondTarget), first);
                from.SendMessage("That is not a portcullis. Try again.");
            }
            else
            {
                first.Link  = second;
                second.Link = first;
                from.SendMessage("The portcullis have been linked.");
            }
        }
Example #27
0
		private static void Link_OnSecondTarget( Mobile from, object targeted, object state )
		{
			BaseDoor first = (BaseDoor)state;
			BaseDoor second = targeted as BaseDoor;

			if ( second == null )
			{
				from.BeginTarget( -1, false, TargetFlags.None, new TargetStateCallback( Link_OnSecondTarget ), first );
				from.SendMessage( "That is not a door. Try again." );
			}
			else
			{
				first.Link = second;
				second.Link = first;
				from.SendMessage( "The doors have been linked." );
			}
		}
Example #28
0
        public override void OnClick()
        {
            if (m_Bowl.Deleted || !m_Bowl.Movable || !m_Bowl.CanPlant || !m_From.CheckAlive())
            {
                return;
            }

            if (m_Bowl.HasPlant)
            {
                m_From.SendMessage("Il y a déja une graine dans ce pot.");
            }
            else
            {
                m_From.SendMessage("Choissisez la graine à planter dans le pot.");
                m_From.BeginTarget(1, false, TargetFlags.None, new TargetCallback(m_Bowl.ChooseSeed_OnTarget));
            }
        }
Example #29
0
        public override void OnDoubleClick(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (pm.ExploringTheDeepQuest > ExploringTheDeepQuestChain.None)
            {
                if (!m_InUse)
                {
                    from.SendLocalizedMessage(1154219); // Where do you wish to use this?
                    from.BeginTarget(-1, true, TargetFlags.None, OnTarget);
                }
            }
            else
            {
                from.PublicOverheadMessage(MessageType.Regular, 0x3B2, 1154274); // *You aren't quite sure what to do with this. If you spoke to the Salvage Master at the Sons of the Sea in Trinsic you might have a better understanding of its use...*
            }
        }
Example #30
0
        public static void PickInstrument(Mobile from, InstrumentPickedCallback callback)
        {
            BaseInstrument instrument = GetInstrument(from);

            if (instrument != null)
            {
                if (callback != null)
                {
                    callback(from, instrument);
                }
            }
            else
            {
                from.SendLocalizedMessage(500617); // What instrument shall you play?
                from.BeginTarget(1, false, TargetFlags.None, new TargetStateCallback(OnPickedInstrument), callback);
            }
        }
        public override void OnDoubleClick(Mobile from)
        {
            if (IsEmpty)
            {
                if (!Fillable || !ValidateUse(from, true))
                {
                    return;
                }

                from.BeginTarget(-1, true, TargetFlags.None, new TargetCallback(Link_OnTarget));
                from.SendLocalizedMessage(1115892);                   //Target a water trough you wish to link.
            }
            else
            {
                base.OnDoubleClick(from);
            }
        }
Example #32
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1042001);               // That must be in your pack for you to use it.
     }
     else if (Quantity > 0)
     {
         from.SendMessage("Select the sprinkler you wish to fill");
         from.Target = new SprinklerTarget(this);
     }
     else
     {
         from.BeginTarget(-1, true, TargetFlags.None, new TargetCallback(Fill_OnTarget));
         SendLocalizedMessageTo(from, 500837);                   // Fill from what?
     }
 }
        public override void OnDoubleClick(Mobile from)
        {
            if (IsEmpty)
            {
                if (!ValidateUse(from, true))
                {
                    return;
                }

                Delete();
            }
            else if (Pourable && ValidateUse(from, true))
            {
                from.BeginTarget(-1, true, TargetFlags.None, new TargetCallback(PourOut_OnTarget));
                from.SendLocalizedMessage(1010086);                   //What do you want to use this on?
            }
        }
Example #34
0
        private static void Link_OnSecondTarget(Mobile from, object targeted, object state)
        {
            BaseDoor first  = (BaseDoor)state;
            BaseDoor second = targeted as BaseDoor;

            if (second == null)
            {
                from.BeginTarget(-1, false, TargetFlags.None, new TargetStateCallback(Link_OnSecondTarget), first);
                from.SendMessage("That is not a door. Try again.");
            }
            else
            {
                first.Link  = second;
                second.Link = first;
                from.SendMessage("The doors have been linked.");
            }
        }
Example #35
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                from.BeginTarget(-1, false, TargetFlags.None, (m, targeted) =>
                {
                    if (!IsChildOf(m.Backpack))
                    {
                        m.SendLocalizedMessage(1042001);     // That must be in your pack for you to use it.
                    }
                    else if (targeted is BaseWeapon)
                    {
                        BaseWeapon wep = targeted as BaseWeapon;

                        if (!wep.IsChildOf(m.Backpack))
                        {
                            m.SendLocalizedMessage(1042001);     // That must be in your pack for you to use it.
                        }
                        else if (wep.TimesImbued > 0 || wep.Quality != ItemQuality.Exceptional)
                        {
                            m.SendLocalizedMessage(1046439);     // Invalid target.
                        }
                        else if (wep.Attributes.WeaponDamage > 0)
                        {
                            wep.Attributes.WeaponDamage = 0;
                            m.SendLocalizedMessage(1151814);     // You have removed the damage increase from this weapon.

                            Consume();
                        }
                        else
                        {
                            m.SendLocalizedMessage(1046439);     // Invalid target.
                        }
                    }
                    else
                    {
                        m.SendLocalizedMessage(1046439);     // Invalid target.
                    }
                });
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
        private void this_doorSelected(Mobile from, object target, object state)
        {
            BaseDoor          door    = target as BaseDoor;
            DoorTrapInstaller inst    = state as DoorTrapInstaller;
            string            message = "";

            if (door == null)
            {
                from.BeginTarget(1, false, TargetFlags.None, new TargetStateCallback(this_doorSelected), inst);
                message = "That is not a door. Try again.";
            }
            else if (inst != null && inst.Install(from, door, out message))
            {
                inst.Delete();
            }

            from.SendMessage(message);
        }
Example #37
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.NextSkillTime > DateTime.Now)
            {
                from.SendSkillMessage();                 // You must wait...
            }
            else if (from.InRange(GetWorldLocation(), 1))
            {
                from.RevealingAction();

                from.SendLocalizedMessage(500948);                   // Who will you use the bandages on?
                from.BeginTarget(3, false, TargetFlags.Beneficial, new TargetCallback(OnTarget));
            }
            else
            {
                from.SendLocalizedMessage(500295);                   // You are too far away to do that.
            }
        }
Example #38
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Protected && from.AccessLevel == AccessLevel.Player)
                return;

            if (!from.InRange(this.GetWorldLocation(), 2))
                return;

            if (Burning)
            {
                from.SendMessage("Comme elle est magnifique!");      
            }
            else
            {
                from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(OnTarget));
                from.SendMessage("Elle serait encore mieux avec une chandelle à l'intérieur, non?");
            }
        }
Example #39
0
        public override void OnDoubleClick(Mobile m)
        {
            if (RootParent != m)
            {
                m.SendMessage("That item must be in your backpack to use.");
                return;
            }

            var house = BaseHouse.FindHouseAt(m);

            if (m.AccessLevel == AccessLevel.Player && (house == null || house.Owner != m))
            {
                m.SendMessage("You have to be inside your house to use this.");
                return;
            }

            m.BeginTarget(3, false, TargetFlags.None, OnTarget);
        }
Example #40
0
        public override void OnDoubleClick(Mobile from)
        {
            if(!IsChildOf(from.Backpack))
                {
                    from.SendMessage("Le crystal doit être entre vos mains");   
                }
            else if (Completion == 100)
            {
                from.SendMessage("Le crystal ne pourrait absorber davantage de pouvoir!");
            }
            else
            {
                from.SendMessage("Quel pouvoir souhaitez-vous absorber?");
                from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(AbsorbTarget));
            }

            base.OnDoubleClick(from);
        }
Example #41
0
        private void carpetEntity_selectionCallback(Mobile from, object target, object state)
        {
            bool add = (bool)state;

            if (target is IEntity)
            {
                if (add)
                {
                    _carpet.IncludeEntity((IEntity)target);
                }
                else
                {
                    _carpet.RemoveEntity((IEntity)target);
                }
            }

            from.BeginTarget(10, false, Server.Targeting.TargetFlags.None, new TargetStateCallback(carpetEntity_selectionCallback), state);
        }
Example #42
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendMessage("Le crystal doit être entre vos mains");
            }
            else if (Completion == 100)
            {
                from.SendMessage("Le crystal ne pourrait absorber davantage de pouvoir!");
            }
            else
            {
                from.SendMessage("Quel pouvoir souhaitez-vous absorber?");
                from.BeginTarget(2, false, TargetFlags.None, new TargetCallback(AbsorbTarget));
            }

            base.OnDoubleClick(from);
        }
Example #43
0
        // Plume : Ajout du sertissage
        public override void OnDoubleClick(Mobile from)
        {
            if (PlayerConstructed && GemType == GemType.None)
            {
                if (from.Skills[SkillName.Tinkering].Value > 80)
                {
                    from.BeginTarget(1, false, TargetFlags.None, new TargetCallback(SertissageTarget));
                    from.SendMessage("Quelle pierre voulez-vous y sertir?");
                }
                else
                {
                    from.SendMessage("Un bijoutier expérimenté pourrait y sertir une pierre précieuse");
                }
                return;
            }

            base.OnDoubleClick(from);
        }
Example #44
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1071121); // Select the bulk order book you want to replace a cover.
                from.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (m, targeted) =>
                {
                    if (targeted is BulkOrderBook)
                    {
                        BulkOrderBook bob = (BulkOrderBook)targeted;

                        if (bob.IsChildOf(m.Backpack))
                        {
                            if (bob.Hue != Hue)
                            {
                                bob.Hue = Hue;
                                UsesRemaining--;

                                m.SendLocalizedMessage(1071119);     // You have successfully given the bulk order book a new cover.
                                m.PlaySound(0x048);

                                if (UsesRemaining <= 0)
                                {
                                    m.SendLocalizedMessage(1071120);     // You have used up all the bulk order book covers.
                                    Delete();
                                }
                            }
                            else
                            {
                                m.SendLocalizedMessage(1071122);     // You cannot cover it with same color.
                            }
                        }
                        else
                        {
                            m.SendLocalizedMessage(1071117);     // You cannot use this item for it.
                        }
                    }
                    else
                    {
                        m.SendLocalizedMessage(1071118);     // You can only cover a bulk order book with this item.
                    }
                });
            }
        }
 public override void OnDoubleClick(Mobile from)
 {
     if (from != Parent)
     {
         from.SendLocalizedMessage(1112886);                   // You must be wearing this item in order to use it.
     }
     else if (m_Ammo < 1)
     {
         from.SendMessage("You do not have any knives ready for use.");
     }
     else if (ThrowDelay > DateTime.Now)
     {
         from.SendLocalizedMessage(501789);                   // You must wait before trying again.
     }
     else
     {
         from.BeginTarget(10, false, TargetFlags.Harmful, new TargetStateCallback <ACreedJinBori>(Target), this);
     }
 }
Example #46
0
        public override void OnDoubleClick( Mobile from )
        {
			if ( from is PlayerMobile )
			{
				int canDo = 0;

				foreach ( Mobile m in this.GetMobilesInRange( 20 ) )
				{
					if ( m is TailorGuildmaster )
						++canDo;
				}
				foreach ( Item i in this.GetItemsInRange( 20 ) )
				{
					if ( i is TailorShoppe && !i.Movable )
					{
						TailorShoppe b = (TailorShoppe)i;

						if ( b.ShoppeOwner == from )
							++canDo;
					}
				}
				if ( from.Map == Map.SavagedEmpire && from.X > 1054 && from.X < 1126 && from.Y > 1907 && from.Y < 1983 ){ ++canDo; }

				PlayerMobile pc = (PlayerMobile)from;
				if ( pc.NpcGuild != NpcGuild.TailorsGuild )
				{
					from.SendMessage( "Only those of the Tailors Guild may use this!" );
				}
				else if ( from.Skills[SkillName.Tailoring].Value < 90 )
				{
					from.SendMessage( "Only a master tailor can use this!" );
				}
				else if ( canDo == 0 )
				{
					from.SendMessage( "You need to be near a tailor guildmaster, or a tailor shoppe you own, to use this!" );
				}
				else
				{
					from.SendMessage("Select the clothing you would like to enhance...");
					from.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(OnTarget));
				}
			}
        }
Example #47
0
        public override void OnDoubleClick(Mobile from)
        {
            Faction faction = Faction.Find(from);

            if (!IsChildOf(from.Backpack))
            {
                // That is not in your backpack.
                from.SendLocalizedMessage(1042593);
            }
            else if (faction == null)
            {
                // You may not use this unless you are a faction member!
                from.SendLocalizedMessage(1010376, null, 0x25);
            }
            else
            {
                from.BeginTarget(1, false, TargetFlags.None, new TargetCallback(Target_Callback));
            }
        }
Example #48
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         // You must have the object in your backpack to use it.
         from.SendLocalizedMessage(1042010);
     }
     else if (PlantHueInfo.IsSaturated(m_PlantHue))
     {
         // This pigment is saturated and cannot be mixed further.
         from.SendLocalizedMessage(1112125);
     }
     else
     {
         // Which plant pigment do you wish to mix this with?
         from.SendLocalizedMessage(1112123);
         from.BeginTarget(-1, false, TargetFlags.None, new TargetCallback(Target));
     }
 }
Example #49
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            Mobile      m       = sender.Mobile;
            GrabOptions options = Grab.GetOptions(m);

            if (m == null || info.ButtonID <= 0 || info.ButtonID == 100)
            {
                return;
            }

            //store flags
            options.ResetFlags();

            if (info.Switches.Length > 0)
            {
                for (int i = 0; i < info.Switches.Length; i++)
                {
                    if (info.Switches[i] == 1)
                    {
                        options.SetFlag(GrabFlag.Everything, true);
                        break;
                    }

                    options.SetFlag(Grab.ParseInt32(info.Switches[i]), true);
                }
            }
            else
            {
                options.SetFlag(GrabFlag.Everything, true);
            }

            //handle buttons
            if (info.ButtonID == 105)              //OK
            {
                Grab.SaveOptions(m, options);
                m.SendMessage("You have updated your Grab options.");
            }
            else             //placement container selection
            {
                m.SendMessage("Select the container to place this type of loot in.");
                m.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, new TargetStateCallback(OnContainerSelect), info.ButtonID);
            }
        }
Example #50
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( m_CurrentUses > 0 )
			{
				if ( from.Thirst < 20 )
					++from.Thirst;
				from.BAC += 5;
				if ( from.BAC > 60 )
					from.BAC = 60;
				BaseBeverage.CheckHeaveTimer( from );
				--m_CurrentUses;
				from.PlaySound( Utility.RandomList( 0x30, 0x2D6 ) );
			}
			else
			{
				from.BeginTarget( -1, true, TargetFlags.None, new TargetCallback( Fill ) );
				SendLocalizedMessageTo( from, 500837 ); // Fill from what?
			}
		}
Example #51
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from, true))
            {
                from.SendAsciiMessage("That must be in your backpack to use it.");
                return;
            }
            else if (!from.InRange(GetWorldLocation(), 3) || !from.InLOS(GetWorldLocation()))
            {
                from.SendAsciiMessage("You cannot reach that.");
                return;
            }

            from.BeginTarget(10, false, TargetFlags.None, new TargetCallback(OnTarget));
            if (from.Target != null)
            {
                from.Target.CheckLOS = false;
                from.Target.BeginTimeout(from, TimeSpan.FromSeconds(15.0));
            }
        }
Example #52
0
        public static void ExchangeSkill_OnCommand(CommandEventArgs args)
        {
            Mobile m = args.Mobile;

            if (args.Length != 2)
            {
                m.SendMessage("ExchangeSkill <skill to lower> <skill to raise>");
            }
            else
            {
                SkillName toLower = SkillName.Swords;
                SkillName toRaise = SkillName.Swords;

                if (TryParse(m, args.GetString(0), ref toLower) && TryParse(m, args.GetString(1), ref toRaise))
                {
                    m.BeginTarget(-1, false, TargetFlags.None, new TargetStateCallback(OnTarget), new object[] { toLower, toRaise });
                    m.SendMessage("Select the mobile.");
                }
            }
        }
Example #53
0
    public override void OnDoubleClick(Mobile from)
    {
        if (!IsChildOf(from.Backpack))
        {
            from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            return;
        }

        var house = BaseHouse.FindHouseAt(from);

        if (house?.IsOwner(from) == true)
        {
            from.SendLocalizedMessage(1062838); // Where would you like to place this decoration?
            from.BeginTarget(-1, true, TargetFlags.None, Placement_OnTarget);
        }
        else
        {
            from.SendLocalizedMessage(502092); // You must be in your house to do this.
        }
    }
Example #54
0
        private static void ForgetAllRecipes_OnCommand(CommandEventArgs e)
        {
            Mobile m = e.Mobile;

            m.SendMessage("Target a player to have them forget all of the recipies they've learned.");

            m.BeginTarget(-1, false, TargetFlags.None, delegate(Mobile from, object targeted)
            {
                if (targeted is PlayerMobile)
                {
                    ((PlayerMobile)targeted).ResetRecipes();

                    m.SendMessage("They forget all their recipies.");
                }
                else
                {
                    m.SendMessage("That is not a player!");
                }
            });
        }
Example #55
0
 public override void OnDoubleClick(Mobile from)
 {
     if (IsModified)
     {
         from.SendMessage("That has already been modified.");
     }
     else if (!IsChildOf(from.Backpack))
     {
         from.SendMessage("This must be in your backpack to modify it.");
     }
     else if (from.Skills[SkillName.Fletching].Base < 100.0)
     {
         from.SendMessage("Only a grandmaster bowcrafter can modify this weapon.");
     }
     else
     {
         from.BeginTarget(2, false, Targeting.TargetFlags.None, new TargetCallback(OnTargetGears));
         from.SendMessage("Select the gears you wish to use.");
     }
 }
Example #56
0
 public override void OnDoubleClick(Mobile from)
 {
     if (from.Map != Map || !from.InRange(Location, 2))
     {
         from.SendLocalizedMessage(500446); // That is too far away.
     }
     else if (m_Platform.Summoner != null && m_Platform.Summoner != from)
     {
         SendLocalizedMessageTo(from, 502221); // Someone else is already using this item.
     }
     else if (m_Key != null && !m_Key.Deleted)
     {
         SendLocalizedMessageTo(from, 1112701); // I've already accepted your offering.
     }
     else
     {
         from.SendAsciiMessage("What would you like to sacrifice?");
         from.BeginTarget(10, false, TargetFlags.None, new TargetCallback(Sacrifice_Callback));
     }
 }
Example #57
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsModified )
			{
				from.SendMessage( "That has already been modified." );
			}
			else if ( !IsChildOf( from.Backpack ) )
			{
				from.SendMessage( "This must be in your backpack to modify it." );
			}
			else if ( from.Skills[SkillName.Fletching].Base < 100.0 )
			{
				from.SendMessage( "Only a grandmaster bowcrafter can modify this weapon." );
			}
			else
			{
				from.BeginTarget( 2, false, Targeting.TargetFlags.None, new TargetCallback( OnTargetGears ) );
				from.SendMessage( "Select the gears you wish to use." );
			}
		}
Example #58
0
        public override void OnDoubleClick(Mobile from)
        {
            if (IsChildOf(from.Backpack))
            {
                if (ItemID == BuoyID)
                {
                    ItemID = TrapID;
                }

                if (Items.Count > 0)
                {
                    DumpContents(from);
                    from.SendMessage("You dump the contents of the lobster trap into your pack.");
                }
                else
                {
                    from.SendLocalizedMessage(500974); //What water do you want to fish in?
                    from.BeginTarget(-1, true, TargetFlags.None, OnTarget);
                }
            }
            else if (ItemID == BuoyID)
            {
                if (RootParent != null)
                {
                    ItemID = TrapID;
                }

                InvalidateProperties();

                if (CanUseTrap(from))
                {
                    EndTimer(from);
                }

                InvalidateProperties();
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
Example #59
0
        public override void OnDoubleClick(Mobile m)
        {
            if (IsChildOf(m.Backpack))
            {
                m.SendLocalizedMessage(1155613); // Target the weapon, spellbook, or instrument you wish to apply this to...
                m.BeginTarget(-1, false, Server.Targeting.TargetFlags.None, (from, targeted) =>
                {
                    if (targeted is Item && targeted is ISlayer)
                    {
                        var item   = (Item)targeted;
                        var slayer = (ISlayer)targeted;

                        var socket = item.GetSocket <SlayerSocket>();

                        if (socket == null || socket.Slayer != SlayerName.Silver)
                        {
                            if (slayer.Slayer != SlayerName.None && slayer.Slayer2 != SlayerName.None)
                            {
                                from.SendLocalizedMessage(1155680); // You cannot apply Tincture of Silver to items that are already slayers!
                            }
                            else
                            {
                                item.AttachSocket(new SlayerSocket(SlayerName.Silver, TimeSpan.FromHours(1)));

                                Delete();

                                from.SendLocalizedMessage(1155616); // You carefully apply Tincture of Silver to the item.  The effects will fade in one hour.
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(1155614); // This item is already treated with Tincture of Silver!
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1155615); // You cannot apply Tincture of Silver to this item.
                    }
                });
            }
        }
Example #60
0
		private static void AllSpells_OnTarget( Mobile from, object obj )
		{
			if ( obj is Spellbook )
			{
				Spellbook book = (Spellbook)obj;

				if ( book.BookCount == 64 )
					book.Content = ulong.MaxValue;
				else
					book.Content = (1ul << book.BookCount) - 1;

				from.SendMessage( "The spellbook has been filled." );

				CommandLogging.WriteLine( from, "{0} {1} filling spellbook {2}", from.AccessLevel, CommandLogging.Format( from ), CommandLogging.Format( book ) );
			}
			else
			{
				from.BeginTarget( -1, false, TargetFlags.None, new TargetCallback( AllSpells_OnTarget ) );
				from.SendMessage( "That is not a spellbook. Try again." );
			}
		}