I'm working on a custom show/hide trigger in WA for Sacred Shield, but I'm encountering 2 issues with the code as I have it now.
Code:
function() local name,_,_,_,_,_,expires = UnitBuff("player", "Sacred Shield",nil,"PLAYER")
if name and (expires - GetTime()) > 9 then
return false
end
return true
end
This normally works flawlessly, but I've noticed a 1-2 second delay from when it *should* proc, to when it does proc (hence why it's at ">9"). The other issue is that if my primary sacred shield buff (ie 30s duration) falls off, but the other sacred shield remains, it then takes priority on all recasts until such a time where it's broken and the first one takes priority again. For Raids this isn't an issue, but for CMs/Heroics/Old Content, it's pretty common for me to not take enough damage to break a Sacred Shield. With that being said here are the questions...
1. Is there a way to fix the trigger to operate off of SpellID instead of the buff name?
2. is there a way to reduce the time between when it should trigger and when it actually does?