Lua functions

DismissPet

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

Historical signature: DismissPet(Spawn)

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

Function: DismissPet(spawn)

Description: Dismisses the supplied pet NPC through its original owner. Combat, deity and cosmetic pets are removed; a charmed NPC instead loses its pet/owner state and receives a normal brain. Already dismissing pets are ignored. The operation retains the admitted pet and owner through spell-removal callbacks. Cleanup clears only the original relationship revision: a replacement pet, a same-allocation reassignment or callback reparenting is preserved.

Parameters:

  • spawn (Spawn) - Pet NPC to dismiss, rather than the owning Player.

Returns: None. Invalid/non-pet input or an unavailable owner performs no dismissal.

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.

DismissPet(pet)

Evidence: server/Spells/AA/SummonAnimatedTome.lua:21; binding EQ2Emu_lua_DismissPet.

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