Quantcast
WoWInterface - View Single Post - Getting links for uncollected pets and mounts
View Single Post
06-15-21, 10:16 PM   #3
Walkerbo
A Chromatic Dragonspawn
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 167
Hi Ketho

I am not sure that it makes sense that the petGUID is only known for pets that are currently known as there are examples of being able to get the GUID of mounts even if they are unknown.

For example, I can get the mount link for an uncollected mount using the following chunk;
Lua Code:
  1. local mountIndex = 0
  2. while true do
  3.     mountIndex = mountIndex + 1
  4.     local buttonName = "MountJournalListScrollFrameButton" .. mountIndex
  5.     local button = _G[buttonName]
  6.     if not button then
  7.         break
  8.     end
  9.     button:HookScript(
  10.         "OnClick",
  11.         function(self)
  12.             print("*****************************************************") -- debug --
  13.             mountLink = GetSpellLink(self.spellID)
  14.             print(mountLink)
  15.             print("*****************************************************") -- debug --
  16.         end
  17.     )
  18. end

So I still believe the following should work;
Lua Code:
  1. local speciesId, petGUID = C_PetJournal.FindPetIDByName(speciesName)
but it obviously returns nil for the petGUID.

I had no idea that I could create my own link, so thank you very much for the link.

I have had fun building a few of them though having no way of getting the unknown pet rarity I have to use a fixed colour for the link.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote