/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\events and scenarios\Summer2008\Magincia Mystery\BlackrockQuests\BlackrockElemental.cs
Lines of code: 121
***********************************************************/


using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
	[CorpseName( "a blackrock elemental corpse" )]
	public class BlackrockElemental : BaseCreature
	{
	
	
		public override WeaponAbility GetWeaponAbility()
		{
			switch ( Utility.Random( 2 ) )
			{
				default:
				case 0: return WeaponAbility.Dismount;
				case 1: return WeaponAbility.ArmorIgnore;
			}
		}

		[Constructable]
		public BlackrockElemental() : base( AIType.AI_Super, FightMode.Closest, 10, 1, 0.18, 0.22 )
		{
			Name = "a blackrock elemental";
			Body = 111;
			Hue = 1175;
			BaseSoundID = 268;

			SetStr( 255, 300 );
			SetDex( 165, 185 );
			SetInt( 143, 150 );

			SetHits( 2391, 2420 );

			SetDamage( 40, 70 );

			SetDamageType( ResistanceType.Physical, 25 );
			SetDamageType( ResistanceType.Fire, 25 );
			SetDamageType( ResistanceType.Cold, 25 );
			SetDamageType( ResistanceType.Energy, 25 );

			SetResistance( ResistanceType.Physical, 67, 71 );
			SetResistance( ResistanceType.Fire, 50, 56 );
			SetResistance( ResistanceType.Cold, 47, 51 );
			SetResistance( ResistanceType.Poison, 50, 57 );
			SetResistance( ResistanceType.Energy, 35, 40 );

			SetSkill( SkillName.MagicResist, 120.0 );
			SetSkill( SkillName.Tactics, 120.0 );
			SetSkill( SkillName.Wrestling, 120.0 );

			Fame = 35000;
			Karma = -35000;

			VirtualArmor = 23;
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.SuperBoss, 4 );
		}

		public override bool AutoDispel{ get{ return true; } }
		public override bool BleedImmune{ get{ return true; } }
		public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
		public override int TreasureMapLevel{ get{ return 6; } }
		public override int BonusHPR{ get{ return 70; } }
		public override bool NoFlee { get { return true; } }
		public override bool Unprovokable{ get{ return true; } }
		public override bool Uncalmable{ get{ return true; } }
		public override bool AlwaysMurderer{ get{ return true; } }
		
		public override int AuraDamageMin {get{return 20;}}		
		public override int AuraDamageMax {get{return 50;}}		
		
		public override double AuraChance {get{return 1;}} 
		public override int AuraDelayMin {get{return 7;}}
		public override int AuraDelayMax {get{return 14;}}
		
		public override int AuraEffectID {get{return 0x3709;}}			//effect item id shown on affected mobiles
		public override int AuraEffectType {get{return 9904;}}		//effect id shown on affected mobiles 9502
		public override int AuraEffectHue {get{return 0x835;}} 			//effect hue to show on affected mobiles 0x835
		public override int AuraEffectRender {get{return 3;}} 			//effect render mode to show on affected mobiles 0x496
		public override int AuraEffectSound {get{return 0x231;}}			//effect sound id to show on affected mobiles		
		
		public override int AuraDamagePhys {get{return 0;}}
		public override int AuraDamageFire {get{return 50;}}
		public override int AuraDamageCold {get{return 0;}}
		public override int AuraDamagePoison {get{return 50;}}
		public override int AuraDamageEnergy {get{return 0;}}
		public override int AuraDamageChaos {get{return 0;}}
		public override int AuraDamageDirect {get{return 0;}} 	
		
		public override TextDefinition AuraEffectText {get{return "The steam burns you!";}}//cliloc/string sent to affected mobiles				
		public override int AuraRange {get{return 4;}}				//the range in tiles, of the aura
		public override bool AuraIgnoreLOS {get{return false;}}

		public override void AlterMeleeDamageFrom( Mobile from, ref int damage )
		{
			if ( from is BaseCreature )
			{
				BaseCreature bc = (BaseCreature)from;

				if ( bc.Controlled || bc.BardTarget == this )
					damage = 0; // Immune to pets and provoked creatures
			}
		}
		
		public override void OnDeath( Container c )
		{
			c.DropItem( new ShadowIronOre( 25 )  );

			base.OnDeath( c );
		}
		
		public override void OnDamage( int amount, Mobile attacker, bool willKill ) 
		{
		
			if(attacker!=null)
			{
			int ReflectedDMG; 
			
			ReflectedDMG = (int)(amount * 0.5);
			AOS.Damage( attacker, this, ReflectedDMG, true, 0, 0, 0, 0, 0, 0, 100,false );
			}
			base.OnDamage(amount, attacker, willKill);	
		}

		public override void AlterDamageScalarFrom( Mobile caster, ref double scalar )
		{
			scalar = 0.0; // Immune to magic
		}

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