/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\Misc\WelcomeTimer.cs
Lines of code: 43
***********************************************************/


using System;
using Server.Network;

namespace Server.Misc
{
	/// <summary>
	/// This timer spouts some welcome messages to a user at a set interval. It is used on character creation and login.
	/// </summary>
	public class WelcomeTimer : Timer
	{
		private Mobile m_Mobile;
		private int m_State, m_Count;

		private static string[] m_Messages = ( Core.Testcenter ?
			new string[]
				{
					"Welcome to AoV Test Centre. You are free to do anything you want without any loss to your real items/stats/etc. ",
					 "Type [help to view a list of commands to play with.",
					 "Note that this server is occasionally refreshed with live, any progress here may be lost.",
					 "Please report any issues you may find."
				} :
			new string[]
				{	
					"Welcome to Age of Valor!",
					"Be sure to check our website and register on our forums at www.uovalor.com.",
					"To help increase the popularity of the server, please get your friends to join!"
				} );

		public WelcomeTimer( Mobile m ) : this( m, m_Messages.Length )
		{
		}

		public WelcomeTimer( Mobile m, int count ) : base( TimeSpan.FromSeconds( 3.0 ), TimeSpan.FromSeconds( 5.0 ) )
		{
			m_Mobile = m;
			m_Count = count;
		}

		protected override void OnTick()
		{
			if ( m_State < m_Count )
				m_Mobile.SendMessage( 0x35, m_Messages[m_State] );

			m_State++;
			
			if ( m_State > m_Count )
			{
			LoginStats.Show(m_Mobile);
				Stop();
			}
		}
	}
}