Wowpedia

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

READ MORE

Wowpedia
(petID)
Tag: WoW API docs
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 
{{wowapi}}
 
{{wowapi}}
 
Returns information about a battle pet.
 
Returns information about a battle pet.
speciesID, customName, level, xp, maxXp, displayID, isFavorite, name, icon, petType, creatureID, sourceText, description, isWild, canBattle, tradable, unique = C_PetJournal.GetPetInfoByPetID(petID)
+
speciesID, customName, level, xp, maxXp, displayID, isFavorite, name, icon, petType, creatureID, sourceText, description, isWild, canBattle, tradable, unique, obtainable = C_PetJournal.GetPetInfoByPetID("petID")
   
 
== Arguments ==
 
== Arguments ==
  +
;petID : <span class="apitype">string</span> : [[GUID#BattlePet|GUID]]
;petID : String - Unique identifier for this specific pet
 
   
 
== Returns ==
 
== Returns ==
  +
{| class="darktable zebra"
;speciesID : Number - Identifier for the pet species
 
  +
!Index!!Value!!Type!!Details
;customName : String - Name assigned by the player or nil if unnamed
 
  +
|-
;level : Number - The pet's current battle level
 
 
|1||[[BattlePetSpeciesID|speciesID]]||Number||Identifier for the pet species
;xp : Number - The pet's current xp
 
  +
|-
;maxXp : Number - The pet's maximum xp
 
 
|2||customName||String||Name assigned by the player or nil if unnamed
;displayID : Number - The display ID of the pet
 
  +
|-
;isFavorite : Boolean - Whether the pet is marked as a favorite
 
 
|3||level||Number||The pet's current battle level
;name : String - Name of the pet species ("Albino Snake", "Blue Mini Jouster", etc.)
 
  +
|-
;icon : String - Full path for the species' icon
 
 
|4||xp||Number||The pet's current xp
;petType : Number - Index of the species' pet type
 
  +
|-
;creatureID : Number - NPC ID for the summoned companion pet
 
 
|5||maxXp||Number||The pet's maximum xp
;sourceText : String - Section of the tooltip that provides location information
 
  +
|-
;description : String - Section of the tooltip that provides pet description ("flavor text")
 
 
|6||[[CreatureDisplayID|displayID]]||Number||The display ID of the pet
;isWild: Boolean - For pets in the player's possession, true if the pet ''was'' caught in the wild. For pets not in the player's possession, true if the pet ''can'' be caught in the wild.
 
  +
|-
;canBattle : Boolean - True if this pet can be used in battles, false otherwise.
 
 
|7||isFavorite||Boolean||Whether the pet is marked as a favorite
;tradable : Boolean - True if this pet can be traded, false otherwise.
 
  +
|-
;unique : Boolean - True if this pet is unique, false otherwise.
 
 
|8||name||String||Name of the pet species ("Albino Snake", "Blue Mini Jouster", etc.)
  +
|-
 
|9||icon||String||Full path for the species' icon
  +
|-
 
|10||petType||Number||Index of the species' pet type
  +
|-
 
|11||creatureID||Number||NPC ID for the summoned companion pet
  +
|-
 
|12||sourceText||String||Section of the tooltip that provides location information
  +
|-
 
|13||description||String||Section of the tooltip that provides pet description ("flavor text")
  +
|-
 
|14||isWild||Boolean||For pets in the player's possession, true if the pet ''was'' caught in the wild. For pets not in the player's possession, true if the pet ''can'' be caught in the wild.
  +
|-
 
|15||canBattle||Boolean||True if this pet can be used in battles, false otherwise.
  +
|-
 
|16||tradable||Boolean||True if this pet can be traded, false otherwise.
  +
|-
 
|17||unique||Boolean||True if this pet is unique, false otherwise.
  +
|-
  +
|18||obtainable||Boolean||True if this pet can be obtained, false otherwise (only false for tamer pets and developer/test pets).
  +
|-
  +
|}
  +
  +
== Details ==
  +
* Information about the player's battle pets is available after {{api|t=e|UPDATE_SUMMONPETS_ACTION}} has fired.
   
 
== Patch history ==
 
== Patch history ==
{{Patch 5.1.0|note=Added isFavorite return value.}}
+
* {{Patch 5.2.0|note=Added 18th return value, "obtainable".}}
{{Patch 5.0.4|note=Added.}}
+
* {{Patch 5.1.0|note=Added isFavorite return value.}}
  +
* {{Patch 5.0.4|note=Added.}}
   
== See Also ==
+
== See also ==
* {{api|C_PetJournal.GetSummonedPetGUID}}
+
* {{api|C_PetJournal.GetPetStats}}
  +
* {{api|C_PetJournal.GetPetInfoBySpeciesID}}

Revision as of 10:06, 9 September 2021

Returns information about a battle pet.

speciesID, customName, level, xp, maxXp, displayID, isFavorite, name, icon, petType, creatureID, sourceText, description, isWild, canBattle, tradable, unique, obtainable = C_PetJournal.GetPetInfoByPetID("petID")

Arguments

petID
string : GUID

Returns

Index Value Type Details
1 speciesID Number Identifier for the pet species
2 customName String Name assigned by the player or nil if unnamed
3 level Number The pet's current battle level
4 xp Number The pet's current xp
5 maxXp Number The pet's maximum xp
6 displayID Number The display ID of the pet
7 isFavorite Boolean Whether the pet is marked as a favorite
8 name String Name of the pet species ("Albino Snake", "Blue Mini Jouster", etc.)
9 icon String Full path for the species' icon
10 petType Number Index of the species' pet type
11 creatureID Number NPC ID for the summoned companion pet
12 sourceText String Section of the tooltip that provides location information
13 description String Section of the tooltip that provides pet description ("flavor text")
14 isWild Boolean For pets in the player's possession, true if the pet was caught in the wild. For pets not in the player's possession, true if the pet can be caught in the wild.
15 canBattle Boolean True if this pet can be used in battles, false otherwise.
16 tradable Boolean True if this pet can be traded, false otherwise.
17 unique Boolean True if this pet is unique, false otherwise.
18 obtainable Boolean True if this pet can be obtained, false otherwise (only false for tamer pets and developer/test pets).

Details

Patch history

See also