getting name or spellid for buffs/debuffs

getting name or spellid for buffs/debuffs

by modernist » Mon Oct 05, 2015 12:38 pm

is this basically impossible? even api like GetPlayerBuffName() doesn't seem to exist in 1.12. i'm looking to match names or ids from a table when UNIT_AURA is called — but there's pretty much bugger all way to do it as I can see.

best alternative i can find is matching based on the icon texture path:

Code: Select all
f:SetScript('OnEvent', function()
    local buffs = {}
    local aura_on
    local j = 0
    for i = 1, 16 do
        local icon = UnitBuff('player', i)
        if icon ~= nil then
            buffs[i] = icon
            j = j + 1
        end
    end
    for i = 1, j do
        local aura_on = string.find(buffs[i], table.iconpath)
        if aura_on ~= nil then
            DEFAULT_CHAT_FRAME:AddMessage'icon match'
        end
    end
end)


but obviously this is a terrible and non-workable method, nobody is gonna know what the texture path for their spell is
modernist
Sergeant Major
Sergeant Major
 

Re: getting name or spellid for buffs/debuffs

by Geigerkind » Mon Oct 05, 2015 1:07 pm

What you could do is to get the buff name by the GameTooltip. After that you just iterate in your own table to find the spellID. But as far as I know there is no way in vanilla to get the SpellId directly
My Addons:
DPSMate - A combat analyzation tool (/viewtopic.php?f=63&t=38042)
Vanilla Consolidated Buff-Frames (/viewtopic.php?f=63&t=18189)
Modified Power Auras (/viewtopic.php?f=63&t=18251)
User avatar
Geigerkind
Senior Sergeant
Senior Sergeant
 

Re: getting name or spellid for buffs/debuffs

by modernist » Mon Oct 05, 2015 4:12 pm

oh that works, neat.

https://github.com/obble/modup/blob/master/spell.lua

this write-up is now actually partially based on your method for PA — i'm having an issue where the event won't actually push until the aura is removed (rather than applied). Any idea if I'm doing something dumb here?
modernist
Sergeant Major
Sergeant Major
 

Re: getting name or spellid for buffs/debuffs

by Geigerkind » Mon Oct 05, 2015 4:23 pm

The UNIT_AURA event is different and weaker as in other expansions. In Wotlk I think all aura based events were merged into UNIT_AURA.
In vanilla you have to use a bunch of events in order to track them properly.
If you are only using it for the player auras PLAYER_AURAS_CHANGED should be fine.
My Addons:
DPSMate - A combat analyzation tool (/viewtopic.php?f=63&t=38042)
Vanilla Consolidated Buff-Frames (/viewtopic.php?f=63&t=18189)
Modified Power Auras (/viewtopic.php?f=63&t=18251)
User avatar
Geigerkind
Senior Sergeant
Senior Sergeant
 

Re: getting name or spellid for buffs/debuffs

by modernist » Mon Oct 05, 2015 4:58 pm

fantastic, thanks
modernist
Sergeant Major
Sergeant Major
 


Return to Addons & macros