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
- func AuctionTradeable(bonding, quality int) bool
- func SlotOf(c character.Character, ds store.DataStore, group string, itemID int64) string
- func Tradeable(bonding, _ int) bool
- type Gettable
- type Options
- type Path
- type Reagent
- type RecipeSource
- type Result
- type Shopping
- type SkillCheck
- type SkillUpStep
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 ( CanMake = "can_make" Short = "short" Far = "far" NotProfession = "not_profession" // NeedsRecipe: the skill reaches the recipe, but it is taught by an item the character does not have. NeedsRecipe = "needs_recipe" )
Skill statuses.
const MaxSuffixes = 2
MaxSuffixes is how many suffixes a shopping list names: the top two for the player's priority.
const ShortMax = 25
ShortMax is the most skill points a character may be short of a recipe for a skill-up path to be worth offering; a larger gap is "far short" and leads with the other ways.
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
// Questie is the player's QuestieDB, which places a trainer or vendor the dataset has no place for; nil without it.
Questie *questie.Index
}
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"`
// Skill is a craft path's check of the character's profession skill; Recipe says where the recipe
// is learned. Informational paths (a craft the character cannot make) never count as a way.
Skill *SkillCheck `json:"skill,omitempty"`
Recipe *RecipeSource `json:"recipe_source,omitempty"`
Informational bool `json:"informational,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 RecipeSource ¶ added in v0.7.29
type RecipeSource struct {
Kind string `json:"kind" jsonschema:"known, trainer, vendor, drop, quest or unknown"`
Item string `json:"item,omitempty" jsonschema:"the recipe item that teaches it"`
Line string `json:"line"`
Offer *vendors.Offer `json:"offer,omitempty"`
Source string `json:"source,omitempty"`
}
RecipeSource says where the recipe is learned.
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
// Use is what the character should know before getting a consumable: the level it needs to use it and the classes that
// can, when the character is below that level or not of those classes. "" for anything else.
Use string `json:"use,omitempty"`
// Unfit is true for an item the player's build cannot use well (a shield for a dual-wielder): it is
// left out of the answer entirely, never named as a thing to skip.
Unfit bool `json:"unfit,omitempty"`
// 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:"-"`
// Armor is the armor material of an armor slot ("cloth"), empty for other slots.
Armor 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.
type SkillCheck ¶ added in v0.7.29
type SkillCheck struct {
Profession string `json:"profession"`
Have int `json:"have"` // the character's rank; 0 when they lack the profession
Need int `json:"need"` // the recipe's learn skill
Gap int `json:"gap"` // points short, 0 when none
Status string `json:"status" jsonschema:"can_make, needs_recipe, short, far or not_profession"`
Rank string `` /* 128-byte string literal not displayed */
RankLevel int `json:"rank_level,omitempty" jsonschema:"the character level that rank is trained from"`
RecipeKnown *bool `` /* 136-byte string literal not displayed */
SkillUp []SkillUpStep `json:"skill_up,omitempty" jsonschema:"when short: up to three recipes that give skill-ups now, estimates"`
}
SkillCheck is a craft path's check of the character's profession skill against the recipe.
type SkillUpStep ¶ added in v0.7.29
type SkillUpStep struct {
Recipe string `json:"recipe"`
Creates string `json:"creates,omitempty"`
Difficulty string `json:"difficulty" jsonschema:"orange, yellow or green at the character's skill, as the game colours it"`
Crafts int `json:"crafts_estimate"`
Reaches int `json:"reaches_skill"`
Known bool `json:"known,omitempty"`
LearnFirst bool `` /* 127-byte string literal not displayed */
Missing []Reagent `json:"missing,omitempty" jsonschema:"the materials still needed for those crafts"`
Line string `json:"line"`
}
SkillUpStep is one recipe of a skill-up path. Crafts is an estimate: about one point per craft while the recipe is orange, three in four while it is yellow, one in four while it is green.