diff options
| -rw-r--r-- | sql/updates/world/2011_08_13_02_world_creature_scriptname.sql | 1 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/storm_peaks.cpp | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/sql/updates/world/2011_08_13_02_world_creature_scriptname.sql b/sql/updates/world/2011_08_13_02_world_creature_scriptname.sql new file mode 100644 index 00000000000..c8b85c37f66 --- /dev/null +++ b/sql/updates/world/2011_08_13_02_world_creature_scriptname.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_hyldsmeet_protodrake' WHERE `entry`=29625;
\ No newline at end of file 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; } |
