/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\mobiles\MimicTrap.cs
Lines of code: 48
***********************************************************/


using System;
using Server;
using Server.Network;
using Server.Targeting;
using Server.Mobiles;

namespace Server.Items
{
	public class MimicTrap : BaseTrap
	{
		[Constructable]
		public MimicTrap() : base( 1 )
		{
			switch ( Utility.Random( 2 ))
			{       
				case 0: ItemID = 3650; Name = "A Locked Treasure Chest"; break;  
				case 1: ItemID = 3651; Name = "A Locked Treasure Chest"; break;	
			}
		}

		public override bool PassivelyTriggered{ get{ return true; } }
		public override TimeSpan PassiveTriggerDelay{ get{ return TimeSpan.Zero; } }
		public override int PassiveTriggerRange{ get{ return 1; } }
		public override TimeSpan ResetDelay{ get{ return TimeSpan.FromSeconds( 0.0 ); } }

		public override void OnTrigger( Mobile from )
		{
		if (!HarmItem.ShouldHarm(from) && from.Skills[SkillName.Lockpicking].Base <= 49.9 )return;
			from.Hidden = false;

			Mobile spawn;
			spawn = new Mimic();
			spawn.MoveToWorld( this.Location, this.Map );	
			spawn.Combatant = from;
			
			
			spawn.Say("* You have been deceived, that item is really a mimic! *");
			this.Delete();
		}

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

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}
}ÿ