Core/ScriptSystem: Add a PlayerScript::OnSpellCast(Player *player, Spell *spell, bool skipCheck) function.

Requested by Zor.

--HG--
branch : trunk
This commit is contained in:
silinoron
2010-09-03 19:58:16 -07:00
parent 128c60c84a
commit d2c259fe76
3 changed files with 14 additions and 0 deletions

View File

@@ -3133,6 +3133,11 @@ void Spell::cast(bool skipCheck)
}
}
// now that we've done the basic check, now run the scripts
// should be done before the spell is actually executed
if (Player *playerCaster = m_caster->ToPlayer())
sScriptMgr.OnPlayerSpellCast(playerCaster, this, skipCheck);
SetExecutedCurrently(true);
if (m_caster->GetTypeId() != TYPEID_PLAYER && m_targets.getUnitTarget() && m_targets.getUnitTarget() != m_caster)