diff --git a/data/sql/updates/pending_db_world/rev_1780334902720000000.sql b/data/sql/updates/pending_db_world/rev_1780334902720000000.sql new file mode 100644 index 000000000..b48256486 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1780334902720000000.sql @@ -0,0 +1,3 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` = 62976 AND `ScriptName` = 'spell_thorim_lightning_pillar_P2'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (62976, 'spell_thorim_lightning_pillar_P2'); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index a73aafa68..157873af3 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -1592,6 +1592,7 @@ public: } }; +// 63238 Lightning Pillar class spell_thorim_lightning_pillar_P2_aura : public AuraScript { PrepareAuraScript(spell_thorim_lightning_pillar_P2_aura); @@ -1609,6 +1610,29 @@ class spell_thorim_lightning_pillar_P2_aura : public AuraScript } }; +// 62976 Lightning Pillar +class spell_thorim_lightning_pillar_P2 : public SpellScript +{ + PrepareSpellScript(spell_thorim_lightning_pillar_P2); + + void SelectPillar(WorldObject*& target) + { + if (Unit* caster = GetCaster()) + { + std::list pillars; + caster->GetCreatureListWithEntryInGrid(pillars, NPC_PILLAR, GetSpellInfo()->GetMaxRange()); + + if (!pillars.empty()) + target = Acore::Containers::SelectRandomContainerElement(pillars); + } + } + + void Register() override + { + OnObjectTargetSelect += SpellObjectTargetSelectFn(spell_thorim_lightning_pillar_P2::SelectPillar, EFFECT_0, TARGET_UNIT_NEARBY_ENTRY); + } +}; + class spell_thorim_trash_impale_aura : public AuraScript { PrepareAuraScript(spell_thorim_trash_impale_aura); @@ -1679,6 +1703,7 @@ void AddSC_boss_thorim() new go_thorim_lever(); // Spells + RegisterSpellScript(spell_thorim_lightning_pillar_P2); RegisterSpellScript(spell_thorim_lightning_pillar_P2_aura); RegisterSpellScript(spell_thorim_trash_impale_aura);