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

Dynamically Increasing the Max HP of a unit

Status
Not open for further replies.
Level 3
Joined
Jan 4, 2009
Messages
55
How would a custom script look to increase the Maximum HP of a specific unit? I tried using Item HP Bonus ability as a Unit ability, but increasing the level of this ability did not actually change the maximum HP to the new amount.

For Example: Lvl 1 = 50 bonus HP and Lvl 2 = 100
Increasing the ability to level 2 still only gave a 50 HP bonus to the unit.

This ability has 20 different levels to it, so I don't really think making 20 different lvl 1 abilities would be a good idea, hence my request for a custom script.

Thanks in advance.
 
Level 11
Joined
Nov 15, 2007
Messages
800
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Add +101 HP (Level 2 = +1) to Footman 0000 <gen>
      • Unit - Increase level of +101 HP (Level 2 = +1) for Footman 0000 <gen>
      • Unit - Remove +101 HP (Level 2 = +1) from Footman 0000 <gen>
I just learned of this today. Apparently when level is increased the ability will simply permanently add the amount of HP it would add at level 1, and when removed it will remove the amount of HP it would add at the level it's currently on. So every time this trigger runs it would permanently add 100 HP to the footman.
 
Status
Not open for further replies.
Top