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


using System;
using Server;
using Server.Network;
using Server.Mobiles;

namespace Server.Items
{
	public class OrganoCentral : BaseOrgano
	{
		private Item m_Wound; //It simulates the hole when we cut the organ
		
		public OrganoCentral() : base( 4944, PlagueHelper.Line[12], 221, BrainTypes.Brain_None )
		{
			Weight = 0;
		}

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

		public override void CreateTissue()
		{
		
			PutGuts( new Plague_deco( 4943, PlagueHelper.Line[12], Hue, false, true) , -22, 0 );
			PutGuts( new Plague_deco( 4945, PlagueHelper.Line[12], Hue, false, true) , 22, 0 );
		
			m_Wound = new Plague_deco( 4650, PlagueHelper.Line[8], 1, false, false );
			PutGuts( m_Wound , -3, 21 );

		    MyBrain = new Plague_Core();
		    PutGuts( MyBrain , -3, 28 );
		}

		public override void OpenOrganTo( Mobile from )
		{
			if ( RootParent == from )
			{
				m_Wound.Visible = true;
				MyBrain.Visible = true;
				from.Say( false, PlagueHelper.Line[14] );
			}
		}

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

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

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

			int version = reader.ReadInt();
			m_Wound = reader.ReadItem();

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