Skip to content

Commit

Permalink
Icecrown: Spell 58203 Scripted
Browse files Browse the repository at this point in the history
target corrected
Closes #579
  • Loading branch information
Grz3s authored and killerwife committed Dec 12, 2024
1 parent 91d362d commit 6260107
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(57667,'spell_frozen_siegebolt'),
(57669,'spell_replenishment'),
(57853,'spell_master_summoners_staff'),
(58203,'spell_iron_chain'),
(58418,'spell_portal_to_capital_city'),
(58420,'spell_portal_to_capital_city'),
(58524,'spell_control_eidolon_watcher'),
Expand Down
24 changes: 24 additions & 0 deletions src/game/AI/ScriptDevAI/scripts/northrend/icecrown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,29 @@ struct ControlEidolonWatcher : public SpellScript
}
};

// 58203 - Iron Chain
struct IronChain : public SpellScript, public AuraScript
{
SpellCastResult OnCheckCast(Spell* spell, bool /*strict*/) const override
{
Unit* target = spell->m_targets.getUnitTarget();
if (!target || target->GetEntry() != 31075)
return SPELL_FAILED_BAD_TARGETS;

return SPELL_CAST_OK;
}
void OnApply(Aura* aura, bool apply) const override
{
Unit* caster = aura->GetCaster();
if (!caster || !aura->GetTarget()->IsCreature())
return;
if (!apply)
return;

aura->GetTarget()->GetMotionMaster()->MoveFollow(caster, 2.0f, M_PI_F, true);
}
};

void AddSC_icecrown()
{
Script* pNewScript = new Script;
Expand Down Expand Up @@ -1378,4 +1401,5 @@ void AddSC_icecrown()
RegisterSpellScript<BurningSkeleton>("spell_burning_skeleton");
RegisterSpellScript<RefurbishedDemolisher>("spell_refurbished_demolisher");
RegisterSpellScript<ControlEidolonWatcher>("spell_control_eidolon_watcher");
RegisterSpellScript<IronChain>("spell_iron_chain");
}

0 comments on commit 6260107

Please sign in to comment.