* Fix mind flay target requirements.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-03-11 22:27:07 +01:00
parent 5808c12f5e
commit 6683ae58c9
2 changed files with 8 additions and 5 deletions
+6 -3
View File
@@ -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;
}
+2 -2
View File
@@ -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);