Add new code snippets

This commit is contained in:
2024-03-03 13:50:12 +01:00
commit 01b612a50b
409 changed files with 65292 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
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

View File

@@ -0,0 +1,76 @@
DISPLAY
function()
return ("%.0fk / %.0fk"):format(UnitHealth("player") / 1000, UnitHealthMax("player") / 1000);
end
TRIGGER
function()
return true
end
DURATION
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.42 * 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 new,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

View File

@@ -0,0 +1,79 @@
--HoTP 2.0
TRIGGER
function()
return true
end
ICON --Trigger for scripts
function()
aura_env.percentageHealth = aura_env.round((UnitHealth("player") / UnitHealthMax("player")) * 100, 0)
aura_env.currentHealth = UnitHealth("player")
aura_env.maxHealth = UnitHealthMax("player")
aura_env.missingHealthPercentage = aura_env.round(((UnitHealthMax("player") - UnitHealth("player")) / UnitHealthMax("player")) * 100, 2)
aura_env.missingHealth = UnitHealthMax("player") - UnitHealth("player")
local healingMultiplier = 1.
local versa = GetCombatRatingBonus(CR_VERSATILITY_DAMAGE_DONE)
healingMultiplier = healingMultiplier + (healingMultiplier * (aura_env.traitLevel * aura_env.traitEffectiveness)) + (healingMultiplier * (versa / 100))
for k,v in pairs(aura_env.buffs) do
if UnitBuff("player", k) ~= nil then
healingMultiplier = healingMultiplier + (healingMultiplier * v)
end
end
local talent = select(10, GetTalentInfoByID(22430))
if talent == true then
healingMultiplier = healingMultiplier + (healingMultiplier * 0.3)
end
aura_env.hotpRelativeHeal = 0.3 * healingMultiplier --How much % hotp heals disregarding missing health
aura_env.hotpAbsoluteRelativeHeal = aura_env.hotpRelativeHeal * aura_env.missingHealthPercentage --How much % hp hotp will heal regarding missing health
aura_env.hotpAbsoluteHeal = aura_env.round(aura_env.hotpRelativeHeal * aura_env.missingHealth, 0)
aura_env.newApsoluteHealth = aura_env.round(aura_env.currentHealth + aura_env.hotpAbsoluteHeal, 0)
aura_env.newRelativeHealth = aura_env.round(aura_env.percentageHealth + aura_env.hotpAbsoluteRelativeHeal, 0)
--print(healingMultiplier,aura_env.hotpRelativeHeal,aura_env.hotpAbsoluteRelativeHeal,aura_env.hotpAbsoluteHeal,aura_env.newApsoluteHealth,aura_env.newRelativeHealth) --DEBUG
--print(aura_env.hotpAbsoluteRelativeHeal, aura_env.newRelativeHealth, aura_env.percentageHealth) --DEBUG
--print(aura_env.hotpAbsoluteHeal, aura_env.newApsoluteHealth, aura_env.currentHealth) --DEBUG
--print(aura_env.round(aura_env.hotpRelativeHeal * 100, 0)) --% of health hotp heals
end
DURATION
function()
return aura_env.percentageHealth, 100, 1
end
NAME
function()
return aura_env.percentageHealth .. " " .. aura_env.newRelativeHealth .. " +" .. aura_env.round(aura_env.hotpAbsoluteRelativeHeal, 0)
end
DISPLAY
function()
return ("%.0fk / %.0fk"):format(UnitHealth("player") / 1000, UnitHealthMax("player") / 1000);
end
INIT
aura_env.traitLevel = 7
aura_env.traitEffectiveness = 0.06
aura_env.buffs =
{
["Consecration"] = 0.3,
["Avenging Wrath"] = 0.35,
["Chains of Thrayn"] = 0.5,
["Ilterendi, Crown Jewel of Silvermoon"] = 0.15
}
aura_env.round = function(var, n)
if (n) then
var = math.floor((var * 10^n) + 0.5) / (10^n)
else
var = math.floor(var+0.5)
end
return var
end
aura_env.percentageHealth = 0
aura_env.currentHealth = 0
aura_env.maxHealth = 0
aura_env.hotpRelativeHeal = 0
aura_env.hotpAbsoluteRelativeHeal = 0
aura_env.hotpAbsoluteHeal = 0
aura_env.newApsoluteHealth = 0
aura_env.newRelativeHealth = 0
aura_env.missingHealth = 0
aura_env.missingHealthPercentage = 0

View File

@@ -0,0 +1,69 @@
--HoTP 2.0
TRIGGER
function()
return true
end
ICON --Trigger for scripts
function()
aura_env.percentageHealth = aura_env.round((UnitHealth("player") / UnitHealthMax("player")) * 100, 0)
aura_env.currentHealth = UnitHealth("player")
aura_env.maxHealth = UnitHealthMax("player")
aura_env.missingHealthPercentage = aura_env.round(((UnitHealthMax("player") - UnitHealth("player")) / UnitHealthMax("player")) * 100, 2)
aura_env.missingHealth = UnitHealthMax("player") - UnitHealth("player")
local healingMultiplier = 1.
local versa = GetCombatRatingBonus(CR_VERSATILITY_DAMAGE_DONE)
healingMultiplier = healingMultiplier + (healingMultiplier * (aura_env.traitLevel * aura_env.traitEffectiveness)) + (healingMultiplier * (versa / 100))
for k,v in pairs(aura_env.buffs) do
if UnitBuff("player", k) ~= nil then
healingMultiplier = healingMultiplier + (healingMultiplier * v)
end
end
local talent = select(10, GetTalentInfoByID(22430))
if talent == true then
healingMultiplier = healingMultiplier + (healingMultiplier * 0.3)
end
aura_env.hotpRelativeHeal = 0.3 * healingMultiplier --How much % hotp heals disregarding missing health
aura_env.hotpAbsoluteRelativeHeal = aura_env.hotpRelativeHeal * aura_env.missingHealthPercentage --How much % hp hotp will heal regarding missing health
aura_env.hotpAbsoluteHeal = aura_env.round(aura_env.hotpRelativeHeal * aura_env.missingHealth, 0)
aura_env.newApsoluteHealth = aura_env.round(aura_env.currentHealth + aura_env.hotpAbsoluteHeal, 0)
aura_env.newRelativeHealth = aura_env.round(aura_env.percentageHealth + aura_env.hotpAbsoluteRelativeHeal, 0)
--print(healingMultiplier,aura_env.hotpRelativeHeal,aura_env.hotpAbsoluteRelativeHeal,aura_env.hotpAbsoluteHeal,aura_env.newApsoluteHealth,aura_env.newRelativeHealth) --DEBUG
--print(aura_env.hotpAbsoluteRelativeHeal, aura_env.newRelativeHealth, aura_env.percentageHealth) --DEBUG
--print(aura_env.hotpAbsoluteHeal, aura_env.newApsoluteHealth, aura_env.currentHealth) --DEBUG
--print(aura_env.round(aura_env.hotpRelativeHeal * 100, 0)) --% of health hotp heals
end
DURATION
function()
return aura_env.newRelativeHealth, 100, 1
end
INIT
aura_env.traitLevel = 7
aura_env.traitEffectiveness = 0.06
aura_env.buffs =
{
["Consecration"] = 0.3,
["Avenging Wrath"] = 0.35,
["Chains of Thrayn"] = 0.5,
["Ilterendi, Crown Jewel of Silvermoon"] = 0.15
}
aura_env.round = function(var, n)
if (n) then
var = math.floor((var * 10^n) + 0.5) / (10^n)
else
var = math.floor(var+0.5)
end
return var
end
aura_env.percentageHealth = 0
aura_env.currentHealth = 0
aura_env.maxHealth = 0
aura_env.hotpRelativeHeal = 0
aura_env.hotpAbsoluteRelativeHeal = 0
aura_env.hotpAbsoluteHeal = 0
aura_env.newApsoluteHealth = 0
aura_env.newRelativeHealth = 0
aura_env.missingHealth = 0
aura_env.missingHealthPercentage = 0

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,77 @@
--WeakAurasSaved.HoTP 3.0
--TRIGGER
function()
return true
end
--ICON --Trigger for scripts
function()
WeakAurasSaved.HoTP.percentageHealth = aura_env.round((UnitHealth("player") / UnitHealthMax("player")) * 100, 0)
WeakAurasSaved.HoTP.currentHealth = UnitHealth("player")
WeakAurasSaved.HoTP.missingHealthPercentage = aura_env.round(((UnitHealthMax("player") - UnitHealth("player")) / UnitHealthMax("player")) * 100, 2)
WeakAurasSaved.HoTP.missingHealth = UnitHealthMax("player") - UnitHealth("player")
local healingMultiplier = 1.
local versa = GetCombatRatingBonus(CR_VERSATILITY_DAMAGE_DONE)
healingMultiplier = healingMultiplier + (healingMultiplier * (WeakAurasSaved.HoTP.traitLevel * WeakAurasSaved.HoTP.traitEffectiveness))
healingMultiplier = healingMultiplier + (healingMultiplier * (versa / 100))
for k, v in pairs(WeakAurasSaved.HoTP.Buffs) do
if UnitBuff("player", k) ~= nil then
healingMultiplier = healingMultiplier + (healingMultiplier * v)
end
end
local talent = select(10, GetTalentInfoByID(22430))
if talent == true then
healingMultiplier = healingMultiplier + (healingMultiplier * 0.3)
end
WeakAurasSaved.HoTP.hotpRelativeHeal = 0.3 * healingMultiplier --How much % hotp heals disregarding missing health
WeakAurasSaved.HoTP.hotpAbsoluteRelativeHeal = WeakAurasSaved.HoTP.hotpRelativeHeal * WeakAurasSaved.HoTP.missingHealthPercentage --How much % hp hotp will heal regarding missing health
WeakAurasSaved.HoTP.hotpAbsoluteHeal = aura_env.round(WeakAurasSaved.HoTP.hotpRelativeHeal * WeakAurasSaved.HoTP.missingHealth, 0)
WeakAurasSaved.HoTP.newApsoluteHealth = aura_env.round(WeakAurasSaved.HoTP.currentHealth + WeakAurasSaved.HoTP.hotpAbsoluteHeal, 0)
WeakAurasSaved.HoTP.newRelativeHealth = aura_env.round(WeakAurasSaved.HoTP.percentageHealth + WeakAurasSaved.HoTP.hotpAbsoluteRelativeHeal, 0)
end
--DURATION
function()
return WeakAurasSaved.HoTP.percentageHealth, 100, 1
end
--NAME
function()
return WeakAurasSaved.HoTP.percentageHealth .. " " .. WeakAurasSaved.HoTP.newRelativeHealth .. " +" .. aura_env.round(WeakAurasSaved.HoTP.hotpAbsoluteRelativeHeal, 0)
end
--DISPLAY
function()
return ("%.0fk / %.0fk"):format(UnitHealth("player") / 1000, UnitHealthMax("player") / 1000);
end
--INIT
aura_env.round = function(var, n)
if (n) then
var = math.floor((var * 10 ^ n) + 0.5) / (10 ^ n)
else
var = math.floor(var + 0.5)
end
return var
end
WeakAurasSaved.HoTP =
{
["Buffs"] =
{
["Consecration"] = 0.3,
["Avenging Wrath"] = 0.35,
["Chains of Thrayn"] = 0.5,
["Ilterendi, Crown Jewel of Silvermoon"] = 0.15,
},
["traitLevel"] = 7,
["traitEffectiveness"] = 0.06,
["percentageHealth"] = 0,
["currentHealth"] = 0,
["hotpRelativeHeal"] = 0,
["hotpAbsoluteRelativeHeal"] = 0,
["hotpAbsoluteHeal"] = 0,
["newApsoluteHealth"] = 0,
["newRelativeHealth"] = 0,
["missingHealth"] = 0,
["missingHealthPercentage"] = 0,
}

View File

@@ -0,0 +1,10 @@
--HoTP 3.0
--TRIGGER
function()
return true
end
--DURATION
function()
return WeakAurasSaved.HoTP.newRelativeHealth, 100, 1
end