• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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

Status
Not open for further replies.
Level 9
Joined
Mar 26, 2020
Messages
209
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
 
set life to X [Max (1.00)
^ that part, what configure action is that?
1629949475267.png
 
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)%
 
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.
Back
Top