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

namespace Server.Mobiles
{
	[CorpseName( "a dead lotus" )]
	public class BloodLotus : BaseCreature
	{
		[Constructable]
		public BloodLotus() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a blood lotus";
			Body = 137;
			BaseSoundID = 352;

			SetStr( 96, 120 );
			SetDex( 66, 85 );
			SetInt( 16, 30 );

			SetHits( 58, 72 );
			SetMana( 0 );

			SetDamage( 6, 12 );

			SetSkill( SkillName.MagicResist, 15.1, 20.0 );
			SetSkill( SkillName.Tactics, 65.1, 80.0 );
			SetSkill( SkillName.HandToHand, 65.1, 80.0 );

			Fame = 4500;
			Karma = -4500;

			VirtualArmor = 28;

			PackReg( 3 );
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.Average );
		}

		public void DrainBlood( Mobile m )
		{
			DoHarmful( m );
			new Blood().MoveToWorld( m.Location, m.Map );
			m.SendMessage( "The plant feeds on your blood!" );
			int toDrain = Utility.RandomMinMax( 2, 10 );
			m.PlaySound( 0x23F );
			Hits += toDrain;
			m.Damage( toDrain, this );
		}

		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );
			DrainBlood( defender );
		}

		public override void OnGotMeleeAttack( Mobile attacker )
		{
			base.OnGotMeleeAttack( attacker );
			DrainBlood( attacker );
		}

		public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
		public override Poison HitPoison{ get{ return Poison.Greater; } }

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