fix(Scripts/BlackTemple): Shahraz Fatal Attraction number of targets can be fewer than 3 (#21859)

This commit is contained in:
Jelle Meeus
2025-04-09 13:17:18 +02:00
committed by GitHub
parent 756c6c9001
commit b828f7a025

View File

@@ -102,7 +102,11 @@ struct boss_mother_shahraz : public BossAI
ScheduleTimedEvent(50s, [&] {
Talk(SAY_SPELL);
me->CastCustomSpell(SPELL_FATAL_ATTRACTION, SPELLVALUE_MAX_TARGETS, 3, me, false);
// weights for 1, 2, or 3 targets
static double chances[] = {5.0, 15.0, 80.0};
uint32 selectedIndex = urandweighted(3, chances);
uint32 numTargets = selectedIndex + 1;
me->CastCustomSpell(SPELL_FATAL_ATTRACTION, SPELLVALUE_MAX_TARGETS, numTargets, me, false);
}, 1min);
me->m_Events.AddEventAtOffset([&] {