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


using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Misc;
using Server.Mobiles;
using Server.Network;
 

namespace Server.Items 
{ 
	public abstract class BaseCursedPirateAle : Item 
	{ 
		public Poison m_Poison; 
		public int Highness; 

		[CommandProperty( AccessLevel.GameMaster )] 
		public Poison Poison 
		{ 
			get { return m_Poison; } 
			set { m_Poison = value; } 
		} 

		public BaseCursedPirateAle ( int itemID ) : base( itemID ) 
		{
			LootType = LootType.Cursed;
		} 
		
		public override void OnDoubleClick( Mobile from ) 
		{ 
			if ( !this.IsLockedDown )
			{
				from.SendLocalizedMessage( 502693 ); // Remember, this only works when locked down.
				return;
			}
			else 
			{
				DrinkIt( from );
			}
		}

		public void DrinkIt( Mobile from )
		{
			// Play a random drinking sound
			from.PlaySound( Utility.Random( 0x30, 2 ) );

			if ( from.Body.IsHuman && !from.Mounted )
				from.Animate( 34, 5, 1, true, false, 0 );

			PirateCurse.CursePlayer( from );
		}

		public BaseCursedPirateAle ( Serial serial ) : base( serial ) 
		{ 
		} 

		public override void Serialize( GenericWriter writer ) 
		{ 
			base.Serialize( writer ); 
			writer.Write( (int) 0 ); // version 
			
			Poison.Serialize( m_Poison, writer ); 
		} 

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

			int version = reader.ReadInt(); 

			switch ( version ) 
			{ 
				case 0: 
				{ 
					m_Poison = Poison.Deserialize( reader ); 
					break; 
				} 
			} 
		} 
	} 

//===================================== 

	public class CursedPirateAle : BaseCursedPirateAle 
	{ 
		[Constructable] 
		public CursedPirateAle () : base( 2466 ) 
		{ 
			Name = "Cursed Pirate Ale"; 
			Weight = 2.0;
			Hue = 677;
			LootType = LootType.Cursed;
		} 

		public CursedPirateAle ( 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(); 
		} 
	} 
//===================================== 
} 
