Quantcast
Survival of the Fittest - WoWInterface
Thread Tools Display Modes
12-20-20, 02:50 AM   #1
doofus
A Flamescale Wyrmkin
Join Date: Feb 2018
Posts: 148
Survival of the Fittest

I use the function IsUsableSpell() and GetSpellCooldown() to examine whether/when "Survival of the Fittest" becomes available.

This spell is only available if there is a Tenacity pet out.

If I am freshy logged in and there is no pet, or if I am freshly logged in with a non-tenacity pet, both the above functions return the true state of the spell, ie not available.

Once I summon a tenacity pet however, both the above functions behave as if the spell is available, regardless if the pet has been dismissed, or the pet is now a non-tenacity one.

The WoW client however correctly highlights the spell, so it knows. How does it do it ?
  Reply With Quote
12-20-20, 05:41 AM   #2
LudiusMaximus
A Frostmaul Preserver
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 256
That's really strange. It makes you wonder what IsUsableSpell() is good for regarding pet abilities.

A workaround could be this:

Lua Code:
  1. local _, id = GetSpellBookItemName(14, BOOKTYPE_PET)
  2. if id == 264735 then
  3.   -- Survival of the fittest is available.
  4. end
__________________
~ Be the change you want to see in the world... of warcraft interface! ~
  Reply With Quote
12-20-20, 01:09 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,796
Perhaps it also checks to see if you actually have a pet summoned.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Survival of the Fittest

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