RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Random DyeTub Stone

airwalk

Wanderer
Random DyeTub Stone

It's a stone who sell a dye tub with random color.

Put this script into a custom directory.
So, if you've any idea or bugs, tell me. Thanks.

Edit: I've lost my host. So here is my script.
Code:
using System;

namespace Server.Items
{
	public class DyeStone : Item
	{
				
		[Constructable]
		public DyeStone() : base( 0xED4 ) 
		{
			Name = "a random dyetub Stone [10000 gp]";
			Movable = false;
		}
		
        public override void OnDoubleClick( Mobile from )
		{
			Container pack = from.Backpack;
			DyeTub dt = new DyeTub(); 
			dt.DyedHue = Utility.Random( 1500 );
			dt.Name = "Dying Tub [from Random DyeTub Stone]";
			dt.Redyable = false;
			dt.LootType = LootType.Blessed;
			if ( pack != null && pack.ConsumeTotal( typeof( Gold ), 10000 ) ) {
				from.AddToBackpack( dt );
			}
			else {
				from.SendMessage( 50, "You don't have enought money" );
			}

			base.OnDoubleClick( from );
			
		}
		
	public DyeStone( Serial serial ) : base( serial )
		{
		}
	public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
		
	}
}
 
Top