ADDING IN TOGGLEABLE WEAR SLOTS -------------------------------- Edward Felch The concept of this is to be able to turn people's wear slots on and off, this would allow for specific race wear slots without any trickiness (dragon races might have a wing slot), or to allow players to add in new slots (aka having one's ears pierced), or as a form of perverse Imm punishment (You pissed me off, so now you can't wield anything). This is a newbie-ish level snippet, we're only adding in some checks, and some things into the player structure. Yes, I know I have no skill at all putting together a snippet, I think I used to though. Compiled and tested on: circle30bpl21-OasisOLC-2.0.1 WARNING: If you are not using ASCII pfiles this will require a pwipe or conversion, if you are using ASCII pfiles, no one will be able to wear equipment unless you either toggle all the player's slots back on, or write a quick function for it. However new players will be normal :) This might not be 100% perfect as I've taken it from a far different MUD than the one I tested on, somewhere in the code a player might be able to slip on an item they shouldn't be able to, but it's easy to find out where and to add in the check to do so. IMPORTANT: A line the starts with a + represents either a change in the original code or an addition. POSSIBLE IDEA Add in an ear slot and create a spec proc for a player to pay some gold to get his/ her ears pierces which turns that wearbit on. CONTACT INFORMATION: dustlos@hotmail.com - Not always reliable efelch@hotmail.com - Only used for MSN messenger AIM: edwardfelch or ed181818 ICQ: 170542486 I'd prefer some form of messaging contact since I'm trying to switch ISPs and the hotmail accounts exist soley to see how much spam can accumulate. Yes, I use Trillian. Feel free to bug me, I've been out of the CircleMUD community forever and don't have any real intentions of running a MUD again but I'm quite happy to help out people, to fix anything wrong in the snippet, etc. BEGIN ======= act.item.c Change find_eq_pos to be like this: ----------------------------------- int find_eq_pos(struct char_data *ch, struct obj_data *obj, char *arg) { int where = -1; const char *keywords[] = { "!RESERVED!", "finger", "!RESERVED!", "neck", "!RESERVED!", "body", "head", "legs", "feet", "hands", "arms", "shield", "about", "waist", "wrist", "!RESERVED!", "!RESERVED!", "!RESERVED!", "\n" }; if (!arg || !*arg) { if (CAN_WEAR(obj, ITEM_WEAR_FINGER)) where = WEAR_FINGER_R; if (CAN_WEAR(obj, ITEM_WEAR_NECK)) where = WEAR_NECK_1; if (CAN_WEAR(obj, ITEM_WEAR_BODY)) where = WEAR_BODY; if (CAN_WEAR(obj, ITEM_WEAR_HEAD)) where = WEAR_HEAD; if (CAN_WEAR(obj, ITEM_WEAR_LEGS)) where = WEAR_LEGS; if (CAN_WEAR(obj, ITEM_WEAR_FEET)) where = WEAR_FEET; if (CAN_WEAR(obj, ITEM_WEAR_HANDS)) where = WEAR_HANDS; if (CAN_WEAR(obj, ITEM_WEAR_ARMS)) where = WEAR_ARMS; if (CAN_WEAR(obj, ITEM_WEAR_SHIELD)) where = WEAR_SHIELD; if (CAN_WEAR(obj, ITEM_WEAR_ABOUT)) where = WEAR_ABOUT; if (CAN_WEAR(obj, ITEM_WEAR_WAIST)) where = WEAR_WAIST; if (CAN_WEAR(obj, ITEM_WEAR_WRIST)) where = WEAR_WRIST_R; } else if ((where = search_block(arg, keywords, FALSE)) < 0) send_to_char(ch, "'%s'? What part of your body is THAT?\r\n", arg); + /* We also need to see if they have this slot "open" */ + if (!IS_SET(WEARBIT_FLAGS(ch), (1<carrying))) send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg), arg); else { if (!CAN_WEAR(obj, ITEM_WEAR_WIELD)) send_to_char(ch, "You can't wield that.\r\n"); + else if (!IS_SET(WEARBIT_FLAGS(ch), (1< str_app[STRENGTH_APPLY_INDEX(ch)].wield_w) send_to_char(ch, "It's too heavy for you to use.\r\n"); else perform_wear(ch, obj, WEAR_WIELD); } } Change ACMD(do_grab) to be like this: -------------------------------------- ACMD(do_grab) { char arg[MAX_INPUT_LENGTH]; struct obj_data *obj; one_argument(argument, arg); if (!*arg) send_to_char(ch, "Hold what?\r\n"); else if (!(obj = get_obj_in_list_vis(ch, arg, NULL, ch->carrying))) send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg), arg); else { + if (GET_OBJ_TYPE(obj) == ITEM_LIGHT) + { + if (!IS_SET(WEARBIT_FLAGS(ch), (1< wearbit victim numberofslot\r\n"); return; } if (!(vict = get_char_vis(ch, arg1, NULL, FIND_CHAR_WORLD))) { send_to_char(ch, "They don't seem to be on.\r\n"); return; } if (IS_NPC(vict)) { send_to_char(ch, "You don't want to do this to a mobile.\r\n"); return; } if (!*arg2) { sprintf(buf, "%s's wearbits:\r\n", GET_NAME(vict)); for (i = 0; i < NUM_WEARS; i++) { if (IS_SET(WEARBIT_FLAGS(vict), (1< NUM_WEARS-1) { send_to_char(ch, "You are specifying an equipment slot that is out of range.\r\n"); return; } sprintf(buf, "You are altering the person's %s.\r\n", equipment_types[slot]); send_to_char(ch, buf); TOGGLE_BIT(WEARBIT_FLAGS(vict), (1<player.wear_bits)