1. #1

    GetUnitDebuff changes

    So apparently blizz changed how GetUnitBuff, GetUnitDebuff, and GetUnitAuras work, and it broke one of my favourite weak auras.

    This is how part of it looked before
    Code:
    function()
        local name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId 
        = UnitDebuff("target", "Moonfire", nil, "PLAYER")
        if duration ~= nil then 
            return true
        else return false
        end
        
    end
    WeakAuras posted on twitter:
    Code:
    For our custom coders: Blizzard changed UnitAura/Buff/Debuff in 8.0 to no longer work off names, we added a few helper functions to ease the pain: 
    
    Usage: WA_GetUnitAura("player", spellName | spellID, filter)
    There are: 
    WA_GetUnitAura
    WA_GetUnitBuff 
    WA_GetUnitDebuff
    but I'm not sure how to go about fixing mine, I tried all kind of combinations changing the "UnitDebuff("target", "Moonfire", nil, "PLAYER")" to "WA_GetUnitDebuff("target" Moonfire, player)" and can't seem to get it working.

    Any tips?

  2. #2
    WA_GetUnitDebuff("target", "Moonfire", "PLAYER") should be working... Also not sure about return values, may be WA_GetUnitDebuff has different return values compared to UnitDebuff?

    Also your return values are wrong, "rank" seems to be removed in BFA.

    You can also change original code to use spellid instead of spell name and get benefits of it working across different locales.
    Hardcoding spell names is bad.
    Last edited by TOM_RUS; 2018-07-19 at 02:22 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •