/**********************************************************
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\demitel\mobiles\elementallordsummoner.cs
Lines of code: 67
***********************************************************/


using System;
using Server;
using Server.Items;
using Server.Engines.CannedEvil;

namespace Server.Mobiles
{
	[CorpseName( "an ore elemental corpse" )]
	public class elordsummoner : BaseCreature
	{


		
		[Constructable]
		public elordsummoner() : base( AIType.AI_Vendor, FightMode.None, 10, 1, 0.2, 0.4 )
		{
			Name = "Servant of the Elemental Lord";
			Body = 108;
			Hue=334;
			BaseSoundID = 268;
			CantWalk=true;
			Blessed=true;
		}

		public virtual bool IsInvulnerable{ get{ return true; } }
		
		public override bool OnDragDrop( Mobile from, Item dropped )
		{		
		if(from==null || dropped==null)return false;
		
		bool summon=false;
		
		if (dropped is ChampionSkull)
		{
		ChampionSkull skull = (ChampionSkull)dropped;
				if (skull.Type==ChampionSkullType.Elements)summon=true;
		}
		
		if(!summon)
		{
		this.Say("This is not what I need to summon the elemental lord!");
		return false;
		}
		
	
		ElementalLord mob = new ElementalLord();
		mob.MoveToWorld( new Point3D( 2046, 258, 7 ), Map.Felucca );
		
		
		this.Say("The elemental lord has been summoned!  Good luck, brave one.");
		
		return true;
		}
		
		
		
		public override void OnMovement( Mobile m, Point3D oldLocation )
		{

			if( m.Alive && m is PlayerMobile )
			{
			PlayerMobile pm = (PlayerMobile)m;

				int range = 6;

				if( m.Alive && Math.Abs( Z - m.Z ) < 16 && InRange( m, range ) && !InRange( oldLocation, range ) )
				{
					
				SayTo( pm, "Bring me the skull of the elements, and I shall summon you my lord!" );
					
				}				
			}
		}		
		
		

		public override bool AutoDispel{ get{ return true; } }


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

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			writer.Write( (int) 0 );
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();
		}
	}
}