Beispiel #1
0
int board(struct char_data *ch, int cmd, char *arg)
{
	static int has_loaded = 0;

	if (!ch->desc)
		return(FALSE); /* By MS or all NPC's will be trapped at the board */

	/* note: I'll let display and remove return 0 if the arg was non-board- */
	/* related. Thus, it'll be possible to read other things than the board */
	/* while you're in the room. Conceiveably, you could do this for write, */
	/* too, but I'm not in the mood for such hacking.                       */

	if (!has_loaded)
	{
		board_load_board();
		has_loaded = 1;
	}

	switch (cmd) {
		case 15:  /* look */
			return(board_show_board(ch, arg));
		case 149: /* write */
			board_write_msg(ch, arg);
		return 1;
		case 63: /* read */
			return(board_display_msg(ch, arg));
		case 66: /* remove */
			return(board_remove_msg(ch, arg));
		default:
			return 0;
	}
}
Beispiel #2
0
int board(struct char_data *ch, const char * cmd, char *arg,
          struct obj_data *obj, int type) {
    static int has_loaded = 0;
    int bnum = -1;
    int obj_num;

    if (type != PULSE_COMMAND)
        return (FALSE);

    if (!ch->desc)
        return (0);                 /* By MS or all NPC's will be trapped at the board */

    if (!has_loaded) {
        board_load_board();
        has_loaded = 1;
    }

    if (!cmd)
        return (FALSE);

    /* Identify which board we're dealing with */

    obj_num = (obj->item_number);
    if (obj_num == (real_object(3099)))
        bnum = 0;
    else if (obj_num == (real_object(3098)))
        bnum = 1;
    else if (obj_num == (real_object(3097)))
        bnum = 2;

    if (STREQ(cmd, "look")) {
        return (board_show_board(ch, arg, bnum));
    }
    else if (STREQ(cmd, "write")) {
        board_write_msg(ch, arg, bnum);
        return 1;
    }
    else if (STREQ(cmd, "read")) {
        return (board_display_msg(ch, arg, bnum));
    }
    else if (STREQ(cmd, "remove")) {
        return (board_remove_msg(ch, arg, bnum));
    }
    else {
        return 0;
    }
}
Beispiel #3
0
int board(struct char_data *ch, int cmd, char *arg, struct obj_data *obj, int type)
{
  static int has_loaded = 0;
  char buf[80];
  int bnum = -1;
  int obj_num;

  if (type != PULSE_COMMAND)
    return(FALSE);

  if (!ch->desc)
    return(0); /* By MS or all NPC's will be trapped at the board */
  
  if (!has_loaded)
    {
      board_load_board();
      has_loaded = 1;
    }

  if (!cmd)
    return(FALSE);

  /* Identify which board we're dealing with */
  
  obj_num = (obj->item_number);
  if (obj_num == (real_object(3099)))  bnum = 0;
  else if (obj_num == (real_object(3098)))  bnum = 1;
  else if (obj_num == (real_object(3097))) bnum = 2;

  switch (cmd) {
  case 15:  /* look */
    return(board_show_board(ch, arg, bnum));
  case 149: /* write */
    board_write_msg(ch, arg, bnum);
    return 1;
  case 63: /* read */
    return(board_display_msg(ch, arg, bnum));
  case 66: /* remove */
    return(board_remove_msg(ch, arg, bnum));
  default:
    return 0;
  }
}