Lua functions

AddSkill

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

Historical signature: AddSkill(…) via current binding

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

Function: AddSkill(player, skill_id, current_value, maximum_value, more_to_add = false)

Description: Adds a player skill by copying its master definition when the player does not already have that skill.

Parameters:

  • player (Player) - Player receiving the skill.
  • skill_id (uint32) - Positive ID of an existing master skill definition.
  • current_value (uint16) - Positive starting value.
  • maximum_value (uint16) - Positive starting maximum.
  • more_to_add (boolean, optional) - Keep a batch open with true; false requests the final skill packet refresh, including when this ID already exists.

Returns: Boolean true when the valid player/positive-parameter request enters the missing-skill add path; false otherwise. The current native Lua function does not report the underlying master-definition lookup result, so true alone does not prove publication. Use HasSkill to verify an unknown master ID.

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.

AddSkill(Player, entry.id, current, max_value, index < #missing)

Evidence: server/SpawnScripts/Generic/ClassChangeModule.lua:394; binding EQ2Emu_lua_AddSkill.

Current registration: WorldServer/Lua/LuaInterface.cpp.