Core/Spells: Blaze of Life triggered by Eye of Blazing Power will now only target the most injured raid or party member instead of all

This commit is contained in:
Ovahlord
2022-06-02 21:46:45 +02:00
parent ce79689c96
commit c7e287ccb4
2 changed files with 23 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_item_blaze_of_light';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(96966, 'spell_item_blaze_of_light'),
(97136, 'spell_item_blaze_of_light');

View File

@@ -5085,6 +5085,24 @@ class spell_item_herbouflage : public AuraScript
}
};
// 96966, 97136 - Blaze of Life
class spell_item_blaze_of_light : public SpellScript
{
void FilterTargets(std::list<WorldObject*>& targets)
{
if (targets.size() < 2)
return;
targets.sort(Trinity::HealthPctOrderPred());
targets.resize(1);
}
void Register() override
{
OnObjectAreaTargetSelect.Register(&spell_item_blaze_of_light::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ALLY);
}
};
void AddSC_item_spell_scripts()
{
// 23074 Arcanite Dragonling
@@ -5220,4 +5238,5 @@ void AddSC_item_spell_scripts()
RegisterSpellScript(spell_item_world_queller_focus);
RegisterSpellScript(spell_item_jom_gabbar);
RegisterSpellScript(spell_item_satisfied);
RegisterSpellScript(spell_item_blaze_of_light);
}