Documentation
¶
Overview ¶
Package vendors finds who sells an item, from the dataset's vendor_sources table (offers players saw in game and reported to Everloot, CC BY-SA 4.0). The rules are in docs/upgrade-paths.md.
Index ¶
Constants ¶
const ( KindVendor = "vendor" KindTrainer = "trainer" KindFlight = "flight" )
Kinds a Search can look for.
const ( MaxFound = 5 MaxSells = 6 )
MaxFound is how many NPCs a search lists; MaxSells is how many goods each one names.
const ( Source = "everloot" Credit = "Everloot (CC BY-SA)" )
Source tags the facts as Everloot's; Credit is the attribution line for an answer's sources.
const CheapPerBand = 10000
CheapPerBand is the price, in copper, a vendor path may cost per ten levels of the character's level band (level/10 + 1 bands) to count as cheap: 1 gold at levels 1-9, 2 gold at 10-19, and so on.
Variables ¶
This section is empty.
Functions ¶
func BasePrice ¶ added in v0.7.97
BasePrice is the price a player with no standing pays for an item whose vendor row lists the price. A reporter's price can be lower than the item's buy price because of a reputation discount the reporter had (a tenth off at Honored), so the buy price is used when it is higher. An unknown listed price (0 or less) stays unknown.
func ObservedOf ¶ added in v0.7.104
func ObservedOf(chars ...character.Character) []character.SeenVendor
ObservedOf is the vendors every one of the characters opened.
Types ¶
type Found ¶ added in v0.7.98
type Found struct {
NPCID int64 `json:"npc_id"`
Name string `json:"name"`
Sub string `json:"subname,omitempty" jsonschema:"the NPC's title, such as Shady Goods"`
Zone string `json:"zone,omitempty"`
Subzone string `json:"subzone,omitempty"`
X float64 `json:"x,omitempty"`
Y float64 `json:"y,omitempty"`
HasXY bool `json:"has_coordinates"`
Faction string `json:"faction,omitempty" jsonschema:"Alliance, Horde, or empty for a vendor both factions can use"`
// FactionKnown is true when a source holds the NPC's side: QuestieDB (an empty side there is a vendor both sides use) or the NPC row.
FactionKnown bool `json:"faction_known" jsonschema:"false when no data says which side can use the NPC; Faction is then empty"`
Sells []string `json:"sells,omitempty"`
Questie bool `json:"from_questie" jsonschema:"the place or the subname was read from the player's QuestieDB"`
Observed bool `json:"observed,omitempty" jsonschema:"true when one of the player's characters opened this vendor's shop"`
// contains filtered or unexported fields
}
Found is one NPC the search matched.
type Offer ¶
type Offer struct {
NPCID int64 `json:"-"`
Vendor string `json:"vendor"`
Zone string `json:"zone,omitempty"`
PriceCopper int64 `json:"price_copper"`
Price string `json:"price,omitempty" jsonschema:"the price in gold, silver and copper; empty when the price is unknown"`
Limited bool `json:"limited,omitempty" jsonschema:"the vendor has limited stock"`
Source string `json:"source" jsonschema:"everloot, or seen by you when the player saw this vendor in game"`
}
Offer is one vendor selling one item.
func Best ¶
Best is the cheapest offer for the item (a known price before an unknown one, then the lowest NPC id), or false when the table is missing or has no vendor for it. A vendor the dataset does not name is skipped: advice never points at "vendor 1234".
func BestFor ¶ added in v0.7.47
BestFor is Best for a character: a vendor the player opened and saw sell the item (open to their faction) comes first, at the price it showed, ahead of the dataset's offers.
func (Offer) Cheap ¶
Cheap reports whether the price is modest for a character of the level: at or under CheapPerBand copper for each band of ten levels. An unknown price is never cheap.
func (Offer) Line ¶
Line is "Buy from <vendor> in <zone> for <price>", with "limited stock" when it is limited.
type Query ¶ added in v0.7.98
type Query struct {
Text string
Zone string
Kind string // vendor (default), trainer or flight
Faction string // the player's faction; "" lists both
At questie.Where
// Observed are the vendors the player's characters opened (Seen.Vendors), searched beside the dataset and
// QuestieDB and merged by npc id; use ObservedOf to collect them.
Observed []character.SeenVendor
}
Query is one who-sells question. Text is a keyword, an item name or a subname word ("poison", "Shady Goods", "reagents"); empty lists the NPCs of the kind in Zone.
type Result ¶ added in v0.7.98
type Result struct {
Found []Found `json:"found"`
Text string `json:"text"`
Gap string `json:"gap,omitempty" jsonschema:"set when nothing matched: the data that holds no such NPC"`
}
Result is a search's answer: the NPCs (nearest first), the line to say, and Gap when nothing matched.