diff options
-rw-r--r-- | sql/updates/world/3.3.5/2022_03_05_00_world.sql | 8 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_sholazar_basin.cpp | 122 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 67 |
3 files changed, 130 insertions, 67 deletions
diff --git a/sql/updates/world/3.3.5/2022_03_05_00_world.sql b/sql/updates/world/3.3.5/2022_03_05_00_world.sql new file mode 100644 index 00000000000..a05e9aad2c0 --- /dev/null +++ b/sql/updates/world/3.3.5/2022_03_05_00_world.sql @@ -0,0 +1,8 @@ +-- +UPDATE `spell_script_names` SET `ScriptName` = 'spell_sholazar_take_sputum_sample' WHERE `ScriptName` = 'spell_q12683_take_sputum_sample'; + +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_sholazar_sputum_collected'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(52306,'spell_sholazar_sputum_collected'); + +UPDATE `spell_script_names` SET `ScriptName` = 'spell_sholazar_song_of_cleansing' WHERE `ScriptName` = 'spell_q12735_song_of_cleansing'; diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 622d76caca5..237c1f733aa 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -663,6 +663,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 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); @@ -673,4 +792,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); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 2b85c37705d..0385e8ef4df 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -537,30 +537,6 @@ class spell_q12634_despawn_fruit_tosser : public SpellScript } }; -// http://www.wowhead.com/quest=12683 Burning to Help -// 52308 - Take Sputum Sample -class spell_q12683_take_sputum_sample : public SpellScript -{ - PrepareSpellScript(spell_q12683_take_sputum_sample); - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - uint32 reqAuraId = GetEffectInfo(EFFECT_1).CalcValue(); - - Unit* caster = GetCaster(); - if (caster->HasAuraEffect(reqAuraId, 0)) - { - uint32 spellId = GetEffectInfo().CalcValue(); - caster->CastSpell(caster, spellId, true); - } - } - - void Register() override - { - OnEffectHit += SpellEffectFn(spell_q12683_take_sputum_sample::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } -}; - // http://www.wowhead.com/quest=12851 Going Bearback enum Quest12851Data { @@ -888,47 +864,6 @@ class spell_q12066_bunny_kill_credit : public SpellScript } }; -enum ACleansingSong -{ - SPELL_SUMMON_SPIRIT_ATAH = 52954, - SPELL_SUMMON_SPIRIT_HAKHALAN = 52958, - SPELL_SUMMON_SPIRIT_KOOSU = 52959, - - AREA_BITTERTIDELAKE = 4385, - AREA_RIVERSHEART = 4290, - AREA_WINTERGRASPRIVER = 4388, -}; - -// 52941 - Song of Cleansing -class spell_q12735_song_of_cleansing : public SpellScript -{ - PrepareSpellScript(spell_q12735_song_of_cleansing); - - void HandleScript(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - switch (caster->GetAreaId()) - { - case AREA_BITTERTIDELAKE: - caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_ATAH); - break; - case AREA_RIVERSHEART: - caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_HAKHALAN); - break; - case AREA_WINTERGRASPRIVER: - caster->CastSpell(caster, SPELL_SUMMON_SPIRIT_KOOSU); - break; - default: - break; - } - } - - void Register() override - { - OnEffectHitTarget += SpellEffectFn(spell_q12735_song_of_cleansing::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - } -}; - enum DefendingWyrmrestTemple { SPELL_SUMMON_WYRMREST_DEFENDER = 49207 @@ -2175,7 +2110,6 @@ void AddSC_quest_spell_scripts() RegisterSpellScript(spell_q11730_ultrasonic_screwdriver); RegisterSpellScript(spell_q12459_seeds_of_natures_wrath); RegisterSpellScript(spell_q12634_despawn_fruit_tosser); - RegisterSpellScript(spell_q12683_take_sputum_sample); RegisterSpellScript(spell_q12851_going_bearback); RegisterSpellScript(spell_q10041_q10040_who_are_they); RegisterSpellScript(spell_q12659_ahunaes_knife); @@ -2186,7 +2120,6 @@ void AddSC_quest_spell_scripts() RegisterSpellScript(spell_q14112_14145_chum_the_water); RegisterSpellScript(spell_q9452_cast_net); RegisterSpellScript(spell_q12066_bunny_kill_credit); - RegisterSpellScript(spell_q12735_song_of_cleansing); RegisterSpellScript(spell_q12372_cast_from_gossip_trigger); RegisterSpellScript(spell_q12372_destabilize_azure_dragonshrine_dummy); RegisterSpellScript(spell_q11010_q11102_q11023_aggro_check_aura); |