/**********************************************************
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\demitel\MirageDesert\DesertRider.cs
Lines of code: 140
***********************************************************/


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

namespace Server.Mobiles
{
	public class DesertRider : BaseCreature
	{
		public override WeaponAbility GetWeaponAbility()
		{
			switch ( Utility.Random( 2 ) )
			{
				default:
				case 0: return WeaponAbility.InfectiousStrike;
				case 1: return WeaponAbility.InfectiousStrike;
				case 2: return WeaponAbility.ArmorIgnore;

			}
		}
		[Constructable]
		public DesertRider() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.15, 0.4 )
		{
			switch (Utility.Random(4))
			{
			case 0: Name = "Samant";break;
			case 1: Name = "Seika";break;
			case 2: Name = "Samam";break;
			case 3: Name = "Ank'Tabeh";break;
			case 4: Name = "Ank'Terem";break;
			}
			Body = 400;
			Hue = 33770;

			ActiveSpeed = 0.11;
			CurrentSpeed = 0.11;
			PassiveSpeed = 0.11;

			SetStr( 151, 170 );
			SetDex( 800, 800 );
			SetInt( 51, 65 );

			SetDamage( 29, 34 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 50, 60 );
			SetResistance( ResistanceType.Fire, 90 );
			SetResistance( ResistanceType.Cold, 50, 60 );
			SetResistance( ResistanceType.Poison, 20, 40 );
			SetResistance( ResistanceType.Energy, 40, 60 );

			SetSkill( SkillName.Healing, 60.3, 90.0 );
			SetSkill( SkillName.Macing, 72.5, 95.0 );
			SetSkill( SkillName.Poisoning, 90.0, 115.5 );
			SetSkill( SkillName.MagicResist, 72.5, 95.0 );
			SetSkill( SkillName.Macing, 72.5, 95.0 );
			SetSkill( SkillName.Fencing, 72.5, 120.0 );
			SetSkill( SkillName.Archery, 72.5, 120.0 );
			SetSkill( SkillName.Tactics, 72.5, 120.0 );

			Fame = 1000;
			Karma = -1000;

			PackItem( new Bandage( Utility.RandomMinMax( 1, 15 ) ) );

			if ( 0.1 > Utility.RandomDouble() )
				PackItem( new BolaBall() );

			HornedTribalMask helm = new HornedTribalMask();
			helm.Hue = 2413;
			AddItem( helm );

			Robe robe = new Robe();
			robe.Hue = 2413;
			AddItem( robe );

			LeatherGloves gloves = new LeatherGloves();
			gloves.Hue = 2413;
			AddItem( gloves );

			switch ( Utility.Random( 2 ))
			{
				case 0: AddItem( new Spear()); break;
				case 1: AddItem( new Kryss() ); break;
				case 2: AddItem( new Kryss() ); break;
			}

			new Horse().Rider = this;
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.FilthyRich, 2 );
		}

		public override bool AlwaysMurderer{ get{ return true; } }
		public override bool ShowFameTitle{ get{ return false; } }
		public override bool BardImmune{ get{ return !Core.AOS; } }

		public override OppositionGroup OppositionGroup
		{
			get{ return OppositionGroup.SavagesAndOrcs; }
		}

		public override bool OnBeforeDeath()
		{
			IMount mount = this.Mount;

			if ( mount != null )
				mount.Rider = null;

			if ( mount is Mobile )
				((Mobile)mount).Delete();

			return base.OnBeforeDeath();
		}

		public override bool IsEnemy( Mobile m )
		{
			if ( m.BodyMod == 183 || m.BodyMod == 184 )
				return false;

			return base.IsEnemy( m );
		}

		public override void AggressiveAction( Mobile aggressor, bool criminal )
		{
			base.AggressiveAction( aggressor, criminal );

			if ( aggressor.BodyMod == 183 || aggressor.BodyMod == 184 )
			{
				AOS.Damage( aggressor, 50, 0, 100, 0, 0, 0 );
				aggressor.BodyMod = 0;
				aggressor.HueMod = -1;
				aggressor.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );
				aggressor.PlaySound( 0x307 );
				aggressor.SendLocalizedMessage( 1040008 ); // Your skin is scorched as the tribal paint burns away!

				if ( aggressor is PlayerMobile )
					((PlayerMobile)aggressor).SavagePaintExpiration = TimeSpan.Zero;
			}
		}

		public override void AlterMeleeDamageTo( Mobile to, ref int damage )
		{
			if ( to is Dragon || to is WhiteWyrm || to is SwampDragon || to is Drake || to is Nightmare || to is Hiryu || to is LesserHiryu || to is Daemon )
				damage *= 3;
		}

		public override void AddNameProperties( ObjectPropertyList list )
		{
			base.AddNameProperties( list );

			list.Add("The Cobra Tribe");
		}

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