aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellMgr.cpp9
-rw-r--r--src/game/SpellMgr.h4
2 files changed, 8 insertions, 5 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index fb482f9daab..ccc6cc85f5a 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -513,7 +513,7 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB)
return true;
}
-bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
+bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep)
{
SpellEntry const *spellproto = sSpellStore.LookupEntry(spellId);
if (!spellproto) return false;
@@ -702,11 +702,14 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex)
if(spellproto->AttributesEx & SPELL_ATTR_EX_NEGATIVE)
return false;
+ if (!deep && spellproto->EffectTriggerSpell[effIndex] && !IsPositiveSpell(spellproto->EffectTriggerSpell[effIndex], true))
+ return false;
+
// ok, positive
return true;
}
-bool IsPositiveSpell(uint32 spellId)
+bool IsPositiveSpell(uint32 spellId, bool deep)
{
SpellEntry const *spellproto = sSpellStore.LookupEntry(spellId);
if (!spellproto) return false;
@@ -714,7 +717,7 @@ bool IsPositiveSpell(uint32 spellId)
// spells with at least one negative effect are considered negative
// some self-applied spells have negative effects but in self casting case negative check ignored.
for (int i = 0; i < 3; i++)
- if (!IsPositiveEffect(spellId, i))
+ if (!IsPositiveEffect(spellId, i, deep))
return false;
return true;
}
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index e512af4b850..ddbbf92de1d 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -408,8 +408,8 @@ inline bool IsNonCombatSpell(SpellEntry const *spellInfo)
return (spellInfo->Attributes & SPELL_ATTR_CANT_USED_IN_COMBAT) != 0;
}
-bool IsPositiveSpell(uint32 spellId);
-bool IsPositiveEffect(uint32 spellId, uint32 effIndex);
+bool IsPositiveSpell(uint32 spellId, bool deep = false);
+bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep = false);
bool IsPositiveTarget(uint32 targetA, uint32 targetB);
bool IsSingleTargetSpell(SpellEntry const *spellInfo);