fix(Scripts/Northrend): Update Drakkensryd proto-drake vehicle logic (#25587)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
sogladev
2026-05-02 19:57:06 +02:00
committed by GitHub
parent 50ebe52b96
commit 43aa645660
2 changed files with 24 additions and 14 deletions

View File

@@ -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];

View File

@@ -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;
};