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

CastToObject

Casts a spell on a specific object. Internally sets a target trap on the object via WaitTargetObject and then casts the spell via CastSpell.

In Pascal, the spell is identified by its name (string), same as in CastSpell.

In Python, the spell parameter accepts a name (string), spell index (integer), or Spell enum value.

Returns True if the cast request was sent (Pascal). In Python, returns None.

Произносит заклинание на указанный объект. Внутри устанавливает ловушку на таргет через WaitTargetObject и затем произносит заклинание через CastSpell.

В Pascal заклинание задаётся именем (строка), как в CastSpell.

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

Pascal

function CastToObject(SpellName: String; ObjID: Cardinal): Boolean;

Parameters:

  • SpellName — spell name (e.g. 'Greater Heal', 'Lightning'). Case-insensitive.
  • ObjID — ID of the target object.

Python

def CastToObject(spell: Union[str, int, Spell], obj_id: int) -> None: ...

Pascal Example

begin
  // Heal yourself
  CastToObject('Greater Heal', Self);

  // Lightning on an enemy
  CastToObject('Lightning', EnemyID);
end.

Python Example

from py_astealth.stealth_enums import Spell

# Using Spell enum
CastToObject(Spell.GreaterHeal, Self())

# Using spell name
CastToObject('Lightning', enemy_id)

# Using numeric index
CastToObject(30, enemy_id)

See Also

Cast, WaitForTarget, Spell enum