Simple way to do basic chance based outcomes:
PHP Code:
if(!random(2)) //50%
if(!random(4)) //25%
if(random(4)) //75%
if(!random(10)) //10%
if(random(10)) //90%
//etc
Stoned Ape