Code:
skill = GET_SKILL(ch, CRAFT_SKILL(craft)) - (CRAFT_SKILL_LEVEL(craft) / 2);
rand = rand_number(1, 100);
crit = rand_number(1, 10);
if (rand < crit) {
if (real_object(CRAFT_CRIT_OBJVNUM(craft)) != NOTHING && rand < crit) {
if ((obj = read_object(CRAFT_CRIT_OBJVNUM(craft), VIRTUAL)) == NULL) {
send_to_char(ch, "You seem to have an issue with your crafting.\r\n");
mudlog(CMP, LVL_GOD, TRUE, "SYSERR: Event Craft called without critical created object.");
return (0);
}
remove_components(ch, craft, TRUE);
obj_to_char(obj, ch);
act(CRAFT_CRIT_MSG_SELF(craft), TRUE, ch, obj, 0, TO_CHAR);
act(CRAFT_CRIT_MSG_ROOM(craft), TRUE, ch, obj, 0, TO_NOTVICT);
}
} else {
if (skill > rand) {
if ((obj = read_object(CRAFT_OBJVNUM(craft), VIRTUAL)) == NULL) {
send_to_char(ch, "You seem to have an issue with your crafting.\r\n");
mudlog(CMP, LVL_GOD, TRUE, "SYSERR: Event Craft called without created object.");
return (0);
}
remove_components(ch, craft, TRUE);
obj_to_char(obj, ch);
if (!CRAFT_MSG_SELF(craft))
send_to_char(ch, "You have created %s.\r\n", obj->short_description);
else
act(CRAFT_MSG_SELF(craft), TRUE, ch, obj, 0, TO_CHAR);
if (CRAFT_MSG_ROOM(craft))
act(CRAFT_MSG_ROOM(craft), TRUE, ch, obj, 0, TO_NOTVICT);
} else if (skill > (rand / 2)) {
act("You struggle in your attempt to craft, but you continue on.", TRUE, ch, 0, 0, TO_CHAR);
act("$n struggles in $s attempt to craft.", TRUE, ch, 0, 0, TO_NOTVICT);
return (CRAFT_TIMER(craft) * PASSES_PER_SEC);
} else {
remove_components(ch, craft, FALSE);
act(CRAFT_FAIL_MSG_SELF(craft), TRUE, ch, 0, 0, TO_CHAR);
act(CRAFT_FAIL_MSG_ROOM(craft), TRUE, ch, 0, 0, TO_NOTVICT);
}
}
return (0);
}
That may be part of the reason I'm seeing another issue, or not.