Skip to content

Commit 43aa645

Browse files
sogladevCopilot
andauthored
fix(Scripts/Northrend): Update Drakkensryd proto-drake vehicle logic (#25587)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 50ebe52 commit 43aa645

2 files changed

Lines changed: 24 additions & 14 deletions

File tree

src/server/game/Spells/SpellInfoCorrections.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5189,6 +5189,12 @@ void SpellMgr::LoadSpellInfoCorrections()
51895189
spellInfo->ProcCharges = 0;
51905190
});
51915191

5192+
// 54933 Hyldnir Harpoon
5193+
ApplySpellFix({ 54933 }, [](SpellInfo* spellInfo)
5194+
{
5195+
spellInfo->Effects[EFFECT_0].BasePoints = 1;
5196+
});
5197+
51925198
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
51935199
{
51945200
SpellInfo* spellInfo = mSpellInfoMap[i];

src/server/scripts/Northrend/zone_storm_peaks.cpp

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -538,42 +538,46 @@ class npc_icefang : public CreatureScript
538538
}
539539
};
540540

541-
enum HyldsmeetProtoDrake
542-
{
543-
NPC_HYLDSMEET_DRAKERIDER = 29694
544-
};
545-
546541
struct npc_hyldsmeet_protodrake : public CreatureAI
547542
{
548-
explicit npc_hyldsmeet_protodrake(Creature* creature) : CreatureAI(creature), _accessoryRespawnTimer(0) { }
543+
explicit npc_hyldsmeet_protodrake(Creature* creature) : CreatureAI(creature), _accessoryInstalled(false), _accessoryRespawnTimer(0)
544+
{
545+
me->SetUnitFlag2(UNIT_FLAG2_PREVENT_SPELL_CLICK);
546+
}
549547

550548
void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) override
551549
{
552-
if (apply)
550+
if (who->IsPlayer())
553551
return;
554552

555-
if (who->GetEntry() == NPC_HYLDSMEET_DRAKERIDER)
553+
if (apply)
554+
_accessoryInstalled = true;
555+
else
556+
{
557+
_accessoryInstalled = false;
556558
_accessoryRespawnTimer = 5 * MINUTE * IN_MILLISECONDS;
559+
}
557560
}
558561

559562
void UpdateAI(uint32 diff) override
560563
{
561-
//! We need to manually reinstall accessories because the vehicle itself is friendly to players,
562-
//! so EnterEvadeMode is never triggered. The accessory on the other hand is hostile and killable.
564+
// We need to manually reinstall accessories because the vehicle itself is friendly to players,
565+
// so EnterEvadeMode is never triggered. The accessory on the other hand is hostile and killable.
566+
if (_accessoryInstalled)
567+
return;
568+
563569
Vehicle* vehicleKit = me->GetVehicleKit();
564-
if (!vehicleKit || !_accessoryRespawnTimer)
570+
if (!vehicleKit)
565571
return;
566572

567573
if (_accessoryRespawnTimer <= diff)
568-
{
569574
vehicleKit->InstallAllAccessories(true);
570-
_accessoryRespawnTimer = 0;
571-
}
572575
else
573576
_accessoryRespawnTimer -= diff;
574577
}
575578

576579
private:
580+
bool _accessoryInstalled;
577581
uint32 _accessoryRespawnTimer;
578582
};
579583

0 commit comments

Comments
 (0)