Hi Thomas
this is our bash, few minor adjustments from original:
ACMD(do_bash)
{
char arg[MAX_INPUT_LENGTH];
struct char_data *vict;
int percent, prob;
one_argument(argument, arg);
if (IS_NPC(ch) || !GET_SKILL(ch, SKILL_BASH)) {
send_to_char(ch, "You have no idea how.\r\n");
return;
}
/* if (AFF_FLAGGED(ch, AFF_FLYING)) {
send_to_char(ch, "You can't bash while flying.\r\n");
return;
} */
if (ROOM_FLAGGED(IN_ROOM(ch), ROOM_PEACEFUL)) {
send_to_char(ch, "This room just has such a peaceful, easy feeling...\r\n");
return;
}
if (!GET_EQ(ch, WEAR_WIELD)) {
send_to_char(ch, "You need to wield a weapon to make it a success.\r\n");
return;
}
if (GET_MOVE(ch) <= 0) {
send_to_char(ch, "You are to tired to fight anymore!\r\n");
return;
}
if (!IS_NPC(ch) && PRF_FLAGGED(ch, PRF_AFK)) {
send_to_char(ch, "Try removing your AFK flag first.\r\n");
SET_BIT_AR(PLR_FLAGS(ch), PLR_KILLER);
return;
}
if (!(vict = get_char_vis(ch, arg, NULL, FIND_CHAR_ROOM))) {
if (FIGHTING(ch) && IN_ROOM(ch) == IN_ROOM(FIGHTING(ch))) {
vict = FIGHTING(ch);
} else {
send_to_char(ch, "Bash who?\r\n");
return;
}
}
if (vict == ch) {
send_to_char(ch, "Aren't we funny today...\r\n");
return;
}
if (MOB_FLAGGED(vict, MOB_NOKILL)) {
send_to_char(ch, "This mob is protected.\r\n");
return;
}
if ((GET_CLASS(vict) == CLASS_NPC_GIANT) && (GET_RACE(ch) != RACE_HALF_GIANT)) {
send_to_char(ch, "You aren't tall enough to bash a giant!\r\n");
return;
}
log("%d", GET_RACE(vict));
if ((GET_RACE(vict) == RACE_HALF_GIANT) && (GET_RACE(ch) != RACE_HALF_GIANT)) {
log("%d", GET_RACE(vict));
send_to_char(ch, "You aren't tall enough to bash a half giant!\r\n");
return;
}
percent = rand_number(1, 115); /* 101% is a complete failure */
prob = GET_SKILL(ch, SKILL_BASH);
if (MOB_FLAGGED(vict, MOB_NOBASH))
percent = 115;
if (percent > prob) {
damage(ch, vict, 0, SKILL_BASH);
GET_POS(ch) = POS_SITTING;
} else {
/*
* If we bash a player and they wimp out, they will move to the previous
* room before we set them sitting. If we try to set the victim sitting
* first to make sure they don't flee, then we can't bash them! So now
* we only set them sitting if they didn't flee. -gg 9/21/98
*/
if (damage(ch, vict, 1, SKILL_BASH) > 0) { /* -1 = dead, 0 = miss */
improve_skill(ch, SKILL_BASH);
WAIT_STATE(vict, PULSE_VIOLENCE);
if (IN_ROOM(ch) == IN_ROOM(vict))
GET_POS(vict) = POS_SITTING;
}
}
WAIT_STATE(ch, PULSE_VIOLENCE * 2);
}