Lua functions

CanHarvest

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

Historical signature: CanHarvest(…) via current binding

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

Function: CanHarvest(player, ground_spawn)

Description: Checks whether any configured harvesting entry is eligible. Collecting uses Gathering skill. Configured skill bonuses contribute to the total; entries apply minimum skill, and bonus tables also apply minimum adventure level. Failed eligibility sends a harvesting warning when connected.

Parameters: player: player spawn in a usable zone. ground_spawn: GroundSpawn with configured entries.

Returns: Boolean after a completed check; no value (nil) for invalid inputs, missing entries, or missing collection skill.

Connection lifetime: Each player or group-member connection resolved by this function is retained through the native call. A disconnect or reconnect during a callback cannot destroy that retained connection or switch the ongoing call to a replacement. A later Lua call resolves the current connection. This does not extend the lifetime of unrelated spawn or item userdata.

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.

return CanHarvest(Caster, Target)

Evidence: server/Spells/Commoner/harvest.lua:11; binding EQ2Emu_lua_CanHarvest.

Current registration: WorldServer/Lua/LuaInterface.cpp.