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 committed 2010-09-03 19:58:16 -07:00
1 parent 128c60c84a
commit d2c259fe76
3 files changed
+14

No files matched your search

+5
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)