View Single Post
  #7  
Old 05-31-2016, 10:33 PM
NobodysHero's Avatar
NobodysHero NobodysHero is offline
Co-Owner of MystFell
 
Join Date: Nov 2013
Posts: 144
Gender: Female
Credits: 24,961
NobodysHero is on a distinguished road
Default

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 >= && $random <= 3){
                    
$newtype = ('Chestnut Unicorn');
                    }
                    elseif(
$random >= && $random <= 6){
                    
$newtype = ('Sienna Kirin');
                    }
                    elseif(
$random >= && $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;

Reply With Quote