Lua functions

AddHate

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

Historical signature: AddHate(Spawn, NPC, Amount, SendPacket)

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

Function: AddHate(Spawn, NPC, Amount, SendPacket)

Description: Add or Remove hate from a Spawn or Spell Targets if in a LUA Spell.

Parameters:

  • Spawn: Spawn - The target involved for the hate to be added.
  • NPC: Spawn - NPC related to the hate list we want to update.
  • Amount: SInt32 - The amount of hate to add or subtract (negative to remove hate).
  • SendPacket: UInt8 - Default is false, if set to 1 then we will send the threat packet to the client if in a lua spell.

Returns: None.

Checked example

Active call in a local runtime Lua script. Argument count matches current fixed C++ readers. The binding also handles arguments dynamically. This is a contextual call pattern, not a tested standalone script.

AddHate(Caster, Target, 0, 0, Effect00Value00)

Evidence: server/Spells/ClassicRefresh/Fighter/Rescue-2552782.lua:14; binding EQ2Emu_lua_AddHate.

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