• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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.
 
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.
Back
Top