learn

package
v0.7.62 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 8 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 learn answers "who teaches this recipe?": the nearest trainer or vendor for the character's faction, with zone and coordinates, and the recipe's real skill gate. Trainers come from the dataset's trainers table, vendors from vendor_sources; a place the dataset lacks comes from the player's own QuestieDB. The rules are in docs/professions.md.

Index

Constants

View Source
const (
	Trainer = "trainer"
	Vendor  = "vendor"
	Drop    = "drop"
	Quest   = "quest"
)

Way kinds.

View Source
const MaxWays = 3

MaxWays is how many ways to learn a recipe an answer lists.

Variables

This section is empty.

Functions

func CountsText

func CountsText(m map[string]int) string

CountsText writes the counts one profession per line, sorted.

func FactionOK added in v0.7.45

func FactionOK(npc, char string) bool

FactionOK reports whether an NPC's faction ("A", "H", "Alliance", "Horde", neutral or empty) serves the character's faction.

func GateCounts

func GateCounts(ds store.DataStore) map[string]int

GateCounts counts, per profession, the trainer recipes whose only skill value is the client's minimum of 1: no number can be stated for them.

Types

type Gate

type Gate struct {
	Skill   int    `json:"skill,omitempty" jsonschema:"the skill needed; 0 when no number is known"`
	Unknown bool   `json:"unknown,omitempty" jsonschema:"a trainer recipe whose only value is the client minimum of 1: no number is stated"`
	Line    string `json:"line"`
}

Gate is the skill needed to learn the recipe.

type Result

type Result struct {
	Recipe     string `json:"recipe"`
	Profession string `json:"profession,omitempty"`
	Ways       []Way  `json:"ways"`
	Gate       Gate   `json:"gate"`
	Text       string `json:"text"`
}

Result is where to learn one recipe.

func Find

func Find(c character.Character, ds store.DataStore, qx *questie.Index, query string) (Result, error)

Find resolves a recipe or the item it makes by name and says where to learn it. A character's own profession wins when several recipes share the name.

func Recipe

Recipe says where to learn the recipe row r (a recipes row) for the character.

type Way

type Way struct {
	Kind    string  `json:"kind" jsonschema:"trainer, vendor, drop or quest"`
	Name    string  `json:"name,omitempty"`
	Title   string  `json:"title,omitempty" jsonschema:"a Questie trainer's rank title, such as Journeyman Blacksmith"`
	Zone    string  `json:"zone,omitempty"`
	X       float64 `json:"x,omitempty"`
	Y       float64 `json:"y,omitempty"`
	HasXY   bool    `json:"has_xy,omitempty"`
	Questie bool    `json:"from_questie,omitempty" jsonschema:"the place comes from the player's own Questie database"`
	Item    string  `json:"item,omitempty" jsonschema:"the recipe item, for a vendor, drop or quest"`
	Price   string  `json:"price,omitempty"`
	Seen    bool    `json:"seen_by_you,omitempty" jsonschema:"the player saw this trainer or vendor in game: it comes before the dataset"`
	Line    string  `json:"line"`
	// contains filtered or unexported fields
}

Way is one place to learn the recipe.

Jump to

Keyboard shortcuts

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