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

Gold/Lumber Income Trigger

Status
Not open for further replies.
Level 3
Joined
Feb 18, 2017
Messages
31
Hey there,


i am working on a strategy map and have a problem with a trigger.

I basicly want to achive this:
If the player has a certain building, lets say the lumber mill, he will get 10 lumber per 10 seconds. But he will only gain lumber aslong as the building is alive. If the building gets destroyed, he wont get the lumber anymore. But i need a trigger that counts the amount of buildings, so lets say the player has 5 lumber mills he will get 50 lumber per 10 seconds (10 per lumber mill).

Everything i tired failed, either the effect wont stack of it will continue even if the building isnt alive anymore.

Would be very grateful for some help/tips!

thank you!
 
Level 11
Joined
Jun 2, 2004
Messages
849
  • Untitled Trigger 001
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set TempUnitGroup = (Units owned by (Picked player) matching ((((Matching unit) is dead) Equal to False)) and (((Unit Type of (Matching Unit)) Equal to Lumber Mill))
          • Player - Add ((Number of units in TempUnitGroup) x 10) to (Picked player) Current lumber
          • Custom script: call DestroyGroup(udg_TempUnitGroup)
 
Status
Not open for further replies.
Top