[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.
This commit is contained in:
Paul Coene 2024-04-24 17:20:58 -04:00 committed by GitHub
parent 1891c9b6de
commit 99612ba7b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

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

View File

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