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

[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