Add rule to allow non-PC pet NPCs to crit

NPCs can't crit at all ever on live
This commit is contained in:
Michael Cook (mackal) 2017-02-05 13:44:04 -05:00
parent a6a056ad0d
commit 592f9a9cb9
2 changed files with 10 additions and 8 deletions

View File

@ -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)

View File

@ -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) {