From 43aa645660176f44cc2ab275aa3e527ca4148775 Mon Sep 17 00:00:00 2001 From: sogladev Date: Sat, 2 May 2026 19:57:06 +0200 Subject: [PATCH] fix(Scripts/Northrend): Update Drakkensryd proto-drake vehicle logic (#25587) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../game/Spells/SpellInfoCorrections.cpp | 6 ++++ .../scripts/Northrend/zone_storm_peaks.cpp | 32 +++++++++++-------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/server/game/Spells/SpellInfoCorrections.cpp b/src/server/game/Spells/SpellInfoCorrections.cpp index e09e82a37..03b9107fe 100644 --- a/src/server/game/Spells/SpellInfoCorrections.cpp +++ b/src/server/game/Spells/SpellInfoCorrections.cpp @@ -5189,6 +5189,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->ProcCharges = 0; }); + // 54933 Hyldnir Harpoon + ApplySpellFix({ 54933 }, [](SpellInfo* spellInfo) + { + spellInfo->Effects[EFFECT_0].BasePoints = 1; + }); + for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i) { SpellInfo* spellInfo = mSpellInfoMap[i]; diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index b8c6bec5e..5140656c0 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -538,42 +538,46 @@ public: } }; -enum HyldsmeetProtoDrake -{ - NPC_HYLDSMEET_DRAKERIDER = 29694 -}; - struct npc_hyldsmeet_protodrake : public CreatureAI { - explicit npc_hyldsmeet_protodrake(Creature* creature) : CreatureAI(creature), _accessoryRespawnTimer(0) { } + explicit npc_hyldsmeet_protodrake(Creature* creature) : CreatureAI(creature), _accessoryInstalled(false), _accessoryRespawnTimer(0) + { + me->SetUnitFlag2(UNIT_FLAG2_PREVENT_SPELL_CLICK); + } void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) override { - if (apply) + if (who->IsPlayer()) return; - if (who->GetEntry() == NPC_HYLDSMEET_DRAKERIDER) + if (apply) + _accessoryInstalled = true; + else + { + _accessoryInstalled = false; _accessoryRespawnTimer = 5 * MINUTE * IN_MILLISECONDS; + } } void UpdateAI(uint32 diff) override { - //! We need to manually reinstall accessories because the vehicle itself is friendly to players, - //! so EnterEvadeMode is never triggered. The accessory on the other hand is hostile and killable. + // We need to manually reinstall accessories because the vehicle itself is friendly to players, + // so EnterEvadeMode is never triggered. The accessory on the other hand is hostile and killable. + if (_accessoryInstalled) + return; + Vehicle* vehicleKit = me->GetVehicleKit(); - if (!vehicleKit || !_accessoryRespawnTimer) + if (!vehicleKit) return; if (_accessoryRespawnTimer <= diff) - { vehicleKit->InstallAllAccessories(true); - _accessoryRespawnTimer = 0; - } else _accessoryRespawnTimer -= diff; } private: + bool _accessoryInstalled; uint32 _accessoryRespawnTimer; };