/**********************************************************
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\valentinesday\cupidminion.cs
Lines of code: 90
***********************************************************/


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


namespace Server.Mobiles
{
	[CorpseName( "a cupid minion corpse " )]
	public class cupidminion : BaseCreature
	{
	
	
	//arty stuff ---------------------------------------

		private static Type[] artylist = new Type[]
		{
		typeof( randomartydeed ),typeof(ClothingBlessDeed),typeof(pigmentsoffel),typeof(skilldeed),typeof(GargoylesPickaxe),typeof(SOS)
		};
		
		
		public void GiveArtifact()
		{
		if(0.04<Utility.RandomDouble())return; //decimal % chance to get artifact
		
			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,"You have been rewarded for your valor!");
			Container pack = m.Backpack;
			if ( pack == null || !pack.TryDropItem( m, artifact, false ) )
			m.BankBox.DropItem( artifact );			
		}
		//end arty stuff------------------------------------------
		
		
		public override bool OnBeforeDeath()
		{
		GiveArtifact();
		return base.OnBeforeDeath();
		}

	
		[Constructable]
		public cupidminion() : base( AIType.AI_Super, FightMode.Closest, 10, 1, 0.049, 0.059 )
		{
			Name = "A Cupid Minion";
			BodyValue = 128;
			
			Hue = 1278;			
			
			
			SetDamage( 3, 6 );

			SetDamageType( ResistanceType.Physical, 100 );


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

			
			SetStr( 70, 100 );
			SetDex( 20, 50 );
			SetInt( 125, 205 );

		
			
			
			SetSkill( SkillName.MagicResist, 100, 120 );
			SetSkill( SkillName.Focus, 100, 120 );
			SetSkill( SkillName.Magery, 100, 120 );
			SetSkill( SkillName.EvalInt, 10, 15 );		
			SetSkill( SkillName.Meditation, 100, 250 );	


			Fame = 1400;
			Karma = -1000;


			Gold gold = new Gold(60+Utility.Random(150));
			gold.Hue=1278;
			gold.Name="Wubby Money";

			PackItem(gold);
			

		}
		
		public override void OnDeath( Container c )
 		{
			base.OnDeath( c );
	 	}


		public override void GenerateLoot()
		{
		AddLoot( LootPack.Rich );
		}

		

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