quests

package
v0.7.83 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: MIT Imports: 7 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 quests places a quest in its quest line, from the dataset's quest_lines table. The rules are in docs/chain.md.

Index

Constants

View Source
const Credit = "Everloot (CC BY-SA)"

Credit is the attribution line shown wherever Everloot facts appear.

View Source
const SourceDataset = "dataset"

SourceDataset marks a chain read from the dataset's quest lines.

View Source
const SourceEverloot = "everloot"

SourceEverloot marks a fact read from the dataset's quests_observed table: what players saw in game and reported to Everloot (CC BY-SA 4.0).

View Source
const SourceQuestie = "questie"

SourceQuestie marks a chain or fact read from the player's own QuestieDB.

Variables

This section is empty.

Functions

func GiverName added in v0.7.29

func GiverName(ds store.DataStore, id int64) string

GiverName is the bare name of the quest's giver: the client tables' first, else the NPC that quests_observed (Everloot) saw give it; "" when neither knows. Callers fall back to Questie.

func GiverNameSeen added in v0.7.47

func GiverNameSeen(ds store.DataStore, seen *character.Observed, id int64) (name string, fromSeen bool)

GiverNameSeen is GiverName, falling back to the NPC the player saw give the quest (the addon's own record); seen is true only for that fallback, so the caller can mark it "seen by you".

func Render

func Render(c Chain, name string) string

Render is the plain-text form. name is the asked-for quest's name, which may be empty.

func Resolve

func Resolve(ds store.DataStore, text string) (id int64, name string, candidates []string)

Resolve turns a quest id or name into a quest id and name. The name index lists no quests, so a name is matched by scanning the quests table: exactly before partially; otherwise it returns the candidates and id 0.

func ResolveWith added in v0.7.25

func ResolveWith(ds store.DataStore, ix *questie.Index, text string) (id int64, name string, candidates []string)

ResolveWith is Resolve that also matches names the dataset lacks against QuestieDB.

Types

type Chain

type Chain struct {
	Found    bool   `json:"found"`
	LineID   int64  `json:"line_id,omitempty"`
	Line     string `json:"line,omitempty"`
	QuestID  int64  `json:"quest_id"`
	Position int    `json:"position,omitempty" jsonschema:"1-based place of the quest in the line"`
	Steps    []Step `json:"steps"`
	// NextQuestID is the quest after this one, 0 on the last step.
	NextQuestID int64 `json:"next_quest_id,omitempty"`
	// Source is "dataset" or, for a chain built from the player's QuestieDB, "questie".
	Source string `json:"source,omitempty"`
	// Quest, Before and After are set only for a Questie chain: the quest itself, the quests it
	// follows and the quests it leads to.
	Quest  *Facts  `json:"quest,omitempty"`
	Before []Facts `json:"before,omitempty"`
	After  []Facts `json:"after,omitempty"`
}

Chain is where a quest sits in its quest line. Found is false when the dataset has no quest_lines table or no line holds the quest; the other fields are then empty.

func Of

func Of(ds store.DataStore, questID int64) Chain

Of returns the chain the quest sits in; when it is in several lines, the one with the lowest id. Steps are ordered by the table's position column when it has one, else by file order.

func OfWith added in v0.7.25

func OfWith(ds store.DataStore, ix *questie.Index, questID int64) Chain

OfWith is Of with a fallback: when the dataset has no quest line for the quest, the chain is built from the player's QuestieDB (ix may be nil). The dataset wins whenever it has a line.

func (Chain) Total

func (c Chain) Total() int

Total is the number of steps in the line.

func (Chain) Unlocks

func (c Chain) Unlocks() bool

Unlocks is true when another step follows this quest.

type Facts added in v0.7.25

type Facts struct {
	QuestID    int64  `json:"quest_id"`
	Name       string `json:"name,omitempty"`
	Level      int    `json:"level,omitempty"`
	MinLevel   int    `json:"min_level,omitempty"`
	Giver      string `json:"giver,omitempty" jsonschema:"who or what starts it, with the zone"`
	TurnIn     string `json:"turn_in,omitempty" jsonschema:"who or what takes it in, with the zone"`
	Objective  string `json:"objective,omitempty"`
	Classes    string `json:"classes,omitempty" jsonschema:"classes it is limited to; empty when open to all"`
	Races      string `json:"races,omitempty" jsonschema:"races it is limited to; empty when open to all"`
	Category   string `json:"category,omitempty"`
	Faction    string `json:"faction,omitempty"`
	Source     string `json:"source" jsonschema:"questie or everloot (seen by players on Everloot)"`
	Credit     string `json:"credit,omitempty" jsonschema:"set to the Everloot credit when any fact comes from Everloot"`
	Followers  []int  `json:"-"`
	Precursors []int  `json:"-"`
}

Facts is what the player's QuestieDB says about one quest.

func FactsOf added in v0.7.28

func FactsOf(ds store.DataStore, ix *questie.Index, id int64) *Facts

FactsOf describes quest id, filling each fact from the first source that has it: the dataset's client tables, then quests_observed (Everloot), then the player's QuestieDB (ix may be nil). The Source is everloot when an Everloot fact was used, else questie; nil when no source knows the quest.

func QuestieFacts added in v0.7.25

func QuestieFacts(ix *questie.Index, id int64) *Facts

QuestieFacts describes quest id from the index, or nil when Questie does not know it.

type Step

type Step struct {
	Position int    `json:"position" jsonschema:"1-based place in the line"`
	QuestID  int64  `json:"quest_id"`
	Name     string `json:"name,omitempty" jsonschema:"empty when the dataset has no quest name"`
}

Step is one quest of a line.

Jump to

Keyboard shortcuts

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