/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\Mobiles\Monsters\Reptile\Magic\AncientWyrm.cs
Lines of code: 87
***********************************************************/


using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
	[CorpseName( "a dragon corpse" )]
	public class AncientWyrm : BaseCreature
	{
		[Constructable]
		public AncientWyrm () : base( AIType.AI_Super, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "an ancient wyrm";
			Body = 46;
			BaseSoundID = 362;

			SetStr( 1096, 1185 );
			SetDex( 86, 175 );
			SetInt( 847, 1000 );

			SetHits( 1452, 1177 );

			SetDamage( 29, 35 );

			SetDamageType( ResistanceType.Physical, 75 );
			SetDamageType( ResistanceType.Fire, 25 );

			SetResistance( ResistanceType.Physical, 65, 75 );
			SetResistance( ResistanceType.Fire, 80, 90 );
			SetResistance( ResistanceType.Cold, 70, 80 );
			SetResistance( ResistanceType.Poison, 60, 70 );
			SetResistance( ResistanceType.Energy, 60, 70 );
			

			SetSkill( SkillName.EvalInt, 80.1, 109.0 );
			SetSkill( SkillName.Magery, 80.1, 109.7 );
			SetSkill( SkillName.Meditation, 52.5, 75.0 );
			SetSkill( SkillName.MagicResist, 100.5, 150.0 );
			SetSkill( SkillName.Tactics, 97.6, 100.0 );
			SetSkill( SkillName.Wrestling, 100.0, 110.0 );

			Fame = 22500;
			Karma = -22500;

			VirtualArmor = 70;			
			
		/*	if(5==Utility.Random(100) && !IsParagon)
			{
				Tamable=true;
				ControlSlots = 5;
				MinTameSkill = 116;			
				Name = "a tamable ancient wyrm";
			}*/
		}
		
		public override void OnAfterDamage(int damage,Mobile from)
		{
			if(Controlled && Hits>50 && 0.6>Utility.RandomDouble())this.Hits=(this.Hits-(Utility.Random(damage/2)));
			base.OnAfterDamage(damage,from);
		}			
		

		public override void GenerateLoot()
		{
			AddLoot( LootPack.FilthyRich, 6 );
			AddLoot( LootPack.Gems, 5 );
		}

		public override int GetIdleSound()
		{
			return 0x2D3;
		}

		public override int GetHurtSound()
		{
			return 0x2D1;
		}
		
		
		public override int BonusHPR{ get{ return -5; } }//bonus hp regen
		public override int BonusMR{ get{ return -9; } }//bonus mana regen
		public override int BonusSR{ get{ return -2; } }//bonus stam regen	

		
		public override bool ReacquireOnMovement{ get{ return !Controlled; } }
		public override bool HasBreath{ get{ return !Controlled; } } // fire breath enabled
		public override bool AutoDispel{ get{ return !Controlled; } }
		public override HideType HideType{ get{ return HideType.Barbed; } }
		public override int Hides{ get{ return 40; } }
		public override int Meat{ get{ return 19; } }
		public override int Scales{ get{ return 12; } }
		public override ScaleType ScaleType{ get{ return (ScaleType)Utility.Random( 4 ); } }
		public override Poison PoisonImmune{ get{ return Poison.Regular; } }
		public override Poison HitPoison{ get{ return Utility.RandomBool() ? Poison.Lesser : Poison.Regular; } }
		public override int TreasureMapLevel{ get{ return 5; } }
		public override bool CanAngerOnTame { get { return true; } }	
		public override double StatLossScalarOnTame { get {return 0.35;}}
		public override double ResistLossScalarOnTame{ get{ return 0.40; } }
		

		public AncientWyrm( 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();	
			
			MinTameSkill = 116;	//temp - can be removed after reload on all servers
		}
	}
}