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
- func GiverName(ds store.DataStore, id int64) string
- func GiverNameSeen(ds store.DataStore, seen *character.Observed, id int64) (name string, fromSeen bool)
- func Name(ds store.DataStore, id int64) string
- func ObservedLevel(ds store.DataStore, id int64) (int, bool)
- func Render(c Chain, name string) string
- func Resolve(ds store.DataStore, text string) (id int64, name string, candidates []string)
- func ResolveWith(ds store.DataStore, ix *questie.Index, text string) (id int64, name string, candidates []string)
- type Chain
- type Facts
- type Step
Constants ¶
const Credit = "Everloot (CC BY-SA)"
Credit is the attribution line shown wherever Everloot facts appear.
const SourceDataset = "dataset"
SourceDataset marks a chain read from the dataset's quest lines.
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).
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
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 Name ¶ added in v0.7.99
Name is the quest's name in the client tables, else the title players reported in quests_observed, else "". The client's quests table holds no name column in a published dataset, so a quest named only there has the observed title.
func ObservedLevel ¶ added in v0.7.97
ObservedLevel is the level players reported for quest id in the dataset's quests_observed table (Everloot); false when the table or the row is missing or holds no level.
func Render ¶
Render is the plain-text form. name is the asked-for quest's name, which may be empty.
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"`
// BeforeAll is true when every quest in Before must be finished first (a group prerequisite), and false when
// one of them is enough (single prerequisites, when there are several).
BeforeAll bool `json:"before_all,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 ¶
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.
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"`
Tag string `json:"tag,omitempty" jsonschema:"group or dungeon when players tagged the quest as one that needs a group; empty otherwise"`
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
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
QuestieFacts describes quest id from the index, or nil when Questie does not know it.
func (Facts) ClassHeading ¶ added in v0.7.101
ClassHeading is the class a quest's heading names ("Warlock"), "" when the heading is a zone or there is none: such a quest is a class quest and its heading is no place.
func (Facts) GroupWords ¶ added in v0.7.99
GroupWords says a quest players tagged as one for a group or a dungeon; empty for any other.