[Trigger] An ability that kills a unit if it's health is below a certain percentage.

bub

bub

Level 1
Joined
Feb 17, 2008
Messages
2
I've just started playing with world editor yesterday so I apologize if I'm missing something obvious.

The thing is, I want to make the spell described in the title, but I can't find a way to check for how much life a unit has. I can use Unit - Property in a Unit - Set life block, but I need it in an if/then block since I only want to change the life of the unit if the condition is met. It simply isn't there. I can't even set a variable to the unit's life, it isn't there for selection either in the Set Variable block.

if (life of (target unit of ability being cast)) < .....
or
Set UNITLIFE = Life of (target unit of ability being cast)

Is it possible that you can't do this in the trigger editor?

I have a workaround that doesn't check anything, but every time the ability is cast sets the life of the target unit to life*sgn(life - 0.3*maxlife), so if the unit is below 30% it sets it to negative life and otherwise to the same amount. This seems to work but this is not the way it should be done, it's a very bad way to do things.

I can't believe there is no way to CHECK for conditions like this... Can someone help?

edit: sorry for the "it's" in the title, seems I can't change it :)
 
Top