aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2013_02_15_00_world_waypoint_data.sql20
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp51
2 files changed, 30 insertions, 41 deletions
diff --git a/sql/updates/world/2013_02_15_00_world_waypoint_data.sql b/sql/updates/world/2013_02_15_00_world_waypoint_data.sql
new file mode 100644
index 00000000000..555cbd506e8
--- /dev/null
+++ b/sql/updates/world/2013_02_15_00_world_waypoint_data.sql
@@ -0,0 +1,20 @@
+SET @NPC_DRAKE := 29709;
+
+DELETE FROM `waypoint_data` WHERE `id`=@NPC_DRAKE;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@NPC_DRAKE,1,7294.96,-2418.733,823.869,0,0,0,0,100,0),
+(@NPC_DRAKE,2,7315.984,-2331.46,826.3972,0,0,0,0,100,0),
+(@NPC_DRAKE,3,7271.826,-2271.479,833.5917,0,0,0,0,100,0),
+(@NPC_DRAKE,4,7186.253,-2218.475,847.5632,0,0,0,0,100,0),
+(@NPC_DRAKE,5,7113.195,-2164.288,850.2301,0,0,0,0,100,0),
+(@NPC_DRAKE,6,7078.018,-2063.106,854.7581,0,0,0,0,100,0),
+(@NPC_DRAKE,7,7073.221,-1983.382,861.9246,0,0,0,0,100,0),
+(@NPC_DRAKE,8,7061.455,-1885.899,865.119,0,0,0,0,100,0),
+(@NPC_DRAKE,9,7033.32,-1826.775,876.2578,0,0,0,0,100,0),
+(@NPC_DRAKE,10,6999.902,-1784.012,897.4521,0,0,0,0,100,0),
+(@NPC_DRAKE,11,6954.913,-1747.043,897.4521,0,0,0,0,100,0),
+(@NPC_DRAKE,12,6933.856,-1720.698,882.2022,0,0,0,0,100,0),
+(@NPC_DRAKE,13,6932.729,-1687.306,866.1189,0,0,0,0,100,0),
+(@NPC_DRAKE,14,6952.458,-1663.802,849.8133,0,0,0,0,100,0),
+(@NPC_DRAKE,15,7002.819,-1651.681,831.397,0,0,0,0,100,0),
+(@NPC_DRAKE,16,7026.531,-1649.239,828.8406,0,0,0,0,100,0);
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index dae2ffd36f6..f977e788eee 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -356,6 +356,7 @@ public:
enum FreedProtoDrake
{
+ NPC_DRAKE = 29709,
AREA_VALLEY_OF_ANCIENT_WINTERS = 4437,
TEXT_EMOTE = 0,
SPELL_KILL_CREDIT_PRISONER = 55144,
@@ -363,27 +364,6 @@ enum FreedProtoDrake
SPELL_KILL_CREDIT_DRAKE = 55143
};
-const Position FreedDrakeWaypoints[16] =
-{
- {7294.96f, -2418.733f, 823.869f, 0.0f},
- {7315.984f, -2331.46f, 826.3972f, 0.0f},
- {7271.826f, -2271.479f, 833.5917f, 0.0f},
- {7186.253f, -2218.475f, 847.5632f, 0.0f},
- {7113.195f, -2164.288f, 850.2301f, 0.0f},
- {7078.018f, -2063.106f, 854.7581f, 0.0f},
- {7073.221f, -1983.382f, 861.9246f, 0.0f},
- {7061.455f, -1885.899f, 865.119f, 0.0f},
- {7033.32f, -1826.775f, 876.2578f, 0.0f},
- {6999.902f, -1784.012f, 897.4521f, 0.0f},
- {6954.913f, -1747.043f, 897.4521f, 0.0f},
- {6933.856f, -1720.698f, 882.2022f, 0.0f},
- {6932.729f, -1687.306f, 866.1189f, 0.0f},
- {6952.458f, -1663.802f, 849.8133f, 0.0f},
- {7002.819f, -1651.681f, 831.397f, 0.0f},
- {7026.531f, -1649.239f, 828.8406f, 0.0f}
-};
-
-
class npc_freed_protodrake : public CreatureScript
{
public:
@@ -394,29 +374,20 @@ public:
npc_freed_protodrakeAI(Creature* creature) : VehicleAI(creature) {}
bool autoMove;
- bool wpReached;
uint16 CheckTimer;
- uint16 countWP;
void Reset()
{
autoMove = false;
- wpReached = false;
CheckTimer = 5000;
- countWP = 0;
}
void MovementInform(uint32 type, uint32 id)
{
- if (type != POINT_MOTION_TYPE)
+ if (type != WAYPOINT_MOTION_TYPE)
return;
- if (id < 15)
- {
- ++countWP;
- wpReached = true;
- }
- else
+ if (id == 15)
// drake reached village
{
// get player that rides drake (from seat 0)
@@ -448,20 +419,18 @@ public:
CheckTimer = 5000;
if (me->GetAreaId() == AREA_VALLEY_OF_ANCIENT_WINTERS)
{
- Talk(TEXT_EMOTE, me->GetVehicleKit()->GetPassenger(0)->GetGUID());
- autoMove = true;
- wpReached = true;
+ if (Vehicle* vehicle = me->GetVehicleKit())
+ if (Unit* passenger = vehicle->GetPassenger(0))
+ {
+ Talk(TEXT_EMOTE, passenger->GetGUID());
+ me->GetMotionMaster()->MovePath(NPC_DRAKE, false);
+ autoMove = true;
+ }
}
}
else
CheckTimer -= diff;
}
-
- if (wpReached && autoMove)
- {
- wpReached = false;
- me->GetMotionMaster()->MovePoint(countWP, FreedDrakeWaypoints[countWP]);
- }
}
};