Ok it told me my dragons had 4 babies... but I only got two eggs?
Here's what I have....Also can I show the images of each new baby? I know how to show one but not the others?
Code:
else {
$num = mt_rand(1, 5);
for($i = 0;$i<$num;$i++){
// we choose the type!
$types = array($female->type, $male->type);
$typerand = rand(0,1);
// we choose the gender
$tempgender = rand(0, 99);
if($tempgender < $row->genderratio) {
$gender = "f";
$alts = "yes";
unset($tempgender);
}
else {
$gender = "m";
$alts = "no";
unset($tempgender);
}
$salt = passgenerator(10, 0);
$aid = passgenerator(5, 0);
$code = codegen(10, 0);
$time = time();
$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.";
}
else{
$adopts->insert("owned_adoptables", array("aid" => $aid, "type" => $types[$typerand], "name" => $aid, "owner" => $loggedinname, "currentlevel" => 0, "totalclicks" => 0, "code" => $code,
"imageurl" => NULL, "usealternates" => $alts, "tradestatus" => 'notfortrade', "isfrozen" => 'no', "gender" => $gender, "lastbred" => 0, "date" => $date, "father" => $maleid, "mother" => $femaleid));
} // the end of for loop
$article_content = "
<center>
<img src='http://taleofdragons.net/get/".$maleid.".gif'><br>
<img src='http://taleofdragons.net/get/".$femaleid.".gif'></center><br>".$imageurl."Congratulations! Breeding is successful, you have acquired {$num} babies from breeding!<br>
<a href='myadopts.php?act=stats&id=".$aid."'><img src='http://taleofdragons.net/get/".$aid.".gif'></a></p>";
}
$adopts->update("owned_adoptables", array("lastbred" => $time), "aid = '{$femaleid}'");
$adopts->update("owned_adoptables", array("lastbred" => $time), "aid = '{$maleid}'");
} // we end the place where it goes on if the levels are ok
} //this bracket ends the else where we find the male/female id's
}