Hmm, if im flying and trying to kill something i get: You're fighting the best you can!
Code:
ACMD(do_hit)
{
char arg[MAX_INPUT_LENGTH];
struct char_data *vict;
one_argument(argument, arg);
if (!*arg)
send_to_char(ch, "Hit who?\r\n");
else if (GET_MOVE(ch) <= 0)
send_to_char(ch, "You are to tired to fight right now!\r\n");
else 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);
}
else if (AFF_FLAGGED(ch, AFF_TREE))
send_to_char(ch, "You are not able to fight while in tree form!\r\n");
else if (!(vict = get_char_vis(ch, arg, NULL, FIND_CHAR_ROOM)))
send_to_char(ch, "They don't seem to be here.\r\n");
else if (vict == ch) {
send_to_char(ch, "You hit yourself...OUCH!.\r\n");
act("$n hits $mself, and says OUCH!", FALSE, ch, 0, vict, TO_ROOM);
} else if (AFF_FLAGGED(ch, AFF_CHARM) && (ch->master == vict))
act("$N is just such a good friend, you simply can't hit $M.", FALSE, ch, 0, vict, TO_CHAR);
else {
if (!CONFIG_PK_ALLOWED && !IS_NPC(vict) && !IS_NPC(ch))
check_killer(ch, vict);
if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) {
if (GET_DEX(ch) > GET_DEX(vict) || (GET_DEX(ch) == GET_DEX(vict) && rand_number(1, 2) == 1)) /* if faster */ {
hit(ch, vict, TYPE_UNDEFINED); /* first */
GET_MOVE(ch) -= 1;
}
else hit(vict, ch, TYPE_UNDEFINED); /* or the victim is first */
WAIT_STATE(ch, PULSE_VIOLENCE + 2);
} else if (GET_POS(ch) == POS_FIGHTING && vict != FIGHTING(ch) && FIGHTING(vict) == ch) {
if (GET_SKILL(ch, SKILL_SWITCH_TARGET) > rand_number(1, 110)) {
send_to_char(ch, "You swith your target!\r\n");
act("$n switches target to $N!", FALSE, ch, 0, vict, TO_ROOM);
FIGHTING(ch) = vict;
WAIT_STATE(ch, PULSE_VIOLENCE + 1);
} else {
send_to_char(ch, "You failed to switch your target!\r\n");
act("$n failed to switch target!", FALSE, ch, 0, vict, TO_ROOM);
improve_skill(ch, SKILL_SWITCH_TARGET);
}
} else
send_to_char(ch, "You're fighting the best you can!\r\n");
}
}