Lua functions

Attack

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

Historical signature: Attack(NPC, Target)

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

Function: Attack(NPC, Target)

Description: NPC will attack its target (NPC/Player/Bot).

Parameters:

  • NPC: Spawn - The spawn or entity involved.
  • Target: Spawn - The spawn or entity involved.

Returns: None.

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.

Attack(Cat,NPC)

Evidence: server/SpawnScripts/BeggarsCourt/arat.lua:32; binding EQ2Emu_lua_Attack.

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