From 99612ba7b37e28f6f6e59f41b41363502a0a0d6b Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Wed, 24 Apr 2024 17:20:58 -0400 Subject: [PATCH] [Bug Fix] All NPC classes could stun with kick/only warriors could be stunned (#4273) * [Bug Fix] All NPC classes could stun with kick/only warriors could be stunned. * Fix default NPCKickStun value to match existing code * Remove else and make NPC the default. * assign stun_level in declaration. --- common/ruletypes.h | 2 ++ zone/attack.cpp | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index d6ba73ca0..6b5626feb 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -511,6 +511,8 @@ RULE_CATEGORY(Combat) RULE_REAL(Combat, AERampageMaxDistance, 70, "Max AERampage range (% of max combat distance)") RULE_INT(Combat, PetBaseCritChance, 0, "Pet base crit chance") RULE_INT(Combat, NPCBashKickLevel, 6, "The level that NPCcan KICK/BASH") +RULE_INT(Combat, NPCKickStunLevel, 1, "The level that NPC has a chance to stun with kick.") +RULE_INT(Combat, PCKickStunLevel, 56, "The level that PC has a chance to stun with kick.") RULE_INT(Combat, MeleeCritDifficulty, 8900, "Value against which is rolled to check if a melee crit is triggered. Lower is easier") RULE_INT(Combat, ArcheryCritDifficulty, 3400, "Value against which is rolled to check if an archery crit is triggered. Lower is easier") RULE_INT(Combat, ThrowingCritDifficulty, 1100, "Value against which is rolled to check if a throwing crit is triggered. Lower is easier") diff --git a/zone/attack.cpp b/zone/attack.cpp index 4375d13fc..8cc7013c2 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -4302,8 +4302,12 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons } } else if (skill_used == EQ::skills::SkillKick && - (attacker->GetLevel() > 55 || attacker->IsNPC()) && GetClass() == Class::Warrior) { - can_stun = true; + attacker->GetClass() == Class::Warrior) { + int stun_level = RuleI(Combat, NPCKickStunLevel); + if (attacker->IsClient()) { + stun_level = RuleI(Combat, PCKickStunLevel); + } + can_stun = (attacker->GetLevel() >= stun_level); } bool is_immune_to_frontal_stun = false;