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

TargetToObject

Responds to an active target cursor by targeting the specified object.

ObjID — serial (ID) of the object to target.

Does nothing if no target cursor is currently active. The object must exist in the world; if it does not, the target response is still sent (the server decides validity).

Use WaitForTarget to wait for a target cursor before calling this method, or use WaitTargetObject to pre-set the target before the action that triggers the cursor.

Отвечает на активный курсор цели, нацеливаясь на указанный объект.

ObjID — serial (ID) объекта-цели.

Не выполняет действий, если курсор цели не активен. Объект должен существовать в мире; если нет, ответ о цели всё равно отправляется (валидность определяет сервер).

Используйте WaitForTarget для ожидания курсора цели перед вызовом, или WaitTargetObject для предварительной установки цели до действия, вызывающего курсор.

Pascal

procedure TargetToObject(ObjID: Cardinal);

Python

def TargetToObject(ObjID: int) -> None: ...

Pascal Example

begin
  Cast(spHeal);
  WaitForTarget(5000);
  if TargetID > 0 then
    TargetToObject(Self);
end.

Python Example

Cast(Spell.Heal)
WaitForTarget(5000)
if TargetID() > 0:
    TargetToObject(Self())

See Also

TargetToTile, TargetToXYZ, WaitForTarget, WaitTargetObject