I have added a SKILL_DISARM and it works fine, up until my mud freezes
during combat, not crashes, but freezes and dumps out the core with some
missing tic error after about 5 minutes...
Here is what I am using for disarm:
ACMD(do_disarm)
{
struct char_data *vict;
int prob, percent;
argument = one_argument(argument, arg);
if (!*arg){
send_to_char("Disarm who?\r\n", ch);
return;
}
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 (!GET_EQ(vict, WEAR_WIELD)){
send_to_char("They must wield a weapon for you to disarm them...\r\n",
ch);
return;
}
percent = number(1, 101); /* 101% is a complete failure */
prob = GET_SKILL(ch, SKILL_DISARM);
if (percent > prob) {
act("You fail to disarm $N...", FALSE, ch, 0, vict, TO_CHAR);
act("$N just tried to disarm you! But failed.", FALSE, ch, 0, vict,
TO_VICT);
act("$n tries to disarm $N, but fails...", FALSE, ch, 0, vict,
TO_NOTVICT);
damage(ch, vict, 0, SKILL_DISARM);
WAIT_STATE(ch, PULSE_VIOLENCE);
return;
} else {
act("You sucessfully disarm $N!", FALSE, ch, 0, vict, TO_CHAR);
act("$n knocks your weapon out of your hands!!", FALSE, ch, 0, vict,
TO_VICT);
act("$n skillfully disarms $N with a flick of the wrist!", FALSE,
ch, 0, vict, TO_NOTVICT);
damage(ch, vict, 0, SKILL_DISARM);
obj_to_room(GET_EQ(vict, WEAR_WIELD), ch->in_room);
WAIT_STATE(ch, 2*PULSE_VIOLENCE);
improve_skill(ch, SKILL_DISARM, 1);
return;
}
}
If anyone can show me where the faults are in my code, or if anyone
would like to share/compare their disarm skill code please contact me.
Thanks!
Shaw
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST