/**********************************************************
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\powerups\Antidote.cs
Lines of code: 52
***********************************************************/


using System;
using Server;
using Server.Network;
using Server.Targeting;
using Server.Mobiles;
using Server.Spells.Second;
using System.Collections;
using Server.Items;
using Server.ContextMenus;
using System.Text;

namespace Server.Items
{
	public class Antidote : BaseTrap
	{
		[Constructable]
		public Antidote() : base( 6209 )
		{
			Name = "Antidote (Removes curses and ailments)";
			Hue = 1167;
		}

		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(from==null)return;		
			
			if(Spells.Chivalry.RemoveCurseSpell.IsCursed(from) || from.Poison!=null)
			{
				Spells.Chivalry.RemoveCurseSpell.RemoveCurses(from);
				from.Poison = null;				
				from.FixedParticles( 0x373A, 10, 15, 5012, EffectLayer.Waist );
				from.PlaySound( 0x1E0 );
				from.Say("* You have been cured of your ailments *");
				this.Delete();
			}
		}

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