advice

package
v0.7.95 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 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 advice ranks what a captured character should do next. Every step names its source; a fact neither the capture nor the dataset holds is reported as unknown, never guessed. The rules are in docs/advice.md.

Index

Constants

View Source
const (
	KindTurnIn     = "turn_in"
	KindQuest      = "quest"
	KindTalent     = "talent"
	KindProfession = "profession"
	KindGear       = "gear"
)

Step kinds.

View Source
const (
	MaxBelow = 5 // a quest more than this far below is grey and skipped
	MaxAbove = 3 // a quest more than this far above is too hard and skipped
)

Quest level window around the character's level.

View Source
const (
	AvailBelow = 2
	AvailAbove = 2
	// MaxAvailable caps how many "Pick up" steps WhatsNext adds.
	MaxAvailable = 3
)

Level band for a quest the character has not picked up: the character's level -2 to +2.

View Source
const (
	ClassQuestPrefix = "Class quest: pick up "
	ClassQuestNote   = "Class quests often teach a core ability."
	// MaxClassQuests caps how many class quests lead the list (the prompt budget).
	MaxClassQuests = 3
)

Class quest wording. A class quest is a pick-up limited to the player's class (or a few classes).

View Source
const AbandonPrefix = "Abandon "

AbandonPrefix starts the title of the step for a failed quest.

View Source
const MaxLocated = 5

MaxLocated is how many quests in the log get a location from Questie (the prompt budget).

View Source
const PickUpPrefix = "Pick up: "

PickUpPrefix starts the title of a step for a quest that is not yet in the log.

View Source
const SpellQuestPrefix = "Pick up "

SpellQuestPrefix starts the title of a spell-quest pick-up step.

View Source
const TalentAsk = `ask "What talents should I get?"`

TalentAsk is the question that gets the player's talent picks.

Variables

View Source
var SpellQuests = []SpellQuest{

	{QuestID: 5658, Spell: "Touch of Weakness", Class: 5, Rank1: []int64{2652, 2943}},
}

SpellQuests is the curated table of quest-taught spells. Facts only, from the quest and spell pages on wowhead and warcraft.wiki. The quest's own level, race and giver come from the player's Questie. Add a row per class or racial quest that grants a spell.

Functions

func ByQuestOrder added in v0.7.78

func ByQuestOrder[T any](items []T, quest func(T) int, order []int) []T

ByQuestOrder puts the items whose quest is in order into that order, each in a slot an on-route item held; everything else stays where it was. The panel's list and the answers' facts use it so they follow the route.

func IsClassQuest added in v0.7.0

func IsClassQuest(s Step) bool

IsClassQuest reports whether the step is a class quest pick-up.

func IsSpellQuest added in v0.7.89

func IsSpellQuest(s Step) bool

IsSpellQuest reports whether the step is a spell-quest pick-up.

func Render

func Render(c character.Character, steps []Step, total int) string

Render is the plain-text rendering; total is the count before any limit.

func TalentTitle added in v0.7.81

func TalentTitle(c character.Character, ds store.DataStore, n int) string

TalentTitle is the top line for n unspent class talent points: the build's next pick, net of the ranks already spent, or a hedge when the capture cannot say what is spent.

func TalentsKnown added in v0.7.81

func TalentsKnown(t *character.Talents) bool

TalentsKnown reports whether the capture lists what the character has already picked.

func WhoOf added in v0.6.0

func WhoOf(c character.Character) questie.Who

WhoOf is the eligibility facts of c for the player's QuestieDB (the same band as the pick-up steps).

Types

type Available added in v0.4.0

type Available struct {
	Quests    []Step
	Unchecked []string
}

Available is the quests a character could pick up now. Unchecked names each rule the dataset could not support, so an empty list is never read as "nothing to pick up".

func AvailableQuests added in v0.4.0

func AvailableQuests(c character.Character, ds store.DataStore) Available

AvailableQuests finds quests the character has not picked up but could: level within the band, class and race allowed, the previous step of its quest line completed, not completed, not in the log, not a DNT or deprecated placeholder, and in a zone the log already has quests in (the last-saved zone, or else the zones of the log's quests, is "nearby"). Ranked by level fit, then a shared quest line, then a shared zone. ds may be nil.

type MissedSpellQuest added in v0.7.89

type MissedSpellQuest struct {
	SpellQuest
	Quest *questie.Quest
	Giver questie.Place
}

MissedSpellQuest is a spell quest the character can take, has not, and so lacks its spell.

func MissedSpellQuests added in v0.7.89

func MissedSpellQuests(c character.Character, qx *questie.Index) []MissedSpellQuest

MissedSpellQuests lists the spell quests the character is eligible for (class, race, level), whose spell is not known, and that are neither done nor in the log. It needs the capture's known spells and the player's Questie; without them it says nothing.

type SpellQuest added in v0.7.89

type SpellQuest struct {
	QuestID int
	Spell   string
	Class   int     // the game's class id
	Rank1   []int64 // spell ids of Rank 1 (any of them known means the spell is learned)
}

SpellQuest is a spell whose first rank a quest teaches, not a trainer. Every later rank is then blocked at the trainer until the quest is done.

func QuestSpellFor added in v0.7.89

func QuestSpellFor(name string, class int) (SpellQuest, bool)

QuestSpellFor is the table row for a spell by name and class id.

type Step

type Step struct {
	Kind   string `json:"kind"`
	Title  string `json:"title"`
	Reason string `json:"reason"`
	Zone   string `json:"zone,omitempty"`
	// Progress is the quest's objective progress, such as "Crab Season: 3/8 Crab Claws".
	Progress string `json:"progress,omitempty"`
	QuestID  int    `json:"quest_id,omitempty"`
	// Location is where to go (an NPC or objective and its map percent), when the player's own
	// Questie could place it.
	Location string   `json:"location,omitempty"`
	Sources  []string `json:"sources"`

	// The structured parts of the step, for the digest; never part of the JSON the tools print.
	Name   string `json:"-"` // the quest's bare title
	Level  int    `json:"-"` // the quest's level, 0 when unknown
	NPC    string `json:"-"` // the giver of a pick-up, or the turn-in NPC
	Elite  bool   `json:"-"` // an elite or group quest
	Points int    `json:"-"` // unspent talent points, for a talent step

	// A trip is a quest with nothing to do that is handed in elsewhere: Finisher, FinisherPlace and
	// Instance (the dungeon, when the finisher is inside one) say where.
	Trip          bool   `json:"-"`
	Finisher      string `json:"-"`
	FinisherPlace string `json:"-"`
	Instance      string `json:"-"`
	InstanceZone  string `json:"-"` // the dungeon's zone
}

Step is one piece of advice.

func Limit

func Limit(steps []Step, n int) []Step

Limit keeps the first n steps; n <= 0 keeps all.

func WhatsNext

func WhatsNext(c character.Character, ds store.DataStore) []Step

WhatsNext returns every step for the character, best first. ds may be nil (no dataset).

func WhatsNextWith added in v0.5.0

func WhatsNextWith(c character.Character, ds store.DataStore, qx *questie.Index) []Step

WhatsNextWith is WhatsNext with the player's own QuestieDB, when they have one (nil otherwise): it supplies the pick-ups and the locations of the quests in the log.

Jump to

Keyboard shortcuts

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