src/dg_triggers.c
int cmd_otrig(obj_data *obj, char_data *actor, char *cmd,
	      char *argument, int type)
{
  trig_data *t;
  char buf[MAX_INPUT_LENGTH];
  
  if (obj && SCRIPT_CHECK(obj, OTRIG_COMMAND))
    for (t = TRIGGERS(SCRIPT(obj)); t; t = t->next) {
      if (!TRIGGER_CHECK(t, OTRIG_COMMAND))
        continue;
 
      if (IS_SET(GET_TRIG_NARG(t), type) &&
          (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t))) {
        mudlog(NRM, LVL_BUILDER, TRUE, "SYSERR: O-Command Trigger #%d has no text argument!",
          GET_TRIG_VNUM(t));
        continue;
      }
       
      if (IS_SET(GET_TRIG_NARG(t), type) &&
          (*GET_TRIG_ARG(t)=='*' ||
          !strn_cmp(GET_TRIG_ARG(t), cmd, strlen(GET_TRIG_ARG(t))))) {
	
	ADD_UID_VAR(buf, t, actor, "actor", 0);
	skip_spaces(&argument);
	add_var(&GET_TRIG_VARS(t), "arg", argument, 0);
	skip_spaces(&cmd);
	add_var(&GET_TRIG_VARS(t), "cmd", cmd, 0);
	
	if (script_driver((void **)&obj, t, OBJ_TRIGGER, TRIG_NEW))
	  return 1;
      }
    }

  return 0;
}
/* checks for command trigger on specific object. assumes obj has cmd trig */
checks for command trigger on specific object. assumes obj has cmd trig
checks for command trigger on specific object . assumes obj has cmd trig
int cmd_otrig(obj_data *obj, char_data *actor, char *cmd,
	      char *argument, int type)
{
  trig_data *t;
  char buf[MAX_INPUT_LENGTH];
  if (obj && SCRIPT_CHECK(obj, OTRIG_COMMAND))
    for (t = TRIGGERS(SCRIPT(obj)); t; t = t->next) {
      if (!TRIGGER_CHECK(t, OTRIG_COMMAND))
        continue;
      if (IS_SET(GET_TRIG_NARG(t), type) &&
          (!GET_TRIG_ARG(t) || !*GET_TRIG_ARG(t))) {
        mudlog(NRM, LVL_BUILDER, TRUE, "SYSERR: O-Command Trigger #%d has no text argument!",
          GET_TRIG_VNUM(t));
        continue;
      }
      if (IS_SET(GET_TRIG_NARG(t), type) &&
          (*GET_TRIG_ARG(t)=='*' ||
          !strn_cmp(GET_TRIG_ARG(t), cmd, strlen(GET_TRIG_ARG(t))))) {
	ADD_UID_VAR(buf, t, actor, "actor", 0);
	skip_spaces(&argument);
	add_var(&GET_TRIG_VARS(t), "arg", argument, 0);
	skip_spaces(&cmd);
	add_var(&GET_TRIG_VARS(t), "cmd", cmd, 0);
	if (script_driver((void **)&obj, t, OBJ_TRIGGER, TRIG_NEW))
	  return 1;
      }
    }
  return 0;
}
int cmd_otrig ( obj_data * obj , char_data * actor , char * cmd , char * argument , int type ) { trig_data * t ; char buf [ MAX_INPUT_LENGTH ] ; if ( obj && SCRIPT_CHECK ( obj , OTRIG_COMMAND ) ) for ( t = TRIGGERS ( SCRIPT ( obj ) ) ; t ; t = t -> next ) { if ( ! TRIGGER_CHECK ( t , OTRIG_COMMAND ) ) continue ; if ( IS_SET ( GET_TRIG_NARG ( t ) , type ) && ( ! GET_TRIG_ARG ( t ) || ! * GET_TRIG_ARG ( t ) ) ) { mudlog ( NRM , LVL_BUILDER , TRUE , " " , GET_TRIG_VNUM ( t ) ) ; continue ; } if ( IS_SET ( GET_TRIG_NARG ( t ) , type ) && ( * GET_TRIG_ARG ( t ) == ' ' || ! strn_cmp ( GET_TRIG_ARG ( t ) , cmd , strlen ( GET_TRIG_ARG ( t ) ) ) ) ) { ADD_UID_VAR ( buf , t , actor , " " , 0 ) ; skip_spaces ( & argument ) ; add_var ( & GET_TRIG_VARS ( t ) , " " , argument , 0 ) ; skip_spaces ( & cmd ) ; add_var ( & GET_TRIG_VARS ( t ) , " " , cmd , 0 ) ; if ( script_driver ( ( void * * ) & obj , t , OBJ_TRIGGER , TRIG_NEW ) ) return 1 ; } } return 0 ; }
checks for command trigger on specific object.
checks for command trigger on specific object .