Files
abysmal-isle/Scripts/Scripts-master/Games/DealorNoDeal-2010/DealorNoDeal/Timers/PlayerReplayTimer.cs
Unstable Kitsune b918192e4e Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
2023-11-28 23:20:26 -05:00

65 lines
1.0 KiB
C#

using System;
using Server;
using Server.Items;
namespace Server.Mobiles
{
public class PlayerReplayTimer : Timer
{
private Mobile pmobile;
public PlayerReplayTimer( Mobile m ) : base( TimeSpan.FromMinutes( 1 ) )
{
pmobile = m;
}
protected override void OnTick()
{
PlayerMobile pm = pmobile as PlayerMobile;
if ( pm == null || pm.Backpack == null )
{
this.Stop();
return;
}
Item check = pm.Backpack.FindItemByType(typeof(DoNDReplayDeed) );
if ( check == null )
{
this.Stop();
return;
}
DoNDReplayDeed gd = check as DoNDReplayDeed;
if ( gd == null )
{
this.Stop();
return;
}
gd.RPM1 +=1;
if ( gd.RPM1 == 60 )
{
gd.RP1 +=1;
gd.RPM1 = 0;
this.Start();
return;
}
if ( gd.RP1 == gd.RReplay )
{
pm.SendMessage( pm.Name + ", You can now play Deal or No Deal!");
gd.Delete();
return;
}
if ( gd.RP1 < gd.RReplay )
{
this.Start();
return;
}
}
}
}