Files
abysmal-isle/Scripts/Scripts-master/Games/DealorNoDeal-2010/DealorNoDeal/Timers/MobileDeleteTimer.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

76 lines
1.4 KiB
C#

using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Items;
using Server.Gumps;
namespace Server.Mobiles
{
public class MobileDeleteTimer : Timer
{
private Mobile pmobile;
private Mobile bmobile;
private Mobile m_DG;
public Mobile DG
{
get{ return m_DG; }
set{ m_DG = value; }
}
public MobileDeleteTimer( Mobile pmm, Mobile bcc ) : base( TimeSpan.FromSeconds( 1 ) )
{
pmobile = pmm;
bmobile = bcc;
}
protected override void OnTick()
{
Howey bc = bmobile as Howey;
if ( bc == null )
{
this.Stop();
return;
}
PlayerMobile pm = pmobile as PlayerMobile;
if ( pm == null || pm.Backpack == null )
{
GameSystem.EndDDGame( pm, bc );
this.Stop();
return;
}
Item check = pm.Backpack.FindItemByType(typeof(DoNDGameDeed) );
DoNDGameDeed gd = check as DoNDGameDeed;
if ( gd == null )
{
this.Stop();
return;
}
if ( gd.Commercial == true )
{
if (pm.HasGump( typeof( DoNDCommercialGump )))
pm.CloseGump( typeof( DoNDCommercialGump ) );
pm.SendGump( new DoNDCommercialGump( pm ) );
}
if ( gd.GameOver == false )
{
this.Start();
return;
}
GameSystem.EndDDGame( pm, bc );
if ( bc.DeBugger == true )
Console.WriteLine( "DeBug : System, Mobile Delete Timer OK" );
this.Stop();
}
}
}