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

Basic drop sistems

Level 10
Joined
Feb 13, 2010
Messages
116
Ok we have 2 trigers that drop items when a creep its killed
First: Used for multyple item drop
This item drop chance uses integer(variable) to determinate chance to drop an item.
  • Item Drop Chance
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • -------- We set the random's --------
      • -------- random = integer --------
      • Set Random1 = (Random integer number between 0 and 10)
      • Set Random2 = (Random integer number between 0 and 10)
      • -------- Item 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Lvl 2 Pig Boss
          • Random1 Less than or equal to 5
        • Then - Actions
          • -------- next we chose what creep drop this item and what are the number that random must be so that the item drops. --------
          • -------- So random is a number betewen 0-10 and the required number is 5 or less so that means that the item has a 50% chance to drop when this creep dies --------
          • Item - Create Claws of Attack +15 at (Position of (Triggering unit))
          • -------- then we crate the item at the position of the dyingng unit --------
        • Else - Actions
          • Do nothing
      • -------- and this is the same trigger but for anthoer creep --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Lvl 2 Pig Melle
          • Random1 Less than or equal to 5
        • Then - Actions
          • Item - Create Claws of Attack +15 at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • -------- Item 2 --------
      • -------- Item nr 2 has a 20% chance to drop --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Lvl 2 Pig Boss
          • Random2 Less than or equal to 2
        • Then - Actions
          • Item - Create Runed Gauntlets at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Lvl 2 Pig Melle
          • Random2 Less than or equal to 2
        • Then - Actions
          • Item - Create Runed Gauntlets at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
Two:Used for a single item drop ( Always Drop )
This item drop chance uses integer(variable) to determinate what item to drop.
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • -------- We set the random's --------
      • -------- random = integer --------
      • Set Random1 = (Random integer number between 0 and 3)
      • -------- Item 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Lvl 2 Pig Boss
          • Random1 Equal to 1
        • Then - Actions
          • -------- We set the creep --------
          • -------- And random 1 what nr must be so the trigger start working --------
          • Item - Create Claws of Attack +15 at (Position of (Triggering unit))
          • -------- Chose the item --------
        • Else - Actions
          • Do nothing
      • -------- Item 2 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Lvl 2 Pig Boss
          • Random1 Equal to 2
        • Then - Actions
          • Item - Create Ring of Protection +5 at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • -------- Item 3 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Lvl 2 Pig Boss
          • Random1 Less than or equal to 3
        • Then - Actions
          • Item - Create Heart of Aszune at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • -------- ALL OF THEM MUST BE THE SAME CREEP !!! --------
You can add a item drop chance to this trigger if u whant not to always drop
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • -------- We set the random's --------
      • -------- random = integer --------
      • Set Random1 = (Random integer number between 0 and 3)
      • Set Random2 = (Random integer number between 0 and 10)
      • -------- Item 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Lvl 2 Pig Boss
          • Random1 Equal to 1
          • Random2 Less than or equal to 5
        • Then - Actions
          • -------- We set the creep --------
          • -------- Also set random2 for a chance --------
          • -------- And random 1 what nr must be so the trigger start working --------
          • -------- Also set random2 for a chance --------
          • -------- So random is a number betewen 0-10 and the required number is 5 or less so that means that the item has a 50% chance to drop when this creep dies --------
          • Item - Create Claws of Attack +15 at (Position of (Triggering unit))
          • -------- Chose the item --------
        • Else - Actions
          • Do nothing
      • -------- Item 2 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Lvl 2 Pig Boss
          • Random1 Equal to 2
          • Random2 Less than or equal to 5
        • Then - Actions
          • Item - Create Ring of Protection +5 at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • -------- Item 3 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Lvl 2 Pig Boss
          • Random1 Less than or equal to 3
          • Random2 Less than or equal to 5
        • Then - Actions
          • Item - Create Heart of Aszune at (Position of (Triggering unit))
        • Else - Actions
          • Do nothing
      • -------- ALL OF THEM MUST BE THE SAME CREEP !!! --------
.
 
Last edited:
Basic drop sistems -> Basic drop systems

Btw:

1st. Remove Do Nothing from trigger actions!

2nd. Remove Memory Leaks (example: Item - Create Ring of Protection +5 at (Position of (Triggering unit)))

3th. Items must be added one by one what if I have 100 or more items in my map?
Create setup trigger and set item values there:
  • Set Item[1] = Claws of Attack +3
  • Set Item[2] = Claws of Attack +6
  • Set Item[3] = Claws of Attack +9
  • Set Item[4] = Claws of Attack +12
  • ...
Use something like this then:
  • Item - Create Item[(Random integer number between 0 and 10)] at (TempPoint)
4th. Please Read: How to properly format a tutorial - Please read before posting!

5th. Attach test map!
 
Level 31
Joined
May 3, 2008
Messages
3,155
This tutorial cannot be approve as it does not follow proper tutorial format and was inefficient.

The Do Nothing action are particularly useless as they just called another action that does particularly nothing at all.

To top up with, you leak location and you repeat some of the condition which are not entirely necessary.

This are suppose the way to do it for the first trigger.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Footman
          • (Unit-type of (Triggering unit)) Equal to Knight
          • (Unit-type of (Triggering unit)) Equal to Flying Machine
    • Actions
      • Set int = (Random integer number between 1 and 100)
      • Set position = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • int Less than or equal to 50
        • Then - Actions
          • Item - Create Tome of Experience at position
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • int Less than or equal to 20
        • Then - Actions
          • Item - Create Ring of Protection +5 at position
        • Else - Actions
      • Custom script: call RemoveLocation (udg_position)
as for your second trigger, why need it when it could be done via object editor?

and even if it does, you are doing it at the wrong way.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Footman
          • (Unit-type of (Triggering unit)) Equal to Knight
          • (Unit-type of (Triggering unit)) Equal to Flying Machine
    • Actions
      • Set int = (Random integer number between 1 and 3)
      • Set position = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • int Equal to 1
        • Then - Actions
          • Item - Create Tome of Experience at position
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • int Equal to 2
        • Then - Actions
          • Item - Create Ring of Protection +5 at position
        • Else - Actions
      • Custom script: call RemoveLocation (udg_position)
 
Top