if ($numrows < gGetCreatureMax($acc["id"])) { echo 'It hops to your castle!<br>'; $sql = "INSERT INTO summons (account, creature) VALUES ('{$acc['id']}', '{$gdWhiteRabbitId}')"; $result = $db->query($sql); } else { echo 'It runs away.<br>'; } } if ($encounter == 19) { echo ' You encounter ', $gdEncounters[$encounter][0], '.<br> '; $sql = "SELECT count(*) FROM summons WHERE account = '{$acc['id']}'"; $result = $db->query($sql); $numrows = $db->result($result, 0); if ($numrows < gGetCreatureMax($acc["id"])) { $sql = "SELECT count(*) FROM summons WHERE creature = '{$gdWhiteRabbitId}' AND account = '{$acc['id']}'"; $result = $db->query($sql); $whiterabbits = $db->result($result, 0); if ($whiterabbits > 0) { echo 'It hops to your castle!<br>'; $sql = "INSERT INTO summons (account, creature) VALUES ('{$acc['id']}', '{$gdBabyWhiteRabbitId}')"; $result = $db->query($sql); } else { echo 'It runs away.<br>'; } } else { echo 'It runs away.<br>'; } } if ($encounter == 20) {
$result = $db->query($sql); $numrows = $db->num_rows($result); if ($numrows != 0) { echo 'That kingdom already has a special egg like that. It can\'t have more than one.<br>'; $no = 1; }*/ $sql = "SELECT s.id FROM summons AS s, accounts AS a WHERE a.kingdom = '{$row['kingdom']}' AND s.account = a.id AND s.creature = '{$cid}'"; $result = $db->query($sql); $numrows = $db->num_rows($result); if ($numrows != 0) { echo 'That kingdom already has a special creature like that. It can\'t have more than one.<br>'; $no = 1; } } $maxcreatures = gGetCreatureMax($accid); $sql = "SELECT COUNT(*) FROM summons WHERE account = '{$accid}'"; $result = $db->query($sql); $numrows = $db->result($result, 0); if ($numrows >= $maxcreatures) { echo 'That mage can\'t have any more creatures because ', strtolower($gdGenders[$row["gender"]]["s"]), ' has reached ', strtolower($gdGenders[$row["gender"]]["a"]), ' creature maximum.<br>'; $no = 1; } } } if ($no == 0) { $demon = FALSE; if (!$demon) { // now round each modifier to an integer $list = explode(";", $egg["mods"]); $egg["mods"] = "";
} } if ($acc["attacked"] && $acc["level"] > gdUnderAttackSummoningLimit) { $output .= 'You can\'t spend resources while you are under attack.<br>'; $no = 1; } if ($no == 0) { $successful = FALSE; $sql = "LOCK TABLES accbuildings WRITE, buildings WRITE, summons LOW_PRIORITY WRITE, accitems WRITE, amulets WRITE, accounts LOW_PRIORITY WRITE"; $result = $db->query($sql); $sql = "SELECT id FROM amulets WHERE id = '{$amid}'"; $result = $db->query($sql); $numrows = $db->num_rows($result); if ($numrows == 1) { if ($row["type"] == 0) { $maxcreatures = gGetCreatureMax($acc["id"]); $sql = "SELECT COUNT(*) FROM summons WHERE account = '{$acc['id']}'"; $result = $db->query($sql); $numrows = $db->result($result, 0); if ($numrows < $maxcreatures) { $sql = "INSERT INTO summons (account, creature, mods) VALUES ('{$acc['id']}', '{$row['target']}', '" . $row["mods"] . "')"; $result = $db->query($sql); $text = "Creature"; $successful = TRUE; } else { $output .= 'You already have ' . $maxcreatures . ' creatures. You can\'t summon a new one.<br>'; } } else { $sql = "INSERT INTO accitems (account, item, modvalue1, modvalue2, special, specialrace, specialracename) VALUES ('{$acc['id']}', '{$row['target']}', '{$row['modvalue1']}', '{$row['modvalue2']}', '{$row['special']}', '{$row['specialrace']}', '{$row['specialracename']}')"; $result = $db->query($sql); $text = "Item";