• 🏆 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!

Increase/Decrease Max Life

Status
Not open for further replies.
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 39
Joined
Feb 27, 2007
Messages
4,992
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.
 
Status
Not open for further replies.
Top