• 🏆 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] Please Analyze this Oil Trigger and tell me what is the problem

Status
Not open for further replies.

  • Oil Multiboard
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set TempForce = (All players controlled by a User player)
      • Multiboard - Create a multiboard with 2 columns and ((Number of players in TempForce) + 1) rows, titled Oil
      • Set OilS_MB = (Last created multiboard)
      • Multiboard - Set the text for OilS_MB item in column 1, row 1 to Players:
      • Multiboard - Set the text for OilS_MB item in column 2, row 1 to Oil:
      • Multiboard - Set the display style for OilS_MB item in column 1, row 1 to Show text and Hide icons
      • Multiboard - Set the display style for OilS_MB item in column 2, row 1 to Show text and Hide icons
      • Multiboard - Set the width for OilS_MB item in column 1, row 1 to 20.00% of the total screen width
      • Multiboard - Set the width for OilS_MB item in column 2, row 1 to 7.00% of the total screen width
      • For each (Integer LoopInteger) from 1 to ((Number of players in TempForce) + 1), do (Actions)
        • Loop - Actions
          • Multiboard - Set the icon for OilS_MB item in column 1, row (LoopInteger + 1) to ReplaceableTextures\WorldEditUI\Editor-Force.blp
          • Multiboard - Set the icon for OilS_MB item in column 2, row (LoopInteger + 1) to ReplaceableTextures\WorldEditUI\Editor-ItemSet.blp
          • Multiboard - Set the display style for OilS_MB item in column 1, row (LoopInteger + 1) to Show text and Show icons
          • Multiboard - Set the display style for OilS_MB item in column 2, row (LoopInteger + 1) to Show text and Show icons
          • Multiboard - Set the text for OilS_MB item in column 1, row (LoopInteger + 1) to (Name of (Player(LoopInteger)))
          • Multiboard - Set the text for OilS_MB item in column 2, row (LoopInteger + 1) to (String(OilS_OilInt[LoopInteger]))
          • Multiboard - Set the width for OilS_MB item in column 1, row (LoopInteger + 1) to 20.00% of the total screen width
          • Multiboard - Set the width for OilS_MB item in column 2, row (LoopInteger + 1) to 7.00% of the total screen width
      • Multiboard - Show OilS_MB
      • Custom script: call DestroyForce(udg_TempForce)
  • Oil Gathering Part 1
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(resumeharvesting))
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Oil Tanker (Orc)
          • (Unit-type of (Triggering unit)) Equal to Oil Tanker (Human)
    • Actions
      • Unit - Create 1 Oil Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add a 6.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Oil Dummy to (Last created unit)
      • Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Triggering unit)
      • Unit Group - Add (Triggering unit) to OilDummyHarvesters
  • Shipyards and Refineries
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Shipyard (Orc)) and do (Actions)
        • Loop - Actions
          • Set ShipyardPositionOrc = (Position of (Picked unit))
          • Set TempOilGroup[1] = (Units within 200.00 of ShipyardPositionOrc matching ((Unit-type of (Matching unit)) Equal to Oil Tanker (Orc)))
      • Unit Group - Pick every unit in (Units of type Oil Refinery (Orc)) and do (Actions)
        • Loop - Actions
          • Set RefineryPostionOrc = (Position of (Picked unit))
          • Set TempOilGroup[2] = (Units within 200.00 of RefineryPostionOrc matching ((Unit-type of (Matching unit)) Equal to Oil Tanker (Orc)))
      • Unit Group - Pick every unit in (Units of type Shipyard (Human)) and do (Actions)
        • Loop - Actions
          • Set ShipyardPositionHuman = (Position of (Picked unit))
          • Set TempOilGroup[3] = (Units within 200.00 of ShipyardPositionHuman matching ((Unit-type of (Matching unit)) Equal to Oil Tanker (Human)))
      • Unit Group - Pick every unit in (Units of type Oil Refinery (Human)) and do (Actions)
        • Loop - Actions
          • Set RefineryPostionHuman = (Position of (Picked unit))
          • Set TempOilGroup[4] = (Units within 200.00 of RefineryPostionHuman matching ((Unit-type of (Matching unit)) Equal to Oil Tanker (Human)))
      • -------- ------------------- --------
      • Unit Group - Pick every unit in TempOilGroup[1] and do (Actions)
        • Loop - Actions
          • Unit - Remove Oil buff from (Picked unit)
      • Unit Group - Pick every unit in TempOilGroup[2] and do (Actions)
        • Loop - Actions
          • Unit - Remove Oil buff from (Picked unit)
      • Unit Group - Pick every unit in TempOilGroup[3] and do (Actions)
        • Loop - Actions
          • Unit - Remove Oil buff from (Picked unit)
      • Unit Group - Pick every unit in TempOilGroup[4] and do (Actions)
        • Loop - Actions
          • Unit - Remove Oil buff from (Picked unit)
  • Oil Gathering Part 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • (OilDummyHarvesters is empty) Equal to False
    • Actions
      • Unit Group - Pick every unit in OilDummyHarvesters and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Oil ) Equal to False
            • Then - Actions
              • Player - Add -100 to (Owner of (Picked unit)) Current gold
              • Set OilS_OilInt[(Player number of (Owner of (Picked unit)))] = (OilS_OilInt[(Player number of (Owner of (Picked unit)))] + 100)
              • Multiboard - Set the text for OilS_MB item in column 2, row ((Player number of (Owner of (Triggering unit))) + 1) to (String(OilS_OilInt[(Player number of (Owner of (Triggering unit)))]))
            • Else - Actions
don't mind the leaks, I'll fix them later
the problem is, the buff of the oil tankers doesn't go away D:
please help me fix it D:
 
Status
Not open for further replies.
Top