GetWorldItems
Returns an array of all world items currently known to the client. Each element is a TWorldItemData record containing the item’s serial, graphic, color, coordinates, world number, stack count, and flags.
This provides a snapshot of items visible in the game world (not inside containers). For mobiles, use GetMobiles.
Возвращает массив всех предметов мира, известных клиенту на данный момент. Каждый элемент — запись TWorldItemData, содержащая серийный номер, графику, цвет, координаты, номер мира, количество в стопке и флаги.
Предоставляет снимок предметов, видимых в игровом мире (не внутри контейнеров). Для мобилов используйте GetMobiles.
function GetWorldItems: TArray<TWorldItemData>;
DWScript only. Not available in PascalScript in this form.
function GetWorldItems: TWorldItemDataArray;
Type definition:
TWorldItemData = packed record
Serial: Cardinal;
Graphic: Word;
Color: Word;
X: Word;
Y: Word;
Z: ShortInt;
World: Byte;
Count: Word;
Flags: Byte;
end;
TWorldItemDataArray = TArray<TWorldItemData>;
def GetWorldItems() -> list[WorldItemData]: ...
var
Items: TArray<TWorldItemData>;
i: Integer;
begin
Items := GetWorldItems;
AddToSystemJournal('World items count: ' + IntToStr(Length(Items)));
for i := 0 to Min(Length(Items) - 1, 9) do
AddToSystemJournal(' $' + IntToHex(Items[i].Serial, 8) +
' type=$' + IntToHex(Items[i].Graphic, 4) +
' at ' + IntToStr(Items[i].X) + ',' + IntToStr(Items[i].Y) + ',' + IntToStr(Items[i].Z));
end.
items = GetWorldItems()
AddToSystemJournal(f'World items count: {len(items)}')
for item in items[:10]:
AddToSystemJournal(f' ${item.Serial:08X} type=${item.Graphic:04X}'
f' at {item.X},{item.Y},{item.Z}')