levelup

package
v0.7.71 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 13 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 levelup answers "what's new at my next level?": the spells and ranks a class trainer teaches in a level window, what they cost when the dataset knows, the nearest class trainer, whether the character's money covers it, and the class quests coming up. Everything comes from the dataset's class_spells and trainer_spells, the capture, and the player's QuestieDB; nothing is guessed.

Index

Constants

This section is empty.

Variables

View Source
var ClassIDs = map[string]int64{"WARRIOR": 1, "PALADIN": 2, "HUNTER": 3, "ROGUE": 4, "PRIEST": 5, "SHAMAN": 7, "MAGE": 8, "WARLOCK": 9, "DRUID": 11}

ClassIDs maps the capture's class token to the dataset's class_id.

Functions

func ClassCity added in v0.7.70

func ClassCity(faction, class string) string

ClassCity is the capital for the faction's class trainers, "" when none is known.

func Facts

func Facts(c character.Character, ds store.DataStore, qx *questie.Index, from, to int) (text string, spells, quests bool)

Facts is the grounded block for "what's new at my next level": the spells to train from level from to to with costs, the total, the money check, the trainer and the class quests coming up. ok is false when the dataset holds nothing for the class and window.

func MoneyLine

func MoneyLine(c character.Character, total int64) string

MoneyLine is the plain money check: "" when the character's money is unknown or covers the total.

func Total

func Total(sp []Spell) (copper int64, unknown int)

Total is the cost of the spells that have one, and how many have none on record.

Types

type ClassQuest

type ClassQuest struct {
	ID        int
	Name      string
	Level     int
	Giver     string
	Zone      string
	X, Y      float64
	OpensAt   int // the level it opens at; 0 when open now
	Objective string
}

ClassQuest is a class quest coming up: its giver and where.

func ClassQuests

func ClassQuests(c character.Character, qx *questie.Index, ahead int) []ClassQuest

ClassQuests lists the character's class quests available now or within ahead levels.

type Spell

type Spell struct {
	ID    int64
	Name  string
	Rank  int   // 0 when the ability has no rank
	Level int   // the level it is learned at
	New   bool  // false when it upgrades a known rank
	Cost  int64 // copper; 0 when no corroborated offer carries one
	Seen  bool  // the cost is the one a trainer showed the player
	// SeenAt is when that trainer window was read (unix s); NeedLevel is the level its window said, 0 when none.
	SeenAt    int64
	NeedLevel int
	Blocked   bool // the trainer showed it as not yet available
}

Spell is one ability or rank a trainer teaches.

func Spells

func Spells(c character.Character, ds store.DataStore, from, to int) []Spell

Spells lists the trainer-taught spells of the character's class for levels from to to, in level order. A spell the capture says the character knows is left out (when it lists known spells), and so is a rank a higher rank in the same window supersedes. Costs come from trainer_spells.

func (Spell) Label

func (s Spell) Label() string

Label is the spell as a player reads it: "Rend (Rank 2)".

type TrainPlace added in v0.7.70

type TrainPlace struct {
	City    string
	From    string   // the flight point to fly from, when a known direct flight reaches the city
	Trainer *Trainer // the class trainer's NPC and position, only when a capture or QuestieDB names one
	Seen    bool     // the trainer is one the player opened
	Here    bool     // the character is already in the city
}

TrainPlace is where the character should go to train class spells.

func TrainAt added in v0.7.70

func TrainAt(c character.Character, qx *questie.Index) (TrainPlace, bool)

TrainAt chooses the place to train class spells: a class trainer the player opened in the city or where they stand, else the class's trainer in the faction's city from QuestieDB, else the city alone. It never names an NPC or a position that no source holds.

func (TrainPlace) Line added in v0.7.70

func (p TrainPlace) Line(class string) string

Line is the plain fact: "Train at: Undercity (fly from Tarren Mill)".

type Trainer

type Trainer struct {
	Name, Zone string
	X, Y       float64
}

Trainer is the nearest class trainer from the player's QuestieDB.

func NearestTrainer

func NearestTrainer(c character.Character, qx *questie.Index) (Trainer, bool)

NearestTrainer is the character's class trainer for their faction, in their zone first, else the nearest by map distance, else the first. ok is false without a QuestieDB or a trainer.

func SeenClassTrainer added in v0.7.47

func SeenClassTrainer(c character.Character) (Trainer, bool)

SeenClassTrainer is the class trainer the player opened (one whose window carries no profession skill gate), the newest on the character's own map first.

func (Trainer) String

func (t Trainer) String() string

Jump to

Keyboard shortcuts

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