Rune

A type alias: another name for the type it stands for.

Stands for
"air"

Methods

MethodReturnsDescription
itemId(Rune)numberThe rune's own item id: ItemID.AIRRUNE for Rune.AIR. A static, since a Rune is its name ("air"). A staff a spell needs is a `SpellI…
itemIds(Rune){ number }Every item id that pays for the rune in a spell's cost: its own item first, then each combination rune carrying it, ordered as the Rune c…
fromItemId(number)Rune?The rune whose own item an item id is. A combination rune's item answers the combination rune (`Rune.fromItemId(ItemID.MISTRUNE) == Rune.MI…
fromVarbit(number)Rune?The rune a rune-pouch slot's type varbit (VarbitID.RUNE_POUCH_TYPE_1 to _6) names.
mainhandProviders(){ [Rune]: { number } }The staves that supply each elemental rune, by rune: a table from Rune.AIR, WATER, EARTH and FIRE to the item ids of the staves tha…
offhandProviders(){ [Rune]: { number } }The tomes that supply each elemental rune, by rune: a table from Rune.WATER, EARTH and FIRE to the item ids of the tomes that supply…
isSuppliedByEquipment(Rune)booleanWhether a worn staff or tome supplies the rune.

Fields

FieldTypeDescription
AIRRuneAir rune.
WATERRuneWater rune.
EARTHRuneEarth rune.
FIRERuneFire rune.
MINDRuneMind rune.
CHAOSRuneChaos rune.
DEATHRuneDeath rune.
BLOODRuneBlood rune.
COSMICRuneCosmic rune.
NATURERuneNature rune.
LAWRuneLaw rune.
SOULRuneSoul rune.
BODYRuneBody rune.
ASTRALRuneAstral rune.
WRATHRuneWrath rune.
MISTRuneMist rune.
DUSTRuneDust rune.
MUDRuneMud rune.
LAVARuneLava rune.
STEAMRuneSteam rune.
SMOKERuneSmoke rune.
SUNFIRERuneSunfire rune.
AETHERRuneAether rune.

Returned by

MethodReturnsDescription
RuneClass.fromItemIdRune?The rune whose own item an item id is. A combination rune's item answers the combination rune (`Rune.fromItemId(ItemID.MISTRUNE) == Rune.MI…
RuneClass.fromVarbitRune?The rune a rune-pouch slot's type varbit (VarbitID.RUNE_POUCH_TYPE_1 to _6) names.
RuneClass.mainhandProviders{ [Rune]: { number } }The staves that supply each elemental rune, by rune: a table from Rune.AIR, WATER, EARTH and FIRE to the item ids of the staves tha…
RuneClass.offhandProviders{ [Rune]: { number } }The tomes that supply each elemental rune, by rune: a table from Rune.WATER, EARTH and FIRE to the item ids of the tomes that supply…
RunePouch.contents{ { rune: Rune, quantity: number } }What a spell can draw on from the pouch now: empty while no pouch is carried.
RunePouch.missing{ Rune }Which of runes the pouch does not hold enough of, read as storedContents is.
RunePouch.storedContents{ { rune: Rune, quantity: number } }The pouch's contents as the game's vars hold them, which stay set while the pouch is banked. To ask what a spell can use, read contents.

Method details

itemId

itemId: (Rune) -> number

The rune's own item id: ItemID.AIRRUNE for Rune.AIR. A static, since a Rune is its name ("air"). A staff a spell needs is a SpellItem, not a rune.

rune
A Rune constant or a rune's name.

itemIds

itemIds: (Rune) -> { number }

Every item id that pays for the rune in a spell's cost: its own item first, then each combination rune carrying it, ordered as the Rune constants are. It also lists sunfire runes for fire and aether runes for soul and cosmic, which the game accepts.

rune
A Rune constant or a rune's name.

fromItemId

fromItemId: (number) -> Rune?

The rune whose own item an item id is. A combination rune's item answers the combination rune (Rune.fromItemId(ItemID.MISTRUNE) == Rune.MIST).

itemId
Any item id.
Returns
nil for an item that is no rune.

fromVarbit

fromVarbit: (number) -> Rune?

The rune a rune-pouch slot's type varbit (VarbitID.RUNE_POUCH_TYPE_1 to _6) names.

value
The varbit's value.
Returns
nil for 0 or a value that names no rune.

mainhandProviders

mainhandProviders: () -> { [Rune]: { number } }

The staves that supply each elemental rune, by rune: a table from Rune.AIR, WATER, EARTH and FIRE to the item ids of the staves that supply the rune without using any. That is the plain, battle and mystic staves, each combination staff carrying it, and the ornament steam and lava staves (*_PRETTY), which the game treats as their base staff.

offhandProviders

offhandProviders: () -> { [Rune]: { number } }

The tomes that supply each elemental rune, by rune: a table from Rune.WATER, EARTH and FIRE to the item ids of the tomes that supply the rune without using any (fire has two: TOME_OF_FIRE and the untradeable BR_TOME_OF_FIRE).

isSuppliedByEquipment

isSuppliedByEquipment: (Rune) -> boolean

Whether a worn staff or tome supplies the rune.

A static over the rune, since a Rune is its name ("air"), a string with no methods; a game argument after the rune is ignored. True when a worn item's name contains "staff" and one of the rune's names ("Air", "Smoke", "Mist" and "Dust" for AIR, ...), or starts with "Tome of", does not end with "(empty", and contains one. The ornament staves count, and so does an uncharged tome ("Tome of fire (empty)"); a members staff on a free world ("Members object") does not. The combination runes, SUNFIRE and AETHER are never supplied. It reads the worn items, so it raises outside a callback.

rune
A Rune constant or a rune's name.