Core/Spells: Corrected aura SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK handling for auras with very high values
Port From (https://github.com/TrinityCore/TrinityCore/commit/9842ca3f4a843e97815512e84e9860737ab5db21)
This commit is contained in:
@@ -3777,6 +3777,34 @@ namespace Game.Spells
|
||||
|
||||
Unit target = aurApp.GetTarget();
|
||||
|
||||
// Do not apply such auras in normal way
|
||||
if (GetAmount() >= 1000)
|
||||
{
|
||||
if (apply)
|
||||
target.SetInstantCast(true);
|
||||
else
|
||||
{
|
||||
// only SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK can have this high amount
|
||||
// it's some rare case that you have 2 auras like that, but just in case ;)
|
||||
|
||||
bool remove = true;
|
||||
var castingSpeedNotStack = target.GetAuraEffectsByType(AuraType.ModCastingSpeedNotStack);
|
||||
foreach (AuraEffect aurEff in castingSpeedNotStack)
|
||||
{
|
||||
if (aurEff != this && aurEff.GetAmount() >= 1000)
|
||||
{
|
||||
remove = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (remove)
|
||||
target.SetInstantCast(false);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
target.ApplyCastTimePercentMod(GetAmount(), apply);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user