'; if (($_GET['user']) && (admin($user_name))) { $userId = $_GET['user']; $user_name = getInfo(username,users,"WHERE id='$userId'"); } if ($user_name) { $cancel = $_POST['cancel']; if ($cancel) { $conditions = "WHERE id='$cancel'"; $user1 = getInfo(user1,trades,$conditions); $user2 = getInfo(user2,trades,$conditions); $user1Name = getInfo(username,users,"WHERE id='$user1'"); $user2Name = getInfo(username,users,"WHERE id='$user2'"); if ($user1 == $userId) { $money = getInfo(user1_money,trades,$conditions); $money += getInfo(money,users,"WHERE id='$userId'"); $items = getInfo(user1_items,trades,$conditions); $inventory = getInfo(inventory,users,"WHERE id='$userId'"); if ($inventory) $inventory .= '.'.$items; else $inventory = $items; $query = "UPDATE users SET inventory='$inventory' WHERE id='$userId'"; mysql_query($query); $query = "UPDATE users SET money='$money' WHERE id='$userId'"; mysql_query($query); $query = "DELETE from trades WHERE id='$cancel'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
The trade offer has been deleted.
'; echo '
'; echo '
'; $topic = "Trade with ".$user1Name." has been cancelled."; $message = $user1Name." has cancelled the trade offer."; sendMessage($user2Name,$topic,$message,$user1Name); } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
There was an error in deleting this trade offer; You are not the person who initiated it in the first place.
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "acceptparty") { $accept = $_POST['accept']; if (fnmatch("*Accept*",$accept)) $accept = "accept"; else $accept = "decline"; $userIdString = '.'.$userId.'.'; $party = getInfo(id,parties,"WHERE invites like '%$userIdString%'"); if (!$party) $failure = "You have not been invited to join a party."; if ($accept == "accept") { if (getInfo(party,users,"WHERE id='$userId'")) $failure = "You already belong to a party."; } if (!$failure) { $leader = getInfo(leader,parties,"WHERE id='$party'"); $leadername = getInfo(username,users,"WHERE id='$leader'"); if ($accept == "accept") { $query = "UPDATE users SET party='$party' WHERE id='$userId'"; mysql_query($query); sendMessage($leadername,"Party","$user_name has accepted the invitation to join your party.","God"); } else sendMessage($leadername,"Party","$user_name has declined the invitation to join your party.","God"); $invites = getInfo(invites,parties,"WHERE id='$party'"); $invites = removeElement($userId,$invites,'.'); $query = "UPDATE parties SET invites='$invite' WHERE id='$party'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; if ($accept == "accept") $accept = "accepted"; else $accept = "declined"; echo "
You have successfully $accept the party invitation.
"; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo "
$failure
"; echo '
'; echo '
'; } } if ($_POST['mode'] == "removeuserParty") { $user = $_POST['removeuser']; $party = getInfo(party,users,"WHERE id='$user'"); if (!getInfo(leader,parties,"WHERE id='$party'") != $userId) $failure = "You are not the leader of that user's party."; if (!$failure) { $query = "UPDATE users SET party='' WHERE id='$user'"; mysql_query($query); sendMessage(getInfo(username,users,"WHERE id='$user'"),"Party","You have been removed from the party.","God"); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; if ($accept == "accept") $accept = "accepted"; else $accept = "declined"; echo "
You have successfully $accept the party invitation.
"; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo "
$failure
"; echo '
'; echo '
'; } } if ($_POST['mode'] == "createparty") { if (getInfo(party,users,"WHERE id='$userId'")) $failure = "You already belong to a party."; if (!$failure) { $query = "INSERT INTO parties VALUES('','$userId','')"; mysql_query($query); $party = getInfo(id,parties,"WHERE leader='$userId'"); $query = "UPDATE users SET party='$party' WHERE id='$userId'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo "
You have successfully created a party. You may now invite people through their character profiles.
"; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo "
$failure
"; echo '
'; echo '
'; } } if ($_POST['mode'] == "disbandparty") { $party = getInfo(id,parties,"WHERE leader='$userId'"); if (!$failure) { $result = getRows(users,"WHERE party='$party' and id!='$userId'"); while ($row = mysql_fetch_array($result)) { $partymember = $row['username']; sendMessage($partymember,"Party","The party to which you belong has been disbanded.","God"); } $query = "UPDATE users SET party='' WHERE party='$party'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo "
You have successfully disbanded the party.
"; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo "
$failure
"; echo '
'; echo '
'; } } if ($_POST['mode'] == "leaveparty") { $party = getInfo(party,users,"WHERE id='$userId'"); $leader = getInfo(leader,parties,"WHERE id='$party'"); if (!$party) $failure = "You do not belong to a party."; if (!$failure) { $query = "UPDATE users SET party='' WHERE id='$userId'"; mysql_query($query); $leadername = getInfo(username,users,"WHERE id='$leader'"); sendMessage($leadername,"Party","$user_name has left your party.","God"); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo "
You have successfully left the party.
"; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo "
$failure
"; echo '
'; echo '
'; } } if ($_POST['mode'] == "cancelpayment") { $payment = $_POST['payment']; if (getInfo(boss,payments,"WHERE id='$payment'") != $userId) $failure = "You are not in control of this payment."; $user = getInfo(user,payments,"WHERE id='$payment'"); $username = getInfo(username,users,"WHERE id='$user'"); $amount = getInfo(amount,payments,"WHERE id='$payment'"); $interval = getInfo(interval,payments,"WHERE id='$payment'"); $days = $interval / (24 * 3600); if (!$failure) { if (getInfo(id,npc_citizens,"WHERE npc='$user'")) { $query = "UPDATE npc_citizens SET employer='' WHERE npc='$user'"; mysql_query($query); } $query = "DELETE FROM payments WHERE id='$payment'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully cancelled the regular payment.
'; echo '
'; echo '
'; sendMessage($username,"Regular Payments Cancelled","$user_name has cancelled his regular payment of $amount every $days days.","God"); } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "crateResources") { $maximum = $_POST['max']; $inventory = getInfo(inventory,users,"WHERE id='$userId'"); $inventory = explode('.',$inventory); $max = count($inventory); unset($resources); for ($i = 0;$i < $max;$i++) { $item = $inventory[$i]; if ((getInfo(type,user_items,"WHERE id='$item'") == "resource") || (getInfo(type,user_items,"WHERE id='$item'") == "material")) { $resources[] = $item; unset($inventory[$i]); } } $inventory = implode('.',$inventory); if (($maximum <= 1) && ($maximum)) $failure = "You must choose a number greater than 1."; if (!$resources) $failure = "You are not carrying any resources or materials."; if (!$failure) { $query = "UPDATE users SET inventory='$inventory' WHERE id='$userId'"; mysql_query($query); if (!$maximum) { $max = count($resources); unset($crates); for ($i = 0;$i < $max;$i++) { $item = $resources[$i]; $record = getInfo(item,user_items,"WHERE id='$item'"); if (inArray($record,$crates)) { $position = position($record,$crates); $contents[$position] .= '.'.$item; } else { $crates[] = $record; $contents[] = $item; } } } else { $max = count($resources); unset($crates); for ($i = 0;$i < $max;$i++) { $item = $resources[$i]; $record = getInfo(item,user_items,"WHERE id='$item'"); if (inArray($record,$crates)) { $position = position($record,$crates); $inCrateNum = count(explode('.',$contents[$position])); if ($inCrateNum >= $maximum) { $crates[] = $record; $contents[] = $item; } else { $contents[$position] .= '.'.$item; } } else { $crates[] = $record; $contents[] = $item; } } } $inventory = getInfo(inventory,users,"WHERE id='$userId'"); $max = count($crates); for ($i = 0;$i < $max;$i++) { $crate = $crates[$i]; $itemType = getInfo(name,items,"WHERE id='$crate'"); $inside = $contents[$i]; $number = count(explode('.',$inside)); $crateName = "$itemType ($number)"; $crateDescription = "A crate containing $number $itemType(s)."; $query = "INSERT INTO items VALUES('','$crateName','','$crateDescription','','$userId','crate','$inside','','','','','','','','')"; mysql_query($query); $crate_id = numRows(items); $query = "INSERT INTO user_items VALUES('','$crateName','crate','$crate_id','0','$inside','0','','','')"; mysql_query($query); $crate_id = numRows(user_items); if ($inventory) $inventory .= '.'.$crate_id; else $inventory = $crate_id; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully crated your resources and materials.
'; echo '
'; echo '
'; $query = "UPDATE users SET inventory='$inventory' WHERE id='$userId'"; mysql_query($query); } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } unset($inventory); unset($resources); unset($materials); unset($crates); if ($_POST['mode'] == "stretch") { $stretch = $_POST['stretch']; if (($stretch < -40) || ($stretch > 50)) $failure = "The amount you chose was either too high or too low. It may not be less than -40 or more than 50."; if (!$failure) { $query = "UPDATE users SET stretch='$stretch' WHERE id='$userId'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have changed the stretch of your avatar.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "cultApply") { $query = "UPDATE users SET cultApply='' WHERE id='$userId'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully cancelled your application.
'; echo '
'; echo '
'; } if ($_POST['mode'] == "hidehair") { $hair = getInfo(hair,users,"WHERE id='$userId'"); if (!$hair) { $hair = getInfo(hairhide,users,"WHERE id='$userId'"); $hide_hair = true; } else { $hide_hair = false; } if (!$hair) $failure = "You do not have any hair."; if (!$failure) { if ($hide_hair) { $query = "UPDATE users SET hair='$hair' WHERE id='$userId'"; mysql_query($query); $query = "UPDATE users SET hairhide='' WHERE id='$userId'"; mysql_query($query); } else { $query = "UPDATE users SET hair='' WHERE id='$userId'"; mysql_query($query); $query = "UPDATE users SET hairhide='$hair' WHERE id='$userId'"; mysql_query($query); } } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
'; if (!$failure) echo 'Success'; else echo 'Error'; echo '
'; echo '
'; echo '
'; if (!$failure) { if ($hide_hair) echo "Your hair is now being displayed."; else echo "Your hair is now hidden."; } else echo $failure; echo '
'; echo '
'; echo '
'; } if ($_POST['mode'] == "destination") { $destination = $_POST['destination']; $location = getInfo(location,users,"WHERE id='$userId'"); $type = getInfo(type,places,"WHERE id='$location'"); $type = getInfo(label,buildings,"WHERE id='$type'"); if ($type == "caravel") $type = "ship"; if (($type != "ship") && ($type != "caravan")) $failure = "You are not on a ship or a caravan."; if ($type == "caravan") { $curr = getInfo(town,users,"WHERE id='$userId'"); $curr = getInfo(zone,towns,"WHERE id='$curr'"); if (!$curr) $curr = getInfo(destination,place_travels,"WHERE place='$location'"); $zone = getInfo(zone,towns,"WHERE id='$destination'"); if ((($zone == "2.1") || ($zone == "2.2")) && ($curr != $zone)) $failure = "The caravan cannot reach that destination."; } if ($type == "ship") { $seaside = getInfo(seaside,towns,"WHERE id='$destination'"); if (!$seaside) $failure = "The ship cannot reach that destination."; } if (!$failure) { $query = "UPDATE users SET destination='$destination' WHERE id='$userId'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully changed your destination. You will now automatically disembark in the location you chose, when the ship arrives there.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "citizen") { $query = "UPDATE users SET citizen='' WHERE id='$userId'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully cancelled the application.
'; echo '
'; echo '
'; } if ($_POST['mode'] == "job") { $query = "UPDATE users SET job='' WHERE id='$userId'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully cancelled the application.
'; echo '
'; echo '
'; } if ($_POST['mode'] == "remove") { $conditions = "WHERE id='$userId'"; $remOverhead = $_POST['remOverhead']; $remClothes = $_POST['remClothes']; $remBehind = $_POST['remBehind']; $inventory = getInfo(inventory,users,"WHERE id='$userId'"); $max = count($remOverhead); if ($max > 0) { $overhead = explode('.',getInfo(overhead,users,"WHERE id='$userId'")); for ($i = 0;$i < $max;$i++) { $rem = $remOverhead[$i]; if (inArray($rem,$overhead)) { $overhead = implode('.',$overhead); $overhead = removeElement($rem,$overhead,"."); $overhead = explode('.',$overhead); if ($inventory) $inventory .= '.'.$rem; else $inventory = $rem; if (getInfo(type,user_items,"WHERE id='$item'") == "epic") { $slayno = true; } } else { $failure = "You are not wearing one or more of the items you are trying to remove."; } } } $max = count($remClothes); if ($max > 0) { $clothes = explode('.',getInfo(clothes,users,"WHERE id='$userId'")); for ($i = 0;$i < $max;$i++) { $rem = $remClothes[$i]; if (inArray($rem,$clothes)) { $clothes = implode('.',$clothes); $clothes = removeElement($rem,$clothes,"."); $clothes = explode('.',$clothes); if ($inventory) $inventory .= '.'.$rem; else $inventory = $rem; if (getInfo(type,user_items,"WHERE id='$item'") == "epic") { $slayno = true; } } else { $failure = "You are not wearing one or more of the items you are trying to remove."; } } } $max = count($remBehind); if ($max > 0) { $behind = explode('.',getInfo(behind,users,"WHERE id='$userId'")); for ($i = 0;$i < $max;$i++) { $rem = $remBehind[$i]; if (inArray($rem,$behind)) { $behind = implode('.',$behind); $behind = removeElement($rem,$behind,"."); $behind = explode('.',$behind); if ($inventory) $inventory .= '.'.$rem; else $inventory = $rem; if (getInfo(type,user_items,"WHERE id='$item'") == "epic") { $slayno = true; } } else { $failure = "You are not wearing one or more of the items you are trying to remove."; } } } if (!$failure) { if ($slayno) { $time = time() + (3600 * 24 * 7); $query = "UPDATE users SET slay='$time' WHERE id='$userId'"; mysql_query($query); } if (implode('.',$remOverhead)) { $overhead = implode('.',$overhead); $query = "UPDATE users SET overhead='$overhead' WHERE id='$userId'"; mysql_query($query); } if (implode('.',$remClothes)) { $clothes = implode('.',$clothes); $query = "UPDATE users SET clothes='$clothes' WHERE id='$userId'"; mysql_query($query); } if (implode('.',$remBehind)) { $behind = implode('.',$behind); $query = "UPDATE users SET behind='$behind' WHERE id='$userId'"; mysql_query($query); } $query = "UPDATE users SET inventory='$inventory' WHERE id='$userId'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully removed the clothes you have chosen.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "wear") { $items = $_POST['items']; $action = $_POST['action']; $open = $_POST['open']; if ($open) { $inventory = getInfo(inventory,users,"WHERE id='$userId'"); $openArray = $open; $maxOpen = count($openArray); for ($i = 0;$i < $maxOpen;$i++) { $inventory = explode('.',$inventory); $open = $openArray[$i]; if (!inArray($open,$inventory)) $failure = "You are not carrying one of the crates."; else { $inventory = implode('.',$inventory); $inventory = removeElement($open,$inventory,'.'); } } if (!$failure) { set_time_limit(120); for ($ii = 0;$ii < $maxOpen;$ii++) { $open = $openArray[$ii]; $openMessage .= "You have successfully opened ".getInfo(name,user_items,"WHERE id='$open'").". It contains:
"; $openItems = getInfo(stat,user_items,"WHERE id='$open'"); $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") { $money = getInfo(money,users,"WHERE id='$userId'"); $money += getInfo(portions,user_items,"WHERE id='$item'"); $openMessage .= '
'.getInfo(portions,user_items,"WHERE id='$item'").' gold coins'; $query = "UPDATE users SET money='$money' WHERE id='$userId'"; mysql_query($query); } else { $itemName = getInfo(name,user_items,"WHERE id='$item'"); $openMessage .= '
'.$itemName.''; if ($inventory) $inventory .= '.'.$item; else $inventory = $item; } } $openMessage .="

"; } $query = "UPDATE users SET inventory='$inventory' WHERE id='$userId'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$openMessage.'
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } else { if (!$action) $failure = "You must choose what you want to do with these items."; if (($action == "drop") && (!getInfo(room,users,"WHERE id='$userId'"))) $failure = "You may not drop anything if you are nowhere."; if (($action == "drop") && (getInfo(status,users,"WHERE id='$userId'") != "conscious")) $failure = "You may not drop anything if you are not conscious."; if ((($action == "crate") || ($action == "drop")) && ($crateMoney > getInfo(money,users,"WHERE id='$userId'"))) $failure = "You do not have that much money."; if (($action == "delete") && ((getInfo(travel,users,"WHERE id='$userId'") > time()) || (getInfo(status,users,"WHERE id='$userId'") != "conscious"))) $failure = "You must wait 24 hours after being hit, before being able to delete anything in your inventory. Also, you may not delete anything if you are not conscious."; $inventory = getInfo(inventory,users,"WHERE id='$userId'"); $inventory = explode('.',$inventory); $max = count($items); $weapons = 0; $armours = 0; $epics = 0; for ($i = 0;$i < $max;$i++) { $item = $items[$i]; if ((getInfo(type,user_items,"WHERE id='$item'") == "weapon") && (($action == "overhead") || ($action == "underhead") || ($action == "behind"))) { $overhead = getInfo(overhead,users,"WHEREid='$userId'"); $underhead = getInfo(clothes,users,"WHERE id='$userId'"); $behind = getInfo(behind,users,"WHERE id='$userId'"); $clothing = $overhead.'.'.$underhead.'.'.$behind; $clothing = explode('.',$clothing); $max2 = count($clothing); for ($ii = 0;$ii < $max2;$ii++) { if (getInfo(type,user_items,"WHERE id='$clothing[$ii]'") == "epic") { $failure = "You are already wearing an epic item. You may not wear any armour while wearing an epic item."; } } $weapons++; } if ((getInfo(type,user_items,"WHERE id='$item'") == "epic") && (($action == "overhead") || ($action == "underhead") || ($action == "behind"))) { $overhead = getInfo(overhead,users,"WHERE id='$userId'"); $underhead = getInfo(clothes,users,"WHERE id='$userId'"); $behind = getInfo(behind,users,"WHERE id='$userId'"); $clothing = $overhead.'.'.$underhead.'.'.$behind; $clothing = explode('.',$clothing); $max2 = count($clothing); for ($ii = 0;$ii < $max2;$ii++) { if (getInfo(type,user_items,"WHERE id='$clothing[$ii]'") == "weapon") { $failure = "You may not wear any armour or weapons while wearing an epic item."; break; } if (getInfo(type,user_items,"WHERE id='$clothing[$ii]'") == "armour") { $failure = "You may not wear any armour or weapons while wearing an epic item."; } } $epics++; } if ((getInfo(type,user_items,"WHERE id='$item'") == "armour") && (($action == "overhead") || ($action == "underhead") || ($action == "behind"))) { $overhead = getInfo(overhead,users,"WHERE id='$userId'"); $underhead = getInfo(clothes,users,"WHERE id='$userId'"); $behind = getInfo(behind,users,"WHERE id='$userId'"); $clothing = $overhead.'.'.$underhead.'.'.$behind; $clothing = explode('.',$clothing); $max2 = count($clothing); $armour = 0; for ($ii = 0;$ii < $max2;$ii++) { if (getInfo(type,user_items,"WHERE id='$clothing[$ii]'") == "epic") { $failure = "You are already wearing an epic item. You may not wear any armour while wearing an epic item."; } } } if (!inArray($item,$inventory)) { $failure = "You are not carrying one or more of the items you selected."; } if (((getInfo(type,user_items,"WHERE id='$item'") != "clothing") && (getInfo(type,user_items,"WHERE id='$item'") != "weapon") && (getInfo(type,user_items,"WHERE id='$item'") != "armour") && (getInfo(type,user_items,"WHERE id='$item'") != "epic")) && (($action == "overhead") || ($action == "underhead") || ($action == "behind") || ($action == "donate"))) $failure = "You have selected items you may not wear or donate."; } if ($epic > 1) $failure = "You are trying to wear too many epic items."; if (!$failure) { $max = count($items); for ($i = 0;$i < $max;$i++) { $item = $items[$i]; $inventory = getInfo(inventory,users,"WHERE id='$userId'"); $inventory = removeElement($item,$inventory,'.'); $query = "UPDATE users SET inventory='$inventory' WHERE id='$userId'"; mysql_query($query); if ($action == "overhead") { $overhead = getInfo(overhead,users,"WHERE id='$userId'"); if ($overhead) $overhead .= '.'.$item; else $overhead = $item; $query = "UPDATE users SET overhead='$overhead' WHERE id='$userId'"; mysql_query($query); if (getInfo(type,user_items,"WHERE id='$item'") == "epic") { $query = "UPDATE users SET slay='no' WHERE id='$userId'"; mysql_query($query); } } if ($action == "underhead") { $clothes = getInfo(clothes,users,"WHERE id='$userId'"); if ($clothes) $clothes .= '.'.$item; else $clothes = $item; $query = "UPDATE users SET clothes='$clothes' WHERE id='$userId'"; mysql_query($query); if (getInfo(type,user_items,"WHERE id='$item'") == "epic") { $query = "UPDATE users SET slay='no' WHERE id='$userId'"; mysql_query($query); } } if ($action == "behind") { $behind = getInfo(behind,users,"WHERE id='$userId'"); if ($behind) $behind .= '.'.$item; else $behind = $item; $query = "UPDATE users SET behind='$behind' WHERE id='$userId'"; mysql_query($query); if (getInfo(type,user_items,"WHERE id='$item'") == "epic") { $query = "UPDATE users SET slay='no' WHERE id='$userId'"; mysql_query($query); } } if ($action == "crate") { if ($crate) $crate .= '.'.$item; else $crate = $item; } if ($action == "drop") { $room = getInfo(room,users,"WHERE id='$userId'"); $roomInventory = getInfo(inventory,rooms,"WHERE id='$room'"); if ($roomInventory) $roomInventory .= '.'.$item; else $roomInventory = $item; $query = "UPDATE rooms SET inventory='$roomInventory' WHERE id='$room'"; mysql_query($query); } if ($action == "donate") { $item_id = getInfo(item,user_items,"WHERE id='$item'"); $itemSex = getInfo(sex,items,"WHERE id='$item_id'"); $query = "INSERT INTO donations VALUES('','$item','$userId','$itemSex')"; mysql_query($query); } } $crateMoney = $_POST['crateMoney']; if ($action == "crate") { $crateName = $_POST['crateName']; if ($crateMoney) { $money = getInfo(money,users,"WHERE id='$userId'"); $money -= $crateMoney; $query = "UPDATE users SET money='$money' WHERE id='$userId'"; mysql_query($query); $moneyName = 'Pouch of '.$crateMoney.' Gold Coins'; $query = "INSERT INTO user_items VALUES('','$moneyName','money','','$crateMoney','','','','','')"; mysql_query($query); $money_item = numRows(user_items); if ($crate) $crate .= '.'.$money_item; else $crate = $money_item; } $crateDescription = "A crate containing ".$user_name."\'s possessions."; $query = "INSERT INTO items VALUES('','$crateName','','$crateDescription','','$userId','crate','$crate','','','','','','','','')"; mysql_query($query); $crate_id = numRows(items); $query = "INSERT INTO user_items VALUES('','$crateName','crate','$crate_id','0','$crate','0','','','')"; mysql_query($query); $crate_id = numRows(user_items); $inventory = getInfo(inventory,users,"WHERE id='$userId'"); if ($inventory) $inventory .= '.'.$crate_id; else $inventory = $crate_id; $query = "UPDATE users SET inventory='$inventory' WHERE id='$userId'"; mysql_query($query); } if (($action == "drop") && ($crateMoney > 0)) { $money = getInfo(money,users,"WHERE id='$userId'"); $money -= $crateMoney; $query = "UPDATE users SET money='$money' WHERE id='$userId'"; mysql_query($query); $moneyName = 'Pouch of '.$crateMoney.' Gold Coins'; $query = "INSERT INTO user_items VALUES('','$moneyName','money','','$crateMoney','','','','','')"; mysql_query($query); $money_item = numRows(user_items); $room = getInfo(room,users,"WHERE id='$userId'"); $roomInventory = getInfo(inventory,rooms,"WHERE id='$room'"); if ($roomInventory) $roomInventory .= '.'.$money_item; else $roomInventory = $money_item; $query = "UPDATE rooms SET inventory='$roomInventory' WHERE id='$room'"; mysql_query($query); } } if (!$failure) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; backup_inventory($user); if (($action == "overhead") || ($action == "underhead") || ($action == "behind")) echo '
You have successfully worn the clothes you have chosen.
'; if ($action == "donate") echo '
You have successfully donated the clothes you have chosen. Thank you for your generosity.
'; if ($action == "drop") echo '
You have successfully dropped the items. Now, anyone will be able to pick them up from the room you are currently in.
'; if ($action == "crate") echo '
You have successfully stored your items in a crate.
'; if ($action == "delete") echo '
You have successfully deleted the items you selected.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } } if ($_POST['mode'] == "Release") { $slave = $_POST['slave']; $slavename = getInfo(username,users,"WHERE id='$slave'"); $master = getInfo(master,users,"WHERE id='$slave'"); $mastername = getInfo(username,users,"WHERE id='$master'"); if ($master == $userId) { $oldMax = statmax($slave); $query = "UPDATE users SET master='' WHERE id='$slave'"; if (mysql_query($query)) { $query = "UPDATE users SET chained='' WHERE id='$slave'"; mysql_query($query); $topic = "You are free"; $message = $mastername." has decided to set you free. You are no longer a slave."; sendMessage($slavename,$topic,$message,"God"); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully freed '.$slavename.'.
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
An error has occurred. Please try again. If the problem persists, contact an administrator.
'; echo '
'; echo '
'; } } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
You are not '.$slave.'\'s master, and therefore cannot set them free.
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "cancel") { $post = getInfo(post,fights,"WHERE offense='$userId'"); $defense = getInfo(defense,fights,"WHERE offense='$userId'"); if (getInfo(id,npc_combat,"WHERE npc='$defense'")) { $query = "DELETE FROM npc_combat WHERE npc='$defense'"; mysql_query($query); } $query = "DELETE FROM posts WHERE id='$post'"; mysql_query($query); $query = "DELETE FROM fights WHERE offense='$userId'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully cancelled your attack.
'; echo '
'; echo '
'; } if ($_POST['mode'] == "canceltie") { $post = getInfo(post,immobil,"WHERE offense='$userId'"); $query = "DELETE FROM posts WHERE id='$post'"; mysql_query($query); $query = "DELETE FROM immobil WHERE offense='$userId'"; mysql_query($query); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
You have successfully cancelled your action.
'; echo '
'; echo '
'; } if ($_POST['mode'] == "transform") { $transformation = getInfo(transformation,users,"WHERE id='$userId'"); if (getInfo(id,spells,"WHERE spell='divineIntervention' and user='$userId'")) $failure = "You may not transform. The spell that was cast on you, divine intervention, has not yet worn off."; if (getInfo(id,spells,"WHERE spell='demonicPossession' and user='$userId'")) $failure = "You may not transform. The spell that was cast on you, demonic possession, has not yet worn off."; if (!$transformation) $failure = "You do not have a transformed state."; if (!$failure) { $query = "UPDATE users SET transformed='' WHERE id='$userId'"; mysql_query($query); $success = "You have reverted to your humanoid form."; $transformation = $_POST['transformation']; $query = "UPDATE users SET transformed='$transformation' WHERE id='$userId'"; mysql_query($query); $success = "You have transformed."; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
'.$success.'
'; echo '
'; echo '
'; } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; echo '
'.$failure.'
'; echo '
'; echo '
'; } } if ($_POST['mode'] == "npcIdle") { $result = getRows(users,"WHERE NPC='$userId'"); while ($row = mysql_fetch_array($result)) { $npc = $row['id']; $query = "UPDATE npcs SET mode='' WHERE name='$npc'"; mysql_query($query); $query = "DELETE FROM npc_siege WHERE npc='$npc'"; mysql_query($query); $query = "DELETE FROM npc_arrow WHERE npc='$npc'"; mysql_query($query); $query = "DELETE FROM npc_mining WHERE npc='$npc'"; mysql_query($query); } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
All of your NPCs are now idle.
'; echo '
'; echo '
'; } if ($_POST['mode'] == "npcStandby") { $result = getRows(users,"WHERE NPC='$userId'"); while ($row = mysql_fetch_array($result)) { $npc = $row['id']; if (getInfo(mode,npcs,"WHERE name='$npc'") == "arrows") { $query = "UPDATE npc_arrow SET target='' WHERE npc='$npc'"; mysql_query($query); } if (getInfo(mode,npcs,"WHERE name='$npc'") == "siege") { $query = "UPDATE npc_siege SET target='' WHERE npc='$npc'"; mysql_query($query); } } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Success
'; echo '
'; echo '
All of the NPCs you had set to siege weapons or bows and arrows are now set to stand guard and return fire on anyone who attacks.
'; echo '
'; echo '
'; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
User Control Panel
'; echo '
'; echo '
This is where you may control things including trades, kingdoms, towns, buildings and slaves.
'; echo '
'; echo '
'; $location = getInfo(location,users,"WHERE id='$userId'"); $type = getInfo(type,places,"WHERE id='$location'"); $type = getInfo(label,buildings,"WHERE id='$type'"); if ($type == "caravel") $type = "ship"; if (($type == "ship") || ($type == "caravan")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Travel
'; echo '
'; echo '
'; echo 'You are on a ship or a caravan. You can choose to automatically disembark when you reach a certain town.

'; echo '
'; echo ''; echo '
'; echo '
'; echo '
'; echo '
'; } if ((getInfo(id,npc_bribes,"WHERE user='$userId'")) || (getInfo(username,users,"WHERE NPC='$userId'"))) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
NPC Memories
'; echo '
'; echo ''; $time = time(); $result = getRows(npc_bribes,"WHERE user='$userId' and time>='$time'"); while ($row = mysql_fetch_array($result)) { $npc = $row['npc']; $npcname = getInfo(username,users,"WHERE id='$npc'"); $time = $row['time']; $left = $time - time(); $hours = truncate($left / 3600); $left = $left - ($hours * 3600); $minutes = truncate($left / 60); $seconds = $left - ($minutes * 60); $expires = "$hours hours, $minutes minutes and $seconds seconds"; echo ''; } $result = getRows(users,"WHERE NPC='$userId'"); while ($row = mysql_fetch_array($result)) { $npc = $row['id']; $npcname = $row['username']; echo ''; } echo '
View '.$npcname.' MemoriesExpires in '.$expires.'
View '.$npcname.' Memories
'; echo '
'; echo '
'; } if (getInfo(offense,fights,"WHERE offense='$userId'")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
You are Fighting
'; echo '
'; echo '
'; echo 'If you wish, you can retract your attack, and your attack will be stricken from the record. One would probably do this, if the victim failed to reply for a long time, thus tying up your own character.

'; echo '
'; echo '
'; echo '
'; echo '
'; } if (getInfo(offense,immobil,"WHERE offense='$userId'")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
You are Tying Someone Up
'; echo '
'; echo '
'; echo 'If you wish, you can retract your action, and your action will be stricken from the record. One would probably do this, if the victim failed to reply for a long time, thus tying up your own character.

'; echo '
'; echo '
'; echo '
'; echo '
'; } if ((getInfo(regeneration,users,"WHERE id='$userId'")) && (getInfo(status,users,"WHERE id='$userId'") == "unconscious")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
You are Unconscious
'; echo '
'; echo '
'; $left = getInfo(regeneration,users,"WHERE id='$userId'") - time(); $time = $left; $hours = truncate($left / 3600); $left = $left - ($hours * 3600); $minutes = truncate($left / 60); $seconds = $left - ($minutes * 60); echo 'You are currently unconscious, and vulnerable to being killed, robbed or enslaved.'; if ($time > 0) echo '
You will be able to wake yourself up in '.$hours.' hours, '.$minutes.' minutes and '.$seconds.' seconds.'; else echo '
You may wake up immediately.'; echo '
'; echo '
'; echo '
'; } if (getInfo(user,travels,"WHERE user='$userId'")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
You are Travelling
'; echo '
'; echo '
'; $left = getInfo(arrival,travels,"WHERE user='$userId'") - time(); $hours = truncate($left / 3600); $left = $left - ($hours * 3600); $minutes = truncate($left / 60); $seconds = $left - ($minutes * 60); echo 'You are currently travelling.
You will arrive in '.$hours.' hours, '.$minutes.' minutes and '.$seconds.' seconds.'; echo '
'; echo '
'; echo '
'; } if (getInfo(cultApply,users,"WHERE id='$userId'")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Cult Application
'; echo '
'; echo '
'; $cult = getInfo(cultApply,users,"WHERE id='$userId'"); $name = getInfo(name,cults,"WHERE id='$cult'"); echo 'You have applied to the cult, "'.$name.'".
'; echo '
'; echo '
'; echo '
'; } $userLocation = getInfo(location,users,"WHERE id='$userId'"); if (getInfo(destination,place_travels,"WHERE place='$userLocation'")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
You are Travelling by Ship or by Caravan
'; echo '
'; echo '
'; $left = getInfo(arrival,place_travels,"WHERE place='$userLocation'") - time(); $hours = truncate($left / 3600); $left = $left - ($hours * 3600); $minutes = truncate($left / 60); $seconds = $left - ($minutes * 60); echo 'You are currently travelling.
You will arrive in '.$hours.' hours, '.$minutes.' minutes and '.$seconds.' seconds.'; echo '
'; echo '
'; echo '
'; } $citizen = getInfo(citizen,users,"WHERE id='$userId'"); $job = getInfo(job,users,"WHERE id='$userId'"); if ($citizen) { $application = getInfo(name,kingdoms,"WHERE id='$citizen'"); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Citizenship Application
'; echo '
'; echo '
'.$application.'
'; echo '
'; echo '
'; } if ($job) { $application = getInfo(name,places,"WHERE id='$job'"); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Job Application
'; echo '
'; echo '
'.$application.'
'; echo '
'; echo '
'; } if (getInfo(transformation,users,"WHERE id='$userId'")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Transformation
'; echo '
'; echo '
'; echo 'You have a transformed state. If you wish, you may toggle between your transformation and your humanoid state without posting.

'; echo '
'; echo ' '; echo '
'; echo '
'; echo '
'; echo '
'; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Avatar
'; echo '
'; echo '
'; $user_id = getInfo(id,users,"WHERE id='$userId'"); echo '
'; echo ''; echo '
'; echo '
Avatar Stretch/Compression
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
This allows you to alter your character\'s height. A negative stretch will make it appear shorter, while a positive one will make it appear taller.
'; echo '



'; $conditions = "WHERE id='$userId'"; $overhead = explode('.',getInfo(overhead,users,$conditions)); $clothes = explode('.',getInfo(clothes,users,$conditions)); $behind = explode('.',getInfo(behind,users,$conditions)); $hair = getInfo(hair,users,"WHERE id='$userId'"); if (!$hair) { $hair_hidden = true; $hair = getInfo(hairhide,users,"WHERE id='$userId'"); } else { $hair_hidden = false; } $hair_image = getInfo(image,hair,"WHERE id='$hair'"); $hair_sex = getInfo(sex,hair,"WHERE id='$hair'"); $hair_sex = getInfo(sex,bases,"WHERE id='$hair_sex'"); echo '
'; if ($hair) { echo '
Hair
'; echo ''; echo ''; echo '
'.$name.'


'; echo "
"; echo '

'; echo '
'; } echo '
'; if (getInfo(overhead,users,"WHERE id='$userId'")) { echo '
Over-Hair Clothing/Accessories
'; $max = count($overhead); for ($i = 0;$i < $max;$i++) { $item = $overhead[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $price = getInfo(price,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'


'; echo '
Remove
'; echo '

'; echo '
'; } if (getInfo(clothes,users,"WHERE id='$userId'")) { echo '
Under-Hair Clothing/Accessories
'; $max = count($clothes); for ($i = 0;$i < $max;$i++) { $item = $clothes[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $price = getInfo(price,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'


'; echo '
Remove
'; echo '
'; echo '
'; } if (getInfo(behind,users,"WHERE id='$userId'")) { echo '
Behind Avatar Clothing/Accessories
'; $max = count($behind); for ($i = 0;$i < $max;$i++) { $item = $behind[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $price = getInfo(price,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
'.$name.'


'; echo '
Remove
'; echo '
'; } echo '
'; echo '
'; echo '
'; echo ''; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Inventory
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Money
'; echo '
'; echo '
Money : '.getInfo(money,users,"WHERE id='$userId'").'
'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Your Inventory\'s Weight
'; echo '
'; $weightMax = maxWeight($userId); echo '
The money and items you carry and wear each have a particular weight. If the total weight exceeds '.$weightMax.'kg, you will not be able to move.

'; echo floor(getInfo(money,users,"WHERE id='$userId'") * 0.005)."kg of gold coins
"; echo count_items(getInfo(overhead,users,"WHERE id='$userId'").'.'.getInfo(clothes,users,"WHERE id='$userId'").'.'.getInfo(behind,users,"WHERE id='$userId'"))."kg being worn
"; echo count_items(getInfo(inventory,users,"WHERE id='$userId'"))."kg in your inventory
"; echo "Total: ".weigh($userId)."kg"; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Mode
'; echo '
'; echo '
There are several actions you can do. Please select one, then select the items involved.
Wear Over-Hair Wear Under-Hair Wear Behind Avatar Add to Crate Drop Donate Delete'; echo '

If you are creating a crate, please set a name for the crate. This would help sorting it out from different crates.

Also, if you wish to place a pouch of money in the crate, or wish to drop one into the room you are in, state how much, here.
'; echo '
'; echo '
'; echo '
'; unset($clothes); $conditions = "WHERE id='$userId'"; $inventory = explode('.',getInfo(inventory,users,$conditions)); $max = count($inventory); for ($i = 0;$i < $max;$i++) { $item = $inventory[$i]; $conditions = "WHERE id='$item'"; $type = getInfo(type,user_items,$conditions); if (($type == "food") || ($type == "drink") || ($type == "alcohol") || ($type == "poison")) $foods[] = $item; if ($type == "poison") $poison[] = $item; if (($type == "clothing") || ($type == "weapon") || ($type == "armour") || ($type == "epic")) $clothes[] = $item; if (($type == "other") || ($type == "misc") || ($type == "seal")) $other[] = $item; if ($type == "relic") $relics[] = $item; if ($type == "crate") $crates[] = $item; if ($type == "resource") $resources[] = $item; if ($type == "material") $materials[] = $item; if ($type == "key") $keys[] = $item; if ($type == "door") $doors[] = $item; if ($type == "arrows") $arrows[] = $item; if (!getInfo(name,items,"WHERE id='$item'")) $inventory[$i] = ''; } if ((count($clothes) > 1) || ($clothes[0])) { echo '
Clothing/Accessories
'; $max = count($clothes); for ($i = 0;$i < $max;$i++) { $item = $clothes[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $price = getInfo(price,user_items,$conditions); $image = displayClothing($item); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
Items your character can wear, that will appear on their avatar. Click on an item to see more information about it.
'.$name.'


'; echo '
'; echo '

'; echo '
'; } if ((count($foods) > 1) || ($foods[0])) { echo '
Food
'; $max = count($foods); for ($i = 0;$i < $max;$i++) { $item = $foods[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $type = getInfo(type,user_items,$conditions); $stat = getInfo("stat",user_items,$conditions); $price = getInfo(price,user_items,$conditions); $record_item = getInfo(item,user_items,$conditions); if ($type == "food") { $stats = '+'.$stat.' hunger per portion
'.getInfo(portions,user_items,$conditions).'/'.getInfo(portions,items,"WHERE id='$record_item'").' portions left'; $type = "Food"; } if ($type == "poison") { $stats = '-'.$stat.' health'; $type = "Poison"; } if ($type == "drink") { $stats = '+'.$stat.' mana per portion
'.getInfo(portions,user_items,$conditions).'/'.getInfo(portions,items,"WHERE id='$record_item'").' portions left'; $type = "Drink"; } if ($type == "alcohol") { $stats = '+'.$stat.' hunger per portion
+'.round($stat / 4).' intoxication per portion
'.getInfo(portions,user_items,$conditions).'/'.getInfo(portions,items,"WHERE id='$record_item'").' portions left'; $type = "Alcohol"; } if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
Items your character can eat or drink to regain health, mana and hunger points. Click on an item to see more information about it.
'.$name.'
'.$type; $itemRecord = getInfo(item,user_items,"WHERE id='$item'"); if ((getInfo(bonus,users,"WHERE id='$userId'") == "explorer") && (getInfo(id,food,"WHERE item='$itemRecord'"))) echo '
Start Cooking'; echo '
'.$stats; echo '
'; echo '

'; echo '
'; } if ((count($relics) > 1) || ($relics[0])) { echo '
Body Parts
'; $max = count($relics); for ($i = 0;$i < $max;$i++) { $item = $relics[$i]; $conditions = "WHERE id='$item'"; $item = getInfo(item,user_items,$conditions); $conditions = "WHERE id='$item'"; $name = getInfo(name,items,$conditions); $creator = getInfo(creator,items,$conditions); $item = $relics[$i]; if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } echo '
Parts of other dead characters\' bodies. Click on an item to see more information about it.
'.$creator.'\'s '.$name.'
'; echo '
'; echo '

'; echo '
'; } if ((count($other) > 1) || ($other[0])) { echo '
Miscellaneous Items
'; $max = count($other); for ($i = 0;$i < $max;$i++) { $item = $other[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $price = getInfo(price,user_items,$conditions); if ($i % 4 == 0) echo ''; $type = getInfo(type,user_items,$conditions); if ($type == "other") { echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
Written documents including things such as books and letters. Click on an item to see more information about it.
'.stripslashes($name).''; if (!getInfo(extra,user_items,$conditions)) echo '
Write More'; echo '
'; } elseif ($type == "seal") { echo '
'.stripslashes($name).''; if (!getInfo(extra,user_items,$conditions)) echo '
Stamp a Written Document'; echo '
'; } else { echo '
'.stripslashes($name).''; } echo '
'; echo '

'; echo '
'; } if ((count($crates) > 1) || ($crates[0])) { echo '
Crates
'; $max = count($crates); for ($i = 0;$i < $max;$i++) { $item = $crates[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
Boxes, sacks, and other such things that contain other items. Click on an item to see more information about it.
'.$name.'
'; echo '
Select:
'; echo '
Open:
'; echo '

'; echo '
'; } if ((count($arrows) > 1) || ($arrows[0])) { echo '
Arrows
'; $max = count($arrows); for ($i = 0;$i < $max;$i++) { $item = $arrows[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
Quivers full of arrows that can be shot at other users. Click on an item to see more information about it.
'.$name.'
'; echo '
'; echo '

'; echo '
'; } if ((count($resources) > 1) || ($resources[0])) { echo '
Crude Resources
'; $max = count($resources); for ($i = 0;$i < $max;$i++) { $item = $resources[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
Crude resources that can be refined and used to make weaponry and armour, or left as they are and used to create buildings and fortify them. Click on an item to see more information about it.
'.$name.'
'; echo '
'; echo '

'; echo '
'; } if ((count($materials) > 1) || ($materials[0])) { echo '
Materials
'; $max = count($materials); for ($i = 0;$i < $max;$i++) { $item = $materials[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
Refined materials that can be used to create weaponry and armour. Click on an item to see more information about it.
'.$name.'
'; echo '
'; echo '

'; echo '
'; } if ((count($keys) > 1) || ($keys[0])) { echo '
Keys
'; $max = count($keys); for ($i = 0;$i < $max;$i++) { $item = $keys[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
An item that will open a particular door. If you are carrying the key to a door, you don\'t need to unlock the door seperately - you will be able to walk through it without any trouble. Click on an item to see more information about it.
'.$name.'
'; echo '
'; echo '

'; echo '
'; } if ((count($doors) > 1) || ($doors[0])) { echo '
Doors
'; $max = count($doors); for ($i = 0;$i < $max;$i++) { $item = $doors[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) echo ''; } } echo '
Doors must be carried from the forges to their respective buildings and installed from the inventory. Click on an item to see more information about it.
'.$name.'
'; echo '
'; echo '

'; echo '
'; } echo '
'; echo '
'; echo '
'; if ((count($poison) > 1) || ($poison[0])) { echo '
Poison
'; $max = count($poison); for ($i = 0;$i < $max;$i++) { $item = $poison[$i]; if ($item) { $conditions = "WHERE id='$item'"; $name = getInfo(name,user_items,$conditions); $stat = getInfo("stat",user_items,$conditions); $price = getInfo(price,user_items,$conditions); $stats = '-'.$stat.' health'; if ($i % 4 == 0) echo ''; echo ''; if ((($i + 1) % 4 == 0) || ($i + 1 == $max)) { echo ''; if ($max > 3) echo ''; } } } echo '
Poisons can be mixed with foods or used to taint weapons to add extra damage over time. Click on an item to see more information about it.
'.$name.'
'.$stats; echo '

'; echo '

'; echo '
'; } if ((count($resources) > 0) || (count($materials) > 0)) { echo '
Crating Resources/Materials
'; echo ''; echo ''; echo ''; echo '
'; echo '
'; echo 'To make managing resources and materials easier, you can use this tool to automatically crate together all like resources and materials. If you wish, you may choose to set a maximum number per crate, so that multiple crates will be created for each resource. If you wish to put all of each type into a single crate, simply leave the "maximum" box blank.

'; echo '
'; echo 'Maximum items in each crate: '; echo '
'; echo '
'; echo '

'; echo '
'; } if (getInfo(id,pots,"WHERE creator='$userId'")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Gambling
'; echo '
'; echo '
You currently have an active gambling pot. You can manage it here
'; echo '
'; echo '
'; } if (getInfo(name,lords,"WHERE name='$userId'")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Lordship
'; echo '
'; echo '
You are a Lord, and may manage your knights here
'; echo '
'; echo '
'; } if (getInfo(id,payments,"WHERE boss='$userId' or user='$userId'")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Regular Automatic Payments
'; echo '
'; echo ''; $result = getRows(payments,"WHERE boss='$userId'"); while ($row = mysql_fetch_array($result)) { $id = $row['id']; $user = $row['user']; $username = getInfo(username,users,"WHERE id='$user'"); $amount = $row['amount']; $interval = $row['interval']; $interval = $interval / (24 * 3600); echo ''; } $result = getRows(payments,"WHERE user='$userId'"); while ($row = mysql_fetch_array($result)) { $id = $row['id']; $user = $row['boss']; $username = getInfo(username,users,"WHERE id='$user'"); $amount = $row['amount']; $interval = $row['interval']; $interval = $interval / (24 * 3600); echo ''; } echo '
'.$amount.' gold to '.$username.' every '.$interval.' days
'.$amount.' gold from '.$username.' every '.$interval.' days
'; echo '
'; echo '
'; } if (getInfo(user1,trades,"WHERE user1='$userId' or user2='$userId'")) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Trades
'; echo '
'; echo ''; $result = getRows(trades,"WHERE user1='$userId' or user2='$userId'"); while ($row = mysql_fetch_array($result)) { $i = $row['id']; $user1 = $row['user1']; $user2 = $row['user2']; $user1Name = getInfo(username,users,"WHERE id='$user1'"); $user2Name = getInfo(username,users,"WHERE id='$user2'"); if ($user1 == $userId) echo ''; if ($user2 == $userId) echo ''; } echo '
Trade with '.$user2Name.'
Trade with '.$user1Name.'
'; echo '
'; echo '
'; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Party
'; echo '
'; echo ''; $userIdString = '.'.$userId.'.'; $party = getInfo(id,parties,"WHERE invites like '%$userIdString%'"); $inviter = getInfo(leader,parties,"WHERE id='$party'"); $invitername = getInfo(username,users,"WHERE id='$inviter'"); if (getInfo(id,parties,"WHERE invites like '%$userIdString%'")) { echo ''; } elseif (getInfo(party,users,"WHERE id='$userId'")) { $party = getInfo(party,users,"WHERE id='$userId'"); if (getInfo(id,parties,"WHERE leader='$userId'")) { $result = getRows(users,"WHERE party='$party' and id!='$userId'"); while ($row = mysql_fetch_array($result)) { echo ''; } echo ''; } else { $result = getRows(users,"WHERE party='$party'"); while ($row = mysql_fetch_array($result)) { echo ''; } echo ''; } } else { echo ''; } echo '
To help in combat situations and other adventuring scenarios, your character can group together with other characters to form a party. During a fight, if a character who belongs to the same party as you is in the same room at the time of an attack, they will have the opportunity to parry that attack for you. Also, some characters will be able to make use of spells that will apply to their entire party.

'.$row['username'].'

'.$row['username'].'


'; echo '
'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
NPC Groups
'; echo '
'; echo ''; $result = getRows(npc_groups,"WHERE creator='$userId' or leader='$userId'"); while ($row = mysql_fetch_array($result)) { $group = $row['id']; $mode = $row['mode']; $var = $row['var']; $name = $row['name']; if ($mode == "siege") { $target = getInfo(name,places,"WHERE id='$var'"); $job = "Fire siege weapons at $target"; } if ($mode == "arrows") { $targetPlace = getInfo(place,rooms,"WHERE id='$var'"); $targetPlaceName = getInfo(name,places,"WHERE id='$targetPlace'"); $target = getInfo(name,rooms,"WHERE id='$var'"); $job = "Fire arrows into $target, in $targetPlaceName"; if (!$target) $job = "Prepare bows and arrows, hold fire"; } if ($mode == "protect") { $protected = getInfo(username,users,"WHERE id='$var'"); $job = "Protect $protected"; } if ($mode == "sell") { $job = "Automatically tend to the selling of items, if the npc is an employee in its current location"; } if ($mode == "mine") { $job = "Automatically pick up every crude resource in a room, once every twelve hours."; } if ($mode == "wander") { $job = "Wander"; } if ($mode == "") { $job = "Idle"; } echo ''; } echo ''; echo '
In order to better control your NPCs, you can place them into groups. This way, you can give a common goal or command to the entire group, instead of having to deal with each NPC individually. Be mindful, however, that not all commands can be applied to the entire group.
'.$name.' : '.$job.'

'; echo '
'; echo '
'; if (numRowsConditions(npc_citizens,"WHERE employer='$userId'") > 0) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Hired NPCs
'; echo '
'; echo ''; $result = getRows(npc_citizens,"WHERE employer='$userId'"); while ($row = mysql_fetch_array($result)) { $npc = $row['npc']; $npcname = getInfo(username,users,"WHERE id='$npc'"); $status = getInfo(status,users,"WHERE id='$npc'"); if ($status != "dead") { $job = $row['job']; $mode = $row['mode']; if ($mode == "pause") $modeName = "Eating"; if ($mode == "working") $modeName = "Working"; if ($mode == "travel") $modeName = "Travelling"; if (!$mode) $modeName = "Idle/Waiting"; if ($job == "sell") $jobName = "Vendor"; if ($job == "mine") $jobName = "Miner"; if ($job == "protect") $jobName = "Bodyguard"; if ($job == "other") $jobName = "Miscellaneous"; echo ""; } } echo ''; echo '
Hiring citizen NPCs can prove to be a very useful cheap alternative to making NPCs yourself. For more information about hiring citizen NPCs, please refer to this guide article: Hiring Citizen NPCs

$npcname: $jobName, currently $modeName
'; echo '
'; echo '
'; } echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
NPCs
'; echo '
'; echo ''; $result = getRows(users,"WHERE NPC='$userId' and status!='dead'"); while ($row = mysql_fetch_array($result)) { $npc = $row['id']; $npcname = $row['username']; $npc_id = $row['id']; $mode = getInfo(mode,npcs,"WHERE name='$npc'"); $var = getInfo('var',npcs,"WHERE name='$npc'"); if ($mode == "siege") { $target = getInfo(target,npc_siege,"WHERE npc='$npc'"); $weapon = getInfo(weapon,npc_siege,"WHERE npc='$npc'"); $weaponType = getInfo(type,arsenals,"WHERE id='$weapon'"); $weaponType = getInfo(name,weapons,"WHERE id='$weaponType'"); $ammo = getInfo(ammo,npc_siege,"WHERE npc='$npc'"); $ammoType = getInfo(type,ammo,"WHERE id='$ammo'"); $ammoType = getInfo(name,ammunition,"WHERE id='$ammoType'"); $targetName = getInfo(name,places,"WHERE id='$target'"); if ($target) { $job = "Fire $weaponType [$weapon] ($ammoType) at $targetName."; $cooldown = getInfo(cooldown,arsenals,"WHERE id='$weapon'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Weapon cooldown in $hours hours, $minutes minutes and $seconds seconds."; } else { $job .= " Weapon cooldown complete."; } $cooldown = getInfo('time',npc_siege,"WHERE npc='$npc'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Firing next in $hours hours, $minutes minutes and $seconds seconds"; } else { $job .= " Ready to fire."; } } else { $job = "Man $weaponType [$weapon] ($ammoType) and return fire if attacked."; $cooldown = getInfo(cooldown,arsenals,"WHERE id='$weapon'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Weapon cooldown in $hours hours, $minutes minutes and $seconds seconds"; } else { $job .= " Weapon cooldown complete"; } } } if ($mode == "arrows") { $target = getInfo(target,npc_arrow,"WHERE npc='$npc'"); $roomName = getInfo(name,rooms,"WHERE id='$target'"); $targetName = getInfo(place,rooms,"WHERE id='$target'"); $targetName = getInfo(name,places,"WHERE id='$targetName'"); if ($target) { $job = "Fire arrows at $roomName, $targetName."; $cooldown = getInfo(arrows,npcs,"WHERE name='$npc'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Cooldown in $hours hours, $minutes minutes and $seconds seconds."; } else { $job .= " Cooldown complete."; } $cooldown = getInfo('time',npc_arrow,"WHERE npc='$npc'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Firing next in $hours hours, $minutes minutes and $seconds seconds"; } else { $job .= " Ready to fire"; } } else { $job = "Stand guard with bow and arrows, return fire if attacked."; $cooldown = getInfo(arrows,npcs,"WHERE name='$npc'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Cooldown in $hours hours, $minutes minutes and $seconds seconds"; } else { $job .= " Cooldown complete"; } } } if ($mode == "protect") { $protected = getInfo(username,users,"WHERE id='$var'"); $job = "Protect $protected"; } if ($mode == "sell") { $job = "Automatically tend to the selling of items, if the npc is an employee in its current location"; } if ($mode == "mine") { $job = "Automatically pick up crude resources."; $cooldown = getInfo('time',npc_mining,"WHERE npc='$npc'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Picking up next in $hours hours, $minutes minutes and $seconds seconds"; } } if ($mode == "") { $job = "Idle"; } echo ''; } $result = getRows(npcs,"WHERE leader='$userId'"); while ($row = mysql_fetch_array($result)) { $npc = $row['name']; if (getInfo(status,users,"WHERE id='$npc'") != "dead") { $npcname = getInfo(username,users,"WHERE id='$npc'"); $mode = getInfo(mode,npcs,"WHERE name='$npc'"); $var = getInfo('var',npcs,"WHERE name='$npc'"); if ($mode == "siege") { $target = getInfo(target,npc_siege,"WHERE npc='$npc'"); $weapon = getInfo(weapon,npc_siege,"WHERE npc='$npc'"); $weaponType = getInfo(type,arsenals,"WHERE id='$weapon'"); $weaponType = getInfo(name,weapons,"WHERE id='$weaponType'"); $ammo = getInfo(ammo,npc_siege,"WHERE npc='$npc'"); $ammoType = getInfo(type,ammo,"WHERE id='$ammo'"); $ammoType = getInfo(name,ammunition,"WHERE id='$ammoType'"); $targetName = getInfo(name,places,"WHERE id='$target'"); if ($target) { $job = "Fire $weaponType [$weapon] ($ammoType) at $targetName."; $cooldown = getInfo(cooldown,arsenals,"WHERE id='$weapon'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Weapon cooldown in $hours hours, $minutes minutes and $seconds seconds."; } else { $job .= " Weapon cooldown complete."; } $cooldown = getInfo('time',npc_siege,"WHERE npc='$npc'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Firing next in $hours hours, $minutes minutes and $seconds seconds"; } else { $job .= " Ready to fire."; } } else { $job = "Man $weaponType [$weapon] ($ammoType) and return fire if attacked."; $cooldown = getInfo(cooldown,arsenals,"WHERE id='$weapon'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Weapon cooldown in $hours hours, $minutes minutes and $seconds seconds"; } else { $job .= " Weapon cooldown complete"; } } } if ($mode == "arrows") { $target = getInfo(target,npc_arrow,"WHERE npc='$npc'"); $roomName = getInfo(name,rooms,"WHERE id='$target'"); $targetName = getInfo(place,rooms,"WHERE id='$target'"); $targetName = getInfo(name,places,"WHERE id='$targetName'"); if ($target) { $job = "Fire arrows at $roomName, $targetName."; $cooldown = getInfo(arrows,npcs,"WHERE name='$npc'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Cooldown in $hours hours, $minutes minutes and $seconds seconds."; } else { $job .= " Cooldown complete."; } $cooldown = getInfo('time',npc_arrow,"WHERE npc='$npc'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Firing next in $hours hours, $minutes minutes and $seconds seconds"; } else { $job .= " Ready to fire"; } } else { $job = "Stand guard with bow and arrows, return fire if attacked."; $cooldown = getInfo(arrows,npcs,"WHERE name='$npc'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Cooldown in $hours hours, $minutes minutes and $seconds seconds"; } else { $job .= " Cooldown complete"; } } } if ($mode == "protect") { $protected = getInfo(username,users,"WHERE id='$var'"); $job = "Protect $protected"; } if ($mode == "sell") { $job = "Automatically tend to the selling of items, if the npc is an employee in its current location"; } if ($mode == "mine") { $job = "Gather resources from the room."; $cooldown = getInfo('time',npc_mining,"WHERE npc='$npc'"); $cooldown = $cooldown - time(); if ($cooldown > 0) { $hours = truncate($cooldown / 3600); $cooldown = $cooldown - ($hours * 3600); $minutes = truncate($cooldown / 60); $seconds = $cooldown - ($minutes * 60); $job .= " Picking up next in $hours hours, $minutes minutes and $seconds seconds"; } } if ($mode == "") { $job = "Idle"; } echo ''; } } echo ''; if (npclimit($userId)) echo ''; echo ''; echo '
NPCs, or non-player-characters are little computer-run characters that can be used to fill the odd jobs that you yourself may not wish to do. While some NPCs can only be used for shopkeeping, mining and delivering messages, others can be used in combat as well.
Please refer to this guide article for more information: NPCs

'.$npcname.' : '.$job.'
'.$npcname.' : '.$job.'



'; echo '
'; echo '
'; if (numRowsConditions(users,"WHERE master='$userId' and status!='dead'") > 0) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Slaves
'; echo '
'; echo ''; $result = getRows(users,"WHERE master='$userId' and status!='dead'"); while ($row = mysql_fetch_array($result)) { $user = $row['id']; $username = $row['username']; echo ''; } echo '
Other users can be enslaved - however, when you take someone captive, make sure you have use for them, or intend to trade them away. Leaving a character to rot is not curteous and will only harm the site as a whole.
Please refer to this guide article for more information: Slavery

'.$username.'
'; echo '
'; echo '
'; } if (numRowsConditions(cults,"WHERE leader='$userId'") > 0) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Cults
'; echo '
'; echo ''; $max = numRows(cults); for ($i = 1;$i <= $max;$i++) { $conditions = "WHERE id='$i'"; $owner = getInfo(leader,cults,$conditions); $place = getInfo(name,cults,$conditions); if ($owner == $userId) echo ''; } echo '
'.$place.'
'; echo '
'; echo '
'; } if (numRowsConditions(transport,"WHERE captain='$userId'") > 0) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Ships and Caravans
'; echo '
'; echo ''; $result = getRows(transport,"WHERE captain='$userId'"); while ($row = mysql_fetch_array($result)) { $conditions = "WHERE id='$i'"; $place = $row['place']; $name = getInfo(name,places,"WHERE id='$place'"); echo ''; } echo '
A ship or caravan can be used to transport people and goods over water or land respectively. As captain, you have control over steering and the inventory.

'.$name.'
'; echo '
'; echo '
'; } if (numRowsConditions(rooms,"WHERE tenant='$userId'") > 0) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Rooms (Tenanted)
'; echo '
'; echo ''; $max = numRows(rooms); for ($i = 1;$i <= $max;$i++) { $conditions = "WHERE id='$i'"; $tenant = getInfo(tenant,rooms,$conditions); $room = getInfo(name,rooms,$conditions); if ($tenant == $userId) echo ''; } echo '
As a tenant of a room, you have certain control over it, such as locking the door, and also altering its description if the building\'s owner has allowed you to do so.

'.$room.'
'; echo '
'; echo '
'; } if (numRowsConditions(places,"WHERE owner='$userId'") + numRowsConditions(co_owners,"WHERE user='$userId'") + numRowsConditions(rooms,"WHERE tenant='$userId'") > 0) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Buildings/Places
'; echo '
'; echo ''; $max = numRows(places); for ($i = 1;$i <= $max;$i++) { $conditions = "WHERE id='$i'"; $owner = getInfo(owner,places,$conditions); $place = getInfo(name,places,$conditions); if ($place) { $town = getInfo(town,places,$conditions); if ($town) $town = getInfo(name,towns,"WHERE id='$town'"); else $town = getInfo(x,transport,"WHERE place='$i'").','.getInfo(y,transport,"WHERE place='$i'"); if ((($owner == $userId) || ((numRowsConditions(rooms,"WHERE place='$i' and tenant!='$userId'") <= 0) && ((!$owner) || ($owner == 1)))) && (!getInfo(abandoned,places,"WHERE id='$i'"))) echo ''; } } $result = getRows(co_owners,"WHERE user='$userId'"); while ($row = mysql_fetch_array($result)) { $place = $row['place']; $placename = getInfo(name,places,"WHERE id='$place'"); $town = getInfo(town,places,"WHERE id='$place'"); if ($town) $town = getInfo(name,towns,"WHERE id='$town'"); else $town = getInfo(x,transport,"WHERE place='$i'").','.getInfo(y,transport,"WHERE place='$i'"); echo ''; } echo '
A building can be anything from a single-room hut, to a town square, to a castle, to a ship. Anathema Online is organized through towns that contains buildings, and buildings that contain rooms.

'.$place.' ('.$town.')
'.$placename.' ('.$town.')
'; echo '
'; echo '
'; } if (numRowsConditions(towns,"WHERE leader='$userId'") > 0) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Towns
'; echo '
'; echo ''; $result = getRows(towns,"WHERE leader='$userId'"); while ($row = mysql_fetch_array($result)) { $town = $row['name']; $town_id = $row['id']; echo ''; } echo '
As the owner of a town or village, you can manage it and the buildings within it.

'.$town.'
'; echo '
'; echo '
'; } if (numRowsConditions(kingdoms,"WHERE leader='$userId'") > 0) { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Kingdoms
'; echo '
'; echo ''; $max = numRows(kingdoms); for ($i = 1;$i <= $max;$i++) { $conditions = "WHERE id='$i'"; $master = getInfo(leader,kingdoms,$conditions); $kingdom = getInfo(name,kingdoms,$conditions); if ($master == $userId) echo ''; } echo '
As a king, you can manage the description of your kingdom, the characters named as your children, your consort and the citizens.

'.$kingdom.'
'; echo '
'; } } else { echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo '
Error
'; echo '
'; if (!$logged_in) echo '
You must login to view this.
'; else echo '
You must select a character to view this.
'; echo '
'; echo '
'; } echo ''; include "index-bottom.php" ?>