Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function()
- -- colors
- local col = {["red"] = "ff0000", ["yellow"] = "ffff00", ["green"] = "00ff00"}
- -- options display
- if WeakAuras.IsOptionsOpen() then return "|cff"..col.yellow.."3".."|r" end
- -- string to append and return
- local str = ""
- -- color for string
- local str_col = ""
- -- number of atonements
- local atonement_count = GetSpellCount(200829)
- -- abort if there is no atoned players
- --if atonement_count == 0 then return end
- -- group size
- local group_size = GetNumGroupMembers()
- -- raid or party?
- local group_type = IsInRaid() and "raid" or "party"
- -- count members who meet threshold
- local passed = 0
- -- get versatility for heals
- local vers = 1 + GetCombatRatingBonus(29) / 100
- -- get mastery
- local mastery = 1 + GetMasteryEffect() / 100
- -- get atonement transfer
- local atonement_heal = ((mastery * 40) / 100)
- -- Check artifact for sins of the many and 35+ traits
- local hasSins = false
- local paragon = 1
- local loaded = IsAddOnLoaded("LibArtifactData-1.0") or LoadAddOn("LibArtifactData-1.0")
- if loaded then
- aura_env.LAD = aura_env.LAD or LibStub("LibArtifactData-1.0")
- if not aura_env.LAD:GetActiveArtifactID() then
- aura_env.LAD:ForceUpdate()
- end
- local _, traits = aura_env.LAD:GetArtifactTraits()
- if traits then
- for _,v in ipairs(traits) do
- if v.spellID == 198074 then
- hasSins = true
- elseif v.spellID == 214925 then
- if v.currentRank > 0 then
- paragon = 1 + (((v.currentRank - 1) * 0.005) + 0.05)
- end
- end
- end
- end
- end
- -- sins of the many
- local sins = hasSins and 1 + (atonement_count / 100) or 1
- -- twist of fate
- local tof = UnitBuff("player", GetSpellInfo(109142)) and 1.2 or 1
- -- get smite heal from atonement
- local smite_heal = GetSpellBonusDamage(7) * 2.25 * 2 * vers * atonement_heal * 1.15 * tof * sins * paragon
- -- loop through party
- for i = 1, group_size do
- -- get unit id etc "raid2"
- local unit_id = group_type .. i
- if UnitBuff(unit_id, GetSpellInfo(81749), nil, "PLAYER") then
- -- get unit health defecit
- local health_defecit = UnitHealthMax(unit_id) - UnitHealth(unit_id)
- -- check if unit's hp is under or equal to a critical smite heal
- if health_defecit >= smite_heal then
- -- unit passed, add one to the passed variable
- passed = passed + 1
- end
- end
- end
- -- get percent of atoned targets under the threshold
- local passed_over_atonement = passed / (atonement_count > 0 and atonement_count or 1)
- -- check if count is over thresh
- if atonement_count == 0 then
- str_col = col.red
- elseif passed_over_atonement >= aura_env.options.green then
- str_col = col.green
- elseif passed_over_atonement < aura_env.options.green and passed_over_atonement >= aura_env.options.yellow then
- str_col = col.yellow
- else
- str_col = col.red
- end
- -- return string with color
- return "|cff"..str_col..atonement_count.."|r"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement