#W# Initial Commit: Avatars Conquest
This commit is contained in:
commit
5df497787a
7510 changed files with 416048 additions and 0 deletions
38
Scripts/Misc/WelcomeTimer.cs
Normal file
38
Scripts/Misc/WelcomeTimer.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
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 = new string[]
|
||||
{
|
||||
"Welcome to Britannia!"
|
||||
};
|
||||
|
||||
public WelcomeTimer( Mobile m ) : this( m, m_Messages.Length )
|
||||
{
|
||||
}
|
||||
|
||||
public WelcomeTimer( Mobile m, int count ) : base( TimeSpan.FromSeconds( 5.0 ), TimeSpan.FromSeconds( 10.0 ) )
|
||||
{
|
||||
m_Mobile = m;
|
||||
m_Count = count;
|
||||
}
|
||||
|
||||
protected override void OnTick()
|
||||
{
|
||||
if ( m_State < m_Count )
|
||||
m_Mobile.SendMessage( 0x35, m_Messages[m_State++] );
|
||||
|
||||
if ( m_State == m_Count )
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue