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

[Solved] Drain Health Trigger?

Status
Not open for further replies.
Level 4
Joined
Jul 19, 2010
Messages
99
Hello, so i am creating a survival map and it requires a trigger that if your mana is equal to 0 and/or your food is equal to zero your health would begin to drop. So far I am stumped. I don't want to use separate triggers to drain health because then it would double drain and kill your hero almost instantly. I would like it to be under one trigger if possible (Note: I do not know how to use JASS or any of that other crap haha). Thanks! =)

  • HealthDrain
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Survivor) and do (Actions)
        • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RedFood Equal to 0
          • (Integer((Mana of (Picked unit)))) Equal to 0
        • Then - Actions
          • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) - ((Real((Strength of (Picked unit) (Exclude bonuses)))) + 1.00))%
        • Else - Actions
          • Do nothing
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • HealthDrain
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units of type Survivor) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • RedFood Equal to 0
                • Mana of (Picked unit) Less than 1
            • Then - Actions
              • Reduce life
            • Else - Actions
 
Level 4
Joined
Jul 19, 2010
Messages
99
Oh I gotcha, and what is the custom script? :| sorry.

  • HealthDrain
    • Events
      • Time - Every 15.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Survivor) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Integer((Mana of (Picked unit)))) Less than 1
                  • RedFood Equal to 0
                  • RedWater Equal to 0
            • Then - Actions
              • Unit - Set life of (Picked unit) to ((Percentage life of (Picked unit)) - ((Real((Strength of (Picked unit) (Exclude bonuses)))) + 1.00))%
            • Else - Actions
              • Do nothing

idk what im doing wrong
 
Last edited:
Status
Not open for further replies.
Top