fix(Scripts/ZulAman): Halazzi Phases (#20650)

This commit is contained in:
Jelle Meeus
2024-11-20 13:08:21 +01:00
committed by GitHub
parent 8cde31018d
commit 047a21d31a
3 changed files with 142 additions and 58 deletions

View File

@@ -5298,6 +5298,28 @@ class spell_gen_steal_weapon : public AuraScript
}
};
// 43536 - Serverside - SetHealth (75%)
// 43537 - Serverside - SetHealth (50%)
// 43538 - Serverside - SetHealth (25%)
class spell_gen_set_health : public SpellScript
{
PrepareSpellScript(spell_gen_set_health);
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
{
uint32 value = GetSpellInfo()->Effects[EFFECT_0].CalcValue();
target->SetHealth(target->CountPctFromMaxHealth(value));
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gen_set_health::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_generic_spell_scripts()
{
RegisterSpellScript(spell_silithyst);
@@ -5455,4 +5477,5 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_consumption);
RegisterSpellScript(spell_gen_sober_up);
RegisterSpellScript(spell_gen_steal_weapon);
RegisterSpellScript(spell_gen_set_health);
}