Movement & Teleport¶
gObjMoveGate(aIndex, gate)¶
Teleports the player to a predefined move gate.
gObjTeleport(aIndex, map, x, y)¶
Teleports the player to exact coordinates on a map.
MoveObjectTo(lpObj, map, x, y, autoStartHelper)¶
Moves a player to coordinates on a map, using the gate system for cross-map moves. Optionally starts the helper (auto-move) system.
gObjTeleportMagicUse(aIndex, map, x, y)¶
Uses teleport magic to move the player (with teleport animation).
gObjGetRandomFreeLocation(map, ox, oy, tx, ty, count)¶
Finds a random free location on the map near the given coordinates.
- Returns:
boolean(modifies ox, oy by reference)
gObjGetTargetPos(lpObj, sx, sy)¶
Calculates a target position offset from the object.
- Returns:
boolean, tx, ty(tuple)
local ok, tx, ty = gObjGetTargetPos(player, 3, 3)
if ok then
LogAdd(LOG_BLUE, "Target pos: " .. tx .. "," .. ty)
end
gObjGetPositionTarget(lpObj)¶
Gets the current movement target position of the object.
gObjSetPosition(aIndex, x, y)¶
Directly sets the object's position (no teleport animation).
PathFindMoveMsgSend(lpObj, x, y)¶
Sends a pathfinding move message to make the object walk to the position.
gObjConbertTimeGetTIckCount(secondsBlock)¶
Converts seconds into days, hours, minutes, seconds.
- Returns:
days, hours, minutes, seconds(tuple)
local d, h, m, s = gObjConbertTimeGetTIckCount(90061)
LogAdd(LOG_BLUE, d .. "d " .. h .. "h " .. m .. "m " .. s .. "s")
-- Output: "1d 1h 1m 1s"
Help