Lua functions

SummonDeityPet

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

Historical signature: SummonDeityPet(spawn, pet_id)

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

Function: SummonDeityPet(spawn, pet_id)

Description: Create a noncombat deity pet from an NPC database definition during a spell callback. The pet uses the owner's level and faction, a configured random pet name, a noncombat brain, and the summoning spell identity. It is not attackable. Owner, pet category, brain and appearance setup finish before publication; construction and retirement each have an explicit allocation owner.

Parameters:

  • spawn (Spawn) - Player or NPC entity that will own the pet.
  • pet_id (uint32) - Nonzero NPC database spawn ID.

Returns: The created pet Spawn object, or nil for an invalid owner, an existing pet in this category, missing/invalid NPC definition, unavailable or resisted spell, or rejected admission. Failed construction retires its allocation without retaining a dangling pet address.

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

No checked example is published for this function yet. No suitable maintained runtime-script example passed the argument and source review.

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