Lua functions

StopTimer

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

Historical signature: StopTimer(spawn, function)

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

Function: StopTimer(spawn, function)

Description:

Cancels pending spawn script timers belonging to the supplied original spawn allocation. Reuse of a runtime ID cannot cancel another allocation's timers. Cancellation also suppresses callbacks already queued by the current traversal if they have not entered. It does not interrupt an entered callback.

Parameters:

  • spawn (Spawn) - The original spawn whose timers should be cancelled.
  • function (string, optional) - Callback name to cancel. Omission or an empty string cancels all pending timers for that allocation.

Returns: None.

Callbacks may call StopTimer while dispatch is in progress. A timer added after cancellation is a new registration and can run on a later traversal. See AddTimer and Lua actor lifetime.

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.

StopTimer(NPC, "animationloop")

Evidence: server/SpawnScripts/The Deserted Mine/ShyzintheCoercer.lua:197; binding EQ2Emu_lua_StopTimer.

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