Lua functions

Knockback

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

Historical signature: Knockback(target_spawn, spawn, duration, vertical, horizontal, use_heading)

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

Function: Knockback(target_spawn, spawn, duration, vertical, horizontal, use_heading)

Description: Triggers a knockback on the target_spawn with spawn being the originator.

Parameters:

  • target_spawn (Spawn) - Spawn object representing target_spawn.
  • spawn (Spawn) - Spawn object representing spawn.
  • duration (uint32) - Time value duration in seconds.
  • vertical (float) - Float value vertical.
  • horizontal (float) - Float value horizontal.
  • use_heading (uint8) - Integer value use_heading.

Returns: None.

Connection lifetime: Each player or group-member connection resolved by this function is retained through the native call. A disconnect or reconnect during a callback cannot destroy that retained connection or switch the ongoing call to a replacement. A later Lua call resolves the current connection. This does not extend the lifetime of unrelated spawn or item userdata.

Checked example

Active call in a local runtime Lua script. The omitted heading flag resolves to false. This is a contextual call pattern, not a tested standalone script.

Knockback(NPC, Spawn, 500, -100, 25)

Evidence: server/SpawnScripts/TimorousDeep/asiltstorm.lua:27; binding EQ2Emu_lua_Knockback.

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