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


using System;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;

namespace Server.Mobiles
{
	[CorpseName( "a ghostly corpse" )]
	public class Ghost : BaseCreature
	{
		public override bool DeleteCorpseOnDeath{ get{ return true; } }
	
		[Constructable]
		public Ghost() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.4, 0.8 )
		{
			Name = "a ghost";
			Body = 401;
			Hue = 0;
			BaseSoundID = 263;

			SetStr( 26, 40 );
			SetDex( 26, 40 );
			SetInt( 26, 40 );

			SetHits( 16, 24 );

			SetDamage( 0 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 200 );
			SetResistance( ResistanceType.Fire, 200 );
			SetResistance( ResistanceType.Cold, 200 );
			SetResistance( ResistanceType.Poison, 200 );
			SetResistance( ResistanceType.Energy, 200 );

			SetSkill( SkillName.MagicResist, 20.1, 30.0 );
			SetSkill( SkillName.Swords, 20.1, 30.0 );
			SetSkill( SkillName.Tactics, 20.1, 30.0 );
			SetSkill( SkillName.Wrestling, 200.1, 300.0 );

			Fame = 0;
			Karma = -1000;

			VirtualArmor = 6;
			
			Item shroud = new HoodedShroudOfShadows();

			shroud.Movable = false;
			shroud.Hue = 1001;
			
			AddItem( shroud );
			
			Timer.DelayCall( TimeSpan.FromMinutes( 1.0 ), new TimerCallback( Delete ) );
		}
		
		public override bool CanBeDamaged()
		{
			return false;
		}
		
		public override void OnGotMeleeAttack( Mobile defender )
		{
			base.OnGotMeleeAttack( defender );
			
			if (defender.Player)
			{
			defender.Hits = 1;
			defender.Mana = 0;
			defender.SendMessage( "You feel near death as the ghost touches you" );
			}
		}

		public override bool AlwaysAttackable{ get{ return true; } }
		public override bool BleedImmune{ get{ return true; } }
		public override Poison PoisonImmune{ get{ return Poison.Lethal; } }

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

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			this.Delete();
		}
	}
}