%RANDOM := 1D3
IF %RANDOM = 1 THEN $ITEMSTATE1 := 1
IF %RANDOM = 2 THEN $ITEMSTATE2 := 1
IF %RANDOM = 3 THEN $ITEMSTATE3 := 1
This essentially uses a random value to set which item should be in the player's inventory. Replace the number after the ITEMSTATE with the number of each item. Advanced scripting needed.