mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 00:08:01 +00:00
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;
|
||||
});
|
||||
|
||||
// 54933 Hyldnir Harpoon
|
||||
ApplySpellFix({ 54933 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].BasePoints = 1;
|
||||
});
|
||||
|
||||
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
|
||||
{
|
||||
SpellInfo* spellInfo = mSpellInfoMap[i];
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user