fix(Scripts/Ulduar): randomize Thorim lightning pillar (#26054)

This commit is contained in:
AlsoNotMehh
2026-06-10 19:06:35 -04:00
committed by GitHub
parent 2849807967
commit 28c0b203a4
2 changed files with 28 additions and 0 deletions

View File

@@ -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');

View File

@@ -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<Creature*> 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);