• 🏆 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] [If/Then/Else + Pick Unit - trigger) - Problem

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin^^

my Idea: I got the creep "Zul'Ra". If the life of Zul'Ra becomes lower than 9000, 4 random "Elite Troll Berserker" and 1 "Elite Troll Priest" should change the owner from Neutral Passive to Player 12 (Brown) and gains Vulnerble.

the structure of Zul'Ras Temple": Hes in the middle and around him there are this "Dark Trolls" and "Troll Priests". (There are neutral passive and Invulnerble)

My Trigger:
  • Summon 1
    • Events
      • Unit - Troll Warlock 0067 <gen>'s life becomes Less than 9000.00
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit Group - Pick every unit in (Units within 2000.00 of (Position of Troll Warlock 0067 <gen>)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Elite Troll Berserker
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Neutral Passive
                • Then - Actions
                  • Unit Group - Pick every unit in (Random 4 units from (Units of type (Unit-type of (Picked unit)))) and do (Actions)
                    • Loop - Actions
                      • Unit - Make (Picked unit) Vulnerable
                      • Unit - Change ownership of (Picked unit) to Player 12 (Brown) and Change color
                      • Unit - Order (Picked unit) to Attack-Move To (Position of Troll Warlock 0067 <gen>)
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • Do nothing
      • Unit Group - Pick every unit in (Units within 2000.00 of (Position of Troll Warlock 0067 <gen>)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Elite Troll Priest
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Neutral Passive
                • Then - Actions
                  • Unit Group - Pick every unit in (Random 1 units from (Units of type (Unit-type of (Picked unit)))) and do (Actions)
                    • Loop - Actions
                      • Unit - Make (Picked unit) Vulnerable
                      • Unit - Change ownership of (Picked unit) to Player 12 (Brown) and Change color
                      • Unit - Order (Picked unit) to Attack-Move To (Position of Troll Warlock 0067 <gen>)
                • Else - Actions
                  • Do nothing
            • Else - Actions
              • Do nothing
My Problem: If the trigger .. trigger ( :eekani: ) ALL trolls around him becomes vurnable and change owner to Player 12 (Brown)

So can someone help my what i should change?

(Theres this trigger for 9000 life and for 7000 5000 3000 1000 life other triggers (with the same function))
 
Level 9
Joined
Feb 14, 2009
Messages
316
The problem is that the trigger picks EVERY unit who is troll and for each picked troll it selects 4 trolls => that means you must do:

  • Unit Group - Pick every unit in (Random 4 units from (Units of type Elite Troll Berserker)) matching ((Owner of (Picked unit)) Equal to Neutral Passive) and do (Actions)
    • Loop - Actions
      • If (All conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Region centered at (Position of (Troll Warlock...)) with size (2000,2000)) contains (Picked unit)) Equal to True
        • Then - Actions
          • Unit - Make (Picked unit) Vulnerable
          • Unit - Change ownership...
          • Unit - Order (Picked unit) ...
        • Else - Actions
          • Do nothing
Instead of the 1st major "pick every unit". Similar thing for the other one. There are better solutions to this, of course, but I'm sure you will find them yourself.
 
Level 16
Joined
May 1, 2008
Messages
1,605
Hmm ... there 2 points ... first one the editor is stupid or second i am <-- but thats impossible =P

I dont know i tried some stuff ... sometimes nothing happend ... sometimes only 1 troll was pciked not 4 .... AND onetime my wc3 got an error -_-

I just change the plan how i want crate thos trolls ;) now there summoned and this work =D

Anyway ty for your help :thumbs_up:

MfG
Dr. Boom
 
Status
Not open for further replies.
Top