Lua functions

AddTemporaryImmunity

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

Historical signature: AddTemporaryImmunity(…) via current binding

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

Function: AddTemporaryImmunity(Spawn, ImmunityType, DurationMS)

Description: Grant an immunity for a positive duration in milliseconds.

Parameters:

  • Spawn: Spawn - Required Entity receiving the immunity.
  • ImmunityType: UInt8 - Immunity ID; use a named IMMUNITY_TYPE_* Lua constant. Damage immunities use IDs 11–25.
  • DurationMS: UInt32 - Positive duration in milliseconds.

Returns: None.

Behavior: Reapplying a timed immunity can extend its expiry. Expiry does not remove independent direct or spell-owned grants. No current spell is required. See the immunity table and damage behavior.

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.

AddTemporaryImmunity(Target, 1, Param01 * 1000)

Evidence: server/Spells/ClassicRefresh/Mage/Enchanter/Coercer/Befriend-2550859.lua:43; binding EQ2Emu_lua_AddTemporaryImmunity.

Current registration: WorldServer/Lua/LuaInterface.cpp.