From a721c71db8cea702f9222cca65f19ad8d5da2ef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Thu, 8 Dec 2022 10:21:51 -0700 Subject: [PATCH] More Onyxia 40 fixes --- src/IndividualProgressionPlayer.cpp | 2 +- src/vanillaScripts/boss_onyxia.cpp | 23 +++++++++++++++----- src/vanillaScripts/instance_onyxias_lair.cpp | 15 ++++++++++++- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/src/IndividualProgressionPlayer.cpp b/src/IndividualProgressionPlayer.cpp index 66d789d..e8bacd3 100644 --- a/src/IndividualProgressionPlayer.cpp +++ b/src/IndividualProgressionPlayer.cpp @@ -423,7 +423,7 @@ public: class IndividualPlayerProgression_UnitScript : public UnitScript { private: - float computeTotalGearTuning(Player* player) + static float computeTotalGearTuning(Player* player) { float gearAdjustment = 0.0; for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) diff --git a/src/vanillaScripts/boss_onyxia.cpp b/src/vanillaScripts/boss_onyxia.cpp index fb62f94..2820902 100644 --- a/src/vanillaScripts/boss_onyxia.cpp +++ b/src/vanillaScripts/boss_onyxia.cpp @@ -112,9 +112,8 @@ enum Yells SAY_KILL = 1, SAY_PHASE_2_TRANS = 2, SAY_PHASE_3_TRANS = 3, - - // Emote - EMOTE_BREATH = 4 + EMOTE_BREATH = 4, + SAY_EVADE = 5 }; class boss_onyxia_40 : public CreatureScript @@ -293,9 +292,21 @@ public: } } + bool CheckInRoom() override + { + if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 95.0f) + { + Talk(SAY_EVADE); + EnterEvadeMode(); + return false; + } + + return true; + } + void UpdateAI(uint32 diff) override { - if (!UpdateVictim()) + if (!UpdateVictim() || !CheckInRoom()) { return; } @@ -452,7 +463,7 @@ public: { Talk(EMOTE_BREATH); me->SetFacingTo(OnyxiaMoveData[CurrentWP].o); - DoCast(OnyxiaMoveData[CurrentWP].spellId); + DoCastAOE(OnyxiaMoveData[CurrentWP].spellId); events.ScheduleEvent(EVENT_SPELL_BREATH, 8250); break; } @@ -500,7 +511,7 @@ public: { if (Creature* trigger = me->SummonCreature(12758, *me, TEMPSUMMON_TIMED_DESPAWN, 1000)) { - trigger->AI()->DoCast(trigger, 17731); + trigger->CastSpell(trigger, 17731, false); } break; } diff --git a/src/vanillaScripts/instance_onyxias_lair.cpp b/src/vanillaScripts/instance_onyxias_lair.cpp index 0c1a6f4..f00ffb8 100644 --- a/src/vanillaScripts/instance_onyxias_lair.cpp +++ b/src/vanillaScripts/instance_onyxias_lair.cpp @@ -57,7 +57,14 @@ public: switch (go->GetEntry()) { case GO_WHELP_SPAWNER: - go->CastSpell((Unit*)nullptr, 17646); + if (instance->GetDifficulty() == RAID_DIFFICULTY_10MAN_HEROIC) + { + go->CastSpell((Unit*)nullptr, 90003); + } + else + { + go->CastSpell((Unit*)nullptr, 17646); + } if (Creature* onyxia = GetCreature(DATA_ONYXIA)) { onyxia->AI()->DoAction(-1); @@ -314,6 +321,12 @@ public: spellInfo->Effects[EFFECT_0].DieSides = 225; spellInfo->Effects[EFFECT_0].BasePoints = 1387; break; + case 90003: + spellInfo->Targets |= TARGET_FLAG_DEST_LOCATION; + spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST); + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd + spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(5); + break; } } };