Пример #1
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (!from.CanSee(o))
                {
                    from.SendLocalizedMessage(500237);                       // Target can not be seen.
                }
                if (o is BlueClothing)
                {
                    BlueClothing cloth = (BlueClothing)o;

                    if (m_Deed.Enhance == BlueEnhance.Efficient && !(cloth is BlueNecklace))
                    {
                        from.SendMessage(1365, "You may only use the Efficient enhancement on the necklace.");
                        return;
                    }

                    if (m_Deed.Teir == 1)
                    {
                        if (cloth.EnhanceOne == m_Deed.Enhance)
                        {
                            from.SendMessage(1365, "This piece of clothing already has this enhancement.");
                            return;
                        }

                        cloth.EnhanceOne = m_Deed.Enhance;
                        from.SendMessage(1365, "You enhance the clothing with a Touched enhancement.");
                    }
                    else if (m_Deed.Teir == 2)
                    {
                        if (cloth.EnhanceTwo == m_Deed.Enhance)
                        {
                            from.SendMessage(1365, "This piece of clothing already has this enhancement.");
                            return;
                        }

                        cloth.EnhanceTwo = m_Deed.Enhance;
                        from.SendMessage(1365, "You enhance the clothing with a Touched enhancement.");
                    }

                    m_Deed.Delete();
                }
                else
                {
                    from.SendMessage("You cannot use this on that.");
                }
            }
		public BlueClothingExchangeGump( BlueClothing clothing ) : base( 0, 0 )
		{

			m_TradeIn = clothing;

			Closable = true;
			Disposable = true;
			Dragable = true;
			Resizable = false;

			AddPage(  0  );

			AddBackground( 0, 0, 210, 205, 9270 );
			AddLabel( 15, 15, 1365, "Blue  Clothing  Exchange" );
			AddLabel( 15, 35, 1365, @"Cost: " + COST.ToString() );

			AddItem( 10, 60, 5912, 1365 ); // Hat
			AddButton( 60, 60, 4023, 4024, 1, GumpButtonType.Reply, 0 ); 

			AddItem( 10, 90, 5399, 1365 ); // Shirt
			AddButton( 60, 90, 4023, 4024, 2, GumpButtonType.Reply, 0 );

			AddItem( 10, 120, 11112, 1365 ); // Belt
			AddButton( 60, 120, 4023, 4024, 3, GumpButtonType.Reply, 0 );

			AddItem( 10, 150, 12227, 1365 ); // Pants
			AddButton( 60, 150, 4023, 4024, 4, GumpButtonType.Reply, 0 );

			AddItem( 105, 60, 12228, 1365 ); // Boots
			AddButton( 155, 60, 4023, 4024, 5, GumpButtonType.Reply, 0 );

			AddItem( 105, 90, 5441, 1365 ); // Sash
			AddButton( 155, 90, 4023, 4024, 6, GumpButtonType.Reply, 0 );

			AddItem( 105, 120, 5198, 1365 ); // Arms
			AddButton( 155, 120, 4023, 4024, 7, GumpButtonType.Reply, 0 );

			AddItem( 95, 145, 9901, 1365 ); // Cloak
			AddButton( 155, 150, 4023, 4024, 8, GumpButtonType.Reply, 0 );
		}