Spells
constSpells:object
Defined in: server/api.d.ts:6098
Server-defined spells. A defined spell gets its own name, lock, spell-bar slot and numbers, and runs an existing player spell’s class for its look and behaviour. Every client registers it in the game’s own spell table, so it is cast, cooled down and priced like a game spell. No asset package is involved.
Type Declaration
Section titled “Type Declaration”define()
Section titled “define()”define(
definition):SpellDefinitionInfo
Adds a spell, or replaces the one with the same id, on every client now and on every client that joins later. Throws on a bad id, an unknown base, stat, part or incantation, a record path that is not plugin-rooted, a name or description that is too long or holds markup, or a full table (32). Grant it through its lock, e.g. with the spells resource’s /grantspell
Parameters
Section titled “Parameters”definition
Section titled “definition”Returns
Section titled “Returns”The stored definition.
get(
id):SpellDefinitionInfo|null
One defined spell, by id (case-blind).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”SpellDefinitionInfo | null
list()
Section titled “list()”list():
SpellDefinitionInfo[]
Every defined spell.
Returns
Section titled “Returns”remove()
Section titled “remove()”remove(
id):boolean
Removes a defined spell for players who join later. Connected clients keep it, numbers included, until they reconnect, so revoke its lock as well.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
False for an unknown id.