WoWInterface (
-   Lua/XML Help (
-   -   Survival of the Fittest (

doofus 12-20-20 02:50 AM

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 ?

LudiusMaximus 12-20-20 05:41 AM

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

Seerah 12-20-20 01:09 PM

Perhaps it also checks to see if you actually have a pet summoned.

All times are GMT -6. The time now is 06:51 AM.

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