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

Trigger give 1 gold every second if a or more units are in a region

Status
Not open for further replies.
Level 3
Joined
Mar 7, 2010
Messages
29
hi i m looking for a trigger that is a unit (or more) of a player is in a region named "center" the player owned of units get 1 gold at second
ps: if 2 units are in region the player get 1 gold not 2
 
Level 8
Joined
Jan 8, 2010
Messages
493
  • Events
    • Time - Every 1.00 seconds of game time
  • Conditions
    • (Number of units in (Units in (Region) owned by (Player))) Greater than or equal to 1
  • Actions
    • Custom script: set bj_wantDestroyGroup=true
    • Unit Group - Pick every unit in (Units in (Region) owned by (Player)) and do (Actions)
      • Loop - Actions
        • Player - Add 1 to (Owner of (Picked unit)) Current gold
 
Level 3
Joined
Mar 7, 2010
Messages
29
thx for answer but i dont find this:
(Number of units in (Units in (Region) owned by (Player))) Greater than or equal to 1

and (for information only) what this does?:Custom script: set bj_wantDestroyGroup=true
 
So many answers before I was finished with mine =/
Anyway this loops through Players 1 to 12 and gives 1 gold no matter how many units are in the region (1+)
  • GoldRegion
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set TempGroup = (Units in Region 000 <gen> owned by (Player((Integer A))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in TempGroup) Greater than 0
            • Then - Actions
              • Player - Add 1 to (Player((Integer A))) Current gold
            • Else - Actions
          • Custom script: call DestroyGroup( udg_TempGroup )
 
Level 3
Joined
Mar 7, 2010
Messages
29
dragon thx you too but for me is better 12 different trigger, your trigger is the bast but too hard for me
thx all!
 
Status
Not open for further replies.
Top