Lua functions

DamageSpawn

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

Historical signature: DamageSpawn(attacker, victim, type, dmg_type, low_damage, high_damage, spell_name, crit_mod)

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

Function: DamageSpawn(attacker, victim, type, dmg_type, low_damage, high_damage, spell_name, crit_mod)

Description: Damages the victim by the attacker. type represents damage packet types listed here https://github.com/emagi/eq2emu/blob/main/docs/data_types/damage_packet_types.md converted from hex to decimal.

Parameters:

  • attacker (Spawn) - Spawn object representing attacker.
  • victim (Spawn) - Spawn object representing victim.
  • type (uint8) - Integer value type.
  • dmg_type (uint8) - Integer value dmg_type.
  • low_damage (uint32) - Integer value low_damage.
  • high_damage (uint32) - Integer value high_damage.
  • spell_name (string) - String spell_name.
  • crit_mod (uint8) - Integer value crit_mod.

Returns: None.

Checked example

Active call in a local runtime Lua script. The omitted take-power flag resolves to false. This is a contextual call pattern, not a tested standalone script.

DamageSpawn(Spawn, Spawn, 192, 3, damageToTake, damageToTake, "Fire!", 0, 0, 1, 1)

Evidence: server/SpawnScripts/BrawlersDojo/BurningFireinvisiblecube.lua:47; binding EQ2Emu_lua_DamageSpawn.

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