Package net.storm.sdk.magic
Class Magic
java.lang.Object
net.storm.sdk.magic.Magic
Utility class for interacting with the magic spellbook system.
This class provides methods for:
- Casting spells on various targets (items, NPCs, players, objects)
- Checking and setting autocast settings
- Managing spell selection state
- Checking home teleport cooldown
Spells can be cast using different interaction methods for flexibility in how the action is performed.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcast(InteractMethod interactMethod, Spell spell) Casts a spell without a target using a specific interaction method.static voidcast(InteractMethod interactMethod, Spell spell, int actionIndex) Casts a spell with a specific action index using a specific interaction method.static voidcast(InteractMethod interactMethod, Spell spell, String action) Casts a spell with a specific action using a specific interaction method.static voidcast(InteractMethod interactMethod, Spell spell, INPC target) Casts a spell on an NPC using a specific interaction method.static voidcast(InteractMethod interactMethod, Spell spell, IPlayer target) Casts a spell on a player using a specific interaction method.static voidcast(InteractMethod interactMethod, Spell spell, IItem target) Casts a spell on an inventory item using a specific interaction method.static voidcast(InteractMethod interactMethod, Spell spell, ITileItem target) Casts a spell on a ground item using a specific interaction method.static voidcast(InteractMethod interactMethod, Spell spell, ITileObject target) Casts a spell on a tile object using a specific interaction method.static voidCasts a spell without a target using the default interaction method.static voidCasts a spell with a specific action index using the default interaction method.static voidCasts a spell with a specific action using the default interaction method.static voidCasts a spell on an NPC using the default interaction method.static voidCasts a spell on a player using the default interaction method.static voidCasts a spell on an inventory item using the default interaction method.static voidCasts a spell on a ground item using the default interaction method.static voidcast(Spell spell, ITileObject target) Casts a spell on a tile object using the default interaction method.static voidDisables autocasting.static InstantGets the last time the home teleport spell was used.static booleanChecks if any spell is currently set as autocast.static booleanisAutoCasting(Spell spell) Checks if a specific spell is currently set as the autocast spell.static booleanChecks if defensive autocasting is currently enabled.static booleanChecks if the home teleport spell is currently on cooldown.static booleanisSpellSelected(Spell spell) Checks if a specific spell is currently selected for casting.static voidselectSpell(Spell spell) Selects a spell for use on a subsequent target.static voidsetAutoCast(Spell spell, boolean defensive) Sets a spell as the autocast spell.
-
Constructor Details
-
Magic
public Magic()
-
-
Method Details
-
isAutoCasting
Checks if a specific spell is currently set as the autocast spell.- Parameters:
spell- the spell to check- Returns:
trueif the spell is set as autocast,falseotherwise
-
isAutoCasting
public static boolean isAutoCasting()Checks if any spell is currently set as autocast.- Returns:
trueif autocasting is enabled,falseotherwise
-
isDefensiveAutoCasting
public static boolean isDefensiveAutoCasting()Checks if defensive autocasting is currently enabled.- Returns:
trueif defensive autocasting is active,falseotherwise
-
isSpellSelected
Checks if a specific spell is currently selected for casting.- Parameters:
spell- the spell to check- Returns:
trueif the spell is selected,falseotherwise
-
cast
Casts a spell on an inventory item using a specific interaction method.- Parameters:
interactMethod- the method to use for the interactionspell- the spell to casttarget- the item target
-
cast
Casts a spell on an inventory item using the default interaction method.- Parameters:
spell- the spell to casttarget- the item target
-
cast
Casts a spell on an NPC using a specific interaction method.- Parameters:
interactMethod- the method to use for the interactionspell- the spell to casttarget- the NPC target
-
cast
Casts a spell on an NPC using the default interaction method.- Parameters:
spell- the spell to casttarget- the NPC target
-
cast
Casts a spell on a player using a specific interaction method.- Parameters:
interactMethod- the method to use for the interactionspell- the spell to casttarget- the player target
-
cast
Casts a spell on a player using the default interaction method.- Parameters:
spell- the spell to casttarget- the player target
-
cast
Casts a spell on a ground item using a specific interaction method.- Parameters:
interactMethod- the method to use for the interactionspell- the spell to casttarget- the ground item target
-
cast
Casts a spell on a ground item using the default interaction method.- Parameters:
spell- the spell to casttarget- the ground item target
-
cast
Casts a spell on a tile object using a specific interaction method.- Parameters:
interactMethod- the method to use for the interactionspell- the spell to casttarget- the tile object target
-
cast
Casts a spell on a tile object using the default interaction method.- Parameters:
spell- the spell to casttarget- the tile object target
-
cast
Casts a spell without a target using a specific interaction method.Used for spells like teleports that don't require a target.
- Parameters:
interactMethod- the method to use for the interactionspell- the spell to cast
-
cast
Casts a spell without a target using the default interaction method.Used for spells like teleports that don't require a target.
- Parameters:
spell- the spell to cast
-
cast
Casts a spell with a specific action using a specific interaction method.- Parameters:
interactMethod- the method to use for the interactionspell- the spell to castaction- the action name to use
-
cast
Casts a spell with a specific action using the default interaction method.- Parameters:
spell- the spell to castaction- the action name to use
-
cast
Casts a spell with a specific action index using the default interaction method.- Parameters:
spell- the spell to castactionIndex- the action index (1-based)
-
cast
Casts a spell with a specific action index using a specific interaction method.- Parameters:
interactMethod- the method to use for the interactionspell- the spell to castactionIndex- the action index (1-based)
-
selectSpell
Selects a spell for use on a subsequent target.After selecting a spell, the next click on a valid target will cast the spell on that target.
- Parameters:
spell- the spell to select
-
getLastHomeTeleportUsage
Gets the last time the home teleport spell was used.- Returns:
- the instant when home teleport was last used, or
nullif never used
-
isHomeTeleportOnCooldown
public static boolean isHomeTeleportOnCooldown()Checks if the home teleport spell is currently on cooldown.- Returns:
trueif home teleport is on cooldown,falseotherwise
-
setAutoCast
Sets a spell as the autocast spell.- Parameters:
spell- the spell to set as autocastdefensive- whether to use defensive casting (gains defence XP)
-
deselectAutoCast
public static void deselectAutoCast()Disables autocasting.
-