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" Vendor = "vendor" 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 AuctionTradeable ¶ added in v0.7.11
AuctionTradeable reports whether an item can be bought on the Auction House as gear: tradeable (not bound on pickup) and uncommon quality or better.
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 {
// 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"`
Boss string `json:"boss,omitempty"` // a dungeon path: the boss that drops it
Dungeon string `json:"dungeon,omitempty"` // a dungeon path: the dungeon
Creature string `json:"creature,omitempty"` // a creature path: the first creature that carries it
// Offer is a vendor path's seller; Source tags facts taken from Everloot, and Credit is the
// attribution that goes with them.
Offer *vendors.Offer `json:"offer,omitempty"`
Source string `json:"source,omitempty"`
Credit string `json:"credit,omitempty"`
// contains filtered or unexported fields
}
Path is one dependable way to get an item.
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
Offer *vendors.Offer `json:"offer,omitempty"` // a vendor that sells it, when the dataset has one
Source string `json:"source,omitempty"` // "everloot" when How names that vendor
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
// Shopping is the Auction House search for a slot, when the result stands for a slot's shopping
// list rather than one item.
Shopping *Shopping `json:"shopping,omitempty"`
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.
type Shopping ¶ added in v0.7.11
type Shopping struct {
Slot string `json:"slot"`
Type string `json:"type" jsonschema:"what to look for, such as 'mail chest'"`
MinLevel int `json:"min_level"`
MaxLevel int `json:"max_level"`
Quality string `json:"quality"`
Suffixes []string `json:"suffixes,omitempty" jsonschema:"stat suffixes that fit, in plain words"`
Examples []string `json:"examples,omitempty" jsonschema:"one to three base items that drop in this range"`
Line string `json:"line" jsonschema:"one line for the digest"`
// Desc is the list's kind of item, level range and suffixes alone: no slot, no gain.
Desc string `json:"-"`
Steps []string `json:"search_steps" jsonschema:"the in-game search, step by step"`
// Best is the best upgrade among the items that fit the list.
Best gear.Candidate `json:"-"`
}
Shopping is a slot's Auction House search: not one item but a kind of item (a base item and a stat suffix), at a level range, assumed cheap. It never holds a price.
func Shop ¶ added in v0.7.11
func Shop(c character.Character, ds store.DataStore, slot string, cands []gear.Candidate, bestKind string) (Shopping, bool)
Shop builds the slot's shopping list from its upgrade candidates, best first. bestKind is the kind of the best way already found for the slot ("" when none): a quest in reach or a craft is better than shopping, so then there is no list. ok is false when no candidate is an Auction House item.
func ShoppingList ¶ added in v0.7.11
func ShoppingList(c character.Character, ds store.DataStore, group, slot string, opt Options) (Shopping, bool)
ShoppingList builds the shopping list for one slot, when the slot's best way to get an upgrade is the Auction House or there is no better quest or craft.