From 4ecf01ada43dd7a34d8aa19853b1343fb7243e6d Mon Sep 17 00:00:00 2001 From: killerwife Date: Sun, 8 Oct 2023 11:06:51 +0200 Subject: [PATCH] Sholazar: Fix assignment of proper entry for q.12726 --- sql/scriptdev2/spell.sql | 1 - .../scripts/northrend/sholazar_basin.cpp | 30 ++++++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index 8845764c23f..acb5eb178f1 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -813,7 +813,6 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (52812,'spell_molten_fury_flamebringer'), (52862,'spell_devour_wind'), (52864,'spell_devour_water'), -(52866,'spell_transform_visual'), (52942,'spell_pulsing_shockwave'), (53031,'spell_crusader_parachute'), (53032,'spell_flurry_of_claws'), diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/sholazar_basin.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/sholazar_basin.cpp index c16af98da9d..35f53f90243 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/sholazar_basin.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/sholazar_basin.cpp @@ -719,6 +719,22 @@ struct DevourWind : public SpellScript return SPELL_CAST_OK; } + + void OnCast(Spell* spell) const override + { + // transform visual + spell->GetCaster()->CastSpell(nullptr, 52866, TRIGGERED_OLD_TRIGGERED); + + if (!spell->GetCaster()->IsCreature()) + return; + + // change into water + Creature* caster = static_cast(spell->GetCaster()); + caster->UpdateEntry(28985); + caster->GetCharmInfo()->InitVehicleCreateSpells(); + if (Player* player = dynamic_cast(caster->GetCharmer())) + player->VehicleSpellInitialize(); + } }; // 52864 - Devour Water @@ -735,19 +751,18 @@ struct DevourWater : public SpellScript return SPELL_CAST_OK; } -}; -// 52866 - Transform Visual -struct TransformVisual : public SpellScript -{ - void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override + void OnCast(Spell* spell) const override { + // transform visual + spell->GetCaster()->CastSpell(nullptr, 52866, TRIGGERED_OLD_TRIGGERED); + if (!spell->GetCaster()->IsCreature()) return; + // change into water Creature* caster = static_cast(spell->GetCaster()); - caster->UpdateEntry(spell->GetCaster()->GetEntry() == 28985 ? 28999 : 28985); - caster->SetSpellList(spell->GetCaster()->GetEntry() * 100 + 1); + caster->UpdateEntry(28999); caster->GetCharmInfo()->InitVehicleCreateSpells(); if (Player* player = dynamic_cast(caster->GetCharmer())) player->VehicleSpellInitialize(); @@ -806,6 +821,5 @@ void AddSC_sholazar_basin() RegisterSpellScript("spell_summon_sooholu"); RegisterSpellScript("spell_devour_wind"); RegisterSpellScript("spell_devour_water"); - RegisterSpellScript("spell_transform_visual"); RegisterSpellScript("spell_flurry_of_claws"); }