• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Leak Expertise Needed

Status
Not open for further replies.
Level 3
Joined
Dec 8, 2008
Messages
29
*sigh* How bad does this leak...?

  • Actions
    • Set RandomItem = (Random integer number between 1 and 4)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • RandomItem Equal to 1
      • Then - Actions
        • If ((Random integer number between 1 and 5) Equal to 2) then do (Item - Create Worn Sword at (Position of (Triggering unit))) else do (Do nothing)
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • RandomItem Equal to 2
      • Then - Actions
        • If ((Random integer number between 1 and 5) Equal to 4) then do (Item - Create Burnished Shield at (Position of (Triggering unit))) else do (Do nothing)
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • RandomItem Equal to 3
      • Then - Actions
        • If ((Random integer number between 1 and 5) Equal to 1) then do (Item - Create Bearskin Headpiece at (Position of (Triggering unit))) else do (Do nothing)
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • RandomItem Equal to 4
      • Then - Actions
        • If ((Random integer number between 1 and 5) Equal to 3) then do (Item - Create Mark of Veruse at (Position of (Triggering unit))) else do (Do nothing)
      • Else - Actions
    • Set RandomItem = 0
 
Level 3
Joined
Sep 13, 2008
Messages
63
1 for "(Position of (Triggering unit))"

At the start set some variable (point) to "(Position of (Triggering unit))" and replace "(Position of (Triggering unit))" with the variable. And add this to the end (remove the < and >):
  • Actions
    • Custom script: call RemoveLocation(udg_<Your variable name>)
    • Custom script: set udg_<Your variable name> = null
Sleep...
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Also nest those if/then/else actions, it'll make your trigger slightly more efficient. You see, now it checks the value of RandomItem 4 times, while if you would nest them, it would only have to check the value of RandomItem one time if it's equal to 1, two times if it's equal to 2, etc.
 
Status
Not open for further replies.
Top