UseItemOnMobile
Uses an item directly on a mobile (target) without requiring a target cursor.
ItemSerial — serial (ID) of the item to use.
TargetSerial — serial (ID) of the mobile to target.
This is a single-packet operation that combines “use item” and “target mobile” into one action. It is faster than the traditional use-then-target sequence.
Requires client version 5.0.4 or higher. If the client version is older, an error is logged and the call is ignored.
Both the item and the target mobile must exist; otherwise an error is logged.
Does nothing if the character is not connected.
Использует предмет непосредственно на мобайле (цели) без необходимости курсора цели.
ItemSerial — serial (ID) используемого предмета.
TargetSerial — serial (ID) мобайла-цели.
Это однопакетная операция, объединяющая «использование предмета» и «нацеливание на мобайла» в одно действие. Быстрее традиционной последовательности «использовать → нацелить».
Требуется версия клиента 5.0.4 или выше. При более старой версии логируется ошибка и вызов игнорируется.
Оба объекта (предмет и мобайл-цель) должны существовать, иначе логируется ошибка.
Не выполняет действий, если персонаж не подключён.
procedure UseItemOnMobile(ItemSerial: Cardinal; TargetSerial: Cardinal);
def UseItemOnMobile(ItemSerial: int, TargetSerial: int) -> None: ...
const
BANDAGE_TYPE = $0E21;
begin
if FindType(BANDAGE_TYPE, Backpack) > 0 then
begin
UseItemOnMobile(FindItem, Self);
AddToSystemJournal('Applied bandage to self');
end;
end.
BANDAGE_TYPE = 0x0E21
if FindType(BANDAGE_TYPE, Backpack()) > 0:
UseItemOnMobile(FindItem(), Self())
AddToSystemJournal('Applied bandage to self')