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 SourceDataset = "dataset"
SourceDataset marks a chain read from the dataset's quest lines.
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"`
Source string `json:"source" jsonschema:"questie"`
Followers []int `json:"-"`
Precursors []int `json:"-"`
}
Facts is what the player's QuestieDB says about one quest.