/**********************************************************
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\mobiles\ElementalLord.cs
Lines of code: 121
***********************************************************/


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


namespace Server.Mobiles
{
	[CorpseName( "the remains of an elemental lord" )]
	public class ElementalLord : basedemitel
	{

		public override WeaponAbility GetWeaponAbility()
		{
			switch ( Utility.Random( 6 ) )
			{
				default:
				case 1: return WeaponAbility.CrushingBlow;
				case 2: return WeaponAbility.NerveStrike;
				case 3: return WeaponAbility.ParalyzingBlow;
				case 4: return WeaponAbility.DualWield;
				case 5: return WeaponAbility.TalonStrike;
				case 6: return WeaponAbility.WhirlwindAttack;
			}
		}

	
		private static Type[] artys = new Type[]
			{
				typeof( SylphsDancingBlade ),
				typeof( TheVoid ),
				typeof( SalamandosSoul ),
				typeof( SpiritOfTheStorms ),
			};

	
		public override bool OnBeforeDeath()
		{
		GiveArtifact(artys);
		return base.OnBeforeDeath();
		}
		

		[Constructable]
		public ElementalLord() : base( AIType.AI_Super, FightMode.Closest, 0.1, 0.2 )
		{
			Name = "an elemental lord";
			Body = 102;
			BaseSoundID = 655;

			SetStr( 1310, 1500 );
			SetDex( 260, 450 );
			SetInt( 3010, 3500 );

			SetHits( 150000 );
			SetMana(500000);
			
			SetDamage( 10, 40 );

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

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

			SetSkill( SkillName.MagicResist, 100.1, 115.0 );
			SetSkill( SkillName.Tactics, 120, 140.0 );
			SetSkill( SkillName.Wrestling, 100, 120.0 );
			SetSkill( SkillName.Magery, 115, 120.0 );
			SetSkill( SkillName.EvalInt, 115, 120.0 );
			SetSkill( SkillName.Meditation, 80.1, 120 );
			SetSkill(SkillName.Archery, 90, 120 );

			Fame = 105000;
			Karma = -55000;

			Bow wep = new Bow();
			wep.Attributes.SpellChanneling = 1;
			wep.MaxDamage=30;
			wep.Movable=false;
			wep.MaxRange=40;
			wep.Attributes.WeaponSpeed=-50;
			AddItem( wep );
			
			
}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.SuperBoss, 4 );
			AddLoot( LootPack.HighScrolls, Utility.RandomMinMax( 6, 12 ) );
			AddLoot( LootPack.Potions, 2 );
			
			
			//drop ore
			PackItem(new DullCopperOre(25 + Utility.Random(25)));
			PackItem(new CopperOre(25 + Utility.Random(40) ));
			PackItem(new GoldOre(25 + Utility.Random(50) ));
			PackItem(new VeriteOre(25 + Utility.Random(60) ));
			PackItem(new AgapiteOre(50 + Utility.Random(60) ));
			PackItem(new ValoriteOre(50 + Utility.Random(80) ));
			PackItem(new BronzeOre(100 + Utility.Random(80) ));
			PackItem(new ShadowIronOre(100 + Utility.Random(100) ));
			
			//chance to drop runic hammers
			
			if(Utility.Random(50)==1)PackItem(new RunicHammer( CraftResource.DullCopper, 100 ));
			if(Utility.Random(100)==1)PackItem(new RunicHammer( CraftResource.ShadowIron, 90 ));
			if(Utility.Random(150)==1)PackItem(new RunicHammer( CraftResource.Copper, 80 ));
			if(Utility.Random(250)==1)PackItem(new RunicHammer( CraftResource.Bronze, 70 ));
			if(Utility.Random(400)==1)PackItem(new RunicHammer( CraftResource.Gold, 60 ));
			if(Utility.Random(650)==1)PackItem(new RunicHammer( CraftResource.Agapite, 50 ));
			if(Utility.Random(800)==1)PackItem(new RunicHammer( CraftResource.Verite, 40 ));
			if(Utility.Random(1000)==1)PackItem(new RunicHammer( CraftResource.Valorite, 30 ));			
		}
		
		
		public override void OnDamage( int amount, Mobile attacker, bool willKill )
		{

		base.OnDamage(amount,attacker,willKill);
		}		
		

		public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
		public override bool BardImmune{ get{ return !Core.SE; } }
		public override bool Unprovokable{ get{ return Core.SE; } }
		public override bool Uncalmable{ get{ return Core.SE; } }
		public override double BonusPetDamageScalar{ get{ return 2.0; } }

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