From b28da6e03f92a866ae17ba0315713a941b65d842 Mon Sep 17 00:00:00 2001 From: sogladev Date: Sat, 4 Oct 2025 09:28:14 +0200 Subject: [PATCH] fix(Scripts/Northrend): quest Sniffing out the Perpetrator (#23076) --- .../rev_1759519474819030750.sql | 44 ++++++ .../scripts/Northrend/zone_storm_peaks.cpp | 142 +++++++++--------- 2 files changed, 116 insertions(+), 70 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1759519474819030750.sql diff --git a/data/sql/updates/pending_db_world/rev_1759519474819030750.sql b/data/sql/updates/pending_db_world/rev_1759519474819030750.sql new file mode 100644 index 000000000..371e8f60c --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1759519474819030750.sql @@ -0,0 +1,44 @@ +-- +SET @PATH := 29677; +DELETE FROM `script_waypoint` WHERE `entry`=@PATH; +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`) VALUES +(@PATH, 0, 7157.85, -749.79016, 891.31964, 0), +(@PATH, 1, 7164.398, -764.5809, 892.379, 0), +(@PATH, 2, 7173.0713, -777.02747, 899.1467, 0), +(@PATH, 3, 7182.944, -781.4821, 904.5898, 0), +(@PATH, 4, 7193.046, -787.17285, 910.80505, 0), +(@PATH, 5, 7205.2866, -793.2994, 917.2018, 0), +(@PATH, 6, 7218.268, -802.1098, 921.5436, 0), +(@PATH, 7, 7230.444, -816.3606, 924.7782, 0), +(@PATH, 8, 7232.167, -834.23175, 926.6067, 0), +(@PATH, 9, 7247.4736, -848.1854, 925.8038, 0), +(@PATH, 10, 7263.3325, -875.33746, 925.0643, 0), +(@PATH, 11, 7275.5557, -895.33954, 926.41693, 0), +(@PATH, 12, 7283.677, -922.1367, 922.6736, 0), +(@PATH, 13, 7284.9517, -947.7603, 918.92914, 0), +(@PATH, 14, 7294.8335, -985.7026, 915.495, 0), +(@PATH, 15, 7310.106, -1018.042, 913.71466, 0), +(@PATH, 16, 7321.158, -1040.3647, 912.26416, 0), +(@PATH, 17, 7341.2275, -1082.5309, 905.9852, 0), +(@PATH, 18, 7355.9634, -1127.9506, 907.5246, 0), +(@PATH, 19, 7359.7407, -1156.9366, 910.2179, 0), +(@PATH, 20, 7352.724, -1172.65, 912.25995, 0), +(@PATH, 21, 7340.049, -1188.0729, 914.70184, 0), +(@PATH, 22, 7330.8037, -1201.4724, 915.6217, 0), +(@PATH, 23, 7323.1274, -1228.3346, 909.4873, 0), +(@PATH, 24, 7316.8394, -1268.2141, 902.8047, 0), +(@PATH, 25, 7316.317, -1300.7645, 904.0472, 0), +(@PATH, 26, 7315.278, -1332.3418, 904.6077, 0), +(@PATH, 27, 7313.0195, -1366.2754, 907.04065, 0), +(@PATH, 28, 7312.0806, -1399.7428, 910.6963, 0), +(@PATH, 29, 7312.83, -1434.0999, 912.7638, 0), +(@PATH, 30, 7311.606, -1466.3434, 916.6626, 0), +(@PATH, 31, 7309.7144, -1498.7023, 921.09863, 0), +(@PATH, 32, 7306.8794, -1531.1903, 928.2958, 0), +(@PATH, 33, 7305.797, -1558.9252, 939.31244, 0), +(@PATH, 34, 7305.19, -1566.0189, 940.9037, 0); + +-- set StandState to sitting +DELETE FROM `creature_template_addon` WHERE (`entry` = 29695); +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES +(29695, 0, 0, 1, 0, 0, 0, ''); diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 35fd65e31..d43a29a5e 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -28,88 +28,90 @@ #include "Vehicle.h" #include "WaypointMgr.h" -enum qSniffing +enum qSniffingOutThePerpetrator { + NPC_FROSTHOUND = 29677, SPELL_SUMMON_PURSUERS_PERIODIC = 54993, SPELL_SNIFFING_CREDIT = 55477, + TALK_EMOTE_FROSTHOUND_SNIFF = 0, + TALK_SEEN = 1, + TALK_CONFRONT = 2, + TALK_EMOTE_TRACKED_COMPLETE = 3, }; -class npc_frosthound : public CreatureScript +struct npc_frosthound : public npc_escortAI { -public: - npc_frosthound() : CreatureScript("npc_frosthound") { } + explicit npc_frosthound(Creature* creature) : npc_escortAI(creature), _summons(creature) {} - struct npc_frosthoundAI : public npc_escortAI + void AttackStart(Unit* /*who*/) override {} + void JustEngagedWith(Unit* /*who*/) override {} + void EnterEvadeMode(EvadeReason /* why */) override {} + void JustDied(Unit* /*killer*/) override { } + void OnCharmed(bool /*apply*/) override { } + + void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) override { - npc_frosthoundAI(Creature* creature) : npc_escortAI(creature) {} - - void AttackStart(Unit* /*who*/) override {} - void JustEngagedWith(Unit* /*who*/) override {} - void EnterEvadeMode(EvadeReason /* why */) override {} - - void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) override + if (who->IsPlayer()) { - if (who->IsPlayer()) + if (apply) { - if (apply) - { - me->SetFaction(who->GetFaction()); - me->CastSpell(me, SPELL_SUMMON_PURSUERS_PERIODIC, true); - Start(false, true, who->GetGUID()); - } + me->SetFaction(who->GetFaction()); + me->CastSpell(me, SPELL_SUMMON_PURSUERS_PERIODIC, true); + Start(false, true, who->GetGUID()); + Talk(TALK_EMOTE_FROSTHOUND_SNIFF, me); } } - - void JustDied(Unit* /*killer*/) override - { - } - - void OnCharmed(bool /*apply*/) override - { - } - - void UpdateAI(uint32 diff) override - { - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - } - - void WaypointReached(uint32 waypointId) override - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 0: - me->TextEmote("You've been seen! Use the net and Freezing elixir to keep the dwarves away!", nullptr, true); - break; - case 19: - me->TextEmote("The frosthound has located the thief's hiding place. Confront him!", 0, true); - if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit()) - summoner->ToPlayer()->KilledMonsterCredit(29677); - break; - } - } - - void JustSummoned(Creature* cr) override - { - cr->ToTempSummon()->SetTempSummonType(TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT); - cr->ToTempSummon()->InitStats(20000); - if (urand(0, 1)) - cr->GetMotionMaster()->MoveFollow(me, 0.0f, 0.0f); - else if (cr->AI()) - cr->AI()->AttackStart(me); - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_frosthoundAI(creature); } + + void UpdateAI(uint32 diff) override + { + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + } + + void WaypointReached(uint32 waypointId) override + { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + switch (waypointId) + { + case 0: + Talk(TALK_SEEN, player); + break; + case 34: + Talk(TALK_EMOTE_TRACKED_COMPLETE, me); + Talk(TALK_CONFRONT, player); + if (Unit* summoner = me->ToTempSummon()->GetSummonerUnit()) + summoner->ToPlayer()->KilledMonsterCredit(NPC_FROSTHOUND); + _summons.DespawnAll(); + break; + default: + break; + } + } + + void JustSummoned(Creature* cr) override + { + _summons.Summon(cr); + cr->ToTempSummon()->SetTempSummonType(TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT); + cr->ToTempSummon()->InitStats(20000); + if (urand(0, 1)) + cr->GetMotionMaster()->MoveFollow(me, 0.0f, 0.0f); + else if (cr->AI()) + cr->AI()->AttackStart(me); + } + + void Reset() override + { + _summons.DespawnAll(); + } + +private: + SummonList _summons; }; enum eIronWatcher @@ -1194,7 +1196,7 @@ class spell_feed_stormcrest_eagle : public SpellScript void AddSC_storm_peaks() { - new npc_frosthound(); + RegisterCreatureAI(npc_frosthound); new npc_iron_watcher(); new npc_time_lost_proto_drake(); new npc_wild_wyrm();