Documentation
¶
Overview ¶
Package gather answers "where do I mine, pick or fish X?" and "where should I gather at my level?" from the player's own QuestieDB objects, read at runtime: the zones with the most nodes or schools that yield the item, the character's own zone first, with a sample coordinate or two. The rules are in docs/professions.md and docs/design/questie-interop.md.
Index ¶
- Constants
- func AnyQuestie(zs []Zone) bool
- func KindOf(s string) string
- func Line(zones []Zone) string
- func SideOfZone(zone string) string
- type Gatherer
- func (g *Gatherer) Catches(c character.Character, id int64, name, query string) (Result, bool)
- func (g *Gatherer) Count() int
- func (g *Gatherer) Find(c character.Character, item, verb string) Result
- func (g *Gatherer) ForLevel(c character.Character, kind string) Result
- func (g *Gatherer) ItemZones(item int64, at questie.Where) (kind string, zones []Zone)
- func (g *Gatherer) ItemZonesFor(c character.Character, item int64, at questie.Where) (kind string, zones []Zone)
- type Node
- type Result
- type Zone
Constants ¶
const ( Herb = "herb" Ore = "ore" Fish = "fishing" )
Kinds of gathering, named for the skill they use.
const FromCatches = "from the game data's fishing reports"
FromCatches marks places read from the dataset's fishing reports, not from a Questie database.
const FromQuestie = "from your Questie database"
FromQuestie marks every place read from the player's QuestieDB.
const MaxZones = 3
MaxZones is how many zones an answer lists.
Variables ¶
This section is empty.
Functions ¶
func AnyQuestie ¶ added in v0.7.47
AnyQuestie reports whether any zone came from the player's QuestieDB rather than their own sightings.
func SideOfZone ¶ added in v0.7.97
SideOfZone says which faction's home zones a zone is among, "horde" or "alliance", or "" for a neutral or unknown zone. A character of the other faction does not fish or trade in a capital or starting zone.
Types ¶
type Gatherer ¶
type Gatherer struct {
// contains filtered or unexported fields
}
Gatherer holds the classified nodes of one QuestieDB. A nil Gatherer knows no nodes.
func New ¶
New classifies the Questie objects that yield items. The rule, in order, for each object that is not a container:
- the dataset names it as a Herbalism or Mining node: that profession (and its skill);
- its name says vein or deposit (ore), or school, wreckage or similar (fishing);
- it yields an item that a Mining recipe uses as a reagent: ore;
- it yields an item that an Alchemy or Inscription recipe uses and no Mining recipe does: herb.
The node's skill is the curated profession_notes figure for its name, else the dataset's skill_required, else the lowest required level of what it yields. A nil index, or one with no object rows, gives a Gatherer with no nodes.
func (*Gatherer) Catches ¶ added in v0.7.97
Catches is the zones where the dataset's fishing reports say item id was caught, best catch rate first and without the other faction's home zones; false when no cast caught it.
func (*Gatherer) Find ¶
Find answers "where can I find/mine/pick/fish X?". verb may be empty. It names up to MaxZones zones, with the character's own zone first and then the zones with the most spawns of the nodes or schools that yield the item, each with sample coordinates.
func (*Gatherer) ForLevel ¶
ForLevel answers "where should I mine/herb/fish at my level?". The character's skill comes from their professions. A node suits them when its skill is at most theirs; the best are those within 50 points under it (still worth the trip), else the highest they can take. Skills the notes and the yielded items do not give count as suiting everyone. Up to MaxZones zones, the character's own first, then the most spawns.
func (*Gatherer) ItemZones ¶
ItemZones are the zones where the item with that id can be gathered, for the profession planner: the character's zone first, then the busiest. Nil when no classified node yields it.
func (*Gatherer) ItemZonesFor ¶ added in v0.7.47
func (g *Gatherer) ItemZonesFor(c character.Character, item int64, at questie.Where) (kind string, zones []Zone)
ItemZonesFor is ItemZones with the zones where the player gathered the item themselves first (the planner's feeders). It works without Questie.
type Node ¶
type Node struct {
questie.Node
Kind string
Skill int // the skill the node needs; 0 when no number is known
}
Node is a Questie object that the classification rule accepted as gatherable.
type Result ¶
type Result struct {
Query string `json:"query,omitempty"`
Kind string `json:"kind,omitempty"`
Item string `json:"item,omitempty"`
Skill int `json:"skill,omitempty" jsonschema:"the character's skill, for a level answer"`
Zones []Zone `json:"zones"`
FromQuestie bool `json:"from_questie,omitempty"`
Text string `json:"text"`
}
Result is an answer.
type Zone ¶
type Zone struct {
Zone string `json:"zone"`
Spawns int `json:"spawns" jsonschema:"how many nodes or schools spawn there"`
Here bool `json:"here,omitempty" jsonschema:"the character is in this zone"`
Spots []questie.Spot `json:"-"`
Coords [][2]float64 `json:"coordinates,omitempty" jsonschema:"sample places, map percent"`
Nodes []string `json:"nodes" jsonschema:"the node or school names that spawn there"`
Seen bool `json:"seen_by_you,omitempty" jsonschema:"the player gathered here themselves (the addon's own record)"`
Skill int `json:"skill,omitempty" jsonschema:"the lowest skill a node there needs; 0 when unknown"`
}
Zone is one zone to gather in.