diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index 0a07ffe9d6..663fb07464 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -377,6 +377,7 @@ void SpellLog::SendToSet() Spell::Spell(WorldObject* caster, SpellEntry const* info, uint32 triggeredFlags, ObjectGuid originalCasterGUID, SpellEntry const* triggeredBy) : m_partialApplicationMask(0), m_spellScript(SpellScriptMgr::GetSpellScript(info->Id)), m_auraScript(SpellScriptMgr::GetAuraScript(info->Id)), + m_effectSkipMask(0), m_spellLog(this), m_param1(0), m_param2(0), m_trueCaster(caster) { MANGOS_ASSERT(caster != nullptr && info != nullptr); @@ -5297,7 +5298,7 @@ SpellCastResult Spell::CheckCast(bool strict) uint32 availableEffectMask = 0; for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i) - if (m_spellInfo->Effect[i]) + if (m_spellInfo->Effect[i] && (m_effectSkipMask & (1 << i)) == 0) availableEffectMask |= (1 << i); auto partialApplication = [&](uint32 i) -> SpellCastResult @@ -5311,8 +5312,13 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_CAST_OK; }; + m_partialApplicationMask |= m_effectSkipMask; + for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i) { + if ((m_effectSkipMask & (1 << i)) != 0) + continue; + // for effects of spells that have only one target switch (m_spellInfo->Effect[i]) { diff --git a/src/game/Spells/Spell.h b/src/game/Spells/Spell.h index 43895f9334..21869691f3 100644 --- a/src/game/Spells/Spell.h +++ b/src/game/Spells/Spell.h @@ -776,6 +776,8 @@ class Spell uint32 GetDamage() { return damage; } void SetDamage(uint32 newDamage) { damage = newDamage; } SpellSchoolMask GetSchoolMask() { return m_spellSchoolMask; } + // OnInit use only + void SetEffectSkipMask(uint32 mask) { m_effectSkipMask = mask; } // OnHit use only uint32 GetTotalTargetDamage() { return m_damage; } uint32 GetTotalTargetAbsorb() { return m_absorb; } @@ -800,6 +802,9 @@ class Spell WorldObject* GetTrueCaster() const { return m_trueCaster; } Unit* GetAffectiveCasterOrOwner() const; + // custom Spell Cast Results + void SetParam1(uint32 param1) { m_param1 = param1; } + void SetParam2(uint32 param2) { m_param2 = param2; } // overrides void SetOverridenSpeed(float newSpeed); void SetIgnoreRoot(bool state) { m_ignoreRoot = state; } @@ -942,6 +947,7 @@ class Spell SpellScript* m_spellScript; AuraScript* m_auraScript; // needed for some checks for value calculation int32 m_effectTriggerChance[MAX_EFFECT_INDEX]; // used by effects to roll if they should go off + uint32 m_effectSkipMask; uint32 m_spellState; uint32 m_timer;