Documentation
¶
Overview ¶
Package dungeons picks the dungeons that fit a captured character from the dataset's instances, instance_bosses and loot_sources tables, and lists the boss drops that gear.Upgrades scores as upgrades for the character's spec. The rules are in docs/dungeons.md.
Index ¶
- Constants
- func AlternateMode(ds store.DataStore, boss store.Row) bool
- func Mentioned(ds store.DataStore, qx *questie.Index, text string) string
- func PartySize(name string, raid bool, table int) int
- func QuestCount(ds store.DataStore, name string) (n int, ok bool)
- func Render(c character.Character, r Result, limit int) string
- func RenderNamed(c character.Character, p DungeonPick, togo int) string
- type Drop
- type DungeonPick
- type Inhabitant
- type Pickup
- type Quest
- type RaidSize
- type Result
Constants ¶
const DungeonParty = 5
DungeonParty is the players a dungeon takes: a party of five.
const LevelWindow = 3
LevelWindow is how far below the character a dungeon's range may top out and still fit. A dungeon is open from its minimum level, so none fits a character under it.
Variables ¶
This section is empty.
Functions ¶
func AlternateMode ¶ added in v0.7.99
AlternateMode is true when boss, an instance_bosses row, belongs to an alternate mode of its map while the map has ordinary encounters: the dungeon's own list leaves it out, so a drop from it is not the dungeon's.
func Mentioned ¶ added in v0.7.43
Mentioned is the name of the one dungeon a text names: its full name, else (when it has several words and the first is distinctive) that first word. "" when none matches or the word is shared by several dungeons.
func PartySize ¶ added in v0.7.101
PartySize is the number of players a dungeon or raid takes. The client's map table holds a cap of 10 for most five-player dungeons and 20 for Sunken Temple, which is no group a player can bring: a dungeon's party is five. Blackrock Spire is the one that holds a ten-player part (Upper Blackrock Spire), so it keeps the table's 10 and is worded for both parts (see DungeonPick.players). A raid keeps the table's size.
func QuestCount ¶ added in v0.7.123
QuestCount is how many distinct quests the dataset's instance_quests rows tie to the named dungeon or raid, whatever their side; ok is false when the name is no map of the instances table. It is the least the dungeon has in the game: the rows file a quest under a dungeon's heading for some dungeons only.
func Render ¶
Render is the plain-text plan, showing at most limit ranked picks (all when limit <= 0). It leads with the answer and never narrates where the data came from.
func RenderNamed ¶ added in v0.7.43
func RenderNamed(c character.Character, p DungeonPick, togo int) string
RenderNamed is the plan for one named dungeon, whatever the character's level: one line when it is not open yet, then everything about it (all its bosses, quests and drops).
Types ¶
type Drop ¶
type Drop struct {
Boss string
ItemID int64
Item string
Slot string
Delta float64
Empty bool // the slot is empty
Chance *float64 // percent of loot windows
// Questie is true when the drop comes from the player's QuestieDB, not the dataset.
Questie bool
}
Drop is one upgrade a boss drops. Chance is nil when the dataset has no kill count.
type DungeonPick ¶
type DungeonPick struct {
MapID int64
Name string
MinLevel *int
MaxLevel *int
MaxPlayers *int
// Raid is true for a raid map: its lockout and attunement are not in the dataset.
Raid bool
// EntranceZone is where the dungeon's entrance is; empty when not known.
EntranceZone string
// EntranceX and EntranceY are the entrance in map percent of EntranceZone; EntranceFromQuestie
// is true when Questie supplied the zone or the coordinates.
EntranceX, EntranceY float64
HasEntranceXY bool
EntranceFromQuestie bool
// Inside are the creatures that live in the dungeon, bosses first, when Questie knows them.
Inside []Inhabitant
// Curated is true when the level range is the advisor's typical range (level_source curated).
Curated bool
// Faction is "Horde" or "Alliance" when the dungeon is one side's; empty for both.
Faction string
// Pickups are the dungeon quests to take first, with their givers.
Pickups []Pickup
// LevelUnknown is true when the dataset holds no level range; such picks are unranked.
LevelUnknown bool
// Fit is how many levels the character is above the range (0 inside it).
Fit int
// Upgrades counts the distinct items among Drops.
Upgrades int
Drops []Drop
Quests []Quest
// Bosses are the dungeon's encounters by name, from the dataset.
Bosses []string
// UnlinkedBosses are the encounters the dataset cannot tie to a creature, so their drops are
// unknown.
UnlinkedBosses []string
// contains filtered or unexported fields
}
DungeonPick is one dungeon and what it offers the character.
func Named ¶ added in v0.7.43
func Named(c character.Character, ds store.DataStore, qx *questie.Index, name string) (*DungeonPick, int, error)
Named is the dungeon the player asked about by name (exactly, else by containment either way), described whatever the character's level or side: it is for planning ahead, so nothing is filtered. The int is how many levels the character is under its minimum (0 when open). It returns nil when no dungeon has that name, and an error naming the candidates when a part of a name fits several dungeons (Blackrock, Zul): none of them is guessed.
type Inhabitant ¶ added in v0.7.33
Inhabitant is a creature inside a dungeon, from the player's QuestieDB.
type Pickup ¶ added in v0.7.32
type Pickup struct {
ID int64
Title string
Giver string
Questie bool // from the player's QuestieDB
GiverSeen bool // the giver is one the player saw give the quest
}
Pickup is a dungeon quest worth taking before going in.
type RaidSize ¶ added in v0.7.122
RaidSize is a raid the dataset gives a level range, with the players it takes.
type Result ¶
type Result struct {
Picks []DungeonPick
Unknown []DungeonPick
Spec string
// First is set when the character is below every dungeon's range: the lowest one, which they
// reach in LevelsToGo levels. Meanwhile is one useful thing to do in the meantime.
First *DungeonPick
LevelsToGo int
Meanwhile string
// ItemLevelOnly is true when upgrades were scored without stat weights.
ItemLevelOnly bool
Reason string // why scoring fell back to item level, when it did
}
Result is a plan: ranked picks, then the dungeons with no level range.
func Plan ¶
Plan finds the dungeons whose level range comes within LevelWindow of the character's level, ranked by upgrade count then level fit, with the unranked level-unknown ones after.