Documentation
¶
Overview ¶
Package paths says how a character can dependably get an item: a quest reward, a craft, the Auction House, a dungeon boss or a named creature. An item with no such way is a random drop and is never offered as an upgrade. The rules are in docs/upgrade-paths.md.
Everything it returns is plain words: names only, never an item, quest, recipe or NPC id.
Index ¶
Constants ¶
const ( Quest = "quest" Craft = "craft" Auction = "auction" Dungeon = "dungeon" Creature = "creature" )
Path kinds, most dependable first. The UI picks an icon from the kind.
const ( Often = 15.0 Sometimes = 5.0 // NamedMin is the chance a named creature must carry the item at. NamedMin = 10.0 // NamedMax is how many creatures may carry the item for it to count as theirs. NamedMax = 3 // WorldDropMany is the number of creature sources above which an item is a random world drop. WorldDropMany = 5 // DungeonWindow is how far a dungeon's level range may lie from the character's level. DungeonWindow = 3 )
Chance words: a drop chance above Often is "often", from Sometimes up to it "sometimes"; under Sometimes a drop is not dependable.
const TryPerSlot = 40
TryPerSlot is how many of a slot's best candidates are checked for a way to get them.
Variables ¶
This section is empty.
Functions ¶
func Money ¶
Money renders copper as "1g 20s": gold and silver, with copper only when under a silver.
Types ¶
type Gettable ¶
Gettable is an upgrade candidate with its ways to get it.
func InSlot ¶
func InSlot(c character.Character, ds store.DataStore, group, slot string, opt Options, limit int) ([]Gettable, error)
InSlot returns up to limit upgrades for one slot (empty for every slot, one per slot) that have a dependable way to be got, best first. An upgrade with no way is skipped.
type Options ¶
type Options struct {
// Prices holds real auction prices by item id; the capture holds none today.
Prices map[int64]Price
// PlanQuests are the quest ids the plan has as steps.
PlanQuests map[int]bool
}
Options carries what the capture and the plan add to the dataset.
type Path ¶
type Path struct {
Kind string `json:"kind"`
Line string `json:"line"` // one line, plain words
Reagents []Reagent `json:"reagents,omitempty"`
Quest string `json:"quest,omitempty"`
QuestID int `json:"-"`
Choice bool `json:"choice_reward,omitempty"`
}
Path is one dependable way to get an item.
type Price ¶
Price is a real auction price: copper and the day it was seen (YYYY-MM-DD). A vendor sell price is never one.
type Reagent ¶
type Reagent struct {
Name string `json:"name"`
Need int `json:"need"`
Have int `json:"have"`
InBags int `json:"in_bags"`
InBank int `json:"in_bank"`
Missing int `json:"missing"`
How string `json:"how,omitempty"` // how to get the missing part, in words
ItemID int64 `json:"-"`
}
Reagent is one reagent of a craft, with what the character holds and how to get the rest.
type Result ¶
type Result struct {
Item string `json:"item"`
Slot string `json:"slot,omitempty"`
Paths []Path `json:"paths"`
Reason string `json:"reason,omitempty"` // when there is no path: why, in words
ItemID int64 `json:"-"`
}
Result is the ways to get one item, best first.
func (Result) Dependable ¶
Dependable reports whether the item has at least one path.