From a2f89224118a759a2dd89629ff4f89a2a1aa3b36 Mon Sep 17 00:00:00 2001 From: Dan <83884799+elthehablo@users.noreply.github.com> Date: Sun, 25 Feb 2024 15:49:49 +0100 Subject: [PATCH] fix(Scripts/TheEye): remove faulty aurascript and do visual transition in normal script instead (#18395) --- .../remove_aurascript_from_db.sql | 2 + .../Outland/TempestKeep/Eye/boss_alar.cpp | 62 +++++++------------ 2 files changed, 25 insertions(+), 39 deletions(-) create mode 100644 data/sql/updates/pending_db_world/remove_aurascript_from_db.sql diff --git a/data/sql/updates/pending_db_world/remove_aurascript_from_db.sql b/data/sql/updates/pending_db_world/remove_aurascript_from_db.sql new file mode 100644 index 000000000..4c17c32c6 --- /dev/null +++ b/data/sql/updates/pending_db_world/remove_aurascript_from_db.sql @@ -0,0 +1,2 @@ +-- +DELETE FROM `spell_script_names` WHERE `spell_id` = 34341 AND `ScriptName` = 'spell_alar_ember_blast_death'; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index b44274018..a2dc7fde3 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -69,7 +69,8 @@ enum Misc EVENT_SPELL_BERSERK = 3, EVENT_MOVE_TO_PHASE_2 = 4, - EVENT_FINISH_DIVE = 5 + EVENT_FINISH_DIVE = 5, + EVENT_INVISIBLE = 6 }; enum GroupAlar @@ -172,22 +173,25 @@ struct boss_alar : public BossAI if (damage >= me->GetHealth() && _platform < POINT_MIDDLE) { damage = 0; - me->SetReactState(REACT_PASSIVE); - scheduler.CancelAll(); - me->CastStop(); - me->SetHealth(me->GetMaxHealth()); - DoCastSelf(SPELL_EMBER_BLAST, true); //spellscript doesn't trigger - + DoCastSelf(SPELL_EMBER_BLAST, true); + PretendToDie(me); + ScheduleUniqueTimedEvent(1s, [&]{ + me->SetVisible(false); + }, EVENT_INVISIBLE); ScheduleUniqueTimedEvent(8s, [&]{ me->SetPosition(alarPoints[POINT_MIDDLE]); }, EVENT_RELOCATE_MIDDLE); ScheduleUniqueTimedEvent(12s, [&] { + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetVisible(true); DoCastSelf(SPELL_CLEAR_ALL_DEBUFFS, true); DoCastSelf(SPELL_REBIRTH_PHASE2); }, EVENT_MOVE_TO_PHASE_2); ScheduleUniqueTimedEvent(16001ms, [&]{ + me->SetHealth(me->GetMaxHealth()); me->SetReactState(REACT_AGGRESSIVE); + me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); _platform = POINT_MIDDLE; me->GetMotionMaster()->MoveChase(me->GetVictim()); ScheduleAbilities(); @@ -195,6 +199,18 @@ struct boss_alar : public BossAI } } + void PretendToDie(Creature* creature) + { + scheduler.CancelAll(); + creature->InterruptNonMeleeSpells(true); + creature->RemoveAllAuras(); + creature->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); + creature->SetReactState(REACT_PASSIVE); + creature->GetMotionMaster()->MovementExpired(false); + creature->GetMotionMaster()->MoveIdle(); + creature->SetStandState(UNIT_STAND_STATE_DEAD); + } + void ScheduleAbilities() { ScheduleTimedEvent(57s, [&] @@ -394,37 +410,6 @@ class spell_alar_ember_blast : public SpellScript } }; -class spell_alar_ember_blast_death : public AuraScript -{ - PrepareAuraScript(spell_alar_ember_blast_death); - - void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) - { - PreventDefaultAction(); // xinef: prevent default action after change that invisibility in instances is executed instantly even for creatures - Unit* target = GetTarget(); - InvisibilityType type = InvisibilityType(aurEff->GetMiscValue()); - target->m_invisibility.AddFlag(type); - target->m_invisibility.AddValue(type, aurEff->GetAmount()); - - GetUnitOwner()->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - GetUnitOwner()->SetStandState(UNIT_STAND_STATE_DEAD); - GetUnitOwner()->m_last_notify_position.Relocate(0.0f, 0.0f, 0.0f); - GetUnitOwner()->m_delayed_unit_relocation_timer = 1000; - } - - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - GetUnitOwner()->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE); - GetUnitOwner()->SetStandState(UNIT_STAND_STATE_STAND); - } - - void Register() override - { - OnEffectApply += AuraEffectApplyFn(spell_alar_ember_blast_death::OnApply, EFFECT_2, SPELL_AURA_MOD_INVISIBILITY, AURA_EFFECT_HANDLE_REAL); - OnEffectRemove += AuraEffectRemoveFn(spell_alar_ember_blast_death::OnRemove, EFFECT_2, SPELL_AURA_MOD_INVISIBILITY, AURA_EFFECT_HANDLE_REAL); - } -}; - class spell_alar_dive_bomb : public AuraScript { PrepareAuraScript(spell_alar_dive_bomb); @@ -446,7 +431,6 @@ void AddSC_boss_alar() RegisterTheEyeAI(boss_alar); RegisterSpellScript(spell_alar_flame_quills); RegisterSpellScript(spell_alar_ember_blast); - RegisterSpellScript(spell_alar_ember_blast_death); RegisterSpellScript(spell_alar_dive_bomb); }