Lua functions

AddRecipeBookToPlayer

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

Historical signature: AddRecipeBookToPlayer(player, recipe_book_id)

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

Function: AddRecipeBookToPlayer(player, recipe_book_id)

Description: Registers a learned recipe book for the Player, using the master recipe-book catalogue and its tradeskill-level requirement. The Lua form records book membership. Individual recipes require a scribing operation that supplies the book item's recipe CRC list.

Parameters:

  • player (Spawn) - Player receiving the book registration.
  • recipe_book_id (uint32) - Recipe-book item ID in the master catalogue.

Returns: Boolean. true when the native book registration succeeds, including an eligible book already registered; false for an invalid Player, unavailable/currently replaced connection, unknown book, insufficient tradeskill level, or rejected admission. The result reports native completion rather than database durability.

Ownership and callbacks: The call retains the original Player before releasing its Lua argument stack and passes that Player's captured connection/session operation to the native helper. A replacement between connection lookup and admission rejects the request. A replacement after admission cannot redirect book or recipe work to another Player. Original catalogue and construction owners remain alive across reloads and callbacks. UI delivery requires the original audience to remain current. An unavailable Player connection returns false.

Checked example

No checked example is published for this function yet. No active script call with the current C++ argument count was found.

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