require "constants.php";
$title = "Anathema Online - Item Information";
include "index-top.php";
$item = $_GET['item'];
$portions = getInfo(portions,user_items,"WHERE id='$item'");
$type = getInfo(type,user_items,"WHERE id='$item'");
$stat = getInfo("stat",user_items,"WHERE id='$item'");
$poison = explode(':',getInfo(poison,user_items,"WHERE id='$item'"));
$pdamage = $poison[0];
$pturns = $poison[1];
$enchantment = getInfo(enchantment,user_items,"WHERE id='$item'");
$item = getInfo(item,user_items,"WHERE id='$item'");
$conditions = "WHERE id='$item'";
if (!$stat) $stat = getInfo("stat",items,$conditions);
$name = getInfo(name,items,$conditions);
$shop = getInfo(shop,items,$conditions);
$shop = getInfo(name,places,"WHERE id='$shop'");
$price = getInfo(price,items,$conditions);
$totalPortions = getInfo(portions,items,$conditions);
$description = getInfo(description,items,$conditions);
$sex = getInfo(sex,items,$conditions);
$creator = getInfo(creator,items,$conditions);
$typeName = $type;
if ($type) {
$typeName[0] = strtoupper($typeName[0]);
if ($typeName == "Other") $typeName = "Prose";
$name[0] = strtoupper($name[0]);
echo '
';
echo '';
echo '';
echo '';
echo '';
echo '
';
echo '';
echo '';
echo '';
echo '';
echo '';
echo '';
$width = "80%";
if (($type == "clothing") || ($type == "armour") || ($type == "weapon") || ($type == "epic")) {
echo '';
echo ' ';
echo ' | ';
$width = "70%";
}
echo '';
if ($type == "relic") echo $creator."'s ".$name." ";
echo 'Type : '.$typeName.' ';
if ($type == "food") echo '+'.$stat.' hunger per portion ';
if ($type == "drink") echo '+'.$stat.' mana per portion ';
if ($type == "alcohol") echo '+'.$stat.' hunger, +'.round($stat / 4).' intoxication per portion ';
if (($type == "food") || ($type == "drink") || ($type == "alcohol")) echo $portions.'/'.$totalPortions.' portions left ';
if ($type == "poison") {
echo "$stat damage over $portions turn(s)";
}
if ($type == "clothing")
switch ($sex) {
case "m":
echo "Gender : Male ";
break;
case "f":
echo "Gender : Female ";
break;
}
if ($type == "weapon") {
echo "Deals ".$stat." damage ";
echo $portions.'/'.$totalPortions.' health ';
if ($pdamage) echo "$pdamage damage over $pturns turn(s) ";
switch ($sex) {
case "m":
echo "Gender : Male ";
break;
case "f":
echo "Gender : Female ";
break;
}
}
if ($type == "armour") {
echo "Absorbs ".$stat." damage ";
echo $portions.'/'.$totalPortions.' health ';
switch ($sex) {
case "m":
echo "Gender : Male ";
break;
case "f":
echo "Gender : Female ";
break;
}
}
if ($type == "arrows") {
echo "$stat damage ";
echo "$portions arrows ";
if ($pdamage) echo "$pdamage damage over $pturns turn(s) ";
}
if ($type == "door") {
echo "$portions health ";
echo "$stat% chance of being lock-picked ";
}
if ($type == "epic") {
echo "Deals ".round(($stat / 10) * 9)." damage ";
echo "Absorbs ".round(($stat / 10) * 13)." damage ";
echo "Adds ".$stat." to every attacking diceroll ";
echo $portions.'/'.$totalPortions.' health ';
switch ($sex) {
case "m":
echo "Gender : Male ";
break;
case "f":
echo "Gender : Female ";
break;
}
}
echo "Weight: ".count_items($_GET['item'])."kg";
echo ' | ';
echo '';
if ($type == "crate") {
echo 'Contains: ';
$openItems = $stat;
$openItems = explode('.',$openItems);
$max = count($openItems);
for ($i = 0;$i < $max;$i++) {
$item = $openItems[$i];
$itemType = getInfo(type,user_items,"WHERE id='$item'");
if ($itemType == "money") {
if ($openMessage) $openMessage .= ', '.getInfo(portions,user_items,"WHERE id='$item'").' gold coins';
else $openMessage = getInfo(portions,user_items,"WHERE id='$item'").' gold coins';
} else {
$itemName = getInfo(name,user_items,"WHERE id='$item'");
if ($openMessage) $openMessage .= ', '.$itemName.'';
else $openMessage = ''.$itemName.'';
}
}
echo $openMessage.'
';
}
if ($type != "other") echo ''.$description.'';
else echo 'A written document.';
if ($enchantment) {
$spell = getInfo(spell,enchantments,"WHERE id='$enchantment'");
$mana = getInfo(mana,enchantments,"WHERE id='$enchantment'");
$var1 = getInfo(var1,enchantments,"WHERE id='$enchantment'");
$var2 = getInfo(var2,enchantments,"WHERE id='$enchantment'");
$var3 = getInfo(var3,enchantments,"WHERE id='$enchantment'");
if ($spell == "revitalize") $e = "Enchanted to cast revitalize. Raises fatigue of a user by $var1 points.";
if ($spell == "calmAnimals") $e = "Enchanted to cast calm animals. Keeps all NPC creatures on whom this spell is cast from attacking anyone for $var1 hours.";
if ($spell == "divineIntervention") $e = "Enchanted to cast divine intervention. Has a $var2% chance to force a user into their untransformed state for $var1 posts. Requires the user's hair as an ingredient.";
if ($spell == "protection") $e = "Enchanted with protection from curses. $var1% chance of blocking a curse from being cast on the wearer.";
if ($spell == "trace") $e = "Enchanted to cast trace. Has a $var1% chance of revealing the building a user is in.";
if ($spell == "insomniac") $e = "Enchanted to cast insomniac. Will keep a user from passing out from fatigue or sleeping voluntarily until their fatigue drops to -$var1.";
if ($spell == "enrageBeasts") $e = "Enchanted to cast enrage beasts. Makes all NPC creatures on whom this spell is cast attack anyone including their owners and masters for $var1 hours.";
if ($spell == "demonicPossession") $e = "Enchanted to cast demonic possession. Has a $var2% chance of forcing a user into their transformed state for $var1 posts. Requires the user's hair as an ingredient.";
if ($spell == "raiseTheDead") $e = "Enchanted to cast raise the dead. Has a $var2% chance of bringing any corpse (NPC or PC) back to life as a $var1 health undead NPC creature under the caster's command.";
echo " $e";
}
echo ' | ';
echo ' ';
echo ' ';
echo ' | ';
echo '
';
echo '';
echo '
';
echo '';
} else {
echo '';
echo '';
echo '';
echo '';
echo '';
echo '
';
echo '';
echo '';
echo '';
echo '| ';
echo 'This item does not exist.';
echo ' | ';
echo '
';
echo '';
echo '
';
}
?>
include "index-bottom.php"
?>