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


using System;
using System.Collections;
using Server.Items;
using System.Collections.Generic;


namespace Server.Mobiles
{
	[CorpseName( "a Llama Lord corpse" )]
	public class llamalord : BaseCreature
	{
		public override bool ClickTitle{ get{ return false; } }
		public override bool ShowFameTitle{ get{ return false; } }
		
//arty stuff ---------------------------------------

		private static Type[] artylist = new Type[]
		{
		typeof( EtherealLlama ),typeof(randomartydeed)
		};
		
		
		public void GiveArtifact()
		{				
		if(0.9>Utility.RandomDouble())return;
			ArrayList toGive = new ArrayList();
			List<DamageStore> rights = BaseCreature.GetLootingRights( this.DamageEntries, this.HitsMax );

			for ( int i = rights.Count - 1; i >= 0; --i )
			{
				DamageStore ds = rights[i];
				if ( ds.m_HasRight )
					toGive.Add( ds.m_Mobile );
			}
			if ( rights.Count == 0 )return;			
			Mobile m;
			
			m	= rights[Utility.Random( rights.Count )].m_Mobile;		
			
			Item artifact =  Loot.Construct( artylist[Utility.Random(artylist.Length)] );					
			m.SendMessage(200,"As reward for fighting the llama lord, a special artifact has been bestoyed to you.");
			Container pack = m.Backpack;
			if ( pack == null || !pack.TryDropItem( m, artifact, false ) )
			m.BankBox.DropItem( artifact );			
		}
		//end arty stuff------------------------------------------

		

		
		[Constructable]
		public llamalord() : base( AIType.AI_Super, FightMode.Closest, 10, 1, 0.049, 0.049 )
		{

			SpeechHue = Utility.RandomDyedHue();
			Hue = Utility.RandomSkinHue();
			Name = "a Llama Lord";
			Body = (( this.Female = Utility.RandomBool() ) ? Body = 0x191 : Body = 0x190);
			
			Hue = Utility.RandomSkinHue();

           new RidableLlama().Rider = this;
		   



			SetDamageType( ResistanceType.Physical, 20 );
			SetDamageType( ResistanceType.Fire, 20 );
			SetDamageType( ResistanceType.Cold, 20 );
			SetDamageType( ResistanceType.Poison, 20 );
			SetDamageType( ResistanceType.Energy, 20 );

			SetResistance( ResistanceType.Physical, 50,70 );
			SetResistance( ResistanceType.Fire, 50,70);
			SetResistance( ResistanceType.Cold, 50,70 );
			SetResistance( ResistanceType.Poison, 50,70 );
			SetResistance( ResistanceType.Energy, 50,70  );

			
			SetStr( 75000);
			SetDex( 1000, 1500 );
			SetInt( 1000, 1500 );

	        SetHits( 99, 150 );
			SetMana( 110, 230 );		

			SetDamage( 1, 5 );			
			
			
			SetSkill( SkillName.MagicResist, 100, 120 );
			SetSkill( SkillName.Meditation, 100, 120 );
			SetSkill( SkillName.Focus, 100, 120 );
			SetSkill( SkillName.Wrestling, 100, 120 );
			SetSkill( SkillName.Magery, 110, 120 );
			SetSkill( SkillName.EvalInt, 110, 200 );
			SetSkill( SkillName.Anatomy, 100, 120 );
			
			
			 

			Fame = 1000000;
			Karma = -100000;

			AddItem( new Robe(Utility.RandomNeutralHue()) );
			AddItem( new Cloak(Utility.RandomNeutralHue()) );
			

			
			
			PackReg( 60 );
			Utility.AssignRandomHair( this );
		}
		
		public override void OnDeath( Container c )
 		{
		    GiveArtifact();
			base.OnDeath( c );
	 	}


		public override void GenerateLoot()
		{
		AddLoot( LootPack.Rich );
		}
		public override bool CanRummageCorpses{ get{ return true; } }
		public override bool AlwaysMurderer{ get{ return true; } }
		public override bool BardImmune{ get{ return true; } }

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