• 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.

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 45
Joined
Feb 27, 2007
Messages
5,578
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