/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\engines\Event System\items\traps\StunGasTrap.cs
Lines of code: 79
***********************************************************/


using System;
using Server;
using Server.Network;

namespace Server.Items
{
	public enum StunGasTrapType
	{
		NorthWall,
		WestWall,
		Floor
	}

	public class StunGasTrap : BaseTrap
	{
		[CommandProperty( AccessLevel.GameMaster )]
		public StunGasTrapType Type
		{
			get
			{
				switch ( ItemID )
				{
					case 0x113C: return StunGasTrapType.NorthWall;
					case 0x1147: return StunGasTrapType.WestWall;
					case 0x11A8: return StunGasTrapType.Floor;
				}

				return StunGasTrapType.WestWall;
			}
			set
			{
				ItemID = GetBaseID( value );
			}
		}

		public static int GetBaseID( StunGasTrapType type )
		{
			switch ( type )
			{
				case StunGasTrapType.NorthWall: return 0x113C;
				case StunGasTrapType.WestWall: return 0x1147;
				case StunGasTrapType.Floor: return 0x11A8;
			}

			return 0;
		}

		[Constructable]
		public StunGasTrap() : this( StunGasTrapType.Floor )
		{
			Hue = 1266;
		}

		[Constructable]
		public StunGasTrap( StunGasTrapType type ) : base( GetBaseID( type ) )
		{
			Hue = 1266;
		}

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

		public override void OnTrigger( Mobile from )
		{
			if (!HarmItem.ShouldHarm(from))return;

			Effects.SendLocationEffect( Location, Map, GetBaseID( this.Type ) - 2, 16, 3, GetEffectHue(), 0 );
			Effects.PlaySound( Location, Map, 0x204 );
			
			from.FixedParticles( 0x374A, 1, 12, 5054, 2301, 7, EffectLayer.Head );//23
			from.Paralyze( TimeSpan.FromSeconds( 4.0 ) );
			
			from.Say("* A cloud of gas surrounds you. You are paralyzed *");

		}

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