paths

package
v0.7.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
const (
	Quest    = "quest"
	Craft    = "craft"
	Auction  = "auction"
	Dungeon  = "dungeon"
	Creature = "creature"
)

Path kinds, most dependable first. The UI picks an icon from the kind.

View Source
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.

View Source
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

func AuctionTradeable(bonding, quality int) bool

AuctionTradeable reports whether an item can be bought on the Auction House as gear: tradeable (not bound on pickup) and uncommon quality or better.

func SlotOf

func SlotOf(c character.Character, ds store.DataStore, group string, itemID int64) string

SlotOf finds the capture slot an item is an upgrade for; "" when it is not one.

func Tradeable

func Tradeable(bonding, quality int) bool

Tradeable reports whether an item can be sold between players: not bound on pickup (1) or a quest item (4, 5), and common quality or better.

Types

type Gettable

type Gettable struct {
	Slot      string
	Candidate gear.Candidate
	Result    Result
}

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
	// 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
	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 For

func For(c character.Character, ds store.DataStore, itemID int64, opt Options) Result

For finds the dependable ways the character can get the item, best first.

func (Result) Best

func (r Result) Best() (Path, bool)

Best is the first path.

func (Result) Dependable

func (r Result) Dependable() bool

Dependable reports whether the item has at least one path.

func (Result) Text

func (r Result) Text() string

Text renders the result as plain sentences.

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.

func (Shopping) Result added in v0.7.11

func (s Shopping) Result() Result

Result renders a shopping list as an upgrade_paths result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL