diff --git a/sql/custom/world/2026_11_16_04_world_classic_scripted_npc_texts.sql b/sql/custom/world/2026_11_16_04_world_classic_scripted_npc_texts.sql new file mode 100644 index 0000000000..bec521cf32 --- /dev/null +++ b/sql/custom/world/2026_11_16_04_world_classic_scripted_npc_texts.sql @@ -0,0 +1,12 @@ +-- Gossip texts of two Classic scripted NPCs, each under an id of its own (the id of the creature's gossip menu, 91000000 + entry, +-- as in 2026_11_12_22, and the next one). Texts are the client's BroadcastText ids of the Classic npc_text rows. Safe to run again. +-- 16365 Master Craftsman Omarion, pattern page: "Perhaps I can teach you something..." (12258). His script sent Classic's +-- npc_text 8508, which in this world is another NPC's line ("I'm sure that help from Farstrider Enclave will be here soon..."). +-- 14338 Knot Thimblejack: "Please, please, please tell me you are here to get me out of these shackles..." (9220) and, after +-- "Why should I bother fixing the trap?", "Well, from what I've gathered while waiting to be eaten by these yokels..." (9369). +-- His script sent Classic's 6795 / 6883, which are not in this world: right-clicking him opened nothing at all. +DELETE FROM `npc_text` WHERE `ID` IN (91016365, 91014338, 91014339); +INSERT INTO `npc_text` (`ID`,`Probability0`,`Probability1`,`Probability2`,`Probability3`,`Probability4`,`Probability5`,`Probability6`,`Probability7`,`BroadcastTextID0`,`BroadcastTextID1`,`BroadcastTextID2`,`BroadcastTextID3`,`BroadcastTextID4`,`BroadcastTextID5`,`BroadcastTextID6`,`BroadcastTextID7`,`VerifiedBuild`) VALUES +(91016365,1,0,0,0,0,0,0,0,12258,0,0,0,0,0,0,0,0), +(91014338,1,0,0,0,0,0,0,0,9220,0,0,0,0,0,0,0,0), +(91014339,1,0,0,0,0,0,0,0,9369,0,0,0,0,0,0,0,0); diff --git a/src/server/scripts/Custom/Classic/instances/dire_maul/classic_instance_dire_maul.cpp b/src/server/scripts/Custom/Classic/instances/dire_maul/classic_instance_dire_maul.cpp index d3a6b9cc24..34898024d2 100644 --- a/src/server/scripts/Custom/Classic/instances/dire_maul/classic_instance_dire_maul.cpp +++ b/src/server/scripts/Custom/Classic/instances/dire_maul/classic_instance_dire_maul.cpp @@ -1011,8 +1011,10 @@ enum ClassicDMKnotThimblejack QUEST_FREE_KNOT = 5525, QUEST_FREE_KNOT_REPEATABLE = 7429, - GOSSIP_MENU_1 = 6795, // npc_text - GOSSIP_MENU_2 = 6883, // npc_text + // npc_text of his own (2026_11_16_04_world_classic_scripted_npc_texts.sql): Classic's 6795 / 6883 are not in this world, + // and a gossip with a missing text never opened on the client, so right-clicking him did nothing at all (chris 11-16). + GOSSIP_MENU_1 = 91014338, // "Please, please, please tell me you are here to get me out of these shackles..." (9220) + GOSSIP_MENU_2 = 91014339, // "Well, from what I've gathered while waiting to be eaten by these yokels..." (9369) GO_KNOTS_BALL_AND_CHAIN = 179511 }; @@ -1100,7 +1102,6 @@ struct classic_npc_knot_thimblejack : public ScriptedAI AddGossipItemFor(player, GossipOptionNpc::None, GOSSIP_ITEM_KNOT_OGRE_SUIT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); } - // TODO(classic): npc_text 6795 / 6883 must exist in the TC world DB (VMaNGOS npc_text ids) SendGossipMenuFor(player, GOSSIP_MENU_1, me->GetGUID()); return true; } diff --git a/src/server/scripts/Custom/Classic/instances/naxxramas/classic_instance_naxxramas.cpp b/src/server/scripts/Custom/Classic/instances/naxxramas/classic_instance_naxxramas.cpp index 03c605b99f..af3fb10fd5 100644 --- a/src/server/scripts/Custom/Classic/instances/naxxramas/classic_instance_naxxramas.cpp +++ b/src/server/scripts/Custom/Classic/instances/naxxramas/classic_instance_naxxramas.cpp @@ -1990,7 +1990,10 @@ enum OmarionMisc BC_CLOSE_CRAFTER = 12270, // I need to go. Evil stirs. Die well, Omarion. GOSSIP_MENU_INTRO = 8507, - GOSSIP_MENU_CRAFTER = 8508, + // "Perhaps I can teach you something..." (BroadcastText 12258). Classic's npc_text 8508 is another NPC's line in this world + // (chris 11-16: "I'm sure that help from Farstrider Enclave will be here soon..."), so the text has an id of its own + // (2026_11_16_04_world_classic_scripted_npc_texts.sql). + GOSSIP_MENU_CRAFTER = 91016365, GOSSIP_MENU_NOCRAFT = 8516, GOSSIP_OPT_NOT_CRAFTSMAN = 1, @@ -2061,6 +2064,44 @@ void LearnCraftIfCan(uint32 learnId, uint32 knowId, Player* pPlayer, ReputationR struct classic_mob_craftsman_omarion : public ScriptedAI { + struct Pattern { uint32 action; char const* name; uint32 knowId; bool exalted; }; + + // The patterns of one profession (sender GOSSIP_SELECT_TAILOR / _BS / _LW), each with the recipe spell it teaches. + static std::vector const& PatternsOf(uint32 profession) + { + static std::vector const tailor = { + { GOSSIP_SELECT_GLACIAL_GLOVES, "Glacial Gloves", 28205, false }, { GOSSIP_SELECT_GLACIAL_WRISTS, "Glacial Wrists", 28209, false }, + { GOSSIP_SELECT_GLACIAL_CHEST, "Glacial Vest", 28207, true }, { GOSSIP_SELECT_GLACIAL_CLOAK, "Glacial Cloak", 28208, true } }; + static std::vector const smith = { + { GOSSIP_SELECT_ICEBANE_GLOVES, "Icebane Gauntlets", 28243, false }, { GOSSIP_SELECT_ICEBANE_WRISTS, "Icebane Bracers", 28244, false }, + { GOSSIP_SELECT_ICEBANE_CHEST, "Icebane Breastplate", 28242, true } }; + static std::vector const leather = { + { GOSSIP_SELECT_POLAR_GLOVES, "Polar Gloves", 28220, false }, { GOSSIP_SELECT_ICYSCALE_GLOVES, "Icy Scale Gauntlets", 28223, false }, + { GOSSIP_SELECT_POLAR_WRISTS, "Polar Bracers", 28221, false }, { GOSSIP_SELECT_ICYSCALE_WRISTS, "Icy Scale Bracers", 28224, false }, + { GOSSIP_SELECT_POLAR_CHEST, "Polar Tunic", 28219, true }, { GOSSIP_SELECT_ICYSCALE_CHEST, "Icy Scale Breastplate", 28222, true } }; + static std::vector const none; + switch (profession) + { + case GOSSIP_SELECT_TAILOR: return tailor; + case GOSSIP_SELECT_BS: return smith; + case GOSSIP_SELECT_LW: return leather; + default: return none; + } + } + + // One profession's page: every pattern the player's reputation allows and that they do not know yet, then "I need to go". + // Each line checks its own recipe, so learning one leaves the others on the page (chris 11-16: after Glacial Gloves the + // page held only "I need to go"). + void SendPatternPage(Player* player, uint32 profession) + { + ReputationRank const rep = player->GetReputationRank(FACTION_ID_ARGENT_DAWN_NAXX); + for (Pattern const& p : PatternsOf(profession)) + if (rep >= (p.exalted ? REP_EXALTED : REP_REVERED) && !player->HasSpell(p.knowId)) + ClassicNaxxAddGossip(player, p.name, profession, p.action); + ClassicNaxxAddGossip(player, BC_CLOSE_CRAFTER, profession, GOSSIP_CLOSE); + SendGossipMenuFor(player, GOSSIP_MENU_CRAFTER, me->GetGUID()); + } + classic_mob_craftsman_omarion(Creature* creature) : ScriptedAI(creature) { } bool OnGossipHello(Player* pPlayer) override @@ -2082,7 +2123,6 @@ struct classic_mob_craftsman_omarion : public ScriptedAI ClassicNaxxAddGossip(pPlayer, BC_NO_CRAFT_TEXT, GOSSIP_SENDER_MAIN, GOSSIP_SELECT_NOCRAFT); - // TODO(classic): npc_text 8507 / 8508 / 8516 must exist in the TC world DB (VMaNGOS npc_text ids) SendGossipMenuFor(pPlayer, GOSSIP_MENU_INTRO, me->GetGUID()); me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); return true; @@ -2120,46 +2160,9 @@ struct classic_mob_craftsman_omarion : public ScriptedAI switch (uiAction) { case GOSSIP_SELECT_TAILOR: - if (argentDawnRep >= CRACT1_REQ_RANK) - { - ClassicNaxxAddGossip(pPlayer, "Glacial Gloves", GOSSIP_SELECT_TAILOR, GOSSIP_SELECT_GLACIAL_GLOVES); - ClassicNaxxAddGossip(pPlayer, "Glacial Wrists", GOSSIP_SELECT_TAILOR, GOSSIP_SELECT_GLACIAL_WRISTS); - } - if (argentDawnRep >= CRAFT2_REQ_RANK) - { - ClassicNaxxAddGossip(pPlayer, "Glacial Vest", GOSSIP_SELECT_TAILOR, GOSSIP_SELECT_GLACIAL_CHEST); - ClassicNaxxAddGossip(pPlayer, "Glacial Cloak", GOSSIP_SELECT_TAILOR, GOSSIP_SELECT_GLACIAL_CLOAK); - } - ClassicNaxxAddGossip(pPlayer, BC_CLOSE_CRAFTER, GOSSIP_SELECT_TAILOR, GOSSIP_CLOSE); - SendGossipMenuFor(pPlayer, GOSSIP_MENU_CRAFTER, me->GetGUID()); - return true; case GOSSIP_SELECT_BS: - if (argentDawnRep >= CRACT1_REQ_RANK) - { - ClassicNaxxAddGossip(pPlayer, "Icebane Gauntlets", GOSSIP_SELECT_BS, GOSSIP_SELECT_ICEBANE_GLOVES); - ClassicNaxxAddGossip(pPlayer, "Icebane Bracers", GOSSIP_SELECT_BS, GOSSIP_SELECT_ICEBANE_WRISTS); - } - if (argentDawnRep >= CRAFT2_REQ_RANK) - ClassicNaxxAddGossip(pPlayer, "Icebane Breastplate", GOSSIP_SELECT_BS, GOSSIP_SELECT_ICEBANE_CHEST); - ClassicNaxxAddGossip(pPlayer, BC_CLOSE_CRAFTER, GOSSIP_SELECT_BS, GOSSIP_CLOSE); - SendGossipMenuFor(pPlayer, GOSSIP_MENU_CRAFTER, me->GetGUID()); - return true; case GOSSIP_SELECT_LW: - if (argentDawnRep >= CRACT1_REQ_RANK) - { - ClassicNaxxAddGossip(pPlayer, "Polar Gloves", GOSSIP_SELECT_LW, GOSSIP_SELECT_POLAR_GLOVES); - ClassicNaxxAddGossip(pPlayer, "Icy Scale Gauntlets", GOSSIP_SELECT_LW, GOSSIP_SELECT_ICYSCALE_GLOVES); - - ClassicNaxxAddGossip(pPlayer, "Polar Bracers", GOSSIP_SELECT_LW, GOSSIP_SELECT_POLAR_WRISTS); - ClassicNaxxAddGossip(pPlayer, "Icy Scale Bracers", GOSSIP_SELECT_LW, GOSSIP_SELECT_ICYSCALE_WRISTS); - } - if (argentDawnRep >= CRAFT2_REQ_RANK) - { - ClassicNaxxAddGossip(pPlayer, "Polar Tunic", GOSSIP_SELECT_LW, GOSSIP_SELECT_POLAR_CHEST); - ClassicNaxxAddGossip(pPlayer, "Icy Scale Breastplate", GOSSIP_SELECT_LW, GOSSIP_SELECT_ICYSCALE_CHEST); - } - ClassicNaxxAddGossip(pPlayer, BC_CLOSE_CRAFTER, GOSSIP_SELECT_LW, GOSSIP_CLOSE); - SendGossipMenuFor(pPlayer, GOSSIP_MENU_CRAFTER, me->GetGUID()); + SendPatternPage(pPlayer, uiAction); return true; case GOSSIP_SELECT_NOCRAFT: { @@ -2221,8 +2224,8 @@ struct classic_mob_craftsman_omarion : public ScriptedAI break; } - ClassicNaxxAddGossip(pPlayer, BC_CLOSE_CRAFTER, uiSender, GOSSIP_CLOSE); - SendGossipMenuFor(pPlayer, GOSSIP_MENU_CRAFTER, me->GetGUID()); + // Back to the same profession's page, with the pattern just learned gone from it. + SendPatternPage(pPlayer, uiSender); return true; } }; diff --git a/src/server/scripts/World/npc_professions.cpp b/src/server/scripts/World/npc_professions.cpp index 8ade0d78b5..b1ca0f1961 100644 --- a/src/server/scripts/World/npc_professions.cpp +++ b/src/server/scripts/World/npc_professions.cpp @@ -100,13 +100,16 @@ public: // the profession's own line (202), so that is the line the 260 requirement reads. switch (me->GetEntry()) { + // Zap's and Jhordy's texts are the ones of their own gossip menus (6092: 7249, and 7254 once the device is + // known; 6094: 7251 and 7253). The old ids were wrong for this world: 6092 is a menu id, and as a text it is + // the spirit healer's line ("It is not yet your time..."); 7252 does not exist. case NPC_ZAP: - canLearn = CanLearn(player, 6092, 0, SKILL_ENGINEERING, 260, S_GOBLIN, SPELL_TO_EVERLOOK, npcTextId); + canLearn = CanLearn(player, 7249, 7254, SKILL_ENGINEERING, 260, S_GOBLIN, SPELL_TO_EVERLOOK, npcTextId); if (canLearn) gossipItem = GOSSIP_ZAP; break; case NPC_JHORDY: - canLearn = CanLearn(player, 7251, 7252, SKILL_ENGINEERING, 260, S_GNOMISH, SPELL_TO_GADGET, npcTextId); + canLearn = CanLearn(player, 7251, 7253, SKILL_ENGINEERING, 260, S_GNOMISH, SPELL_TO_GADGET, npcTextId); if (canLearn) gossipItem = GOSSIP_JHORDY; break; @@ -125,8 +128,11 @@ public: } } + // The learn line is option 0 of the menu on Zap and Jhordy (the only one their menus have here; asking for option 2 + // found nothing, so no engineer ever saw it) and option 2 on the Outland pair. if (canLearn) - AddGossipItemFor(player, gossipItem, 2, me->GetEntry(), GOSSIP_ACTION_INFO_DEF + 1); + AddGossipItemFor(player, gossipItem, (gossipItem == GOSSIP_ZAP || gossipItem == GOSSIP_JHORDY) ? 0 : 2, me->GetEntry(), + GOSSIP_ACTION_INFO_DEF + 1); SendGossipMenuFor(player, npcTextId ? npcTextId : player->GetGossipTextId(me), me->GetGUID()); return true; @@ -157,7 +163,9 @@ public: break; } - return false; + // The option itself points at another menu (6093 / 6095); the device is learned, so the window closes here. + CloseGossipMenuFor(player); + return true; } };