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:
@@ -5189,6 +5189,12 @@ void SpellMgr::LoadSpellInfoCorrections()
|
|||||||
spellInfo->ProcCharges = 0;
|
spellInfo->ProcCharges = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 54933 Hyldnir Harpoon
|
||||||
|
ApplySpellFix({ 54933 }, [](SpellInfo* spellInfo)
|
||||||
|
{
|
||||||
|
spellInfo->Effects[EFFECT_0].BasePoints = 1;
|
||||||
|
});
|
||||||
|
|
||||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||||
{
|
{
|
||||||
SpellInfo* spellInfo = mSpellInfoMap[i];
|
SpellInfo* spellInfo = mSpellInfoMap[i];
|
||||||
|
|||||||
@@ -538,42 +538,46 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
enum HyldsmeetProtoDrake
|
|
||||||
{
|
|
||||||
NPC_HYLDSMEET_DRAKERIDER = 29694
|
|
||||||
};
|
|
||||||
|
|
||||||
struct npc_hyldsmeet_protodrake : public CreatureAI
|
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
|
void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) override
|
||||||
{
|
{
|
||||||
if (apply)
|
if (who->IsPlayer())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (who->GetEntry() == NPC_HYLDSMEET_DRAKERIDER)
|
if (apply)
|
||||||
|
_accessoryInstalled = true;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_accessoryInstalled = false;
|
||||||
_accessoryRespawnTimer = 5 * MINUTE * IN_MILLISECONDS;
|
_accessoryRespawnTimer = 5 * MINUTE * IN_MILLISECONDS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
{
|
{
|
||||||
//! We need to manually reinstall accessories because the vehicle itself is friendly to players,
|
// 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.
|
// so EnterEvadeMode is never triggered. The accessory on the other hand is hostile and killable.
|
||||||
|
if (_accessoryInstalled)
|
||||||
|
return;
|
||||||
|
|
||||||
Vehicle* vehicleKit = me->GetVehicleKit();
|
Vehicle* vehicleKit = me->GetVehicleKit();
|
||||||
if (!vehicleKit || !_accessoryRespawnTimer)
|
if (!vehicleKit)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_accessoryRespawnTimer <= diff)
|
if (_accessoryRespawnTimer <= diff)
|
||||||
{
|
|
||||||
vehicleKit->InstallAllAccessories(true);
|
vehicleKit->InstallAllAccessories(true);
|
||||||
_accessoryRespawnTimer = 0;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
_accessoryRespawnTimer -= diff;
|
_accessoryRespawnTimer -= diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool _accessoryInstalled;
|
||||||
uint32 _accessoryRespawnTimer;
|
uint32 _accessoryRespawnTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user