Shield Block User Rule exposes some slight weirdness.
arcadepro opened this issue ยท 3 comments
return Configure {
"Shield Block",
L['Easy mode Shield Block.'],
2565, -- Shield Block
"player",
{ "UNIT_POWER_FREQUENT", "UNIT_AURA", "SPELL_UPDATE_CHARGES" },
function(_, model)
local rage = UnitPower("player")
local blockcharges = GetSpellCharges(2565) -- Shield Block Spell
local blocking = GetPlayerBuff("player", 132404) -- Shield Block Aura
local spellcost = 60
if blockcharges > 0 and not blocking and rage > spellcost then
model.highlight = "flash"
end
end,
2565, -- Shield Block (Protection only)
}
i) This rule works as expected only if 'No Flash on Cooldown' is disabled in the global options.
If 'No Flash on Cooldown' is enabled then the flash wont occur because the spell is 'on cooldown' despite having charges to spend.
This does make sense because when the spell is on cooldown it IS on cooldown, but equally the spell can still be used. Maybe we should check for IsUsableSpell instead? I found it a bit ambiguous depending on your viewpoint. A minor quibble I guess.
ii) Only seen with OmniCC thus far. Sometimes the spell charges are drawn behind the spiral overlay model when using this rule. It's probably more of an omnicc issue but I thought I'd mention it.
I don't think IsUsableSpell would be useful in that case. However, I think the flash should be shown when charges are available. I'll try to change that.
Testing Monks' Roll: GetSpellCooldown does not indicate any cooldown until all charges have been expanded, so it would behave correctly.
What return GetSpellCooldown and GetSpellCharges return for Shield Block depending on the number of charges ? (use /run print(GetSpellCooldown(2565)); print(GetSpellCharges(2565))
)
/dump GetSpellCooldown(2565)
arg[2] returns 0 with two charges remaining
arg[2] returns 0 or 1.5(gcd) with one charge remaining.
arg[2] returns 12 with no charges remaining.
/dump GetSpellCharges(2565)
arg[1] returns the charges remaining; correctly
arg[2] returns 2 (max charges, unchanging)
arg[3] returns the time of cast
arg[4] returns 12 (cooldown per charge, unchanging)