Documentation
¶
Overview ¶
Package character reads characters captured by ForeverScribe (https://github.com/MattMaximo/foreverscribe, MIT) into a typed model.
Fields ForeverScribe did not capture are nil (or an empty string for text), never invented.
Index ¶
- Constants
- func OpenWindowTip(profession string) string
- func ParseAddon(text, key, name string) (*Totals, *Observed)
- func ParseQuestRewards(vars map[string]any) map[int]QuestReward
- func SeenAgo(t int64, now time.Time) string
- func SeenNote(t int64, now time.Time) string
- func Siblings(path string) (fsPath, wowcPath string)
- func Stale(t int64, now time.Time) bool
- func StandingName(id int) string
- type Character
- func (c Character) Carries(item int64) bool
- func (c Character) ElitesIncluded() bool
- func (c Character) HasRecipeList(profession string) bool
- func (c Character) HearthWait(now int64) (wait int, usable bool)
- func (c Character) IsAbandoned(id int) bool
- func (c Character) IsHidden(id int) bool
- func (c Character) KnowsRecipe(profession string, spell int64, name string, creates int64) Knowledge
- func (c Character) LastKnownPosition() *Position
- func (c Character) LikelyKnowsMaker(profession string, creates int64) bool
- func (c Character) NearbyGivers(now time.Time) []Giver
- func (c Character) Reach() int
- func (c Character) Recipe(profession, name string) (SeenRecipe, bool)
- func (c Character) RecipeEntry(profession string, spell int64, name string, creates int64) (SeenRecipe, bool)
- func (c Character) ReputationNamed(text string) (Reputation, bool)
- func (c Character) ReputationsNamed(text string) []Reputation
- func (c Character) TrainerUsed(spell int64, name string) bool
- func (c Character) WithRecipeProfessions() Character
- func (c Character) ZoneOfMap(mapID int) string
- type Client
- type EquippedItem
- type File
- type FlightNode
- type Giver
- type ItemStack
- type Knowledge
- type Location
- type NPC
- type Objective
- type Observed
- func (o *Observed) Empty() bool
- func (o *Observed) FlightsFor(faction string) []SeenFlight
- func (o *Observed) GiverOf(questID int) (SeenGiver, bool)
- func (o *Observed) NodeNear(m int, x, y float64) (FlightNode, bool)
- func (o *Observed) TrainersFor(faction string) []SeenTrainer
- func (o *Observed) VendorsOf(item int64, faction string) (vs []SeenVendor, stock []SeenStock)
- type PerPoint
- type PlanPrefs
- type Position
- type Profile
- type Quest
- type QuestPOI
- type QuestReward
- type Reputation
- type RewardItem
- type RewardRep
- type SeenFlight
- type SeenGather
- type SeenGiver
- type SeenOffer
- type SeenRecipe
- type SeenRecipes
- type SeenStock
- type SeenTrainer
- type SeenVendor
- type Skill
- type Spot
- type Talent
- type TalentGroup
- type TalentTree
- type Talents
- type Totals
Constants ¶
const ( SourceWoWC = "WoW Companion addon" SourceFS = "ForeverScribe" )
Source names for Character.Source.
const ( FSFile = "ForeverScribe.lua" WoWCFile = "WoWCompanion.lua" )
File names beside each other in one SavedVariables folder.
const DBVariable = "ForeverScribeDB"
DBVariable is the one global the addon writes.
const DefaultLevelReach = 3
DefaultLevelReach is how many levels above the player an unfinished quest may be and still be planned.
const FlightNodeRadius = 3.0
FlightNodeRadius is how far, in map percent, a flight master may stand from its captured node and still match it.
const NearFraction = 0.75
NearFraction is the share of objectives done at which an open quest counts as nearly complete.
const RecentGiver = 7 * 24 * time.Hour
RecentGiver is how recently a giver must have been met to be flagged as a recent interaction.
const SeenByYou = "seen by you"
SeenByYou is the mark on a fact that came from what the player saw in game (WoWCompanionDB.observed, docs/observed-format.md of the addon).
const StaleAfter = 30 * 24 * time.Hour
StaleAfter is how old an observation may be and still count as current price data.
const WoWCVariable = "WoWCompanionDB"
WoWCVariable is the global the WoW Companion addon writes; its characters sit in `characters` (docs/capture-format.md of the addon).
Variables ¶
This section is empty.
Functions ¶
func OpenWindowTip ¶ added in v0.7.98
OpenWindowTip is the one line to say when a profession's recipes were never captured.
func ParseAddon ¶ added in v0.7.47
ParseAddon reads the addon's SavedVariables text: the stat totals of one character and what the player saw.
func ParseQuestRewards ¶ added in v0.7.112
func ParseQuestRewards(vars map[string]any) map[int]QuestReward
ParseQuestRewards reads WoWCompanionDB.questRewards out of parsed variables. It is tolerant: a capture without the table, or an entry without items, gives nothing for it. nil when none.
func SeenAgo ¶ added in v0.7.53
SeenAgo says when something was seen, in plain words ("seen 3 days ago"); "" when t is unknown.
func SeenNote ¶ added in v0.7.53
SeenNote is the freshness phrase for an observation: "seen 3 days ago", with "; prices may have changed" added once it is older than StaleAfter.
func Siblings ¶ added in v0.7.47
Siblings returns the ForeverScribe and the WoW Companion file in the folder of path. A path named WoWCompanion.lua is the addon's file; any other name is taken as ForeverScribe's.
func Stale ¶ added in v0.7.53
Stale reports whether an observation made at t is too old to count as current prices.
func StandingName ¶ added in v0.7.99
StandingName is the name of a reputation standing id, "" for an id outside 1 to 8.
Types ¶
type Character ¶
type Character struct {
Key string // "Realm:Name"; the name alone when the realm is empty
Name string
Realm string
Level *int
Class string
Race string
Faction string
Money *int
XP *int
XPMax *int
RestedXP *int // experience points (GetXPExhaustion), not a percentage
CapturedAt *int64
Addon string
Client Client
Location *Location // nil when the capture holds none
Hearth string // the hearthstone's bind location name
// HearthHave, HearthReadyIn (seconds left when captured) and HearthCD (the full cooldown, seconds) are nil
// in a capture made before the addon read them; see HearthWait. HearthCD is short because a test guards
// that no Character field says "cooldown" (a craft's).
HearthHave *bool
HearthReadyIn *int
HearthCD *int
// Source says which capture the character came from: SourceWoWC, SourceFS or both joined.
Source string
Equipment map[string]EquippedItem // nil when not captured
Bags []ItemStack
BagsCaptured bool
Bank []ItemStack
BankCaptured bool // false until the player has opened the bank with ForeverScribe running
NPCs []NPC // nil when the capture holds no npcs table
Quests []Quest
QuestsCaptured bool
// QuestPOI is the point the client's quest map gave for a quest in the log, by quest id: the
// area of its current objective. Nil when the capture holds none.
QuestPOI map[int]QuestPOI
CompletedQuests []int
// PlanPrefs are the player's plan settings (WoWCompanionDB.characters[key].planPrefs); nil means defaults.
PlanPrefs *PlanPrefs
// Abandoned are quests the player abandoned (from the addon's events) and has not accepted again or
// unhidden since; they count as hidden. Filled by unlock.Apply.
Abandoned map[int]bool
Talents *Talents
Skills []Skill
SkillsCaptured bool
Professions []Skill // each profession once
Reputations []Reputation
// Profile is the player's own, kept locally (internal/profile) and attached after the
// capture is read; nil when the player has set none. They are never part of a capture.
Profile *Profile
// Seasonal is the player's holiday-event setting, kept with the profile: "" (off), "on" or
// "on:<event keys>" (see questie.Seasonal).
Seasonal string
// KnownSpells are the spell ids the character knows (a recipe's spell id included), when a capture
// lists them; nil when it does not.
KnownSpells map[int64]bool
// Recipes are the recipes the client's own trade skill window listed, by profession (lower-case);
// nil when none were recorded. A recipe listed here is known.
Recipes map[string]SeenRecipes
// Totals are the stat totals the addon records (WoWCompanionDB.characters[key].stats), attached with AttachTotals;
// nil when none.
Totals *Totals
// Seen is what the player saw in game (WoWCompanionDB.observed): trainers, vendors, gathering and
// quest givers; nil when nothing was recorded. These "seen by you" facts come before the dataset.
Seen *Observed
// QuestRewards are the reward windows the player saw (WoWCompanionDB.questRewards), by quest id, account-wide;
// nil when the capture has none.
QuestRewards map[int]QuestReward
}
func AttachAddon ¶ added in v0.7.47
AttachAddon returns c with what the addon recorded in its SavedVariables file: the stat totals and the observations ("seen by you"). Nothing is attached when the file is missing or unreadable.
func AttachTotals ¶ added in v0.7.12
AttachTotals returns c with what the addon recorded in its SavedVariables file: its stat totals and what the player saw (Seen). c is unchanged when the file is unreadable or holds none.
func LoadWoWCharacter ¶ added in v0.7.47
LoadWoWCharacter builds one character from a WoWCompanionDB.characters record.
func MergeCharacters ¶ added in v0.7.47
MergeCharacters returns the newer capture, with each part it lacks filled from the other.
func (Character) Carries ¶ added in v0.7.98
Carries reports whether the item is in the bags or the bank.
func (Character) ElitesIncluded ¶ added in v0.7.98
ElitesIncluded reports whether the player plans elite quests.
func (Character) HasRecipeList ¶ added in v0.7.98
HasRecipeList reports whether the capture holds recipes for the profession (its trade skill or craft window was read).
func (Character) HearthWait ¶ added in v0.7.101
HearthWait says whether the character has a hearthstone to use and, if so, the seconds until it is ready at time now (unix seconds): the captured wait aged by the time since the capture. A capture without the hearthstone fields counts as present and ready when a bind is set; no bind or no stone is not usable.
func (Character) IsAbandoned ¶ added in v0.7.107
IsAbandoned reports whether the quest counts as hidden only because the player abandoned it.
func (Character) IsHidden ¶ added in v0.7.98
IsHidden reports whether the player hid the quest from the plan.
func (Character) KnowsRecipe ¶ added in v0.7.77
func (c Character) KnowsRecipe(profession string, spell int64, name string, creates int64) Knowledge
KnowsRecipe decides whether the character knows a recipe, by its spell id, its name and the item it creates. Known spells and the recorded recipes for the profession both count as known; when either source exists and the recipe is in neither, it is not known (even if the other source is empty).
func (Character) LastKnownPosition ¶ added in v0.5.0
LastKnownPosition is nil when neither a located save nor any NPC sighting exists.
func (Character) LikelyKnowsMaker ¶ added in v0.7.98
LikelyKnowsMaker reports whether the character probably knows a recipe of the profession that makes the item: no recipe list was captured for the profession and the item is in the bags or the bank.
func (Character) NearbyGivers ¶ added in v0.5.0
NearbyGivers lists kind "quest" NPCs in the position's zone (same map when both ids are known), nearest first. A giver sighted at several spots is listed once.
func (Character) Reach ¶ added in v0.7.98
Reach is the level reach in effect: the default when the character has no prefs, -1 for off.
func (Character) Recipe ¶ added in v0.7.53
func (c Character) Recipe(profession, name string) (SeenRecipe, bool)
Recipe finds a recipe the player's window listed for the profession, by name (case-blind).
func (Character) RecipeEntry ¶ added in v0.7.108
func (c Character) RecipeEntry(profession string, spell int64, name string, creates int64) (SeenRecipe, bool)
RecipeEntry finds the recipe the profession's window listed by spell id, name (case-blind) or created item id, whichever the caller holds; a zero id or empty name is not matched.
func (Character) ReputationNamed ¶ added in v0.7.99
func (c Character) ReputationNamed(text string) (Reputation, bool)
ReputationNamed is the character's reputation with the faction the text names, or false: the first of ReputationsNamed.
func (Character) ReputationsNamed ¶ added in v0.7.106
func (c Character) ReputationsNamed(text string) []Reputation
ReputationsNamed are the character's reputations with the factions the text names. A faction whose full name the text holds (case-insensitive) is the answer alone; failing that, the factions the short name a player says stands for: the first word of the name without a leading "The" ("Timbermaw" for Timbermaw Hold, "Gnomeregan" for Gnomeregan Exiles, "Thorium" for Thorium Brotherhood) or its last long word ("Nozdormu" for Brood of Nozdormu, "Arathor"), as a whole word.
func (Character) TrainerUsed ¶ added in v0.7.108
TrainerUsed reports whether a trainer the player opened lists the recipe (by spell id or name) as "used": already learned. The window's own list is the newer word when it holds the recipe; this is for a recipe it lacks.
func (Character) WithRecipeProfessions ¶ added in v0.7.64
WithRecipeProfessions adds a profession for each one the character has recorded recipes for and the skills do not list: a recipe window only opens for a profession the character has. The skill level of an added one is unknown. It returns c unchanged when nothing needs adding.
type EquippedItem ¶
type EquippedItem struct {
Slot string
ItemID *int
Enchant *int
Link string
Name string
ItemLevel *int
Quality *int
Durability *int
DurabilityMax *int
// Stats is the item's own stats as the addon recorded them (agi, sta, armor, ...); nil when it did not. Enchants are not in it.
Stats map[string]float64
}
type File ¶
type File struct {
Addon string
Schema *int
Client Client
Characters []Character
// HasWoWC and HasFS say which capture files were read (WoWCompanionDB.characters, ForeverScribeDB).
HasWoWC, HasFS bool
}
File is everything one SavedVariables file holds.
func LoadFile ¶
LoadFile reads the character captures beside path: the WoW Companion addon's (WoWCompanionDB.characters in WoWCompanion.lua) and ForeverScribe's. A character in both is merged: the newer capture leads and the other fills the parts it lacks. A file that is missing or unreadable is skipped when the other gives characters; otherwise the error is the one for path. A malformed file is a *lua.ParseError.
func LoadWoWC ¶ added in v0.7.47
LoadWoWC builds models from parsed variables holding WoWCompanionDB.characters. The result has no characters (and HasWoWC false upstream) when the table is absent.
func (File) CapturedAt ¶
CapturedAt is the newest capture time over all characters.
type FlightNode ¶ added in v0.7.114
type FlightNode struct {
ID int
Map int
X, Y float64
Name string // "Ratchet, The Barrens"
State string // "reachable" or "unreachable" for a known node
}
FlightNode is one node of the flight map as the addon captured it.
func (FlightNode) Known ¶ added in v0.7.114
func (n FlightNode) Known() bool
Known reports whether the capture marks the node as a flight point the character has.
type Giver ¶ added in v0.5.0
type Giver struct {
NPC
Distance float64 // straight line in map percent
Recent bool // met within RecentGiver
}
Giver is a quest-giver NPC the character has met, with its distance from the position.
type ItemStack ¶
type ItemStack struct {
ItemID int
Count int
Name string
Link string
// The addon's optional per-item fields; nil or empty when it did not record them.
Quality *int
ItemLevel *int
ReqLevel *int
EquipLoc string
Suffix string
// Enchant is the enchant id on the item; nil when none or not recorded.
Enchant *int
// Stats is the item's own stats as the addon recorded them; nil when it did not.
Stats map[string]float64
}
type Knowledge ¶ added in v0.7.77
type Knowledge int
Knowledge says whether the character knows a recipe.
const ( // RecipeUnknown: nothing recorded decides it (no known spells and no recorded list for the profession). RecipeUnknown Knowledge = iota // RecipeKnown: the spell is a known spell, or the recipe is in the recorded list for the profession. RecipeKnown // RecipeNotKnown: the character has a spell list or a recorded recipe list and the recipe is in neither. RecipeNotKnown // RecipeLikelyKnown: no recipe list was recorded for the profession (its window was never opened), but the // character carries the item the recipe makes. It is inferred, never read: say "likely", never "learn it". RecipeLikelyKnown )
type Location ¶ added in v0.4.0
Location is where the character stood at the last save (ForeverScribe snapshot.location). X and Y are percent of the map (0 to 100) and nil when the client gave no position.
type NPC ¶ added in v0.5.0
type NPC struct {
ID int
Name string
MapID *int
Zone string
Subzone string
X, Y *float64
Kind string
First *int64
Seen *int64 // t: last interaction, epoch seconds
Count *int // n: interactions
Spots []Spot
}
NPC is one NPC sighting (ForeverScribe npcs["<npcID>:<uiMapID>"]). Kind is "quest" or "gossip".
type Objective ¶
func (Objective) Label ¶ added in v0.7.2
Label is the objective's text without its have/need count: "Windsong Crawler Meat".
func (Objective) ObjectiveDone ¶ added in v0.7.79
ObjectiveDone reports whether o is finished, by its done flag or its count.
type Observed ¶ added in v0.7.47
type Observed struct {
Trainers []SeenTrainer
Vendors []SeenVendor
Gather []SeenGather
Givers []SeenGiver
// Flights are the flight masters the player opened.
Flights []SeenFlight
// Nodes are the flight map nodes the addon captured (flightPoints.nodes of every character), merged by node id.
Nodes []FlightNode
}
Observed is what the player saw, read from the addon's SavedVariables. Every list may be empty.
func ParseObserved ¶ added in v0.7.47
ParseObserved reads WoWCompanionDB.observed out of parsed variables: trainers, vendors, gathering and the quest givers of accepted events (the newest sighting of each quest wins). It is tolerant: a missing section or field is empty.
func (*Observed) FlightsFor ¶ added in v0.7.53
func (o *Observed) FlightsFor(faction string) []SeenFlight
FlightsFor lists the seen flight masters open to the faction, newest first.
func (*Observed) NodeNear ¶ added in v0.7.114
func (o *Observed) NodeNear(m int, x, y float64) (FlightNode, bool)
NodeNear is the captured node on map m nearest (x, y) within FlightNodeRadius.
func (*Observed) TrainersFor ¶ added in v0.7.47
func (o *Observed) TrainersFor(faction string) []SeenTrainer
TrainersFor lists the seen trainers open to the character's faction, newest first.
type PerPoint ¶ added in v0.7.56
type PerPoint struct {
SpellCritFromInt, CritFromAgi, ManaRegenFromSpi, HealthRegenFromSpi *float64
}
PerPoint are the client's per-point getters, every field optional: stats.perPoint.spellCritFromInt, critFromAgi, manaRegenFromSpi and healthRegenFromSpi.
type PlanPrefs ¶ added in v0.7.98
type PlanPrefs struct {
LevelReach int
Hidden map[int]bool
IncludeElite bool
Updated int64 // when the addon last wrote the prefs (0 when it does not say)
}
PlanPrefs are the player's plan settings. LevelReach is 0 to 10, or -1 for no limit; Hidden are the quests the player dismissed; IncludeElite plans elite (group) quests.
type Position ¶ added in v0.5.0
Position is the character's last known place: the saved location when it has coordinates, else (Approximate) where the most recent NPC interaction happened.
type Profile ¶ added in v0.7.0
type Profile struct {
Role string `json:"role"`
Focus string `json:"focus"`
Spec string `json:"spec,omitempty"`
// StatPref is the optional stat preference: balanced, damage or survival ("" is balanced).
StatPref string `json:"stat_pref,omitempty"`
}
Profile is a character's play style: role (tank, healer, damage or balanced), focus (leveling, dungeons, pvp or mixed), the spec tree the player chose.
type Quest ¶
type Quest struct {
QuestID int
Title string
Level *int
Zone string
Complete *bool
Failed *bool
Objectives []Objective
// Observed marks a quest the addon saw accepted after the capture: it is in the log, but its
// objectives are not in the capture.
Observed bool
// Elite is set when the addon flagged the quest elite (a group quest); nil or false when not.
Elite *bool
// Group is the quest's suggested group size from the addon (0 or nil: none); above 0 the quest is a group quest.
Group *int
}
func (Quest) Fraction ¶ added in v0.5.0
Fraction is the share of the quest's objectives that are done, and whether it is known. A complete quest is 1; a quest with no readable objectives is unknown.
func (Quest) IsElite ¶ added in v0.7.105
IsElite reports whether the capture itself marks the quest elite, and whether it says anything: ok is false for a capture with neither an elite flag nor a group size, which leaves the answer to other sources.
func (Quest) NearlyDone ¶ added in v0.5.0
NearlyDone reports a quest that is complete or has at least NearFraction of its objectives done.
func (Quest) ObjectiveProgress ¶ added in v0.5.0
ObjectiveProgress is ProgressText without the quest name: "3/8 Crab Claws; 1/1 Boss".
func (Quest) ProgressText ¶ added in v0.5.0
ProgressText is the quest's objective progress, such as "Crab Season: 3/8 Crab Claws; 1/1 Boss". It is empty when the quest has no objective with a count.
type QuestPOI ¶ added in v0.7.94
QuestPOI is one captured quest map point: a map, a position as percent of that map, and when the client gave it (0 when not recorded).
type QuestReward ¶ added in v0.7.112
type QuestReward struct {
QuestID int
Choices []RewardItem
Fixed []RewardItem
Money int64
XP int
Rep []RewardRep
SeenAt int64
}
QuestReward is what the quest's reward window showed the player (WoWCompanionDB.questRewards[questID], the addon's docs/capture-format.md): the items to choose from, the items always given, money in copper, experience and reputation. It is account-wide: any character that saw it recorded it.
type Reputation ¶
type Reputation struct {
FactionID int
Name string
Standing *int
Value *int
Min *int
Max *int
AtWar *bool
Group string
}
func (Reputation) Progress ¶ added in v0.7.99
func (r Reputation) Progress() string
Progress says where the character stands with the faction: the standing, the points inside it and the points to the next standing, from the capture's own bar (min, max and value) and, where the capture lacks them, the game's public thresholds. It says what is not known and never a guess: "" when the capture holds no standing.
type RewardItem ¶ added in v0.7.112
RewardItem is one item a quest reward window showed.
type SeenFlight ¶ added in v0.7.53
type SeenFlight struct {
NPC int64
Name string
Map int
X, Y float64
Faction string
T int64
Node string // the taxi node name recorded for this flight master, when the addon had it
}
SeenFlight is one flight master the player opened: a known flight point.
type SeenGather ¶ added in v0.7.47
type SeenGather struct {
Kind string // herb, mine, skin or fish
Source string
Map int
CX, CY int // the cell: floor(percent / 5)
N int
T int64
SkillMin, SkillMax int
Items map[int64]int // item id -> total looted
}
SeenGather is one aggregated gathering or fishing row: where, what and how much.
type SeenGiver ¶ added in v0.7.47
SeenGiver is where the player saw a quest's giver, from an accepted event.
type SeenOffer ¶ added in v0.7.47
type SeenOffer struct {
Name string
Rank string
State string // available, unavailable or used (already known)
Cost int64 // copper
Level int // the character level it needs, 0 when none shown
Skill string // the skill gate's profession, "" when none
SkillLevel int
Spell int64
}
SeenOffer is one thing a trainer teaches, as the trainer window showed it.
type SeenRecipe ¶ added in v0.7.53
type SeenRecipe struct {
Name string
ID int64 // the spell or item id in the recipe's link, 0 when none
Difficulty string // orange, yellow, green or grey at the skill the window was opened at
Makes int64 // item id, 0 when none
MakesCount int
Reagents []ItemStack
}
SeenRecipe is one recipe the player's own trade skill window listed.
type SeenRecipes ¶ added in v0.7.53
type SeenRecipes struct {
SeenAt int64
Entries []SeenRecipe
}
SeenRecipes is one profession's recipes and when the window was read.
type SeenTrainer ¶ added in v0.7.47
type SeenTrainer struct {
NPC int64
Name string
Map int
X, Y float64
Faction string
T int64
Offers []SeenOffer
}
SeenTrainer is one trainer the player opened.
type SeenVendor ¶ added in v0.7.47
type SeenVendor struct {
NPC int64
Name string
Map int
X, Y float64
Faction string
T int64
Items []SeenStock
}
SeenVendor is one vendor the player opened.
type TalentGroup ¶
TalentGroup is one named branch of a tree (for example "Discipline") and its spent points.
type TalentTree ¶
type TalentTree struct {
Name string
Key string // "professions" for a profession tree; "" for a class tree
Points *int // points spent in the tree
Unspent *int // currency.unspent
MaxPoints *int // currency.max
MaxAvail *int // currency.maxAvailable
Groups []TalentGroup
Talents []Talent
}
func (TalentTree) IsProfession ¶ added in v0.7.0
func (t TalentTree) IsProfession() bool
IsProfession reports whether the tree is a profession talent tree, not a class tree.
type Talents ¶
type Talents struct {
System string
Loadout string
Unspent *int // class talent points (class tree currencies, else the top-level field)
Trees []TalentTree
}
func (*Talents) ProfessionUnspent ¶ added in v0.7.0
ProfessionUnspent is the unspent points over the profession trees; 0 when there are none.
type Totals ¶ added in v0.7.12
type Totals struct {
At *int64 // stats.seenAt
Level *int // stats.level
// The five stats, as the totals the player sees (stats.stats.<stat>.total); Base, Pos and Neg are the
// same stat's unmodified value and its gear/buff and penalty parts.
Str, Agi, Sta, Int, Spi *float64
Base, Pos, Neg map[string]float64 // keyed "str", "agi", "sta", "int", "spi"
HealthMax, ManaMax *float64
Armor, AttackPower *float64
RangedAttackPower *float64
// Crit is the melee crit chance (stats.meleeCrit); RangedCrit and SpellCrit (the best school) are percents.
Crit, RangedCrit, SpellCrit *float64
Dodge, Parry, Block *float64
ManaRegenBase *float64 // stats.manaRegen.base
ManaRegenCasting *float64 // stats.manaRegen.casting
SpellDamage, SpellHealing *float64
// Per are what the client's own per-point getters report for this character (stats.perPoint); nil when
// the addon wrote none.
Per *PerPoint
}
Totals are a character's stat numbers as the WoW Companion addon records them read-only in WoWCompanionDB.characters[<character key>].stats (every field optional; nil when the addon wrote none).
func ParseTotals ¶ added in v0.7.12
ParseTotals reads WoWCompanionDB.characters[key].stats out of the addon's SavedVariables text, tolerantly: a missing table, entry or field gives nil or a nil field. The key is matched as captured, then case-insensitively, then by character name alone.