• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] How to prevent from dying with hp cost ability

Status
Not open for further replies.
Level 5
Joined
Mar 26, 2020
Messages
66
just as the title says, i have this spell that consumes 20% of the HP but i want to make it like huskar's lifebreak in DotA where base of his hp%left as cost (preventing him from dying like with 60/2000 HP and that spell is like cost 20% of the remaining hp to cast therefore he won't die after casting with low hp) [sry i find it hard to explain this] and ends up dying if the caster has 20% or less HP
 
Level 5
Joined
Mar 26, 2020
Messages
66
set life to X [Max (1.00)
^ that part, what configure action is that?
1629949475267.png
 
Level 5
Joined
Mar 26, 2020
Messages
66
1629951159453.png

1629951183841.png

1629951242547.png

im confused after the Set Life (To Value) i don't see arithmetic/math option after clicking the first one[set life of triggering unit] (unless that feature is on reforge coz i use 1.27ver)
 
Level 24
Joined
Feb 9, 2009
Messages
1,783
already done that, i did both percentage and value, still gets killed with less of the conditions cost
View attachment 385853 i put 200% as 20% cost
1567525278327.jpg


1629952817143.png

According to that you are simply taking the life of the triggering unit, subtracting 200.00 and setting the resulting value as its new percentage of it's life, note the % at the end of the line.
Read over the screen shots and use Set life to (VALUE)
End result should look like:
  • Unit - Set life of (Triggering unit) to (Max(1.00, ((Life of (Triggering unit)) - ((Max life of (Triggering unit)) x 0.20))))
Not
  • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - 200.00)%
 
Level 24
Joined
Feb 9, 2009
Messages
1,783
The number of brackets in your screenie tell me that you're a big fat fibber.

1590133173315.jpg


1629955468308.png
In my trigger I have value 1 as (1.00), and value2 as (Life of (Triggering unit)) - ((Max life of (Triggering unit)) x 0.20)))

You have value1 as (1.00), but have value2 as (Life of (Triggering unit) and then you go on to subtract ((Max life of (Triggering unit)) x 0.20) from outside Max(x,y).

Review the screenshots earlier and try again.
 
Status
Not open for further replies.
Top