= time())) || (getInfo(NPC,users,"WHERE id='$npc'") == $userId) || (getInfo(status,users,"WHERE id='$npc'") == "immobilized")) && (getInfo(room,users,"WHERE id='$npc'") == getInfo(room,users,"WHERE id='$userId'"))) || (admin($user_name)) || (moderator($user_name)) || (getInfo(status,users,"WHERE id='$npc'") == "dead")) { $commands = $_POST['command']; $post = $_POST['post']; $conditions = "WHERE id='$id'"; $buildingId = getInfo(place,rooms,$conditions); $conditions = "WHERE id='$buildingId'"; $building = getInfo(name,places,$conditions); $town = getInfo(town,places,$conditions); $count = 0; if ($id) { $conditions = "WHERE id='$id'"; $place_description = stripslashes(getInfo(description,rooms,$conditions)); $room = stripslashes(getInfo(name,rooms,$conditions)); $place_id = getInfo(place,rooms,$conditions); $place_type = getInfo(type,places,"WHERE id='$place_id'"); $place_type = getInfo(type,buildings,"WHERE id='$place_type'"); echo ''; echo ''; if (numRowsConditions(archives,"WHERE thread_id='$id'") > 0) echo ''; echo '
'.$room.'
'.$place_description.'
View Archived Posts for this Room

'; } $records = explode('.',getInfo(records,users,"WHERE id='$npc'")); $countMax = count($records); for ($i = 0;$i < $countMax;$i++) { $record = explode(':',$records[$i]); if ((!$id) || ($record[1] == $id)) { if (getInfo(post,posts,"WHERE id='".$record[0]."'")) $posts[] = $record[0]; } } $max = count($posts); if (!implode('.',$posts)) $max = 0; $page = $_GET['page']; if (!$page) $page = truncate(($max - 1) / 10) + 1; if ($page * 10 > $max) { $page = truncate(($max - 1) / 10) + 1; } $offset = (10 * ($page - 1)); $stop = $offset + 10; if ($stop > $max) $stop = $max; for ($i = $offset;$i < $stop;$i++) { $ii = $posts[$i]; $intox = ''; $dex = 0; $conditions = "WHERE id='$ii'"; $row = getRow('*',posts,"WHERE id='$ii'"); $username = $row['username']; $profile_id = getInfo(username,posts,$conditions); $username = getInfo(username,users,"WHERE id='$profile_id'"); $thread_id = getInfo(thread_id,posts,$conditions); $date = $row['date']; $ooc = $row['ooc']; $whisper = getInfo(whisper,posts,$conditions); if (($whisper) && (($whisper != $npc) && ($profile_id != $npc))) $ooc = "ooc"; if (!$ooc) { $user_id = $row['id']; $post = $row['post']; if (!$post) { $row = getRow('*',archives,"WHERE id='$ii'"); $post = $row['post']; } if ($post) { $health = $row['health']; $mana = $row['mana']; $dex = $row['dex']; $stretch = $row['stretch']; $money = $row['money']; $nationality = $row['nationality']; $conditions = "WHERE id='$nationality'"; $nationality = getInfo(name,kingdoms,$conditions); $master = $row['master']; $statmax = $row['statmax']; $rank = $row['rank']; $status = $row['status']; $conditions = "WHERE username='$username'"; $sex = getInfo(sex,users,$conditions); $conditions = "WHERE level='$rank'"; if ($sex == "f") $rank = getInfo(female,ranks,$conditions); else $rank = getInfo(male,ranks,$conditions); if ($rank == "Knight") { if ($sex == "f") $rank = "Dame"; if ($sex == "m") $rank = "Sir"; } $intox = ''; if ($dex > 0) $intox = "Barely Intoxicated"; if ($dex > 10) $intox = "Slightly Intoxicated"; if ($dex > 20) $intox = "Moderately Intoxicated"; if ($dex > 30) $intox = "Very Intoxicated"; if ($dex > 40) $intox = "Extremely Intoxicated"; if ($dex >= 50) $intox = "Passed Out"; $fatigue = $row['fatigue']; if ($fatigue <= 20) $warning = "Weary"; if ($fatigue <= 15) $warning = "Tired"; if ($fatigue <= 10) $warning = "Very Tired"; if ($fatigue <= 5) $warning = "Exhausted"; $hunger = $row['hunger']; if ($hunger <= 20) $hungry = "Peckish"; if ($hunger <= 15) $hungry = "Hungry"; if ($hunger <= 10) $hungry = "Famished"; if ($hunger <= 5) $hungry = "Starving"; echo '

'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; if ($rank != "Peasant") echo $rank; echo ' '.$username.''; if ($nationality) echo ' of '.$nationality; echo ''; echo $date; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; $wounds = getInfo(wounds,users,"WHERE username='$npc'"); echo ''; echo ''; echo '
'; echo ' Profile
Send Message
Trade
Offer Job'; if (admin($npc)) echo '
View Record'; echo '
'; echo '
'; echo '

'; $users = $row['users']; $usersArray = explode('.',$users); if ($users) { $users = explode('.',$users); $max = count($users); for ($iii = 0;$iii < $max;$iii++) { $users[$iii] = getInfo(username,users,"WHERE id='$users[$iii]'"); } $users = implode(', ',$users); $roomname = getInfo(name,rooms,"WHERE id='$thread_id'"); $place = getInfo(place,rooms,"WHERE id='$thread_id'"); $placename = getInfo(name,places,"WHERE id='$place'"); if (!inArray($npc,$usersArray)) echo "$npcname was not in this room; this was seen from a guard tower or a town wall.
"; echo "Currently in the room ($roomname, $placename): $users."; echo "

"; } echo stripslashes($post); echo '
'; echo '
'; if ($status == "unconscious") echo "Unconscious
"; if ($status == "immobilized") echo "Tied Up
"; echo $health.' Health Points
'; echo $mana.' Mana Points
'; echo $intox.'
'; if ($warning) echo $warning.'
'; if ($hungry) echo $hungry.'
'; if ((admin($npc)) || (last($ii,$id,$npc)) || (moderator($npc))) echo '
'; if ((admin($npc)) || (last($ii,$id,$npc)) || (moderator($npc))) echo '
'; echo '[Report this Post]'; echo '
'; unset($dex); unset($intox); unset($warning); } } else { $user_id = $row['id']; $post = $row['post']; if (!$post) { $row = getRow('*',archives,"WHERE id='$ii'"); $post = $row['post']; } if ($post) { $whispername = getInfo(username,users,"WHERE id='$whisper'"); $nationality = $row['nationality']; $conditions = "WHERE id='$nationality'"; $nationality = getInfo(name,kingdoms,$conditions); $rank = $row['rank']; $rankLevel = $rank; $conditions = "WHERE username='$username'"; $sex = getInfo(sex,users,$conditions); $conditions = "WHERE level='$rank'"; if ($sex == "f") $rank = getInfo(female,ranks,$conditions); else $rank = getInfo(male,ranks,$conditions); if ($rank == "Knight") { if ($sex == "f") $rank = "Dame"; if ($sex == "m") $rank = "Sir"; } echo '

'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
['; if (!$whisper) { if ($ooc == "ooc") echo "OOC"; else echo "Failed Counter"; } else { echo "Whisper"; } echo '] '; if (($username != "God") && ($rankLevel > 10)) echo $rank; echo ' '.$username.''; if ($nationality) echo ' of '.$nationality; echo ''; echo $date; echo 'Show/Hide
'; echo ''; echo ''; echo ''; echo '
'; if (!$whisper) { echo str_replace("\\'","'",str_replace('\\"','"',stripslashes($post))); } else { echo "$username whispered to $whispername."; } echo '
[Report this Post]'; if (admin($npc)) echo '
'; if ((admin($npc)) || (last($ii,$id,$npc))) echo '
'; echo '
'; } } } $max = count($posts); 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 '
Error
'; echo '
'; echo '
You may not view this NPC\'s memories. You must be in the same room as the npc and either own the npc, bribe the npc or immobilize the npc.
'; echo '
'; echo '
'; } ?>