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

Max Health Condition

Status
Not open for further replies.
Level 9
Joined
Mar 27, 2009
Messages
309
Here's how you could get it to do [Iterations] amount of operations for each 5% lost.

Not sure about when it is healed, but it's simply finding the right event to trigger it, or if you heal via triggers, then use this there.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set iterations = ((((Max life of (Triggering unit)) - (Life of (Triggering unit))) / (Max life of (Triggering unit))) x 20.00)
      • For each (Integer A) from 1 to (Integer(iterations)), do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: (String(iterations))
          • -------- Do things here --------
The X 20.00 is to calculate percentage and then find each 5% [100%/5%]

For some reason this took wayyy too much fiddling on my part. :ogre_haosis:
 
Level 4
Joined
Aug 1, 2013
Messages
54
Here's how you could get it to do [Iterations] amount of operations for each 5% lost.

Not sure about when it is healed, but it's simply finding the right event to trigger it, or if you heal via triggers, then use this there.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Set iterations = ((((Max life of (Triggering unit)) - (Life of (Triggering unit))) / (Max life of (Triggering unit))) x 20.00)
      • For each (Integer A) from 1 to (Integer(iterations)), do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: (String(iterations))
          • -------- Do things here --------
The X 20.00 is to calculate percentage and then find each 5% [100%/5%]

For some reason this took wayyy too much fiddling on my part. :ogre_haosis:

Works perfect thank you
 
Status
Not open for further replies.
Top