here is ur line
set $nick($chan,$rand(1,$nick($chan,0)))
no %random in it an yes no real need to set any vars as Jethro_ stated.
the output of ur snippet is this
<~napa182> !spin <~SlickOne> napa182 spins the bottle <~SlickOne> the bottle is slowing down <~SlickOne> it landed on