aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-06-08 22:18:28 +0200
committerShauren <shauren.trinity@gmail.com>2025-06-08 22:18:28 +0200
commitea692f5a248e5e67e3b983767044901cc743309b (patch)
tree361966c77384757b383825f6b080e51a32747424 /src/server/game/Spells/SpellEffects.cpp
parent35214519ce12064223fb6c39fbdc2519db4569d3 (diff)
Core/Spells: Allow removing weapon damage effects by preventing target selection in scripts
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 06462af0ff9..eb983373d24 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2794,8 +2794,12 @@ void Spell::EffectWeaponDmg()
// multiple weapon dmg effect workaround
// execute only the last weapon damage
// and handle all effects at once
+ uint32 effectMask = std::ranges::find(m_UniqueTargetInfo, unitTarget->GetGUID(), &TargetInfo::TargetGUID)->EffectMask;
for (size_t j = effectInfo->EffectIndex + 1; j < m_spellInfo->GetEffects().size(); ++j)
{
+ if (!(effectMask & (1 << j)))
+ continue;
+
switch (m_spellInfo->GetEffect(SpellEffIndex(j)).Effect)
{
case SPELL_EFFECT_WEAPON_DAMAGE:
@@ -2829,6 +2833,9 @@ void Spell::EffectWeaponDmg()
float weaponDamagePercentMod = 1.0f;
for (SpellEffectInfo const& spellEffectInfo : m_spellInfo->GetEffects())
{
+ if (!(effectMask & (1 << spellEffectInfo.EffectIndex)))
+ continue;
+
switch (spellEffectInfo.Effect)
{
case SPELL_EFFECT_WEAPON_DAMAGE:
@@ -2874,6 +2881,9 @@ void Spell::EffectWeaponDmg()
// Sequence is important
for (SpellEffectInfo const& spellEffectInfo : m_spellInfo->GetEffects())
{
+ if (!(effectMask & (1 << spellEffectInfo.EffectIndex)))
+ continue;
+
// We assume that a spell have at most one fixed_bonus
// and at most one weaponDamagePercentMod
switch (spellEffectInfo.Effect)