Well as I was checking the core file to see why we crashed I ran in to
something pretty funny if you ask me.... I would like to meet who ever on
this muds history was a coder on it cause well.... the function speaks for
it self:
void do_scribe ( CHAR_DATA *ch, char *argument )
{
char arg[MAX_INPUT_LENGTH], arg2[MSL];
char buf[MAX_INPUT_LENGTH];
OBJ_DATA *obj;
int sn;
int risk;
if ( ( get_skill(ch,gsn_scribe) == 0 ) )
{
send_to_char("You don't know how to write scrolls.\n\r",ch);
return;
}
if (IS_SET(ch->in_room->room_flags,ROOM_NO_MAGIC))
{
send_to_char("You cannot scribe scrolls in this room!\n\r",ch);
return;
}
argument = one_argument( argument, arg );
argument = one_argument( argument, arg2);
if ( arg[0] == '\0' )
{
send_to_char( "Scribe what spell?\n\r", ch );
return;
}
/* Do we have a parchment to scribe spells? */
if ( ( sn = skill_lookup(arg) ) < 0)
{
send_to_char( "You don't know any spells by that name.\n\r", ch );
return;
}
if (skill_table[sn].spell_fun == spell_null)
{
send_to_char("You can't scribe that.\n\r", ch);
return;
}
if (skill_table[sn].target == TAR_CHAR_SELF)
obj = create_object( get_obj_index(OBJ_VNUM_PARCHMENT), 0);
act( "$n begins writing a scroll.", ch, obj, NULL, TO_ROOM );
WAIT_STATE( ch, 2 * PULSE_VIOLENCE );
/* Check the skill percentage, fcn(int,wis,skill) */
if ( !IS_NPC(ch)
&& ( number_percent() > ch->pcdata->learned[gsn_scribe] ||
number_percent() > ((get_curr_stat(ch,STAT_INT) + ch->level) /
2 +
(get_curr_stat(ch,STAT_WIS) +ch->level) /
3)))
{
act( "$p bursts in flames!", ch, obj, NULL, TO_CHAR );
act( "$p bursts in flames!", ch, obj, NULL, TO_ROOM );
check_improve(ch,gsn_scribe,FALSE,2);
sn = skill_lookup("fireball") == LEVEL_HERO -1;
extract_obj( obj );
return;
}
/* basically, making scrolls more potent than potions; also, scrolls
are not limited in the choice of spells, i.e. scroll of enchant
weapon
has no analogs in potion forms --- JH */
risk = UMIN(ch->level, atoi(arg2));
risk = number_fuzzy(risk);
obj->level = risk;
obj->value[0] = risk;
spell_imprint(sn, obj->level, ch, obj, 0);
act("$n has created $p!",ch,obj,NULL,TO_ROOM);
act("You have created $p!",ch,obj,NULL,TO_CHAR);
check_improve(ch,gsn_scribe,TRUE,2);
check_improve(ch, sn, TRUE, 1);
free_string(obj->name);
sprintf(buf, "%s %s", item_name(obj->item_type), skill_table[sn].name);
obj->name = str_dup( buf );
obj_to_char(obj, ch);
return;
}
Tell me if you see anything kind of funny.... Probly could guess why I
crashed too.