Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function()
- --get total damage taken
- --variables to loop
- local i = 1
- local cur = GetTime()
- local total = 0
- while aura_env.dmgTaken[i] do
- --grab table entries with time and damage
- local time = aura_env.dmgTaken[i][1]
- local dmg = aura_env.dmgTaken[i][2]
- --if the damage happened outside of the timewindow
- if cur > time + aura_env.lastSec then
- --remove the entry
- table.remove(aura_env.dmgTaken, i)
- else --otherwise
- --add up the damage and go to next entry
- total = total + dmg
- i = i + 1
- end
- end
- --Value Based
- local current = UnitHealth("player")
- local max = UnitHealthMax("player")
- aura_env.curHP = current
- aura_env.maxHP = max
- --Versatility Rating
- local vers = 1 + (GetCombatRatingBonus(CR_VERSATILITY_DAMAGE_DONE) + GetVersatilityBonus(CR_VERSATILITY_DAMAGE_DONE))/100
- --Vampiric Blood
- local vamp = WA_GetUnitBuff("player", 55233) and 1.3 or 1
- --Guardian Spirit
- local gs = 1 + (select(16, WA_GetUnitBuff("player", 47788)) or 0) / 100
- --Divine Hymn
- local dh = WA_GetUnitBuff("player", 64844) and 1.1 or 1
- --Hemostasis
- local haemo = 1 + 0.08 * (select(3, WA_GetUnitBuff("player", 273947)) or 0)
- --Skullflower's Haemostasis legendary
- local haemoleg = 1 + 0.2 * (select(3, WA_GetUnitBuff("player", 235559)) or 0)
- --Lana'thel's Lament legendary
- local lana = WA_GetUnitBuff("player", 188290) and IsEquippedItem(133974) and 1.05 or 1
- --Dark Succor, Unholy/Frost
- local succor = WA_GetUnitBuff("player",101568) and (0.1 * aura_env.maxHP) or 0
- local heal = total * aura_env.percDmg --damage taken * DS percentage
- local perc = heal / UnitHealthMax("player") --relative to maxHP
- perc = math.max(aura_env.minHealthPerc, perc) --minimum DS percentage
- perc = perc * vamp * vers * gs * dh * lana * haemo * haemoleg --apply all multipliers except succor
- heal = perc * UnitHealthMax("player") --get the actual heal value
- heal = heal + succor --add succor
- --store the values in aura_env variables to access them from other locations
- aura_env.healing = heal
- --print()
- aura_env.expected = heal
- --print(current)
- --print(aura_env.display)
- return current + aura_env.healing, max, true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement