From c5695f5ed7a5a0806fd580d864a60a55d6cb8265 Mon Sep 17 00:00:00 2001 From: thedax Date: Thu, 26 Jun 2025 08:04:13 -0400 Subject: [PATCH] Parially implement Gemstone Traders and Hunt currency exchangers (#67) --- resources/scripts/events/Events.lua | 30 +++++++++++++++++++ .../events/common/GenericGemstoneTrader.lua | 15 ++++++++++ .../common/GenericHuntCurrencyExchange.lua | 9 ++++++ resources/scripts/events/tosort/HuntBoard.lua | 13 ++++++++ 4 files changed, 67 insertions(+) create mode 100644 resources/scripts/events/common/GenericGemstoneTrader.lua create mode 100644 resources/scripts/events/common/GenericHuntCurrencyExchange.lua create mode 100644 resources/scripts/events/tosort/HuntBoard.lua diff --git a/resources/scripts/events/Events.lua b/resources/scripts/events/Events.lua index 6a4a68b..fe28c4a 100644 --- a/resources/scripts/events/Events.lua +++ b/resources/scripts/events/Events.lua @@ -265,6 +265,8 @@ to_sort = { [720898] = "DeliveryMoogle.lua", [721096] = "ToyChest.lua", [721028] = "UnendingJourney.lua", + [721044] = "CrystalBell.lua", + [721098] = "HuntBoard.lua", [721226] = "Orchestrion.lua", [721347] = "GlamourDresser.lua", [721440] = "SummoningBell.lua", @@ -276,6 +278,30 @@ to_sort = { -- Events in /common that aren't already covered by other tables common_events = { [720915] = "GenericMender.lua", + [721480] = "GenericGemstoneTrader.lua", -- Generic Shadowbringers in-city gemstone traders + [721479] = "GenericGemstoneTrader.lua", -- Generic Shadowbringers per-zone gemstone traders + -- [721619] = "GenericGemstoneTrader.lua", -- Generic Endwalker & Dawntrail per-zone gemstone traders, but they do nothing when interacted with right now + -- [721620] = "GenericGemstoneTrader.lua", -- Generic Endwalker & Dawntrail in-city gemstone traders, but they do nothing when interacted with right now +} + +-- Not all Hunt NPCs are spawning right now, unfortunately. +generic_hunt_exchange = { + 1769660, -- Ishgard: Yolaine -> Doman Gear Exchange (DoW, IL 180) + 1769661, -- Ishgard: Yolaine -> Doman Gear Exchange (DoM, IL 180) + 1769715, -- Ishgard: Yolaine -> Artifact Gear Exchange I (DoW, IL 210) + 1769716, -- Ishgard: Yolaine -> Artifact Gear Exchange II (DoW, IL 210) + 1769717, -- Ishgard: Yolaine -> Artifact Gear Exchange (DoM, IL 210) + 1769783, -- Kugane: Satsuya -> Centurio Seal Exchange II + 1769864, -- Kugane: Satsuya -> Ala Mhigan Gear Exchange (DoW, IL 310) + 1769865, -- Kugane: Satsuya -> Ala Mhigan Gear Exchange (DoM, IL 310) + 1769914, -- Kugane: Satsuya -> Lost Allagan Gear (DoW, IL 340) + 1769915, -- Kugane: Satsuya -> Lost Allagan Gear (DoM, IL 340) + 1770476, -- Radz-at-Han: Wilmetta -> Sacks of Nuts Exchange + 1770619, -- Radz-at-Han: Wilmetta -> Moonward Gear Exchange (DoW, IL 570) + 1770620, -- Radz-at-Han: Wilmetta -> Moonward Gear Exchange (DoW, IL 570) + 1770704, -- Radz-at-Han: Wilmetta -> Radiant's Gear (DoW, IL 600) + 1770705, -- Radz-at-Han: Wilmetta -> Radiant's Gear (DoM, IL 600) + 1770761, -- Tuliyollal: Ryubool Ja -> Dawn Hunt Vendor } -- Not custom in the sense of non-SQEX content, just going based off the directory name @@ -317,6 +343,10 @@ for _, event_id in pairs(generic_anetshards) do registerEvent(event_id, "events/common/GenericAethernetShard.lua") end +for _, event_id in pairs(generic_hunt_exchange) do + registerEvent(event_id, "events/common/GenericHuntCurrencyExchange.lua") +end + for event_id, script_file in pairs(to_sort) do registerEvent(event_id, TOSORT_DIR..script_file) end diff --git a/resources/scripts/events/common/GenericGemstoneTrader.lua b/resources/scripts/events/common/GenericGemstoneTrader.lua new file mode 100644 index 0000000..3870be4 --- /dev/null +++ b/resources/scripts/events/common/GenericGemstoneTrader.lua @@ -0,0 +1,15 @@ +-- TODO: actually implement bicolor gemstones, and present a 'shop' menu (it seems to be different than hunt exchange NPCs)? + +--Scene 00000 "Collect bicolor gemstones to trade for a variety of goods" / scene informing the player they can now access the shop +--Scene 00001 softlocks or simply shows a dialog box (depends per vendor), presumably needs shop params sent to it +--Scene 00002 does nothing (for now) +--Scene 00003 "You must progress further through the main scenario in order to access this vendor's wares." + +function onTalk(target, player) + -- "You must progress further through the main scenario in order to access this vendor's wares." + player:play_scene(target, EVENT_ID, 00003, 8192, 0) +end + +function onReturn(scene, results, player) + player:finish_event(EVENT_ID) +end diff --git a/resources/scripts/events/common/GenericHuntCurrencyExchange.lua b/resources/scripts/events/common/GenericHuntCurrencyExchange.lua new file mode 100644 index 0000000..c4494c3 --- /dev/null +++ b/resources/scripts/events/common/GenericHuntCurrencyExchange.lua @@ -0,0 +1,9 @@ +-- TODO: actually implement hunt currency and possible opcodes for doing the transactions + +function onTalk(target, player) + player:play_scene(target, EVENT_ID, 00000, 8192, 0) +end + +function onReturn(scene, results, player) + player:finish_event(EVENT_ID) +end diff --git a/resources/scripts/events/tosort/HuntBoard.lua b/resources/scripts/events/tosort/HuntBoard.lua new file mode 100644 index 0000000..4a34ad4 --- /dev/null +++ b/resources/scripts/events/tosort/HuntBoard.lua @@ -0,0 +1,13 @@ +-- TODO: actually implement this menu + +-- Scene 00000 will just say you can't participate or bug out (in the case of ARR hunt boards), and is also the only scene this actor has + +function onTalk(target, player) + -- In expansion towns, this will display text such as "The Clan Hunt board is covered in bills showing the details of wanted monsters. However, you are unable to accept any of the bills posted at present." + -- In the ARR capitals it will still open an empty buggy hunt bill list. Presumably they work differently and hide the board entirely when you're unable to participate in The Hunt. + player:play_scene(target, EVENT_ID, 00000, 8192, 0) +end + +function onReturn(scene, results, player) + player:finish_event(EVENT_ID) +end