Lua functions

AdjustHatePosition

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

Historical signature: AdjustHatePosition(…) via current binding

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

Function: AdjustHatePosition(entity, npc, increase)

Description:

Adjusts the entity's hate position by one. true increases the position delta; false decreases it. A current spell applies this to its living NPC targets and ignores a resisted spell; otherwise uses the supplied NPC.

Parameters:

  • entity (Spawn) - Entity whose hate position changes.
  • npc (Spawn) - NPC used outside a spell target-list context.
  • increase (boolean) - true for +1; false for -1.

Returns: None.

Original spell targets: When this function uses a spell's target list, it snapshots references to the originally selected actor allocations. It skips unavailable or departed targets instead of selecting another actor with a reused runtime ID. Accepted actors remain physically retained through the active protected callback, including Lua errors; saved userdata and target records do not keep them alive between callbacks. Explicit Spawn arguments retain their existing selection behavior. See 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.

AdjustHatePosition(Caster, Target, false)

Evidence: server/Spells/Priest/Cleric/Templar/Harmony.lua:18; binding EQ2Emu_lua_AdjustHatePosition.

Current registration: WorldServer/Lua/LuaInterface.cpp.