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

Increase stregth per missing health

Status
Not open for further replies.
Level 6
Joined
May 15, 2009
Messages
191
Hey everyone. Im trying to make a passive spell that increases your strength by 1/2/3 points(depending on the level of the ability) per percentage missing health. So if you have 1 level of the spell, and you are missing 40% health, you should have 40 extra strength.
My problem is that the bonus stops after it has increased just once. Heres the trigger as of now:
  • Unyielding Onslaught
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Riftwalker)) and do (Actions)
        • Loop - Actions
          • Set UO_PercenHealth = (100.00 - (Percentage life of (Picked unit)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Percentage life of (Picked unit)) Less than 100.00
            • Then - Actions
              • Hero - Modify Strength of (Picked unit): Set to ((20 + ((Level of (Picked unit)) x 4)) + (((Level of Unyielding Onslaught for (Triggering unit)) x 1) x (Integer(UO_PercenHealth))))
            • Else - Actions
              • Hero - Modify Strength of (Picked unit): Set to (20 + (4 x (Level of (Picked unit))))
Help much appreciated, thx in advance.
(Btw I know that there is a leak, but I will fix that when/if the trigger works)
 
Level 8
Joined
Dec 9, 2009
Messages
397
It would be a lot easier, and less intensive to just get a damage detection system, and trigger the damage of the units with that skill.

str also increases total health, so increasing it by % of hp lost will be kinda crazy, unless you turned that constant off.

which makes the DDS an even better option.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 032
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • Set u = (Picked unit)
          • Set ID = (Custom value of u)
          • Set i1 = (Integer((100.00 - (Percentage life of u))))
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • i1 Not equal to (!=) Bonus[ID]
              • Then - Actions
                • Hero - Modify Strength of u: Add (i1 - Bonus[ID])
                • Set Bonus[ID] = i1
              • Else - Actions
You also need unit indexer: www.hiveworkshop.com/forums/spells-569/gui-unit-indexer-1-2-0-2-a-197329/

Just copy it to your map and you're done.

Add units to the group.

Variables:
u = unit
ID = integer
i1 = integer
Bonus = integer array
 
Level 6
Joined
May 15, 2009
Messages
191
I rather dislike downloading other peoples triggers(And I belive that I have a spell that already uses custom value) but it seems I have little choice.

Thx for help anyway guys - Will try

P.S For my other trigger using custom values(it sets the custom value of a unit, to the player number) will I somewhat be able to modify it for this new system?
Here it is:
  • Sigil of Annihiliation Settings
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sigil of Annihiliation
      • ((Target unit of ability being cast) has buff Sigil of Annihiliation ) Not equal to True
    • Actions
      • Player Group - Add (Owner of (Triggering unit)) to SigilofA_CasterOwner
      • Unit - Set the custom value of (Target unit of ability being cast) to (Player number of (Owner of (Target unit of ability being cast)))
      • Unit Group - Add (Target unit of ability being cast) to SigilofA_Group
  • Sigil of Annihilation Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in SigilofA_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Sigil of Annihiliation ) Equal to True
            • Then - Actions
              • Set SigilofA_Picked = (Picked unit)
              • Set SigilofA_TimeOn[(Custom value of SigilofA_Picked)] = (SigilofA_TimeOn[(Custom value of SigilofA_Picked)] + 1)
            • Else - Actions
              • Unit Group - Remove SigilofA_Picked from SigilofA_Group
 
Last edited:
Status
Not open for further replies.
Top