IsUsableSpell("Spirit Mend");
is useless
as is
playerSpellST, playerSpellDuration, playerSpellEnabled = GetSpellCooldown("Spirit Mend");
both return "true" (or the equivalent), with or without a pet active, let alone an exotic pet.
The UI knows if the spell is active, of course, but how to get to it?
We can look at the actionbar, which is what I do, but there must be a better way?
Edit:
same for Mend Pet...
Edit:
I have now found a solution
local _,_,_,_,_,_,lSpiritMendID = GetSpellInfo("Spirit Mend");
local lSpiritMendKnown = lSpiritMendID and IsSpellKnown(lSpiritMendID,true);
playerSpellST, playerSpellDuration, playerSpellEnabled = GetSpellCooldown("Spirit Mend");
local playerSpellSpiritMendCD = lIsPetAlive and lSpiritMendKnown and playerSpellST and ( playerSpellST + playerSpellDuration - timeNow ) or 9999;
|