fix(Scripts/Ulduar): filter Hodir Icicle force-cast targets (#26915)

Co-authored-by: offl <11556157+offl@users.noreply.github.com>
This commit is contained in:
Andrew 2026-08-02 15:35:03 -03:00 committed by GitHub
parent 32eb9c67d1
commit 02519baa49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 11 deletions

View file

@ -0,0 +1,5 @@
--
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_hodir_icicle_force_cast';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(62476, 'spell_hodir_icicle_force_cast'),
(62477, 'spell_hodir_icicle_force_cast');

View file

@ -53,7 +53,8 @@ enum HodirSpellData
SPELL_ICICLE_VISUAL_UNPACKED = 62234,
SPELL_ICICLE_VISUAL_PACKED = 62462,
SPELL_ICICLE_PACKED_TBBA = 62477,
SPELL_ICICLE_FORCE_CAST = 62476,
SPELL_ICICLE_FORCE_CAST_H = 62477,
SPELL_ICICLE_VISUAL_FALLING = 62453,
SPELL_ICICLE_FALL_EFFECT_UNPACKED = 62236,
SPELL_ICICLE_FALL_EFFECT_PACKED = 62460,
@ -411,16 +412,7 @@ struct boss_hodir : public BossAI
break;
case EVENT_FLASH_FREEZE:
{
std::list<Unit*> targets;
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
targets.push_back(itr->GetSource());
targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_FLASH_FREEZE_TRAPPED_PLAYER));
Acore::Containers::RandomResize(targets, (RAID_MODE(2,3)));
for (Unit* target : targets)
me->CastSpell(target, SPELL_ICICLE_PACKED_TBBA, true); // Forces victim to cast Icicle (62462)
DoCastSelf(RAID_MODE(SPELL_ICICLE_FORCE_CAST, SPELL_ICICLE_FORCE_CAST_H), true);
me->CastSpell((Unit*)nullptr, SPELL_FLASH_FREEZE_CAST, false);
me->PlayDirectSound(SOUND_HODIR_FLASH_FREEZE, 0);
Talk(TEXT_FLASH_FREEZE);
@ -1338,6 +1330,24 @@ class spell_hodir_periodic_icicle : public SpellScript
}
};
// 62476, 62477 - Icicle: force-casts the snowdrift icicle (62462) on the selected players
class spell_hodir_icicle_force_cast : public SpellScript
{
PrepareSpellScript(spell_hodir_icicle_force_cast);
void FilterTargets(std::list<WorldObject*>& targets)
{
targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_FLASH_FREEZE_TRAPPED_PLAYER));
Acore::Containers::RandomResize(targets, GetCaster()->GetMap()->Is25ManRaid() ? 3 : 2);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hodir_icicle_force_cast::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
class FlashFreezeCheck
{
public:
@ -1586,6 +1596,7 @@ void AddSC_boss_hodir()
RegisterSpellScript(spell_hodir_biting_cold_main_aura);
RegisterSpellScript(spell_hodir_biting_cold_player_aura);
RegisterSpellScript(spell_hodir_periodic_icicle);
RegisterSpellScript(spell_hodir_icicle_force_cast);
RegisterSpellAndAuraScriptPair(spell_hodir_flash_freeze, spell_hodir_flash_freeze_aura);
RegisterSpellScript(spell_hodir_storm_power_aura);
RegisterSpellScript(spell_hodir_storm_cloud_aura);