WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   GetSpellTabInfo() for Pet Spells ? (https://www.wowinterface.com/forums/showthread.php?t=57182)

aallkkaa 06-03-19 07:49 PM

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).

LBXZero 10-11-19 12:20 PM

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.

aallkkaa 01-01-20 04:37 PM

Quote:

Originally Posted by LBXZero (Post 334218)
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!

LBXZero 01-02-20 09:17 AM

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.

aallkkaa 01-03-20 12:44 AM

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! :cool:

LBXZero 01-03-20 04:59 AM

Quote:

Originally Posted by aallkkaa (Post 334887)
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! :cool:

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.


All times are GMT -6. The time now is 03:16 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI