mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-27 22:16:11 +00:00
fix(Scripts/Spells): some LW drums cannot affect targets lvl80 or higher (#24611)
This commit is contained in:
@@ -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');
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user