• 🏆 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] Temporary Life Boost

Status
Not open for further replies.
Level 4
Joined
Feb 24, 2018
Messages
71
Hello ! I have this trigger which boosts the target's health by 10%,20% and 30%.
  • Life Boost
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Life Boost
    • Actions
      • Set int = (Integer(((Max life of (Target unit of ability being cast)) - (0.10 x (Real((Level of Life Boost for (Triggering unit))))))))
      • Set int3 = (int / 100)
      • Set int = (int - (int3 x 100))
      • Set int2 = (int / 10)
      • Set int = (int - (int2 x 10))
      • For each (Integer A) from 1 to int3, do (Actions)
        • Loop - Actions
          • Unit - Add 100 HP to (Target unit of ability being cast)
          • Unit - Set level of 100 HP for (Target unit of ability being cast) to 2
          • Unit - Remove 100 HP from (Target unit of ability being cast)
      • For each (Integer A) from 1 to int2, do (Actions)
        • Loop - Actions
          • Unit - Add 10 HP to (Target unit of ability being cast)
          • Unit - Set level of 10 HP for (Target unit of ability being cast) to 2
          • Unit - Remove 10 HP from (Target unit of ability being cast)
      • For each (Integer A) from 1 to int, do (Actions)
        • Loop - Actions
          • Unit - Add 1 HP to (Target unit of ability being cast)
          • Unit - Set level of 1 HP for (Target unit of ability being cast) to 2
          • Unit - Remove 1 HP from (Target unit of ability being cast)
I would like to know how do I modify this so it's a temporary health boost, for example after 10 seconds the bonus health is removed from the target. Thanks !
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
If you look into the spells & systems section you should be able to find a system that modifies a unit's HP & Mana either permanent or temporary. I was looking at something the other day, nothing special, but it does the job, I got 0 memory of how it was named, the author or if it was GUI or Jass or anything else... Unfortunately, you'll have to do some digging yourself ;)
 
Level 3
Joined
Mar 1, 2018
Messages
41
I didn't find add or remove units max life in my GUI so i made an Item Ability of HP, gave it some levels and put it into a spellbook.

I Give triggering unit the spellbook, but set the item Ability HP to "x" level (any variable you want)

when the effect wears off I remove the spellbook. (btw i disabled it so it wont show the icon)

Maybe this is a work around?
 
Level 4
Joined
Feb 24, 2018
Messages
71
I didn't find add or remove units max life in my GUI so i made an Item Ability of HP, gave it some levels and put it into a spellbook.

I Give triggering unit the spellbook, but set the item Ability HP to "x" level (any variable you want)

when the effect wears off I remove the spellbook. (btw i disabled it so it wont show the icon)

Maybe this is a work around?
Does this method boosts the target's health in percentage ?
 
Level 3
Joined
Mar 1, 2018
Messages
41
Ah, no.
I could do it with like 500 ability levels and 1hp per level but it would look silly. I made 100 levels with 5hp increments.

Then i detect hero int and multiply it by 0.20 wich gets 20%, and that will be the level of the dummy ability?

Something like that. I can get units life, multiply it to get some % and use % on ability wich works by the factor of 5. (personal preference, I wish I could only increment by 10s and allways have 0s at the end, to look simple, but it's hard to balance stuff.)
 
Status
Not open for further replies.
Top