Skip to content

Commit

Permalink
Sholazar: Fix assignment of proper entry for q.12726
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Oct 8, 2023
1 parent a4bb6fc commit 4ecf01a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
1 change: 0 additions & 1 deletion sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
30 changes: 22 additions & 8 deletions src/game/AI/ScriptDevAI/scripts/northrend/sholazar_basin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Creature*>(spell->GetCaster());
caster->UpdateEntry(28985);
caster->GetCharmInfo()->InitVehicleCreateSpells();
if (Player* player = dynamic_cast<Player*>(caster->GetCharmer()))
player->VehicleSpellInitialize();
}
};

// 52864 - Devour Water
Expand All @@ -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<Creature*>(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<Player*>(caster->GetCharmer()))
player->VehicleSpellInitialize();
Expand Down Expand Up @@ -806,6 +821,5 @@ void AddSC_sholazar_basin()
RegisterSpellScript<SummonSooholu>("spell_summon_sooholu");
RegisterSpellScript<DevourWind>("spell_devour_wind");
RegisterSpellScript<DevourWater>("spell_devour_water");
RegisterSpellScript<TransformVisual>("spell_transform_visual");
RegisterSpellScript<FlurryOfClaws>("spell_flurry_of_claws");
}

0 comments on commit 4ecf01a

Please sign in to comment.