Beispiel #1
0
SPEC_RET spec_mayor( CHAR_DATA *ch )
{
	static const char  open_path[]  = "W3a3003b33000c111d0d111Oe333333Oe22c222112212111a1S.";
	static const char  close_path[] = "W3a3003b33000c111d0d111CE333333CE22c222112212111a1S.";
	static const char *path;
	static int		   pos;
	static bool		   move;

	if ( !move )
	{
		if ( calendar.hour == 6 )
		{
			path = open_path;
			move = TRUE;
			pos  = 0;
		}

		if ( calendar.hour == 20 )
		{
			path = close_path;
			move = TRUE;
			pos  = 0;
		}
	}

	if ( ch->fighting )
		return spec_cast_cleric( ch );

	if ( !move || ch->position < POSITION_SLEEP )
		return FALSE;

	/* (TR) */
	switch ( path[pos] )
	{
	  case '0':
	  case '1':
	  case '2':
	  case '3':
		move_char( ch, get_exit(ch->in_room, path[pos] - '0'), 0, FALSE );
		break;

	  case 'W':
		ch->position = POSITION_STAND;
		act( AT_ACTION, "$n awakens and groans loudly.", ch, NULL, NULL, TO_ROOM );
		break;

	  case 'S':
		ch->position = POSITION_SLEEP;
		act( AT_ACTION, "$n lies down and falls asleep.", ch, NULL, NULL, TO_ROOM );
		break;

	  case 'a':
		act( AT_SAY, "$n says 'Hello Honey!'", ch, NULL, NULL, TO_ROOM );
		break;

	  case 'b':
		act( AT_SAY, "$n says 'What a view!  I must do something about that dump!'", ch, NULL, NULL, TO_ROOM );
		break;

	  case 'c':
		act( AT_SAY, "$n says 'Vandals!  Youngsters have no respect for anything!'", ch, NULL, NULL, TO_ROOM );
		break;

	  case 'd':
		act( AT_SAY, "$n says 'Good day, citizens!'", ch, NULL, NULL, TO_ROOM );
		break;

	  case 'e':
		act( AT_SAY, "$n says 'I hereby declare the town of Darkhaven open!'", ch, NULL, NULL, TO_ROOM );
		break;

	  case 'E':
		act( AT_SAY, "$n says 'I hereby declare the town of Darkhaven closed!'", ch, NULL, NULL, TO_ROOM );
		break;

	  case 'O':
	  	send_command( ch, "unlock gate", CO );
		send_command( ch, "open gate", CO );
		break;

	  case 'C':
	  	send_command( ch, "close gate", CO );
	  	send_command( ch, "lock gate", CO );
		break;

	  case '.' :
		move = FALSE;
		break;
	}

	pos++;
	return FALSE;
}
Beispiel #2
0
bool spec_mayor( CHAR_DATA *ch )
{
    static const char open_path[] =
	"W3a3003b33000c111d0d111Oe333333Oe22c222112212111a1S.";

    static const char close_path[] =
	"W3a3003b33000c111d0d111CE333333CE22c222112212111a1S.";

    static const char *path;
    static int pos;
    static bool move;

    if ( !move )
    {
	if ( time_info.hour ==  6 )
	{
	    path = open_path;
	    move = TRUE;
	    pos  = 0;
	}

	if ( time_info.hour == 20 )
	{
	    path = close_path;
	    move = TRUE;
	    pos  = 0;
	}
    }

    if ( ch->fighting != NULL )
	return spec_cast_cleric( ch );
    if ( !move || ch->position < POS_SLEEPING )
	return FALSE;

    switch ( path[pos] )
    {
    case '0':
    case '1':
    case '2':
    case '3':
	move_char( ch, path[pos] - '0' );
	break;

    case 'W':
	ch->position = POS_STANDING;
	act( "$n awakens and groans loudly.", ch, NULL, NULL, TO_ROOM );
	break;

    case 'S':
	ch->position = POS_SLEEPING;
	act( "$n lies down and falls asleep.", ch, NULL, NULL, TO_ROOM );
	break;

    case 'a':
	act( "$n says 'Hello Honey!'", ch, NULL, NULL, TO_ROOM );
	break;

    case 'b':
	act( "$n says 'What a view!  I must do something about that dump!'",
	    ch, NULL, NULL, TO_ROOM );
	break;

    case 'c':
	act( "$n says 'Vandals!  Youngsters have no respect for anything!'",
	    ch, NULL, NULL, TO_ROOM );
	break;

    case 'd':
	act( "$n says 'Good day, citizens!'", ch, NULL, NULL, TO_ROOM );
	break;

    case 'e':
	act( "$n says 'I hereby declare the city of Midgaard open!'",
	    ch, NULL, NULL, TO_ROOM );
	break;

    case 'E':
	act( "$n says 'I hereby declare the city of Midgaard closed!'",
	    ch, NULL, NULL, TO_ROOM );
	break;

    case 'O':
	do_unlock( ch, "gate" );
	do_open( ch, "gate" );
	break;

    case 'C':
	do_close( ch, "gate" );
	do_lock( ch, "gate" );
	break;

    case '.' :
	move = FALSE;
	break;
    }

    pos++;
    return FALSE;
}