Ovale Spell Priority

Ovale Spell Priority

6M Downloads

Hammer of Wrath usable during Ashen Hallow

Hemario opened this issue ยท 4 comments

commented

Hammer of Wrath is usable during Ashen Hallow. However there is not buff, debuff or totem aura present when Ashen Hallow is up.
Therefore we cannot use any of this information in the SpellRequire function.
The only way we could even get this working is by checking the Spell Activation overlay of the spell (the glow border of the spell on the action bar)

This is relevant WeakAuras code how they handle watching for spell activation.

  local spellActivationSpells = {};
  local spellActivationSpellsCurrent = {};
  local spellActivationFrame;
  local function InitSpellActivation()
    spellActivationFrame = CreateFrame("FRAME");
    WeakAuras.frames["Spell Activation"] = spellActivationFrame;
    spellActivationFrame:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_SHOW");
    spellActivationFrame:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_HIDE");
    spellActivationFrame:SetScript("OnEvent", function(self, event, spell)
      Private.StartProfileSystem("generictrigger");
      local spellName = GetSpellInfo(spell)
      if (spellActivationSpells[spell] or spellActivationSpells[spellName]) then
        local active = (event == "SPELL_ACTIVATION_OVERLAY_GLOW_SHOW")
        spellActivationSpellsCurrent[spell] = active
        spellActivationSpellsCurrent[spellName] = active
        if not WeakAuras.IsPaused() then
          WeakAuras.ScanEvents("WA_UPDATE_OVERLAY_GLOW", spell)
        end
      end

      Private.StopProfileSystem("generictrigger");
    end);
  end

  function WeakAuras.WatchSpellActivation(id)
    if (not id) then
      return;
    end
    if (not spellActivationFrame) then
      InitSpellActivation();
    end
    spellActivationSpells[id] = true;
  end

  function WeakAuras.SpellActivationActive(id)
    return spellActivationSpellsCurrent[id];
  end
commented

My quick thoughts on this is that it is easy to add to the Auras module as another trigger event to update a hidden buff, ashen_hallow, that can be checked by the rest of the Ovale. This minimizes changes that need to be made to the rest of the code.

UPDATE: This idea doesn't actually work because spell activations happen for other reasons than whatever buff we're trying to check.

commented

I think spell activations should override the unusable spell property check. The activation events can be registered in the states/Spells.ts module.

commented

I was thinking more in the lines of:
SpellRequire(hammer_of_wrath unusable set=1 enabled=(target.healthpercent() > 20 and (level()<58 or not buffpresent(avenging_wrath))))
into
SpellRequire(hammer_of_wrath unusable set=1 enabled=(target.healthpercent() > 20 and (level()<58 or not buffpresent(avenging_wrath)) and not SpellActivationActive(hammer_of_wrath)))

commented

I don't think that condition is a good idea though. How does someone writing a script know which spells have spell activation? This doesn't seem very future-proof. The way that Blizzard implements spell activation, if a spell is glowing on your action bar, it is always usable, regardless of any other restrictions that may be on the spell's usage in other circumstances. To me, that means that it should just override the unusable property or do something else internal to Ovale (perhaps adjusting return value of IsUsable()) to make sure that the spell can be suggested. Doing it this way allows for scripts to be unchanged even if Blizzard adds new spell interactions or mechanics into the game.