Skip to content

Commit 238e298

Browse files
committed
fix(Scripts/Northrend): Drakkensryd manual accessory reinstall logic
- refactor manual accessory reinstall logic - set Hyldnir Harpoon to only enter the passenger position. Avoids issues where a second player can mount the Rider's position - set UNIT_FLAG2_PREVENT_SPELL_CLICK to avoid cogwheel icon on the drake
1 parent 92a9146 commit 238e298

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
@@ -5190,6 +5190,12 @@ void SpellMgr::LoadSpellInfoCorrections()
51905190
spellInfo->ProcCharges = 0;
51915191
});
51925192

5193+
// 54933 Hyldnir Harpoon
5194+
ApplySpellFix({ 54933 }, [](SpellInfo* spellInfo)
5195+
{
5196+
spellInfo->Effects[EFFECT_0].BasePoints = 1;
5197+
});
5198+
51935199
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
51945200
{
51955201
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)