Aedit "features"...part 2

From: Matthias Elsdragon (MgicTG1@aol.com)
Date: 04/28/00


       if (save)  {
            const char *type = NULL;

            switch (subcmd)  {
            case SCMD_OLC_REDIT: type = "room"; break;
            case SCMD_OLC_ZEDIT: type = "zone"; break;
            case SCMD_OLC_SEDIT: type = "shop"; break;
            case SCMD_OLC_MEDIT: type = "mobile"; break;
            case SCMD_OLC_OEDIT: type = "object"; break;
                /* -mm 42600 */
            case SCMD_OASIS_AEDIT: type = "social"; break;
            }

            if (!type) {
                send_to_char("Oops, I forgot what you wanted to
save.\r\n", ch);
                return;
            }

            sprintf(buf, "Saving all %ss in zone %d.\r\n", type,
zone_table[OLC_ZNUM(d)].number);
            send_to_char(buf, ch);
            sprintf(buf, "OLC: %s saves %s info for zone %d.",
GET_NAME(ch), type, zone_table[OLC_ZNUM(d)].number);
            mudlog(buf, CMP, MAX(LVL_BUILDER, GET_INVIS_LEV(ch)), TRUE);

            switch (subcmd) {
            case SCMD_OLC_REDIT: redit_save_to_disk(OLC_ZNUM(d)); break;
            case SCMD_OLC_ZEDIT: zedit_save_to_disk(OLC_ZNUM(d)); break;
            case SCMD_OLC_OEDIT: oedit_save_to_disk(OLC_ZNUM(d)); break;
            case SCMD_OLC_MEDIT: medit_save_to_disk(OLC_ZNUM(d)); break;
            case SCMD_OLC_SEDIT: sedit_save_to_disk(OLC_ZNUM(d)); break;
                /* -mm 42500 */
            case SCMD_OASIS_AEDIT: aedit_save_to_disk(d); break;
            }

            free(d->olc);
            return;
        }

        if (subcmd != SCMD_OASIS_AEDIT)
            OLC_NUM(d) = number;

        else  {
            OLC_NUM(d) = 0;
            OLC_STORAGE(d) = str_dup(buf1);
            for (OLC_ZNUM(d) = 0; (OLC_ZNUM(d) <= top_of_socialt);
OLC_ZNUM(d)++)  {
                if (is_abbrev(OLC_STORAGE(d),
soc_mess_list[OLC_ZNUM(d)].command))
                    break;
            }
            if (OLC_ZNUM(d) > top_of_socialt) {
                if (find_command(OLC_STORAGE(d)) > NOTHING)  {
                    cleanup_olc(d, CLEANUP_ALL);
                    send_to_char("That command already exists.\r\n",
ch);
                    return;
                }
                sprintf(buf, "Do you wish to add the '%s' action? ",
OLC_STORAGE(d));
                send_to_char(buf, ch);
                OLC_MODE(d) = AEDIT_CONFIRM_ADD;
            }
            else  {
                sprintf(buf, "Do you wish to edit the '%s' action? ",
soc_mess_list[OLC_ZNUM(d)].command);
                send_to_char(buf, ch);
                OLC_MODE(d) = AEDIT_CONFIRM_EDIT;
            }
        }

        /*
        * Steal player's descriptor start up subcommands.
        */
        switch (subcmd) {
        case SCMD_OLC_TRIGEDIT:
            if ((real_num = real_trigger(number)) >= 0)
                trigedit_setup_existing(d, real_num);
            else
                trigedit_setup_new(d);
            STATE(d) = CON_TRIGEDIT;
            break;
        case SCMD_OLC_REDIT:
            if ((real_num = real_room(number)) >= 0)
                redit_setup_existing(d, real_num);
            else
                redit_setup_new(d);
            STATE(d) = CON_REDIT;
            break;
        case SCMD_OLC_ZEDIT:
            if ((real_num = real_room(number)) < 0) {
                send_to_char("That room does not exist.\r\n", ch);
                free(d->olc);
                return;
            }
            zedit_setup(d, real_num);
            STATE(d) = CON_ZEDIT;
            break;
        case SCMD_OLC_MEDIT:
            if ((real_num = real_mobile(number)) < 0)
                medit_setup_new(d);
            else
                medit_setup_existing(d, real_num);
            STATE(d) = CON_MEDIT;
            break;
        case SCMD_OLC_OEDIT:
            if ((real_num = real_object(number)) >= 0)
                oedit_setup_existing(d, real_num);
            else
                oedit_setup_new(d);
            STATE(d) = CON_OEDIT;
            break;
        case SCMD_OLC_SEDIT:
            if ((real_num = real_shop(number)) >= 0)
                sedit_setup_existing(d, real_num);
            else
                sedit_setup_new(d);
            STATE(d) = CON_SEDIT;
            break;
        case SCMD_OASIS_AEDIT:
            STATE(d) = CON_AEDIT;
            break;
        default:
            break;
        }
        act("$n starts using OLC.", TRUE, d->character, 0, 0, TO_ROOM);
        SET_BIT(PLR_FLAGS(ch), PLR_WRITING);
}
}


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT