fix(Scripts/Northrend): Rework 'The Cleansing' quest (#23942)
Co-authored-by: offl <11556157+offl@users.noreply.github.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -247,28 +247,6 @@ class spell_q10525_vision_guide : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_q11322_q11317_the_cleansing : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_q11322_q11317_the_cleansing)
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* ar = GetCaster();
|
||||
if (ar && ar->ToPlayer())
|
||||
{
|
||||
if (ar->ToPlayer()->GetQuestStatus(11317) == QUEST_STATUS_INCOMPLETE || ar->ToPlayer()->GetQuestStatus(11322) == QUEST_STATUS_INCOMPLETE)
|
||||
ar->SummonCreature(27959, 3032.0f, -5095.0f, 723.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
|
||||
|
||||
ar->SetStandState(UNIT_STAND_STATE_SIT);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_q11322_q11317_the_cleansing::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_q10714_on_spirits_wings : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q10714_on_spirits_wings);
|
||||
@@ -2499,7 +2477,6 @@ void AddSC_quest_spell_scripts()
|
||||
RegisterSpellScript(spell_q12014_steady_as_a_rock);
|
||||
RegisterSpellAndAuraScriptPair(spell_q11026_a11051_banish_the_demons, spell_q11026_a11051_banish_the_demons_aura);
|
||||
RegisterSpellScript(spell_q10525_vision_guide);
|
||||
RegisterSpellScript(spell_q11322_q11317_the_cleansing);
|
||||
RegisterSpellScript(spell_q10714_on_spirits_wings);
|
||||
RegisterSpellScript(spell_q10720_the_smallest_creature);
|
||||
RegisterSpellScript(spell_q13086_last_line_of_defence);
|
||||
|
||||
Reference in New Issue
Block a user