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
- func ContinentOf(zone string) string
- func CountsText(m map[string]int) string
- func Crossing(faction, from, to string) string
- func FactionOK(npc, char string) bool
- func GateCounts(ds store.DataStore) map[string]int
- func Landmass(zone string) string
- func RankFor(ds store.DataStore, skill int) (name string, floor, level int, ok bool)
- func RankLine(rank string, floor, level, have, need int, charLevel *int) string
- func ZoneIn(text string) bool
- type Gate
- type Result
- type Way
Constants ¶
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.
const ( Trainer = "trainer" Vendor = "vendor" Drop = "drop" Quest = "quest" )
Way kinds.
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
ContinentOf is the zone's continent, or "" when the zone is not known.
func CountsText ¶
CountsText writes the counts one profession per line, sorted.
func Crossing ¶ added in v0.7.97
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
FactionOK reports whether an NPC's faction ("A", "H", "Alliance", "Horde", neutral or empty) serves the character's faction.
func GateCounts ¶
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
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
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.
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.
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.