Thread Tools Display Modes
06-03-19, 07:49 PM   #1
aallkkaa
A Warpwood Thunder Caller
 
aallkkaa's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2017
Posts: 98
GetSpellTabInfo() for Pet Spells ?

Hello,

I'd like to use something like GetSpellTabInfo() ( or GetFlyoutInfo() ) to get the number of Pet spells in its spellbook. But there seems to be no function to that effect.
Is there?

More details:
I am currently doing something in the likes of:
Code:
repeat
  -- ...
until (GetSpellBookItemName(i, BOOKTYPE_PET)) == nil
. It does work, but, as I learned from trying to fetch Rogue Poisons (flyout), some spell slots may "contain" an empty spell (SpellName == nil). In that case, the following solved it:
Code:
for flyoutSlot = 1, select(3, GetFlyoutInfo(flyoutButtonID)) do
  -- ...
end
It would be useful to me to get all of a given Pet spells, even if it is still too low level to have learned them all yet (as I can with Player spells, including Flyouts).
  Reply With Quote
10-11-19, 12:20 PM   #2
LBXZero
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 61
Are you still working on this problem? I recently did some work modifying the spellbook for WoW Classic, and I may be able to help given the experimentation I did.

Last edited by LBXZero : 10-11-19 at 12:23 PM.
  Reply With Quote
01-01-20, 04:37 PM   #3
aallkkaa
A Warpwood Thunder Caller
 
aallkkaa's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2017
Posts: 98
Originally Posted by LBXZero View Post
Are you still working on this problem? I recently did some work modifying the spellbook for WoW Classic, and I may be able to help given the experimentation I did.
Thanks a lot for your reply and your kind offer - and I apologize for taking so long in getting back to you (I had not noticed your reply).
I haven't been working on it, but I do still have the problem. I go around it by creating high level Trial Characters (which eventyally expire) and getting the data from them (sometimes after I've done some leveling on them to get the spells). It's time consuming but it's how I've been doing it.

I am currently only working on Live (and occasionaly PTR) and I may not even need to work on it for Classic (I released LibSpellName2SID as a replacement to the abandoned LibBabble-SpellNames - tjhe oldest release in that lib's official repository is from the TBC expansion (or is it WoTLK?), but I found a version from Vanilla somewhere else (I haven't tested it yet and I'm not even sure where it's been legally hosted, so... But hopefully I'll be able to use that when the time comes).
So, as to the problem above, I'd gretaly apreciate your thoughts.

The context for the coding is in an addon that isn't published as such, but rather part of the LibSpellName2SID project. It can be downloaded from:
http://svn.wowinterface.com/listing....pulator_trunk_
(you can check the branches too, if you're so inclined; that's where I keep the work for the next version).

Thanks in advance!
  Reply With Quote
01-02-20, 09:17 AM   #4
LBXZero
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 61
I worked through the SpellbookFrame.lua file. The function "HasPetSpells()" returns number of pet spells.

https://wow.gamepedia.com/API_HasPetSpells

I haven't used libraries for anything, yet.
  Reply With Quote
01-03-20, 12:44 AM   #5
aallkkaa
A Warpwood Thunder Caller
 
aallkkaa's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2017
Posts: 98
Thanks a lot! I actually remember using tht function in my addon. How did I miss that? LOL
I'll have a look into it.
Thanks again!
  Reply With Quote
01-03-20, 04:59 AM   #6
LBXZero
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 61
Originally Posted by aallkkaa View Post
Thanks a lot! I actually remember using tht function in my addon. How did I miss that? LOL
I'll have a look into it.
Thanks again!
If you want a little fun detail in regards to pet spells, pet spells' spell ID can be used with "cast by spellID" functions. The spell IDs are 32bit integers, and pet spells carry flag bits in the greatest 8 bits. Filter off the greatest 8 bits, and you have a functional spell ID.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » GetSpellTabInfo() for Pet Spells ?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off