diff --git a/common/ruletypes.h b/common/ruletypes.h index 21c4949ea..5323fda49 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -398,6 +398,7 @@ RULE_INT(Combat, NPCBashKickStunChance, 15) //Percent chance that a bash/kick wi RULE_INT(Combat, MeleeCritDifficulty, 8900) // lower is easier RULE_INT(Combat, ArcheryCritDifficulty, 3400) // lower is easier RULE_INT(Combat, ThrowingCritDifficulty, 1100) // lower is easier +RULE_BOOL(Combat, NPCCanCrit, false) // true allows non PC pet NPCs to crit RULE_BOOL(Combat, UseIntervalAC, true) RULE_INT(Combat, PetAttackMagicLevel, 30) RULE_BOOL(Combat, EnableFearPathing, true) diff --git a/zone/attack.cpp b/zone/attack.cpp index c05be46cb..1ebf2a352 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -3953,6 +3953,9 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * } #endif // BOTS + if (IsNPC() && !RuleB(Combat, NPCCanCrit)) + return; + // 1: Try Slay Undead if (defender->GetBodyType() == BT_Undead || defender->GetBodyType() == BT_SummonedUndead || defender->GetBodyType() == BT_Vampire) { @@ -3983,14 +3986,12 @@ void Mob::TryCriticalHit(Mob *defender, DamageHitInfo &hit, ExtraAttackOptions * // We either require an innate crit chance or some SPA 169 to crit bool innate_crit = false; int crit_chance = GetCriticalChanceBonus(hit.skill); - if (IsClient()) { - if ((GetClass() == WARRIOR || GetClass() == BERSERKER) && GetLevel() >= 12) - innate_crit = true; - else if (GetClass() == RANGER && GetLevel() >= 12 && hit.skill == EQEmu::skills::SkillArchery) - innate_crit = true; - else if (GetClass() == ROGUE && GetLevel() >= 12 && hit.skill == EQEmu::skills::SkillThrowing) - innate_crit = true; - } + if ((GetClass() == WARRIOR || GetClass() == BERSERKER) && GetLevel() >= 12) + innate_crit = true; + else if (GetClass() == RANGER && GetLevel() >= 12 && hit.skill == EQEmu::skills::SkillArchery) + innate_crit = true; + else if (GetClass() == ROGUE && GetLevel() >= 12 && hit.skill == EQEmu::skills::SkillThrowing) + innate_crit = true; // we have a chance to crit! if (innate_crit || crit_chance) {