ACMD(do_brain)
{
  struct char_data *vict;
  int percent, prob;

  one_argument(argument, buf);

  if (!(vict = get_char_room_vis(ch, buf))) {
    send_to_char("Brain who?\r\n", ch);
    return;
  }

 
  if (vict == ch) {
    send_to_char("That would be funny to see.\r\n", ch);
    return;
  }
  if (!GET_EQ(ch, WEAR_WIELD)) {
    send_to_char("You need to wield a weapon to make it a success.\r\n", ch);
    return;
  }
  if (GET_OBJ_VAL(GET_EQ(ch, WEAR_WIELD), 3) != TYPE_BLUDGEON - TYPE_HIT) {
    send_to_char("Only bludgeoning weapons can be used for braining.\r\n", ch);
    return;
  }
  if (FIGHTING(vict)) {
    send_to_char("You can't brain a fighting person -- they're too alert!\r\n", ch);
    return;
  }

  if (MOB_FLAGGED(vict, MOB_AWARE)) {
    act("You notice $N raising $s weapon at you!", FALSE, vict, 0, ch, TO_CHAR);
    act("$e notices you raising your weapon!", FALSE, vict, 0, ch, TO_VICT);
    act("$n notices $N raising $s weapon at $m!", FALSE, vict, 0, ch, TO_NOTVICT);
    hit(vict, ch, TYPE_UNDEFINED);
    return;
  }

  percent = number(1, 101);	/* 101% is a complete failure */
  prob = GET_SKILL(ch, SKILL_BRAIN);

  if (AWAKE(vict) && (percent < prob)) {
    act("You are knocked out when $N hits you upside your head.", FALSE, vict, 0, ch, TO_CHAR);
    act("$n sees stars and slumps over, knocked out.", FALSE, vict, 0, ch, TO_VICT);
    act("$n sees stars and slumps over, knocked out, after $N brains $m.", FALSE, vict, 0, ch, TO_NOTVICT);
    
    cast_spell(ch, vict, NULL, SPELL_SLEEP);

  }  else {
    act("You notice $N raising $s weapon at you!", FALSE, vict, 0, ch, TO_CHAR);
    act("$e notices you raising your weapon!", FALSE, vict, 0, ch, TO_VICT);
    act("$n notices $N raising $s weapon at $m!", FALSE, vict, 0, ch, TO_NOTVICT);
    hit(ch, vict, SKILL_BRAIN);
  }
}