'; $place_id = $_GET['place']; $place = getInfo(name,places,"WHERE id='$place_id'"); $result = getRows(currencies,"WHERE place='$place_id'"); while ($row = mysql_fetch_array($result)) { $item = $row['item']; $currencies[] = getInfo(name,items,"WHERE id='$item'").':'.$row['exchange']; } if ($place) { $room = $_GET['room']; $result = getRows(base_families,""); while ($row = mysql_fetch_array($result)) { $id = $row['id']; $name = $row['name']; $links[] = "$name"; } $links = implode(' | ',$links); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
'.$place.'\'s Catalogue
'; echo '
'; if ($room) echo '
This is a list of the items that you may purchase in '.getInfo(name,rooms,"WHERE id='$room'").', '.$place.'.
'; else echo '
This is a list of the items that you may purchase in '.$place.'.
'; echo '
'; echo '
'; $place_type = getInfo(type,places,"WHERE id='$place_id'"); $place_type = getInfo(type,buildings,"WHERE id='$place_type'"); if ($place_type == "shop") echo 'View Clothing for :
'.$links.'


'; if ($room) { $conditions = "WHERE shop='$place_id' or shop='$place_id:' or shop='$place_id:$room'"; } else { $conditions = "WHERE shop='$place_id' or shop like '$place_id:%'"; } $max = numRowsConditions(items,$conditions); $page = $_GET['page']; if (!$page) $page = 1; if ($page * 10 > $max) $page = truncate(($max - 1) / 10) + 1; $offset = (10 * ($page - 1)); $stop = 10; $postCount = 0; $counting_posts = 0; $type = $_GET['type']; if (numRowsConditions(items,"WHERE shop!='$place_id:' and shop like '$place_id:%'") > 0) { echo "
Room:

"; } if ($type) { if ($room) { $result = getRows(items,"WHERE (shop='$place_id' or shop='$place_id:$room' or shop='$place_id:') and price>'0' and (stock>'0' or pawn='') and base='$type' ORDER BY price ASC","LIMIT $offset, 10"); $max = numRowsConditions(items,"WHERE (shop='$place_id' or shop='$place_id:$room' or shop='$place_id:') and price>'0' and (stock>'0' or pawn='') and base='$type'"); } else { $result = getRows(items,"WHERE (shop='$place_id' or shop like '$place_id:%') and price>'0' and (stock>'0' or pawn='') and base='$type' ORDER BY price ASC","LIMIT $offset, 10"); $max = numRowsConditions(items,"WHERE (shop='$place_id' or shop like '$place_id:%') and price>'0' and (stock>'0' or pawn='') and base='$type'"); } } else { if ($room) { $result = getRows(items,"WHERE (shop='$place_id' or shop='$place_id:$room' or shop='$place_id:') and price>'0' and (stock>'0' or pawn='') ORDER BY type DESC","LIMIT $offset, 10"); $max = numRowsConditions(items,"WHERE (shop='$place_id' or shop='$place_id:$room' or shop='$place_id:') and price>'0' and (stock>'0' or pawn='')"); } else { $result = getRows(items,"WHERE (shop='$place_id' or shop like '$place_id:%') and price>'0' and (stock>'0' or pawn='') ORDER BY type DESC","LIMIT $offset, 10"); $max = numRowsConditions(items,"WHERE (shop='$place_id' or shop like '$place_id:%') and price>'0' and (stock>'0' or pawn='')"); } } while ($row = mysql_fetch_array($result)) { $ii = $row['id']; $stock = $row['stock']; $totalPortions = $row['portions']; $name = $row['name']; $price = $row['price']; $description = $row['description']; $type = $row['type']; $stat = $row['stat']; $image = $row['image']; $sex = $row['sex']; $pawn = $row['pawn']; $typeName = $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 ''; echo '
'; echo '
'; echo $name; echo '
'; echo '
'; echo ''; echo ''; if (($type == "clothing") || ($type == "armour") || ($type == "weapon")) { echo ''; $width = "70%"; } echo ''; echo ''; echo ''; echo '
'; echo ''; echo ''; echo 'Price : '.$price.' gold'; if ($currencies) { $max = count($currencies); for ($i = 0;$i < $max;$i++) { $currency = $currencies[$i]; $currency = explode(':',$currency); echo ' = '.ceil($price / $currency[1]).' '.$currency[0]; } } echo '
'; echo 'Stock : '.$stock.' left
'; echo 'Type : '.$typeName.'
'; if ($type == "food") echo '+'.$stat.' hunger per portion
'; if ($type == "drink") echo '+'.$stat.' mana per portion
'; if ($type == "poison") echo '-'.$stat.' health
'; if ($type == "alcohol") echo '+'.$stat.' hunger, +'.round($stat / 4).' intoxication per portion
'; if (($type == "food") || ($type == "drink") || ($type == "alcohol")) { if (!$pawn) { echo $totalPortions.' portions
'; } else { $originalPortions = getInfo(portions,items,"WHERE id='$pawn'"); echo $totalPortions.'/'.$originalPortions.' portions left
'; } } if ($type == "weapon") { echo "Deals ".$stat." damage
"; switch ($sex) { case "m": echo "Gender : Male
"; break; case "f": echo "Gender : Female
"; break; } } if ($type == "armour") { echo "Absorbs ".$stat." damage
"; switch ($sex) { case "m": echo "Gender : Male
"; break; case "f": echo "Gender : Female
"; break; } } if (($type == "armour") || ($type == "weapon")) { $originalPortions = getInfo(portions,items,"WHERE id='$pawn'"); echo $totalPortions.'/'.$originalPortions.' health left
'; } if ($type == "clothing") switch ($sex) { case "m": echo "Gender : Male
"; break; case "f": echo "Gender : Female
"; break; } echo "Weight: ".weigh_item($ii)."kg"; echo '
'; if ($type != "other") echo '
'.$description.'
'; else echo '
A written document.
'; $enchantment = $row['enchantment']; 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 '
'; } if ($max > 10) { echo '
'; echo ''; echo ''; echo '
Pages
'; $pages = truncate(($max - 1)/ 10) + 1; $pstart = $page - 3; if ($pstart < 1) $pstart = 1; if ($pstart != 1) echo '1, '; $pend = $page + 3; if ($pend > $pages) $pend = $pages; if ($pstart > 2) echo '..'; for ($p = $pstart;$p <= $pend;$p++) { if ($p == $page && $page != $pend) echo $p.', '; elseif ($p == $pages) echo ''; else echo ''.$p.', '; } if ($pend < $pages - 1) echo '..'; if ($page != $pend) echo ''.$pages.''; if ($page == $pend) echo $pages; echo '
'; } } else { echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
This catalogue does not exist.
'; echo '
'; echo '
'; } include "index-bottom.php" ?>