Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
(Update for new patch)
 
No edit summary
 
Line 1: Line 1:
  +
== Licensing ==
{{wowapi}} __NOTOC__
 
  +
{{Licensing|Boss}}
 
 
<!-- Describe the purpose of the function, exhausting detail can be saved for a later section -->
 
Returns information about the companions you have. New in [[Patch 3.0]]
 
 
<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
 
creatureID, creatureName, creatureSpellID, icon, issummoned = GetCompanionInfo("type", id)
 
 
== Parameters ==
 
=== Arguments ===
 
<!-- List each argument, together with its type -->
 
:("type")
 
 
:;type : String - The [[API TYPE TypeId|TypeID]] to query (e.g. "CRITTER", or "MOUNT")
 
:;id : Integer - The slot id to query (starts at 1).
 
 
=== Returns ===
 
<!-- List each return value, together with its type -->
 
:;creatureID: Integer - The ID of the companion.
 
:;creatureSpellID: Integer - The Spell ID to cast the companion.
 
:;creatureName: String - The name of the companion.
 
:;icon: String - The texture of the icon for the companion.
 
:;issummoned: integer - 1 if the companion is summoned, nil if it's not
 
 
== Example ==
 
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory -->
 
<!-- begin code -->
 
for i=1,GetNumCompanions("CRITTER"),1 do
 
local creatureID, creatureName, creatureSpellID, icon, issummoned = GetCompanionInfo("CRITTER", i);
 
ChatFrame1:AddMessage(creatureID .. " " .. creatureSpellID .. " " .. creatureName .. " " .. icon) end
 
<!-- end code -->
 
 
====Result====
 
<!-- If it helps, include example results here, though they are not required. You're allowed to cheat liberally since WoW isn't a command line language. -->
 
:Prints all the information regarding your pets to the chat frame.
 
<!-- begin code -->
 
7555 Hawk Owl 10706 Interface\Icons\Ability_EyeOfTheOwl 1
 
7553 Great Horned Owl 10707 Interface\Icons\Ability_EyeOfTheOwl nil
 
<!-- end code -->
 
 
[[Category:World of Warcraft API]]
 

Revision as of 20:26, 11 April 2011

Licensing