View Single Post
  #10  
Old 04-24-2012, 08:36 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 591,502
Hall of Famer is on a distinguished road
Default

Well I see, looks like it is because of the way you modify your code. XD You only get 0 or 1 baby from the last two tries because you have this 'breeding chance' settings. Here:

PHP Code:
$bredtemp rand(0,100); 
            if(
$bredtemp <= "50"){ 
            
$article_content "<center> <img src='http://taleofdragons.net/get/".$maleid.".gif'><br> <img src='http://taleofdragons.net/get/".$femaleid.".gif'><br> These two don't seem very interested in each other right now. Try again in a week."
     } 
According to this, the $bredtemp generates a number between 0 to 100, but only when this random number is below 50 will breeding actually occur. For this reason you wont get 3 dragons unless the variable $bredtemp gets a random number below 50 everytime. See the logic? Since each time breeding has 50% chance to succeed, it makes perfect sense why you get 1 out of 3 last time, and 2 out of 4 the first time. The script will work normally if you remove the 'breeding chance' code.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote