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

MoveItem

Moves an item to the specified container or ground location. This is a combined DragItem + DropItem operation in a single call.

ObjID — ID of the item to move.

Count — number of items from the stack. Use 0 for the entire stack.

MoveIntoID — destination container ID, or 0 to drop on the ground.

X, Y, Z — coordinates within the container, or world coordinates when dropping on the ground. Use 0, 0, 0 for default placement.

Returns True if the item was successfully moved, False otherwise.

Перемещает предмет в указанный контейнер или на землю. Объединяет DragItem + DropItem в один вызов.

ObjID — ID предмета для перемещения.

Count — количество предметов из стопки. 0 — вся стопка.

MoveIntoID — ID контейнера-получателя, или 0 для сброса на землю.

X, Y, Z — координаты внутри контейнера или мировые координаты при сбросе на землю. 0, 0, 0 для размещения по умолчанию.

Возвращает True при успешном перемещении, False — в противном случае.

Pascal

function MoveItem(ObjID: Cardinal; Count: Integer; MoveIntoID: Cardinal;
  X: Integer; Y: Integer; Z: ShortInt): Boolean;

Python

def MoveItem(item_id: int, count: int, move_into_id: int,
             x: int, y: int, z: int) -> bool: ...

Pascal Example

begin
  if FindType($0EED, Backpack) > 0 then
  begin
    if MoveItem(FindItem, 100, LastContainer, 0, 0, 0) then
      AddToSystemJournal('Moved 100 gold to container')
    else
      AddToSystemJournal('Failed to move');
  end;
end.

Python Example

if FindType(0x0EED, Backpack()) > 0:
    if MoveItem(FindItem(), 100, LastContainer(), 0, 0, 0):
        AddToSystemJournal('Moved 100 gold to container')
    else:
        AddToSystemJournal('Failed to move')

See Also

DragItem, DropItem, MoveItems, EmptyContainer