→ WoW API
Returns information about the companions you have.
creatureID, creatureName, creatureSpellID, icon, issummoned = GetCompanionInfo("type", id)
- String (companionType) - Companion type to query: "CRITTER" or "MOUNT".
- Integer - The slot id to query (starts at 1).
- Integer - The NPC ID of the companion.
- String - The name of the companion.
- Integer - The spell ID to cast the companion. This is not passed to CallCompanion, but can be used with, e.g., GetSpellInfo.
- String - The texture of the icon for the companion.
- Flag - 1 if the companion is summoned, nil if it's not
for i=1,GetNumCompanions("CRITTER") do local creatureID, creatureName, creatureSpellID, icon, issummoned = GetCompanionInfo("CRITTER", i); print(creatureID, creatureSpellID, creatureName, icon, issummoned) end
- Prints all the information regarding your pets to the chat frame.
7555 Hawk Owl 10706 Interface\Icons\Ability_EyeOfTheOwl 1 7553 Great Horned Owl 10707 Interface\Icons\Ability_EyeOfTheOwl nil
- If called before the client updates the creature cache, GetCompanionInfo returns companions in the order in which they were learned by the current character (this can be observed during the first log-on after a patch or by removing the client's cache files). Once the cache is updated, however, it returns companions in alphabetical order; a COMPANION_UPDATE event is fired to notify of this update (however, multiple COMPANION_UPDATE events may be fired prior to the update as well). This was last verified in Patch 3.3.0a.
- This function was introduced in Patch 3.0.