View Single Post
  #6  
Old 04-26-2012, 06:37 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 112,691
SilverDragonTears is on a distinguished road
Default

Quote:
Originally Posted by Hall of Famer View Post
You can also do database integration by creating a new field in table prefix.adoptables that stores the number of babies a specific species can produce. It can get quite tricky for interspecies breeding though, so I do not recommend it at this moment.
I know you aren't feeling well but I need this. I need to keep the rares and ultra rares from breeding more than 1 at a time.
I figured out a difficult and probably source consuming way....
Code:
 
        else{


        if ($female->type == 'Cake Dragon') $num = mt_rand(0, 1);
        else if ($female->type == 'Sun-up Dragon') $num = mt_rand(0, 1);
        else if ($female->type == 'Sundown Dragon') $num = mt_rand(0, 1);
        else if ($female->type == 'Bastet Dragon') $num = mt_rand(0, 1);
        else if ($male->type == 'Cake Dragon') $num = mt_rand(0, 1);
        else if ($male->type == 'Sun-up Dragon') $num = mt_rand(0, 1);
        else if ($male->type == 'Sundown Dragon') $num = mt_rand(0, 1);
        else if ($male->type == 'Bastet Dragon') $num = mt_rand(0, 1);
        else if ($female->type == 'Aqua Dragon') $num = mt_rand(0, 4);
        else if ($female->type == 'Cow Amphiptere Dragon') $num = mt_rand(0, 4);
        else if ($male->type == 'Aqua Dragon') $num = mt_rand(0, 4);
        else if ($male->type == 'Cow Amphiptere Dragon') $num = mt_rand(0, 4);
        else $num = mt_rand(0, 5);
        for($i = 0;$i<$num;$i++){
I wanted to just use the rarity variable that is in the adoptables table but I wasn't sure how to call it?
__________________

Check out SilvaTales

Last edited by SilverDragonTears; 04-26-2012 at 07:35 PM.
Reply With Quote