View Single Post
  #6  
Old 05-31-2016, 08:21 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 152,231
Abronsyth is on a distinguished road
Default

You could do some things to manually add pets, use a rand function to assign each pet as a number. You'll just have to manually add in all of the pet types that you want to be possible from it. I haven't tested it, but I think it'd be something like this. Then just change "speciesA" (etc) to a specific pet type (make sure it is word for word, case and all). Should work, I think, but as I said I haven't tested it, so use at your own risk.
PHP Code:
function items_albino($item$adopt){
  
$mysidia Registry::get("mysidia");
  
$random rand(1,9); 
                    if(
$random >= && $random <= 3){
                    
$newtype = ('speciesA');
                    }
                    elseif(
$random >= && $random <= 6){
                    
$newtype = ('speciesB');
                    }
                    elseif(
$random >= && $random <= 9){
                    
$newtype = ('speciesC');
                    }
  
$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 {$adopt->type}!<br>";
  
//Update item quantity...
  
$delitem $item->remove(); 
  return 
$note;

You could make this challenging for your users by making more common pets have greater probability and less common pets have a lower probability :)
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 05-31-2016 at 08:24 AM.
Reply With Quote