Magic

object Magic

Magic interface

Types

AncientSpell
Link copied to clipboard
enum AncientSpell : Enum<Magic.AncientSpell> , Magic.MagicSpell

Represents all the spells in the Ancient spell book.

ArceuusSpell
Link copied to clipboard
enum ArceuusSpell : Enum<Magic.ArceuusSpell> , Magic.MagicSpell

Represents all the spells in the Arceuus spell book.

Book
Link copied to clipboard
enum Book : Enum<Magic.Book>

A spell book enum that wraps all the magic spells in each of the different spell books.

LunarSpell
Link copied to clipboard
enum LunarSpell : Enum<Magic.LunarSpell> , Magic.MagicSpell

Represents all the spells in the Lunar spell book.

MagicSpell
Link copied to clipboard
interface MagicSpell

Parent interface class for all magical spells in any spell book.

Spell
Link copied to clipboard
enum Spell : Enum<Magic.Spell> , Magic.MagicSpell

Represents all the spells in the Modern spell book.

Functions

book
Link copied to clipboard
fun book(): Magic.Book

Retrieves the current spell book that the user is on.

cast
Link copied to clipboard
fun cast(spell: Magic.MagicSpell): Boolean

Attempts to cast the given MagicSpell. This method will switch to the spell book tab if it is not already selected. A boolean value will be returned representing whether the spell's component was successfully clicked or not.

fun cast(spell: Magic.MagicSpell, action: String?): Boolean

Attempts to cast the given MagicSpell with specified action (to support redirected teleports). This method will switch to the spell book tab if it is not already selected. A boolean value will be returned representing whether the spell's component was successfully clicked or not.

casting
Link copied to clipboard
fun casting(spell: Magic.MagicSpell): Boolean

Validates that a player has a specific spell selected.

component
Link copied to clipboard
fun component(spell: Magic.MagicSpell): Component

Returns the component holding the MagicSpell. If the component cannot be found, an empty component will be returned.

magicspell
Link copied to clipboard
fun magicspell(): Magic.MagicSpell

Retrieves the current spell selected in the spell book. If no spell is currently being casted, Spell.NIL will be returned instead.

ready
Link copied to clipboard
fun ready(spell: Magic.MagicSpell): Boolean

Returns a boolean value representing whether a spell is ready to be cast. The player must be in the magic tab and have the required level, runes, and items for the cast.

widget
Link copied to clipboard
fun widget(): Int

Return the integer constant for the widget of the spell book.