/**********************************************************
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\Melisande\Key System\DryadBasket.cs
Lines of code: 59
***********************************************************/


using System;
using System.Collections;
using Server.Multis;
using Server.Mobiles;
using Server.Network;
using System.Collections.Generic;
using Server.ContextMenus;

namespace Server.Items
{
	public class DryadBasket : BaseContainer
	{
		[Constructable]
		public DryadBasket() : base( 0x990 )
		{
			Weight = 1.0; 
		}

		public DryadBasket( Serial serial ) : base( serial )
		{
		}
		
		public override bool OnDragDropInto( Mobile from, Item dropped, Point3D p )
		{
			//DryadsBlessing DBless = dropped as DryadsBlessing;
			// && base.OnDragDropInto( from, dropped, p )
			
			//DBless != null

			if (dropped is DryadsBlessing)
			{
				from.AddToBackpack(new peerlesskeybag(new MelisandeKey(), 2,0,1));
				from.SendMessage("You are given a bag of keys which will summon the beast");
				dropped.Delete();
				return true;
			}
			else
			{
				return false;
			}
		}
		
		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			//DryadsBlessing DBless = dropped as DryadsBlessing;

			if (dropped is DryadsBlessing)
			{
				from.AddToBackpack(new peerlesskeybag(new MelisandeKey(this.Map==Map.Trammel ? Map.Trammel : Map.Felucca), 2,0,1));
				from.SendMessage("You are given a bag of keys which will summon the beast");
				dropped.Delete();
				return true;
			}
			else
			{
				return false;
			}
		}

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