Disarm Skill

From: Entreri (entreri@netcom.com)
Date: 10/16/95


Hello,
	I am having some troubles with a skill that i just coded, disarm.
It seems to enjoy slamming the weapon into a room that is "somewhere" and
doesn't have a vnum :)

here is the code, hopefully someone knows how to relocate the object.
[code begins]
ACMD(do_disarm)
{
  struct char_data *vict;
  int percent, prob;
 
  if ((GET_CLASS(ch) != CLASS_WARRIOR && (GET_CLASS(ch)) != CLASS_RANGER))
  {
    send_to_char("Disarming is better left to warrior types.\r\n", ch);
    return;
  }
  one_argument(argument, arg);
 
  if (!(vict = get_char_room_vis(ch, arg))) {
    if (FIGHTING(ch)) {
      vict = FIGHTING(ch);
    } else {
      send_to_char("Disarm who?\r\n", ch);
      return;
    }
  }
  if (vict == ch) {
    send_to_char("You decide not to disarm yourself.\r\n", ch);
    return;
  }
  percent = ((10 - (GET_AC(vict) / 10)) << 1) + number(1, 101);
/* 101% is a complete failure */
  prob = GET_SKILL(ch, SKILL_DISARM);
 
  if (percent > prob) {
    if (vict->equipment[WEAR_WIELD]) {
      unequip_char(vict, WEAR_WIELD);
      obj_to_room(0, vict->in_room);
      act("$n skillfully disarms $N!",
          TRUE, ch, 0, 0, TO_ROOM);
      act("You send $p flying from $N's grasp.", TRUE, ch, 0, vict,
          TO_CHAR);
      act("$p flies from your grasp as $n disarms you!", TRUE, ch, 0, vict,
TO_VICT);
  } else
      act("$n trys to disarm $N but fails!",
          TRUE, ch, 0, 0, TO_ROOM);
      act("You fail to disarm $N!", TRUE, ch, 0, vict,
          TO_CHAR);
      act("$n trys and fails to disarm you!", TRUE, ch, 0, vict, TO_VICT);
        damage(ch, vict, GET_LEVEL(ch) >> 1, SKILL_DISARM);
  WAIT_STATE(ch, PULSE_VIOLENCE * 3);
}
}

[code ends]



This archive was generated by hypermail 2b30 : 12/07/00 PST