diff options
author | QAston <qaston@gmail.com> | 2011-05-31 20:02:55 +0200 |
---|---|---|
committer | QAston <qaston@gmail.com> | 2011-05-31 20:24:44 +0200 |
commit | 7b5b95966e8a101c84ccef8b9d37740062eefa4c (patch) | |
tree | b7a44e189ffd8a9ef850649f14fee19ba8104a38 /src/server/game/Spells/SpellScript.cpp | |
parent | 4ccb21e51a16a7eeb19760562730f890825a0a62 (diff) |
Core/AuraScript: Add DoCheckAreaTarget hook to allow explicit area aura target selection.
Diffstat (limited to 'src/server/game/Spells/SpellScript.cpp')
-rwxr-xr-x | src/server/game/Spells/SpellScript.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 35c05c87a44..4645a2564a7 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -19,6 +19,7 @@ #include "Spell.h" #include "SpellAuras.h" #include "SpellScript.h" +#include "SpellMgr.h" bool _SpellScript::_Validate(SpellEntry const* entry) { @@ -468,6 +469,10 @@ void SpellScript::SetCustomCastResultMessage(SpellCustomErrors result) bool AuraScript::_Validate(SpellEntry const * entry) { + for (std::list<CheckAreaTargetHandler>::iterator itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr) + if (!HasAreaAuraEffect(entry)) + sLog->outError("TSCR: Spell `%u` of script `%s` does not have area aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName->c_str()); + for (std::list<EffectApplyHandler>::iterator itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr) if (!(*itr).GetAffectedEffectsMask(entry)) sLog->outError("TSCR: Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str()); @@ -523,6 +528,16 @@ bool AuraScript::_Validate(SpellEntry const * entry) return _SpellScript::_Validate(entry); } +AuraScript::CheckAreaTargetHandler::CheckAreaTargetHandler(AuraCheckAreaTargetFnType _pHandlerScript) +{ + pHandlerScript = _pHandlerScript; +} + +bool AuraScript::CheckAreaTargetHandler::Call(AuraScript* auraScript, Unit * _target) +{ + return (auraScript->*pHandlerScript)(_target); +} + AuraScript::EffectBase::EffectBase(uint8 _effIndex, uint16 _effName) : _SpellScript::EffectAuraNameCheck(_effName), _SpellScript::EffectHook(_effIndex) { |