Item restriction

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
4 years 5 months ago - 4 years 5 months ago #5834 by JTP
Item restriction was created by JTP
Hi

I tried to add a check in do_wield so barbarians only can use bludgeon weapons. Compiles just fine, but crashed game when trying to wield a weapon. Ideas why ?
Insired by backstab only possible with a certain weapon type.

ACMD(do_wield)
{
  char arg[MAX_INPUT_LENGTH];
  struct obj_data *obj;

  one_argument(argument, arg);

  if (!*arg)
    send_to_char(ch, "Wield 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 (!CAN_WEAR(obj, ITEM_WEAR_WIELD))
      send_to_char(ch, "You can't wield that.\r\n");
    else if (GET_OBJ_WEIGHT(obj) > str_app[STRENGTH_APPLY_INDEX(ch)].wield_w)
      send_to_char(ch, "It's too heavy for you to use.\r\n");
    else if (GET_LEVEL(ch) < GET_OBJ_LEVEL(obj))
      send_to_char(ch, "You are not experienced enough to use that.\r\n");
    else if ((GET_CLASS(ch) == CLASS_BARBARIAN) && (GET_OBJ_VAL(GET_EQ(ch, WEAR_WIELD), 3) != TYPE_BLUDGEON - TYPE_HIT))
      send_to_char(ch, "Barbarians can only wield bludgeon weapons.\r\n");
    else
      perform_wear(ch, obj, WEAR_WIELD);
  }
}
Last edit: 4 years 5 months ago by JTP.

Please Log in or Create an account to join the conversation.

More
4 years 5 months ago #5836 by thomas
Replied by thomas on topic Item restriction
Please login to view the answers
The following user(s) said Thank You: JTP

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
4 years 5 months ago #5838 by JTP
Replied by JTP on topic Item restriction
Please login to view the answers

Please Log in or Create an account to join the conversation.

Time to create page: 0.076 seconds