ReadStaticsXY
Returns all static items at the specified world coordinates as a TStaticCell record.
X, Y — tile coordinates on the map.
WorldNum — world (facet) number: 0 = Felucca, 1 = Trammel, 2 = Ilshenar, 3 = Malas, 4 = Tokuno, 5 = Ter Mur.
The returned TStaticCell contains a Statics array of TStaticItem records and a StaticCount field. Each record provides the tile graphic, absolute X/Y coordinates, Z altitude, and color of the static item.
Returns an empty record (StaticCount = 0) if no statics exist at the given position or the character is not connected.
In Python, this method returns a list of StaticItemRealXY objects (dicts with int values).
Unlike GetStaticTilesArray, which searches a rectangular area and returns TFoundTile records (without color), ReadStaticsXY returns data for a single tile position with full detail including color.
Возвращает все статические объекты в указанных мировых координатах в виде записи TStaticCell.
X, Y — координаты тайла на карте.
WorldNum — номер мира (фасета): 0 = Felucca, 1 = Trammel, 2 = Ilshenar, 3 = Malas, 4 = Tokuno, 5 = Ter Mur.
Возвращаемый TStaticCell содержит массив Statics из записей TStaticItem и поле StaticCount. Каждая запись включает graphic тайла, абсолютные координаты X/Y, высоту Z и цвет статического объекта.
Возвращает пустую запись (StaticCount = 0), если статика в данной позиции нет или персонаж не подключён.
В Python метод возвращает список объектов StaticItemRealXY (словари с целочисленными значениями).
В отличие от GetStaticTilesArray, которая ищет в прямоугольной области и возвращает TFoundTile (без цвета), ReadStaticsXY возвращает данные для одной позиции тайла с полной информацией, включая цвет.
function ReadStaticsXY(X: Word; Y: Word; WorldNum: Byte): TStaticCell;
TStaticItem = packed record
Tile: Word;
X: Word;
Y: Word;
Z: ShortInt;
Color: Word;
end;
TStaticCell = packed record
Statics: array of TStaticItem;
StaticCount: Byte;
end;
Parameters:
- X — horizontal map coordinate.
- Y — vertical map coordinate.
- WorldNum — facet index (0–5).
def ReadStaticsXY(X: int, Y: int, WorldNum: int) -> list[StaticItemRealXY]: ...
var
Cell: TStaticCell;
I: Integer;
begin
Cell := ReadStaticsXY(GetX(Self), GetY(Self), WorldNum);
AddToSystemJournal('Statics at position: ' + IntToStr(Cell.StaticCount));
for I := 0 to Cell.StaticCount - 1 do
AddToSystemJournal(Format(' Tile=$%4.4X Z=%d Color=$%4.4X',
[Cell.Statics[I].Tile, Cell.Statics[I].Z, Cell.Statics[I].Color]));
end.
cell = ReadStaticsXY(GetX(Self()), GetY(Self()), WorldNum())
AddToSystemJournal(f'Statics at position: {len(cell)}')
for s in cell:
AddToSystemJournal(f' Tile=${s.Tile:04X} Z={s.Z} Color=${s.Color:04X}')