Life - 400

Sonic

New Member
Reaction score
10
How to make this :
x = some unit
When the hero x loses 400 hit points, some action will happen. I need this for boss fight.
So for example the boss x has a 1200 max life, then his life becomes 800 and mini bosses are spawned, then when life becomes 400 and again.
+rep
 

Grags_1977

Ultra Cool Member
Reaction score
32
Trigger:
  • Boss life less than 800
    • Events
      • Unit - Boss 0000 <gen>'s life becomes Less than 800.00
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Make Boss Angry!


Trigger:
  • Boss life less than 400
    • Events
      • Unit - Boss 0000 <gen>'s life becomes Less than 400.00
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Make Boss Angrier!


If i'm reading what you're asking correctly then the above is perfect for what you want.




Another way. Create a real variable. I called it rAngryBoss (the R stands for Real)

Trigger:
  • Map initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set rAngryBoss = ((Life of Boss 0000 <gen>) - 400.00)


Trigger:
  • Boss takes damage
    • Events
      • Unit - Boss 0000 <gen> Takes damage
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of Boss 0000 <gen>) Less than rAngryBoss
        • Then - Actions
          • Set rAngryBoss = (rAngryBoss - 400.00)
          • Make Boss Angry!
        • Else - Actions
 

Sonic

New Member
Reaction score
10
Thanks, the second is better, because you need a lot of triggers for 1 way, so the 2nd is better. +rep
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
or u could do this...
Trigger:
  • Events
    • A unit enters playable map area
    • Conditions
      • Unit type of triggering unit is equal to (your unit)
    • Actions
      • Trigger - add event triggering unit takes damage to trigger2 <gen>


Trigger:
  • Events
    • Conditions
    • Actions
      • If then else
        • If
          • Damage taken + Accumulated_Damage is less than 400
        • Then
          • Set Accumulated_Damage = Accumulated_Damage + damage taken
        • Else
          • Set Accumulated_Damage = (Accumulated_Damage + damage taken) - 400
          • Run your actions


Or for a MUI version

Trigger:
  • Events
    • Conditions
    • Actions
      • If then else
        • If
          • Damage taken + Accumulated_Damage[unit id of triggering unit] is less than 400
        • Then
          • Set Accumulated_Damage = Accumulated_Damage[unit id of triggering unit] + damage taken
        • Else
          • Set Accumulated_Damage = (Accumulated_Damage[unit id of triggering unit] + damage taken) - 400
          • Run your actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top