From b6daee6c7a0c42bc614df37ad8898a4176c59a20 Mon Sep 17 00:00:00 2001 From: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com> Date: Sat, 31 May 2025 17:09:03 +0200 Subject: [PATCH] fix (DB/Script) Move Eye of Acherus event to SmartAI. (#22249) --- .../pending_db_world/Eye_of_Acherus.sql | 34 +++++ .../game/Spells/SpellInfoCorrections.cpp | 7 ++ .../ScarletEnclave/chapter1.cpp | 118 ------------------ 3 files changed, 41 insertions(+), 118 deletions(-) create mode 100644 data/sql/updates/pending_db_world/Eye_of_Acherus.sql diff --git a/data/sql/updates/pending_db_world/Eye_of_Acherus.sql b/data/sql/updates/pending_db_world/Eye_of_Acherus.sql new file mode 100644 index 000000000..c5531e43a --- /dev/null +++ b/data/sql/updates/pending_db_world/Eye_of_Acherus.sql @@ -0,0 +1,34 @@ + +-- Remove Flight flag +UPDATE `creature_template_movement` SET `Flight` = 0 WHERE (`CreatureId` = 28511); + +-- Add Waypoint +DELETE FROM `waypoint_data` WHERE `id` IN ("2851100"); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +("2851100", 1, 2341.5713, -5672.797, 538.3942, NULL, 0, 0, 0, 100, 0), +("2851100", 2, 1957.3962, -5844.1055, 273.86673, NULL, 0, 0, 0, 100, 0), +("2851100", 3, 1758.007, -5876.7847, 166.86671, NULL, 0, 0, 0, 100, 0); + +-- Set Action List +DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 2851100); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(2851100, 9, 0, 0, 0, 0, 100, 512, 0, 0, 0, 0, 0, 0, 11, 51892, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - Actionlist - Cast \'Eye of Acherus Visual\''), +(2851100, 9, 1, 0, 0, 0, 100, 512, 6000, 6000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - Actionlist - Say Line 0'), +(2851100, 9, 2, 0, 0, 0, 100, 512, 1000, 1000, 0, 0, 0, 0, 11, 51923, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - Actionlist - Cast \'Eye of Acherus Flight (Boost)\''), +(2851100, 9, 3, 0, 0, 0, 100, 512, 1000, 1000, 0, 0, 0, 0, 103, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - Actionlist - Set Rooted Off'), +(2851100, 9, 4, 0, 0, 0, 100, 512, 100, 100, 0, 0, 0, 0, 232, 2851100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - Actionlist - Start Path 2851100'), +(2851100, 9, 5, 0, 0, 0, 100, 512, 19200, 19200, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - Actionlist - Set Rooted On'), +(2851100, 9, 6, 0, 0, 0, 100, 512, 500, 500, 0, 0, 0, 0, 11, 51890, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - Actionlist - Cast \'Eye of Acherus Flight\''), +(2851100, 9, 7, 0, 0, 0, 100, 512, 500, 500, 0, 0, 0, 0, 28, 51923, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - Actionlist - Remove Aura \'Eye of Acherus Flight (Boost)\''), +(2851100, 9, 8, 0, 0, 0, 100, 0, 500, 500, 0, 0, 0, 0, 28, 51860, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - Actionlist - Remove Aura \'Serverside - Root Self\''), +(2851100, 9, 9, 0, 0, 0, 100, 512, 500, 500, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - Actionlist - Say Line 1'), +(2851100, 9, 10, 0, 0, 0, 100, 512, 500, 500, 0, 0, 0, 0, 103, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - Actionlist - Set Rooted Off'); + +-- Set General SmartAI and remove script name +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 28511; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28511); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(28511, 0, 0, 1, 54, 0, 100, 512, 0, 0, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - On Just Summoned - Set Rooted On'), +(28511, 0, 1, 2, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 11, 51860, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - On Just Summoned - Cast \'Serverside - Root Self\''), +(28511, 0, 2, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 80, 2851100, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Eye of Acherus - On Just Summoned - Run Script'); diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index 9baac47d2..3548ea787 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -5105,6 +5105,13 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->AttributesEx6 |= SPELL_ATTR6_ALLOW_WHILE_RIDING_VEHICLE; }); + // Eye of Acherus Flight (Boost) + ApplySpellFix({ 51923 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].ApplyAuraName = SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER); + }); + // Shattering Throw ApplySpellFix({ 64382 }, [](SpellInfo* spellInfo) { diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 9fb5e9006..2a5816d74 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -37,123 +37,6 @@ enum EyeOfAcherusMisc { SPELL_THE_EYE_OF_ACHERUS = 51852, - SPELL_EYE_OF_ACHERUS_VISUAL = 51892, - SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST = 51923, - SPELL_EYE_OF_ACHERUS_FLIGHT = 51890, - SPELL_ROOT_SELF = 51860, - - EVENT_ANNOUNCE_LAUNCH_TO_DESTINATION = 1, - EVENT_UNROOT = 2, - EVENT_LAUNCH_TOWARDS_DESTINATION = 3, - EVENT_GRANT_CONTROL = 4, - - SAY_LAUNCH_TOWARDS_DESTINATION = 0, - SAY_EYE_UNDER_CONTROL = 1, - - POINT_NEW_AVALON = 1, - - EYE_POINT_DESTINATION_0 = 0, - EYE_POINT_DESTINATION_1 = 1, - EYE_POINT_DESTINATION_2 = 2, - EYE_POINT_DESTINATION_3 = 3 -}; - -struct npc_eye_of_acherus : public ScriptedAI -{ - npc_eye_of_acherus(Creature* creature) : ScriptedAI(creature) - { - creature->SetReactState(REACT_PASSIVE); - } - - void InitializeAI() override - { - 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); - } - - void OnCharmed(bool apply) override - { - if (!apply) - { - me->GetCharmerOrOwner()->RemoveAurasDueToSpell(SPELL_THE_EYE_OF_ACHERUS); - me->GetCharmerOrOwner()->RemoveAurasDueToSpell(SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST); - } - } - - void UpdateAI(uint32 diff) override - { - _events.Update(diff); - - while (uint32 eventId = _events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_ANNOUNCE_LAUNCH_TO_DESTINATION: - if (Unit* owner = me->GetCharmerOrOwner()) - { - Talk(SAY_LAUNCH_TOWARDS_DESTINATION, owner); - } - _events.ScheduleEvent(EVENT_UNROOT, 400ms); - break; - case EVENT_UNROOT: - me->RemoveAurasDueToSpell(SPELL_ROOT_SELF); - DoCastSelf(SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST); - _events.ScheduleEvent(EVENT_LAUNCH_TOWARDS_DESTINATION, 1s + 200ms); - break; - case EVENT_LAUNCH_TOWARDS_DESTINATION: - { - Position const EYE_DESTINATION_1 = { 2361.21f, -5660.45f, 496.744f, 0.0f }; - Position const EYE_DESTINATION_2 = { 2341.571f, -5672.797f, 538.3942f, 0.0f }; - Position const EYE_DESTINATION_3 = { 1957.4f, -5844.1f, 273.867f, 0.0f }; - Position const EYE_DESTINATION_4 = { 1758.01f, -5876.79f, 166.867f, 0.0f }; - - Movement::MoveSplineInit init(me); - init.SetFly(); - if (Unit* owner = me->GetCharmerOrOwner()) - { - init.SetVelocity(owner->GetSpeed(MOVE_RUN)); - } - - me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_0, EYE_DESTINATION_1); - me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_1, EYE_DESTINATION_2); - me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_2, EYE_DESTINATION_3); - me->GetMotionMaster()->MovePoint(EYE_POINT_DESTINATION_3, EYE_DESTINATION_4); - _events.ScheduleEvent(EVENT_GRANT_CONTROL, 22s); - break; - } - case EVENT_GRANT_CONTROL: - if (Unit* owner = me->GetCharmerOrOwner()) - { - Talk(SAY_EYE_UNDER_CONTROL, owner); // This is wrong, should be when last pointId is reached. - } - me->RemoveAurasDueToSpell(SPELL_ROOT_SELF); - me->RemoveAurasDueToSpell(SPELL_EYE_OF_ACHERUS_FLIGHT_BOOST); - break; - default: - break; - } - } - } - - void MovementInform(uint32 movementType, uint32 pointId) override - { - if (movementType != POINT_MOTION_TYPE) - return; - - switch (pointId) - { - case POINT_NEW_AVALON: - DoCastSelf(SPELL_ROOT_SELF); - break; - default: - break; - } - } - -private: - EventMap _events; }; enum DeathComesFromOnHigh @@ -1329,7 +1212,6 @@ class spell_lich_king_whisper : public SpellScript 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();