function darkhorse_bartender($from)
{
    global $session;
    $what = httpget('what');
    if ($what == "") {
        output("The grizzled old man behind the bar reminds you very much of a strip of beef jerky.`n`n");
        $dname = translate_inline($session['user']['sex'] ? "lasshie" : "shon");
        output("\"`7Shay, what can I do for you %s?`0\" inquires the toothless fellow.", $dname);
        output("\"`7Don't shee the likesh of your short too offen 'round theshe partsh.`0\"");
        addnav("Learn about my enemies", $from . "op=bartender&what=enemies");
        addnav("Learn about colors", $from . "op=bartender&what=colors");
    } elseif ($what == "colors") {
        output("The old man leans on the bar.");
        output("\"`%Sho you want to know about colorsh, do you?`0\" he asks.`n`n");
        output("You are about to answer when you realize the question was rhetorical.`n`n");
        output("He continues, \"`%To do colorsh, here'sh what you need to do.  Firsht, you ushe a ` mark (found right above the tab key) followed by 1, 2, 3, 4, 5, 6, 7, !, @, #, \$, %, ^, &, ), q or Q.  Each of thoshe correshpondsh with a color to look like this: `n`1`1 `2`2 `3`3 `4`4 `5`5 `6`6 `7`7 `n`!`! `@`@ `#`# `\$`\$ `%`% `^`^ `&`& `n `)`) `q`q `Q`Q `n`% got it?`0\"`n  You can practice below:", true);
        rawoutput("<form action=\"" . $from . "op=bartender&what=colors\" method='POST'>");
        $testtext = httppost('testtext');
        $try = translate_inline("Try");
        rawoutput("<input name='testtext' id='testtext'><input type='submit' class='button' value='{$try}'></form>");
        addnav("", $from . "op=bartender&what=colors");
        rawoutput("<script language='JavaScript'>document.getElementById('testtext').focus();</script>");
        if ($testtext) {
            output("`0You entered %s`n", prevent_colors(HTMLEntities($testtext, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))), true);
            output("It looks like %s`n", $testtext);
        }
        output("`0`n`nThese colors can be used in your name, and in any conversations you have.");
    } else {
        if ($what == "enemies") {
            $who = httpget('who');
            if ($who == "") {
                output("\"`7Sho, you want to learn about your enemiesh, do you?  Who do you want to know about?  Well?  Shpeak up!  It only costs `^100`7 gold per person for information.`0\"");
                $subop = httpget('subop');
                if ($subop != "search") {
                    $search = translate_inline("Search");
                    rawoutput("<form action='" . $from . "op=bartender&what=enemies&subop=search' method='POST'><input name='name' id='name'><input type='submit' class='button' value='{$search}'></form>");
                    addnav("", $from . "op=bartender&what=enemies&subop=search");
                    rawoutput("<script language='JavaScript'>document.getElementById('name').focus();</script>");
                } else {
                    addnav("Search Again", $from . "op=bartender&what=enemies");
                    $search = "%";
                    $name = httppost('name');
                    for ($i = 0; $i < strlen($name); $i++) {
                        $search .= substr($name, $i, 1) . "%";
                    }
                    $sql = "SELECT name,alive,location,sex,level,laston,loggedin,login FROM " . db_prefix("accounts") . " WHERE (locked=0 AND name LIKE '{$search}') ORDER BY level DESC";
                    $result = db_query($sql);
                    $max = db_num_rows($result);
                    if ($max > 100) {
                        output("`n`n\"`7Hey, whatsh you think yoush doin'.  That'sh too many namesh to shay.  I'll jusht tell you 'bout shome of them.`0`n");
                        $max = 100;
                    }
                    $n = translate_inline("Name");
                    $lev = translate_inline("Level");
                    rawoutput("<table border=0 cellpadding=0><tr><td>{$n}</td><td>{$lev}</td></tr>");
                    for ($i = 0; $i < $max; $i++) {
                        $row = db_fetch_assoc($result);
                        rawoutput("<tr><td><a href='" . $from . "op=bartender&what=enemies&who=" . rawurlencode($row['login']) . "'>");
                        output_notl("%s", $row['name']);
                        rawoutput("</a></td><td>{$row['level']}</td></tr>");
                        addnav("", $from . "op=bartender&what=enemies&who=" . rawurlencode($row['login']));
                    }
                    rawoutput("</table>");
                }
            } else {
                if ($session['user']['gold'] >= 100) {
                    $sql = "SELECT name,acctid,alive,location,maxhitpoints,gold,sex,level,weapon,armor,attack,race,defense,charm FROM " . db_prefix("accounts") . " WHERE login='******'";
                    $result = db_query($sql);
                    if (db_num_rows($result) > 0) {
                        $row = db_fetch_assoc($result);
                        $row = modulehook("adjuststats", $row);
                        $name = str_replace("s", "sh", $row['name']);
                        $name = str_replace("S", "Sh", $name);
                        output("\"`7Well... letsh shee what I know about %s`7,`0\" he says...`n`n", $name);
                        output("`4`bName:`b`6 %s`n", $row['name']);
                        output("`4`bRace:`b`6 %s`n", translate_inline($row['race'], "race"));
                        output("`4`bLevel:`b`6 %s`n", $row['level']);
                        output("`4`bHitpoints:`b`6 %s`n", $row['maxhitpoints']);
                        output("`4`bGold:`b`6 %s`n", $row['gold']);
                        output("`4`bWeapon:`b`6 %s`n", $row['weapon']);
                        output("`4`bArmor:`b`6 %s`n", $row['armor']);
                        output("`4`bAttack:`b`6 %s`n", $row['attack']);
                        output("`4`bDefense:`b`6 %s`n", $row['defense']);
                        output("`n`^%s7 ish alsho ", $row['name']);
                        $amt = $session['user']['charm'];
                        if ($amt == $row['charm']) {
                            output("ash ugly ash you are.`n");
                        } else {
                            if ($amt - 10 > $row['charm']) {
                                output("`bmuch`b uglier shan you!`n");
                            } else {
                                if ($amt > $row['charm']) {
                                    output("uglier shan you.`n");
                                } else {
                                    if ($amt + 10 < $row['charm']) {
                                        output("`bmuch`b more beautiful shan you!`n");
                                    } else {
                                        output("more beautiful shan you.`n");
                                    }
                                }
                            }
                        }
                        $session['user']['gold'] -= 100;
                        debuglog("spent 100 gold to learn about an enemy");
                    } else {
                        output("\"`7Eh..?  I don't know anyone named that.`0\"");
                    }
                } else {
                    output("\"`7Well... letsh shee what I know about cheapshkates like you,`0\" he says...`n`n");
                    output("`4`bName:`b`6 Get some money`n");
                    output("`4`bLevel:`b`6 You're too broke`n");
                    output("`4`bHitpoints:`b`6 Probably more than you`n");
                    output("`4`bGold:`b`6 Definately richer than you`n");
                    output("`4`bWeapon:`b`6 Something good enough to lay the smackdown on you`n");
                    output("`4`bArmor:`b`6 Probably something more fashionable than you`n");
                    output("`4`bAttack:`b`6 Eleventy billion`n");
                    output("`4`bDefense:`b`6 Super Duper`n");
                }
            }
        }
    }
    addnav("Return to the Main Room", $from . "op=tavern");
}
     addnav("Refresh the list", "inn.php?op=bartender&act=listupstairs");
     output("%s`0 lays out a set of keys on the counter top, and tells you which key opens whose room.  The choice is yours, you may sneak in and attack any one of them.", $barkeep);
     pvplist($iname, "pvp.php", "?act=attack&inn=1");
 } else {
     if ($act == "colors") {
         output("%s`0 leans on the bar.  \"`%So you want to know about colors, do you?`0\" he asks.", $barkeep);
         output("You are about to answer when you realize the question was posed in the rhetoric.");
         output("%s`0 continues, \"`%To do colors, here's what you need to do.", $barkeep);
         output(" First, you use a &#0096; mark (found right above the tab key) followed by 1, 2, 3, 4, 5, 6, 7, !, @, #, \$, %, ^, &.", true);
         output("Each of those corresponds with a color to look like this:");
         output_notl("`n`1&#0096;1 `2&#0096;2 `3&#0096;3 `4&#0096;4 `5&#0096;5 `6&#0096;6 `7&#0096;7 ", true);
         output_notl("`n`!&#0096;! `@&#0096;@ `#&#0096;# `\$&#0096;\$ `%&#0096;% `^&#0096;^ `&&#0096;& `n", true);
         output("`% Got it?`0\"  You can practice below:");
         rawoutput("<form action=\"{$REQUEST_URI}\" method='POST'>", true);
         $testtext = httppost('testtext');
         output("You entered %s`n", prevent_colors(HTMLEntities($testtext, ENT_COMPAT, getsetting("charset", "ISO-8859-1"))), true);
         output("It looks like %s`n", $testtext);
         $try = translate_inline("Try");
         rawoutput("<input name='testtext' id='input'>");
         rawoutput("<input type='submit' class='button' value='{$try}'>");
         rawoutput("</form>");
         rawoutput("<script language='javascript'>document.getElementById('input').focus();</script>");
         output("`0`n`nThese colors can be used in your name, and in any conversations you have.");
         addnav("", $REQUEST_URI);
     } else {
         if ($act == "specialty") {
             $specialty = httpget('specialty');
             if ($specialty == "") {
                 output("\"`2I want to change my specialty,`0\" you announce to %s`0.`n`n", $barkeep);
                 output("With out a word, %s`0 grabs you by the shirt, pulls you over the counter, and behind the barrels behind him.", $barkeep);
                 output("There, he rotates the tap on a small keg labeled \"Fine Swill XXX\"`n`n");