From fdaaaae2574315818ef96cbbe178e960c8b70347 Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Mon, 26 May 2025 13:44:42 +0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/ScarletEnclave):=20Script=20Recall?= =?UTF-8?q?=20Eye=20of=20Acherus=20&=20fix=20Summo=E2=80=A6=20(#22205)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rev_1748181860546922800.sql | 10 +++++ .../ScarletEnclave/chapter1.cpp | 44 ++++++++++++++++--- 2 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1748181860546922800.sql diff --git a/data/sql/updates/pending_db_world/rev_1748181860546922800.sql b/data/sql/updates/pending_db_world/rev_1748181860546922800.sql new file mode 100644 index 000000000..344520725 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1748181860546922800.sql @@ -0,0 +1,10 @@ +-- Eye of Acherus +DELETE FROM `creature_template_spell` WHERE (`CreatureID` = 28511); +INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES +(28511, 0, 51859, 0), +(28511, 1, 51904, 0), +(28511, 2, 52006, 0), +(28511, 4, 52694, 0); + +DELETE FROM `spell_script_names` WHERE `spell_id`=52694 AND `ScriptName`='spell_q12641_death_comes_from_on_high_recall_eye'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (52694, 'spell_q12641_death_comes_from_on_high_recall_eye'); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 941bc2f9f..9fb5e9006 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -62,14 +62,14 @@ struct npc_eye_of_acherus : public ScriptedAI { npc_eye_of_acherus(Creature* creature) : ScriptedAI(creature) { - creature->SetDisplayFromModel(0); creature->SetReactState(REACT_PASSIVE); } void InitializeAI() override { - DoCastSelf(SPELL_ROOT_SELF); + DoCastSelf(SPELL_ROOT_SELF); // Use SetControlled DoCastSelf(SPELL_EYE_OF_ACHERUS_VISUAL); + DoCastSelf(SPELL_EYE_OF_ACHERUS_FLIGHT); _events.ScheduleEvent(EVENT_ANNOUNCE_LAUNCH_TO_DESTINATION, 400ms); } @@ -126,10 +126,9 @@ struct npc_eye_of_acherus : public ScriptedAI case EVENT_GRANT_CONTROL: if (Unit* owner = me->GetCharmerOrOwner()) { - Talk(SAY_EYE_UNDER_CONTROL, owner); + Talk(SAY_EYE_UNDER_CONTROL, owner); // This is wrong, should be when last pointId is reached. } me->RemoveAurasDueToSpell(SPELL_ROOT_SELF); - DoCastSelf(SPELL_EYE_OF_ACHERUS_FLIGHT); me->RemoveAurasDueToSpell(SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST); break; default: @@ -159,23 +158,24 @@ private: enum DeathComesFromOnHigh { - SUMMON_GHOULS_ON_SCARLET_CRUSADE = 54522 + SPELL_CALL_OF_THE_DEAD = 51900 }; +// 51904 - Summon Ghouls On Scarlet Crusade class spell_q12641_death_comes_from_on_high_summon_ghouls : public SpellScript { PrepareSpellScript(spell_q12641_death_comes_from_on_high_summon_ghouls); bool Validate(SpellInfo const* /*spellInfo*/) override { - return ValidateSpellInfo({ SUMMON_GHOULS_ON_SCARLET_CRUSADE }); + return ValidateSpellInfo({ SPELL_CALL_OF_THE_DEAD }); } void HandleScriptEffect(SpellEffIndex effIndex) { PreventHitEffect(effIndex); if (Unit* target = GetHitUnit()) - GetCaster()->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SUMMON_GHOULS_ON_SCARLET_CRUSADE, true); + target->CastSpell(target, SPELL_CALL_OF_THE_DEAD, true); } void Register() override @@ -184,6 +184,35 @@ class spell_q12641_death_comes_from_on_high_summon_ghouls : public SpellScript } }; +// 52694 - Recall Eye of Acherus +class spell_q12641_death_comes_from_on_high_recall_eye : public SpellScript +{ + PrepareSpellScript(spell_q12641_death_comes_from_on_high_recall_eye); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_THE_EYE_OF_ACHERUS }); + } + + void HandleScriptEffect(SpellEffIndex effIndex) + { + PreventHitEffect(effIndex); + Unit* caster = GetCaster(); + Unit* owner = caster->GetCharmerOrOwner(); + + if (!caster || !owner) + return; + + if (owner->HasAura(SPELL_THE_EYE_OF_ACHERUS)) + owner->RemoveAurasDueToSpell(SPELL_THE_EYE_OF_ACHERUS); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_recall_eye::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + enum deathsChallenge { SPELL_DUEL = 52996, @@ -1302,6 +1331,7 @@ void AddSC_the_scarlet_enclave_c1() // Ours RegisterCreatureAI(npc_eye_of_acherus); RegisterSpellScript(spell_q12641_death_comes_from_on_high_summon_ghouls); + RegisterSpellScript(spell_q12641_death_comes_from_on_high_recall_eye); new npc_death_knight_initiate(); RegisterSpellScript(spell_item_gift_of_the_harvester); RegisterSpellScript(spell_q12698_the_gift_that_keeps_on_giving);