diff options
| author | offl <11556157+offl@users.noreply.github.com> | 2022-03-05 02:26:29 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2022-03-26 15:48:03 +0100 |
| commit | b105dc4c8fcbcd381d8c0ad24636d1e948743504 (patch) | |
| tree | a552dbc5a58bc6a410f865faa652f0e994098bad /src/server/scripts/Northrend | |
| parent | 6a5a39dda09aaec5e48043edb06fcfd1fbf9c7a6 (diff) | |
Scripts/Quest: Update 'Burning to Help' & 'A Cleansing Song' (#27849)
(cherry picked from commit 3d6cc67caf26ddf81ea967064f508f8c8569c278)
Diffstat (limited to 'src/server/scripts/Northrend')
| -rw-r--r-- | src/server/scripts/Northrend/zone_sholazar_basin.cpp | 122 |
1 files changed, 122 insertions, 0 deletions
diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 6b27c99cac1..2c0d842ec9c 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -662,6 +662,125 @@ class spell_q12611_deathbolt : public SpellScript } }; +/*###### +## Quest 12683: Burning to Help +######*/ + +enum BurningToHelp +{ + SPELL_HYDRA_SPUTUM = 52307 +}; + +// 52308 - Take Sputum Sample +class spell_sholazar_take_sputum_sample : public SpellScript +{ + PrepareSpellScript(spell_sholazar_take_sputum_sample); + + bool Validate(SpellInfo const* spellInfo) override + { + return spellInfo->GetEffects().size() > EFFECT_1 && ValidateSpellInfo( + { + uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()), + uint32(spellInfo->GetEffect(EFFECT_1).CalcValue()) + }); + } + + SpellCastResult CheckCast() + { + if (!GetCaster()->HasAura(uint32(GetEffectInfo(EFFECT_1).CalcValue()))) + return SPELL_FAILED_CASTER_AURASTATE; + + return SPELL_CAST_OK; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue())); + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_sholazar_take_sputum_sample::CheckCast); + OnEffectHit += SpellEffectFn(spell_sholazar_take_sputum_sample::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 52306 - Sputum Collected +class spell_sholazar_sputum_collected : public SpellScript +{ + PrepareSpellScript(spell_sholazar_sputum_collected); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_HYDRA_SPUTUM }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->RemoveAurasDueToSpell(SPELL_HYDRA_SPUTUM); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_sholazar_sputum_collected::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +/*###### +## Quest 12735: A Cleansing Song +######*/ + +enum ACleansingSong +{ + SPELL_SUMMON_SPIRIT_ATHA = 52954, + SPELL_SUMMON_SPIRIT_HAKHALAN = 52958, + SPELL_SUMMON_SPIRIT_KOOSU = 52959, + + AREA_BITTERTIDE_LAKE = 4385, + AREA_RIVERS_HEART = 4290, + AREA_WINTERGRASP_RIVER = 4388 +}; + +// 52941 - Song of Cleansing +class spell_sholazar_song_of_cleansing : public SpellScript +{ + PrepareSpellScript(spell_sholazar_song_of_cleansing); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo( + { + SPELL_SUMMON_SPIRIT_ATHA, + SPELL_SUMMON_SPIRIT_HAKHALAN, + SPELL_SUMMON_SPIRIT_KOOSU + }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + switch (caster->GetAreaId()) + { + case AREA_BITTERTIDE_LAKE: + caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_ATHA); + break; + case AREA_RIVERS_HEART: + caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_HAKHALAN); + break; + case AREA_WINTERGRASP_RIVER: + caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_KOOSU); + break; + default: + break; + } + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_sholazar_song_of_cleansing::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_sholazar_basin() { RegisterCreatureAI(npc_engineer_helice); @@ -672,4 +791,7 @@ void AddSC_sholazar_basin() new spell_q12589_shoot_rjr(); new npc_haiphoon(); RegisterSpellScript(spell_q12611_deathbolt); + RegisterSpellScript(spell_sholazar_take_sputum_sample); + RegisterSpellScript(spell_sholazar_sputum_collected); + RegisterSpellScript(spell_sholazar_song_of_cleansing); } |
