#Assigning values to buffs and returning a sum of them

10 messages · Page 1 of 1 (latest)

vast stump
#

New aura: Text

Triggers: Aura -> Player -> Buff -> Name = XYZ -> Show on: Auras Found
times 4, one for each buff
"Required for activation" -> "Any triggers"

Actions: On Init -> custom ->

aura_env.buffValues = {
  23, -- value the buff in trigger 1 should be
  56,
  78,
  99, -- value the buff in trigger 4 should be
}

Display: %c in text -> Text function:

function()
    if aura_env.states then
        local sum = 0
        
        for i = 1, #aura_env.states do
            if aura_env.states[i].show then
                sum = sum + aura_env.buffValues[i]
            end
        end
        
        return sum
    end
end
#

Would be one way to do it.

#

Ideally you'd do it as a TSU anyways instead of a custom text I'd say, since that'd allow you to expose the sum for conditions and do stuff depending on it. Which sounds like something you'd want.

#

But I'm on mobile and it's very late.

vast stump
#

the custom text one I described here, as well as a TSU

vast stump
#

!starterkit

proud hollowBOT
vast stump
#

If you want to get into custom coded WAs, you don't need much knowledge of Lua. It's mostly about knowing the way WA works and the WoW API etc.

#

(and it's always best to know when you do not need code, which is the case for 99% of things you want to do usually)