/**********************************************************
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\shimering effusion\mobiles\FetidEssence.cs
Lines of code: 88
***********************************************************/


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

namespace Server.Mobiles
{
	[CorpseName( "the remains of a fetid essence" )]
	public class FetidEssence : BaseCreature
	{

		[Constructable]
		public FetidEssence() : base( AIType.AI_Super, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a fetid essence";
			Body = 273;
			BaseSoundID = 1388;

			SetStr( 108, 119 );
			SetDex( 210, 245 );
			SetInt( 453, 537 );

			SetHits( 571, 648 );
			SetStam( 210, 245 );
			SetMana( 453, 537 );

			SetDamage( 24, 30 );

			SetDamageType( ResistanceType.Physical, 30 );
			SetDamageType( ResistanceType.Poison, 70 );

			SetResistance( ResistanceType.Physical, 41, 48 );
			SetResistance( ResistanceType.Fire, 41, 50 );
			SetResistance( ResistanceType.Cold, 41, 45 );
			SetResistance( ResistanceType.Poison, 76, 90 );
			SetResistance( ResistanceType.Energy, 75, 79 );

			SetSkill( SkillName.MagicResist, 104.6, 113.1 );
			SetSkill( SkillName.Tactics, 80.5, 84.4 );
			SetSkill( SkillName.Wrestling, 82.5, 84.7 );
			SetSkill( SkillName.Poisoning, 90.5, 101.7 );
			SetSkill( SkillName.Magery, 90.1, 97.9 );
			SetSkill( SkillName.EvalInt, 80.1, 99.3 );
			SetSkill( SkillName.Meditation, 81.3, 96.3 );

			Fame = 12000;
			Karma = -12000;

			VirtualArmor = 55;
		}

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

		public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
		public override bool Unprovokable{ get{ return true; } }
		public override bool Uncalmable{ get{ return true; } }
		public override bool IsMLCreature { get { return true;} }
		public override Poison HitPoison{ get{ return Utility.RandomBool() ? Poison.Deadly : Poison.Lethal; } }
		public override double HitPoisonChance{ get{ return 0.2; } }		

		public FetidEssence( Serial serial ) : base( serial )
		{
		}
		
		public override void OnThink()
		{
		
			if (this.Combatant != null && 0.015 >= Utility.RandomDouble())
				IntermittentDamage();
				
			base.OnThink();	
		}
		
		public void IntermittentDamage()
		{
			ArrayList list = new ArrayList();

			foreach ( Mobile m in this.GetMobilesInRange( 15 ) )
			{
				if ( m == this || !CanBeHarmful( m ) || !this.InLOS( m ))
					continue;

				if ( m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned || ((BaseCreature)m).Team != this.Team ) )
					list.Add( m );
				else if ( m.Player )
					list.Add( m );
			}

			foreach ( Mobile m in list )
			{
				m.PlaySound( 1427 );				
				AOS.Damage( m, this, Utility.RandomMinMax( 8, 12 ), true, 100, 0, 0, 0, 0 );
			}
		}

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