Core/Spells: implement helper to filter mechanic immunities in packets to reflect sniff behavior and removed pct heal effects from heal prediction

Despite being able to send all mechanic immunities in spell_start and channel_start, sniffs confirm that only relevant immunities are being sent which in most cases are silence and interrupt immunities. Further sniff analysis may reveal even more possible interrupt flags
This commit is contained in:
Ovahlord committed 2021-02-26 11:30:44 +01:00
1 parent 2439a741ff
commit ffc05d0bf1
3 files changed
+27 -8

No files matched your search

+19
View File
@@ -3253,6 +3253,25 @@ uint32 SpellInfo::GetAllowedMechanicMask() const
return _allowedMechanicMask;
}
uint32 SpellInfo::GetMechanicImmunityMask(Unit* caster, bool channeled) const
{
uint32 casterMechanicImmunityMask = caster->GetMechanicImmunityMask();
uint32 mechanicImmunityMask = 0;
uint32 flags = channeled ? ChannelInterruptFlags : InterruptFlags;
// @todo: research other interrupt flags
if (flags & SPELL_INTERRUPT_FLAG_INTERRUPT)
{
if (casterMechanicImmunityMask & (1 << MECHANIC_SILENCE))
mechanicImmunityMask |= (1 << MECHANIC_SILENCE);
if (casterMechanicImmunityMask & (1 << MECHANIC_INTERRUPT))
mechanicImmunityMask |= (1 << MECHANIC_INTERRUPT);
}
return mechanicImmunityMask;
}
float SpellInfo::GetMinRange(bool positive) const
{
if (!RangeEntry)