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

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