SpellActivationOverlay

SpellActivationOverlay

3M Downloads

Predatory Strikes

ennvina opened this issue · 5 comments

commented

Predatory Strikes did not have an alert in Cataclysm.
In Mists of Pandaria, Blizzard replaced Predatory Strikes with Predatory Swiftness (which are very similar) and added an alert for Predatory Swiftness.
It would totally make sense to re-use MoP's Predatory Swiftness texture for WotLK's Predatory Strikes alert.

Texture preview https://wow.tools/casc/preview/chash?buildconfig=806f4fd265de05a9b328310fcc42eed0&cdnconfig=b225a5d105393ef582066157f7dd34fc&filename=textures%2Fspellactivationoverlays%2Fpredatory_swiftness.blp&contenthash=d21ba74189f02a559c6dad04536ddeb5

Download link https://wow.tools/casc/file/chash?contenthash=d21ba74189f02a559c6dad04536ddeb5&filedataid=898423&buildconfig=806f4fd265de05a9b328310fcc42eed0&cdnconfig=b225a5d105393ef582066157f7dd34fc&filename=predatory_swiftness.blp

commented

The buff to track is most likely Predator's Swiftness (beware of the name) https://www.wowhead.com/wotlk/spell=69369/predators-swiftness

commented

Because Wrath version of the talent requires to lose Bear/Cat form, it’s much less appealing than its MoP counterpart.

In the meantime, these steps can allow you to use it on your side:

Download this file https://wow.tools/casc/file/chash?contenthash=d21ba74189f02a559c6dad04536ddeb5&filedataid=898423&buildconfig=806f4fd265de05a9b328310fcc42eed0&cdnconfig=b225a5d105393ef582066157f7dd34fc&filename=predatory_swiftness.blp

Copy the file to your textures folder of SpellActivationOverlay.

Edit druid.lua (located in the classes folder of SpellActivationOverlay) and add this line right after local function registerClass(self)

    self:RegisterAura("predatory_strikes", 0, 69369, "predatory_swiftness", "Top", 0.5, 255, 255, 255, false);

If done correctly, the function should look something like:

local function registerClass(self)
    self:RegisterAura("predatory_strikes", 0, 69369, "predatory_swiftness", "Top", 0.5, 255, 255, 255, false);

    -- Track Eclipses with a custom CLEU function, so that eclipses can coexist with Omen of Clarity
    -- self:RegisterAura("eclipse_lunar", 0, lunarSpellID, "eclipse_moon", "Left", 1, 255, 255, 255, true);
    -- self:RegisterAura("eclipse_solar", 0, solarSpellID, "eclipse_sun", "Right (Flipped)", 1, 255, 255, 255, true);

The addon must be re-loaded, either with a Reload UI, or by logging out your druid and logging back in.

commented

For people interested in glowing buttons for specific spells while under the effect of Predator's Swiftness, you can use the following code in druid.lua (located in the classes folder of SpellActivationOverlay) and add the following lines :

local predatorSpellID = 69369;
local predatorCache = false;
local glowingHealing = false;

local function hasPredatorSwiftness(self)
	return self:FindPlayerAuraByID(predatorSpellID) ~= nil;
end

You also need to modify the updateGABs method :

local function updateGABs(self)
    if (lunarCache ~= glowingStarfire) then
        local starfireSpellID = 2912;
        if (lunarCache) then
            self:AddGlow(starfireSpellID, { (GetSpellInfo(starfireSpellID)) });
            glowingStarfire = true;
        else
            self:RemoveGlow(starfireSpellID);
            glowingStarfire = false;
        end
    end

    if (solarCache ~= glowingWrath) then
        local wrathSpellID = 5176;
        if (solarCache) then
            self:AddGlow(wrathSpellID, { (GetSpellInfo(wrathSpellID)) });
            glowingWrath = true;
        else
            self:RemoveGlow(wrathSpellID);
            glowingWrath = false;
        end
    end
	
	if (predatorCache ~= glowingHealing) then 
		local healingTouch = 26979;
		if (predatorCache) then
			self:AddGlow(healingTouch, { (GetSpellInfo(healingTouch)) });
			glowingHealing = true;
		else
			self:RemoveGlow(healingTouch);
			glowingHealing = false;
		end
	end
end

In the customLoad method you also need to add that line : predatorCache = hasPredatorSwiftness(self);

You also need to update the customCLEU method :

local function customCLEU(self, ...)
    local timestamp, event, _, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags = CombatLogGetCurrentEventInfo() -- For all events

    -- Accept only certain events, and only when done by the player
    if (event ~= "SPELL_AURA_APPLIED" and event ~= "SPELL_AURA_REMOVED") then return end
    if (sourceGUID ~= UnitGUID("player")) then return end

    local spellID, spellName, spellSchool = select(12, CombatLogGetCurrentEventInfo()) -- For SPELL_*

    if (event == "SPELL_AURA_APPLIED") then
        if (spellID == omenSpellID) then
            clarityCache = true;
            updateSAOs(self);
        elseif (spellID == lunarSpellID) then
            lunarCache = true;
            updateSAOs(self);
            updateGABs(self);
        elseif (spellID == solarSpellID) then
            solarCache = true;
            updateSAOs(self);
            updateGABs(self);
		elseif (spellID == predatorSpellID) then
			predatorCache = true;
			updateGABs(self);
		end
        return;
    elseif (event == "SPELL_AURA_REMOVED") then
        if (spellID == omenSpellID) then
            clarityCache = false;
            updateSAOs(self);
        elseif (spellID == lunarSpellID) then
            lunarCache = false;
            updateSAOs(self);
            updateGABs(self);
        elseif (spellID == solarSpellID) then
            solarCache = false;
            updateSAOs(self);
            updateGABs(self);
		elseif (spellID == predatorSpellID) then
			predatorCache = false;
			updateGABs(self);
		end
        return;
    end
end

Finally, you want to modify registerClass :

local function registerClass(self)
    -- Track Eclipses with a custom CLEU function, so that eclipses can coexist with Omen of Clarity
    -- self:RegisterAura("eclipse_lunar", 0, lunarSpellID, "eclipse_moon", "Left", 1, 255, 255, 255, true);
    -- self:RegisterAura("eclipse_solar", 0, solarSpellID, "eclipse_sun", "Right (Flipped)", 1, 255, 255, 255, true);

    -- Track Omen of Clarity with a custom CLEU function, to be able to switch between feral and non-feral texture
    -- self:RegisterAura("omen_of_clarity", 0, 16870, "natures_grace", "Left + Right (Flipped)", 1, 255, 255, 255, true);

    -- Register glow IDs for glowing buttons, namely Starfire and Wrath
    local starfire = GetSpellInfo(2912);
    local wrath = GetSpellInfo(5176);
	local healingTouch = GetSpellInfo(5185);
        self:RegisterGlowIDs({ starfire, wrath, healingTouch });
	self:RegisterAura("predatory_strikes", 0, 69369, "predatory_swiftness", "Top", 0.8, 255, 255, 255, false);
end

These modifications while make your "Healing Touch" button glow while under the effect of Predator's Swiftness while adding the animation posted by @ennvina. If you wish you could also add other spells such as Cyclone or Entangling Roots by doing the same modifications.

In order to apply the above modifications, the addon must be re-loaded, either with a Reload UI, or by logging out your druid and logging back in.

commented

I believe the above effect could be achieved by simply calling these lines inside registerClass:

local healingTouchSpellID = 26979;
local healingTouchSpellName = GetSpellInfo(healingTouch);
local predatorSpellID = 69369;
self:RegisterAura("predatory_strikes", 0, predatorSpellID, "", "", 0, 0, 0, 0, false, { healingTouchSpellName });

This registers an aura, except it turns off the Spell Alert and turns on the Glowing Button(s).

commented

Implemented in #63, but with 100% scale instead of 50% or 80% as mentioned in code samples.