Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Heal By Missing Health

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Heal

Actions


Set TempUnit = (Target unit of ability being cast)


Set Real1 = ((Max life of TempUnit) x 0.10) <-- this finds out what 10% of the unit's max health is


Set Real2 = (((Max life of TempUnit) - (Life of TempUnit)) / Real1) <-- this finds out how many times 10% of the max health is missing.


Set HealStrength = 25 <--This is whatever the base healing is.


Unit - Set life of TempUnit to ((Life of TempUnit) + (HealStrength x Real2)) <-- multiply healing power by how many times 10% is missing.
Ok, this shoooooould work, but I can't really test that right now, so hopefully my math is right.
Heal By Missing Health
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Heal
Actions
Set TempUnit = (Target unit of ability being cast)
Set Real1 = ((Max life of TempUnit) x 0.10) <-- this finds out what 10% of the unit's max health is
Set Real2 = (((Max life of TempUnit) - (Life of TempUnit)) / Real1) <-- this finds out how many times 10% of the max health is missing.
Set HealStrength = 25 <--This is whatever the base healing is.
Unit - Set life of TempUnit to ((Life of TempUnit) + (HealStrength x Real2)) <-- multiply healing power by how many times 10% is missing.
This will not work perfectly. It will activate even when, for example, 25% HP is missing. Let's say a unit has 200 HP and lost 25%. Now it's 150. Based on your calculation (200- 150) / 20 = 2.5
It means that the healing will be multiplied by 2.5 but that's not what the user asks for. It should be 2 because the 10% was lost twice only. Also, the user still didn't clarify how he would like the heal to be incremented. Why multiplying by HealStrength? Maybe he wants to 5 extra HP healed for every 10% HP missing.
ninehell, you need to give me more info before I can concoct a trigger about this.
Might want to brush up on your mathematics...The calculation would be: BaseHealValue * (1.1 * ((CurrentLife / MaxLife) *100))
FinalHealValue = BaseHealValue * (1 + 1.1 * (1 - CurrentLife / MaxLife))
// CurrentLife / MaxLife -> current life fraction
// (1 - CurrentLife / MaxLife) -> current life missing fraction
// 1.1 -> fractional form of healing power bonus when unit has 0% health (110%)
// 1.1 * (1 - CurrentLife / MaxLife) -> work out the healing bonus to apply as a fraction
// (1 + 1.1 * (1 - CurrentLife / MaxLife)) -> work out the power fraction to apply by adding the bonus fraction to the default damage fraction of 1
// BaseHealValue * (1 + 1.1 * (1 - CurrentLife / MaxLife)) -> work out heal amount by applying the power fraction
yea sorry it is indeed 1-CurrentLife/MaxLife
heal primal amount

Events


Game - DamageModifierEvent becomes Equal to 1.00


Unit - A unit Starts the effect of an ability

Conditions


DamageEventType Equal to 0


(Ability being cast) Equal to Healing Touch Primal

Actions


Unit - Set life of DamageEventTarget to ((Life of DamageEventTarget) + (400.00 x (1.00 + (1.10 x (1.00 - ((Life of DamageEventTarget) / (Max life of DamageEventTarget)))))))


Set DamageEventAmount = (400.00 x (1.00 + (1.10 x (1.00 - ((Life of DamageEventTarget) / (Max life of DamageEventTarget))))))


Set DamageEventHeal = (+ + (String((Integer(DamageEventAmount)))))


Floating Text - Create floating text that reads DamageEventHeal above DamageEventTarget with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency


Floating Text - Change (Last created floating text): Disable permanence


Floating Text - Set the velocity of (Last created floating text) to 50.00 towards 90.00 degrees


Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds


Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds


Custom script: call RemoveLocation(udg_TempPoint)
Set DamageEventAmount = (400.00 x (1.00 + (1.10 x (1.00 - ((Life of DamageEventTarget) / (Max life of DamageEventTarget))))))
Unit - Set life of DamageEventTarget to ((Life of DamageEventTarget) + (DamageEventAmount))
