SpellRanks class provides access to a character’s spell circle ranks and training data. It automatically loads and saves rank information from persistent storage.
Overview
SpellRanks stores training ranks for all spell circles and related skills:
- Minor Spiritual, Major Spiritual, Cleric
- Minor Elemental, Major Elemental
- Minor Mental, Ranger, Sorcerer, Wizard
- Bard, Empath, Paladin, Monk
- Arcane Symbols, Magic Item Use
Class Methods
SpellRanks.load
Loads spell rank data from persistent storage.This method is automatically called when accessing spell rank data, so manual invocation is typically unnecessary.
Loads rank data from
spell-ranks.dat in the game data directory.SpellRanks.save
Saves current spell rank data to persistent storage.Writes rank data to
spell-ranks.dat in the game data directory.SpellRanks.timestamp
Retrieve the last update timestamp for spell rank data.Unix timestamp of when the spell rank data was last updated.
SpellRanks.timestamp=
Set the timestamp for spell rank data.Unix timestamp value to set.
SpellRanks.[]
Retrieve spell rank data for a specific character by name.Character name to look up.
SpellRanks instance for the specified character, or
nil if not found.SpellRanks.list
Retrieve all stored spell rank data.Array of all SpellRanks instances.
Instance Methods
new
Create a new SpellRanks instance for a character.Character name for the spell rank data.
All spell circle ranks are initialized to 0.
name
Get the character name for this spell rank data.Character name.
Instance Attributes
EachSpellRanks instance has accessor attributes for all spell circles and related skills:
Minor Spiritual circle ranks.
Major Spiritual circle ranks.
Cleric Base circle ranks.
Minor Elemental circle ranks.
Major Elemental circle ranks.
Minor Mental circle ranks.
Ranger Base circle ranks.
Sorcerer Base circle ranks.
Wizard Base circle ranks.
Bard Base circle ranks.
Empath Base circle ranks.
Paladin Base circle ranks.
Monk Base circle ranks.
Arcane Symbols skill ranks.
Magic Item Use skill ranks.
Usage Examples
Access character spell ranks
Update and save spell ranks
List all characters with spell ranks
Check timestamp
File Storage
Spell rank data is stored in
spell-ranks.dat within the game-specific data directory using Ruby’s Marshal serialization.Notes
- Data is automatically loaded when first accessed
- The
minormentalandmonkcircles were added in later updates; old data files will have these initialized to 0 - All rank values are integers representing training ranks
