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 ¶
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 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"`
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"`
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.