Ok, I made my own health system so I cannot garauntee that this will work, but here is my item function for health increasing items:
PHP Code:
function items_health($item, $adopt){
$mysidia = Registry::get("mysidia");
$health = $mysidia->db->select("owned_adoptables", array("health"), "aid ='{$adopt->aid}'")->fetchObject();
$addHealth = $adopt->health + $item->value;
//Check if the adoptable's health is already at maximum.
if($adopt->health >= 100){
$note = "Your pet is already fully healed! The {$item->itemname} was not used.";
}
//Not at maximum, but don't go overboard!
elseif($addHealth > 100){
$mysidia->db->update("owned_adoptables", array("health" => 100), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
$note = "The {$item->itemname} fully healed your pet!";
$delitem = $item->remove();
}
//Not at maximum, won't go overboard. Proceed.
else{
$mysidia->db->update("owned_adoptables", array("health" => $addHealth), "aid ='{$adopt->aid}' and owner='{$item->owner}'");
$note = "The {$item->itemname} raised your pet's health by {$item->value}! Their health is now at {$addHealth}.";
$delitem = $item->remove();
}
return $note;
}
(also need to edit classes/class_privateitem, and add the function in the database)