fix(Scripts/Spells): some LW drums cannot affect targets lvl80 or higher (#24611)

This commit is contained in:
sogladev
2026-02-07 00:58:05 +01:00
committed by GitHub
parent 29be3483b6
commit 896f762cce
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
--
-- 35475 Drums of War
-- 35476 Drums of Battle
-- 35478 Drums of Restoration
-- 'Cannot affect targets level 80 or higher.'
DELETE FROM `spell_script_names` WHERE `spell_id` IN (35475, 35476, 35478);
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(35475, 'spell_gen_filter_party_level_80'),
(35476, 'spell_gen_filter_party_level_80'),
(35478, 'spell_gen_filter_party_level_80');

View File

@@ -5696,6 +5696,28 @@ class spell_gen_whisper_to_controller : public SpellScript
}
};
// 35475 Drums of War
// 35476 Drums of Battle
// 35478 Drums of Restoration
class spell_gen_filter_party_level_80 : public SpellScript
{
PrepareSpellScript(spell_gen_filter_party_level_80);
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if([&](WorldObject* target) -> bool
{
Unit* unit = target->ToUnit();
return unit && unit->GetLevel() >= 80;
});
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gen_filter_party_level_80::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_PARTY);
}
};
void AddSC_generic_spell_scripts()
{
RegisterSpellScript(spell_silithyst);
@@ -5871,4 +5893,5 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_bm_on);
RegisterSpellScript(spell_gen_bm_off);
RegisterSpellScript(spell_gen_whisper_to_controller);
RegisterSpellScript(spell_gen_filter_party_level_80);
}