Increase/Decrease Max Life

Level 3
Joined
Jul 10, 2019
Messages
10
Hey guy,

I am trying to figure out a JASS trigger to increase and decrease the max life of a unit when called. It seems that SetUnitState(unit, UNIT_STATE_MAX_LIFE, value) does not work. I also remember that it used to work to add an item ability that increased max life and then immediately remove that ability from a unit. It does not appear that that is working any more? Was that changed in a recent patch? If so is there a new native that could help me with?

Thanks so much!

Best,
Tanner Bina
 
Level 36
Joined
Feb 27, 2007
Messages
4,728
New native (most of which can be found here by searching for "Blz"): native BlzSetUnitMaxHP takes unit whichUnit, integer hp returns nothing
I also remember that it used to work to add an item ability that increased max life and then immediately remove that ability from a unit. It does not appear that that is working any more?
It still works. The bug was that leveling up the bonus life abilities didn't give you the proper life bonus (it gave bonus from level 1), but removing the ability increased unit life by -1.00 x amount of life it should have added. So you make level 1 give 0 bonus life and level 2 give -100 bonus, then add ability, set level to 2, and remove ability = +100 life.
 
Top