From 520f2941e7bf23fa58c8dd6d81631bcfea55fdcd Mon Sep 17 00:00:00 2001 From: Grz3s Date: Sat, 30 Sep 2023 13:08:01 +0200 Subject: [PATCH] SD2: Update spells Quest: 12726 REF: q.12726 'Song of Wind and Water' --- sql/scriptdev2/spell.sql | 3 ++ .../scripts/northrend/sholazar_basin.cpp | 52 +++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index 027fa1ce03f..c254a5c9c21 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -806,6 +806,9 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (52694,'spell_recall_eye_of_acherus'), (52751,'spell_death_gate'), (52812,'spell_molten_fury_flamebringer'), +(52862,'spell_spell_devour_wind'), +(52864,'spell_devour_water'), +(52866,'spell_transform_visual'), (52942,'spell_pulsing_shockwave'), (53031,'spell_crusader_parachute'), (53035,'spell_summon_anubar_periodic_aura'), diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/sholazar_basin.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/sholazar_basin.cpp index 88ce5331272..77a6ce0feee 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/sholazar_basin.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/sholazar_basin.cpp @@ -659,6 +659,55 @@ struct SummonPossessedCrocolisk : public SpellScript } }; +// 52862 - Devour Wind +struct DevourWind : public SpellScript +{ + SpellCastResult OnCheckCast(Spell* spell, bool /*strict*/) const override + { + Unit* target = spell->m_targets.getUnitTarget(); + if (!target || !target->IsCreature() || static_cast(target)->HasBeenHitBySpell(spell->m_spellInfo->Id)) + return SPELL_FAILED_BAD_TARGETS; + + if (target->GetEntry() != 28858) + return SPELL_FAILED_BAD_TARGETS; + + return SPELL_CAST_OK; + } +}; + +// 52864 - Devour Water +struct DevourWater : public SpellScript +{ + SpellCastResult OnCheckCast(Spell* spell, bool /*strict*/) const override + { + Unit* target = spell->m_targets.getUnitTarget(); + if (!target || !target->IsCreature() || static_cast(target)->HasBeenHitBySpell(spell->m_spellInfo->Id)) + return SPELL_FAILED_BAD_TARGETS; + + if (target->GetEntry() != 28862) + return SPELL_FAILED_BAD_TARGETS; + + return SPELL_CAST_OK; + } +}; + +// 52866 - Transform Visual +struct TransformVisual : public SpellScript +{ + void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override + { + if (!spell->GetCaster()->IsCreature()) + return; + + Creature* caster = static_cast(spell->GetCaster()); + caster->UpdateEntry(spell->GetCaster()->GetEntry() == 28985 ? 28999 : 28985); + caster->SetSpellList(spell->GetCaster()->GetEntry() * 100 + 1); + caster->GetCharmInfo()->InitVehicleCreateSpells(); + if (Player* player = dynamic_cast(caster->GetCharmer())) + player->VehicleSpellInitialize(); + } +}; + void AddSC_sholazar_basin() { Script* pNewScript = new Script; @@ -695,4 +744,7 @@ void AddSC_sholazar_basin() RegisterSpellScript("spell_summon_dajik_the_wasp_hunter"); RegisterSpellScript("spell_summon_zepik_the_gorloc_hunter"); RegisterSpellScript("spell_summon_possessed_crocolisk"); + RegisterSpellScript("spell_devour_wind"); + RegisterSpellScript("spell_devour_water"); + RegisterSpellScript("spell_transform_visual"); }