Code:
static void zedit_disp_menu(struct descriptor_data *d)
{
int subcmd = 0, room, counter = 0;
char buf1[MAX_STRING_LENGTH], lev_string[50];
bool levels_set = FALSE;
get_char_colors(d->character);
clear_screen(d);
room = real_room(OLC_NUM(d));
sprintbitarray(OLC_ZONE(d)->zone_flags, zone_bits, ZN_ARRAY_MAX, buf1);
levels_set = zedit_get_levels(d, lev_string);
/* Menu header */
send_to_char(d->character,
"Room number: %s%d%s Room zone: %s%d\r\n"
"%s1%s) Builders : %s%s\r\n"
"%sZ%s) Zone name : %s%s\r\n"
"%sL%s) Lifespan : %s%d minutes\r\n"
"%sB%s) Bottom of zone : %s%d\r\n"
"%sT%s) Top of zone : %s%d\r\n"
"%sR%s) Reset Mode : %s%s\r\n"
"%sF%s) Zone Flags : %s%s\r\n"
"%sM%s) Level Range : %s%s%s\r\n"
"[Command list]\r\n",
cyn, OLC_NUM(d), nrm,
cyn, zone_table[OLC_ZNUM(d)].number,
grn, nrm, yel, OLC_ZONE(d)->builders ? OLC_ZONE(d)->builders : "None.",
grn, nrm, yel, OLC_ZONE(d)->name ? OLC_ZONE(d)->name : "<NONE!>",
grn, nrm, yel, OLC_ZONE(d)->lifespan,
grn, nrm, yel, OLC_ZONE(d)->bot,
grn, nrm, yel, OLC_ZONE(d)->top,
grn, nrm, yel,
OLC_ZONE(d)->reset_mode ? ((OLC_ZONE(d)->reset_mode == 1) ? "Reset when no players are in zone." : "Normal reset.") : "Never reset",
grn, nrm, cyn, buf1,
grn, nrm, levels_set ? cyn : yel, lev_string,
nrm
);
/* Print the commands for this room into display buffer. */
while (MYCMD.command != 'S') {
/* Translate what the command means. */
write_to_output(d, "%s%d - %s", nrm, counter++, yel);
switch (MYCMD.command) {
case 'M':
write_to_output(d, "%sLoad %s [%s%d%s], Max : %d, Chance : %d%%",
MYCMD.if_flag ? " then " : "",
mob_proto[MYCMD.arg1].player.short_descr, cyn,
mob_index[MYCMD.arg1].vnum, yel, MYCMD.arg2, MYCMD.arg4
);
break;
case 'G':
write_to_output(d, "%sGive it %s [%s%d%s], Max : %d, Chance : %d%%",
MYCMD.if_flag ? " then " : "",
obj_proto[MYCMD.arg1].short_description,
cyn, obj_index[MYCMD.arg1].vnum, yel,
MYCMD.arg2, MYCMD.arg4
);
break;
case 'O':
write_to_output(d, "%sLoad %s [%s%d%s], Max : %d, Chance : %d%%",
MYCMD.if_flag ? " then " : "",
obj_proto[MYCMD.arg1].short_description,
cyn, obj_index[MYCMD.arg1].vnum, yel,
MYCMD.arg2, MYCMD.arg4
);
break;
case 'E':
write_to_output(d, "%sEquip with %s [%s%d%s], %s, Max : %d, Chance : %d%%",
MYCMD.if_flag ? " then " : "",
obj_proto[MYCMD.arg1].short_description,
cyn, obj_index[MYCMD.arg1].vnum, yel,
equipment_types[MYCMD.arg3],
MYCMD.arg2, MYCMD.arg4
);
break;
case 'P':
write_to_output(d, "%sPut %s [%s%d%s] in %s [%s%d%s], Max : %d, Chance : %d%%",
MYCMD.if_flag ? " then " : "",
obj_proto[MYCMD.arg1].short_description,
cyn, obj_index[MYCMD.arg1].vnum, yel,
obj_proto[MYCMD.arg3].short_description,
cyn, obj_index[MYCMD.arg3].vnum, yel,
MYCMD.arg2, MYCMD.arg4
);
break;
case 'R':
write_to_output(d, "%sRemove %s [%s%d%s] from room.",
MYCMD.if_flag ? " then " : "",
obj_proto[MYCMD.arg2].short_description,
cyn, obj_index[MYCMD.arg2].vnum, yel
);
break;
case 'D':
write_to_output(d, "%sSet door %s as %s.",
MYCMD.if_flag ? " then " : "",
dirs[MYCMD.arg2],
MYCMD.arg3 ? ((MYCMD.arg3 == 1) ? "closed" : "locked") : "open"
);
case 'T':
write_to_output(d, "%sAttach trigger %s%s%s [%s%d%s] to %s, Chance : %d%%",
MYCMD.if_flag ? " then " : "",
cyn, trig_index[MYCMD.arg2]->proto->name, yel,
cyn, trig_index[MYCMD.arg2]->vnum, yel,
((MYCMD.arg1 == MOB_TRIGGER) ? "mobile" :
((MYCMD.arg1 == OBJ_TRIGGER) ? "object" :
((MYCMD.arg1 == WLD_TRIGGER)? "room" : "????"))), MYCMD.arg4);
break;
case 'V':
write_to_output(d, "%sAssign global %s:%d to %s = %s, Chance : %d%%",
MYCMD.if_flag ? " then " : "",
MYCMD.sarg1, MYCMD.arg2,
((MYCMD.arg1 == MOB_TRIGGER) ? "mobile" :
((MYCMD.arg1 == OBJ_TRIGGER) ? "object" :
((MYCMD.arg1 == WLD_TRIGGER)? "room" : "????"))),
MYCMD.sarg2, MYCMD.arg4);
break;
default:
write_to_output(d, "<Unknown Command>");
break;
}
write_to_output(d, "\r\n");
subcmd++;
}
/* Finish off menu */
write_to_output(d,
"%s%d - <END OF LIST>\r\n"
"%sN%s) Insert new command.\r\n"
"%sE%s) Edit a command.\r\n"
"%sD%s) Delete a command.\r\n"
"%sQ%s) Quit\r\nEnter your choice : ",
nrm, counter, grn, nrm, grn, nrm, grn, nrm, grn, nrm
);
OLC_MODE(d) = ZEDIT_MAIN_MENU;
}
I was checking the logs and its not actually causing any errors its just displaying 'unknown command'. I am wondering if it's not just a display error. The command that would be in question would be 'g' since its giving the NPC a object.