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

GetSurfaceZ

Returns the average surface Z (height) of land tiles at the specified map position. This value is used internally for pathfinding calculations and can be useful for determining the walkable surface level at a given point.

X — X coordinate on the map.

Y — Y coordinate on the map.

WorldNum — map (facet) number (0 = Felucca, 1 = Trammel, etc.).

Returns 0 if the character is disconnected or map data is unavailable.

Возвращает среднюю высоту поверхности (Z) ландшафтных тайлов в указанной точке карты. Это значение используется при расчёте пути и позволяет определить уровень проходимой поверхности в заданной точке.

X — координата X на карте.

Y — координата Y на карте.

WorldNum — номер карты (фасета): 0 = Felucca, 1 = Trammel и т.д.

Возвращает 0, если персонаж не подключён или данные карты недоступны.

Pascal

function GetSurfaceZ(X: Word; Y: Word; WorldNum: Byte): ShortInt;

Python

def GetSurfaceZ(X: int, Y: int, WorldNum: int) -> int: ...

Pascal Example

var
  Z: ShortInt;
begin
  Z := GetSurfaceZ(GetX(Self), GetY(Self), WorldNum);
  AddToSystemJournal('Average surface Z at current position: ' + IntToStr(Z));
end.

Python Example

z = GetSurfaceZ(GetX(Self()), GetY(Self()), WorldNum())
AddToSystemJournal(f'Average surface Z at current position: {z}')

See Also

GetX, GetY, GetZ, GetNextStepZ, IsWorldCellPassable