Kohl Desenee
------------
drunkwalk v1.1

What's New?
-----------
1.1 - I wrote the snippet in pine rather than with hotmail so.. it's
      spaced better. :)
    - I spent more time on it after I remembered right after I sent the
      last version that I forgot all about messages for entering a room.
      Some bug fixes too.. 'Homer!'
    - I talk less.. Suuure.. ;)

1.2 - I actually installed it myself before mailing it once again. ;)
    - I fixed 5 nasty little bugs that reminded me just how awful my code
      is when it's written in the wee hours of the morning. *snicker*
    - I now believe this code to be perfection itself, if you care to
      dispute that, email me about why. :)
    - Added to copyright hoopla at bottom.. Woo!

At the top of move_char put this:

    if (!IS_NPC(ch))
    {
      /* Uh oh, another drunk Frenchman on the loose! :) */
      if (ch->pcdata->condition[COND_DRUNK] > 10)
      {
        if (ch->pcdata->condition[COND_DRUNK] > number_percent())
        {
          act("You feel a little drunk.. not to mention kind of lost..",
              ch,NULL,NULL,TO_CHAR);
          act("$n looks a little drunk.. not to mention kind of lost..",
              ch,NULL,NULL,TO_ROOM);
          door = number_range(0,5);
        }
        else
        {
          act("You feel a little.. drunk..",ch,NULL,NULL,TO_CHAR);
          act("$n looks a little.. drunk..",ch,NULL,NULL,TO_ROOM);
        }
      }
    }


Then you'll want to drop down to where it gives you an exit message:

    if (!IS_NPC(ch) && ch->pcdata->condition[COND_DRUNK] > 10)
        act("$n stumbles off drunkenly on $s way $T.",
            ch,NULL,dir_name[door],TO_ROOM);
    else
        act("$n leaves $T.",ch,NULL,dir_name[door],TO_ROOM);


After that go to the entrance message and replace it with:

    if (!IS_NPC(ch) && ch->pcdata->condition[COND_DRUNK] > 10)
        act("$n stumbles in drunkenly, looking all nice and French.",
            ch,NULL,NULL,TO_ROOM);
    else
        act("$n has arrived.",ch,NULL,NULL,TO_ROOM);


Now if you really want to be a dork, go to where it says 'Alas, you can
not go that way.' and put this in its stead (you will probably want to do 
the same thing, more or less, where it says that the door is closed):

    if ((IS_NPC(ch) && number_percent() < 10)
    || (!IS_NPC(ch) && number_percent() < (10 +
        ch->pcdata->condition[COND_DRUNK])))
    {
      if (!IS_NPC(ch) && ch->pcdata->condition[COND_DRUNK] > 10)
      {
        act("You drunkenly slam face-first into the 'exit' on your way
            $T.",ch,NULL,dir_name[door],TO_CHAR);
        act("$n drunkenly slams face-first into the 'exit' on $s way $T.",
            ch,NULL,dir_name[door],TO_ROOM);
        damage_old(ch,ch,3,0,DAM_BASH,FALSE);
      }
      else
      {
        act("You drunkenly face-first into the 'exit' on your way $T.
            WHAM!",ch,NULL,dir_name[door],TO_CHAR);
        act("$n slams face-first into the 'exit' on $s way $T. WHAM!",
            ch,NULL,dir_name[door],TO_ROOM);
        damage_old(ch,ch,3,0,DAM_BASH,FALSE);
      }
    }
    else
    {
      if (!IS_NPC(ch) && ch->pcdata->condition[COND_DRUNK] > 10)
      {
        act("You stumble about aimlessly and fall down drunk.",
            ch,NULL,dir_name[door],TO_CHAR);
        act("$n stumbles about aimlessly and falls down drunk.",
            ch,NULL,dir_name[door],TO_ROOM);
         ch->position = POS_RESTING;
      }
      else
      {
        act("You almost go $T, but suddenly realize that there's no exit
            there.",ch,NULL,dir_name[door],TO_CHAR);
        act("$n looks like $e's about to go $T, but suddenly stops short
            and looks confused.",ch,NULL,dir_name[door],TO_ROOM);
      }
    }

mud code ends here
------------------

Bug free? I think so. Let me know if not..

When I bother to implement this on my own mud, there will be checks for
sector and such that will greatly enhance the different messages.. There
will also be cutesy stuff for each of the other uh ohs.. such as trying to
go into an air room without flight, etc. If I feel so inclined, I might
release that too. Other code snippets soon to come. :)

Feel free to accredit Kohl Desenee for the above, just don't brag that you
wrote it yourself or, um, I shall send several drunken Frenchmen from
Canada to hunt you down and bring me.. more booze..

In fact! Now you absolutely have to accredit me to use this code. :) As
long as you accredit me properly for my work, you have full permission to
use this on your mud, but permission to post this on a code snippet page
belongs solely to Darkoth and myself. :) I've now put actual thought into
this software and so I think a little show of appreciation is in order..

Any questions, comments, etc. to be directed to foxyrev@hotmail.com

Anthony Michael Tregre (pronounced 'tray-share' for those of you who don't
                        speak a lick of French ;)
