Files
abysmal-isle/Scripts/Services/CommunityCollections/ConfirmRewardGump.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

63 lines
1.7 KiB
C#

using System;
using Server.Mobiles;
namespace Server.Gumps
{
public class ConfirmRewardGump : BaseConfirmGump
{
private readonly IComunityCollection m_Collection;
private readonly Point3D m_Location;
private readonly CollectionItem m_Item;
private readonly int m_Hue;
public ConfirmRewardGump(IComunityCollection collection, Point3D location, CollectionItem item)
: this(collection, location, item, 0)
{
}
public ConfirmRewardGump(IComunityCollection collection, Point3D location, CollectionItem item, int hue)
: base()
{
m_Collection = collection;
m_Location = location;
m_Item = item;
m_Hue = hue;
if (m_Item != null)
AddItem(150, 100, m_Item.ItemID, m_Item.Hue);
}
public override int TitleNumber
{
get
{
return 1074974;
}
}// Confirm Selection
public override int LabelNumber
{
get
{
return 1074975;
}
}// Are you sure you wish to select this?
public override void Confirm(Mobile from)
{
if (m_Collection == null || !from.InRange(m_Location, 2))
return;
if (from is PlayerMobile)
{
PlayerMobile player = (PlayerMobile)from;
if(player.GetCollectionPoints(m_Collection.CollectionID) < m_Item.Points)
{
player.SendLocalizedMessage(1073122); // You don't have enough points for that!
}
else if (m_Item.CanSelect(player))
{
m_Collection.Reward(player, m_Item, m_Hue);
}
}
}
}
}