• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Lose HP when hungry

Status
Not open for further replies.
Level 3
Joined
Mar 29, 2011
Messages
37
I'm wanna make a system: mana is the hunger bar.

Picked hero losing 1 mana/sec
When hero's mana < 1, hero bleed 1 hp/sec.
When hero's mana restore ,equal or greater than 1, stop bleeding.
Hero's mana < 1 again, hero bleed 1hp/sec.

Plz help, i'm really sucks at trigger.
 
You prety much told the system...

Pick all units that are to be affected by this system.
Remove 1 mana from the unit (current mana = current mana - 1)
if current mana of picked unit is less than 1 then set current hitpoints = current hitpoints - 1

As the condition evaluates each time, it will stop when the unit gains more than 1 mana.
 
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Actions)
        • Loop - Actions
          • Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 1.00)
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Integer((Mana of (Picked unit)))) Less than (<) 1
              • Then - Actions
                • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 10.00)
              • Else - Actions
                • Do nothing
Yes it's work, thanks Dr Super Good.

-1 hp is not good because it mess with hp regen.
Does this trigger leak?
 
Thanks u guys for making this trigger works perfectly, now i can know more about trigger.

Case solved XD.
 
Status
Not open for further replies.
Back
Top