Skip to content

Commit

Permalink
SD2: Update spells Quest: 12726
Browse files Browse the repository at this point in the history
REF: q.12726 'Song of Wind and Water'
  • Loading branch information
Grz3s committed Sep 30, 2023
1 parent 5e94c02 commit b85a8dc
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
52 changes: 52 additions & 0 deletions src/game/AI/ScriptDevAI/scripts/northrend/sholazar_basin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Creature*>(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<Creature*>(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<Creature*>(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<Player*>(caster->GetCharmer()))
player->VehicleSpellInitialize();
}
};

void AddSC_sholazar_basin()
{
Script* pNewScript = new Script;
Expand Down Expand Up @@ -695,4 +744,7 @@ void AddSC_sholazar_basin()
RegisterSpellScript<SummonDajikTheWaspHunter>("spell_summon_dajik_the_wasp_hunter");
RegisterSpellScript<SummonZepikTheGorlocHunter>("spell_summon_zepik_the_gorloc_hunter");
RegisterSpellScript<SummonPossessedCrocolisk>("spell_summon_possessed_crocolisk");
RegisterSpellScript<DevourWind>("spell_devour_wind");
RegisterSpellScript<DevourWater>("spell_devour_water");
RegisterSpellScript<TransformVisual>("spell_transform_visual");
}

0 comments on commit b85a8dc

Please sign in to comment.