Overwrite

Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
Unstable Kitsune
2023-11-28 23:20:26 -05:00
parent 3cd54811de
commit b918192e4e
11608 changed files with 2644205 additions and 47 deletions

View File

@@ -0,0 +1,69 @@
using System;
using Server;
using System.Collections.Generic;
namespace Server.Items
{
public class UnderworldPuzzleBox : MetalChest
{
private static Dictionary<Mobile, DateTime> m_Table = new Dictionary<Mobile, DateTime>();
[Constructable]
public UnderworldPuzzleBox()
{
Movable = false;
ItemID = 3712;
}
public override void OnDoubleClick(Mobile from)
{
if (from.InRange(this.Location, 3))
{
if (from.AccessLevel == AccessLevel.Player && IsInCooldown(from))
from.SendLocalizedMessage(1113413); // You have recently participated in this challenge. You must wait 24 hours to try again.
else if (from.Backpack != null)
{
Item item = from.Backpack.FindItemByType(typeof(UnderworldPuzzleItem));
if (item != null)
from.SendMessage("You already have a puzzle board.");
else
{
from.AddToBackpack(new UnderworldPuzzleItem());
from.SendMessage("You recieve a puzzle piece.");
if (from.AccessLevel == AccessLevel.Player)
m_Table[from] = DateTime.UtcNow + TimeSpan.FromHours(24);
}
}
}
}
public static bool IsInCooldown(Mobile from)
{
if(m_Table.ContainsKey(from))
{
if(m_Table[from] < DateTime.UtcNow)
m_Table.Remove(from);
}
return m_Table.ContainsKey(from);
}
public UnderworldPuzzleBox(Serial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int v = reader.ReadInt();
}
}
}