AdiButtonAuras

AdiButtonAuras

404k Downloads

User rules Question for Feral Druid

craglin opened this issue ยท 1 comments

commented

I'm a bit new to user rules. I'm trying to set up a custom user rule for Bloodtalons on Feral Druid where it will highlight the spells for Ferocious Bite and Rip if and only if the Bloodtalons aura is found AND the player has five combo points. I have tried using both the PassiveModifier and ShowPower functions in an attempt to override one with the other, but all it's done is left my icons with the hint effect. I'm not sure how to implement a conditional, so any help would be greatly appreciated.

I've included by code below for reference.

return {
    PassiveModifier {
        319439, -- Bloodtalons (Feral)
        {
            1079, -- Rip (Feral)
            22568, -- Ferocious Bite (Feral)
        },
        145152, -- Bloodtalons (Feral)
        nil,
        "flash",
    },

    ShowPower {
        {
            1079, -- Rip (Feral)
            22568, -- Ferocious Bite (Feral)
        },
        "ComboPoints",
        -4,
        nil,          
    }
}
commented

You need a Configure rule for that:

return Configure {
    'BloodTalonsWith5Combos',
    'Flash Rip and Ferocious Bite when Blood Talons with 5 combos.'
    {
         1079, -- Rip (Feral)
        22568, -- Ferocious Bite (Feral)
    },
    'player',
    {
        'UNIT_AURA',
        'UNIT_POWER_CHANGE'
    },
    function(_, model)
        local combos = UnitPower('player', 4)
        local found, count, expiration = GetPlayerBuff('player', 145152) -- Bloodtalons

        if combos > 4 and found then
            model.flash = true
            -- uncomment the following if you need this info as well
            -- model.expiration = expiration
            -- model.count = count
        end
    end,
    319439, -- Bloodtalons (Feral talent)
}

This is dry-coded, I haven't tested it in-game. It also might "collide" with other rules displayed on Rip/Ferocious Bite (generally the last rule evaluated wins the display and you don't really have control on precedence unless you turn other rules off)