$text .= addslashes(gEchoGem($gems[$m])) . "<br>"; } foreach ($donateothers as $key => $other) { $data = explode("-", $key); $otype = $data[0]; $oid = $data[1]; switch ($otype) { // Itherian item case 1: $sql = "UPDATE Itherian SET account = '{$aid}' WHERE id = '{$oid}'"; $result = $db->query($sql); // get amount of sacs $sql = "SELECT count(*) FROM Itheriansacs WHERE Itherian = '{$oid}' AND used = 'no'"; $result = $db->query($sql); $sacs = $db->result($result, 0); $text .= gEchoItherian($other, $sacs) . "<br>"; $amount = 1; break; // Nether Orb // Nether Orb case 2: $sql = "UPDATE accorbs SET account = '{$aid}' WHERE id = '{$oid}'"; $result = $db->query($sql); $text .= gGetOrbDescription($other) . "<br>"; $amount = 2; break; // package // package case 3: $sql = "UPDATE packages SET account = '{$aid}' WHERE id = '{$oid}'"; $result = $db->query($sql);
$result = $db->query($sql); $signs = $db->result($result, 0); echo 'Please select the Itherian item on which you want to cast this orb spell. It has to have at least ', $signs, ' sacrificed creature souls left in it. You can only see unbound Itherian items here which haven\'t been used yet with this particular orb.<br><br>'; $sql = "SELECT i.*, it.id AS itid, it.bonus FROM (Itherian AS it, items AS i) LEFT JOIN orblogs AS ol ON ol.orb = '{$aoid}' AND ol.type = 'Itherian' AND ol.target = it.id WHERE it.account = '{$acc['id']}' AND it.item = i.id AND ol.orb IS NULL ORDER BY i.name ASC, it.id ASC"; $nresult = $db->query($sql); $numrows = $db->num_rows($nresult); if ($numrows == 0) { echo 'You don\'t have any unbound Itherian items for this orb.<br>'; } while ($row = $db->fetch_array($nresult)) { // get amount of sacs $sql = "SELECT count(*) FROM Itheriansacs WHERE Itherian = '{$row['itid']}' AND used = 'no'"; $result = $db->query($sql); $sacs = $db->result($result, 0); if ($sacs >= $signs) { echo '<a href="index.php?page=items&action=castitherian2&aoid=', $aoid, '&itid=', $row["itid"], '">', gEchoItherian($row, $sacs), '</a><br>'; } } } } if ($action == "castitherian2") { $no = 0; $sql = "SELECT o.color, ao.* FROM accorbs AS ao, orbs AS o WHERE ao.id = '{$aoid}' AND ao.account = '{$acc['id']}' AND ao.orb = o.id"; $result = $db->query($sql); $numrows = $db->num_rows($result); if ($numrows != 1) { echo 'Invalid aoid.<br>'; $no = 1; } else { $orb = $db->fetch_array($result); }
} } if ($action == "sacrificearcane") { echo 'Please select the Itherian item in which you want to sacrifice this creature.<br><br>'; $sql = "SELECT i.*, it.id AS itid, it.bonus FROM Itherian AS it, items AS i WHERE it.account = '{$acc['id']}' AND it.item = i.id ORDER BY i.name ASC, it.id ASC"; $nresult = $db->query($sql); $numrows = $db->num_rows($nresult); if ($numrows == 0) { echo 'You don\'t have any unbound Itherian items.<br>'; } while ($row = $db->fetch_array($nresult)) { // get amount of sacs $sql = "SELECT count(*) FROM Itheriansacs WHERE Itherian = '{$row['itid']}' AND used = 'no'"; $result = $db->query($sql); $sacs = $db->result($result, 0); echo '<a href="index.php?page=creatures&action=sacrificearcane2&sid=', $sid, '&itid=', $row["itid"], '">', gEchoItherian($row, $sacs), '</a><br>'; } } if ($action == "sacrificearcane2") { $no == 0; $sql = "SELECT {$gdCreatureSelect} FROM (summons AS s, creatures AS c, races AS r) LEFT JOIN accitems AS ai ON s.item = ai.id LEFT JOIN items AS i ON ai.item = i.id WHERE s.account = '{$acc['id']}' AND s.creature = c.id AND c.race = r.id AND s.id = '{$sid}'"; $result = $db->query($sql); $numrows = $db->num_rows($result); if ($numrows != 1) { echo 'Invalid sid.'; $no = 1; } else { $row = $db->fetch_array($result); $creature = new Creature($row); $skill = $creature->data["skill"]; if ($row["status"] != 0) {
// other items (including Itherian & Nether Orbs) $array = array(); $array[0]["value"] = 0; $array[0]["name"] = "no other item"; // get Itherian items $tmp = array(); if ($acc["level"] >= gdArcaneLevelMin) { $sql = "SELECT i.*, it.id AS itid, it.bonus FROM Itherian AS it, items AS i WHERE it.account = '{$acc['id']}' AND it.item = i.id ORDER BY i.name ASC, it.id ASC"; $nresult = $db->query($sql); while ($row = $db->fetch_array($nresult)) { // get amount of sacs $sql = "SELECT count(*) FROM Itheriansacs WHERE Itherian = '{$row['itid']}' AND used = 'no'"; $result = $db->query($sql); $sacs = $db->result($result, 0); // get output $tmp["name"] = gEchoItherian($row, $sacs); $tmp["value"] = "1-" . $row["itid"]; $array[] = $tmp; } } // get Nether orbs items if ($acc["level"] >= gdArcaneLevelMin) { $sql = "SELECT o.color, ao.uses, ao.id FROM accorbs AS ao, orbs AS o WHERE ao.account = '{$acc['id']}' AND ao.orb = o.id ORDER BY o.color ASC, ao.uses ASC"; $result = $db->query($sql); $numrows = $db->num_rows($result); while ($row = $db->fetch_array($result)) { $tmp["name"] = gGetOrbDescription($row); $tmp["value"] = "2-" . $row["id"]; $array[] = $tmp; } }