• 🏆 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] Spell for my map

Status
Not open for further replies.
Level 6
Joined
Sep 27, 2008
Messages
258
ok so

  • Future Copy
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • -------- Red --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Future
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Owner of (Triggering unit)) Equal to Player 1 (Red)) and (((Playable map area) contains (Random unit from (Units owned by (Picked player) of type Burrow))) Equal to True)
            • Then - Actions
              • Unit - Create 5 Grunt for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Triggering unit)) Equal to Player 1 (Red)) and (((Playable map area) contains (Random unit from (Units owned by (Picked player) of type Barracks))) Equal to True)
                • Then - Actions
                  • Unit - Create 5 Troll Headhunter for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Owner of (Triggering unit)) Equal to Player 1 (Red)) and (((Playable map area) contains (Random unit from (Units owned by (Picked player) of type Farm))) Equal to True)
                        • Then - Actions
                          • Unit - Create 5 Footman for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Owner of (Triggering unit)) Equal to Player 1 (Red)) and (((Playable map area) contains (Random unit from (Units owned by (Picked player) of type Barracks))) Equal to True)
                            • Then - Actions
                              • Unit - Create 5 Rifleman for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                • Then - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • ((Owner of (Triggering unit)) Equal to Player 1 (Red)) and (((Playable map area) contains (Random unit from (Units owned by (Picked player) of type Moon Well))) Equal to True)
                                    • Then - Actions
                                      • Unit - Create 5 Archer for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • ((Owner of (Triggering unit)) Equal to Player 1 (Red)) and (((Playable map area) contains (Random unit from (Units owned by (Picked player) of type Ancient of War))) Equal to True)
                                        • Then - Actions
                                          • Unit - Create 5 Huntress for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                            • Then - Actions
                                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                • If - Conditions
                                                  • ((Owner of (Triggering unit)) Equal to Player 1 (Red)) and (((Playable map area) contains (Random unit from (Units owned by (Picked player) of type Ziggurat))) Equal to True)
                                                • Then - Actions
                                                  • Unit - Create 5 Ghoul for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
                                                • Else - Actions
                                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    • If - Conditions
                                                      • ((Owner of (Triggering unit)) Equal to Player 1 (Red)) and (((Playable map area) contains (Random unit from (Units owned by (Picked player) of type Crypt))) Equal to True)
                                                    • Then - Actions
                                                      • Unit - Create 5 Crypt Fiend for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
                                                    • Else - Actions
                                            • Else - Actions
                                • Else - Actions
                    • Else - Actions
        • Else - Actions
so the thing i need help on is that no matter what the building i have built is it always spawns grunts.

Burrow=grunts
Barracks(orc)=Headhunters

Farm=Footmen
Barracks(human)=Riflemen

Ziggrat=Ghouls
Crypt=Crypt Fiend

Moon Well=Archer
Ancient of War=Huntress

What the spell is suppose too do is if i have a currently have a farm then i summon units from the next upgrade which is Riflemen from the barracks.
id you don't understand tell me.
 
Last edited:
First off, it should be like this:
  • Trigger
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Future
    • (Owner of (Triggering unit)) Equal to Player 1 (Red)
  • Actions
    • Set Point = (Position of (Triggering unit))
    • Custom script: set bj_wantDestroyGroup = true
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Number of living Orc Burrow units owned by Player 1 (Red)) Greater than 0
      • Then - Actions
        • For each (Integer A) from 1 to 5, do (Actions)
          • Loop - Actions
            • Unit - Create 1 Grunt for (Triggering player) at Point facing Default building facing degrees
      • Else - Actions
    • Custom script: call RemoveLocation (udg_Point)
Do the same actions for the rest building types.

Now, if I understood correctly, you cast the ability and the ability checks what buildings you own. If the building is e.g. Farm, it will spawn Footmen; if it isBarracks, it will spawn Riflemen. If so, this is the trigger to follow:
  • Ab
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red) matching ((((Matching unit) is A structure) Equal to True) and ((Life of (Matching unit)) Greater than (0.41 - 0.05)))) and do (Actions)
        • Loop - Actions
          • Set Point1 = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Farm
            • Then - Actions
              • For each (Integer A) from 1 to 5, do (Actions)
                • Loop - Actions
                  • Unit - Create 1 Footman for Player 1 (Red) at Point1 facing Default building facing degrees
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Picked unit)) Equal to Barracks
                • Then - Actions
                  • For each (Integer A) from 1 to 5, do (Actions)
                    • Loop - Actions
                      • Unit - Create 1 Rifleman for Player 1 (Red) at Point1 facing Default building facing degrees
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Picked unit)) Equal to Orc Burrow
                    • Then - Actions
                      • For each (Integer A) from 1 to 5, do (Actions)
                        • Loop - Actions
                          • Unit - Create 1 Grunt for Player 1 (Red) at Point1 facing Default building facing degrees
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Picked unit)) Equal to Barracks
                        • Then - Actions
                          • For each (Integer A) from 1 to 5, do (Actions)
                            • Loop - Actions
                              • Unit - Create 1 Troll Headhunter for Player 1 (Red) at Point1 facing Default building facing degrees
                        • Else - Actions
          • Custom script: call RemoveLocation (udg_Point1)
 

Attachments

  • Future.w3x
    17.6 KB · Views: 43
Level 6
Joined
Sep 27, 2008
Messages
258
oh ok i see now does that work for player 1-12?

sice there is 1 hero with the ability and ony can be seleceted 1 time
 
Every player share the same hero (a) or there is one hero for every player (b)? If (a), you can't detect what player cast the ability on a shared unit; if (b), then change "Unit Group - Pick every unit in (Units owned by Player 1 (Red) matching" to "Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) matching" and the creation actions (Unit - Create unit), change "Player 1 (Red)" to (Owner of (Triggering unit)) or (Triggering player), which is faster than the previous.
 
Level 6
Joined
Sep 27, 2008
Messages
258
there can only be 1 of the hero in total just player 1-12 can pick him
 
Status
Not open for further replies.
Top