Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. function()
  2. -- colors
  3. local col = {["red"] = "ff0000", ["yellow"] = "ffff00", ["green"] = "00ff00"}
  4. -- options display
  5. if WeakAuras.IsOptionsOpen() then return "|cff"..col.yellow.."3".."|r" end
  6. -- string to append and return
  7. local str = ""
  8. -- color for string
  9. local str_col = ""
  10. -- number of atonements
  11. local atonement_count = GetSpellCount(200829)
  12. -- abort if there is no atoned players
  13. --if atonement_count == 0 then return end
  14. -- group size
  15. local group_size = GetNumGroupMembers()
  16. -- raid or party?
  17. local group_type = IsInRaid() and "raid" or "party"
  18. -- count members who meet threshold
  19. local passed = 0
  20. -- get versatility for heals
  21. local vers = 1 + GetCombatRatingBonus(29) / 100
  22. -- get mastery
  23. local mastery = 1 + GetMasteryEffect() / 100
  24. -- get atonement transfer
  25. local atonement_heal = ((mastery * 40) / 100)
  26. -- Check artifact for sins of the many and 35+ traits
  27. local hasSins = false
  28. local paragon = 1
  29. local loaded = IsAddOnLoaded("LibArtifactData-1.0") or LoadAddOn("LibArtifactData-1.0")
  30. if loaded then
  31. aura_env.LAD = aura_env.LAD or LibStub("LibArtifactData-1.0")
  32. if not aura_env.LAD:GetActiveArtifactID() then
  33. aura_env.LAD:ForceUpdate()
  34. end
  35. local _, traits = aura_env.LAD:GetArtifactTraits()
  36. if traits then
  37. for _,v in ipairs(traits) do
  38. if v.spellID == 198074 then
  39. hasSins = true
  40. elseif v.spellID == 214925 then
  41. if v.currentRank > 0 then
  42. paragon = 1 + (((v.currentRank - 1) * 0.005) + 0.05)
  43. end
  44. end
  45. end
  46. end
  47. end
  48. -- sins of the many
  49. local sins = hasSins and 1 + (atonement_count / 100) or 1
  50. -- twist of fate
  51. local tof = UnitBuff("player", GetSpellInfo(109142)) and 1.2 or 1
  52. -- get smite heal from atonement
  53. local smite_heal = GetSpellBonusDamage(7) * 2.25 * 2 * vers * atonement_heal * 1.15 * tof * sins * paragon
  54. -- loop through party
  55. for i = 1, group_size do
  56. -- get unit id etc "raid2"
  57. local unit_id = group_type .. i
  58. if UnitBuff(unit_id, GetSpellInfo(81749), nil, "PLAYER") then
  59. -- get unit health defecit
  60. local health_defecit = UnitHealthMax(unit_id) - UnitHealth(unit_id)
  61. -- check if unit's hp is under or equal to a critical smite heal
  62. if health_defecit >= smite_heal then
  63. -- unit passed, add one to the passed variable
  64. passed = passed + 1
  65. end
  66. end
  67. end
  68. -- get percent of atoned targets under the threshold
  69. local passed_over_atonement = passed / (atonement_count > 0 and atonement_count or 1)
  70. -- check if count is over thresh
  71. if atonement_count == 0 then
  72. str_col = col.red
  73. elseif passed_over_atonement >= aura_env.options.green then
  74. str_col = col.green
  75. elseif passed_over_atonement < aura_env.options.green and passed_over_atonement >= aura_env.options.yellow then
  76. str_col = col.yellow
  77. else
  78. str_col = col.red
  79. end
  80. -- return string with color
  81. return "|cff"..str_col..atonement_count.."|r"
  82. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement