• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Death when mana reaches 0

Status
Not open for further replies.
Level 3
Joined
May 28, 2007
Messages
33
Hiho,
try to check every few seconds, if your heroe's mana is equal to 0. If it's equal to 0, then kill the hero, else just do nothing... my triggers are German, so I had to translate them by myself... maybe they're called different in the English WE, sorry. Anyway, here is m trigger:
  • Trigger
    • Happenings(?)
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit-group - Pick every unit in (Units in (Playable map area) matching (((Picked unit) is a hero) equal to True)) and do (If ((mana of (Picked unit)) equal to 0.00) then do (unit - Kill (Matching unit)) else do (Do nothing))
 
Level 9
Joined
Jul 1, 2005
Messages
393
thanks for the help + rep.

Happenings are called Events. :)

I am having a little bit of trouble adapting it to my map. I am having trouble making it take mana as a condition for death. This is what I have, but it auto-kills everyone on Force 2. That isn't what I wanted, how can I fix it?

  • Untitled Trigger 001
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All allies of Player 12 (Brown)) and do (If ((Picked player) Equal to (Owner of (Picked unit))) then do (Unit - Kill (Matching unit)) else do (Do nothing))
 
Last edited:
Level 11
Joined
Jul 20, 2004
Messages
2,760
You don't need to make it a condition. If the problem remained the same from the first post, you would only need a bit of JASS to make it work. The basic trick is using "Unit's mana is less than or equal to 0.00" event. Practically you would have a trigger which adds the event for each unit that enters the map and has mana to a secondary trigger. The secondary trigger just kills the (Triggering Unit) without any initial event. :)

This is theory, and can be done even with a bit of custom script Action. I quit modding so I don't have Warcraft on my comp anymore, but perhaps someone can help you with the complete trigger if you can't do it.

-Mihai
 
Level 18
Joined
May 27, 2007
Messages
1,689
silver, you used "Pick Every Player" rather than "Pick Every Unit" and also the mana "Condition" you are looking for is a "Real" Comparison, but this is what the trigger will look like, with a Boolean comparison for the first condition and a Real comparison for the second, that is only if you want it to be for heroes, which is what you want, but anyway i believe this is what you want
  • Mana Death
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
              • (Mana of (Picked unit)) Less than or equal to 0.00
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
this should be something to the effect of what you need
 
Status
Not open for further replies.
Top