- Joined
- Dec 13, 2018
- Messages
- 2,368
Hello,
How can I find the difference between two variables? I want to make a trigger that saves the HP of the hero at two points in time, then deals damage/heals equal to the difference percentage.
Example:
A buff you place on a unit that lasts for 5 seconds. When those 5 seconds expires the target of the ability takes damage equal to X% damage done to the triggering unit (multiple spell levels, 40% for lvl 1 and 50% for lvl 2), and triggering unit is healed X% (20% lvl 1 and 30% lvl 2) of that damage.
Meaning if the caster took 1000 damage within those 5 seconds the unit with the buff will be damaged 500, and the caster will be healed 300 (at spell lvl 2).
Please ask if anything is unclear
It needs to detect this as a damage source as well:
Set HPCaster = ((Life of WarlockCaster) x 0.50)
Unit - Set life of WarlockCaster to HPCaster
How can I find the difference between two variables? I want to make a trigger that saves the HP of the hero at two points in time, then deals damage/heals equal to the difference percentage.
Example:
A buff you place on a unit that lasts for 5 seconds. When those 5 seconds expires the target of the ability takes damage equal to X% damage done to the triggering unit (multiple spell levels, 40% for lvl 1 and 50% for lvl 2), and triggering unit is healed X% (20% lvl 1 and 30% lvl 2) of that damage.
Meaning if the caster took 1000 damage within those 5 seconds the unit with the buff will be damaged 500, and the caster will be healed 300 (at spell lvl 2).
Please ask if anything is unclear
It needs to detect this as a damage source as well:
Set HPCaster = ((Life of WarlockCaster) x 0.50)
Unit - Set life of WarlockCaster to HPCaster