fix(Scripts/Northrend): Rework 'The Cleansing' quest (#23942)

Co-authored-by: offl <11556157+offl@users.noreply.github.com>
This commit is contained in:
sogladev 2025-11-30 20:51:18 +01:00 committed by GitHub
parent d6e03b45db
commit e58683b78b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 246 additions and 127 deletions

View file

@ -5673,6 +5673,29 @@ class spell_gen_bm_on : public SpellScript
}
};
class spell_gen_whisper_to_controller : public SpellScript
{
PrepareSpellScript(spell_gen_whisper_to_controller);
bool Validate(SpellInfo const* spellInfo) override
{
return sObjectMgr->GetBroadcastText(uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()));
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
if (TempSummon* casterSummon = caster->ToTempSummon())
if (Player* target = casterSummon->GetSummonerUnit()->ToPlayer())
casterSummon->Unit::Whisper(uint32(GetEffectValue()), target, false);
}
void Register() override
{
OnEffectHit += SpellEffectFn(spell_gen_whisper_to_controller::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_generic_spell_scripts()
{
RegisterSpellScript(spell_silithyst);
@ -5846,4 +5869,5 @@ void AddSC_generic_spell_scripts()
RegisterSpellScript(spell_gen_invis_on);
RegisterSpellScript(spell_gen_bm_on);
RegisterSpellScript(spell_gen_bm_off);
RegisterSpellScript(spell_gen_whisper_to_controller);
}