Scripts/Storm Peaks: Fix some (embarassing) errors in npc_hyldsmeet_protodrake (script is working now) and correct seat ID in vehicle_template_accessory.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
UPDATE `vehicle_template_accessory` SET `seat_id`=1, `minion`=1 WHERE `entry`=29625;
|
||||
@@ -727,7 +727,8 @@ class npc_hyldsmeet_protodrake : public CreatureScript
|
||||
|
||||
class npc_hyldsmeet_protodrakeAI : public CreatureAI
|
||||
{
|
||||
npc_hyldsmeet_protodrakeAI(Creature* c) : CreatureAI(c), _accessoryRespawnTimer(0), _vehicleKit(NULL) {}
|
||||
public:
|
||||
npc_hyldsmeet_protodrakeAI(Creature* c) : CreatureAI(c), _accessoryRespawnTimer(0), _vehicleKit(c->GetVehicleKit()) {}
|
||||
|
||||
void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply)
|
||||
{
|
||||
@@ -735,7 +736,7 @@ class npc_hyldsmeet_protodrake : public CreatureScript
|
||||
return;
|
||||
|
||||
if (who->GetEntry() == NPC_HYLDSMEET_DRAKERIDER)
|
||||
_accessoryRespawnTimer = who->ToCreature()->GetRespawnDelay();
|
||||
_accessoryRespawnTimer = 5 * MINUTE * IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
@@ -743,15 +744,23 @@ class npc_hyldsmeet_protodrake : public CreatureScript
|
||||
//! 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 (_accessoryRespawnTimer && _accessoryRespawnTimer <= diff && _vehicleKit)
|
||||
_vehicleKit->InstallAllAccessories(false);
|
||||
{
|
||||
_vehicleKit->InstallAllAccessories(true);
|
||||
_accessoryRespawnTimer = 0;
|
||||
}
|
||||
else
|
||||
_accessoryRespawnTimer -= diff;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _accessoryRespawnTimer;
|
||||
Vehicle* _vehicleKit;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_hyldsmeet_protodrakeAI (creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_storm_peaks()
|
||||
|
||||
Reference in New Issue
Block a user