This is code for a command which will allow you to delete zones without editing any index files. Handy if you've got builders working on OLC. The usual disclaimer applies, I'm not responsible for anything that happens to your MUD, due to this code. I would advise backing up your whole MUD before doing this. ---first open interpreter.c --in the prototypes sections add: ACMD(do_zdelete); --in the master command list add { "zdelete" , POS_DEAD , do_zdelete , LVL_IMPL, 0 }, ---in interpreter.h --at the end of the file add: /* do_zdelete */ #define SCMD_ZDELETE 0 ---open act.wizard.c at the end of /* extern functions */ --add: int zdelete_check(int zone); --after ACMD(do_set); --add: ACMD(do_zdelete); --at the end of the file add: ACMD(do_zdelete) { FILE *index2; zone_vnum i; zone_vnum j; int real = 0; if (subcmd != SCMD_ZDELETE) { send_to_char("If you want to delete a zone, say so!\r\n", ch); return; } one_argument(argument, buf); if (!*buf) { send_to_char("Well you need to give the zone number to delete!", ch); return; } j = atoi(buf); for (i = 0; i <= top_of_zone_table; i++) if (zone_table[i].number == j) { real = TRUE; break; } if (!real) { send_to_char("No such zone.\r\n", ch); return; } sprintf(buf2, "%s%s", WLD_PREFIX, INDEX_FILE); if (!(index2 = fopen(buf2, "w"))) { log("SYSERR: Error opening an index file in zdelete"); send_to_char("Error. Please Delete zone manually then reboot.\r\n", ch); return; } for (i = 0; i <= top_of_zone_table; i++) { if (zone_table[i].number != j) fprintf(index2, "%d.wld\n", zone_table[i].number); } fprintf(index2, "$\n"); fclose(index2); sprintf(buf2, "%s%s", MOB_PREFIX, INDEX_FILE); if (!(index2 = fopen(buf2, "w"))) { log("SYSERR: Error opening an index file in zdelete"); send_to_char("Error. Please Delete zone manually then reboot.\r\n", ch); return; } for (i = 0; i <= top_of_zone_table; i++) { if (zone_table[i].number != j) fprintf(index2, "%d.mob\n", zone_table[i].number); } fprintf(index2, "$\n"); fclose(index2); sprintf(buf2, "%s%s", OBJ_PREFIX, INDEX_FILE); if (!(index2 = fopen(buf2, "w"))) { log("SYSERR: Error opening an index file in zdelete"); send_to_char("Error. Please Delete zone manually then reboot.\r\n", ch); return; } for (i = 0; i <= top_of_zone_table; i++) { if (zone_table[i].number != j) fprintf(index2, "%d.obj\n", zone_table[i].number); } fprintf(index2, "$\n"); fclose(index2); sprintf(buf2, "%s%s", ZON_PREFIX, INDEX_FILE); if (!(index2 = fopen(buf2, "w"))) { log("SYSERR: Error opening an index file in zdelete"); send_to_char("Error. Please Delete zone manually then reboot.\r\n", ch); return; } for (i = 0; i <= top_of_zone_table; i++) { if (zone_table[i].number != j) fprintf(index2, "%d.zon\n", zone_table[i].number); } fprintf(index2, "$\n"); fclose(index2); sprintf(buf2, "%s%s", SHP_PREFIX, INDEX_FILE); if (!(index2 = fopen(buf2, "w"))) { log("SYSERR: Error opening an index file in zdelete"); send_to_char("Error. Please Delete zone manually then reboot.\r\n", ch); return; } for (i = 0; i <= top_of_zone_table; i++) { if ((zone_table[i].number != j) && zdelete_check(zone_table[i].number)) fprintf(index2, "%d.shp\n", zone_table[i].number); } fprintf(index2, "$\n"); fclose(index2); /* here is what i made */ sprintf(buf2, "%s%s", TRG_PREFIX, INDEX_FILE); if (!(index2 = fopen(buf2, "w"))) { log("SYSERR: Error opening an index file in zdelete"); send_to_char("Error. Please Delete zone manually then reboot.\r\n", ch); return; } for (i = 0; i <= top_of_zone_table; i++) { if ((zone_table[i].number != j) && zdelete_check(zone_table[i].number)) fprintf(index2, "%d.trg\n", zone_table[i].number); } fprintf(index2, "$\n"); fclose(index2); log("(GC) Zone Delete #%d successful now rebooting.", j); send_to_char("Zone Delete Successful.\r\n", ch); send_to_all("Rebooting.. come back in a minute or two.\r\n"); touch(FASTBOOT_FILE); circle_shutdown = circle_reboot = 1; } ---now open shop.c --just before void list_all_shops(struct char_data * ch); --add int zdelete_check(int zone); --just before --void list_all_shops(struct char_data * ch) { --add int zdelete_check(int zone) { int shop_nr; for (shop_nr = 0; shop_nr < top_shop; shop_nr++) { if ((SHOP_NUM(shop_nr) / 100) == zone) return(1); } return(0); } That should be it, I didn't write this code, m_gally@hotmail.com (Subliminal) wrote it, all I did was add trigger delete support to this. If you use this code please e-mail m_gally@hotmail.com. Bejhan Jetha AKA Chaos of Chrono Apocolypse MUD, Builders are always welcome (chrono.sytes.net:4000)