1
0
EQ2Emu/docs/lua_functions/GetCharmedPet.md
2025-05-13 22:57:49 -04:00

17 lines
617 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Function: GetCharmedPet(Spawn)
Description: Returns the NPC that the given player or NPC has charmed, if any. When a player charms an NPC (through a spell), that NPC becomes a pet under their control — this function retrieves it.
Parameters:
Spawn: Spawn The entity (usually a player) who may have a charmed pet.
Returns: Spawn The charmed pet NPC if one exists, or nil if there is no active charmed pet.
Example:
-- Example usage (checking if player currently has a charmed creature)
local charmed = GetCharmedPet(Player)
if charmed ~= nil then
Say(charmed, "I am under your control...")
end