From: Volar25@aol.com <Volar25@aol.com>
To: rom@rom.org <rom@rom.org>
Subject: [SNIPPET]addition to do_yell
Date: Friday, March 03, 2000 11:19 PM

hey all,

Thought this was a nice little addition to our mud, and its simple enough to 
do, just dont know have people have thought of it. This little addition will 
give the direction the person is yelling from, so you type yell blah! and if 
a person is in the area, to the east it will say something along the lines of 
from the easy volar yells 'blah!' etc... Use it freely. Not sure if something 
like this is even out there..just thought i'd share it.

Volar
Chronicles os Chaos
http://coc.mudservices.com
telnet://coc.mudservices.com 6666

/* Replace do_yell in act_comm.c ith this function: */
void do_yell( CHAR_DATA *ch, char *argument )
{
    char buf[ MAX_STRING_LENGTH ];
    ROOM_INDEX_DATA *rlist[ 500 ];
    CHAR_DATA *vch;
    int rooms, i;

    if ( IS_SET(ch->comm, COMM_NOSHOUT) )
    {
        send_to_char( "You can't yell.\n\r", ch );
        return;
    }
 
    if ( argument[0] == '\0' )
    {
    send_to_char( "Yell what?\n\r", ch );
    return;
    }

    if (!IS_NPC(ch) && ch->pcdata->condition[COND_DRUNK] > 10)
        argument = makedrunk(argument,ch);

    act("You yell '{D$t{x'",ch,argument,NULL,TO_CHAR);
    rooms = get_rooms_in_range( ch->in_room, 8, rlist, 500 );

    for( i = 0 ; i < rooms; i++ )
    {
    if( !rlist[i]->people ) continue;

    switch( rlist[i]->temp )
    {
     /* We use reverse directions, cause r->temp is relative to ch,
        not from the room to ch */

       case DIR_NOWHERE:
        sprintf( buf, "$n yells '{D%s{x'",argument );
        break;
       case DIR_UP:
        sprintf( buf, "From somewhere below, $n yells '{D%s{x'",argument );
        break;
       case DIR_DOWN:
        sprintf( buf, "From somewhere above, $n yells '{D%s{x'",argument );
        break;
       default:
        sprintf( buf, "Somewhere %s of here, $n yells '{D%s{x'",
          dir_name[ rev_dir[ rlist[i]->temp ] ], argument );
        break;
    }

    for( vch = rlist[i]->people; vch ; vch = vch->next_in_room )
      if( ch != vch && !IS_SET( vch->comm, COMM_QUIET ) )
        act( buf, ch, NULL, vch, TO_VICT );
    }

    return;
}


-- 
There is a searchable archive at http://romlist.compu.net/
