- Posts: 227
- Thank you received: 52
Vatiken wrote:
Should be "craft_fail_msg_self ="right?Code:+ case 'L': + if (!strcmp(tag, "Froo")) craft->craft_fail_msg_room = strdup(line); + else if (!strcmp(tag, "Fslf")) craft->craft_msg_self = strdup(line); + break;
Other than that, everything looks good. Nice work.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Halenbane wrote: I'm attempting to add a chance for a critical craft (another vnum is assigned in case they succeed in a big way) so they can have a chance at an upgraded version. This upgraded version would be another vnum entirely. I have modified the code quite a bit but I am having trouble deciding how to write the next piece.
Code:skill = GET_SKILL(ch, CRAFT_SKILL(craft)) - (CRAFT_SKILL_LEVEL(craft) / 2); rand = rand_number(1, 100); crit = rand_number(90, 100); 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);
I need to tell it - If crit > rand and only if rand > skill in the first place, then show craft_crit_msg_room etc and load the crit item instead of the normal one.
The problem I'm having is the way I was thinking of writing it, it would still cause a problem if you didn't set a crit item for that craft. So I don't want the mud freaking out if it crit is > random, and there is no object set for crit. If it crits, but there is no crit obj defined, then it should just go on to the normal item as usual.
Please Log in or Create an account to join the conversation.
tbaMUD © 2024