aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Examples
diff options
context:
space:
mode:
authorQAston <qaston@gmail.com>2010-12-30 02:03:46 +0100
committerQAston <qaston@gmail.com>2010-12-30 02:03:46 +0100
commitc8adcc95f9046235e6ce6ceac98324b406cbebf9 (patch)
tree63eaf2e02409c055f9c53dd6d55c7edc6d9e2376 /src/server/scripts/Examples
parent51b46987c3d5bc14f67ea6370e759f6b0bfd61c3 (diff)
Core/Unit: Move spell specific code from Unit::CalcAbsorbResist to AuraScripts.
Diffstat (limited to 'src/server/scripts/Examples')
-rw-r--r--src/server/scripts/Examples/example_spell.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp
index 8d44cb92a4d..2a9d9a605c4 100644
--- a/src/server/scripts/Examples/example_spell.cpp
+++ b/src/server/scripts/Examples/example_spell.cpp
@@ -285,14 +285,6 @@ class spell_ex_absorb_aura : public SpellScriptLoader
SPELL_TRIGGERED = 18282
};
- bool Validate(SpellEntry const * /*spellEntry*/)
- {
- // check if spellid exists in dbc, we will trigger it later
- if (!sSpellStore.LookupEntry(SPELL_TRIGGERED))
- return false;
- return true;
- }
-
void HandleOnEffectAbsorb(AuraEffect * aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
sLog->outString("Our aura is now absorbing damage done to us!");
@@ -300,6 +292,11 @@ class spell_ex_absorb_aura : public SpellScriptLoader
absorbAmount = dmgInfo.GetDamage();
}
+ void HandleAfterEffectAbsorb(AuraEffect * aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
+ {
+ sLog->outString("Our aura has absorbed %u damage!", absorbAmount);
+ }
+
/*void HandleAfterAbsorb(DamageInfo & dmgInfo)
{
sLog->outString("Our auras have just absorbed damage done to us!");
@@ -309,6 +306,7 @@ class spell_ex_absorb_aura : public SpellScriptLoader
void Register()
{
OnEffectAbsorb += AuraEffectAbsorbFn(spell_ex_absorb_auraAuraScript::HandleOnEffectAbsorb, EFFECT_0);
+ AfterEffectAbsorb += AuraEffectAbsorbFn(spell_ex_absorb_auraAuraScript::HandleAfterEffectAbsorb, EFFECT_0);
//AfterAbsorb += AuraAbsorbFn(spell_ex_absorb_auraAuraScript::HandleAfterAbsorb);
}
};