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

auto gold harvesting problem

Status
Not open for further replies.
Level 9
Joined
Jul 20, 2009
Messages
427
I need help..see I have this trigger that would give me gold whenever I build a goldmine on a gold ore deposit..the problem is I want the income trigger to stop once the ore deposit is depleted?how do i solve this?
  • auto gold
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to GoldMine
    • Actions
      • Set A = A
      • Set Building[A] = 0
      • Set G_Alchem[(Player number of (Owner of (Triggering unit)))] = 5
      • For each (Integer Building[B]) from 0 to 1000000, do (Actions)
        • Loop - Actions
          • -------- Text loops 3 times --------
          • Wait 1.00 game-time seconds
          • Floating Text - Destroy GoldText_A1[(Player number of (Owner of (Triggering unit)))]
          • Set Grupo = (Units within 50.00 of (Position of (Constructed structure)) matching ((Unit-type of (Matching unit)) Equal to Gold ore deposit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in Grupo) Equal to 0
              • ((Triggering unit) is alive) Equal to False
            • Then - Actions
              • Floating Text - Destroy GoldText_A1[(Player number of (Owner of (Triggering unit)))]
              • Floating Text - Destroy GoldText_A2[(Player number of (Owner of (Triggering unit)))]
              • Floating Text - Destroy GoldText_A3[(Player number of (Owner of (Triggering unit)))]
              • Skip remaining actions
            • Else - Actions
              • Do nothing
          • Set Temp_Point = (Position of (Triggering unit))
          • Player - Add G_Alchem[(Player number of (Owner of (Triggering unit)))] to (Owner of (Triggering unit)) Current gold
          • Floating Text - Create floating text that reads (+ + (String(G_Alchem[(Player number of (Owner of (Triggering unit)))]))) at (Position of (Triggering unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
          • Floating Text - Change (Last created floating text): Disable permanence
          • Unit Group - Pick every unit in Grupo and do (Actions)
            • Loop - Actions
              • Unit - Cause (Picked unit) to damage (Picked unit), dealing 5.00 damage of attack type Spells and damage type Divine
          • Set GoldText_A1[(Player number of (Owner of (Triggering unit)))] = (Last created floating text)
          • Wait 1.00 game-time seconds
          • Floating Text - Destroy GoldText_A2[(Player number of (Owner of (Triggering unit)))]
          • Set Grupo = (Units within 50.00 of (Position of (Constructed structure)) matching ((Unit-type of (Matching unit)) Equal to Gold ore deposit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in Grupo) Equal to 0
              • ((Triggering unit) is alive) Equal to False
            • Then - Actions
              • Floating Text - Destroy GoldText_A1[(Player number of (Owner of (Triggering unit)))]
              • Floating Text - Destroy GoldText_A2[(Player number of (Owner of (Triggering unit)))]
              • Floating Text - Destroy GoldText_A3[(Player number of (Owner of (Triggering unit)))]
              • Skip remaining actions
            • Else - Actions
              • Do nothing
          • Player - Add G_Alchem[(Player number of (Owner of (Triggering unit)))] to (Owner of (Triggering unit)) Current gold
          • Floating Text - Create floating text that reads (+ + (String(G_Alchem[(Player number of (Owner of (Triggering unit)))]))) at (Position of (Triggering unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
          • Floating Text - Change (Last created floating text): Disable permanence
          • Unit Group - Pick every unit in Grupo and do (Actions)
            • Loop - Actions
              • Unit - Cause (Picked unit) to damage (Picked unit), dealing 5.00 damage of attack type Spells and damage type Divine
          • Set GoldText_A2[(Player number of (Owner of (Triggering unit)))] = (Last created floating text)
          • Wait 1.00 game-time seconds
          • Floating Text - Destroy GoldText_A3[(Player number of (Owner of (Triggering unit)))]
          • Set Grupo = (Units within 50.00 of (Position of (Constructed structure)) matching ((Unit-type of (Matching unit)) Equal to Gold ore deposit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) is alive) Equal to False
              • (Number of units in Grupo) Equal to 0
            • Then - Actions
              • Floating Text - Destroy GoldText_A1[(Player number of (Owner of (Triggering unit)))]
              • Floating Text - Destroy GoldText_A2[(Player number of (Owner of (Triggering unit)))]
              • Floating Text - Destroy GoldText_A3[(Player number of (Owner of (Triggering unit)))]
              • Skip remaining actions
            • Else - Actions
              • Do nothing
          • Player - Add G_Alchem[(Player number of (Owner of (Triggering unit)))] to (Owner of (Triggering unit)) Current gold
          • Floating Text - Create floating text that reads (+ + (String(G_Alchem[(Player number of (Owner of (Triggering unit)))]))) at (Position of (Triggering unit)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
          • Floating Text - Change (Last created floating text): Disable permanence
          • Unit Group - Pick every unit in Grupo and do (Actions)
            • Loop - Actions
              • Unit - Cause (Picked unit) to damage (Picked unit), dealing 5.00 damage of attack type Spells and damage type Divine
          • Set GoldText_A3[(Player number of (Owner of (Triggering unit)))] = (Last created floating text)
          • Set Building[B] = (Building[B] + 1)
          • Custom script: call RemoveLocation (udg_Temp_Point)
      • If (((Triggering unit) is alive) Equal to False) then do (Skip remaining actions) else do (Do nothing)
 
Status
Not open for further replies.
Top