/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\events and scenarios\Halloween2008\WalkingCorpse.cs
Lines of code: 96
***********************************************************/


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

namespace Server.Mobiles
{
	[CorpseName( "a decomposing corpse" )]
	public class WalkingCorpse : BaseCreature
	{
	
		private DateTime lastSpeech;
		
		[Constructable]
		public WalkingCorpse() : base( AIType.AI_Super, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a walking corpse";
			Body = 155;
			Hue = 2101;
			BaseSoundID = 471;

			SetStr( 301, 350 );
			SetDex( 75 );
			SetInt( 151, 200 );

			SetHits( 5000 );
			SetStam( 150 );
			SetMana( 0 );

			SetDamage( 8, 10 );

			SetDamageType( ResistanceType.Physical, 50 );
			SetDamageType( ResistanceType.Poison, 50 );

			SetResistance( ResistanceType.Physical, 45, 55 );
			SetResistance( ResistanceType.Fire, 10, 20 );
			SetResistance( ResistanceType.Cold, 50, 70 );
			SetResistance( ResistanceType.Poison, 50, 70 );
			SetResistance( ResistanceType.Energy, 20, 30 );

			SetSkill( SkillName.MagicResist, 250.0 );
			SetSkill( SkillName.Tactics, 110.0 );
			SetSkill( SkillName.Wrestling, 120.1, 120.0 );

			Fame = 22500;
			Karma = -22500;

			VirtualArmor = 40;
			
			for ( int t = 0; t < Utility.RandomMinMax(1, 5); t++ )
			{
				switch ( Utility.Random( 16 ))
				{                                   
					case 0: PackItem( new BronzeToken()); break;   
					case 1: PackItem( new BronzeToken()); break;
					case 2: PackItem( new SilverToken()); break;
					case 3: PackItem( new SilverToken()); break;    
					case 4: PackItem( new GoldToken()); break;   
					case 5: PackItem( new BronzeToken()); break;  
					case 6: PackItem( new SilverToken()); break;
					case 7: PackItem( new BronzeToken()); break; 
					case 8: PackItem( new PlatinumToken()); break;   
					case 9: PackItem( new BronzeToken()); break;
					case 10: PackItem( new SilverToken()); break;
					case 11: PackItem( new BronzeToken()); break;    
					case 12: PackItem( new GoldToken()); break;   
					case 13: PackItem( new BronzeToken()); break;  
					case 14: PackItem( new BronzeToken()); break;
					case 15: PackItem( new BronzeToken()); break;    
				}	
			}	
		}
		
		public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }
		public override bool IsMLBoss { get { return true;} }
		public override bool BleedImmune{ get{ return true; } }
		public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
		
		public override void OnThink ()
		{
			if (0.2 > Utility.RandomDouble() && (lastSpeech+TimeSpan.FromSeconds(35))<DateTime.Now) 
					Mutter();
					
			base.OnThink();	
		}
		
		public void Mutter()
		{
			this.Say("*Braaaaaaains, neeeeed braiiiiinssss*");
			lastSpeech=DateTime.Now;
		}
		
		public override void GenerateLoot()
		{
			AddLoot( LootPack.Rich, 5 );
			AddLoot( LootPack.SuperBoss, 3 );			
		}

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