mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 22:07:52 +00:00
fix(Scripts/Ulduar): randomize Thorim lightning pillar (#26054)
This commit is contained in:
@@ -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');
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user