/**********************************************************
RunUO AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by Red Squirrel on Sep-24-2011 10:26:41pm
Filepath: scripts\Items\Artifacts\leviathan\SeafaringCompass.cs
Lines of code: 63

Description: 

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


using System;
using Server;
using Server.Mobiles;

namespace Server.Items
{
	public class SeafaringCompass : BaseTalisman
	{
	
		private Type[] m_Protections = new Type[]
		{
			typeof(SeaSerpent),
			typeof(DeepSeaSerpent),
			typeof(WaterElemental),
			typeof(Kraken),
			typeof(Leviathan)
		};
		
		private object[] m_ProtectionsCliloc = new object[]
		{
			"Sea Serpent",
			"Deep Sea Serpent",
			"Water Elemental",
			"Kraken",
			"Leviathan"
		};	
		
		

		
		
		
		[Constructable]
		public SeafaringCompass() : base( 4246 )
		{
			Name = "Seafaring Compass";
			Hue = 2406;		
						
			AddTaliProperties();
			
			Attributes.BonusInt=10;
			
			SkillBonuses.SetValues( 0, SkillName.DetectHidden, 10.0 );
			SkillBonuses.SetValues( 1, SkillName.Tracking, 10.0 );
			
		}
		
		
		private void AddTaliProperties()
		{
			int randommob;
			
			randommob=Utility.Random(m_Protections.Length-Utility.Random(m_Protections.Length/2));			
			Protection = new TalismanAttribute(m_Protections[randommob],10+Utility.Random(51),m_ProtectionsCliloc[randommob]);
			
			randommob=Utility.Random(m_Protections.Length-Utility.Random(m_Protections.Length/2));			
			Killer = new TalismanAttribute(m_Protections[randommob],Utility.Random(100),m_ProtectionsCliloc[randommob]);	
		
					
		}		
		
		public SeafaringCompass( Serial serial ) :  base( serial )
		{
		}
		
		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 1 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			
			if(version==0)
			{
				SkillBonuses.SetValues( 1, SkillName.Hiding, 0.0 );
				SkillBonuses.SetValues( 2, SkillName.Tracking, 10.0 );
				SkillBonuses.SetValues( 3, SkillName.DetectHidden, 5.0 );
				
				AddTaliProperties();			
			}
		}
	}
}