mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 09:17:36 +01:00
Core/Auras: added support for SPELL_AURA_MOD_RANGED_HASTE stacking rules
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/********************************/
|
||||
|
||||
Reference in New Issue
Block a user