/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\events and scenarios\misc\thanksgiving\mutatedturkey.cs
Lines of code: 100
***********************************************************/


using System;
using System.Collections;
using Server.Items;
using Server.Targeting;

namespace Server.Mobiles
{
	[CorpseName( "a Mutated Turkey corpse" )]
	public class MutatedTurkey : BaseCreature
	{
	
	
		[Constructable]
		public MutatedTurkey() : this( 1.0 )
		{
		}
	
	
		[Constructable]
		public MutatedTurkey(double factor) : base( AIType.AI_Super, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "a Mutated Turkey";
			Body = 30;
			BaseSoundID = 471;
			Hue=0x48F;

			SetStr( (int)(1000*factor) );
			SetDex( (int)(5000*factor));
			SetInt( (int)(500*factor) );

			SetHits((int)(5000*factor));
			SetMana(2500);

			SetDamage( 2, 6 );

			SetDamageType( ResistanceType.Poison, 100 );

			SetResistance( ResistanceType.Physical, 15, 80 );
			SetResistance( ResistanceType.Fire, 50, 80 );
			SetResistance( ResistanceType.Cold, 50, 80 );
			SetResistance( ResistanceType.Poison, 80, 100 );
			SetResistance( ResistanceType.Energy, 50, 80 );

			factor/=0.5;
			
			SetSkill( SkillName.MagicResist, (int)(120*factor ));
			SetSkill( SkillName.Tactics, (int)(120*factor ));
			SetSkill( SkillName.Wrestling, (int)(150*factor ));
			SetSkill( SkillName.Necromancy, (int)(120*factor ));
			SetSkill( SkillName.SpiritSpeak, (int)(120*factor ));
			SetSkill( SkillName.Poisoning, (int)(120*factor ));			
			SetSkill( SkillName.Magery, (int)(120*factor ));
			SetSkill( SkillName.EvalInt, (int)(100*factor ));

			Fame = 7500;
			Karma = -7500;

			VirtualArmor = 28;
		}
		

		
		
		public int Stage=5;

		public override bool OnBeforeDeath()
		{				
		
			if(0.17>Utility.RandomDouble())
			{
			PotionKeg pk = new PotionKeg();
			pk.Type=PotionEffect.PoisonGreater;
			pk.Held=Utility.Random(30);
			PackItem(pk);		
			}
			else if(0.08>Utility.RandomDouble())
			{
			PotionKeg pk = new PotionKeg();
			pk.Type=PotionEffect.PoisonDeadly;
			pk.Held=Utility.Random(30);
			PackItem(pk);		
			}
		
		if(Stage<=0)return base.OnBeforeDeath();
		
			for(int i=1+Utility.Random(3);i>0;i--)
			{
			int x=(this.X-1)+Utility.Random(3);
			int y=(this.Y-1)+Utility.Random(3);
			
			MutatedTurkey mt = new MutatedTurkey(0.1*(double)Stage);
			mt.Stage=Stage-1;
			mt.MoveToWorld(new Point3D(x,y,Z+2),Map);		
			mt.Team=this.Team;
			Effects.SendLocationEffect( new Point3D(x,y,Z+2), Map, 0x3728, 13, 1, 0x461, 4 );			
			}		
			
		
		return base.OnBeforeDeath();
		}
		
		
				
		
		
		public override void GenerateLoot()
		{
			AddLoot( LootPack.Rich, 7 );
			AddLoot( LootPack.SuperBoss, 3 );			
		}

		public override int Meat{ get{ return 10; } }
		public override MeatType MeatType{ get{ return MeatType.Bird; } }
		public override int Feathers{ get{ return 100; } }

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

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

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