diff --git a/data/sql/updates/pending_db_world/rev_1763494864265114240.sql b/data/sql/updates/pending_db_world/rev_1763494864265114240.sql new file mode 100644 index 000000000..aeb330711 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1763494864265114240.sql @@ -0,0 +1,16 @@ +-- +DELETE FROM `waypoint_data` WHERE `id`=125946; + +UPDATE `creature_template_movement` SET `Flight` = 0 WHERE (`CreatureId` = 24083); + +DELETE FROM `creature` WHERE (`id1` = 24083) AND (`guid` IN (1971380)); +INSERT INTO `creature` (`guid`, `id1`, `id2`, `id3`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `Comment`, `VerifiedBuild`) VALUES +(1971380, 24083, 0, 0, 574, 0, 0, 3, 1, 0, 209.1206, -187.86578, 200.00346, 0.677681, 3600, 0, 0, 71856, 0, 0, 0, 0, 0, '', NULL, 0); + +DELETE FROM `vehicle_accessory` WHERE `guid` = 1971380 AND `accessory_entry` = 24849; +INSERT INTO `vehicle_accessory` (`guid`, `accessory_entry`, `seat_id`, `minion`, `description`, `summontype`, `summontimer`) VALUES +(1971380, 24849, 0, 0, 'Proto Drake Rider mounted to Enslaved Proto Drake', 6, 30000); + +DELETE FROM `creature_movement_override` WHERE `SpawnId`=1971380; +INSERT INTO `creature_movement_override` (`SpawnId`, `Ground`, `Swim`, `Flight`, `Rooted`, `Chase`, `Random`, `InteractionPauseTimer`) VALUES +(1971380, 1, 1, 2, 0, 0, 0, NULL); diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp index 09ee36991..1a7cb3030 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp @@ -82,30 +82,33 @@ struct npc_dragonflayer_forge_master : public ScriptedAI enum EnslavedProtoDrake { - TYPE_PROTODRAKE_AT = 28, - DATA_PROTODRAKE_MOVE = 6, - - PATH_PROTODRAKE = 125946, - - EVENT_REND = 1, - EVENT_FLAME_BREATH = 2, - EVENT_KNOCKAWAY = 3, - SPELL_REND = 43931, SPELL_FLAME_BREATH = 50653, SPELL_KNOCK_AWAY = 49722, - POINT_LAST = 6, + EVENT_REND = 1, + EVENT_FLAME_BREATH = 2, + EVENT_KNOCKAWAY = 3, + // Special + EVENT_PRE_LAND = 4, + EVENT_LAND = 5, + + // Special + TYPE_PROTODRAKE_AT = 28, + DATA_PROTODRAKE_MOVE = 6, + POINT_TAKE_OFF = 1, + POINT_PRE_LAND = 2, + POINT_LAND = 3, }; -const Position protodrakeCheckPos = {206.24f, -190.28f, 200.11f, 0.f}; +const Position protodrakeCheckPos{206.24f, -190.28f, 200.11f, 0.f}; +const Position protodrakeTakeOffPos{209.1206f, -187.86578f, 215.00346f}; +const Position protodrakePreLandPos{230.80234f, -164.99632f, 196.74878f}; +const Position protodrakeLandPos{241.2079f, -163.06265f, 193.47125f}; struct npc_enslaved_proto_drake : public ScriptedAI { - npc_enslaved_proto_drake(Creature* creature) : ScriptedAI(creature) - { - _setData = false; - } + explicit npc_enslaved_proto_drake(Creature* creature) : ScriptedAI(creature) { } void Reset() override { @@ -113,22 +116,35 @@ struct npc_enslaved_proto_drake : public ScriptedAI _events.ScheduleEvent(EVENT_REND, 2s, 3s); _events.ScheduleEvent(EVENT_FLAME_BREATH, 5500ms, 7s); _events.ScheduleEvent(EVENT_KNOCKAWAY, 3500ms, 6s); + scheduler.CancelAll(); } void MovementInform(uint32 type, uint32 id) override { - if (type == WAYPOINT_MOTION_TYPE && id == POINT_LAST) + if (type == EFFECT_MOTION_TYPE && id == POINT_TAKE_OFF) { + ScheduleUniqueTimedEvent(500ms, [&] + { + me->GetMotionMaster()->MovePoint(POINT_PRE_LAND, protodrakePreLandPos); + }, EVENT_PRE_LAND); + } + + if (type == POINT_MOTION_TYPE && id == POINT_PRE_LAND) + { + ScheduleUniqueTimedEvent(0s, [&] + { + me->GetMotionMaster()->MovePoint(POINT_LAND, protodrakeLandPos); + }, EVENT_LAND); + } + + if (type == POINT_MOTION_TYPE && id == POINT_LAND) + { + me->SetFacingTo(0.25f); me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.25f); if (Vehicle* v = me->GetVehicleKit()) if (Unit* p = v->GetPassenger(0)) if (Creature* rider = p->ToCreature()) rider->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.25f); - - me->SetCanFly(false); - me->SetDisableGravity(false); - me->SetFacingTo(0.25f); - me->SetImmuneToAll(false); } } @@ -137,14 +153,14 @@ struct npc_enslaved_proto_drake : public ScriptedAI if (type == TYPE_PROTODRAKE_AT && data == DATA_PROTODRAKE_MOVE && !_setData && me->IsAlive() && me->GetDistance(protodrakeCheckPos) < 10.0f) { _setData = true; - me->SetCanFly(true); - me->SetDisableGravity(true); - me->GetMotionMaster()->MoveWaypoint(PATH_PROTODRAKE, false); + me->GetMotionMaster()->MoveTakeoff(POINT_TAKE_OFF, protodrakeTakeOffPos, 8.0f); } } void UpdateAI(uint32 diff) override { + scheduler.Update(diff); + if (!UpdateVictim()) return; @@ -178,7 +194,7 @@ struct npc_enslaved_proto_drake : public ScriptedAI } private: - bool _setData; + bool _setData{false}; EventMap _events; };