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

Lose HP when hungry

Status
Not open for further replies.
Level 3
Joined
Mar 29, 2011
Messages
38
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.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
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.
 
Level 3
Joined
Mar 29, 2011
Messages
38
  • 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?
 
Level 3
Joined
Mar 29, 2011
Messages
38
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.
Top