• 🏆 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] Gold for Mana

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Put them in a Unit Group and enumerate them once in a second, and checks the building's mana each time you enumerate them.
If Mana >= Threshold, reduce Mana, give Player gold
Else, Do nothing. <<< This do nothing literally don't put anything inside the Else block.
 
Level 7
Joined
Sep 19, 2012
Messages
204
I have tried it but im stuck again...i cant find a function that reduces the mana of a unit for a special amount..only a "set mana to" function...
im not even sure if what ive done so far is what you have described...

Code:
test
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in (Units of type Mining Facility) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Mana of (Picked unit)) Greater than or equal to 10.00
                    Then - Actions
                        Player - Add 10 to (Owner of (Picked unit)) Current gold
                    Else - Actions
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
  • test
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Mining Facility) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Mana of (Picked unit)) Greater than or equal to 10.00
            • Then - Actions
              • Player - Add 10 to (Owner of (Picked unit)) Current gold
            • Else - Actions
You should also upload triggers using trigger tags. And if they are big enough use hidden tags.

[hidden="Trigger name normally here"][trigger]paste copied trigger here[/trigger][/hidden]

Looks like this.
  • paste copied trigger here
 
Status
Not open for further replies.
Top