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

My loot system leaks?

Status
Not open for further replies.
Level 7
Joined
Apr 7, 2009
Messages
241
Does this lootdrop trigger leak? Im pretty sure it does.

How can I fix it?

  • Events
    • Unit - A unit owned by Player 12 (Brown) Dies
  • Conditions
  • Actions
    • Set RandomInteger = (Random integer number between 1 and 100)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Furbolg Youngling)) then do (Item - Create Buckler at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Wolf)) then do (Item - Create Wooden Staff at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Dire Wolf)) then do (Item - Create Protective Hide at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 5) and ((Unit-type of (Triggering unit)) Equal to Goreclaw)) then do (Item - Create Buckler at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Pirate)) then do (Item - Create Axe at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Outlaw)) then do (Item - Create Wooden Club at (Position of (Triggering unit))) else do (Do nothing)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Outlaw Ruffian)) then do (Item - Create Wooden Club at (Position of (Triggering unit))) else do (Do nothing)
 
Position of (Triggering unit) leaks.
Set it as a variable, so that it looks like this example:
  • Events
    • Unit - A unit owned by Player 12 (Brown) Dies
  • Conditions
  • Actions
    • Set Point1 = (Position of (Triggering unit))
    • Set RandomInteger = (Random integer number between 1 and 100)
    • If ((RandomInteger Less than or equal to 1) and ((Unit-type of (Triggering unit)) Equal to Furbolg Youngling)) then do (Item - Create Buckler at Point1) else do (Do nothing)
    • Custom script: call RemoveLocation (udg_Point1)
You had better use multiple actions to branch your trigger down. It might become more flexible for the system.

Extras:
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/variables-5896/
http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Status
Not open for further replies.
Top