Help with a weak aura

i’ve taken a weak aura working good with a custom display of

function()
–Following here comes the code, please dont touch this unless you know what you’re doing!

--The following part is just initialise the strings used
local mastery = "Mastery: ".. GetCombatRating(26) .. " ("..string.format("%.2f", GetMasteryEffect()).."%%)"

local haste = "Haste: ".. GetCombatRating(20) .. " ("..string.format("%.2f", GetHaste()).."%%)"

local crit = "Crit: "..GetCombatRating(11).." ("..string.format("%.2f", GetCritChance()).."%%)"

local versatility = "Versatility: "..GetCombatRating(31).." ("..string.format("%.2f", GetCombatRatingBonus(CR_VERSATILITY_DAMAGE_DONE) + GetVersatilityBonus(CR_VERSATILITY_DAMAGE_DONE)).."%%/"..string.format("%.2f", GetCombatRatingBonus(CR_VERSATILITY_DAMAGE_TAKEN) + GetVersatilityBonus(CR_VERSATILITY_DAMAGE_TAKEN)).."%%)"


local intelligence = "Intelligence: " .. UnitStat("player", 4)
local strength = "Strength: " .. UnitStat("player", 1)
local agility = "Agility: " .. UnitStat("player", 2)
local stamina = "Stamina: " .. UnitStat("player", 3)

local id, name, description, icon, background, role, primaryStat = GetSpecializationInfo(GetSpecialization(), false, false, "player", UnitSex("player"))
local returnString = ""
local primaryStat = ""
--[[ Since there was no other way around, I had to manually assign each specification their proper primary Stat. 
             If I made a mistake, or there is a more simple solution, please tell me]]
local intID = {62, 63, 64, 65, 102, 105, 256, 257, 258, 262, 264, 265, 266, 267, 270}
local agiID = {103, 104, 253, 254, 255, 259, 260, 261, 263, 268, 269, 577, 581}
local strID = {66, 70, 71, 72, 73, 250, 251, 252}

local function contains(table, val)
    for i=1,#table do
        if table[i] == val then 
            return true
        end
    end
    return false
end

if contains(intID, id) then primaryStat = primaryStat .. intelligence
elseif contains(agiID, id) then primaryStat = primaryStat .. agility
else primaryStat = primaryStat .. strength end

for i=1,6 do
    if primaryPos==i and showPrimaryStat then returnString = returnString .. primaryStat if i<6 then returnString = returnString .. "\n" end end
    if staminaPos==i and showStamina then returnString = returnString .. stamina if i<6 then returnString = returnString .. "\n" end end
    if masteryPos==i and showMastery then returnString = returnString .. mastery if i<6 then returnString = returnString .. "\n" end end
    if hastePos==i and showHaste then returnString = returnString .. haste if i<6 then returnString = returnString .. "\n" end end
    if critPos==i and showCrit then returnString = returnString .. crit if i<6 then returnString = returnString .. "\n" end end
    if versaPos==i and showVersatility then returnString = returnString .. versatility if i<6 then returnString = returnString .. "\n" end end
    
end 

return returnString

end

and id like to add armor with damage reduction%, parry %, dodge% and speed%.

I can’t find out what to add since i didnt make it myself.

Thanks for help if you can.

Could just use
https://www.curseforge.com/wow/addons/dejacharacterstats

But this is the info you’re after:
https://wow.gamepedia.com/API_GetCombatRating

1 Like