From df5d618130c91033dfcee8bf99906c564755d060 Mon Sep 17 00:00:00 2001 From: pedrohfm9 <122452427+Dr-Arayashiki@users.noreply.github.com> Date: Sun, 3 Dec 2023 13:11:28 -0300 Subject: [PATCH] fix(Script/Stormpeaks) fix quest 12862 and 13060 When All Else Fails (#17916) * fix(DB/Creature): Grunda Bronzewing is now mounted Grunda Bronzewing is now mounted * Update Fix-Grunda Bronzewing in Honor Hold is not riding on a golden gryphon.sql Grunda Bronzewing is now mounted * Rename Fix-Grunda Bronzewing in Honor Hold is not riding on a golden gryphon.sql to Fix-Grunda.sql Grunda Bronzewing is now mounted * Delete Fix-Grunda.sql * Create fix_quest_12862_13060.sql * Update zone_storm_peaks.cpp * Update zone_storm_peaks.cpp * Update zone_storm_peaks.cpp * Update zone_storm_peaks.cpp * Update zone_storm_peaks.cpp * clean up redundancy * Update fix_quest_12862_13060.sql * Update zone_storm_peaks.cpp * Update src/server/scripts/Northrend/zone_storm_peaks.cpp * Update zone_storm_peaks.cpp * fix_quest_12862_13060.sql * delay spell cast by 1 sec * Update zone_storm_peaks.cpp --------- Co-authored-by: Skjalf <47818697+Nyeriah@users.noreply.github.com> --- .../fix_quest_12862_13060.sql | 64 ++++++++++ .../scripts/Northrend/zone_storm_peaks.cpp | 111 ++++++++++++++++++ 2 files changed, 175 insertions(+) create mode 100644 data/sql/updates/pending_db_world/fix_quest_12862_13060.sql diff --git a/data/sql/updates/pending_db_world/fix_quest_12862_13060.sql b/data/sql/updates/pending_db_world/fix_quest_12862_13060.sql new file mode 100644 index 000000000..d7a6612eb --- /dev/null +++ b/data/sql/updates/pending_db_world/fix_quest_12862_13060.sql @@ -0,0 +1,64 @@ +-- D16 Horde remove SAI +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 30477); +-- D16 Horde remove Timed Actionlists +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 3047700) AND (`source_type` = 9); +-- D16 Aliance remove SAI +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 30487); +-- D16 Aliance remove Timed Actionlists +DELETE FROM `smart_scripts` WHERE (`entryorguid` = 3048700) AND (`source_type` = 9); +-- Update D16 creature ScriptName +UPDATE `creature_template` SET `AIName`="", `ScriptName` = 'npc_vehicle_d16_propelled_delivery' WHERE `entry` IN (30477, 30487); +-- Plane Aliance k3 +SET @PATH := 30477 * 100; +DELETE FROM `waypoint_data` WHERE `id` IN (30477*100, 30487*100); +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, 6165, -1064.51, 422.119, NULL, 0, 0, 0, 100, 0), +(@PATH, 2, 6204.1, -998.487, 457.563, NULL, 0, 0, 0, 100, 0), +(@PATH, 3, 6289.57, -952.181, 504.619, NULL, 0, 0, 0, 100, 0), +(@PATH, 4, 6307.79, -872.8, 541.73, NULL, 0, 0, 0, 100, 0), +(@PATH, 5, 6370.58, -821.951, 653.868, NULL, 0, 0, 0, 100, 0), +(@PATH, 6, 6413.27, -660.471, 808.395, NULL, 0, 0, 0, 100, 0), +(@PATH, 7, 6554.81, -550.377, 1018.11, NULL, 0, 0, 0, 100, 0), +(@PATH, 8, 6633.27, -419.316, 1173.91, NULL, 0, 0, 0, 100, 0), +(@PATH, 9, 6760.5, -364.466, 1277.72, NULL, 0, 0, 0, 100, 0), +(@PATH, 10, 6807.88, -427.519, 1399.11, NULL, 0, 0, 0, 100, 0), +(@PATH, 11, 6808.07, -471.447, 1419.25, NULL, 0, 0, 0, 100, 0), +(@PATH, 12, 6775.63, -529.231, 1394.39, NULL, 0, 0, 0, 100, 0), +(@PATH, 13, 6720.65, -535.553, 1328.05, NULL, 0, 0, 0, 100, 0), +(@PATH, 14, 6660.31, -486.865, 1238.55, NULL, 0, 0, 0, 100, 0), +(@PATH, 15, 6658.94, -417.841, 1186.11, NULL, 0, 0, 0, 100, 0), +(@PATH, 16, 6680.49, -329.309, 1098.61, NULL, 0, 0, 0, 100, 0), +(@PATH, 17, 6683.78, -220.345, 972.72, NULL, 0, 0, 0, 100, 0), +(@PATH, 18, 6663.77, -192.126, 962.248, NULL, 0, 0, 0, 100, 0), +(@PATH, 19, 6654.82, -180.169, 958.132, NULL, 0, 0, 0, 100, 0), +(@PATH, 20, 6631.47, -171.331, 966.463, NULL, 0, 0, 0, 100, 0), +(@PATH, 21, 6598.22, -162.366, 984.223, NULL, 0, 0, 0, 100, 0), +(@PATH, 22, 6566.67, -155.208, 992.055, NULL, 0, 0, 0, 100, 0), +(@PATH, 23, 6529.65, -154.936, 992.055, NULL, 0, 0, 0, 100, 0), +(@PATH, 24, 6454.42, -152.131, 962.305, NULL, 0, 0, 0, 100, 0); +-- Plane Horde k3 + +SET @PATH := 30487 * 100; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, 6169.23, -1069.62, 420.694, NULL, 0, 0, 0, 100, 0), +(@PATH, 2, 6232.73, -1031.6, 505.778, NULL, 0, 0, 0, 100, 0), +(@PATH, 3, 6339.22, -1035.08, 575.333, NULL, 0, 0, 0, 100, 0), +(@PATH, 4, 6431.49, -987.674, 694.889, NULL, 0, 0, 0, 100, 0), +(@PATH, 5, 6632.44, -925.974, 896.138, NULL, 0, 0, 0, 100, 0), +(@PATH, 6, 6822.08, -755.521, 1171.19, NULL, 0, 0, 0, 100, 0), +(@PATH, 7, 7090.69, -619.487, 1455.64, NULL, 0, 0, 0, 100, 0), +(@PATH, 8, 7260.75, -282.75, 1513.36, NULL, 0, 0, 0, 100, 0), +(@PATH, 9, 7552.5, -334.651, 1657.67, NULL, 0, 0, 0, 100, 0), +(@PATH, 10, 7692.3, -509.425, 1536.5, NULL, 0, 0, 0, 100, 0), +(@PATH, 11, 7799.19, -636.327, 1252.28, NULL, 0, 0, 0, 100, 0), +(@PATH, 12, 7841.56, -726.55, 1193.92, NULL, 0, 0, 0, 100, 0), +(@PATH, 13, 7844.73, -775.361, 1185.83, NULL, 0, 0, 0, 100, 0), +(@PATH, 14, 7842.45, -815.573, 1186.4, NULL, 0, 0, 0, 100, 0), +(@PATH, 15, 7838.7, -859.957, 1173.17, NULL, 0, 0, 0, 100, 0), +(@PATH, 16, 7865.01, -911.218, 1163.98, NULL, 0, 0, 0, 100, 0), +(@PATH, 17, 7856.23, -951.657, 1151.56, NULL, 0, 0, 0, 100, 0); +-- conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9917; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9917,0,0,28,12862,0,0,0,'','Ricket - Show gossip option only if player has completed but not rewarded quest When All Else Fails'), +(15,9917,1,0,28,13060,0,0,0,'','Ricket - Show gossip option only if player has completed but not rewarded quest When All Else Fails'); diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 9ef54c165..b3120af21 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -1089,6 +1089,116 @@ class spell_q12823_remove_collapsing_cave_aura : public SpellScript } }; +//Generic Fix for Quest WhenAllElseFails ID: 12862 +enum WhenAllElseFailsAlliance +{ + // Creature + NPC_PROPELLED_DEVICE_1 = 30477, + NPC_PROPELLED_DEVICE_2 = 30487, + + // Spell + SPELL_EJECT_PLAYER = 68576, + SPELL_KNOCKBACK_PLAYER = 42895 +}; + +class npc_vehicle_d16_propelled_delivery : public CreatureScript +{ +public: + npc_vehicle_d16_propelled_delivery() : CreatureScript("npc_vehicle_d16_propelled_delivery") { } + + struct npc_vehicle_d16_propelled_deliveryAI : public VehicleAI + { + npc_vehicle_d16_propelled_deliveryAI(Creature* creature) : VehicleAI(creature) { } + + void PassengerBoarded(Unit* /*who*/, int8 /*seatId*/, bool apply) override + { + if (apply) + { + Movement::PointsArray pathPoints; + pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ())); + WaypointPath const* i_path = sWaypointMgr->GetPath(me->GetEntry() * 100); + for (uint8 i = 0; i < i_path->size(); ++i) + { + WaypointData const* node = i_path->at(i); + pathPoints.push_back(G3D::Vector3(node->x, node->y, node->z)); + } + me->GetMotionMaster()->MoveSplinePath(&pathPoints); + me->SetCanFly(true); + me->SetDisableGravity(true); + me->SetSpeed(MOVE_RUN, 6.0f); + me->SetSpeedRate(MOVE_FLIGHT, 8.0f); + me->setActive(true); + } + } + + void MovementInform(uint32 type, uint32 id) override + { + if (type != ESCORT_MOTION_TYPE) + return; + + switch (id) + { + case 12: + if (me->GetEntry() == NPC_PROPELLED_DEVICE_2) + { + if (Vehicle* vehicle = me->GetVehicleKit()) + { + if (Unit* player = vehicle->GetPassenger(0)) + { + if (player->GetTypeId() == TYPEID_PLAYER) + { + player->m_Events.AddEventAtOffset([player]() + { + player->CastSpell(player, SPELL_KNOCKBACK_PLAYER, true); + }, 1s); + } + } + } + + DoCastSelf(SPELL_EJECT_PLAYER); + } + break; + case 17: + if (me->GetEntry() == NPC_PROPELLED_DEVICE_1) + { + if (Vehicle* vehicle = me->GetVehicleKit()) + { + if (Unit* player = vehicle->GetPassenger(0)) + { + if (player->GetTypeId() == TYPEID_PLAYER) + { + player->m_Events.AddEventAtOffset([player]() + { + player->CastSpell(player, SPELL_KNOCKBACK_PLAYER, true); + }, 1s); + } + } + } + + DoCastSelf(SPELL_EJECT_PLAYER); + } + else + { + me->DespawnOrUnsummon(100); + } + break; + case 24: + if (me->GetEntry() == NPC_PROPELLED_DEVICE_1) + { + me->DespawnOrUnsummon(100); + } + break; + default: + break; + } + } + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_vehicle_d16_propelled_deliveryAI(creature); + } +}; void AddSC_storm_peaks() { new npc_frosthound(); @@ -1103,6 +1213,7 @@ void AddSC_storm_peaks() new npc_icefang(); new npc_hyldsmeet_protodrake(); new spell_close_rift(); + new npc_vehicle_d16_propelled_delivery(); RegisterSpellScript(spell_q12823_remove_collapsing_cave_aura); }