Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Cast

Casts a spell.

In Pascal, the spell is identified by its name (string). Spaces in spell names are replaced with underscores internally. The name "Spell Reflection" and "Magic Reflection" are treated as equivalent.

If the spell name is not recognized, the method logs an error: "CastSpell error: unknown spell name" and returns False.

Returns True if the cast request was sent to the server.

In Python, the method is named Cast and accepts a spell index (integer) or a Spell enum value.

The Pascal method name in the source is CastSpell; in Python it is exposed as Cast.

Произносит заклинание.

В Pascal заклинание задаётся именем (строка). Пробелы в именах заменяются подчёркиваниями. Имена "Spell Reflection" и "Magic Reflection" считаются эквивалентными.

Если имя заклинания не распознано, метод записывает ошибку в журнал и возвращает False.

Возвращает True, если запрос на каст отправлен серверу.

В Python метод называется Cast и принимает индекс заклинания (целое число) или значение enum Spell.

Pascal

function CastSpell(SpellName: String): Boolean;

Parameters:

  • SpellName — spell name (e.g. 'Greater Heal', 'Lightning', 'Energy Bolt'). Case-insensitive.

Python

def Cast(SpellID: int) -> None: ...

Parameters:

  • SpellID — spell index or Spell enum value.

Pascal Example

begin
  WaitTargetSelf;
  if CastSpell('Greater Heal') then
    AddToSystemJournal('Greater Heal cast initiated');
  WaitForTarget(5000);
end.

Python Example

from py_astealth.stealth_enums import Spell

WaitTargetSelf()
Cast(Spell.GreaterHeal)
AddToSystemJournal('Greater Heal cast initiated')
WaitForTarget(5000)

# Also works with numeric index
Cast(29)  # Greater Heal

See Also

CastToObject, WaitForTarget, UseSkill, Spell enum