From 9614ea59ec6ad1f773a8d256ebca3bc17b8b2453 Mon Sep 17 00:00:00 2001 From: Fryguy Date: Sun, 2 Jun 2024 17:50:41 -0400 Subject: [PATCH] [Rule] Snare Override Movement Bonus (#4381) * [Rule] Snare Override Movement Bonus This rule allows snare to override any movement bonuses. RULE_BOOL(Spells, AllowSnareEffectsOverrideBonus, false, "Enabling will allow snares to override any speed bonuses the entity may have. Default: False") Default: False * Rule name --------- Co-authored-by: Kinglykrab --- common/ruletypes.h | 1 + zone/bonuses.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/common/ruletypes.h b/common/ruletypes.h index dd755f394..7102c59c1 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -506,6 +506,7 @@ RULE_INT(Spells, HarmTouchCritRatio, 200, "Harmtouch crit bonus, on top of BaseC RULE_BOOL(Spells, UseClassicSpellFocus, false, "Enabling will tell the server to handle random focus damage as classic spell imports lack the limit values.") RULE_BOOL(Spells, ManaTapsOnAnyClass, false, "Enabling this will allow you to cast mana taps on any class, this will bypass ManaTapsRequireNPCMana rule.") RULE_INT(Spells, HealAmountMessageFilterThreshold, 100, "Lifetaps below this threshold will not have a message sent to the client (Heal will still process) 0 to Disable.") +RULE_BOOL(Spells, SnareOverridesSpeedBonuses, false, "Enabling will allow snares to override any speed bonuses the entity may have. Default: False") RULE_CATEGORY_END() RULE_CATEGORY(Combat) diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 7dfe46071..6619d7bed 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -2438,6 +2438,10 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne case SE_CastingLevel2: { new_bonus->effective_casting_level += effect_value; + + if (RuleB(Spells, SnareOverridesSpeedBonuses) && effect_value < 0) { + new_bonus->movementspeed = effect_value; + } break; }