aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <qaston@gmail.com>2012-02-09 18:35:52 +0100
committerQAston <qaston@gmail.com>2012-02-09 18:35:52 +0100
commitb4022acdf3ac2abb091c88996cbf9a3e78f5fee1 (patch)
treeed5b6dd43532320b0bfe5aca6b5b36c9198bc825 /src
parent0b1da6c0ad9c6d5211806a3a893cfe50c6d78af4 (diff)
Core/Spell: move conditions check to Spell::CheckCast.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index dc804d72103..b1aeb41a126 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2859,20 +2859,6 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
InitExplicitTargets(*targets);
- if (Player* plrCaster = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself())
- {
- //check for special spell conditions
- ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id);
- if (!conditions.empty())
- if (!sConditionMgr->IsPlayerMeetToConditions(plrCaster, conditions))
- {
- //SendCastResult(SPELL_FAILED_DONT_REPORT);
- SendCastResult(plrCaster, m_spellInfo, m_cast_count, SPELL_FAILED_DONT_REPORT);
- finish(false);
- return;
- }
- }
-
// Fill aura scaling information
if (m_caster->IsControlledByPlayer() && !m_spellInfo->IsPassive() && m_spellInfo->SpellLevel && !m_spellInfo->IsChanneled() && !(_triggeredCastFlags & TRIGGERED_IGNORE_AURA_SCALING))
{
@@ -4730,6 +4716,14 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_DONT_REPORT;
}
+ // check spell caster's conditions from database
+ if (Player* plrCaster = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself())
+ {
+ ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL, m_spellInfo->Id);
+ if (!conditions.empty() && !sConditionMgr->IsPlayerMeetToConditions(plrCaster, conditions))
+ return SPELL_FAILED_DONT_REPORT;
+ }
+
// Don't check explicit target for passive spells (workaround) (check should be skipped only for learn case)
// those spells may have incorrect target entries or not filled at all (for example 15332)
// such spells when learned are not targeting anyone using targeting system, they should apply directly to caster instead