fix(Scripts/Spells): Shadowburn should give Sould Shard only if targe… (#12030)

...t yields experience/honor to the player.

Fixes #12021
This commit is contained in:
UltraNix
2022-06-15 00:42:55 +02:00
committed by GitHub
parent c40fa6509d
commit fed8d51044
2 changed files with 26 additions and 0 deletions

View File

@@ -1208,6 +1208,27 @@ class spell_warl_drain_soul : public AuraScript
}
};
// 29341 - Shadowburn
class spell_warl_shadowburn : public AuraScript
{
PrepareAuraScript(spell_warl_shadowburn);
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();
}
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_warl_shadowburn::RemoveEffect, EFFECT_0, SPELL_AURA_CHANNEL_DEATH_ITEM, AURA_EFFECT_HANDLE_REAL);
}
};
void AddSC_warlock_spell_scripts()
{
RegisterSpellScript(spell_warl_eye_of_kilrogg);
@@ -1238,4 +1259,5 @@ void AddSC_warlock_spell_scripts()
RegisterSpellScript(spell_warl_soulshatter);
RegisterSpellScript(spell_warl_unstable_affliction);
RegisterSpellScript(spell_warl_drain_soul);
RegisterSpellScript(spell_warl_shadowburn);
}