diff --git a/sql/updates/world/4.3.4/2022_06_02_00_world.sql b/sql/updates/world/4.3.4/2022_06_02_00_world.sql new file mode 100644 index 00000000000..0c98c160f3a --- /dev/null +++ b/sql/updates/world/4.3.4/2022_06_02_00_world.sql @@ -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'); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 09c3a0673b9..d73e0ae4496 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -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& 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); }