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.