Quantcast
WoWInterface - View Single Post - Get pet summon spell ID
View Single Post
09-08-21, 10:57 PM   #2
Ketho
A Molten Giant
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 994
Originally Posted by Walkerbo View Post
I want to be able to determine the summon spellID from the petGUID.

I have no idea WHY you want to map from a GUID to a SpellID, like in this thread and the other thread
I did explain how to do that anyway there, by mapping from SummonSpellID to
  1. SpeciesID with BattlePetSpecies.db2
  2. Pet GUIDs with C_PetJournal.GetPetInfoByIndex
Lua Code:
  1. local SpeciesIDtoSummonSpellID = {
  2.     [39] = 4055, -- Mechanical Squirrel
  3.     [40] = 10673, -- Bombay Cat
  4.     [41] = 10674, -- Cornish Rex Cat
  5. }
  6.  
  7. local guids = {}
  8. local _, numOwnedPets = C_PetJournal.GetNumPets()
  9. for i = 1, numOwnedPets do
  10.     local guid, speciesID = C_PetJournal.GetPetInfoByIndex(i)
  11.     guids[guid] = SpeciesIDtoSummonSpellID[speciesID]
  12. end
  13.  
  14. DevTools_Dump(guids)
Code:
["BattlePet-0-00000338F99E"] = 10673,
["BattlePet-0-00000338F9A3"] = 10674,
["BattlePet-0-00000338F94E"] = 4055
But you still didn't explain what you're actually trying to do https://xyproblem.info/

Last edited by Ketho : 09-16-21 at 03:24 AM.
  Reply With Quote