[Rule] Stun Chance Percent Rule (#3922)

Added a rule for server operators to tune the Stun Chance from players when mobs are behind.

DEFAULT: 12
This commit is contained in:
Fryguy
2024-01-08 03:40:01 -05:00
committed by GitHub
parent 5a7d544c5b
commit 700f4645e2
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -1419,7 +1419,7 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts, boo
if (other->CheckHitChance(this, hit)) {
if (IsNPC() && other->IsClient() && other->animation > 0 && GetLevel() >= 5 && BehindMob(other, GetX(), GetY())) {
// ~ 12% chance
if (zone->random.Roll(12)) {
if (zone->random.Roll(RuleI(Combat, StunChance))) {
int stun_resist2 = other->spellbonuses.FrontalStunResist + other->itembonuses.FrontalStunResist + other->aabonuses.FrontalStunResist;
int stun_resist = other->spellbonuses.StunResist + other->itembonuses.StunResist + other->aabonuses.StunResist;
if (zone->random.Roll(stun_resist2)) {