/**********************************************************
RunUO AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Red Squirrel on Mar-09-2012 08:19:34pm
Filepath: scripts\Mobiles\custom mobiles - to sort\ML Named\Grobu.cs
Lines of code: 125

Description: 

***********************************************************/


using System;
using Server;
using Server.ContextMenus;
using Server.Accounting;
using Server.Gumps;
using Server.Items;
using Server.Menus;
using Server.Menus.Questions;
using Server.Mobiles;
using Server.Network;
using Server.Prompts;
using Server.Regions;
using Server.Engines.Quests;
using Server.Misc;
using System.Collections;
using System.Collections.Generic;
using Server.Engines.Quests.Grobu;

namespace Server.Mobiles
{
	[CorpseName( "a grobu corpse" )]
	public class Grobu : BaseCreature
	{
	
		public override WeaponAbility GetWeaponAbility()
		{
			switch ( Utility.Random( 2 ) )
			{
			default:				
			case 0: return WeaponAbility.CrushingBlow;
			case 1: return WeaponAbility.BleedAttack;
			}
		}	
		

		//main arty stuff ---------------------------------------
		public void GiveArtifact()
		{
			ArrayList toGive = new ArrayList();
			List<DamageStore> rights = BaseCreature.GetLootingRights( this.DamageEntries, this.HitsMax );

			for ( int i = rights.Count - 1; i >= 0; --i )
			{
				DamageStore ds = rights[i];
				if ( ds.m_HasRight )	toGive.Add( ds.m_Mobile );
			}
			if ( rights.Count == 0 )return;			
			
			for(int i=0;i<rights.Count;i++)
			{
				Mobile m = rights[i].m_Mobile;			
				PlayerMobile pm = m as PlayerMobile;
				
				GrobuQuest qs = pm.Quest as GrobuQuest;
				if(qs == null || !(qs is GrobuQuest))continue;
				
				
				if(qs.UserGotFur)pm.SendMessage("You already have the fur, you do not need to get more!");				
				else if(0.25>Utility.RandomDouble()) 
				{
				Item artifact = new GrobusFur();		
				
				qs.UserGotFur=true;		

				pm.GiveItem( artifact );			
				}
			}
			
		}//end main arty stuff------------------------------------------		
		
		
		public override bool OnBeforeDeath()
		{
		GiveArtifact();
		
		return base.OnBeforeDeath();
		}		
		
	
		[Constructable]
		public Grobu() : base( AIType.AI_Super, FightMode.Closest, 10, 1, 0.15, 0.18 )
		{
			Name = "Grobu";
			Body = 167;
			Hue = 2412;
			BaseSoundID = 0xA3;

			SetStr( 192, 210 );
			SetDex( 132, 150 );
			SetInt( 50, 52 );

			SetHits( 1244, 1299 );
			SetStam( 132, 150 );
			SetMana( 180 );

			SetDamage( 33, 44 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 40, 45 );
			SetResistance( ResistanceType.Fire, 20, 32 );
			SetResistance( ResistanceType.Cold, 32, 35 );
			SetResistance( ResistanceType.Poison, 25, 29 );
			SetResistance( ResistanceType.Energy, 22, 34 );

			SetSkill( SkillName.MagicResist, 66.2, 83.7 );
			SetSkill( SkillName.Tactics, 97.3, 116.5 );
			SetSkill( SkillName.Wrestling, 107.4, 119.0 );

			Fame = 7500;
			Karma = 4000;

			VirtualArmor = 24;
		}
		
		public override bool IsMLBoss { get { return true;} }
		public override int TreasureMapLevel{ get{ return 6; } }
		public override double MLChestChance{ get{ return 0.05; } }

		public override int Meat{ get{ return 3; } }
		public override int Hides{ get{ return 20; } }
		public override FoodType FavoriteFood{ get{ return FoodType.Fish | FoodType.Meat | FoodType.FruitsAndVegies; } }
		public override PackInstinct PackInstinct{ get{ return PackInstinct.Bear; } }
		public override bool IsMLCreature { get { return true;} } 
		public override bool Uncalmable{ get{ return true; } }
		
		public override void GenerateLoot()
		{
			AddLoot( LootPack.UltraRich, 1 );
			AddLoot( LootPack.FilthyRich );
		}

		public Grobu( Serial serial ) : base( serial )
		{
		}
		
		public override void OnDeath( Container c )
		{

			base.OnDeath( c );
		}
		
		public override void OnDamage( int amount, Mobile from, bool willKill ) 
		{
			
			base.OnDamage(amount, from, willKill);	
		}

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