/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\engines\PlagueBeastLordQuest\Items\Plague_Venas.cs
Lines of code: 49
***********************************************************/


using System;
using Server;
using Server.Network;

namespace Server.Items
{
	public class Plague_Venas : Item
	{
		private Item m_Organ;
		private bool m_IsCut = false;

		public Plague_Venas( Item item, int color, int flip ) : base( 6939 + flip )
		{
			Name = PlagueHelper.Line[26];
			Movable = false;
			Hue = color;
			m_Organ = item;
			Weight = 0;
		}

		public Plague_Venas( Serial serial ) : base( serial )
		{
		}
		
		public void CutVein( Mobile from)
		{
			if ( !m_IsCut )
			{
				m_IsCut = true;
				ItemID = 7946;
				Organo_Venas peer = m_Organ as Organo_Venas;
				from.LocalOverheadMessage( MessageType.Emote, 0x66B, false, PlagueHelper.Line[27] );
				((Organo_Venas)m_Organ).OnVeinCut( from, Hue );
			}
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
			writer.Write( (Item)m_Organ );
			writer.Write( (bool)m_IsCut );
		}

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

			int version = reader.ReadInt();
			m_Organ = reader.ReadItem();
			m_IsCut = reader.ReadBool();

			if ( m_Organ == null )
				Delete();
		}
	}
}
