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

[JASS] Is it possible to check wether a unit is in a unit variable with jass?

Status
Not open for further replies.
Level 14
Joined
Apr 20, 2009
Messages
1,543
I used this trigger: but it doesn't seem to work for me :S

  • Repick your hero
    • Events
      • Player - Player 1 (Red) types a chat message containing -repick as An exact match
      • Player - Player 2 (Blue) types a chat message containing -repick as An exact match
      • Player - Player 3 (Teal) types a chat message containing -repick as An exact match
      • Player - Player 4 (Purple) types a chat message containing -repick as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -repick as An exact match
      • Player - Player 6 (Orange) types a chat message containing -repick as An exact match
      • Player - Player 7 (Green) types a chat message containing -repick as An exact match
      • Player - Player 8 (Pink) types a chat message containing -repick as An exact match
      • Player - Player 9 (Gray) types a chat message containing -repick as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -repick as An exact match
    • Conditions
    • Actions
      • For each (Integer Integer_C) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering player) Equal to Player[Integer_C]
            • Then - Actions
              • Custom script: if udg_Hero_of_player[udg_Integer_C]==null then
              • Game - Display to (Player group(Player[Integer_C])) the text: You have no hero to...
              • Custom script: else
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of Hero_of_player[Integer_C]) Equal to Space Orc Elite (Hero)
                • Then - Actions
                  • Unit - Replace Hero Tavern 0016 <gen> with a Hero Tavern using The old unit's relative life and mana
                  • Unit - Create 1 Hero chooser for Player[Integer_C] at (Random point in Create Hero Choosers Raiders <gen>) facing Default building facing degrees
                  • Unit - Remove Hero_of_player[Integer_C] from the game
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of Hero_of_player[Integer_C]) Equal to Space Orc Pyromaniac (Hero)
                    • Then - Actions
                      • Unit - Create 1 Hero chooser for Player[Integer_C] at (Random point in Create Hero Choosers Raiders <gen>) facing Default building facing degrees
                      • Unit - Remove Hero_of_player[Integer_C] from the game
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of Hero_of_player[Integer_C]) Equal to Space Orc Sniper (Hero)
                        • Then - Actions
                          • Unit - Create 1 Hero chooser for Player[Integer_C] at (Random point in Create Hero Choosers Raiders <gen>) facing Default building facing degrees
                          • Unit - Remove Hero_of_player[Integer_C] from the game
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Unit-type of Hero_of_player[Integer_C]) Equal to Space Orc Task Force (Hero)
                            • Then - Actions
                              • Unit - Create 1 Hero chooser for Player[Integer_C] at (Random point in Create Hero Choosers Raiders <gen>) facing Default building facing degrees
                              • Unit - Remove Hero_of_player[Integer_C] from the game
                            • Else - Actions
              • Custom script: endif
            • Else - Actions
lol nvm I fixed it... didn't test it correctly :)
 
Status
Not open for further replies.
Top