e.g. 10% chance to do action A, 10% chance to do action B, 80% chance to do action C
Why dont u just create the item at the position of dying unit?
A unit dies
unit = ur unit <<< this isnt needed
create 1 Potion of Health at position of dying unit
(OR what I use for my RPG's is create 1 random artifact of level 8)
and set all the items I use to lvl 8 artifacts so the unit will drop one of them and you can even check the level of the dying unit or life and drop an item from a group that fits the unit, peasant drops mantle of intelligence, ogre drops boots of speed.