• 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.

Adding a chance to drop an item with triggers

Status
Not open for further replies.
Create a real, or integer variable. In the example I use integer.

Make a trigger with event "Unit - A Unit Dies".

Put in, a new condition, a "Unit Type Comparison".
Here you check for the dying unit type.

Then as first action you get a random integer from, for example, 1 to 100.
  • Set Int = (Random Integer Between 1 and 100)
Then you make If-statements to check for the random value and create the appropriate item. (via Integer Comparison)
For example, if "Int" is lower than "25" you create a rare item, else, you create a normal item.
 
Level 8
Joined
Jul 29, 2010
Messages
319
Create a real, or integer variable. In the example I use integer.

Make a trigger with event "Unit - A Unit Dies".

Put in, a new condition, a "Unit Type Comparison".
Here you check for the dying unit type.

Then as first action you get a random integer from, for example, 1 to 100.
  • Set Int = (Random Integer Between 1 and 100)
Then you make If-statements to check for the random value and create the appropriate item. (via Integer Comparison)
For example, if "Int" is lower than "25" you create a rare item, else, you create a normal item.
Thanks :D :D
 
Status
Not open for further replies.
Top