aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Spells/Spell.cpp4
-rw-r--r--src/server/game/Spells/SpellInfo.cpp18
-rw-r--r--src/server/game/Spells/SpellInfo.h2
3 files changed, 22 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 1ff4cffe812..cd78f49cd84 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4176,8 +4176,8 @@ void Spell::SendSpellStart()
uint32 mechanicImmunityMask = 0;
if (Unit* unitCaster = m_caster->ToUnit())
{
- schoolImmunityMask = unitCaster->GetSchoolImmunityMask();
- mechanicImmunityMask = unitCaster->GetMechanicImmunityMask();
+ schoolImmunityMask = m_timer!= 0 ? unitCaster->GetSchoolImmunityMask() : 0;
+ mechanicImmunityMask = m_timer != 0 ? m_spellInfo->GetMechanicImmunityMask(unitCaster) : 0;
}
if (schoolImmunityMask || mechanicImmunityMask)
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index f0d42133088..492ced10a64 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -3038,6 +3038,24 @@ uint32 SpellInfo::GetAllowedMechanicMask() const
return _allowedMechanicMask;
}
+uint32 SpellInfo::GetMechanicImmunityMask(Unit* caster) const
+{
+ uint32 casterMechanicImmunityMask = caster->GetMechanicImmunityMask();
+ uint32 mechanicImmunityMask = 0;
+
+ // @todo: research other interrupt flags
+ if (InterruptFlags & 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 /*= false*/) const
{
if (!RangeEntry)
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index 6f2e8588009..f1a501b0286 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -533,6 +533,8 @@ class TC_GAME_API SpellInfo
uint32 GetAllowedMechanicMask() const;
+ uint32 GetMechanicImmunityMask(Unit* caster) const;
+
private:
// loading helpers
void _InitializeExplicitTargetMask();