Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. function()
  2.  
  3. --get total damage taken
  4. --variables to loop
  5. local i = 1
  6. local cur = GetTime()
  7. local total = 0
  8. while aura_env.dmgTaken[i] do
  9. --grab table entries with time and damage
  10. local time = aura_env.dmgTaken[i][1]
  11. local dmg = aura_env.dmgTaken[i][2]
  12.  
  13. --if the damage happened outside of the timewindow
  14. if cur > time + aura_env.lastSec then
  15. --remove the entry
  16. table.remove(aura_env.dmgTaken, i)
  17. else --otherwise
  18. --add up the damage and go to next entry
  19. total = total + dmg
  20. i = i + 1
  21. end
  22. end
  23.  
  24. --Value Based
  25. local current = UnitHealth("player")
  26. local max = UnitHealthMax("player")
  27.  
  28. aura_env.curHP = current
  29. aura_env.maxHP = max
  30.  
  31. --Versatility Rating
  32. local vers = 1 + (GetCombatRatingBonus(CR_VERSATILITY_DAMAGE_DONE) + GetVersatilityBonus(CR_VERSATILITY_DAMAGE_DONE))/100
  33.  
  34. --Vampiric Blood
  35. local vamp = WA_GetUnitBuff("player", 55233) and 1.3 or 1
  36.  
  37. --Guardian Spirit
  38. local gs = 1 + (select(16, WA_GetUnitBuff("player", 47788)) or 0) / 100
  39.  
  40. --Divine Hymn
  41. local dh = WA_GetUnitBuff("player", 64844) and 1.1 or 1
  42.  
  43. --Hemostasis
  44. local haemo = 1 + 0.08 * (select(3, WA_GetUnitBuff("player", 273947)) or 0)
  45. --Skullflower's Haemostasis legendary
  46. local haemoleg = 1 + 0.2 * (select(3, WA_GetUnitBuff("player", 235559)) or 0)
  47.  
  48. --Lana'thel's Lament legendary
  49. local lana = WA_GetUnitBuff("player", 188290) and IsEquippedItem(133974) and 1.05 or 1
  50.  
  51. --Dark Succor, Unholy/Frost
  52. local succor = WA_GetUnitBuff("player",101568) and (0.1 * aura_env.maxHP) or 0
  53.  
  54.  
  55.  
  56. local heal = total * aura_env.percDmg --damage taken * DS percentage
  57. local perc = heal / UnitHealthMax("player") --relative to maxHP
  58. perc = math.max(aura_env.minHealthPerc, perc) --minimum DS percentage
  59. perc = perc * vamp * vers * gs * dh * lana * haemo * haemoleg --apply all multipliers except succor
  60. heal = perc * UnitHealthMax("player") --get the actual heal value
  61. heal = heal + succor --add succor
  62.  
  63. --store the values in aura_env variables to access them from other locations
  64. aura_env.healing = heal
  65.  
  66.  
  67. --print()
  68. aura_env.expected = heal
  69. --print(current)
  70. --print(aura_env.display)
  71.  
  72. return current + aura_env.healing, max, true
  73.  
  74. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement