Lua functions

HasSpellImmunity

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

Historical signature: HasSpellImmunity(spawn, type)

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

Function: HasSpellImmunity(spawn, type)

Description: Return whether the Entity has an active direct, spell-owned or timed immunity of the given type. See available types in https://github.com/emagi/eq2emu/blob/main/docs/data_types/immunity_types.md

Parameters:

  • spawn (Spawn) - Spawn object representing spawn.
  • type (uint8) - Integer value type.

Returns: Boolean: true if any direct, spell-owned or timed grant is active for this immunity type; otherwise false.

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.

if not IsEpic(Target) or not HasSpellImmunity(Target, 3) then

Evidence: server/Spells/ClassicRefresh/Mage/Enchanter/BindingLight-2550888.lua:27; binding EQ2Emu_lua_HasSpellImmunity.

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