From 4f8f4af63d4966fbf0bb764de31be06831e52e80 Mon Sep 17 00:00:00 2001 From: Grz3s Date: Sun, 19 Jan 2025 22:49:29 +0100 Subject: [PATCH] Spell: Summon Tournament Aspirant Fixed 63791 - Summon Tournament Hawkstrider (Aspirant) 63792 - Summon Tournament Steed (Aspirant) --- sql/scriptdev2/spell.sql | 2 ++ .../scripts/northrend/icecrown.cpp | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/sql/scriptdev2/spell.sql b/sql/scriptdev2/spell.sql index 95cef4e067a..ed859c75143 100644 --- a/sql/scriptdev2/spell.sql +++ b/sql/scriptdev2/spell.sql @@ -989,6 +989,8 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES (63474,'spell_ignis_scorch'), (63482,'spell_lightning_whirl_heroic'), (63499,'spell_hodir_dispel_magic'), +(63791,'spell_summon_tournament_aspirant'), +(63792,'spell_summon_tournament_aspirant'), (63845,'spell_create_lance'), (64203,'spell_void_zone_xt'), (64209,'spell_consumption_xt'), diff --git a/src/game/AI/ScriptDevAI/scripts/northrend/icecrown.cpp b/src/game/AI/ScriptDevAI/scripts/northrend/icecrown.cpp index 25d4dd075af..afc75416cc6 100644 --- a/src/game/AI/ScriptDevAI/scripts/northrend/icecrown.cpp +++ b/src/game/AI/ScriptDevAI/scripts/northrend/icecrown.cpp @@ -1420,6 +1420,35 @@ struct npc_lithe_stalker : public PetAI } }; +// 63791 - Summon Tournament Hawkstrider (Aspirant) +// 63792 - Summon Tournament Steed (Aspirant) +struct SummonTournamentAspirant : public SpellScript, public AuraScript +{ + SpellCastResult OnCheckCast(Spell* spell, bool /*strict*/) const override + { + if (spell->GetCaster()->IsPlayer()) + { + // Player must have aura from equiped item + Player* player = static_cast(spell->GetCaster()); + if (!player->HasAura(62853)) + { + return SPELL_FAILED_EQUIPPED_ITEM; + } + } + + return SPELL_CAST_OK; + } + + void OnSpellCastResultOverride(SpellCastResult& result, uint32& param1, uint32& param2) const override + { + if (result == SPELL_FAILED_EQUIPPED_ITEM) + { + result = SPELL_FAILED_CUSTOM_ERROR; + param1 = SPELL_FAILED_CUSTOM_ERROR_60; + } + } +}; + void AddSC_icecrown() { Script* pNewScript = new Script; @@ -1489,4 +1518,5 @@ void AddSC_icecrown() RegisterSpellScript("spell_iron_chain"); RegisterSpellScript("spell_summon_ominous_cloud"); RegisterSpellScript("spell_subdued_lithe_stalker"); + RegisterSpellScript("spell_summon_tournament_aspirant"); }