/**********************************************************
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\Dark Palace\Mobiles\Verracic.cs
Lines of code: 107
***********************************************************/


using System;
using Server;
using Server.Items;
using Server.Network;

namespace Server.Mobiles
{
	[CorpseName( "the remains of Verracic" )]
	public class Verracic : BaseCreature
	{
		public override bool IgnoreYoungProtection { get { return true; } }
		public override bool AlwaysMurderer{ get{ return true; } }

		[Constructable]
		public Verracic () : base( AIType.AI_Super, FightMode.Strongest, 10, 1, 0.2, 0.3 )
		{
			Name = "Verracic";
			Body = 173;
			BaseSoundID = 387;
			Hue = 2413;

			SetStr( 250, 400 );
			SetDex( 126, 145 );
			SetInt( 280, 300 );

			SetHits( 25000 );

			SetDamage( 29, 35 );

			SetDamageType( ResistanceType.Physical, 0 );
			SetDamageType( ResistanceType.Poison, 100 );

			SetResistance( ResistanceType.Physical, 40, 50 );
			SetResistance( ResistanceType.Fire, 20, 30 );
			SetResistance( ResistanceType.Cold, 20, 30 );
			SetResistance( ResistanceType.Poison, 190, 200 );
			SetResistance( ResistanceType.Energy, 20, 30 );

			SetSkill( SkillName.EvalInt, 120.0 );
			SetSkill( SkillName.Magery, 120.0 );
			SetSkill( SkillName.Meditation, 120.0 );
			SetSkill( SkillName.MagicResist, 500.0 );
			SetSkill( SkillName.Tactics, 120.0 );
			SetSkill( SkillName.Wrestling, 120.0 );

			Fame = 50000;
			Karma = -500000;

			VirtualArmor = 50;

			PackItem( new SpidersSilk( 150 ) );
						
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.UltraRich );
		}
	
		public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
		public override Poison HitPoison{ get{ return Poison.Lethal; } }
		public override int TreasureMapLevel{ get{ return 5; } }
		public override bool BardImmune{ get{ return true; } }
		public override double BonusPetDamageScalar{ get{ return (Core.SE) ? 3.0 : 1.0; } }

		public static void PlaceItemIn( Container parent, int x, int y, Item item )
		{
			parent.AddItem( item );
			item.Location = new Point3D( x, y, 0 );
		}

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

			PlaceItemIn( c, 20, 46, new Gold(1000, 2000) );
			PlaceItemIn( c, 40, 90, new Gold(1000, 2000) );
			PlaceItemIn( c, 30, 115, new Gold(1000, 2000) );
			PlaceItemIn( c, 77, 110, new Gold(1000, 2000) );
			PlaceItemIn( c, 44, 80, new Gold(1000, 2000) );
			PlaceItemIn( c, 80, 124, new Gold(1000, 2000) );

			PlaceItemIn( c, 20, 86, new Gold(1000, 2000) );
			PlaceItemIn( c, 40, 70, new Gold(1000, 2000) );
 
		}

		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			BaseCreature c = defender as BaseCreature;

			if ( c is BaseCreature && c.Controlled )
			{
				if ( 0.1 >= Utility.RandomDouble() )
					DoSpecial( defender );
			}
			else
			{
				DebugSay( "Not a pet, just attack I shall!" );
			}
		}

		public void DoSpecial( Mobile target )
		{
			AddWebCase( target );
		}

		public void AddWebCase( Mobile m )
		{
			new WebCase().MoveToWorld( m.Location, m.Map );
			PublicOverheadMessage( MessageType.Emote, 0x47E, true, "*The gigantic spider pierces the pet body, sinking it within web*" );
			m.PlaySound( 922 );
			m.Kill();
		}

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

		}
	}
}