/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\items\special\dbclicksummoner.cs
Lines of code: 124
***********************************************************/


using System;
using System.Collections;
using System.Collections.Generic;
using Server.Spells;
using Server.ContextMenus;
using Server.Mobiles;


namespace Server.Items
{
	public class dbclicksummoner : Item
	{
		private TimeSpan m_delay=TimeSpan.FromMinutes(15);
		private DateTime m_lastsummon;
		
		
		[CommandProperty( AccessLevel.GameMaster )] 
		public TimeSpan Delay
		{
			get { return m_delay; }
			set {m_delay = value;Modify();}
		}		


		public static Type[] Monsters_List = new Type[]
		{
		typeof(BlackBear),typeof(BrownBear),typeof(GrizzlyBear),typeof(PolarBear) //bears
		,typeof(Chicken),typeof(Crane),typeof(Eagle),typeof(Phoenix) //birds
		,typeof(DireWolf),typeof(GreyWolf),typeof(TimberWolf),typeof(WhiteWolf) //canines
		,typeof(Bull),typeof(Cow) //cows
		,typeof(Cougar),typeof(HellCat),typeof(Panther),typeof(PredatorHellCat),typeof(SnowLeopard) //felines
		,typeof(Boar),typeof(BullFrog),typeof(Gaman),typeof(GiantToad),typeof(Goat),typeof(Gorilla),typeof(GreatHart) //misc
		,typeof(Hind),typeof(Llama),typeof(MountainGoat),typeof(PackHorse),typeof(PackLlama),typeof(Pig),typeof(Sheep),typeof(Walrus) //misc
		,typeof(Beetle),typeof(DesertOstard),typeof(FireSteed),typeof(ForestOstard),typeof(FrenziedOstard),typeof(HellSteed)//mounts
		,typeof(Hiryu),typeof(Horse),typeof(Kirin),typeof(LesserHiryu),typeof(Nightmare),typeof(RidableLlama),typeof(Ridgeback)//mounts
		,typeof(SavageRidgeback),typeof(SilverSteed),typeof(SkeletalMount),typeof(SwampDragon),typeof(Unicorn)//mounts
		,typeof(Alligator),typeof(GiantSerpent),typeof(IceSerpent),typeof(IceSnake),typeof(LavaLizard),typeof(LavaSerpent)//reptiles
		,typeof(LavaSnake),typeof(SilverSerpent),typeof(Snake)//reptile
		,typeof(GiantRat),typeof(JackRabbit),typeof(Rabbit),typeof(Sewerrat)//rodents
		,typeof(AntLion),typeof(BlackSolenInfiltratorQueen),typeof(BlackSolenInfiltratorWarrior),typeof(BlackSolenQueen)//ants
		,typeof(BlackSolenWarrior),typeof(BlackSolenWorker),typeof(RedSolenInfiltratorQueen),typeof(RedSolenInfiltratorWarrior)//ants
		,typeof(RedSolenQueen),typeof(RedSolenWarrior),typeof(RedSolenWorker),typeof(SolenHelper)//ants
		,typeof(Devourer),typeof(FleshGolem),typeof(Gibberling),typeof(GoreFiend),typeof(PatchworkSkeleton)//AOS
		,typeof(Ravager),typeof(SkitteringHopper),typeof(Treefellow),typeof(VampireBat),typeof(WailingBanshee),typeof(WandererOfTheVoid)//AOS
		,typeof(DreadSpider),typeof(TerathanAvenger),typeof(TerathanMatriarch),typeof(FrostSpider),typeof(GiantBlackWidow)//arachnid
		,typeof(GiantSpider),typeof(TerathanDrone),typeof(TerathanWarrior)//arachnid
		,typeof(AirElemental),typeof(BloodElemental),typeof(Efreet),typeof(FireElemental),typeof(IceElemental),typeof(PoisonElemental)//elemental
		,typeof(ToxicElemental),typeof(WaterElemental),typeof(EarthElemental),typeof(SnowElemental)//elemental
		,typeof(AncientLich),typeof(ArcaneDaemon),typeof(Balron),typeof(Betrayer),typeof(Bogle),typeof(BoneMagi),typeof(Daemon)//humanoid
		,typeof(ElderGazer),typeof(EvilMage),typeof(EvilMageLord),typeof(FireGargoyle),typeof(Gargoyle),typeof(GargoyleDestroyer) //humanoid
		,typeof(GargoyleEnforcer),typeof(Gazer),typeof(GolemController),typeof(IceFiend),typeof(Imp),typeof(Lich),typeof(LichLord)//humanoid
		,typeof(OrcishMage),typeof(RatmanMage),typeof(SavageShaman),typeof(Shade),typeof(SkeletalMage),typeof(Spectre)//humanoid
		,typeof(Succubus),typeof(Titan),typeof(Wraith),typeof(ArcticOgreLord),typeof(BoneKnight),typeof(Brigand),typeof(ChaosDaemon)//humanoid
		,typeof(Cursed),typeof(Cyclops),typeof(Doppleganger),typeof(EnslavedGargoyle),typeof(Ettin),typeof(Executioner),typeof(FrostTroll)//humanoid
		,typeof(GazerLarva),typeof(Ghoul),typeof(Guardian),typeof(HeadlessOne),typeof(HordeMinion),typeof(Juggernaut) //humanoid
		,typeof(KhaldunSummoner),typeof(KhaldunZealot),typeof(Moloch),typeof(Mongbat),typeof(Mummy),typeof(Ogre),typeof(OgreLord)//humanoid
		,typeof(Orc),typeof(OrcBomber),typeof(OrcBrute),typeof(OrcCaptain),typeof(OrcishLord),typeof(Ratman),typeof(RatmanArcher)//humanoid
		,typeof(RestlessSoul),typeof(RottingCorpse),typeof(Savage),typeof(SavageRidgeback),typeof(ShadowFiend),typeof(SkeletalKnight)//humanoid
		,typeof(Skeleton),typeof(SpectralArmour),typeof(StoneGargoyle),typeof(StrongMongbat),typeof(Troll),typeof(Zombie) //humanoid
		,typeof(ExodusMinion),typeof(ExodusOverseer),typeof(JukaLord),typeof(JukaMage),typeof(JukaWarrior) //LBR
		,typeof(MeerCaptain),typeof(MeerMage),typeof(MeerWarrior) //LBR
		,typeof(HellHound),typeof(DarkWisp),typeof(EtherealWarrior),typeof(Pixie),typeof(ShadowWisp),typeof(Wisp) //misc
		,typeof(Centaur),typeof(FrostOoze),typeof(Golem),typeof(PlagueBeast),typeof(PlagueBeastLord),typeof(SandVortex),typeof(Slime)//misc
		,typeof(AgapiteElemental),typeof(BronzeElemental),typeof(CopperElemental),typeof(DullCopperElemental),typeof(GoldenElemental) //ore elementals
		,typeof(ShadowIronElemental),typeof(ValoriteElemental),typeof(VeriteElemental) //ore elementals
		,typeof(Reaper),typeof(Bogling),typeof(BogThing),typeof(Corpser),typeof(Quagmire),typeof(SwampTentacle),typeof(WhippingVine)//plants
		,typeof(AncientWyrm),typeof(Dragon),typeof(OphidianArchmage),typeof(OphidianMage),typeof(OphidianMatriarch) //reptile
		,typeof(SerpentineDragon),typeof(ShadowWyrm),typeof(SkeletalDragon),typeof(WhiteWyrm) //reptile
		,typeof(BakeKitsune),typeof(DeathwatchBeetleHatchling),typeof(DeathwatchBeetle),typeof(EliteNinja),typeof(FanDancer) //SE
		,typeof(FireBeetle),typeof(Kappa),typeof(KazeKemono),typeof(LadyOfTheSnow),typeof(Oni),typeof(RaiJu),typeof(RevenantLion) //SE
		,typeof(Ronin),typeof(RuneBeetle),typeof(TsukiWolf),typeof(Yamandon),typeof(YomotsuElder),typeof(YomotsuPriest),typeof(YomotsuWarrior) //SE
		
		//customs:
		
		,typeof(Berserker),typeof(FrostBat),typeof(FrostBeetle),typeof(IceDevil),typeof(PhantomAsp),typeof(PoisonIvy),typeof(Vampire),typeof(Wight)
		,typeof(dreadsquirrel),typeof(holysquirrel),typeof(humusminion),typeof(naturalrevenant),typeof(rabidsquirrel)
		,typeof(squirrel),typeof(vorpalchicken),typeof(westnilecrow),typeof(apprenticejedi),typeof(darkjediknight),typeof(droid),typeof(jediknight),typeof(sithlord)
		,typeof(stormtrooper)	
		
		};
		
	
		public dbclicksummoner( Serial serial ) : base( serial )
		{
		}


		[Constructable]
		public dbclicksummoner() : base( 3633 )
		{
			Movable=false;			
		}

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

			writer.Write((TimeSpan)m_delay);			

		}

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


		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( this, 1 ) )
			{
				from.SendMessage("That is too far away"); 
				return;
			}
		
			if((m_lastsummon+m_delay)>DateTime.Now)
			{
				from.SendMessage("You must wait to do this again");
				return;
			}
			
			Mobile mob=null;
			
			try
			{
				 mob = Activator.CreateInstance( Monsters_List[Utility.Random( Monsters_List.Length )] ) as Mobile;
			}
			catch
			{
				from.SendMessage("System error while activating item.  Try again.");
			}
		
			if(mob!=null)
			{
				mob.OnBeforeSpawn( this.Location, this.Map );
				
				mob.MoveToWorld(this.Location,this.Map);

				m_lastsummon=DateTime.Now;
			}
			else
			{
				from.SendMessage("System error while activating item.  Activator returned null.  Try again.");
			}
		}
	}
}