Struct PluginVendorProfile
- Namespace
- AcDream.Plugin.Abstractions
- Assembly
- AcDream.Plugin.Abstractions.dll
The terms an open vendor shops on: what it pays for goods, what it deals in, and what it will not touch. A plugin planning a vendor visit reads this before it decides what to carry in and what to expect to be paid.
public readonly record struct PluginVendorProfile : IEquatable<PluginVendorProfile>
- Implements
- Inherited Members
Constructors
PluginVendorProfile(float, uint, uint, uint, bool, uint, uint, string?)
The terms an open vendor shops on: what it pays for goods, what it deals in, and what it will not touch. A plugin planning a vendor visit reads this before it decides what to carry in and what to expect to be paid.
public PluginVendorProfile(float BuyRate, uint DealsInItemTypes, uint MinimumValue, uint MaximumValue, bool DealsInMagicalItems, uint AlternateCurrencyWeenieClassId, uint AlternateCurrencyAmount, string? AlternateCurrencyName)
Parameters
BuyRatefloatThe share of an item's value this vendor pays when it buys from the character: 0.75 means it pays three quarters of the item's value. The client rounds the product DOWN to whole coin, and never down to nothing: a payout that works out below one coin is paid as one. A trade note is always paid at its face value whatever this rate says.
DealsInItemTypesuintThe categories of item this vendor buys, as a bit mask over the same category bits ItemType carries. An item whose category shares no bit with this mask is one the vendor refuses.
MinimumValueuintThe least an item may be worth, per unit, for this vendor to buy it; NoValueLimit when it sets no floor. An item worth nothing at all is refused whatever this says.
MaximumValueuintThe most an item may be worth, per unit, for this vendor to buy it; NoValueLimit when it sets no ceiling. A trade note is the exception, as it is on
BuyRate: the vendor takes one however much it is worth, so a plugin that pre-filters its pack by this ceiling has to let notes through or it drops the most valuable things the vendor would have bought.DealsInMagicalItemsboolTrue when this vendor deals in items that carry spells.
AlternateCurrencyWeenieClassIduintThe class id of the item this vendor is paid in instead of coin, or zero when it trades in ordinary coin.
AlternateCurrencyAmountuintHow many of that currency the character was holding when the shop listing arrived, and zero when the vendor trades in coin. It is the figure that listing carried, not a live count: it does not follow what the character spends or picks up afterwards.
AlternateCurrencyNamestringThe plural name of that currency, for a line a plugin writes; null when the vendor trades in ordinary coin.
Fields
NoValueLimit
The value MinimumValue or MaximumValue takes when the vendor sets no limit in that direction.
public const uint NoValueLimit = 4294967295
Field Value
Properties
AlternateCurrencyAmount
How many of that currency the character was holding when the shop listing arrived, and zero when the vendor trades in coin. It is the figure that listing carried, not a live count: it does not follow what the character spends or picks up afterwards.
public uint AlternateCurrencyAmount { get; init; }
Property Value
AlternateCurrencyName
The plural name of that currency, for a line a plugin writes; null when the vendor trades in ordinary coin.
public string? AlternateCurrencyName { get; init; }
Property Value
AlternateCurrencyWeenieClassId
The class id of the item this vendor is paid in instead of coin, or zero when it trades in ordinary coin.
public uint AlternateCurrencyWeenieClassId { get; init; }
Property Value
BuyRate
The share of an item's value this vendor pays when it buys from the character: 0.75 means it pays three quarters of the item's value. The client rounds the product DOWN to whole coin, and never down to nothing: a payout that works out below one coin is paid as one. A trade note is always paid at its face value whatever this rate says.
public float BuyRate { get; init; }
Property Value
DealsInItemTypes
The categories of item this vendor buys, as a bit mask over the same category bits ItemType carries. An item whose category shares no bit with this mask is one the vendor refuses.
public uint DealsInItemTypes { get; init; }
Property Value
DealsInMagicalItems
True when this vendor deals in items that carry spells.
public bool DealsInMagicalItems { get; init; }
Property Value
MaximumValue
The most an item may be worth, per unit, for this vendor to buy it;
NoValueLimit when it sets no ceiling. A trade note is the
exception, as it is on BuyRate: the vendor takes one
however much it is worth, so a plugin that pre-filters its pack by this
ceiling has to let notes through or it drops the most valuable things
the vendor would have bought.
public uint MaximumValue { get; init; }
Property Value
MinimumValue
The least an item may be worth, per unit, for this vendor to buy it; NoValueLimit when it sets no floor. An item worth nothing at all is refused whatever this says.
public uint MinimumValue { get; init; }
Property Value
Unset
The terms reported when no vendor is open, or on a host that does not provide the surface. Both value limits read NoValueLimit rather than zero, because zero is a real limit under this type's own convention: a profile of all zeroes reads as a vendor that pays nothing and refuses everything worth more than nothing, which is the wrong conclusion for a plugin that forgot to check IsOpen first.
public static PluginVendorProfile Unset { get; }
Property Value
UsesAlternateCurrency
True when this vendor is paid in something other than coin, so a plugin counts AlternateCurrencyWeenieClassId rather than the character's money.
public bool UsesAlternateCurrency { get; }