diff options
| author | Machiavelli <machiavelli.trinity@gmail.com> | 2011-08-13 22:04:05 +0200 |
|---|---|---|
| committer | Machiavelli <machiavelli.trinity@gmail.com> | 2011-08-13 22:04:05 +0200 |
| commit | 0cb68815ec207e519a442283fa6e901ad3704833 (patch) | |
| tree | 98f48185c31e95d63a4381c0d7df78ac0d3bca7b /src | |
| parent | 30a54e43cac0de35e59f695c8926577c491ec2f8 (diff) | |
Scripts/Storm Peaks: Make Hyldsmeet Drakerider properly respawn.
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Northrend/storm_peaks.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 8ad91fcf1f6..2bd774cdf5b 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -715,6 +715,45 @@ public: } }; +class npc_hyldsmeet_protodrake : public CreatureScript +{ + enum NPCs + { + NPC_HYLDSMEET_DRAKERIDER = 29694 + }; + + public: + npc_hyldsmeet_protodrake() : CreatureScript("npc_hyldsmeet_protodrake") { } + + class npc_hyldsmeet_protodrakeAI : public CreatureAI + { + npc_hyldsmeet_protodrakeAI(Creature* c) : CreatureAI(c), _accessoryRespawnTimer(0), _vehicleKit(NULL) {} + + void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) + { + if (apply) + return; + + if (who->GetEntry() == NPC_HYLDSMEET_DRAKERIDER) + _accessoryRespawnTimer = who->ToCreature()->GetRespawnDelay(); + } + + void Update(uint32 const diff) + { + //! 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); + else + _accessoryRespawnTimer -= diff; + } + + uint32 _accessoryRespawnTimer; + Vehicle* _vehicleKit; + }; + +}; + void AddSC_storm_peaks() { new npc_agnetta_tyrsdottar; @@ -727,4 +766,5 @@ void AddSC_storm_peaks() new npc_roxi_ramrocket; new npc_brunnhildar_prisoner; new npc_icefang; + new npc_hyldsmeet_protodrake; } |
