移动与传送¶
gObjMoveGate(aIndex, gate)¶
将玩家传送到预定义的移动门。
gObjTeleport(aIndex, map, x, y)¶
将玩家传送到地图上的精确坐标。
MoveObjectTo(lpObj, map, x, y, autoStartHelper)¶
将玩家移动到地图上的坐标,跨地图移动时使用门系统。可选启动助手(自动移动)系统。
gObjTeleportMagicUse(aIndex, map, x, y)¶
使用传送魔法移动玩家(带传送动画)。
gObjGetRandomFreeLocation(map, ox, oy, tx, ty, count)¶
在地图上指定坐标附近查找随机空闲位置。
- 返回值:
boolean(通过引用修改 ox, oy)
gObjGetTargetPos(lpObj, sx, sy)¶
计算从对象偏移的目标位置。
- 返回值:
boolean, tx, ty(元组)
local ok, tx, ty = gObjGetTargetPos(player, 3, 3)
if ok then
LogAdd(LOG_BLUE, "Target pos: " .. tx .. "," .. ty)
end
gObjGetPositionTarget(lpObj)¶
获取对象当前的移动目标位置。
gObjSetPosition(aIndex, x, y)¶
直接设置对象的位置(无传送动画)。
PathFindMoveMsgSend(lpObj, x, y)¶
发送寻路移动消息,使对象步行到指定位置。
gObjConbertTimeGetTIckCount(secondsBlock)¶
将秒数转换为天、小时、分、秒。
- 返回值:
days, hours, minutes, seconds(元组)
local d, h, m, s = gObjConbertTimeGetTIckCount(90061)
LogAdd(LOG_BLUE, d .. "d " .. h .. "h " .. m .. "m " .. s .. "s")
-- 输出: "1d 1h 1m 1s"
Help