48 lines
1.8 KiB
Lua
48 lines
1.8 KiB
Lua
DISPLAY
|
|
function()
|
|
return ("%.0fk / %.0fk"):format(UnitHealth("player") / 1000, UnitHealthMax("player") / 1000);
|
|
end
|
|
|
|
TRIGGER
|
|
function()
|
|
return true
|
|
end
|
|
|
|
DURATION
|
|
function()
|
|
curHealth = floor((UnitHealth("player")/UnitHealthMax("player"))*100);
|
|
return curHealth,100,true;
|
|
end
|
|
|
|
NAME
|
|
function()
|
|
local p = math.max(0, UnitHealth("player")) / math.max(1, UnitHealthMax("player")) * 100;
|
|
local missing_health = UnitHealthMax("player") - UnitHealth("player")
|
|
local b = UnitBuff("player", "Consecration")
|
|
local b2 = UnitBuff("player", "Avenging Wrath")
|
|
local b3 = UnitBuff("player", "Chain of Thrayn")
|
|
local b4 = UnitBuff("player", "Ilterendi, Crown Jewel of Silvermoon")
|
|
local versa = GetCombatRatingBonus(CR_VERSATILITY_DAMAGE_DONE)
|
|
local hotp_base_heal = 0.3 + (0.36 * 0.3)
|
|
local healing_multiplier = 1 + (versa / 100)
|
|
if b == "Consecration" then
|
|
hotp_base_heal = hotp_base_heal + (0.3 * 0.3)
|
|
end
|
|
if b3 == "Chain of Thrayn" then
|
|
healing_multiplier = healing_multiplier + 0.5
|
|
end
|
|
if b2 == "Avenging Wrath" then
|
|
healing_multiplier = healing_multiplier + 0.35
|
|
end
|
|
if b4 == "Ilterendi, Crown Jewel of Silvermoon" then
|
|
healing_multiplier = healing_multiplier + 0.2
|
|
end
|
|
local absolute_healing_only_hotp = missing_health * hotp_base_heal
|
|
if healing_multiplier > 2 then healing_multiplier = 2 end
|
|
local final_heal_absolute = absolute_healing_only_hotp * healing_multiplier
|
|
local final_heal_relative = math.floor((final_heal_absolute / UnitHealthMax("player"))*100)
|
|
local heal_percentage = math.floor((final_heal_absolute / missing_health) * 100)
|
|
--print(heal_percentage)
|
|
local new = p + final_heal_relative
|
|
return string.format("%.f", p) .. " " .. string.format("%.f", new) .. " " .. string.format("+%.f", final_heal_relative)
|
|
end |