mirror of
https://github.com/ServUO/ServUO
synced 2026-08-11 20:23:04 -04:00
- fixes issue where you could still use teleporters and moongates while completing trade orders - Exploding Tar Potions now work correctly. - Added logging to Auctions. - Can't sell items in locked containers. - Explode potions no longer follow mobiles. Co-authored-by: TrueUO <knight.daniel.r@gmail.com>
62 lines
1.7 KiB
C#
62 lines
1.7 KiB
C#
using Server.Accounting;
|
|
using Server.Mobiles;
|
|
using System;
|
|
|
|
namespace Server.Engines.Auction
|
|
{
|
|
[PropertyObject]
|
|
public class BidEntry : IComparable<BidEntry>
|
|
{
|
|
[CommandProperty(AccessLevel.GameMaster)]
|
|
public PlayerMobile Mobile { get; set; }
|
|
|
|
[CommandProperty(AccessLevel.GameMaster)]
|
|
public long CurrentBid { get; set; }
|
|
|
|
//Converts to gold/plat
|
|
[CommandProperty(AccessLevel.GameMaster)]
|
|
public int TotalGoldBid => (int)(CurrentBid >= Account.CurrencyThreshold ? CurrentBid - (TotalPlatBid * Account.CurrencyThreshold) : CurrentBid);
|
|
|
|
[CommandProperty(AccessLevel.GameMaster)]
|
|
public int TotalPlatBid => (int)(CurrentBid >= Account.CurrencyThreshold ? CurrentBid / Account.CurrencyThreshold : 0);
|
|
|
|
public BidEntry(PlayerMobile m, long bid = 0)
|
|
{
|
|
Mobile = m;
|
|
CurrentBid = bid;
|
|
}
|
|
|
|
public BidEntry(PlayerMobile m, GenericReader reader)
|
|
{
|
|
Mobile = m;
|
|
|
|
int version = reader.ReadInt();
|
|
CurrentBid = reader.ReadLong();
|
|
}
|
|
|
|
public void Refund(Auction auction, long amount)
|
|
{
|
|
Account a = Mobile.Account as Account;
|
|
|
|
if (a != null)
|
|
{
|
|
a.DepositGold(amount);
|
|
VaultLogging.LogRefund(auction, Mobile, amount);
|
|
}
|
|
}
|
|
|
|
public void Serialize(GenericWriter writer)
|
|
{
|
|
writer.Write(0);
|
|
writer.Write(CurrentBid);
|
|
}
|
|
|
|
public int CompareTo(BidEntry entry)
|
|
{
|
|
if (CurrentBid > entry.CurrentBid)
|
|
return 1;
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|