/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\engines\ML Peerless + misc areas\labyrinth\mobiles\reptalon.cs
Lines of code: 116
***********************************************************/


using System;
using Server.Mobiles;
using Server.Network;
using Server;
using Server.Items;
using System.Collections;

namespace Server.Mobiles
{
	[CorpseName( "a reptalon corpse" )]
	public class Reptalon : BaseMount
	{
		[Constructable]
		public Reptalon() : this( "a Reptalon" )
		{
		}

		[Constructable]    //body,mounted id
		public Reptalon( string name ) : base( name, 276,16016, AIType.AI_Super, FightMode.Closest, 10, 1, 0.1, 0.3 )
		{
		if(0.02 > Utility.RandomDouble()) Hue= Utility.RandomList(0x501,0x486,0x4f2,0x47e,0x48f,0x455,0x21,0x58c,0x66c,0x54f,0x973,0x966,0x96D,0x972,0x8A5,0x979,0x89F,0x8AB);
		else if (Utility.Random(12) == 1) Hue = Utility.RandomList(593, 2425, 2419, 2219, 2413, 2207, 2418, 2213, 1278, 26, 96, 900);
		else if (Utility.Random(24) == 1) Hue = Utility.RandomList(1643, 2406);
		else if (Utility.Random(50) == 1) Hue = Utility.RandomList(1150,1153);
		else if (Utility.Random(75) == 1) Hue = Utility.RandomList(1161);		
	
		
			BaseSoundID = 362;

			SetStr( 1000, 1025 );
			SetDex( 150, 160 );
			SetInt( 250, 290 );

			SetHits( 800, 1000 );
			SetStam(150,160);
			SetMana(250,290);

			SetDamage( 21, 28 );

			SetDamageType( ResistanceType.Physical, 0 );
			SetDamageType( ResistanceType.Poison, 25 );
			SetDamageType( ResistanceType.Energy, 75 );

			SetResistance( ResistanceType.Physical, 50, 65 );
			SetResistance( ResistanceType.Fire, 35, 45 );
			SetResistance( ResistanceType.Cold, 35, 45 );
			SetResistance( ResistanceType.Poison, 50, 65 );
			SetResistance( ResistanceType.Energy, 70, 85 );

			SetSkill( SkillName.MagicResist, 65.3, 100.0 );
			SetSkill( SkillName.Spellweaving, 65.3, 100.0 );
			SetSkill( SkillName.Tactics, 77.6, 100.0 );
			SetSkill( SkillName.Anatomy, 56.4, 59.7 );
			SetSkill( SkillName.Wrestling, 84.5, 120 );

			Fame = 16000;
			Karma = -16000;

			VirtualArmor = 60;

			Tamable = true;
			ControlSlots = 4;
			MinTameSkill = 101.1;			
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.FilthyRich,1 );
			AddLoot( LootPack.Average,4 );
			PackSWScroll(2);
		}
		
		public override void OnDamage( int amount, Mobile attacker, bool willKill ) 
		{
			if ( 0.1 >= Utility.RandomDouble() )
				ParalyzingRoar();
			
			base.OnDamage(amount, attacker, willKill);	
		}

		public void ParalyzingRoar()
		{
			this.PlaySound( 1262 );
			ArrayList list = new ArrayList();
			
			foreach ( Mobile m in this.GetMobilesInRange( 5 ) )
			{
				if ( this != m && this.InLOS( m ) && this.ShouldHarm( m ))
				{
					if(m.Combatant==this)list.Add( m );
					else if(this.ControlMaster!=null && m.Combatant==this.ControlMaster)list.Add(m);
					else if(this.SummonMaster!=null && m.Combatant==this.SummonMaster)list.Add(m);					
				}
			}

			foreach ( Mobile m in list )
			{
				DoHarmful( m );
				
				m.PlaySound( 0x204 );
				m.FixedEffect( 0x376A, 6, 1 );
				m.SendMessage( "The mighty roar makes you stop dead in your tracks" );
				m.Paralyze( TimeSpan.FromSeconds( 4.0 ) );

			}
		}

		public override bool HasBreath{ get{ return true; } } // fire breath enabled
		public override int Meat{ get{ return 6; } }
		public override int Hides{ get{ return 15; } }
		public override int Scales{ get{ return 3; } }		
		public override Poison PoisonImmune{ get{ return Poison.Greater; } }
		public override Poison HitPoison{ get{ return Poison.Regular; } }
		public override double HitPoisonChance{ get{ return 0.2; } }
		public override HideType HideType{ get{ return HideType.Barbed; } }
		public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }
		public override bool CanAngerOnTame { get { return true; } }
		public override int TreasureMapLevel{ get{ return 5; } }				
		public override bool StatLossAfterTame{ get{ return true; } }		
		public override bool IsMLCreature { get { return true;} } 
		public override int ArcaneLevel{ get{ return 2; } }
		public override int BonusHPR{ get{ return 10; } }
		

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

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

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

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

			int version = reader.ReadInt();
			
			if(Skills[SkillName.Spellweaving].Value<20)SetSkill( SkillName.Spellweaving, 65.3, 100.0 );
		}
	}
}