Core/Spell: check aura positivity per effect on spell hit
- Fixes applying DR to positive effects, and changing duration of whole aura Closes #19447
This commit is contained in:
1 parent
ba2e4d90ec
commit
091100f795
3 files changed
+21
-13
No files matched your search
@@ -9476,11 +9476,11 @@ void Unit::IncrDiminishing(SpellInfo const* auraSpellInfo, bool triggered)
|
||||
++diminish.hitCount;
|
||||
}
|
||||
|
||||
float Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel)
|
||||
bool Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel) const
|
||||
{
|
||||
DiminishingGroup const group = auraSpellInfo->GetDiminishingReturnsGroupForSpell(triggered);
|
||||
if (duration == -1 || group == DIMINISHING_NONE)
|
||||
return 1.0f;
|
||||
return true;
|
||||
|
||||
int32 const limitDuration = auraSpellInfo->GetDiminishingReturnsLimitDuration(triggered);
|
||||
|
||||
@@ -9501,7 +9501,6 @@ float Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool trig
|
||||
}
|
||||
|
||||
float mod = 1.0f;
|
||||
|
||||
if (group == DIMINISHING_TAUNT)
|
||||
{
|
||||
if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TAUNT_DIMINISH))
|
||||
@@ -9536,7 +9535,7 @@ float Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool trig
|
||||
}
|
||||
|
||||
duration = int32(duration * mod);
|
||||
return mod;
|
||||
return (duration != 0);
|
||||
}
|
||||
|
||||
void Unit::ApplyDiminishingAura(DiminishingGroup group, bool apply)
|
||||
|
||||
Reference in new issue
Block a user