• 🏆 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!

How to order REVIVE DEAD HERO ?

Status
Not open for further replies.
Level 15
Joined
Dec 19, 2007
Messages
1,233
Full Trigger:
  • RAX
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in AI_RAX and do (Actions)
        • Loop - Actions
          • Set player = (Owner of (Picked unit))
          • Set ug = (Units owned by player matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Attacker)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ug is empty) Equal to True
            • Then - Actions
              • Unit - Order (Picked unit) to train/upgrade to a Attacker
            • Else - Actions
          • Custom script: call DestroyGroup(udg_ug)
          • Set ug = (Units owned by player matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Summoner)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ug is empty) Equal to True
            • Then - Actions
              • Unit - Order (Picked unit) to train/upgrade to a Summoner
            • Else - Actions
          • Custom script: call DestroyGroup(udg_ug)
          • Set ug = (Units owned by player matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Splasher)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ug is empty) Equal to True
            • Then - Actions
              • Unit - Order (Picked unit) to train/upgrade to a Splasher
            • Else - Actions
          • Custom script: call DestroyGroup(udg_ug)
          • Set ug = (Units owned by player matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Healer)))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (ug is empty) Equal to True
            • Then - Actions
              • Unit - Order (Picked unit) to train/upgrade to a Healer
            • Else - Actions
          • Custom script: call DestroyGroup(udg_ug)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player Food used) Less than 10
            • Then - Actions
              • Set int = (Random integer number between 1 and 4)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • int Equal to 1
                • Then - Actions
                  • Set unit_type = Footman
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • int Equal to 2
                • Then - Actions
                  • Set unit_type = Sorceress
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • int Equal to 3
                • Then - Actions
                  • Set unit_type = Rifleman
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • int Equal to 4
                • Then - Actions
                  • Set unit_type = Grunt
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (player Current gold) Greater than or equal to 150
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (player Current lumber) Greater than or equal to 300
                    • Then - Actions
                      • Set unit_type = Spell Breaker
                    • Else - Actions
                      • Set unit_type = Knight
                • Else - Actions
              • Unit - Order (Picked unit) to train/upgrade to a unit_type
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • (player Current lumber) Greater than or equal to 50
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Current research level of Iron Forged Swords for player) Less than or equal to 3
                          • (Current research level of Iron Plating for player) Less than or equal to 3
                          • (Current research level of Animal War Training for player) Less than or equal to 3
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Animal War Training for player) Less than or equal to 3
                    • Then - Actions
                      • Unit - Order (Picked unit) to research Animal War Training
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Iron Plating for player) Less than or equal to 3
                    • Then - Actions
                      • Unit - Order (Picked unit) to research Iron Plating
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Iron Forged Swords for player) Less than or equal to 3
                    • Then - Actions
                      • Unit - Order (Picked unit) to research Iron Forged Swords
                    • Else - Actions
                • Else - Actions

Relevant Part:
  • Set ug = (Units owned by player matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Attacker)))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (ug is empty) Equal to True
    • Then - Actions
      • Unit - Order (Picked unit) to train/upgrade to a Attacker
    • Else - Actions
  • Custom script: call DestroyGroup(udg_ug)
Result: the hero won't be ordered to be revived.

Question: how to order a hero revive properly?
Thanks for reading and tring to solve it with me!
 
Status
Not open for further replies.
Top