/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\items\special\FountainOfLife\FountainOfLife.cs
Lines of code: 78
***********************************************************/


using System;
using System.Collections;
using Server;
using Server.Multis;
using Server.Network;

namespace Server.Items
{
	[Furniture]
	[Flipable( 0x2AC0, 0x2AC3 )]
	public class FountainOfLife : BaseContainer
	{
		public override int LabelNumber{ get{ return 1075197; } } // Fountain of Life

		[Constructable]
		public FountainOfLife() : base( 0x2AC0 )
		{
			Weight = 10.0;
		}
		
		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			Bandage aid = dropped as Bandage;
			int amount = aid.Amount;

			if ( aid != null && base.OnDragDrop( from, dropped ) && amount == 10 )
			{
				PublicOverheadMessage( MessageType.Regular, 0x3B2, 1075216 ); 
				this.PlaySound( 0x23E );
				aid.Delete();
				from.AddToBackpack(new BlessedBandage(10));
				return true;
			}
			else if (amount != 10)
			{
				from.SendMessage( "You must soak 10 bandages" );
				return false;
			}
			else
			{
				from.SendLocalizedMessage( 1075209 );
				return false;
			}
		}

		public override bool OnDragDropInto( Mobile from, Item dropped, Point3D p )
		{
			Bandage aid = dropped as Bandage;
			int amount = aid.Amount;

			if ( aid != null && base.OnDragDropInto( from, dropped, p ) )
			{
				PublicOverheadMessage( MessageType.Regular, 0x3B2, 1075216);
				this.PlaySound( 0x23E );
				aid.Delete();
				from.AddToBackpack(new BlessedBandage(10));
				return true;
			}
			else if (amount != 10)
			{
				from.SendMessage( "You must soak 10 bandages" );
				return false;
			}
			else
			{
				from.SendLocalizedMessage( 1075209 );
				return false;
			}
		}

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