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 GuideTrainer(ds store.DataStore, prof string, npc int64) (side, zone string)
- func Landmass(zone string) string
- func MakesLine(r Result) 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 RecipesOfItem(ds store.DataStore, name string) []store.Row
- 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 GuideTrainer ¶ added in v0.7.120
GuideTrainer is what the dataset's profession_tiers (the guide trainers) say about a profession trainer by id: the side it serves ("" for both or unknown) and the zone of its place ("Tower of Azora, Elwynn Forest" is Elwynn Forest). It fills what the trainers row lacks; both are "" when the table has no row for the trainer.
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, Ammen Vale, the Exodar, Bloodmyst Isle), which a flight or a walk from the mainland never reaches. "" when the zone is not known.
func MakesLine ¶ added in v0.7.120
MakesLine says what the recipe makes, from the recipe row's item: the item's name, or that the dataset names none (an enchant lists no item; a recipe item the dataset has no row for lists an id and no name). It states no count.
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.
func RankLine ¶ added in v0.7.99
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 RecipesOfItem ¶ added in v0.7.120
RecipesOfItem is the recipes a recipe item teaches, for the item whose name is exactly name (case ignored): the Plans, Pattern, Recipe, Formula, Schematic or Manual the dataset's recipe_items rows list. Empty for any other name.
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"`
// Makes is the name of the item the recipe makes ("" when the dataset names none) and MakesID its item id (0 when the
// recipe row lists none, as for an enchant).
Makes string `json:"makes,omitempty" jsonschema:"the item the recipe makes, from the dataset; empty when it names none"`
MakesID int64 `json:"makes_item_id,omitempty"`
// 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"`
Guide bool `` /* 142-byte string literal not displayed */
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.