diff options
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 237c1071c3f..f6e90b2c6ad 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4467,10 +4467,23 @@ void AuraEffect::HandleAuraModRangedHaste(AuraApplication const* aurApp, uint8 m if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT))) return; - //! ToDo: Haste auras with the same handler _CAN'T_ stack together Unit* target = aurApp->GetTarget(); + int32 spellGroupVal = target->GetHighestExclusiveSameEffectSpellGroupValue(this, GetAuraType()); + bool applyHasteRegenMod = GetAuraType() == SPELL_AURA_MOD_RANGED_HASTE; - target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply); + if (std::abs(spellGroupVal) >= std::abs(GetAmount())) + return; + + if (spellGroupVal) + { + target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(spellGroupVal), !apply); + if (applyHasteRegenMod) + target->ApplyHasteRegenMod(float(spellGroupVal), !apply); + } + target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(GetAmount()), apply); + + if (applyHasteRegenMod) + target->ApplyHasteRegenMod(float(GetAmount()), apply); } /********************************/ |
