AdiButtonAuras

AdiButtonAuras

404k Downloads

PET INVERT_AURA

Rainrider opened this issue ยท 11 comments

commented

This issue would be probably a mess as I'm not sure where to report and if I understand the internals of AdiButtonAuras (ABA) and LibPlayerSpells (LPS). As I test what I try to add to LPS through ABA I figured I'd post here.

Enslave Demon and Control Undead place a debuff on the controlled unit, so I suppose the right flags for both of them are PET and INVERT_AURA. Tested this on a Deathknight, because ABA seems to use LPS for that class but has it's own rules for Warlock. The result is no rule for Control Undead added. In ABA in the rule set for Warlock, Enslave Demon is listed under PetBuffs, which is wrong as it would query UnitAura with "HELPFUL PLAYER" set as filter and this won't get the debuff (that is an assumption, I didn't follow the code all the way through). There is no PetDebuffs category though. Btw Health Funnel is also listed there, but does not work either, so it might be a problem in PetBuffs implementation. The Hunter rule set in ABA uses LPS and Mend Pet works as intended there.

Is the intent behind LPS (with ABA) to be able to guess rules from it but for ABA not to be explicitly dependable on it? It seems a bit like a double effort, as the rule set for i.e. warlock in ABA and the data set in LPS are for the bigger part identical in their meaning.

commented

Well, ABA uses LPS for simple spells, like Serpent Sting putting a Serpent Sting debuff on the target, that is enabled when Serpent Sting is found in player spellbook and when all Serpent Sting debuff information (duration, stack count and highlight) should be shown. ABA should only contain rules which cannot be represented by the LPS simple model, either because they have conditions not pertaining to auras (e.g. health or ressource specific conditions) or because not all information are needed (e.g. display the number of stacks but not the duration).

Originally, ABA had its own rules but as I was adding (parts of) the same data in oUF_Adirelle and AdiSpellHud, I felt that gathering these data to a central place would be needed. So I have moved most of the simple rules from ABA to LPS, benefiting AdiSpellHUD and oUF_Adirelle as a side effect. It is possible that there are some leftovers in ABA rules though.

For that issue, the ABA function which creates rules from LPS (ImportPlayerSpells in RuleDSL.lua) doesn't properly uses INVERT_AURA right now. I'll fix it ASAP.

commented

This still does not add a rule for Control Undead

Here is my WIP on deathknight data for LPS in case I'm doing something wrong

local lib = LibStub("LibPlayerSpells-1.0")
if not lib then return end
lib:__RegisterSpells("DEATHKNIGHT", "50400", 1, {
    COOLDOWN = {
        61999, -- Raise Ally
        INTERRUPT = {
            47528, -- Mind Freeze
            91802, -- Shambling Rush (Ghoul)
            [47476] = "HARMFUL AURA", -- Strangulate
        },
        AURA = {
            HELPFUL = {

            },
            PERSONAL = {
                49039, -- Lichborne
                SURVIVAL = {
                     48707, -- Anti-Magic Shell
                     48792, -- Icebound Fortitude
                     49028, -- Dancing Rune Weapon
                     49222, -- Bone Shield
                     55233, -- Vampiric Blood
                    113072, -- Might of Ursoc (Symbiosis)
                },
                BURST = {

                },
            },
        },
    },
    AURA = {
        PERSONAL = {
                -- 50421, -- Scent of Blood -- NOTE: covered by the default ui
            BURST = {

            },
            IMPORTANT = {

            },
        },
        HELPFUL = {

        },
        HARMFUL = {
            55095, -- Frost Fever
            55078, -- Blood Plague
            43265, -- Death and Decay
            45524, -- Chains of Ice
            3714, -- Path of Frost
            -- 73975, -- Necrotic Strike -- NOTE: added twice through something else, maybe as Slow Casting debuff category and Heal Absorb category
            77606, -- Dark Simulacrum
        },
    },
    RAIDBUFF = {
        [57330] = "ATK_POWER"
    },
    INVERT_AURA = {
        [111673] = "PET", -- Control Undead
    },
    --[45477] = "DISPEL HARMFUL", -- TODO: this needs ABA rule to detect the Glyph of Icy Touch
}, {
    -- Map aura to provider
    [55095] = 45477, -- Frost Fever <= Icy Touch
    [55078] = 45462, -- Blood Plague <= Plague Strike

}, {
    -- Map aura to modified spell(s)
    -- [50421] = {49998} -- Scent of Blood => Death Strike -- NOTE: covered by the default ui
})
commented

ABA tests auras by their spell id, and something the buff id is different from the spell id even though they have the same name. In that case, use the buff id in the first table (where you have "Control Undead" right now) and map it to the spell id in the second map.

About Icy Touch and the Glyph of Icy Touch : sometimes the glyph replaces the spell by another version with the same name and a different spell id. The aura id can be different too. This is handled by the two first maps. If the Glyph added a passive spell in the spellbook (like talents do), you would have to map the buff to the passive in the second map and to map the buff to the modified spell in the third map.

commented

I already checked those.

For Control Undead: spell id 111673, debuff id (on the pet) 111673, caster is the player.
Glyph of Icy Touch apparently applies a spell (see here) where IsPlayerSpell(58631) returns true with the glyph and false otherwise. The spell is not listed in the spell book though. I had [45477] = 58631, -- Icy Touch <= Glyph of Icy Touch in the second table (map aura to provider) but it didn't make any difference - the rule for HARMFUL DISPEL was still shown in ABA's config window regardless of the presence of the glyph.

commented
commented

With what I pr'd to LibDispelable and LibSpellbook for the bigger part yes. Only thing that remains is not to add the rule for the offensive dispel through Icy Touch, when the glyph is unknown. The "aura to provider" thing does not even get checked for. That's not major though, because LibDispelable takes care about it.

commented

IMHO, drop the data in LPS and let LibDispelable handle it.

commented

You're right. Now that I remember it, ABA combines LPS and LibDispelable, e.g. it uses LPS to check of spells tagged as "DISPEL" and uses LD to do the actual aura test.

For rule evaluations, the applicability of each rule is re-evaluated each time LibSpellbook detects a change in the spellbook (which should be less often than SPELLS_CHANGED). If the provider and/or the modified spell of a rule does not exist, the rule is disabled.

commented

If I drop [45477] = "DISPEL HARMFUL" from LPS it won't add a rule for it. The aura to provider mapping is currently redundant there. I still don't know when the rules are generated and if they are refreshed at SPELLS_CHANGED or just the handlers. If they are refreshed, which makes sense, because you have to check for learnt providers, then it could be a small advantage to query LibDispelable only in the case when the player has learnt the provider spell. Just a wild guess though, maybe not worth the effort. Functionality wise all issues mentioned here, apart from Health Funnel, should be now resolved.

Edit: And Enslave Demon has to be removed from ABA and added through LPS.

commented

Enslave Demon works as intended.

Health Funnel is still broken (can be partially fixed by removing it's entry from the cooldown list in LPS, but then no support for the glyphed version). I wanted to take a look there as Health Funnel was added through the PetBuffs rule and wasn't working, so it is either a bug in the rule or something else. That would be the only reason not to close the ticket.

commented

I noticed yesterday that LPS data weren't used at all by the Warlock rules, which could explain the issue with Enslave Demon. Does Adirelle@457aa0b fix the issue ?