/**********************************************************
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\ManaPotion.cs
Lines of code: 43
***********************************************************/


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

namespace Server.Items
{
	public class ManaPotion : BaseTrap
	{
		[Constructable]
		public ManaPotion() : base( 6209 )
		{
			Name = "Mana Potion (Restores All Mana)";
			Hue = 1266;
		}

		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.Mana == from.ManaMax)return;

			from.Mana = from.ManaMax;
			
			from.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist );
			from.PlaySound( 0x1ED );
			
			from.Say("* Your mana has been replenished *");
			this.Delete();
			
		}

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