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.
With Cast Through Orion enabled in Server settings and Orion connected, the spell is cast through Orion itself, so Orion shows its spell area preview on the target cursor. Such a cast is asynchronous and is not ordered against the packets the script sends right after it.
Произносит заклинание.
В Pascal заклинание задаётся именем (строка). Пробелы в именах заменяются подчёркиваниями. Имена "Spell Reflection" и "Magic Reflection" считаются эквивалентными.
Если имя заклинания не распознано, метод записывает ошибку в журнал и возвращает False.
Возвращает True, если запрос на каст отправлен серверу.
В Python метод называется Cast и принимает индекс заклинания (целое число) или значение enum Spell.
Если в настройках сервера включено Cast Through Orion и подключён Orion, заклинание кастуется через сам Orion, и Orion показывает превью области заклинания на курсоре таргета. Такой каст асинхронный: его порядок относительно пакетов, которые скрипт шлёт сразу после него, не гарантирован.
function CastSpell(SpellName: String): Boolean;
Parameters:
- SpellName — spell name (e.g.
'Greater Heal','Lightning','Energy Bolt'). Case-insensitive.
def Cast(SpellID: int) -> None: ...
Parameters:
- SpellID — spell index or Spell enum value.
begin
WaitTargetSelf;
if CastSpell('Greater Heal') then
AddToSystemJournal('Greater Heal cast initiated');
WaitForTarget(5000);
end.
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