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

Description: 

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


using System;
using Server;
using Server.Items;
using Server.Mobiles;

namespace Server.Mobiles
{
	[CorpseName( "a Rend corpse" )]
	public class Rend : BaseMount
	{
		public override WeaponAbility GetWeaponAbility()
		{
			switch ( Utility.Random( 2 ) )
			{
				default:
				case 0: return WeaponAbility.BleedAttack;
				case 1: return WeaponAbility.ParalyzingBlow;
			}
		}
	
		[Constructable]
		public Rend () : this( "Rend" )
		{
		}

		[Constructable]    //body,mounted id
		public Rend( string name ) : base( name, 276,16016, AIType.AI_Melee, FightMode.Closest, 10, 1, 0.1, 0.3 )
		{
			BaseSoundID = 362;
			Hue = 1175;

			SetStr( 1270, 1325 );
			SetDex( 360, 400 );
			SetInt( 600, 700 );

			SetHits( 5200, 6000 );
			SetStam( 360, 400 );
			SetMana( 640, 700);

			SetDamage( 22, 28 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 75, 85 );
			SetResistance( ResistanceType.Fire, 81, 94 );
			SetResistance( ResistanceType.Cold, 46, 55 );
			SetResistance( ResistanceType.Poison, 35, 44 );
			SetResistance( ResistanceType.Energy, 45, 52 );

			SetSkill( SkillName.MagicResist, 90.9, 105.6 );
			SetSkill( SkillName.Anatomy, 66.6, 72.0 );
			SetSkill( SkillName.Tactics, 133.4, 141.4 );
			SetSkill( SkillName.Wrestling, 136.3, 150.0 );

			Fame = 27000;
			Karma = -27000;

			VirtualArmor = 60;

			Tamable = false;		
		}

		public override void GenerateLoot()
		{
			AddLoot( LootPack.UltraRich, 2 );
			AddLoot( LootPack.FilthyRich, 5 );
			AddLoot( LootPack.Average, 5 );
			PackSWScroll(2);
		}
		
		public override bool IsMLBoss { get { return true;} }
		public override int TreasureMapLevel{ get{ return 6; } }
		public override double MLChestChance{ get{ return 0.05; } }
		
		public override bool HasBreath{ get{ return true; } } // fire breath enabled
		public override double BreathDamageScalar{ get{ return 0.06; } }
		public override bool ReacquireOnMovement{ get{ return true; } }
		public override int Meat{ get{ return 6; } }
		public override int Hides{ get{ return 15; } }
		public override int Scales{ get{ return 3; } }		
		public override HideType HideType{ get{ return HideType.Barbed; } }
		public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }				
		public override bool StatLossAfterTame{ get{ return true; } }		
		public override bool IsMLCreature { get { return true;} } 
		public override bool AutoDispel{ get{ return true; } }
		public override double AutoDispelChance{ get{ return 0.2; } }
		public override bool Unprovokable{ get{ return true; } }
		public override bool Uncalmable{ get{ return true; } }
		public override Poison PoisonImmune{ get{ return Poison.Greater; } }

		public Rend( Serial serial ) : base( serial )
		{
		}
		
		public override void OnDamage( int amount, Mobile attacker, bool willKill ) 
		{
			if(attacker!=null && attacker is BaseCreature && 0.2 >= Utility.RandomDouble())
			{
				if(((BaseCreature)attacker).ControlMaster!=null)
				{
					Combatant=((BaseCreature)attacker).ControlMaster;
				}
				else if(((BaseCreature)attacker).SummonMaster!=null)
				{
					Combatant=((BaseCreature)attacker).SummonMaster;
				}
			}	
				
			base.OnDamage(amount, attacker, willKill );			
		}


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