Skip to content

API UO MakeFakeItem

Codex edited this page Sep 19, 2026 · 4 revisions

UO.MakeFakeItem

ClassicUO / Basic IDE

Оглавление · Алфавитный указатель · Items

Creates or updates a local client-side ground Item through the ClassicUO World item collection. The item is made drawable, receives the requested graphic/hue/count and world coordinates, and uses the current player's Z coordinate. When serial=0, Basic allocates a free local item serial automatically.

This command does not send an item-create request to the Ultima Online server. It is a visual/local runtime object and can disappear when the world is reloaded or the server later sends state that replaces/removes the same serial.

Синтаксис

UO.MakeFakeItem(type:Any) -> Unit
UO.MakeFakeItem(type:Any, serial:Any) -> Unit
UO.MakeFakeItem(type:Any, serial:Any, count:Any) -> Unit
UO.MakeFakeItem(type:Any, serial:Any, count:Any, color:Any) -> Unit
UO.MakeFakeItem(type:Any, serial:Any, count:Any, color:Any, x:Any) -> Unit
UO.MakeFakeItem(type:Any, serial:Any, count:Any, color:Any, x:Any, y:Any) -> Unit

Регистр имени не важен. Any — динамическое значение Basic; Unit — отсутствие возвращаемого значения. Integer — знаковое 32-битное число, Decimal — число с плавающей точкой. Правила типов, serial, индексов и ожиданий.

Параметры

Имя Назначение
type Графика/цвет объекта: десятичное или 0x-число. Маску -1 используйте только в поисковых перегрузках, где она поддерживается.
serial optional item serial. 0 asks Basic to allocate a collision-free local item serial automatically. A non-zero value must be a valid item serial (0x40000000..0x7FFFFFFF).
count optional stack amount. Values <= 0 are normalized to 1; values above 65535 are clamped.
color optional hue. Clamped to the ClassicUO 16-bit hue domain and normalized by the normal client hue rules.
x optional world X coordinate. If omitted, the player's current X is used.
y optional world Y coordinate. If omitted, the player's current Y is used.

Параметры обязательны внутри каждой показанной сигнатуры. Опустить аргумент можно только при наличии более короткой перегрузки; пропуск позиции посередине не подразумевается.

Ограничения

Requires a loaded player/world.

  • This is a client-side visual object; it is not a real server-owned item and cannot be used to create inventory or server resources.
  • Supplying a serial already used by an item updates that local item; scripts should normally use serial=0 unless they intentionally need a stable client-local serial.
  • X/Y default to the player's position; Z always uses the player's current Z in this compatibility command.
  • The command returns Unit; success is observable through world/search APIs rather than a returned serial.

Возвращает: Unit — значения нет. Выполняйте вызов отдельной строкой; его нельзя использовать как проверку успеха. Эффект и ограничения зависят от команды.

Примеры

Каждый блок — самостоятельный скрипт из мануала проекта. Параметры демонстрационного объекта/контейнера и условия действия необходимо сопоставить с вашей игровой ситуацией.

Пример 1

SUB Main()
    # Create 10 gold coins locally at the player position using an automatic serial
    UO.MakeFakeItem(0x0EED, 0, 10, 0, UO.GetX(self), UO.GetY(self))
END SUB

Пример 2

SUB Main()
    # Create a local item one tile east of the player
    UO.MakeFakeItem(0x0F0E, 0, 1, 0, UO.GetX(self) + 1, UO.GetY(self))
END SUB

Пример 3

SUB Main()
    UO.MakeFakeItem(0x0EED)
END SUB

Пример 4

SUB Main()
    VAR arg1 = 0x0EED # type
    VAR arg2 = self # serial
    VAR arg3 = 3 # count
    VAR arg4 = -1 # color
    VAR arg5 = UO.GetX() # x
    VAR arg6 = UO.GetY() # y
    UO.MakeFakeItem(arg1, arg2, arg3, arg4, arg5, arg6)
END SUB

Пример 5

SUB Main()
    UO.MakeFakeItem(0x0EED, self)
END SUB

Пример 6

SUB Main()
    UO.MakeFakeItem(0x0EED, self, 3)
END SUB

Пример 7

SUB Main()
    UO.MakeFakeItem(0x0EED, self, 3, -1)
END SUB

Пример 8

SUB Main()
    UO.MakeFakeItem(0x0EED, self, 3, -1, UO.GetX())
END SUB

Пример 9

SUB Main()
    IF UO.Connected THEN
        VAR arg1 = 0x0EED # type
        UO.MakeFakeItem(arg1)
    END IF
END SUB

Пример 10

SUB RunAction()
    VAR arg1 = 0x0EED # type
    UO.MakeFakeItem(arg1)
END SUB

SUB Main()
    # Запуск процедуры выполняет действие:
    RunAction()
END SUB
Реализация и проверка контракта
  • InjectionScript.Runtime.InjectionApiUO+<>c__DisplayClass62_0.<RegisterLegacyManualAliases>b__1

Соответствующая ветвь совместимого обработчика в InjectionApiUO.cs. Arg(i)/Text(i) читают позицию с нуля; bridge обращается к клиенту. Прямые типизированные перегрузки перечислены выше и могут иметь отдельный маршрут.

{
                    int graphic = Arg(0);
                    int serial = Arg(1, 0);
                    int amount = Arg(2, 1);
                    int hue = Arg(3, 0);
                    int x = Arg(4, bridge.GetX(bridge.Self));
                    int y = Arg(5, bridge.GetY(bridge.Self));
                    int createdSerial = bridge.CreateFakeItem(graphic, serial, amount, hue, x, y);
                    if (createdSerial == 0)
                        SystemMessage("MakeFakeItem: invalid graphic/serial or no active player.");
                    break;
                }

Источник реестра и отчёт сверки. Примеры проверяются загрузчиком/парсером включённого runtime. Действия на игровом сервере этой проверкой не исполняются.

Clone this wiki locally