protected override void OnTarget( Mobile from, object target )
			{
				if ( target is Mobile )
				{
					if ( from.CheckTargetSkill( SkillName.Forensics, target, 40.0, 100.0 ) )
					{
						if ( target is PlayerMobile && ((PlayerMobile)target).NpcGuild == NpcGuild.ThievesGuild )
							from.SendLocalizedMessage( 501004 );//That individual is a thief!
						else
							from.SendLocalizedMessage( 501003 );//You notice nothing unusual.
					}
					else
					{
						from.SendLocalizedMessage( 501001 );//You cannot determain anything useful.
					}
				}
				else if ( target is Corpse )
				{
					if ( from.CheckTargetSkill( SkillName.Forensics, target, 0.0, 100.0 ) )
					{
						Corpse c = (Corpse)target;

						if ( ((Body)c.Amount).IsHuman )
							c.LabelTo( from, 1042751, ( c.Killer == null ? "no one" : c.Killer.Name ) );//This person was killed by ~1_KILLER_NAME~

						if ( c.Looters.Count > 0 )
						{
							StringBuilder sb = new StringBuilder();
							for (int i=0;i<c.Looters.Count;i++)
							{
								if ( i>0 )
									sb.Append( ", " );
								sb.Append( ((Mobile)c.Looters[i]).Name );
							}

							c.LabelTo( from, 1042752, sb.ToString() );//This body has been distrubed by ~1_PLAYER_NAMES~
						}
						else
						{
							c.LabelTo( from, 501002 );//The corpse has not be desecrated.
						}
					}
					else
					{
						from.SendLocalizedMessage( 501001 );//You cannot determain anything useful.
					}
				}
				else if ( target is ILockpickable )
				{
					ILockpickable p = (ILockpickable)target;
					if ( p.Picker != null )
						from.SendLocalizedMessage( 1042749, p.Picker.Name );//This lock was opened by ~1_PICKER_NAME~
					else
						from.SendLocalizedMessage( 501003 );//You notice nothing unusual.
				}
			}
			protected override void OnTarget( Mobile from, object o )
			{
				if ( o is Item )
				{
					if ( from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
					{
						if ( o is BaseWeapon )
							((BaseWeapon)o).Attributes.NightSight = 1;		
						else if ( o is BaseArmor )
							((BaseArmor)o).Attributes.NightSight = 1;	
						else if ( o is BaseJewel )
							((BaseJewel)o).Attributes.NightSight = 1;
						else if ( o is BaseClothing )
							((BaseClothing)o).Attributes.NightSight = 1;

						if ( !Core.AOS )
							((Item)o).OnSingleClick( from );
						
						from.SendMessage( "You Successfully enhance the Item." );
						from.PlaySound( Utility.Random( 0x520, 0 ) );
						m_nsOrb.Delete();
					}
					else
						from.SendMessage( "You fail to enhance the item." ); // You cannot augment that...
				}
				else if ( o is Mobile )
					((Mobile)o).OnSingleClick( from );
				else
					from.SendMessage( "You cannot do that." );
			}
Example #3
0
            protected override void OnTarget( Mobile from, object o )
            {
                if ( o is Item )
                {
                    if ( from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
                    {
                        if ( o is BaseWeapon )
                            ((BaseWeapon)o).Identified = true;
                        else if ( o is BaseArmor )
                            ((BaseArmor)o).Identified = true;

                        if ( !Core.AOS )
                            ((Item)o).OnSingleClick( from );
                    }
                    else
                    {
                        from.SendLocalizedMessage( 500353 ); // You are not certain...
                    }
                }
                else if ( o is Mobile )
                {
                    ((Mobile)o).OnSingleClick( from );
                }
                else
                {
                    from.SendLocalizedMessage( 500353 ); // You are not certain...
                }
                //allows the identify skill to reveal attachments
                Server.Engines.XmlSpawner2.XmlAttach.RevealAttachments(from,o);
            }
 protected override void OnTarget( Mobile from, object o )
 {
     if ( o is Item )
     {
         if ( from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
         {
             if ( o is BaseWeapon )
                 ((BaseWeapon)o).Identified = true;
             else if ( o is BaseArmor )
                 ((BaseArmor)o).Identified = true;
             else if ( o is BaseTreasureChest )
             {
                 BaseTreasureChest tchest = (BaseTreasureChest)o;
                 from.SendMessage( "{0} container with {1} treasure.", tchest.Locked ? "a locked" : "an unlocked", m_TreasureValue[(int)tchest.Level] );
             }
             if ( !Core.AOS )
                 ((Item)o).OnSingleClick( from );
         }
         else
         {
             from.SendLocalizedMessage( 500353 ); // You are not certain...
         }
     }
     else if ( o is Mobile )
     {
         ((Mobile)o).OnSingleClick( from );
     }
     else
     {
         from.SendLocalizedMessage( 500353 ); // You are not certain...
     }
 }
            protected override void OnTarget( Mobile from, object o )
            {
                if ( o is Item )
                {
                    if ( !m_CheckSkill || from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
                    {
                        if ( o is IIdentifiable )
                            ((IIdentifiable)o).OnIdentify( from );
                        else if ( o is Spellbook )
                            from.SendAsciiMessage( "You guess it contains about {0} spells....", Math.Max( 0, ((Spellbook)o).SpellCount + Utility.RandomMinMax( -8, 8 ) ) );

                        ((Item)o).OnSingleClick( from );

                        if ( m_OK != null )
                            m_OK( from, o );
                    }
                    else
                    {
                        from.SendLocalizedMessage( 500353 ); // You are not certain...
                    }
                }
                else if ( o is Mobile )
                {
                    ((Mobile)o).OnSingleClick( from );
                }
                else
                {
                    from.SendLocalizedMessage( 500353 ); // You are not certain...
                }
            }
            protected override void OnTarget( Mobile from, object o )
            {
                if ( o is Item )
                {
                    if ( from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
                    {
                        if ( o is BaseWeapon )
                            ((BaseWeapon)o).Identified = true;
                        else if ( o is BaseArmor )
                            ((BaseArmor)o).Identified = true;
                        else if ( o is BaseJewel )
                            ((BaseJewel)o).Identified = true;

                        if ( !Core.AOS )
                            ((Item)o).OnSingleClick( from );
                    }
                    else
                    {
                        from.SendAsciiMessage( "You are not certain..." );
                    }
                }
                else if ( o is Mobile )
                {
                    ((Mobile)o).OnSingleClick( from );
                }
                else
                {
                    from.SendAsciiMessage( "You are not certain..." );
                }
            }
			protected override void OnTarget( Mobile from, object o )
			{
				if ( o is Item )
				{
					if ( from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
					{
						if ( o is BaseWeapon )
							((BaseWeapon)o).Identified = true;
						else if ( o is BaseArmor )
							((BaseArmor)o).Identified = true;
					//ItemID Mods Begin
						else if ( o is BaseClothing)
							((BaseClothing)o).Identified = true;
						else if ( o is BaseJewel)
							((BaseJewel)o).Identified = true;
					//ItemID Mods End
						if ( !Core.AOS )
							((Item)o).OnSingleClick( from );
					}
					else
					{
						from.SendLocalizedMessage( 500353 ); // You are not certain...
					}
				}
				else if ( o is Mobile )
				{
					((Mobile)o).OnSingleClick( from );
				}
				else
				{
					from.SendLocalizedMessage( 500353 ); // You are not certain...
				}
			}
Example #8
0
			protected override void OnTarget( Mobile from, object targeted )
			{
                IEntity entity = targeted as IEntity;
                if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, null, 0, null, SkillName.Anatomy, from.Skills[SkillName.Anatomy].Value))
                {
                    return;
                }
                if ( from == targeted )
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500324 ); // You know yourself quite well enough already.
				else if ( targeted is TownCrier )
					((TownCrier)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500322, from.NetState ); // This person looks fine to me, though he may have some news...
				else if ( targeted is BaseVendor /*&& ((BaseVendor)targeted).IsInvulnerable*/ )
					((BaseVendor)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500326, from.NetState ); // That can not be inspected.
				else if ( targeted is BaseGuard )
					((BaseGuard)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, false, "That person looks strong enough to find criminals and apprehend them.", from.NetState );
				else if ( targeted is Mobile )
				{
					Mobile targ = (Mobile)targeted;

					if ( targ.AccessLevel > AccessLevel.Player )
						targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, false, "That entity is clearly beyond mortal understanding.", from.NetState );
					else
					{
						int marginOfError = Math.Max( 0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 1) );// 4

						int str = targ.Str + Utility.RandomMinMax( -marginOfError, +marginOfError );
						int dex = targ.Dex + Utility.RandomMinMax( -marginOfError, +marginOfError );
						int stm = ((targ.Stam * 100) / Math.Max( targ.StamMax, 1 )) + Utility.RandomMinMax( -marginOfError, +marginOfError );

						int strMod = str / 10;
						int dexMod = dex / 10;
						int stmMod = stm / 10;

						if ( strMod < 0 ) strMod = 0;
						else if ( strMod > 10 ) strMod = 10;

						if ( dexMod < 0 ) dexMod = 0;
						else if ( dexMod > 10 ) dexMod = 10;

						if ( stmMod > 10 ) stmMod = 10;
						else if ( stmMod < 0 ) stmMod = 0;

						if ( from.CheckTargetSkill( SkillName.Anatomy, targ, 0, 100 ) )
						{
							targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState ); // That looks [strong] and [dexterous].

							if ( from.Skills[SkillName.Anatomy].Base >= 65.0 )
								targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState ); // That being is at [10,20,...] percent endurance.
						}
						else
							targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1042666, from.NetState ); // You can not quite get a sense of their physical characteristics.
					}
				}
				else if ( targeted is Item )
				{
					((Item)targeted).SendLocalizedMessageTo( from, 500323, "" ); // Only living things have anatomies!
				}
			}
Example #9
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( from == targeted )
                {
                    from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500910 ); // Hmm, that person looks really silly.
                }
                else if ( targeted is TownCrier )
                {
                    ((TownCrier)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500907, from.NetState ); // He looks smart enough to remember the news.  Ask him about it.
                }
                else if ( targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable )
                {
                    ((BaseVendor)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500909, from.NetState ); // That person could probably calculate the cost of what you buy from them.
                }
                else if ( targeted is Mobile )
                {
                    Mobile targ = (Mobile)targeted;

                    int marginOfError = Math.Max( 0, 20 - (int)(from.Skills[SkillName.EvalInt].Value / 5) );

                    int intel = targ.Int + Utility.RandomMinMax( -marginOfError, +marginOfError );
                    int mana = ((targ.Mana * 100) / Math.Max( targ.ManaMax, 1 )) + Utility.RandomMinMax( -marginOfError, +marginOfError );

                    int intMod = intel / 10;
                    int mnMod = mana / 10;

                    if ( intMod > 10 ) intMod = 10;
                    else if ( intMod < 0 ) intMod = 0;

                    if ( mnMod > 10 ) mnMod = 10;
                    else if ( mnMod < 0 ) mnMod = 0;

                    int body;

                    if ( targ.Body.IsHuman )
                        body = targ.Female ? 11 : 0;
                    else
                        body = 22;

                    if ( from.CheckTargetSkill( SkillName.EvalInt, targ, 0.0, 120.0 ) )
                    {
                        targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038169 + intMod + body, from.NetState ); // He/She/It looks [slighly less intelligent than a rock.]  [Of Average intellect] [etc...]

                        if ( from.Skills[SkillName.EvalInt].Base >= 76.0 )
                            targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038202 + mnMod, from.NetState ); // That being is at [10,20,...] percent mental strength.
                    }
                    else
                    {
                        targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038166 + (body / 11), from.NetState ); // You cannot judge his/her/its mental abilities.
                    }
                }
                else if ( targeted is Item )
                {
                    ((Item)targeted).SendLocalizedMessageTo( from, 500908, "" ); // It looks smarter than a rock, but dumber than a piece of wood.
                }
            }
Example #10
0
            protected override void OnTarget( Mobile from, object o )
            {
                if ( o is Item )
                {
                    if (from.CheckTargetSkill(SkillName.ItemID, o, 0, 100))
                    {
                        bool inlist = false;

                        if (o is BaseWeapon)
                            inlist = ((BaseWeapon)o).IsInIDList(from);
                        else if (o is BaseArmor)
                            inlist = ((BaseArmor)o).IsInIDList(from);
                        else if (o is BaseClothing)
                            inlist = ((BaseClothing)o).IsInIDList(from);
                        else if (o is BaseJewel)
                            inlist = ((BaseJewel)o).IsInIDList(from);

                        if (o is BaseWeapon)
                            ((BaseWeapon)o).AddToIDList(from);
                        else if (o is BaseArmor)
                            ((BaseArmor)o).AddToIDList(from);
                        else if (o is BaseClothing)
                            ((BaseClothing)o).AddToIDList(from);
                        else if (o is BaseJewel)
                            ((BaseJewel)o).AddToIDList(from);

                        if (!Core.AOS)
                            ((Item)o).OnSingleClick(from);

                        if (o is BaseWeapon && (((BaseWeapon)o).IDList.Count > 50 && !inlist || from.AccessLevel > AccessLevel.Player))
                            ((BaseWeapon)o).RemoveFromIDList(from);
                        else if (o is BaseArmor && (((BaseArmor)o).IDList.Count > 50 && !inlist || from.AccessLevel > AccessLevel.Player))
                            ((BaseArmor)o).RemoveFromIDList(from);
                        else if (o is BaseClothing && (((BaseClothing)o).IDList.Count > 50 && !inlist || from.AccessLevel > AccessLevel.Player))
                            ((BaseClothing)o).RemoveFromIDList(from);
                        else if (o is BaseJewel && (((BaseJewel)o).IDList.Count > 50 && !inlist || from.AccessLevel > AccessLevel.Player))
                            ((BaseJewel)o).RemoveFromIDList(from);
                    }
                    else
                    {
                        from.SendAsciiMessage("You are not certain...");
                        //from.SendLocalizedMessage( 500353 ); // You are not certain...
                    }
                }
                else if ( o is Mobile )
                {
                    ((Mobile)o).OnSingleClick( from );
                }
                else
                {
                    from.SendAsciiMessage("You are not certain...");
                    //from.SendLocalizedMessage( 500353 ); // You are not certain...
                }
            }
Example #11
0
            protected override void OnTarget( Mobile from, object o )
            {
                if ( o is Mobile )
                {
                    // It appears to be:
                    from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1041349, ( (Mobile) o ).Name, from.Client );
                }
                else if ( !from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
                {
                    // You have no idea how much it might be worth.
                    from.SendLocalizedMessage( 1041352 );
                }
                else if ( o is Item )
                {
                    Item item = o as Item;

                    // TODO (SA): Display the value of the item
                    // TODO (SA): When should we show this message? "You conclude that item cannot be magically unraveled. The magic in that item has been weakened due to either low durability or the imbuing process." (1111877)

                    if ( item is IImbuable )
                    {
                        UnravelInfo info = Unraveling.GetUnravelInfo( from, item );

                        if ( info == null )
                        {
                            // You conclude that item cannot be magically unraveled. It appears to possess little to no magic.
                            from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1111876, from.Client );
                        }
                        else
                        {
                            if ( from.Skills[SkillName.Imbuing].Value >= info.MinSkill )
                            {
                                // You conclude that item will magically unravel into: ~1_ingredient~
                                from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1111874, String.Format( "#{0}", info.Name.ToString() ), from.Client );
                            }
                            else
                            {
                                // Your Imbuing skill is not high enough to identify the imbuing ingredient.
                                from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1111875, from.Client );
                            }
                        }
                    }
                    else
                    {
                        // You conclude that item cannot be magically unraveled.
                        from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1111878, from.Client );
                    }
                }
                else
                {
                    // You have no idea how much it might be worth.
                    from.SendLocalizedMessage( 1041352 );
                }
            }
Example #12
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( from == targeted )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, false, "Vous vous connaissez suffisamment ainsi..." ); // You know yourself quite well enough already.
				}
				else if ( targeted is TownCrier )
				{
					((TownCrier)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, false, "Cette personne parait bien portante. Peut-être même a-t-elle des nouvelles pour vous?", from.NetState ); // This person looks fine to me, though he may have some news...
				}
				else if ( targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable )
				{
					((BaseVendor)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, false, "Cette personne semble trop occupée pour être examinée", from.NetState ); // That can not be inspected.
				}
				else if ( targeted is Mobile )
				{
					Mobile targ = (Mobile)targeted;

					int marginOfError = Math.Max( 0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 4) );

					int str = targ.Str + Utility.RandomMinMax( -marginOfError, +marginOfError );
					int dex = targ.Dex + Utility.RandomMinMax( -marginOfError, +marginOfError );
					int stm = ((targ.Stam * 100) / Math.Max( targ.StamMax, 1 )) + Utility.RandomMinMax( -marginOfError, +marginOfError );

					int strMod = str / 10;
					int dexMod = dex / 10;
					int stmMod = stm / 10;

					if ( strMod < 0 ) strMod = 0;
					else if ( strMod > 10 ) strMod = 10;

					if ( dexMod < 0 ) dexMod = 0;
					else if ( dexMod > 10 ) dexMod = 10;

					if ( stmMod > 10 ) stmMod = 10;
					else if ( stmMod < 0 ) stmMod = 0;

					if ( from.CheckTargetSkill( SkillName.Anatomy, targ, 0, 100 ) )
					{
						targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState ); // That looks [strong] and [dexterous].

						if ( from.Skills[SkillName.Anatomy].Base >= 65.0 )
							targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState ); // That being is at [10,20,...] percent endurance.
					}
					else
					{
						targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, false, "Vous ne parvenez pas poser un diagnostic complet", from.NetState ); // You can not quite get a sense of their physical characteristics.
					}
				}
				else if ( targeted is Item )
				{
					from.SendMessage( "Seuls les êtres vivants ont une anatomie!"); // Only living things have anatomies!
				}
			}
Example #13
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( !from.Alive )
                {
                    from.SendAsciiMessage("The spirits of the dead are not the province of animal lore.");
                    //from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore.
                }
                else if ( targeted is BaseCreature )
                {
                    BaseCreature c = (BaseCreature)targeted;

                    if ( !c.IsDeadPet )
                    {
                        if ( c.Body.IsAnimal || c.Body.IsMonster || c.Body.IsSea )
                        {
                            if ( (!c.Controlled || !c.Tamable) && from.Skills[SkillName.AnimalLore].Base < 100.0 )
                            {
                                from.SendAsciiMessage("At your skill level, you can only lore tamed creatures.");
                                //from.SendLocalizedMessage( 1049674 ); // At your skill level, you can only lore tamed creatures.
                            }
                            else if ( !c.Tamable && from.Skills[SkillName.AnimalLore].Base < 110.0 )
                            {
                                from.SendAsciiMessage("At your skill level, you can only lore tamed or tameable creatures.");
                                //from.SendLocalizedMessage( 1049675 ); // At your skill level, you can only lore tamed or tameable creatures.
                            }
                            else if ( !from.CheckTargetSkill( SkillName.AnimalLore, c, 0.0, 100.0 ) )
                            {
                                from.SendAsciiMessage("You can't think of anything you know offhand.");
                                //from.SendLocalizedMessage( 500334 ); // You can't think of anything you know offhand.
                            }
                            else
                            {
                                from.CloseGump( typeof( AnimalLoreGump ) );
                                from.SendGump( new AnimalLoreGump( c ) );
                            }
                        }
                        else
                        {
                            from.SendAsciiMessage("That's not an animal!");
                            //from.SendLocalizedMessage( 500329 ); // That's not an animal!
                        }
                    }
                    else
                    {
                        from.SendAsciiMessage("The spirits of the dead are not the province of animal lore.");
                        //from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore.
                    }
                }
                else
                {
                    from.SendAsciiMessage("That's not an animal!");
                    //from.SendLocalizedMessage( 500329 ); // That's not an animal!
                }
            }
Example #14
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( from == targeted )
                {
                    from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500324 ); // You know yourself quite well enough already.
                }
                else if ( targeted is TownCrier )
                {
                    ((TownCrier)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500322, from.NetState ); // This person looks fine to me, though he may have some news...
                }
                else if ( targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable )
                {
                    ((BaseVendor)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500326, from.NetState ); // That can not be inspected.
                }
                else if ( targeted is Mobile )
                {
                    Mobile targ = (Mobile)targeted;

                    int marginOfError = Math.Max( 0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 4) );

                    int str = targ.Str + Utility.RandomMinMax( -marginOfError, +marginOfError );
                    int dex = targ.Dex + Utility.RandomMinMax( -marginOfError, +marginOfError );
                    int stm = ((targ.Stam * 100) / Math.Max( targ.StamMax, 1 )) + Utility.RandomMinMax( -marginOfError, +marginOfError );

                    int strMod = str / 10;
                    int dexMod = dex / 10;
                    int stmMod = stm / 10;

                    if ( strMod < 0 ) strMod = 0;
                    else if ( strMod > 10 ) strMod = 10;

                    if ( dexMod < 0 ) dexMod = 0;
                    else if ( dexMod > 10 ) dexMod = 10;

                    if ( stmMod > 10 ) stmMod = 10;
                    else if ( stmMod < 0 ) stmMod = 0;

                    if ( from.CheckTargetSkill( SkillName.Anatomy, targ, 0, 100 ) )
                    {
                        targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState ); // That looks [strong] and [dexterous].

                        if ( from.Skills[SkillName.Anatomy].Base >= 65.0 )
                            targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState ); // That being is at [10,20,...] percent endurance.
                    }
                    else
                    {
                        targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1042666, from.NetState ); // You can not quite get a sense of their physical characteristics.
                    }
                }
                else if ( targeted is Item )
                {
                    ((Item)targeted).SendAsciiMessageTo( from, "Only living things have anatomies!" );
                }
            }
Example #15
0
        public override bool CheckSuccess( Mobile from, ILockpickable target )
        {
            // Skeleton key gives +10.0 virtual bonus to Lockpicking skill
            double value = from.Skills[SkillName.Lockpicking].Value + 10.0;

            double minSkill = target.LockLevel;
            double maxSkill = target.MaxLockLevel;

            double chance = ( value - minSkill ) / ( maxSkill - minSkill );

            return from.CheckTargetSkill( SkillName.Lockpicking, target, chance );
        }
protected override void OnTarget(Mobile from, object targetyouselect)
            {
                if (targetyouselect is Item)
                {
                    if (from.CheckTargetSkill(SkillName.ItemID, targetyouselect, 0, 100))
                    {
                        if ( ((Item)targetyouselect).IsChildOf( from.Backpack ) )
                        {
                        	if (targetyouselect is BaseWeapon)
                        	    {
                        		((BaseWeapon)targetyouselect).SkillBonuses.SetValues(0, SkillName.AnimalLore, 0);
								((BaseWeapon)targetyouselect).SkillBonuses.SetValues(1, SkillName.AnimalLore, 0);
                        	    }
                        	else if (targetyouselect is BaseArmor)
                        		{
                        		((BaseArmor)targetyouselect).SkillBonuses.SetValues(0, SkillName.AnimalLore, 0);
                        		((BaseArmor)targetyouselect).SkillBonuses.SetValues(1, SkillName.AnimalLore, 0);
                        		}
                        	else if (targetyouselect is BaseJewel)
                        		{
                        		((BaseJewel)targetyouselect).SkillBonuses.SetValues(0, SkillName.AnimalLore, 0);
                        	    ((BaseJewel)targetyouselect).SkillBonuses.SetValues(1, SkillName.AnimalLore, 0);
								}
                        	else if (targetyouselect is BaseClothing)
                        		{
                        		((BaseClothing)targetyouselect).SkillBonuses.SetValues(0, SkillName.AnimalLore, 0);
                        		((BaseClothing)targetyouselect).SkillBonuses.SetValues(1, SkillName.AnimalLore, 0);
                        		}
                        	else
                        		{
								from.SendMessage("That can not be unenhanced.");
								return; //continue might work also
								}

                            from.SendMessage("You Successfully unenhance the Item.");
                            from.PlaySound(Utility.Random(0x520, 0));
                            m_cOrb.Delete();
                        }
                        else
                        {
                            from.SendMessage("The target item must be in your backpack to use this.");
                            return; //continue might work also
                        }
                    }
                    else
                    from.SendMessage("You fail to unenhance the item. Try again."); // You cannot augment that...
                }
                else if (targetyouselect is Mobile)
                    ((Mobile)targetyouselect).OnSingleClick(from);
                else
                    from.SendMessage("You can only unenhance Weapons, Armors, Jewlery, or Clothing.");
            }
Example #17
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( !from.Alive )
                {
                    from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore.
                }
                else if ( targeted is BaseCreature )
                {
                    BaseCreature c = (BaseCreature) targeted;

                    if ( !c.IsDeadPet )
                    {
                        if ( c.Body.IsAnimal || c.Body.IsMonster || c.Body.IsSea )
                        {
                            if ( ( !c.Controlled || !c.Tamable ) && from.Skills[SkillName.AnimalLore].Base < 100.0 )
                            {
                                from.SendLocalizedMessage( 1049674 ); // At your skill level, you can only lore tamed creatures.
                            }
                            else if ( !c.Tamable && from.Skills[SkillName.AnimalLore].Base < 110.0 )
                            {
                                from.SendLocalizedMessage( 1049675 ); // At your skill level, you can only lore tamed or tameable creatures.
                            }
                            else if ( !from.CheckTargetSkill( SkillName.AnimalLore, c, 0.0, 120.0 ) )
                            {
                                from.SendLocalizedMessage( 500334 ); // You can't think of anything you know offhand.
                            }
                            else if ( ( c is LadyMelisande || c is DreadHorn || c is Travesty || c is MonstrousInterredGrizzle || c is ChiefParoxysmus || c is ShimmeringEffusion ) && 0.01 < Utility.RandomDouble() )
                            {
                                from.SendLocalizedMessage( 500334 ); // You can't think of anything you know offhand.
                            }
                            else
                            {
                                from.CloseGump( typeof( AnimalLoreGump ) );
                                from.SendGump( new AnimalLoreGump( c ) );
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage( 500329 ); // That's not an animal!
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage( 500331 ); // The spirits of the dead are not the province of animal lore.
                    }
                }
                else
                {
                    from.SendLocalizedMessage( 500329 ); // That's not an animal!
                }
            }
Example #18
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (from == targeted)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500324); // You know yourself quite well enough already.
                }
                /*else if (targeted is TownCrier)
                {
                    ((TownCrier)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500322, from.NetState); // This person looks fine to me, though he may have some news...
                }
                else if (targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable)
                {
                    ((BaseVendor)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500326, from.NetState); // That can not be inspected.
                }*/
                else if (targeted is Mobile)
                {
                    Mobile targ = (Mobile)targeted;

                    int strMod = targ.Str / 10;
                    int dexMod = targ.Dex / 10;

                    int stmMod = (int)((targ.Stam / (double)targ.StamMax) * 10);

                    if (strMod < 0) strMod = 0;
                    else if (strMod > 10) strMod = 10;

                    if (dexMod < 0) dexMod = 0;
                    else if (dexMod > 10) dexMod = 10;

                    if (stmMod > 10) stmMod = 10;
                    else if (stmMod < 0) stmMod = 0;

                    if (from.CheckTargetSkill(SkillName.Anatomy, targ, 0, 100))
                    {
                        targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState); // That looks [strong] and [dexterous].

                        //if ( from.Skills[SkillName.Anatomy].Base >= 65.0 )
                        //	targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState ); // That being is at [10,20,...] percent endurance.
                    }
                    else
                    {
                        targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042666, from.NetState); // You can not quite get a sense of their physical characteristics.
                    }
                }
                else if (targeted is Item)
                {
                    ((Item)targeted).SendLocalizedMessageTo(from, 500323, ""); // Only living things have anatomies!
                }
            }
Example #19
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( !from.Alive )
				{
					from.SendMessage( "Les esprits des morts ne font pas partie de votre champ de compétence..." ); // The spirits of the dead are not the province of animal lore.
				}
				else if ( targeted is BaseCreature )
				{
					BaseCreature c = (BaseCreature)targeted;

					if ( !c.IsDeadPet )
					{
						if ( c.Body.IsAnimal || c.Body.IsMonster || c.Body.IsSea )
						{
                            if (!c.Controlled && from.Skills[SkillName.AnimalLore].Value < 100.0)
                            {
                                from.SendMessage("Vu votre expérience, vous ne pouvez approcher que les créatures apprivoisées"); // At your skill level, you can only lore tamed creatures.
                            }
                            else if (!c.Controlled && !c.Tamable && from.Skills[SkillName.AnimalLore].Value < 110.0)
                            {
								from.SendMessage( "Vu votre expérience, seules les créatures qui peuvent être apprivoisées et les domestiquées vous laisseront les approcher" ); // At your skill level, you can only lore tamed or tameable creatures.
							}
							else if ( !from.CheckTargetSkill( SkillName.AnimalLore, c, 0.0, 120.0 ) )
							{
								from.SendMessage( "Vous ne décernez rien d'utile" ); // You can't think of anything you know offhand.
							}
							else
							{
								from.CloseGump( typeof( AnimalLoreGump ) );
								from.SendGump( new AnimalLoreGump( c ) );
							}
						}
						else
						{
							from.SendMessage( "Ceci n'est pas un animal!" ); // That's not an animal!
						}
					}
					else
					{
                        from.SendMessage("Les esprits des morts ne font pas partie de votre champ de compétence..."); // The spirits of the dead are not the province of animal lore.
					}
				}
				else
				{
					from.SendMessage( "Ceci n'est pas un animal!" ); // That's not an animal!
				}
			}
			protected override void OnTarget( Mobile from, object o )
			{
                IEntity entity = o as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, null, 0, null, SkillName.ItemID, from.Skills[SkillName.ItemID].Value))
                {
                    return;
                }
                
                if ( o is Item && !(o is HouseSign))
				{
					Item item = o as Item;

					if ( from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
					{
						if ( o is BaseWeapon )
							((BaseWeapon)o).Identified = true;
						else if ( o is BaseArmor )
							((BaseArmor)o).Identified = true;
						else if ( o is BaseClothing )
							((BaseClothing)o).Identified = true;
						else if ( o is BaseTreasureChest )
						{
							BaseTreasureChest tchest = (BaseTreasureChest)o;
							from.SendMessage( "{0} container with {1} treasure.", tchest.Locked ? "a locked" : "an unlocked", m_TreasureValue[(int)tchest.Level] );
						}

						//if ( !Core.AOS )
							item.OnSingleClick( from );
					}
					else
					{
						from.SendLocalizedMessage( 500353 ); // You are not certain...
					}
				}
				else if ( o is Mobile )
				{
					((Mobile)o).OnSingleClick( from );
				}
				else
				{
					from.SendLocalizedMessage( 500353 ); // You are not certain...
				}
                //allows the identify skill to reveal attachments
                //Server.Engines.XmlSpawner2.XmlAttach.RevealAttachments(from, o); // we don't care about this -Alan
			}
            protected override void OnTarget( Mobile from, object o )
            {
                if ( o is Item )
                {
                    if ( from.CheckTargetSkill( SkillName.Appraisal, o, 0, 100 ) )
                    {
                        if ( o is BaseWeapon )
                            ((BaseWeapon)o).Identified = true;
                        else if ( o is BaseArmor )
                            ((BaseArmor)o).Identified = true;

                        if ( !Core.AOS )
                            ((Item)o).OnSingleClick( from );
                    }
                    else
                    {
                        from.SendLocalizedMessage( 500353 ); // You are not certain...
                    }
                }
                else
                {
                    from.SendLocalizedMessage( 500353 ); // You are not certain...
                }
            }
Example #22
0
		public static void Container_Snoop( Container cont, Mobile from )
		{
			if ( from.AccessLevel > AccessLevel.Player || from.InRange( cont.GetWorldLocation(), 1 ) )
			{
				Mobile root = cont.RootParent as Mobile;

				if ( root != null && !root.Alive )
					return;

				if ( root != null && root.AccessLevel > AccessLevel.Player && from.AccessLevel == AccessLevel.Player )
				{
					from.SendLocalizedMessage( 500209 ); // You can not peek into the container.
					return;
				}

				if ( root != null && from.AccessLevel == AccessLevel.Player && !CheckSnoopAllowed( from, root ) )
				{
					from.SendLocalizedMessage( 1001018 ); // You cannot perform negative acts on your target.
					return;
				}

				if ( root != null && from.AccessLevel == AccessLevel.Player && from.Skills[SkillName.Snooping].Value < Utility.Random( 100 ) )
				{
					Map map = from.Map;

					if ( map != null )
					{
						string message = String.Format( "You notice {0} attempting to peek into {1}'s belongings.", from.Name, root.Name );

						IPooledEnumerable eable = map.GetClientsInRange( from.Location, 8 );

						foreach ( NetState ns in eable )
						{
							if ( ns.Mobile != from )
								ns.Mobile.SendMessage( message );
						}

						eable.Free();
					}
				}

				if ( from.AccessLevel == AccessLevel.Player )
					Titles.AwardKarma( from, -4, true );

				if ( from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill( SkillName.Snooping, cont, 0.0, 100.0 ) )
				{
					if ( cont is TrapableContainer && ((TrapableContainer)cont).ExecuteTrap( from ) )
						return;

					cont.DisplayTo( from );
				}
				else
				{
					from.SendLocalizedMessage( 500210 ); // You failed to peek into the container.
				}
			}
			else
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
			}
		}
		protected void OnTargetWrapper( Mobile from, object target )
		{
			double skillvalue = from.Skills[SkillName.Forensics].Value;
			bool wanted = false;
			bool bonusExists = false;
			int amount = 0;

            if(target == null) //kit 12/29/06 sanity checking
            {
                from.SendMessage("You have specified an invalid target.");
                return;
            }
                
			// Packout old entries;
			m_Book.PackEntries();

			if ( target != null && target is Mobile )
			{
				if ( target is PlayerMobile )
				{
					if ( from == (PlayerMobile)target )
					{
						from.SendMessage( "You may not add yourself to your ledger." );
						return;
					}
				
					foreach( LedgerEntry q in m_Book.Entries )
					{
                        if(q == null || q.Mob == null) //kit 12/19/06 sanity check
                            continue;

						if ( (PlayerMobile)q.Mob == (PlayerMobile)target )
						{
							from.SendMessage( "You may not have duplicate entries." );
							return;
						}
					}
				
					if ( skillvalue > 80 )
					{
						
						if( BountyKeeper.BountiesOnPlayer((PlayerMobile)target) > 0 )
						{
							wanted = true;
						}
						amount = BountyKeeper.RewardForPlayer((PlayerMobile)target);
						bonusExists = BountyKeeper.IsEligibleForLBBonus((PlayerMobile)target);

						if( bonusExists )
						{
							amount += BountyKeeper.CurrentLBBonusAmount;
						}
						
						int infoAmount = 1;
						
						if ( skillvalue > 80 )
							infoAmount = 1;
						if ( skillvalue > 95 )
							infoAmount = Utility.Random( 1, 2 );
						if ( skillvalue > 98 )
							infoAmount = Utility.Random( 2, 3 );
						if ( skillvalue == 100 )
							infoAmount = 3;
							
						string whoWants = bonusExists ? "Lord British" : "an Independant Party";
													
						switch ( infoAmount )
						{
							case 0: 
							{ 
								from.SendMessage( "You don't recall any bounties out on this person." ); 
								break;
							}
							case 1: 
							{ 
								if ( wanted )
								{
									from.SendMessage( "That person is wanted." ); 
									
									LedgerEntry e = new LedgerEntry( (Mobile)target, 0, true );
									m_Book.AddEntry( from, e, m_Book.Entries.Count + 1 );
								}

								else
								{
									from.SendMessage( "That person is not wanted." );
								}

								break;
							}
							case 2: 
							{ 
								if ( wanted )
								{
									from.SendMessage( "That person is wanted by {0}.", whoWants ); 

									LedgerEntry e = new LedgerEntry( (Mobile)target, 0, true );
									m_Book.AddEntry( from, e, m_Book.Entries.Count + 1 );
								}

								else
								{
									from.SendMessage( "That person is not wanted." );
								}

								break;
							}
							case 3:
							{ 
								if ( wanted )
								{
									from.SendMessage( "That person is wanted by {0} for {1} GP!", whoWants, amount.ToString() );
									
									LedgerEntry e = new LedgerEntry( (Mobile)target, amount, true );
									m_Book.AddEntry( from, e, m_Book.Entries.Count + 1 );
								}
								else
								{
									from.SendMessage( "That person is not wanted." );
								}
	
								break;
							}
							default: 
							{
								if ( wanted )
								{
									from.SendMessage( "You don't recall any bounties out on this person." ); 
								}
								else
								{
									from.SendMessage( "That person is not wanted." );
								}
								break;
							}

						}
					}
					else
					{
						from.SendMessage( "You fail to recall any bounties out on this person." );
					}
				}
				else
				{
					from.SendMessage( "You can not evaluate their status." );
				}
			}
			else if ( target != null && target is Corpse )
			{
// Looters ----
				if ( from.CheckTargetSkill( SkillName.Forensics, target, 25.0, 100.0 ) )
				{
					Corpse c = (Corpse)target;
					ArrayList looters = new ArrayList();

					if ( c.Looters.Count > 0 )
					{
						foreach ( Mobile mob in c.Looters )
						{
                            if(mob == null) //kit 12/29/06 sanity check
                                continue;

							if ( mob is PlayerMobile )
								looters.Add( mob );
						}
					}
					else
					{
						c.LabelTo( from, 501002 );//The corpse has not been desecrated.
					}
					
					if ( !(c.Killer is PlayerMobile) )
					{
						c.LabelTo( from, "They were killed by {0} (NPC)", c.Killer.Name );
					}
// Corpse Gump Management ----						
					if ( ((Body)c.Amount).IsHuman && c.Killer != null && looters != null && looters.Count > 0 && c.Killer is PlayerMobile )
					{
						from.SendGump( new ForensicChoiceGump( from, c.Killer, looters, m_Book ) );
						return;
					}
					else if ( ((Body)c.Amount).IsHuman && c.Killer != null && c.Killer is PlayerMobile )
					{
						from.SendGump( new ForensicKillerGump( from, c.Killer, m_Book ) );
						return;
					}
					else if ( looters != null && looters.Count > 0 )
					{
						from.SendGump( new ForensicLootGump( from, looters, 0, m_Book ) );
						return;
					}

				}
				else
				{
					from.SendLocalizedMessage( 501001 );//You cannot determain anything useful.
				}
			}
			else
			{
				from.SendMessage( "You have specified an invalid target. Try again." );
				from.Target = new AddEntryTarget( m_Book );
			}
		}
Example #24
0
		public static void Container_Snoop( Container cont, Mobile from )
		{
			/*if (!(from.Target is Stealing.StealingTarget) && DateTime.UtcNow < from.NextSkillTime)
			{
				from.SendMessage("You must wait a moment before you can snoop again.");
				return;
			}*/

			if ( from.AccessLevel > AccessLevel.Player || from.InRange( cont.GetWorldLocation(), 1 ) )
			{
				Mobile root = cont.RootParent as Mobile;

				if ( root != null )
				{
					if ( root.Alive )
					{
						if ( root.AccessLevel > AccessLevel.Player && from.AccessLevel == AccessLevel.Player )
						{
							from.SendLocalizedMessage( 500209 ); // You can not peek into the container.
							return;
						}
						else if ( from.AccessLevel == AccessLevel.Player && !CheckSnoopAllowed( from, root ) )
						{
							from.SendLocalizedMessage( 1001018 ); // You cannot perform negative acts on your target.
							return;
						}
						else if ( from.AccessLevel == AccessLevel.Player && from.Skills[SkillName.Snooping].Value < Utility.Random( 100 ) )
						{
							Map map = from.Map;

							if ( map != null )
							{
								root.SendMessage( String.Format( "You notice {0} attempting to peek into your belongings.", from.Name ) );

								string message = String.Format( "You notice {0} attempting to peek into {1}'s belongings.", from.Name, root.Name );

								IPooledEnumerable eable = map.GetClientsInRange( from.Location, 8 );

								foreach ( NetState ns in eable )
									if ( ns.Mobile != from && ns.Mobile != root )
										ns.Mobile.SendMessage( message );

								eable.Free();
							}
						}
					}
					else
						return;
				}

				if ( from.AccessLevel == AccessLevel.Player )
					Misc.Titles.AwardKarma(from, -4, true);

				if ( from.AccessLevel > AccessLevel.Player || from.CheckTargetSkill( SkillName.Snooping, cont, 0.0, 100.0 ) )
				{
					if (!(cont is TrapableContainer && ((TrapableContainer)cont).ExecuteTrap(from)))
					{
						cont.DisplayTo(from);

						//from.NextSkillTime = DateTime.UtcNow.AddSeconds(cont.Parent is Container ? 0.315 : 1.15);
					}
				}
				else
				{
					from.SendLocalizedMessage( 500210 ); // You failed to peek into the container.
					if ( from.Skills[SkillName.Hiding].Value / 2 < Utility.Random( 100 ) )
						from.RevealingAction();
				}
			}
			else
				from.SendLocalizedMessage( 500446 ); // That is too far away.
		}
Example #25
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_ItemSrc.Deleted )
					return;

				if (targeted is Moonstone)
				{
					Moonstone stone = (Moonstone)targeted;

					if (!(m_ItemSrc is RecallRune))
						from.SendMessage("You cannot copy that to a moonstone.");
					else if (!((RecallRune)m_ItemSrc).Marked)
						from.SendMessage("You cannot copy an unmarked recall rune.");
					else if (Inscribe.GetUser(stone) != null)
						from.SendLocalizedMessage(501621);
					else
					{
						if (from.Mana < 20)
						{
							from.SendMessage("You have insufficient mana to copy the recall rune.");
							return;
						}
							
						Container pack = from.Backpack;
						if (pack == null)
						{
							from.SendMessage("You have no backpack! Contact a GM immediately.");
							return;
						}
						if (pack.ConsumeUpTo(typeof(PowderOfTranslocation), 1) != 1)
						{
							from.SendMessage("You must have some powder of translocation to mark the moonstone.");
							return;
						}

						from.Mana -= 20;
							
						if (Utility.RandomDouble() * 100 >= (100.0 - ((from.Skills[SkillName.Inscribe].Value + from.Skills[SkillName.Magery].Value) / 2.0)) * 2.0)
						{
							RecallRune rune = (RecallRune)m_ItemSrc;
							stone.Marked = true;
							stone.Description = "a moonstone for " + rune.Description;
							stone.Destination = rune.Target;

							from.SendMessage("You copy the rune.");

							from.PlaySound( 0x1FA );
							Effects.SendLocationEffect( rune, rune.Map, 14201, 16 );
							Effects.SendLocationEffect( stone, stone.Map, 14201, 16 );
						}
						else
							from.SendMessage("You fail to copy the recall rune.");
					}
				}
				else if (targeted is BaseBook)
				{
					BaseBook bookDst = (BaseBook)targeted;

					if (!(m_ItemSrc is BaseBook))
						from.SendMessage("You cannot copy that to a book.");
					else if ( Inscribe.IsEmpty( m_ItemSrc as BaseBook ) )
						from.SendLocalizedMessage( 501611 ); // Can't copy an empty book.
					else if ( bookDst == m_ItemSrc )
						from.SendLocalizedMessage( 501616 ); // Cannot copy a book onto itself.
					else if ( !bookDst.Writable )
						from.SendLocalizedMessage( 501614 ); // Cannot write into that book.
					else if ( Inscribe.GetUser( bookDst ) != null )
						from.SendLocalizedMessage( 501621 ); // Someone else is inscribing that item.
					else
					{
						if ( from.CheckTargetSkill( SkillName.Inscribe, bookDst, 0, 50 ) )
						{
							Inscribe.CopyBook( m_ItemSrc as BaseBook, bookDst );

							from.SendLocalizedMessage( 501618 ); // You make a copy of the book.
							from.PlaySound( 0x249 );
						}
						else
						{
							from.SendLocalizedMessage( 501617 ); // You fail to make a copy of the book.
						}
					}
				}
				else
					from.SendMessage("You are unable to copy those two items.");
			}
Example #26
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                int OldHue = 0;

                if ( from == targeted )
                {
                    from.LocalOverheadMessage( MessageType.Regular, 0x3B2, true, "You know yourself quite well enough already." ); // You know yourself quite well enough already.
                }
                else if ( targeted is TownCrier )
                {
                    ((TownCrier)targeted).SayTo(from, true, "This person looks fine to me, though he may have some news...");
                    //((TownCrier)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500322, from.NetState ); // This person looks fine to me, though he may have some news...
                }
                else if ( targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable )
                {
                    OldHue = ((BaseVendor)targeted).SpeechHue;
                    ((BaseVendor)targeted).SpeechHue = 0;
                    ((BaseVendor)targeted).SayTo(from, true, "That can not be inspected.");
                    //((BaseVendor)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500326, from.NetState ); // That can not be inspected.
                    ((BaseVendor)targeted).SpeechHue = OldHue;
                }
                else if ( targeted is Mobile )
                {
                    Mobile targ = (Mobile)targeted;

                    OldHue = targ.SpeechHue;
                    targ.SpeechHue = 0;

                    int marginOfError = Math.Max( 0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 4) );

                    int str = targ.Str + Utility.RandomMinMax( -marginOfError, +marginOfError );
                    int dex = targ.Dex + Utility.RandomMinMax( -marginOfError, +marginOfError );
                    int stm = ((targ.Stam * 100) / Math.Max( targ.StamMax, 1 )) + Utility.RandomMinMax( -marginOfError, +marginOfError );

                    int strMod = str / 10;
                    int dexMod = dex / 10;
                    int stmMod = stm / 10;

                    if ( strMod < 0 ) strMod = 0;
                    else if ( strMod > 10 ) strMod = 10;

                    if ( dexMod < 0 ) dexMod = 0;
                    else if ( dexMod > 10 ) dexMod = 10;

                    if ( stmMod > 10 ) stmMod = 10;
                    else if ( stmMod < 0 ) stmMod = 0;

                    if ( from.CheckTargetSkill( SkillName.Anatomy, targ, 0, 100 ) )
                    {
                        switch (strMod)
                        {
                            case 0:
                                switch (dexMod)
                                {
                                    case 0: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and like they barely manage to stay standing."); break;
                                    case 1: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and very clumsy."); break;
                                    case 2: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and somewhat uncoordinated."); break;
                                    case 3: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and moderately dexterous."); break;
                                    case 4: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and somewhat agile."); break;
                                    case 5: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and very agile."); break;
                                    case 6: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and extremely agile."); break;
                                    case 7: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and extraordinarily agile."); break;
                                    case 8: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and moves like quicksilver."); break;
                                    case 9: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and faster than anything you have ever seen."); break;
                                    case 10: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and superhumanly agile."); break;
                                } break;
                            case 1:
                                switch (dexMod)
                                {
                                    case 0: targ.SayTo(from, true, "That looks rather feeble and like they barely manage to stay standing."); break;
                                    case 1: targ.SayTo(from, true, "That looks rather feeble and very clumsy."); break;
                                    case 2: targ.SayTo(from, true, "That looks rather feeble and somewhat uncoordinated."); break;
                                    case 3: targ.SayTo(from, true, "That looks rather feeble and moderately dexterous."); break;
                                    case 4: targ.SayTo(from, true, "That looks rather feeble and somewhat agile."); break;
                                    case 5: targ.SayTo(from, true, "That looks rather feeble and very agile."); break;
                                    case 6: targ.SayTo(from, true, "That looks rather feeble and extremely agile."); break;
                                    case 7: targ.SayTo(from, true, "That looks rather feeble and extraordinarily agile."); break;
                                    case 8: targ.SayTo(from, true, "That looks rather feeble and moves like quicksilver."); break;
                                    case 9: targ.SayTo(from, true, "That looks rather feeble and faster than anything you have ever seen."); break;
                                    case 10: targ.SayTo(from, true, "That looks rather feeble and superhumanly agile."); break;
                                } break;
                            case 2:
                                switch (dexMod)
                                {
                                    case 0: targ.SayTo(from, true, "That looks somewhat weak and like they barely manage to stay standing."); break;
                                    case 1: targ.SayTo(from, true, "That looks somewhat weak and very clumsy."); break;
                                    case 2: targ.SayTo(from, true, "That looks somewhat weak and somewhat uncoordinated."); break;
                                    case 3: targ.SayTo(from, true, "That looks somewhat weak and moderately dexterous."); break;
                                    case 4: targ.SayTo(from, true, "That looks somewhat weak and somewhat agile."); break;
                                    case 5: targ.SayTo(from, true, "That looks somewhat weak and very agile."); break;
                                    case 6: targ.SayTo(from, true, "That looks somewhat weak and extremely agile."); break;
                                    case 7: targ.SayTo(from, true, "That looks somewhat weak and extraordinarily agile."); break;
                                    case 8: targ.SayTo(from, true, "That looks somewhat weak and moves like quicksilver."); break;
                                    case 9: targ.SayTo(from, true, "That looks somewhat weak and faster than anything you have ever seen."); break;
                                    case 10: targ.SayTo(from, true, "That looks somewhat weak and superhumanly agile."); break;
                                } break;
                            case 3:
                                switch (dexMod)
                                {
                                    case 0: targ.SayTo(from, true, "That looks to be of normal strength and like they barely manage to stay standing."); break;
                                    case 1: targ.SayTo(from, true, "That looks to be of normal strength and very clumsy."); break;
                                    case 2: targ.SayTo(from, true, "That looks to be of normal strength and somewhat uncoordinated."); break;
                                    case 3: targ.SayTo(from, true, "That looks to be of normal strength and moderately dexterous."); break;
                                    case 4: targ.SayTo(from, true, "That looks to be of normal strength and somewhat agile."); break;
                                    case 5: targ.SayTo(from, true, "That looks to be of normal strength and very agile."); break;
                                    case 6: targ.SayTo(from, true, "That looks to be of normal strength and extremely agile."); break;
                                    case 7: targ.SayTo(from, true, "That looks to be of normal strength and extraordinarily agile."); break;
                                    case 8: targ.SayTo(from, true, "That looks to be of normal strength and moves like quicksilver."); break;
                                    case 9: targ.SayTo(from, true, "That looks to be of normal strength and faster than anything you have ever seen."); break;
                                    case 10: targ.SayTo(from, true, "That looks to be of normal strength and superhumanly agile."); break;
                                } break;
                            case 4:
                                switch (dexMod)
                                {
                                    case 0: targ.SayTo(from, true, "That looks somewhat strong and like they barely manage to stay standing."); break;
                                    case 1: targ.SayTo(from, true, "That looks somewhat strong and very clumsy."); break;
                                    case 2: targ.SayTo(from, true, "That looks somewhat strong and somewhat uncoordinated."); break;
                                    case 3: targ.SayTo(from, true, "That looks somewhat strong and moderately dexterous."); break;
                                    case 4: targ.SayTo(from, true, "That looks somewhat strong and somewhat agile."); break;
                                    case 5: targ.SayTo(from, true, "That looks somewhat strong and very agile."); break;
                                    case 6: targ.SayTo(from, true, "That looks somewhat strong and extremely agile."); break;
                                    case 7: targ.SayTo(from, true, "That looks somewhat strong and extraordinarily agile."); break;
                                    case 8: targ.SayTo(from, true, "That looks somewhat strong and moves like quicksilver."); break;
                                    case 9: targ.SayTo(from, true, "That looks somewhat strong and faster than anything you have ever seen."); break;
                                    case 10: targ.SayTo(from, true, "That looks somewhat strong and superhumanly agile."); break;
                                } break;
                            case 5:
                                switch (dexMod)
                                {
                                    case 0: targ.SayTo(from, true, "That looks very strong and like they barely manage to stay standing."); break;
                                    case 1: targ.SayTo(from, true, "That looks very strong and very clumsy."); break;
                                    case 2: targ.SayTo(from, true, "That looks very strong and somewhat uncoordinated."); break;
                                    case 3: targ.SayTo(from, true, "That looks very strong and moderately dexterous."); break;
                                    case 4: targ.SayTo(from, true, "That looks very strong and somewhat agile."); break;
                                    case 5: targ.SayTo(from, true, "That looks very strong and very agile."); break;
                                    case 6: targ.SayTo(from, true, "That looks very strong and extremely agile."); break;
                                    case 7: targ.SayTo(from, true, "That looks very strong and extraordinarily agile."); break;
                                    case 8: targ.SayTo(from, true, "That looks very strong and moves like quicksilver."); break;
                                    case 9: targ.SayTo(from, true, "That looks very strong and faster than anything you have ever seen."); break;
                                    case 10: targ.SayTo(from, true, "That looks very strong and superhumanly agile."); break;
                                } break;
                            case 6:
                                switch (dexMod)
                                {
                                    case 0: targ.SayTo(from, true, "That looks extremely strong and like they barely manage to stay standing."); break;
                                    case 1: targ.SayTo(from, true, "That looks extremely strong and very clumsy."); break;
                                    case 2: targ.SayTo(from, true, "That looks extremely strong and somewhat uncoordinated."); break;
                                    case 3: targ.SayTo(from, true, "That looks extremely strong and moderately dexterous."); break;
                                    case 4: targ.SayTo(from, true, "That looks extremely strong and somewhat agile."); break;
                                    case 5: targ.SayTo(from, true, "That looks extremely strong and very agile."); break;
                                    case 6: targ.SayTo(from, true, "That looks extremely strong and extremely agile."); break;
                                    case 7: targ.SayTo(from, true, "That looks extremely strong and extraordinarily agile."); break;
                                    case 8: targ.SayTo(from, true, "That looks extremely strong and moves like quicksilver."); break;
                                    case 9: targ.SayTo(from, true, "That looks extremely strong and faster than anything you have ever seen."); break;
                                    case 10: targ.SayTo(from, true, "That looks extremely strong and superhumanly agile."); break;
                                } break;
                            case 7:
                                switch (dexMod)
                                {
                                    case 0: targ.SayTo(from, true, "That looks extraordinarily strong and like they barely manage to stay standing."); break;
                                    case 1: targ.SayTo(from, true, "That looks extraordinarily strong and very clumsy."); break;
                                    case 2: targ.SayTo(from, true, "That looks extraordinarily strong and somewhat uncoordinated."); break;
                                    case 3: targ.SayTo(from, true, "That looks extraordinarily strong and moderately dexterous."); break;
                                    case 4: targ.SayTo(from, true, "That looks extraordinarily strong and somewhat agile."); break;
                                    case 5: targ.SayTo(from, true, "That looks extraordinarily strong and very agile."); break;
                                    case 6: targ.SayTo(from, true, "That looks extraordinarily strong and extremely agile."); break;
                                    case 7: targ.SayTo(from, true, "That looks extraordinarily strong and extraordinarily agile."); break;
                                    case 8: targ.SayTo(from, true, "That looks extraordinarily strong and moves like quicksilver."); break;
                                    case 9: targ.SayTo(from, true, "That looks extraordinarily strong and faster than anything you have ever seen."); break;
                                    case 10: targ.SayTo(from, true, "That looks extraordinarily strong and superhumanly agile."); break;
                                } break;
                            case 8:
                                switch (dexMod)
                                {
                                    case 0: targ.SayTo(from, true, "That looks strong as an ox and like they barely manage to stay standing."); break;
                                    case 1: targ.SayTo(from, true, "That looks strong as an ox and very clumsy."); break;
                                    case 2: targ.SayTo(from, true, "That looks strong as an ox and somewhat uncoordinated."); break;
                                    case 3: targ.SayTo(from, true, "That looks strong as an ox and moderately dexterous."); break;
                                    case 4: targ.SayTo(from, true, "That looks strong as an ox and somewhat agile."); break;
                                    case 5: targ.SayTo(from, true, "That looks strong as an ox and very agile."); break;
                                    case 6: targ.SayTo(from, true, "That looks strong as an ox and extremely agile."); break;
                                    case 7: targ.SayTo(from, true, "That looks strong as an ox and extraordinarily agile."); break;
                                    case 8: targ.SayTo(from, true, "That looks strong as an ox and moves like quicksilver."); break;
                                    case 9: targ.SayTo(from, true, "That looks strong as an ox and faster than anything you have ever seen."); break;
                                    case 10: targ.SayTo(from, true, "That looks strong as an ox and superhumanly agile."); break;
                                } break;
                            case 9:
                                switch (dexMod)
                                {
                                    case 0: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and like they barely manage to stay standing."); break;
                                    case 1: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and very clumsy."); break;
                                    case 2: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and somewhat uncoordinated."); break;
                                    case 3: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and moderately dexterous."); break;
                                    case 4: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and somewhat agile."); break;
                                    case 5: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and very agile."); break;
                                    case 6: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and extremely agile."); break;
                                    case 7: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and extraordinarily agile."); break;
                                    case 8: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and moves like quicksilver."); break;
                                    case 9: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and faster than anything you have ever seen."); break;
                                    case 10: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and superhumanly agile."); break;
                                } break;
                            case 10:
                                switch (dexMod)
                                {
                                    case 0: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                                    case 1: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                                    case 2: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                                    case 3: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                                    case 4: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                                    case 5: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                                    case 6: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                                    case 7: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                                    case 8: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                                    case 9: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                                    case 10: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                                } break;

                        }
                        //targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState ); // That looks [strong] and [dexterous].

                        if (from.Skills[SkillName.Anatomy].Base >= 65.0)
                        {
                            switch(stmMod)
                            {
                                case 0: targ.SayTo(from, true, "This being is at zero percent endurance."); break;
                                case 1: targ.SayTo(from, true, "This being is at ten percent endurance."); break;
                                case 2: targ.SayTo(from, true, "This being is at twenty percent endurance."); break;
                                case 3: targ.SayTo(from, true, "This being is at thirty percent endurance."); break;
                                case 4: targ.SayTo(from, true, "This being is at forty percent endurance."); break;
                                case 5: targ.SayTo(from, true, "This being is at fifty percent endurance."); break;
                                case 6: targ.SayTo(from, true, "This being is at sixty percent endurance."); break;
                                case 7: targ.SayTo(from, true, "This being is at seventy percent endurance."); break;
                                case 8: targ.SayTo(from, true, "This being is at eighty percent endurance."); break;
                                case 9: targ.SayTo(from, true, "This being is at ninety percent endurance."); break;
                                case 10: targ.SayTo(from, true, "This being is at one-hundred percent endurance."); break;
                            }
                            //targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState); // That being is at [10,20,...] percent endurance.
                            targ.SpeechHue = OldHue;
                        }
                    }
                    else
                    {
                        OldHue = targ.SpeechHue;
                        targ.SpeechHue = 0;
                        targ.SayTo(from, true, "You can not quite get a sense of their physical characteristics.");
                        targ.SpeechHue = OldHue;
                        //targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1042666, from.NetState ); // You can not quite get a sense of their physical characteristics.
                    }
                }
                else if ( targeted is Item )
                {
                    from.Send(new AsciiMessage(((Item)targeted).Serial, ((Item)targeted).ItemID, MessageType.Regular, 0, 3, "", "Only living things have anatomies!"));
                    //((Item)targeted).SendLocalizedMessageTo( from, 500323, "" ); // Only living things have anatomies!
                }
            }
Example #27
0
			protected override void OnTarget( Mobile from, object targeted )
			{


                IEntity entity = targeted as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, null, 0, null, SkillName.EvalInt, from.Skills[SkillName.EvalInt].Value))
                {
                    return;
                }
                
                if ( from == targeted )
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500910 ); // Hmm, that person looks really silly.
				else if ( targeted is TownCrier )
					((TownCrier)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500907, from.NetState ); // He looks smart enough to remember the news.  Ask him about it.
				else if ( targeted is BaseVendor /*&& ((BaseVendor)targeted).IsInvulnerable*/ )
					((BaseVendor)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500909, from.NetState ); // That person could probably calculate the cost of what you buy from them.
				else if ( targeted is BaseGuard )
					((BaseGuard)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, false, "That person looks smart enough to find criminals and apprehend them.", from.NetState );
				else if ( targeted is Mobile )
				{
					Mobile targ = (Mobile)targeted;

					if ( targ.AccessLevel > AccessLevel.Player )
						targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, false, "That entity is more powerful than mortal minds can comprehend.", from.NetState );
					else
					{
						int marginOfError = Math.Max( 0, 20 - (int)(from.Skills[SkillName.EvalInt].Value / 5) );

						int intel = targ.Int + Utility.RandomMinMax( -marginOfError, +marginOfError );
						int curmana = targ.Mana;
						if ( targ.ManaMax == 0 ) //Mongbats
							curmana = 1;

						int mana = ((curmana * 100) / Math.Max( targ.ManaMax, 1 )) + Utility.RandomMinMax( -marginOfError, +marginOfError );

						int intMod = intel / 10;
						int mnMod = mana / 10;

						if ( intMod > 10 ) intMod = 10;
						else if ( intMod < 0 ) intMod = 0;

						if ( mnMod > 10 ) mnMod = 10;
						else if ( mnMod < 0 ) mnMod = 0;

						int body;

						if ( targ.Body.IsHuman )
							body = targ.Female ? 11 : 0;
						else
							body = 22;

						if ( from.CheckTargetSkill( SkillName.EvalInt, targ, 0.0, 120.0 ) )
						{
							targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038169 + intMod + body, from.NetState ); // He/She/It looks [slighly less intelligent than a rock.]  [Of Average intellect] [etc...]

							if ( from.Skills[SkillName.EvalInt].Base >= 76.0 )
								targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038202 + mnMod, from.NetState ); // That being is at [10,20,...] percent mental strength.
						}
						else
						{
							targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038166 + (body / 11), from.NetState ); // You cannot judge his/her/its mental abilities.
						}
					}
				}
				else if ( targeted is Item )
				{
					((Item)targeted).SendLocalizedMessageTo( from, 500908, "" ); // It looks smarter than a rock, but dumber than a piece of wood.
				}
			}
Example #28
0
        public static bool CheckBardSkillChance( Mobile from, SkillName skill, object target, double minSkill, double maxSkill )
        {
            double chance = GetBardSkillChance( from, skill, minSkill, maxSkill );

            return from.CheckTargetSkill( skill, target, chance );
        }
Example #29
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_BookSrc.Deleted )
					return;

				BaseBook bookDst = targeted as BaseBook;

				if ( bookDst == null )
					from.SendLocalizedMessage( 1046296 ); // That is not a book
				else if ( Inscribe.IsEmpty( m_BookSrc ) )
					from.SendLocalizedMessage( 501611 ); // Can't copy an empty book.
				else if ( bookDst == m_BookSrc )
					from.SendLocalizedMessage( 501616 ); // Cannot copy a book onto itself.
				else if ( !bookDst.Writable )
					from.SendLocalizedMessage( 501614 ); // Cannot write into that book.
				else if ( Inscribe.GetUser( bookDst ) != null )
					from.SendLocalizedMessage( 501621 ); // Someone else is inscribing that item.
				else
				{
					if ( from.CheckTargetSkill( SkillName.Inscribe, bookDst, 0, 50 ) )
					{
						Inscribe.Copy( m_BookSrc, bookDst );

						from.SendLocalizedMessage( 501618 ); // You make a copy of the book.
						from.PlaySound( 0x249 );
					}
					else
					{
						from.SendLocalizedMessage( 501617 ); // You fail to make a copy of the book.
					}
				}
			}
		public override void OnDoubleClick( Mobile from )
		{
			
			if ( from.Mounted )
			{
				from.SendMessage( "You cannot reach. It may be best to dismount." ); 
				return; 
			}
			
			if ( from.InRange( this.GetWorldLocation(), 2 ) ) 
			{ 
				if ( m_yield < 1 )
				{
					from.SendMessage( "There is nothing here to harvest." ); 
					
				}
				
				else if ( from.CheckTargetSkill( SkillName.TasteID, this, 0, 25 ) )
				{
					if(from.Skills[SkillName.TasteID].Base<50)
					{
						from.AddToBackpack( new Mushrooms( this.ItemID ) );
						from.SendMessage( "You find some edible mushrooms!" );
						
					}
					else if(from.Skills[SkillName.TasteID].Base>=50)
					{
					//	switch (Utility.Random(3))
					//	{
					//	 	case 0:
							from.AddToBackpack( new Mushrooms(this.ItemID ) );
							from.SendMessage( "You find some edible mushrooms!" );
					//		break;
					//	 	case 1:
					//		from.AddToBackpack( new DestroyingAngel( Utility.Random(4) ) );
					//		from.SendMessage( "You find some special mushrooms!" );
					//		break;
					//		case 2:
					//		from.AddToBackpack( new ExecutionersCap( Utility.Random(4) ) );
					//		from.SendMessage( "You find some special mushrooms!" );
					//		break;
					//	}
					}
					m_yield-=1;
					
					
				}
				else
				{
					from.SendMessage( "You fail to find any edible mushrooms." );
				}
			}
		}