aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMachiavelli <machiavelli.trinity@gmail.com>2011-08-18 13:13:30 +0200
committerMachiavelli <machiavelli.trinity@gmail.com>2011-08-18 13:13:30 +0200
commit701649cb3fc78eb1e74d6ae94eaee47c0c743166 (patch)
tree7ac698091eab9aba02c2649293e503891894f05c
parentfdbfa5156c0f4d0b9c8485ad067ddf38e6320192 (diff)
Scripts/Storm Peaks: Fix some (embarassing) errors in npc_hyldsmeet_protodrake (script is working now) and correct seat ID in vehicle_template_accessory.
-rw-r--r--sql/updates/world/2011_08_15_01_world_vehicle_template_accessory.sql1
-rw-r--r--src/server/scripts/Northrend/storm_peaks.cpp47
2 files changed, 29 insertions, 19 deletions
diff --git a/sql/updates/world/2011_08_15_01_world_vehicle_template_accessory.sql b/sql/updates/world/2011_08_15_01_world_vehicle_template_accessory.sql
new file mode 100644
index 00000000000..2659570e464
--- /dev/null
+++ b/sql/updates/world/2011_08_15_01_world_vehicle_template_accessory.sql
@@ -0,0 +1 @@
+UPDATE `vehicle_template_accessory` SET `seat_id`=1, `minion`=1 WHERE `entry`=29625;
diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp
index 690b8015ca6..0fedf101a9c 100644
--- a/src/server/scripts/Northrend/storm_peaks.cpp
+++ b/src/server/scripts/Northrend/storm_peaks.cpp
@@ -727,31 +727,40 @@ 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)
- {
- if (apply)
- return;
+ void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply)
+ {
+ if (apply)
+ return;
- if (who->GetEntry() == NPC_HYLDSMEET_DRAKERIDER)
- _accessoryRespawnTimer = who->ToCreature()->GetRespawnDelay();
- }
+ if (who->GetEntry() == NPC_HYLDSMEET_DRAKERIDER)
+ _accessoryRespawnTimer = 5 * MINUTE * IN_MILLISECONDS;
+ }
- void UpdateAI(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;
- }
+ void UpdateAI(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(true);
+ _accessoryRespawnTimer = 0;
+ }
+ else
+ _accessoryRespawnTimer -= diff;
+ }
- uint32 _accessoryRespawnTimer;
- Vehicle* _vehicleKit;
+ private:
+ uint32 _accessoryRespawnTimer;
+ Vehicle* _vehicleKit;
};
+ CreatureAI* GetAI(Creature* creature) const
+ {
+ return new npc_hyldsmeet_protodrakeAI (creature);
+ }
};
void AddSC_storm_peaks()