Lua functions

MoveToLocation

Registered in this checkout as EQ2Emu_lua_MoveToLocation; implementation found at WorldServer/Lua/LuaFunctions.cpp:1496.

Historical signature: MoveToLocation(spawn, x, y, z, speed, lua_function, more_points, use_nav_path)

Parameter and behavior details in the historical explanation are under review against the current implementation.

Function: MoveToLocation(spawn, x, y, z, speed, lua_function, more_points, use_nav_path)

Description: Adds a running destination for the supplied spawn. Points can be batched and can optionally use native navigation paths.

Parameters:

  • spawn (Spawn): the actor to move.
  • x, y, z (number): destination coordinates.
  • speed (number, optional): movement speed. Zero or omission uses the spawn's current speed; a resulting zero speed adds no movement.
  • lua_function (string, optional): callback name associated with this point; an empty string selects no callback.
  • more_points (boolean, optional): true batches this point with more points; false or omission finishes the batch.
  • use_nav_path (boolean, optional): true requests native path navigation; false or omission uses ordinary running locations.

Returns: None.

Navigation ownership: Native navigation registers the original actor allocation and retains an actor loan while preparing or executing commands. Runtime ID or address reuse cannot redirect queued work to a replacement spawn. Path commands are prepared before replacing the current command plan; failed preparation preserves the published plan, and an older request cannot overwrite newer movement queued during its callbacks. Registry and command-metadata locks are released before movement or path-service callbacks.

Checked example

Active call in a local runtime Lua script. Argument count matches current fixed C++ readers. This is a contextual call pattern, not a tested standalone script.

MoveToLocation(NPC, 53.32, -38.49, 63.73, 5, "step1", false, true)

Evidence: server/SpawnScripts/Blackburrow/SpyDeMarco.lua:10; binding EQ2Emu_lua_MoveToLocation.

Current registration: WorldServer/Lua/LuaInterface.cpp. Historical explanation: EQ2Emu Lua documentation.