using System;
using Server;
using Server.Network;
using System.Text;
using Server.Items;
using Server.Mobiles;

namespace Server.Items
{
	public class BaseSupply : Item
	{
		[Constructable]
		public BaseSupply() : base( 0x1709 )
		{
			Name = "bottles";
			SpecialName = "Bottle";
			Weight = 10;
		}

		public override void OnLocationChange( Point3D oldLocation )
		{
			if ( RootParentEntity is PlayerMobile )
			{
				Type itemType = ScriptCompiler.FindTypeByName( SpecialName );
				Item supply = (Item)Activator.CreateInstance(itemType);
				supply.Amount = 100;
				if ( Name == "lockpicks" ){ supply.Amount = 50; }
				else if ( Name == "boards" ){ supply.ItemID = 0x1BD7; supply.Weight = 1.0; }
				((Mobile)RootParentEntity).AddToBackpack ( supply );
				this.Delete();
			}
		}

        public override void AddNameProperties(ObjectPropertyList list)
		{
            base.AddNameProperties(list);
			if ( this.Name == "lockpicks" )
				list.Add( 1070722, "A Bundle of 50");
			else
				list.Add( 1070722, "A Bundle of 100");
        }

		public override void AddNameProperty( ObjectPropertyList list )
		{
			list.Add( Name );
		}

		public BaseSupply( 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();
		}
	}

	public class SupplyBottles : BaseSupply
	{
		[Constructable]
		public SupplyBottles()
		{
			ItemID = 0x1709;
			Name = "bottles";
			SpecialName = "Bottle";
		}

		public SupplyBottles( 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();
		}
	}

	public class SupplyLeather : BaseSupply
	{
		[Constructable]
		public SupplyLeather()
		{
			ItemID = 0x170A;
			Name = "leather";
			SpecialName = "Leather";
		}

		public SupplyLeather( 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();
		}
	}

	public class SupplyLogs : BaseSupply
	{
		[Constructable]
		public SupplyLogs()
		{
			ItemID = 0x172F;
			Name = "logs";
			SpecialName = "WoodBoard";
		}

		public SupplyLogs( 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();
		}
	}

	public class SupplyBoards : BaseSupply
	{
		[Constructable]
		public SupplyBoards()
		{
			ItemID = 0x17BB;
			Name = "boards";
			SpecialName = "WoodBoard";
		}

		public SupplyBoards( 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();
		}
	}

	public class SupplyIngots : BaseSupply
	{
		[Constructable]
		public SupplyIngots()
		{
			ItemID = 0x17BC;
			Name = "ingots";
			SpecialName = "IronIngot";
		}

		public SupplyIngots( 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();
		}
	}

	public class SupplyCloth : BaseSupply
	{
		[Constructable]
		public SupplyCloth()
		{
			ItemID = 0x1730;
			Name = "cloth";
			SpecialName = "Cloth";
		}

		public SupplyCloth( 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();
		}
	}

	public class SupplyMaps : BaseSupply
	{
		[Constructable]
		public SupplyMaps()
		{
			ItemID = 0x1644;
			Name = "blank maps";
			SpecialName = "BlankMap";
		}

		public SupplyMaps( 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();
		}
	}

	public class SupplyScrolls : BaseSupply
	{
		[Constructable]
		public SupplyScrolls()
		{
			ItemID = 0x1794;
			Name = "blank scrolls";
			SpecialName = "BlankScroll";
		}

		public SupplyScrolls( 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();
		}
	}

	public class SupplyBandages : BaseSupply
	{
		[Constructable]
		public SupplyBandages()
		{
			ItemID = 0x1795;
			Name = "bandages";
			SpecialName = "Bandage";
		}

		public SupplyBandages( 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();
		}
	}

	public class SupplyArrows : BaseSupply
	{
		[Constructable]
		public SupplyArrows()
		{
			ItemID = 0xF41;
			Name = "arrows";
			SpecialName = "Arrow";
		}

		public SupplyArrows( 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();
		}
	}

	public class SupplyBolts : BaseSupply
	{
		[Constructable]
		public SupplyBolts()
		{
			ItemID = 0x1BFD;
			Name = "bolts";
			SpecialName = "Bolt";
		}

		public SupplyBolts( 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();
		}
	}

	public class SupplyLockpicks : BaseSupply
	{
		[Constructable]
		public SupplyLockpicks()
		{
			ItemID = 0x14FD;
			Name = "lockpicks";
			SpecialName = "Lockpick";
		}

		public SupplyLockpicks( 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();
		}
	}

	public class SupplyBlackPearl : BaseSupply
	{
		[Constructable]
		public SupplyBlackPearl()
		{
			ItemID = 0x17B3;
			Name = "black pearls";
			SpecialName = "BlackPearl";
		}

		public SupplyBlackPearl( 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();
		}
	}

	public class SupplyBloodmoss : BaseSupply
	{
		[Constructable]
		public SupplyBloodmoss()
		{
			ItemID = 0x17B4;
			Name = "blood moss";
			SpecialName = "Bloodmoss";
		}

		public SupplyBloodmoss( 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();
		}
	}

	public class SupplyGarlic : BaseSupply
	{
		[Constructable]
		public SupplyGarlic()
		{
			ItemID = 0x17B5;
			Name = "garlic";
			SpecialName = "Garlic";
		}

		public SupplyGarlic( 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();
		}
	}

	public class SupplyGinseng : BaseSupply
	{
		[Constructable]
		public SupplyGinseng()
		{
			ItemID = 0x17B6;
			Name = "ginseng";
			SpecialName = "Ginseng";
		}

		public SupplyGinseng( 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();
		}
	}

	public class SupplyMandrakeRoot : BaseSupply
	{
		[Constructable]
		public SupplyMandrakeRoot()
		{
			ItemID = 0x17B7;
			Name = "mandrake roots";
			SpecialName = "MandrakeRoot";
		}

		public SupplyMandrakeRoot( 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();
		}
	}

	public class SupplyNightshade : BaseSupply
	{
		[Constructable]
		public SupplyNightshade()
		{
			ItemID = 0x17B8;
			Name = "nightshade";
			SpecialName = "Nightshade";
		}

		public SupplyNightshade( 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();
		}
	}

	public class SupplySpidersSilk : BaseSupply
	{
		[Constructable]
		public SupplySpidersSilk()
		{
			ItemID = 0x17B9;
			Name = "spider silk";
			SpecialName = "SpidersSilk";
		}

		public SupplySpidersSilk( 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();
		}
	}

	public class SupplySulfurousAsh : BaseSupply
	{
		[Constructable]
		public SupplySulfurousAsh()
		{
			ItemID = 0x17BA;
			Name = "sulfurous ashes";
			SpecialName = "SulfurousAsh";
		}

		public SupplySulfurousAsh( 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();
		}
	}
}