/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\quests\kill quests\Tribal Courage\TribalCourageKillQuest.cs
Lines of code: 70
***********************************************************/


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

namespace Server.Engines.Quests.TribalCouragesKillQuest
{

	public class TribalCouragesKillQuest : QuestSystem
	{
		private static Type[] m_TypeReferenceTable = new Type[]
			{
				typeof( DontOfferConversation ),
				typeof( AcceptConversation ),
				typeof( EndConversation )				
			};

		public override Type[] TypeReferenceTable{ get{ return m_TypeReferenceTable; } }

		public override object Name
		{
			get
			{
				return "Tribal Courage";
			}
		}

		public override object OfferMessage
		{
			get
			{
				return "Those grubby orcs stole some of our tools while we were out hunting. I wish I could seek vengeance on them but there were too many of them and they wounded me with a barrage of arrows and flasks of fire. Are you courageous enough to help me out? I'll make it worth your while.";
			}
		}
		


		public override TimeSpan RestartDelay{ get{ return TimeSpan.Zero; } }
		public override bool IsTutorial{ get{ return false; } }

		public override int Picture{ get{ return 0x15CA; } }

		public TribalCouragesKillQuest( PlayerMobile from,Mobile questgiver) : base( from )
		{
		}
		
		// Serialization
		public TribalCouragesKillQuest()
		{
		}

		public override void ChildDeserialize( GenericReader reader )
		{
			int version = reader.ReadEncodedInt();
		}

		public override void ChildSerialize( GenericWriter writer )
		{
			writer.WriteEncodedInt( (int) 0 ); // version
		}

		public override void Accept()
		{
			base.Accept();

			AddConversation( new AcceptConversation() );
		}

		public static void GiveRewardTo( PlayerMobile from)
		{
			TribalCouragesKillQuest qs = from.Quest as TribalCouragesKillQuest;
			
			Item reward = new LargeBagOfTreasure();
			Item bonusreward = new MaskOfCourage();

			if (0.1 > Utility.RandomDouble())
			{
				from.SendMessage("In addition to that bag of treasure, take this tribal mask as a symbol of your courage.");
				from.PlaceInBackpack( reward );
				from.PlaceInBackpack( bonusreward );
			}
			else {
				from.SendMessage("Those orcs won't be stealing from us anymore!");
				from.PlaceInBackpack( reward );
			}
				
			qs.Complete();			
		}
	}	
}