THANK YOU THANK YOU THANK YOU!!!!
I did have to tweak it a little bit and I'm really surprised I got it working. x.x I'm horrible with PHP (Inexperienced and dyslexic), but for those who want this for their site, this is the code that worked for me. Don't forget to replace my pet types with your own!
PHP Code:
function items_random($item, $adopt){
$mysidia = Registry::get("mysidia");
$random = rand(1,9);
if($random >= 1 && $random <= 3){
$newtype = ('Chestnut Unicorn');
}
elseif($random >= 4 && $random <= 6){
$newtype = ('Sienna Kirin');
}
elseif($random >= 7 && $random <= 9){
$newtype = ('Piebald Kirin');
}
$mysidia->db->update("owned_adoptables", array("type" => $newtype), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
$note = "The {$item->itemname} has been successfully used on your pet, it is now an {$newtype}!<br>";
//Update item quantity...
$delitem = $item->remove();
return $note;
}