[CODE] A scribe skill

From: Cheryl Drago (creed@EXIT1.I-55.COM)
Date: 06/29/98


Hi.  I'm finishing up a new scribe skill on my mud, and I used a portion of
the act.create.c on the circle code site to actually make the new scroll.
Here's the code to make the new scroll.

        final_scroll = create_obj();

        final_scroll->item_number = NOTHING;
        final_scroll->in_room = NOWHERE;
        sprintf(buf2, "scroll %s", spells[spellnum]);
        final_scroll->name = str_dup(buf2);

        final_scroll->description = "A scroll is lying on the ground here.";

        sprintf(buf2, "a scroll of %s", spells[spellnum]);
        final_scroll->short_description = str_dup(buf2);

        /* extra description coolness! */
        CREATE(new_descr, struct extra_descr_data, 1);
        new_descr->keyword = str_dup(final_scroll->name);
        sprintf(buf2, "It appears to be a scroll of %s.", spells[spellnum]);
        new_descr->description = str_dup(buf2);
        new_descr->next = NULL;
        final_scroll->ex_description = new_descr;

        GET_OBJ_TYPE(final_scroll) = ITEM_SCROLL;
        GET_OBJ_WEAR(final_scroll) = ITEM_WEAR_TAKE;
        GET_OBJ_VAL(final_scroll, 0) = GET_LEVEL(ch);
        GET_OBJ_VAL(final_scroll, 1) = spellnum;
        GET_OBJ_VAL(final_scroll, 2) = -1;
        GET_OBJ_VAL(final_scroll, 3) = -1;
        GET_OBJ_COST(final_scroll) = GET_LEVEL(ch) * 500;
        GET_OBJ_WEIGHT(final_scroll) = 1;
        GET_OBJ_RENT(final_scroll) = 200;

Then I give the scroll to them and everything about the scroll looks right.
 When id'd, the scroll says it casts what the scriber wanted it to.
However, when the scroll is recited, the game crashes with no usefull gdb
info.

Also, I was wondering if, instead of giving scrolls a number of -1 and them
not saving, if I could just create a blank scroll, then when a player
scribes something, modify the level of the spell, the spell number, and the
name of the scroll, but leave it's vnum.  Would that change every other
scroll with the same vnum?


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



This archive was generated by hypermail 2b30 : 12/15/00 PST