Lua functions

GetSpellInitialTarget

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

Historical signature: GetSpellInitialTarget(spell)

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

Function: GetSpellInitialTarget(spell)

Description: Looks up the spell's initial runtime target in its zone and retains the returned actor through the active callback. Requires an available spell caster and zone.

Parameters:

  • spell (Spell, optional) - Spell to inspect; defaults to the current spell.

Returns: A Spawn reference, or no value (evaluates as nil) when the spell, caster, zone or initial target is unavailable.

Spell caster lifetime: When this function reads a spell's caster, it retains that allocation for the native operation. Retirement or callback reentry cannot replace its caster with a different allocation at the same address or runtime ID. A known expired or cleared caster is not rediscovered through a replacement connection. An actor already owned by the active callback remains usable through that callback. See Lua actor lifetime.

Checked example

No checked example is published for this function yet. No active script call with the current C++ argument count was found.

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