/* ****************
Healing Potion
***************** */
if ($isloggedin == "yes") {
if ($act == "Healing") {
if ($id == "" or !is_numeric($id)) {
$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;
} else {
$query = "DELETE FROM `adopts_owned_items` WHERE `aid`='$id'";
$result = mysql_query($query);
// die(print_r($query));
// We have what appears to be a valid adoptable ID, so we pull the adoptable's information from the database...
$query = "SELECT * FROM " . $prefix . "owned_adoptables WHERE aid='$aid'";
$result = mysql_query($query);
$num = mysql_numrows($result);
//Loop out code
$i = 0;
while ($i < 1) {
$aid = @mysql_result($result, $i, "aid");
$name = @mysql_result($result, $i, "name");
$owner = @mysql_result($result, $i, "owner");
$health = @mysql_result($result, $i, "health");
$i++;
}
if ($health < "20") {
// Now we see if the adoptable is dead. If it is, we do not heal...
if ($health == "0") {
$article_title = "This Companion is DEAD!";
$article_content = "<br /><br /> This Companion has died and is well beyound the abilities of this Healing Potion!";
} else {
// Add health points to the total health of this adoptable...
$newhealth = $health + 5;
// Actually insert our health information into the database...
$query = "UPDATE " . $prefix . "owned_adoptables SET health='" . $newhealth . "' WHERE aid='" . $aid . "'";
mysql_query($query);
// End the if statement of healing
$image = getcurrentimage($aid);
$itemimage = getcurrentitemimage($id);
$article_title = "Healing Potion";
$article_content = "<br /><br /><center><img src=" . $image . "><br /><br />The Healing Potion has eased " . $name . "'s pain and brought it's health up to " . $newhealth . "/20 !</center>";
}
} else {
// Adoptable is invalid, show an error...
$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;
}
}
}
}