/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Death on Apr-18-2011 09:34:36pm
Filepath: scripts\_custom\Revised Class Quests\Red Solen Matriarch\Mobiles\BlackSolenInfiltrator.cs
Lines of code: 152
***********************************************************/


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

namespace Server.Mobiles
{
	[CorpseName( "a solen infiltrator corpse" )]
	public class BlackSolenInfiltrator : BaseCreature
	{
		private bool m_IsQueen;
		[Constructable]
		public BlackSolenInfiltrator() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			if (0.25 >= Utility.RandomDouble()) {
				m_IsQueen = true;
				Name = "a black solen infiltrator";
				Body = 807;
				BaseSoundID = 959;
				Hue = 0x453;

				SetStr( 326, 350 );
				SetDex( 141, 165 );
				SetInt( 96, 120 );

				SetHits( 151, 162 );

				SetDamage( 10, 15 );

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

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

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

				Fame = 6500;
				Karma = -6500;

				VirtualArmor = 50;

				SolenHelper.PackPicnicBasket( this );

				PackItem( new ZoogiFungus( ( 0.05 > Utility.RandomDouble() ) ? 16 : 7 ) );
			}
			else {
				m_IsQueen = false;
				Name = "a black solen infiltrator";
				Body = 806;
				BaseSoundID = 959;
				Hue = 0x453;

				SetStr( 206, 230 );
				SetDex( 121, 145 );
				SetInt( 66, 90 );

				SetHits( 96, 107 );

				SetDamage( 5, 15 );

				SetDamageType( ResistanceType.Physical, 80 );
				SetDamageType( ResistanceType.Poison, 20 );

				SetResistance( ResistanceType.Physical, 20, 35 );
				SetResistance( ResistanceType.Fire, 20, 35 );
				SetResistance( ResistanceType.Cold, 10, 25 );
				SetResistance( ResistanceType.Poison, 20, 35 );
				SetResistance( ResistanceType.Energy, 10, 25 );

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

				Fame = 3000;
				Karma = -3000;

				VirtualArmor = 40;

				SolenHelper.PackPicnicBasket( this );

				PackItem( new ZoogiFungus( ( 0.05 > Utility.RandomDouble() )? 13 : 5 ) );
			}		
		}

		public override int GetAngerSound()
		{
			if (m_IsQueen) {
				return 0x259;
			}
			else {
				return 0xB5;
			}
		}
		
		public override int GetIdleSound()
		{
			if (m_IsQueen) {
				return 0x259;
			}
			else {
				return 0xB5;
			}
		}

		public override int GetAttackSound()
		{
			if (m_IsQueen) {
				return 0x195;
			}
			else {
				return 0x289;
			}
		}

		public override int GetHurtSound()
		{
			if (m_IsQueen) {
				return 0x250;
			}
			else {
				return 0xBC;
			}
		}

		public override int GetDeathSound()
		{
			if (m_IsQueen) {
				return 0x25B;
			}
			else {
				return 0xE4;
			}
		}

		public override void GenerateLoot()
		{
			if (m_IsQueen) {
				AddLoot( LootPack.Rich );
			}
			else {
				AddLoot( LootPack.Average, 2 );
				AddLoot( LootPack.Gems, Utility.RandomMinMax( 1, 4 ) );
			}
		}

		public override bool IsEnemy( Mobile m )
		{
			if ( SolenHelper.CheckBlackFriendship( m ) )
				return false;
			else
				return base.IsEnemy( m );
		}

		public override void OnDamage( int amount, Mobile from, bool willKill )
		{
			if(from!=null)SolenHelper.OnBlackDamage( from );

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

		public BlackSolenInfiltrator( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
			writer.Write( m_IsQueen );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
			m_IsQueen = reader.ReadBool();
		}
	}
}