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

[Trigger] Percentage HP instead of Flat hp

Status
Not open for further replies.
Level 5
Joined
Jul 17, 2010
Messages
140
So i have this aura that adds Hp, when ever other units are near by.
Is there anyway to increase their hp by X% of ther own max instead of adding flat hp?

  • Health Aura
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Mages_Copy[0] and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units within 900.00 of (Position of (Picked unit))) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff Health Aura ) Equal to True
                • Then - Actions
                  • Unit - Add Aoe Max hp (Greater) to (Picked unit)
                • Else - Actions
      • Unit Group - Pick every unit in (Units within 1000000000.00 of (Center of (Playable map area))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Health Aura ) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Aoe Max hp (Greater) for (Picked unit)) Equal to 1
                • Then - Actions
                  • Unit - Remove Aoe Max hp (Greater) from (Picked unit)
                • Else - Actions
                  • Do nothing
            • Else - Actions
 
Level 16
Joined
Mar 24, 2017
Messages
827
I think it would be easier to modify unholy aura and just change the -Data Percent Bonus- Field to True

But if you wanna use a trigger, you could do this

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Unit - Set life of (Picked unit) to (((Max life of (Picked unit)) x 0.01) + (Life of (Picked unit)))
 
Level 5
Joined
Jul 17, 2010
Messages
140
I think it would be easier to modify unholy aura and just change the -Data Percent Bonus- Field to True

But if you wanna use a trigger, you could do this

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Unit - Set life of (Picked unit) to (((Max life of (Picked unit)) x 0.01) + (Life of (Picked unit)))

Does this add the value permanent`?
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,180
In StarCraft II this would be easy as buff behaviours support percentage life bonus...

In Warcraft III you will need to create a maximum life modification system. There are generally 2 ways to do this.
  1. Use modify maximum life item ability with multiple levels. A bug in the code means that it does not change modify amount upon ability level change yet will still remove the appropriate amount of life for the current level on ability removal. Add the ability, set it to a different level with different life amount and then remove it to permanently modify the unit life. For example setting it so level 1 adds 100 health and level 2 adds 0 health, adding it to your unit, setting it to level 2 and then removing the ability will result in your unit having 100 more maximum life. Works to both increase and decrease maximum life.
  2. Use tomes of life. All units can use tomes of life, even non heroes. An inventory ability can be given to the unit temporarily to allow tome usage. Tome items must be removed after use to avoid leaks. Tomes of life support both positive and negative maximum life modification.
One will have to track the amount of maximum life added to a unit to avoid any permanent modification the unit's maximum life when no longer under the aura. Sudden changes to unit maximum life, eg hero level up, might be difficult to reflect with the ability until the unit leaves the aura.
 
Last edited:
  • Like
Reactions: Rem
Actually there is an even easier way in Warcraft III, the third way is using player handicaps. Keep in mind you'll likely want to reserve a neutral player slot for this that you aren't using for players and/or enemies. Also by using this third method everything is already in percent for you. Ever wanted to change life without needing to glitch it through abilities?
 
Status
Not open for further replies.
Top