learn

package
v0.7.114 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 13 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 (
	DarkPortalEntrance = darkPortalIn
	DarkPortalExit     = darkPortalOut
)

DarkPortalEntrance and DarkPortalExit are the Dark Portal as a crossing names it, from the Blasted Lands side and from Hellfire Peninsula.

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 ContinentOf added in v0.7.86

func ContinentOf(zone string) string

ContinentOf is the zone's continent, or "" when the zone is not known.

func CountsText

func CountsText(m map[string]int) string

CountsText writes the counts one profession per line, sorted.

func Crossing added in v0.7.97

func Crossing(faction, from, to string) string

Crossing is the travel step between two continents for a faction: "Zeppelin to Orgrimmar", or for Outland the Dark Portal (after the zeppelin or boat first when the player is on Kalimdor). "" when both are the same continent, or either is not known: the player then walks or rides.

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.

func Landmass added in v0.7.104

func Landmass(zone string) string

Landmass is the piece of land a zone stands on: its continent, except for the islands off Kalimdor (Azuremyst Isle, the Exodar, Bloodmyst Isle), which a flight or a walk from the mainland never reaches. "" when the zone is not known.

func RankFor added in v0.7.99

func RankFor(ds store.DataStore, skill int) (name string, floor, level int, ok bool)

RankFor is the profession rank a skill needs, from the dataset's profession_notes ranks: the rank whose range holds the skill above its floor (skill 190 is Expert, 150 to 225), the skill it starts above, and the character level it is trained from. ok is false for a skill the first rank reaches, and for a dataset that lists no ranks: nothing is guessed.

func RankLine added in v0.7.99

func RankLine(rank string, floor, level, have, need int, charLevel *int) string

RankLine is the sentence that says a skill needs a rank and the character level it is trained from; when the character is below that level and has not reached the skill, it says so.

func ZoneIn added in v0.7.99

func ZoneIn(text string) bool

ZoneIn reports whether the text names a zone the advisor knows, as whole words ("what level is Duskwood?").

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"`
	Rank    string `` /* 162-byte string literal not displayed */
	Level   int    `json:"level,omitempty" jsonschema:"the character level that rank is trained from"`
}

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"`
	// contains filtered or unexported fields
}

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.

func ProfessionTrainers added in v0.7.90

func ProfessionTrainers(c character.Character, ds store.DataStore, qx *questie.Index, prof string) []Way

ProfessionTrainers lists the trainers of one profession open to the character's faction, nearest first. It is the profession's own trainers only, never a class trainer or a quest NPC.

Jump to

Keyboard shortcuts

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