Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hammer of Wrath usable during Ashen Hallow #771

Closed
Hemario opened this issue Dec 24, 2020 · 4 comments · Fixed by #865
Closed

Hammer of Wrath usable during Ashen Hallow #771

Hemario opened this issue Dec 24, 2020 · 4 comments · Fixed by #865
Labels

Comments

@Hemario
Copy link
Contributor

Hemario commented Dec 24, 2020

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
@johnnylam88
Copy link
Contributor

johnnylam88 commented Dec 25, 2020

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.

@johnnylam88
Copy link
Contributor

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

@Hemario
Copy link
Contributor Author

Hemario commented Dec 29, 2020

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)))

@johnnylam88
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants