• 🏆 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] help editing trigger 1player only

Status
Not open for further replies.
Level 7
Joined
Oct 6, 2006
Messages
293
Need help turning this trigger into a trigger that supports 8players. Guessing i have to use an integer array and stuff but still learning so any help is gladly accepted.

What it does it that when you enter a region and npc spawns for any hero for any player. It has to remember how many units you bought from the npc before so the more units hired the better units that can be hired later. Right now it only works for player reds 1 hero. It might be to difficult but im going to try it.

  • enter merc region fornow
    • Events
      • Unit - A unit enters Merc Enter <gen>
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Bloodelf Wizard
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Greater than or equal to 0
          • Integer Less than or equal to 5
        • Then - Actions
          • Unit - Create 1 Merhen Tucaray for Player 1 (Red) at (Center of Spawn Merc <gen>) facing Default building facing degrees
          • Trigger - Turn on Remove Merc new <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer Greater than or equal to 6
              • Integer Less than or equal to 10
            • Then - Actions
              • Unit - Create 1 Merhen Tucaray lvl 2 for Player 1 (Red) at (Center of Spawn Merc <gen>) facing Default building facing degrees
              • Trigger - Turn on Remove Merc new <gen>
              • Trigger - Turn off (This trigger)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Greater than or equal to 11
          • Integer Less than or equal to 15
        • Then - Actions
          • Unit - Create 1 Merhen Tucaray lvl 3 for Player 1 (Red) at (Center of Spawn Merc <gen>) facing Default building facing degrees
          • Trigger - Turn on Remove Merc new <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer Greater than or equal to 16
              • Integer Less than or equal to 20
            • Then - Actions
              • Unit - Create 1 Merhen Tucaray lvl 4 for Player 1 (Red) at (Center of Spawn Merc <gen>) facing Default building facing degrees
              • Trigger - Turn on Remove Merc new <gen>
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer Greater than or equal to 21
                  • Integer Less than or equal to 25
                • Then - Actions
                  • Unit - Create 1 Merhen Tucaray lvl 4 for Player 1 (Red) at (Center of Spawn Merc <gen>) facing Default building facing degrees
                  • Trigger - Turn on Remove Merc new <gen>
                  • Trigger - Turn off (This trigger)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Integer Greater than or equal to 26
                      • Integer Less than or equal to 30
                    • Then - Actions
                      • Unit - Create 1 Merhen Tucaray lvl 5 for Player 1 (Red) at (Center of Spawn Merc <gen>) facing Default building facing degrees
                      • Trigger - Turn on Remove Merc new <gen>
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Integer Greater than or equal to 31
                          • Integer Less than or equal to 35
                        • Then - Actions
                          • Unit - Create 1 Merhen Tucaray lvl 5 for Player 1 (Red) at (Center of Spawn Merc <gen>) facing Default building facing degrees
                          • Trigger - Turn on Remove Merc new <gen>
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                          • Do nothing

  • Remove Merc new
    • Events
      • Unit - A unit enters Spawn Merc <gen>
    • Conditions
      • ((((Unit-type of (Entering unit)) Equal to Merhen Tucaray) or ((Unit-type of (Entering unit)) Equal to Merhen Tucaray lvl 3)) or (((Unit-type of (Entering unit)) Equal to Merhen Tucaray Final) or ((Unit-type of (Entering unit)) Equal to Merhen Tucaray lvl 2)) or (((Unit-type of (Entering unit)) Equal to Merhen Tucaray lvl 4) or ((Unit-type of (Entering unit)) Equal to Merhen Tucaray lvl 5))
    • Actions
      • Wait 15.00 seconds
      • Unit - Remove (Entering unit) from the game
      • Trigger - Turn on enter merc region fornow <gen>
      • Trigger - Turn off (This trigger)
  • Create leaderboard
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (((Unit-type of (Selling unit)) Equal to Merhen Tucaray) or (((Unit-type of (Selling unit)) Equal to Merhen Tucaray Final) or ((Unit-type of (Selling unit)) Equal to Merhen Tucaray lvl 2))) or ((((Unit-type of (Selling unit)) Equal to Merhen Tucaray lvl 3) or ((Unit-type of (Selling unit)) Equal to Merhen Tucaray lvl 4)) or ((Unit-type of (Selling unit)) Equal to Merhen Tucaray lvl 5))
    • Actions
      • Leaderboard - Create a leaderboard for (All players matching (((Buying unit) is A Hero) Equal to True)) titled Mercenary Score
      • Leaderboard - Add Player 1 (Red) to (Last created leaderboard) with label Points and value 1
      • Leaderboard - Change the value for Player 1 (Red) in (Last created leaderboard) to Integer
      • Set Integer = (Integer + 1)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Didn't really get the point of the trigger but you need to just make 2 changes.

Instead of Integer, put Integer(player number of (owner of triggering unit)).
This is after you make Integer with an array of course.

Now instead of "create bla bla for Player 1..." put (owner of triggering unit).
 
Level 7
Joined
Oct 6, 2006
Messages
293
Thanx for the reply Ghost
If i could give you the map i think it would be easier to see =|.
hmm its like
1. A unit enters this one spot in the mercenary camp.
2. The hero is a unit and it enters that spot in the camp
3. The hero entering the region spawns an npc dependant on a integer for that player.
4. If the player hasnt bought a unit from the spawned unit before, the integer is 0
5. The unit buys 6 units and leaves the spot, despawning the unit hirer.
6. The unit enters the region again but it spawns a different unit with more units to hire from.
7. After 30 unit purchases from the spawned unit, the next time u enter the region the unit spawns with the full list of mercenarys to purchase from.
8. Now thats all for player 1, if player 2 enters the region and never purchased a unit before, he spawns the first unit hirer with just the basic amount of units. He will have to purchase 30units himself to buy from the unit hirer unless someone spawns the highest lvl unit hirer for him to use.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
1.

Event(s): A unit enters Your_Region

Conditions(s): Triggering unit is a hero

Actions(s): Create a Merc for owner of triggering unit at the center of Your_Region
Set Merc(player number of (owner of triggering unit)) = last created unit
If/Then/Else
If ...
Integer(player number of (owner of triggering unit)) equal or lesser then 5
Then ...
Add selling item to Merc(player number of (owner of triggering unit)) // I don't have the editor infront of me so im not sure whats the name of this


2.

Event(s): A unit sells a unit

Condition(s): Triggering's unit type is Merc

Actions(s): Set Integer(player number of (owner of triggering unit)) = (Integer(player number of (owner of triggering unit)) + 1)


3.

Event(s): A unit leaves Your_Region

Condition(s): Triggering unit is a hero

Actions(s): Remove Merc(player number of (owner of triggering unit))



Sorry I don't have my editor infront of me.

On a second though, you maybe won't want to give control of the merc to the players so they wouldn't be able to move him.
 
Status
Not open for further replies.
Top