View Single Post
04-05-21, 02:32 AM   #10
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 233
Heya Ketho

Thanks for your post I will try and hit all of your points.

I want to play a sound when someone summons a blingtron, this will allow me to know when I can get a free gift, it will also allow me to play a blingtron to fight.

To do this I track the "UNIT_SPELLCAST_SUCCEEDED"
event to identify the different blingtrons by their summonPetSpellID.

When I first started this thread my initial issue was that I could not get pet details of the pet held on my cursor, the documentation indicated that I needed the petID to get pet details using C_PetJournal.GetPetInfoByPetID("petID"), yet there was no way for me to get the petID from the cursor.

This initial issue was solved once I worked out that even though the api documentation said that to get the pet information I had to use the petID, it actually required the petGUID.

Now that I had gotten the pet details I still needed the petSummonSpellID that I could track with "UNIT_SPELLCAST_SUCCEEDED"
event; so my next task was to get the petSummonSpellID.

To this end I tried link, spellID = GetSpellLink(spellID or spellName)

This function returns the link and spellID using either the spellName or the spellID; as my goal was to get the spellID I had to use the spellName, which unfortunately returned nil; since you had the spellID the function would have worked fine returning both the link and spellID.

So you used the summonSpellID which is the one bit of data that I can not seem to get.

I have no idea why using GetSpellLink(spellName) returns nil, and I have no idea as to how I can find the spellID without it.
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote