示例#1
0
 protected override void OnTarget(Mobile from, object targeted)
 {
     if (targeted is Item)
     {
         Item item = (Item)targeted;
         if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
         {
             from.SendLocalizedMessage(500446);                           // That is too far away.
         }
         else if (!item.Deleted && item.Dyable && m_Tub.IsDyable(item))
         {
             m_Tub.Dye(from, item);
         }
         else
         {
             TextDefinition.SendMessageTo(from, m_Tub.FailMessage);
         }
     }
     else
     {
         TextDefinition.SendMessageTo(from, m_Tub.FailMessage);
     }
 }
示例#2
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( targeted is Item )
				{
					Item item = (Item)targeted;

					if ( item is IDyable && m_Tub.AllowDyables )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						else if ( item.Parent is Mobile )
							from.SendLocalizedMessage( 500861 ); // Can't Dye clothing that is being worn.
						else if ( ((IDyable)item).Dye( from, m_Tub ) )
							from.PlaySound( 0x23E );
					}
					else if ( FurnitureAttribute.Check( item ) )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else
						{
							bool okay = ( item.IsChildOf( from.Backpack ) );

							if ( !okay )
							{
								if ( item.Parent == null )
								{
									BaseHouse house = BaseHouse.FindHouseAt( item );

									if ( house == null || ( !house.IsLockedDown( item ) && !house.IsSecure( item ) ) )
										from.SendLocalizedMessage( 501022 ); // Furniture must be locked down to paint it.
									else if ( !house.IsCoOwner( from ) )
										from.SendLocalizedMessage( 501023 ); // You must be the owner to use this item.
									else
										okay = true;
								}
								else
								{
									from.SendLocalizedMessage( 1048135 ); // The furniture must be in your backpack to be painted.
								}
							}

							if ( okay )
							{
								item.Hue = m_Tub.DyedHue;
								from.PlaySound( 0x23E );
							}
						}
					}
					else if ( (item is Runebook || item is RecallRune ) && m_Tub.AllowRunebooks )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1049776 ); // You cannot dye runes or runebooks that are locked down.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if (	item is ILevelable || 
								item is IGiftable || 
								item is BaseBoatDeed || 
								item is HouseDeed || 
								item is HousePlacementTool || 
								item is BaseDockedBoat || 
								item is MagicCloak || 
								item is MagicHat || 
								item is Pillows || 
								item is ColoredWallTorch || 
								item is BaseQuiver || 
								item is MagicBelt || 
								item is MagicSash || 
								item is MagicBoots || 
								item is MagicRobe || 
								item is HairDyeBottle || 
								item is HairDyePotion || 
								item is ThrowingGloves || 
								item is LevelPugilistGloves || 
								item is LevelThrowingGloves || 
								item is GiftPugilistGloves || 
								item is GiftThrowingGloves || 
								item is PugilistGlove || 
								item is PugilistGloves ) // WIZARD ADDED FOR SPECIAL CLOTHES
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else if ( item.Parent is Mobile )
						{
							from.SendLocalizedMessage( 500861 ); // Can't Dye clothing that is being worn.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}

						if ( ( item is BaseBoatDeed || item is BaseDockedBoat ) && item.Hue < 1 ){ item.Hue = 0x5BE; }
					}
					else if ( item is DDRelicRugAddonDeed ) // WIZARD ADDED TO DYE RELIC RUGS
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							DDRelicRugAddonDeed relic = (DDRelicRugAddonDeed)item;
							relic.RelicColor = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if ( item is HenchmanFamiliarItem || item is WaxPainting || item is WaxSculptors || item is WaxSculptorsD || item is WaxSculptorsE || item is ColorCandleShort || item is ColorCandleLong ) // WIZARD ADDED
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if ( ( item is MyTentEastAddonDeed ) || ( item is MyTentSouthAddonDeed ) ) // WIZARD ADDED TO DYE TENTS
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							if ( item is MyTentEastAddonDeed ) { MyTentEastAddonDeed tent = (MyTentEastAddonDeed)item; tent.TentColor = m_Tub.DyedHue; }
							else { MyTentSouthAddonDeed tent = (MyTentSouthAddonDeed)item; tent.TentColor = m_Tub.DyedHue; }
							from.PlaySound( 0x23E );
						}
					}
					else if ( item is MonsterStatuette && m_Tub.AllowStatuettes )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1049779 ); // You cannot dye statuettes that are locked down.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if ( item is BaseArmor && ( Server.Misc.MaterialInfo.IsAnyKindOfClothItem( item ) || item is ElvenBoots ) && m_Tub.AllowLeather )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042419 ); // You may not dye leather items which are locked down.
						}
						else if ( item.Parent is Mobile )
						{
							from.SendLocalizedMessage( 500861 ); // Can't Dye clothing that is being worn.
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if ( item is BaseArmor && ( Server.Misc.MaterialInfo.IsAnyKindOfMetalItem( item ) || Server.Misc.MaterialInfo.IsAnyKindOfWoodItem( item ) ) && m_Tub.AllowArmor )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else if ( item.Parent is Mobile )
						{
							from.SendMessage( "Can't Dye armor that is equipped." );
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else if ( item is BaseWeapon && m_Tub.AllowWeapons )
					{
						if ( !from.InRange( m_Tub.GetWorldLocation(), 1 ) || !from.InRange( item.GetWorldLocation(), 1 ) )
						{
							from.SendLocalizedMessage( 500446 ); // That is too far away.
						}
						else if ( !item.Movable )
						{
							from.SendLocalizedMessage( 1042083 ); // You cannot dye that.
						}
						else if ( item.Parent is Mobile )
						{
							from.SendMessage( "Can't Dye weapons that are equipped." );
						}
						else
						{
							item.Hue = m_Tub.DyedHue;
							from.PlaySound( 0x23E );
						}
					}
					else
					{
						from.SendLocalizedMessage( m_Tub.FailMessage );
					}
				}
				else
				{
					from.SendLocalizedMessage( m_Tub.FailMessage );
				}
			}
示例#3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item item)
                {
                    if (item is IDyable dyable && m_Tub.AllowDyables)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446); // That is too far away.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861); // Can't Dye clothing that is being worn.
                        }
                        else if (dyable.Dye(from, m_Tub))
                        {
                            from.PlaySound(0x23E);
                        }
                    }
                    else if ((FurnitureAttribute.Check(item) || item is PotionKeg) && m_Tub.AllowFurniture)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446); // That is too far away.
                        }
                        else
                        {
                            bool okay = item.IsChildOf(@from.Backpack);

                            if (!okay)
                            {
                                if (item.Parent == null)
                                {
                                    BaseHouse house = BaseHouse.FindHouseAt(item);

                                    if (house == null || !house.IsLockedDown(item) && !house.IsSecure(item))
                                    {
                                        from.SendLocalizedMessage(501022); // Furniture must be locked down to paint it.
                                    }
                                    else if (!house.IsCoOwner(from))
                                    {
                                        from.SendLocalizedMessage(501023); // You must be the owner to use this item.
                                    }
                                    else
                                    {
                                        okay = true;
                                    }
                                }
                                else
                                {
                                    from.SendLocalizedMessage(
                                        1048135); // The furniture must be in your backpack to be painted.
                                }
                            }

                            if (okay)
                            {
                                item.Hue = m_Tub.DyedHue;
                                from.PlaySound(0x23E);
                            }
                        }
                    }
                    else if ((item is Runebook || item is RecallRune) && m_Tub.AllowRunebooks)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446); // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(
                                1049776); // You cannot dye runes or runebooks that are locked down.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if (item is BaseArmor armor &&
                             (armor.MaterialType == ArmorMaterialType.Leather ||
                              armor.MaterialType == ArmorMaterialType.Studded) && m_Tub.AllowLeather)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(armor.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446); // That is too far away.
                        }
                        else if (!armor.Movable)
                        {
                            from.SendLocalizedMessage(1042419); // You may not dye leather items which are locked down.
                        }
                        else if (armor.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861); // Can't Dye clothing that is being worn.
                        }
                        else
                        {
                            armor.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
示例#4
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item)
                {
                    Item item = (Item)targeted;

                    if (item is IDyable && m_Tub.AllowDyables)
                    {
                        if ((m_Tub.DyedHue == 0x497 || m_Tub.DyedHue == 0x485) && (!(item is BaseClothing) /*|| item.LootType == LootType.Newbied*/))
                        {
                            from.SendAsciiMessage("This can only be used to dye regular clothes.");
                        }
                        else if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861);                               // Can't Dye clothing that is being worn.
                        }
                        else if (((IDyable)item).Dye(from, m_Tub))
                        {
                            from.PlaySound(0x23E);

                            m_Tub.UsesRemaining--;
                            if (m_Tub.UsesRemaining <= 0)
                            {
                                from.SendAsciiMessage("The dye tub has run dry!");
                                m_Tub.Delete();
                            }
                        }
                    }
                    else if ((FurnitureAttribute.Check(item) || (item is PotionKeg)) && m_Tub.AllowFurniture)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else
                        {
                            bool okay = (item.IsChildOf(from.Backpack));

                            if (!okay)
                            {
                                if (item.Parent == null)
                                {
                                    BaseHouse house = BaseHouse.FindHouseAt(item);

                                    if (house == null || !house.IsLockedDown(item))
                                    {
                                        from.SendLocalizedMessage(501022);                                           // Furniture must be locked down to paint it.
                                    }
                                    else if (!house.IsCoOwner(from))
                                    {
                                        from.SendLocalizedMessage(501023);                                           // You must be the owner to use this item.
                                    }
                                    else
                                    {
                                        okay = true;
                                    }
                                }
                                else
                                {
                                    from.SendLocalizedMessage(1048135);                                       // The furniture must be in your backpack to be painted.
                                }
                            }

                            if (okay)
                            {
                                m_Tub.UsesRemaining--;
                                item.Hue = m_Tub.DyedHue;
                                from.PlaySound(0x23E);

                                if (m_Tub.UsesRemaining <= 0)
                                {
                                    from.SendAsciiMessage("The dye tub has run dry!");
                                    m_Tub.Delete();
                                }
                            }
                        }
                    }
                    else if ((item is Runebook || item is RecallRune) && m_Tub.AllowRunebooks)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049776);                               // You cannot dye runes or runebooks that are locked down.
                        }
                        else
                        {
                            m_Tub.UsesRemaining--;
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);

                            if (m_Tub.UsesRemaining <= 0)
                            {
                                from.SendAsciiMessage("The dye tub has run dry!");
                                m_Tub.Delete();
                            }
                        }
                    }
                    else if (item is MonsterStatuette && m_Tub.AllowStatuettes)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049779);                               // You cannot dye statuettes that are locked down.
                        }
                        else
                        {
                            m_Tub.UsesRemaining--;
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);

                            if (m_Tub.UsesRemaining <= 0)
                            {
                                from.SendAsciiMessage("The dye tub has run dry!");
                                m_Tub.Delete();
                            }
                        }
                    }
                    else if ((item is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Leather || ((BaseArmor)item).MaterialType == ArmorMaterialType.Studded)) && m_Tub.AllowLeather)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1042419);                               // You may not dye leather items which are locked down.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861);                               // Can't Dye clothing that is being worn.
                        }
                        else
                        {
                            m_Tub.UsesRemaining--;
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);

                            if (m_Tub.UsesRemaining <= 0)
                            {
                                from.SendAsciiMessage("The dye tub has run dry!");
                                m_Tub.Delete();
                            }
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(m_Tub.FailMessage);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(m_Tub.FailMessage);
                }
            }
示例#5
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item)
                {
                    Item item = (Item)targeted;

                    if (item is IDyable && m_Tub.AllowDyables)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446); // That is too far away.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861); // Can't Dye clothing that is being worn.
                        }
                        else if (((IDyable)item).Dye(from, m_Tub))
                        {
                            from.PlaySound(0x23E);
                        }
                    }
                    else if ((FurnitureAttribute.Check(item) || (item is PotionKeg)) && m_Tub.AllowFurniture)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446); // That is too far away.
                        }
                        else
                        {
                            bool okay = (item.IsChildOf(from.Backpack));

                            if (!okay)
                            {
                                if (item.Parent == null)
                                {
                                    BaseHouse house = BaseHouse.FindHouseAt(item);

                                    if (!house.IsCoOwner(from))
                                    {
                                        from.SendLocalizedMessage(501023); // You must be the owner to use this item.
                                    }
                                    else if (house == null || (!house.IsLockedDown(item) && !house.IsSecure(item)) && (!(item is AddonComponent) || !house.Addons.ContainsKey(((AddonComponent)item).Addon)))
                                    {
                                        from.SendLocalizedMessage(501022); // Furniture must be locked down to paint it.
                                    }
                                    else
                                    {
                                        okay = true;
                                    }
                                }
                                else
                                {
                                    from.SendLocalizedMessage(1048135); // The furniture must be in your backpack to be painted.
                                }
                            }

                            if (okay)
                            {
                                item.Hue = m_Tub.DyedHue;
                                from.PlaySound(0x23E);
                            }
                        }
                    }
                    else if ((item is Runebook || item is RecallRune) && m_Tub.AllowRunebooks)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446); // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049776); // You cannot dye runes or runebooks that are locked down.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if (item is MonsterStatuette && m_Tub.AllowStatuettes)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446); // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049779); // You cannot dye statuettes that are locked down.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if (m_Tub.AllowLeather)
                    {
                        if ((item is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Leather || ((BaseArmor)item).MaterialType == ArmorMaterialType.Studded)) ||
                            (item is BaseClothing && (((BaseClothing)item).DefaultResource == CraftResource.RegularLeather) || item is WoodlandBelt || item is BarbedWhip ||
                             item is BladedWhip || item is SpikedWhip))
                        {
                            if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                            {
                                from.SendLocalizedMessage(500446); // That is too far away.
                            }
                            else if (!item.Movable)
                            {
                                from.SendLocalizedMessage(1042419); // You may not dye leather items which are locked down.
                            }
                            else if (item.Parent is Mobile)
                            {
                                from.SendLocalizedMessage(500861); // Can't Dye clothing that is being worn.
                            }
                            else
                            {
                                item.Hue = m_Tub.DyedHue;
                                from.PlaySound(0x23E);
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(m_Tub.FailMessage);
                        }
                    }
                    else if ((item is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Chainmail || ((BaseArmor)item).MaterialType == ArmorMaterialType.Ringmail || ((BaseArmor)item).MaterialType == ArmorMaterialType.Plate)) && m_Tub.AllowMetal)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446); // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1042419); // You may not dye leather items which are locked down.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861); // Can't Dye clothing that is being worn.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(m_Tub.FailMessage);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(m_Tub.FailMessage);
                }
            }
示例#6
0
文件: DyeTub.cs 项目: nogu3ira/xrunuo
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item)
                {
                    Item item = (Item)targeted;

                    if (item is IDyable && !(item is CloakOfHumility) && !(item is SolleretsOfSacrifice) && m_Tub.AllowDyables)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861);                               // Can't Dye clothing that is being worn.
                        }
                        else if (((IDyable)item).Dye(from, m_Tub))
                        {
                            from.PlaySound(0x23E);
                        }
                    }
                    else if ((FurnitureAttribute.Check(item) || (item is PotionKeg)) && m_Tub.AllowFurniture)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else
                        {
                            bool okay = (item.IsChildOf(from.Backpack));

                            if (!okay)
                            {
                                if (item.Parent == null)
                                {
                                    var house = HousingHelper.FindHouseAt(item);

                                    if (house == null || !house.IsLockedDown(item))
                                    {
                                        from.SendLocalizedMessage(501022);                                           // Furniture must be locked down to paint it.
                                    }
                                    else if (!house.IsCoOwner(from))
                                    {
                                        from.SendLocalizedMessage(501023);                                           // You must be the owner to use this item.
                                    }
                                    else
                                    {
                                        okay = true;
                                    }
                                }
                                else
                                {
                                    from.SendLocalizedMessage(1048135);                                       // The furniture must be in your backpack to be painted.
                                }
                            }

                            if (okay)
                            {
                                item.Hue = m_Tub.DyedHue;
                                from.PlaySound(0x23E);
                            }
                        }
                    }
                    else if ((item is Runebook || item is RecallRune) && m_Tub.AllowRunebooks)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049776);                               // You cannot dye runes or runebooks that are locked down.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if (item is MonsterStatuette && m_Tub.AllowStatuettes)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049779);                               // You cannot dye statuettes that are locked down.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if ((item is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Leather || ((BaseArmor)item).MaterialType == ArmorMaterialType.Studded)) && m_Tub.AllowLeather)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1042419);                               // You may not dye leather items which are locked down.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861);                               // Can't Dye clothing that is being worn.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(m_Tub.FailMessage);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(m_Tub.FailMessage);
                }
            }
示例#7
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item)
                {
                    Item item = (Item)targeted;

                    if (item is IDyable && m_Tub.AllowDyables)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 3) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                        }
                        //else if ( item.Parent is Mobile )
                        //	from.SendLocalizedMessage( 500861 ); // Can't Dye clothing that is being worn.
                        else if (((IDyable)item).Dye(from, m_Tub))
                        {
                            from.PlaySound(0x23E);
                        }
                    }
                    else if ((FurnitureAttribute.Check(item) || (item is PotionKeg)) && m_Tub.AllowFurniture)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                        }
                        else
                        {
                            bool okay = (item.IsChildOf(from.Backpack));

                            if (!okay)
                            {
                                if (item.Parent == null)
                                {
                                    BaseHouse house = BaseHouse.FindHouseAt(item);

                                    if (house == null || !house.IsLockedDown(item))
                                    {
                                        from.SendLocalizedMessage(501022);                                           // Furniture must be locked down to paint it.
                                    }
                                    else if (!house.IsCoOwner(from))
                                    {
                                        from.SendLocalizedMessage(501023);                                           // You must be the owner to use this item.
                                    }
                                    else
                                    {
                                        okay = true;
                                    }
                                }
                                else
                                {
                                    from.SendLocalizedMessage(1048135);                                       // The furniture must be in your backpack to be painted.
                                }
                            }

                            if (okay)
                            {
                                item.Hue = m_Tub.DyedHue;
                                from.PlaySound(0x23E);
                            }
                        }
                    }
                    else if ((item is Runebook || item is RecallRune) && m_Tub.AllowRunebooks)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 3) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049776);                               // You cannot dye runes or runebooks that are locked down.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if (item is MonsterStatuette && m_Tub.AllowStatuettes)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049779);                               // You cannot dye statuettes that are locked down.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if ((item is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Leather || ((BaseArmor)item).MaterialType == ArmorMaterialType.Studded) || item is ElvenBoots || item is WoodlandBelt) && m_Tub.AllowLeather)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 3) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1042419);                               // You may not dye leather items which are locked down.
                        }

                        /*else if ( item.Parent is Mobile )
                         *      from.SendLocalizedMessage( 500861 ); // Can't Dye clothing that is being worn.*/
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(m_Tub.FailMessage);
                    }
                }
                else if (from == targeted)
                {
                    from.HairHue = from.FacialHairHue = m_Tub.DyedHue;
                    from.PlaySound(0x23E);
                }
                else
                {
                    from.SendLocalizedMessage(m_Tub.FailMessage);
                }
            }
示例#8
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item)
                {
                    Item item = (Item)targeted;

                    if (item is IDyable && m_Tub.AllowDyables)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendAsciiMessage("That is too far away.");   // That is too far away.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendAsciiMessage("Can't Dye clothing that is being worn.");   // Can't Dye clothing that is being worn.
                        }
                        else if (!m_Tub.AllowBolts && (item is BoltOfCloth || item is Cloth || item is UncutCloth || item is BaseClothMaterial || item is Wool || item is Cotton || item is OilCloth))
                        {
                            from.SendAsciiMessage("You can't dye this with a charged dye tub.");
                        }
                        else if (((IDyable)item).Dye(from, m_Tub))
                        {
                            from.PlaySound(0x23E);
                            m_Tub.AfterDye(from);
                        }
                    }
                    else if ((FurnitureAttribute.Check(item) || (item is PotionKeg)) && m_Tub.AllowFurniture)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendAsciiMessage("That is too far away."); // That is too far away.
                        }
                        else
                        {
                            bool okay = (item.IsChildOf(from.Backpack));

                            if (!okay)
                            {
                                if (item.Parent == null)
                                {
                                    BaseHouse house = BaseHouse.FindHouseAt(item);

                                    if (house == null || !house.IsLockedDown(item))
                                    {
                                        from.SendLocalizedMessage("Furniture must be locked down to paint it.");   // Furniture must be locked down to paint it.
                                    }
                                    else if (!house.IsCoOwner(from))
                                    {
                                        from.SendLocalizedMessage("You must be the owner to use this item.");   // You must be the owner to use this item.
                                    }
                                    else
                                    {
                                        okay = true;
                                    }
                                }
                                else
                                {
                                    from.SendLocalizedMessage("The furniture must be in your backpack to be painted.");   // The furniture must be in your backpack to be painted.
                                }
                            }

                            if (okay)
                            {
                                item.Hue = m_Tub.DyedHue;
                                from.PlaySound(0x23E);
                                m_Tub.AfterDye(from);
                            }
                        }
                    }
                    else if ((item is Runebook || item is RecallRune) && m_Tub.AllowRunebooks)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendAsciiMessage("That is too far away.");                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage("You cannot dye runes or runebooks that are locked down.");   // You cannot dye runes or runebooks that are locked down.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                            m_Tub.AfterDye(from);
                        }
                    }
                    else if (item is MonsterStatuette && m_Tub.AllowStatuettes)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage("That is too far away.");                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage("You cannot dye statuettes that are locked down.");   // You cannot dye statuettes that are locked down.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                            m_Tub.AfterDye(from);
                        }
                    }
                    else if ((item is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Leather || ((BaseArmor)item).MaterialType == ArmorMaterialType.Studded)) && m_Tub.AllowLeather)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage("That is too far away.");                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage("You may not dye leather items which are locked down.");   // You may not dye leather items which are locked down.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage("Can't Dye clothing that is being worn.");                               // Can't Dye clothing that is being worn.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                            m_Tub.AfterDye(from);
                        }
                    }
                    else
                    {
                        from.SendAsciiMessage("You can not dye that.");
                    }
                }
                else
                {
                    from.SendAsciiMessage("You can not dye that.");
                }
            }
示例#9
0
文件: DyeTub.cs 项目: MythikGN/Mythik
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item)
                {
                    Item item    = (Item)targeted;
                    var  limited = m_Tub as LimitedUseDyeTub;
                    if (item is Hair && item.Parent == from && m_Tub.AllowDyables)
                    {
                        if (limited != null)
                        {
                            limited.Uses--;
                        }
                        (item as Hair).Hue = m_Tub.DyedHue;
                        from.PlaySound(0x23E);
                    }
                    else if (item is Beard && item.Parent == from && m_Tub.AllowDyables)
                    {
                        if (limited != null)
                        {
                            limited.Uses--;
                        }
                        (item as Beard).Hue = m_Tub.DyedHue;
                        from.PlaySound(0x23E);
                    }
                    else if (item is DyeDeed && item.Parent == from.Backpack)
                    {
                        if (limited != null)
                        {
                            limited.Uses--;
                        }
                        (item as DyeDeed).Hue = (item as DyeDeed).DyedHue = m_Tub.DyedHue;
                        from.PlaySound(0x23E);
                    }
                    else if (item is IDyable && m_Tub.AllowDyables)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861);                               // Can't Dye clothing that is being worn.
                        }
                        else if (((IDyable)item).Dye(from, m_Tub))
                        {
                            from.PlaySound(0x23E);
                            if (limited != null)
                            {
                                limited.Uses--;
                            }
                        }
                    }
                    else if ((FurnitureAttribute.Check(item) || (item is PotionKeg)) && m_Tub.AllowFurniture)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else
                        {
                            bool okay = (item.IsChildOf(from.Backpack));

                            if (!okay)
                            {
                                if (item.Parent == null)
                                {
                                    BaseHouse house = BaseHouse.FindHouseAt(item);

                                    if (house == null || (!house.IsLockedDown(item) && !house.IsSecure(item)))
                                    {
                                        from.SendLocalizedMessage(501022);                                           // Furniture must be locked down to paint it.
                                    }
                                    else if (!house.IsCoOwner(from))
                                    {
                                        from.SendLocalizedMessage(501023);                                           // You must be the owner to use this item.
                                    }
                                    else
                                    {
                                        okay = true;
                                    }
                                }
                                else
                                {
                                    from.SendLocalizedMessage(1048135);                                       // The furniture must be in your backpack to be painted.
                                }
                            }

                            if (okay)
                            {
                                if (limited != null)
                                {
                                    limited.Uses--;
                                }
                                item.Hue = m_Tub.DyedHue;
                                from.PlaySound(0x23E);
                            }
                        }
                    }
                    else if ((item is Runebook || item is RecallRune) && m_Tub.AllowRunebooks)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049776);                               // You cannot dye runes or runebooks that are locked down.
                        }
                        else
                        {
                            if (limited != null)
                            {
                                limited.Uses--;
                            }
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if (item is MonsterStatuette && m_Tub.AllowStatuettes)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049779);                               // You cannot dye statuettes that are locked down.
                        }
                        else
                        {
                            if (limited != null)
                            {
                                limited.Uses--;
                            }
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if ((item is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Leather || ((BaseArmor)item).MaterialType == ArmorMaterialType.Studded) || item is ElvenBoots || item is WoodlandBelt) && m_Tub.AllowLeather)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1042419);                               // You may not dye leather items which are locked down.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861);                               // Can't Dye clothing that is being worn.
                        }
                        else
                        {
                            if (limited != null)
                            {
                                limited.Uses--;
                            }
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(m_Tub.FailMessage);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(m_Tub.FailMessage);
                }
            }
示例#10
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (targeted is Item)
                {
                    Item item = (Item)targeted;

                    if (item is IDyable && m_Tub.AllowDyables)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861);                               // Can't Dye clothing that is being worn.
                        }
                        else if (((IDyable)item).Dye(from, m_Tub))
                        {
                            from.PlaySound(0x23E);
                        }
                    }
                    //------------------------------------------------------------------------------------------------------------------------
                    else if ((item is BaseArmor || (item is BaseShield)) && m_Tub.AllowArmor)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);
                        }
                        else if (!item.Movable)
                        {
                            from.SendMessage("You cannot dye that which is locked down.");
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendMessage("You cannot be wearing items you wish to dye!");
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if ((item is BaseWeapon) && m_Tub.AllowWeapons)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);
                        }
                        else if (!item.Movable)
                        {
                            from.SendMessage("You cannot dye that which is locked down.");
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendMessage("You cannot be holding a weapon you wish to dye!");
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if ((item is RedBook || (item is BlueBook) || (item is TanBook) || (item is BrownBook)) && m_Tub.AllowBooks)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);
                        }
                        else if (!item.Movable)
                        {
                            from.SendMessage("You cannot dye that which is locked down.");
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    //-----------------------------------------------------------------------------------------------------------------------------
                    else if ((FurnitureAttribute.Check(item) || (item is PotionKeg)) && m_Tub.AllowFurniture)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else
                        {
                            bool okay = (item.IsChildOf(from.Backpack));

                            if (!okay)
                            {
                                if (item.Parent == null)
                                {
                                    BaseHouse house = BaseHouse.FindHouseAt(item);

                                    if (house == null || !house.IsLockedDown(item))
                                    {
                                        from.SendLocalizedMessage(501022);                                           // Furniture must be locked down to paint it.
                                    }
                                    else if (!house.IsCoOwner(from))
                                    {
                                        from.SendLocalizedMessage(501023);                                           // You must be the owner to use this item.
                                    }
                                    else
                                    {
                                        okay = true;
                                    }
                                }
                                else
                                {
                                    from.SendLocalizedMessage(1048135);                                       // The furniture must be in your backpack to be painted.
                                }
                            }

                            if (okay)
                            {
                                item.Hue = m_Tub.DyedHue;
                                from.PlaySound(0x23E);
                            }
                        }
                    }
                    else if ((item is Runebook || item is RecallRune) && m_Tub.AllowRunebooks)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049776);                               // You cannot dye runes or runebooks that are locked down.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if (item is MonsterStatuette && m_Tub.AllowStatuettes)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1049779);                               // You cannot dye statuettes that are locked down.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else if (item is Server.Items.LeatherBelt || (item is BaseArmor && (((BaseArmor)item).MaterialType == ArmorMaterialType.Leather || ((BaseArmor)item).MaterialType == ArmorMaterialType.Studded)) && m_Tub.AllowLeather)
                    {
                        if (!from.InRange(m_Tub.GetWorldLocation(), 1) || !from.InRange(item.GetWorldLocation(), 1))
                        {
                            from.SendLocalizedMessage(500446);                               // That is too far away.
                        }
                        else if (!item.Movable)
                        {
                            from.SendLocalizedMessage(1042419);                               // You may not dye leather items which are locked down.
                        }
                        else if (item.Parent is Mobile)
                        {
                            from.SendLocalizedMessage(500861);                               // Can't Dye clothing that is being worn.
                        }
                        else
                        {
                            item.Hue = m_Tub.DyedHue;
                            from.PlaySound(0x23E);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(m_Tub.FailMessage);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(m_Tub.FailMessage);
                }
            }