aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp34
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp9
2 files changed, 37 insertions, 6 deletions
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index b817036a9e4..4c8a9db1571 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -397,8 +397,8 @@ class spell_dru_lifebloom : public SpellScriptLoader
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
- // Final heal only on duration end and dispel
- if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
+ // Final heal only on duration end
+ if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
return;
// final heal
@@ -409,16 +409,46 @@ class spell_dru_lifebloom : public SpellScriptLoader
healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack);
healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack);
+ GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
+
// restore mana
int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
+ return;
}
+
GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
}
+ void HandleDispel(DispelInfo* dispelInfo)
+ {
+ if (Unit* target = GetUnitOwner())
+ {
+ if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
+ {
+ // final heal
+ int32 healAmount = aurEff->GetAmount();
+ if (Unit* caster = GetCaster())
+ {
+ healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
+ healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
+ target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
+
+ // restore mana
+ int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2;
+ caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
+ return;
+ }
+
+ target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
+ }
+ }
+ }
+
void Register()
{
AfterEffectRemove += AuraEffectRemoveFn(spell_dru_lifebloom_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterDispel += AuraDispelFn(spell_dru_lifebloom_AuraScript::HandleDispel);
}
};
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 5f6bbe758f4..75953283113 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -535,15 +535,16 @@ class spell_warl_haunt : public SpellScriptLoader
{
PrepareSpellScript(spell_warl_haunt_SpellScript);
- void HandleEffectHit(SpellEffIndex /*effIndex*/)
+ void HandleEffectHit()
{
- if (AuraEffect* aurEff = GetExplTargetUnit()->GetAuraEffectOfRankedSpell(WARLOCK_HAUNT,EFFECT_1))
- aurEff->SetAmount(CalculatePctN(aurEff->GetAmount(), GetHitDamage()));
+ if (Aura* aura = GetHitAura())
+ if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1))
+ aurEff->SetAmount(CalculatePctN(aurEff->GetAmount(), GetHitDamage()));
}
void Register()
{
- OnEffectHitTarget += SpellEffectFn(spell_warl_haunt_SpellScript::HandleEffectHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
+ OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit);
}
};