Lua functions

OpenBotRecruitment

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

Historical signature: OpenBotRecruitment(…) via current binding

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

Function: OpenBotRecruitment(npc, player)

Description:

Begins recruitment with Lua recruiter context and script identity. The service applies its recruitment policy.

Parameters:

npc: recruiter NPC spawn, excluding bots. player: connected player spawn.

Returns: Boolean indicating whether recruitment began; false for invalid input, missing connection, or rejection.

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.

Deferred session identity:

The UI remembers weak references to the original NPC allocation, Player,

connection and zone, together with the connection's spawn-session generation.

A despawned NPC cannot be replaced by another NPC with the same runtime ID,

database ID, location or script. Player replacement, zoning or reconnecting

invalidates the old action. Idle session metadata does not keep these objects

alive.

Opening a newer UI or cancelling it supersedes an older pending opener, even if the newer opener finishes first. Each response claims its original nonce and stage once. Validation and the

resulting operation retain their original objects through callbacks; cleanup of

an older response preserves a newer session opened during that response. A Lua

call using an old Player object cannot open the UI for the connection's current

replacement Player. Native operation owners are released before the boolean

result is pushed to Lua.

Bot admission during teardown: The deferred operation also remembers the original Player registry admission revision. Beginning teardown revokes pending actions before Client/zone metadata must change. Reopening for a later audience cannot revive an older response. A live connection handoff can preserve ready Player-owned Bots while invalidating the old connection's pending actions. An interrupted activation keeps its original construction/retirement owner, and failed cleanup retains an exact retryable registration claim.

Group composition recommendation: The suggested category uses retained original group members acquired before class calculation. Group disband or actor retirement during calculation cannot replace those already acquired members, and acquisition/calculation runs outside the group-member lock. The recommendation still prioritizes a missing Fighter, then a missing Priest, then balances Mages and Scouts.

Group acceptance and peer replies: Native Bot activation/grouping retains the original actors, connection and group through acceptance callbacks. Pending work observes the original Bot allocation and an invitation revision; a stale peer reply cannot join a replacement Bot or consume a newer request. Updated peers must echo the invite_revision field. Interrupted current claims can retry, while cancellation and replacement supersede older claims.

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.