fix(Scripts/Spells): Drain Soul generates Soul Shard only from targets that yields experience or honor on death. (#9417)
Fixes #9083
This commit is contained in:
@@ -1123,6 +1123,16 @@ class spell_warl_drain_soul : public AuraScript
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||||
|
{
|
||||||
|
Unit* caster = GetCaster();
|
||||||
|
Unit* target = GetTarget();
|
||||||
|
if (!(GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH && caster && target && caster->IsPlayer() && caster->ToPlayer()->isHonorOrXPTarget(target)))
|
||||||
|
{
|
||||||
|
PreventDefaultAction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool CheckProc(ProcEventInfo& eventInfo)
|
bool CheckProc(ProcEventInfo& eventInfo)
|
||||||
{
|
{
|
||||||
// Drain Soul's proc tries to happen each time the warlock lands a killing blow on a unit while channeling.
|
// Drain Soul's proc tries to happen each time the warlock lands a killing blow on a unit while channeling.
|
||||||
@@ -1178,6 +1188,7 @@ class spell_warl_drain_soul : public AuraScript
|
|||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
|
OnEffectRemove += AuraEffectRemoveFn(spell_warl_drain_soul::RemoveEffect, EFFECT_0, SPELL_AURA_CHANNEL_DEATH_ITEM, AURA_EFFECT_HANDLE_REAL);
|
||||||
DoCheckProc += AuraCheckProcFn(spell_warl_drain_soul::CheckProc);
|
DoCheckProc += AuraCheckProcFn(spell_warl_drain_soul::CheckProc);
|
||||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_drain_soul::HandleTick, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
|
OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_drain_soul::HandleTick, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
|
||||||
OnEffectProc += AuraEffectProcFn(spell_warl_drain_soul::HandleProc, EFFECT_2, SPELL_AURA_PROC_TRIGGER_SPELL);
|
OnEffectProc += AuraEffectProcFn(spell_warl_drain_soul::HandleProc, EFFECT_2, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||||
|
|||||||
Reference in New Issue
Block a user