questie

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 16 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 questie reads the player's own installed QuestieDB, if there is one, to find quests the character could pick up and where quest givers and objectives are. It is an optional, read-only integration: nothing here ships Questie data or code, and the index built from the player's install is cached only in their local cache folder. See docs/design/questie-interop.md.

Index

Constants

View Source
const MaxClassQuestClasses = 3

MaxClassQuestClasses is the most classes a quest's mask may name for it to count as a class quest.

View Source
const SupportedContract = 4

SupportedContract is the QuestieDB baked-storage contract this reader understands (the TOC's X-Contract-Version).

Variables

View Source
var CacheDir = func() string {
	d, err := os.UserCacheDir()
	if err != nil {
		return ""
	}
	return filepath.Join(d, "wowc-advisor", "questie")
}

CacheDir is where the parsed index is kept: the player's local cache folder, never the repo. Tests point it at a temp folder.

View Source
var ErrUnreadable = errors.New("QuestieDB format not recognised")

ErrUnreadable means the database is not in a format this reader understands.

Functions

func GameFromSavedVariables

func GameFromSavedVariables(sv string) string

GameFromSavedVariables derives the game folder from a ForeverScribe.lua path, <game>/WTF/Account/<account>/SavedVariables/<file>; "" when the path has another shape.

func OpenGame

func OpenGame(game string) (*Index, Status)

OpenGame probes the game folder and loads its index. A nil index with a non-nil Status is the normal "no Questie" or "unreadable" case.

Types

type Area

type Area struct {
	UIMap int
	Sub   string // the subzone's own name; empty for a zone
	Zone  string
}

type Credit added in v0.7.0

type Credit struct {
	Name string
	NPCs []int
}

Credit is a kill-credit objective: killing any of NPCs counts.

type Entity

type Entity struct {
	Name   string
	Sub    string // the NPC's subname, such as a title
	Spawns []Spawn
}

type Index

type Index struct {
	Schema  int
	DB      string
	Quests  map[int]*Quest
	Npcs    map[int]Entity
	Objects map[int]Entity
	Items   map[int]Item
	Areas   map[int]Area
}

func ForSavedVariables

func ForSavedVariables(sv string) *Index

ForSavedVariables is the index for the game folder a ForeverScribe.lua path sits in, or nil when there is no readable Questie there (the normal case). It never fails.

func Load

func Load(st Status) (*Index, error)

Load returns the index for the installed QuestieDB: from the local cache, else a fresh parse that is then cached. A cache that cannot be read or written is ignored.

func Parse

func Parse(st Status) (*Index, error)

Parse reads the baked TOC at st.TOC and the zone tables beside it. It returns ErrUnreadable (wrapped) when the rows do not decode as expected.

func (*Index) Available

func (ix *Index) Available(w Who, at Where, skip func(name string) bool) []Offer

Available lists the quests the character could pick up, whose giver stands on their map: best level fit first, then nearest the character. A character with no position gets none (nothing can be called nearby).

func (*Index) Locate

func (ix *Index) Locate(questID int, complete bool, at Where) (p Place, objective, ok bool)

Locate is where to go next for a quest in the log: the turn-in when complete, else the nearest objective, else the turn-in. ok is false when nothing is on the character's map.

type Item added in v0.7.0

type Item struct {
	Name    string
	Npcs    []int // NPCs that drop it
	Objects []int // objects that contain it
}

Item is the part of an item row the planner uses: where it comes from.

type Offer

type Offer struct {
	Quest *Quest
	Giver Place
	Diff  int
	Class bool // a class quest the character's class can take
}

Offer is a quest that can be picked up, with its nearest giver.

type Place

type Place struct {
	Name string // the NPC or object
	Sub  string // subzone, when the area has one
	Zone string
	X, Y float64
	Dist float64 // distance from the character in map percent; -1 when unknown
}

func (Place) String

func (p Place) String() string

type Quest

type Quest struct {
	ID         int
	Name       string
	Level      int
	MinLevel   int
	MaxLevel   int // 0: none
	Races      uint64
	Classes    uint64
	PreSingle  []int
	PreGroup   []int
	Exclusive  []int
	Next       int // quest that makes this one moot once started or completed
	Parent     int
	Until      int // quest whose completion ends availability
	Disabled   int // quest that disables this one while it is in the log
	Starters   []Ref
	Finishers  []Ref
	Creatures  []Ref // objectives that are kills or talks
	Items      []int // item objectives (item ids)
	Credits    []Credit
	Restricted bool // a requirement this reader cannot check (skill, reputation, spell, event)
}

Quest is the part of a quest row the advisor uses.

func (*Quest) ClassQuest added in v0.7.0

func (q *Quest) ClassQuest() bool

ClassQuest reports whether the quest is limited to one class or a few (its class mask names at most MaxClassQuestClasses of them), not open to everyone.

func (*Quest) Eligible

func (q *Quest) Eligible(w Who) bool

Eligible reports whether the quest could be picked up now: level, race, class, prerequisites, not done, not in the log, not a placeholder, no requirement this reader cannot check.

type Ref

type Ref struct {
	Object bool
	ID     int
}

type Spawn

type Spawn struct {
	Area int
	X, Y float64
}

Spawn is a place, as percent of the area's map.

type Status

type Status struct {
	Questie  string // Questie's version, "" when not installed
	DB       string // QuestieDB's version, "" when not installed
	Flavor   string
	TOC      string // path of the QuestieDB TOC that holds the data
	Readable bool
	Reason   string
}

Status is what is installed. Readable is true only when the database is in a format this reader understands; Reason says why not otherwise.

func Probe

func Probe(game string) Status

Probe looks for <game>/Interface/AddOns/Questie and QuestieDB and reads only their TOC headers. It never fails: an unreadable database is reported in the Status.

func (Status) Describe

func (s Status) Describe() (ok bool, text string)

Describe is the one-line setup text for the status.

type Where

type Where struct {
	MapID *int
	Zone  string
	X, Y  float64
}

Where is the character's last known place: the uiMapID, or the zone name without one; X and Y are map percent.

type Who

type Who struct {
	Level           int
	ClassID, RaceID int // 0 when not captured: that rule is not checked
	Done, InLog     map[int]bool
	Below, Above    int
}

Jump to

Keyboard shortcuts

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