From efb2e36573838cea0b5881e582e2d0a47bc92b7e Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 16 Jan 2025 20:03:58 +0000 Subject: [PATCH] Lua: Update Orchestrion and Music IDs --- documentation/MusicIDs.txt | 30 +++---- scripts/enum/key_item.lua | 14 ++++ scripts/globals/symphonic_curator.lua | 85 +++++++++++++++----- scripts/items/patio_design_plan_document.lua | 6 +- scripts/items/sheet_of_divine_tunes.lua | 20 +++++ scripts/items/sheet_of_near_east_tunes.lua | 20 +++++ sql/item_basic.sql | 4 + sql/item_usable.sql | 4 + 8 files changed, 146 insertions(+), 37 deletions(-) create mode 100644 scripts/items/sheet_of_divine_tunes.lua create mode 100644 scripts/items/sheet_of_near_east_tunes.lua diff --git a/documentation/MusicIDs.txt b/documentation/MusicIDs.txt index a55fdaa41ff..41e7086db66 100644 --- a/documentation/MusicIDs.txt +++ b/documentation/MusicIDs.txt @@ -25,20 +25,20 @@ 22 Unused ID Unused ID 23 Unused ID Unused ID 24 Unused ID Unused ID - 25 Unused ID Unused ID - 26 Unused ID Unused ID - 27 Unused ID Unused ID - 28 Unused ID Unused ID - 29 Unused ID Unused ID - 30 Unused ID Unused ID - 31 Unused ID Unused ID - 32 Unused ID Unused ID - 33 Unused ID Unused ID - 34 Unused ID Unused ID - 35 Unused ID Unused ID - 36 Unused ID Unused ID - 37 Unused ID Unused ID - 38 Unused ID Unused ID + 25 ??? + 26 ??? + 27 ??? + 28 The Destiny Destroyers TVR + 29 ??? + 30 ??? + 31 ??? + 32 ??? + 33 ??? + 34 ??? (New title screen?) + 35 ??? + 36 ??? + 37 ??? + 38 ??? 39 Unused ID Unused ID 40 Cloister of Time and Souls CS 41 Royal Wanderlust Cait Sith Theme @@ -168,7 +168,7 @@ 165 Galka Character Creation - Galka 166 Mithra Character Creation - Mithra 167 Tarutaru Male Character Creation - Taru Male - 168 Tarutaru Female Character Creation - Hume Female + 168 Hume Female Character Creation - Hume Female 169 Regeneracy CS 170 Buccaneers Pirate Attacks 171 Altepa Desert Eastern/Western Altepa Desert diff --git a/scripts/enum/key_item.lua b/scripts/enum/key_item.lua index d9b4dae7a4c..e20fb9e43d7 100644 --- a/scripts/enum/key_item.lua +++ b/scripts/enum/key_item.lua @@ -3219,6 +3219,20 @@ xi.keyItem = SHEET_OF_CHOCOBO_TUNES = 3344, MOG_KUPON_W_ETH = 3345, MOG_KUPON_I_ABY = 3346, + MOG_KUPON_A_DIA = 3347, + MOG_KUPON_A_EME = 3348, + WING_OF_WAR = 3349, + SHEET_OF_NEAR_EAST_TUNES = 3350, + MOG_KUPON_A_AEV = 3351, + MOG_KUPON_A_AHM = 3352, + MOG_KUPON_A_ATT = 3353, + MOG_KUPON_A_AMR = 3354, + MOG_KUPON_A_AGK = 3355, + ORB_OF_RADIANCE_PHANTOM_GEM = 3356, + RAKAZNAR_PLATE_FRAGMENT = 3357, + -- NULL ENTRY = 3358, + -- NULL ENTRY = 3359, + SHEET_OF_DIVINE_TUNES = 3360, } ---@alias xi.ki xi.keyItem diff --git a/scripts/globals/symphonic_curator.lua b/scripts/globals/symphonic_curator.lua index 324a74aa38c..68eb090e84f 100644 --- a/scripts/globals/symphonic_curator.lua +++ b/scripts/globals/symphonic_curator.lua @@ -3,11 +3,11 @@ ----------------------------------- require('scripts/globals/utils') ----------------------------------- --- NOTE: You can force the Symphonic Curator to appear --- by using !cs 30034 and exiting the menu ------------------------------------ - -- See documentation/songdata.txt for extracted table of data. +-- NOTE: You can force the Symphonic Curator menu by swapping the moogle global calls for +-- : Moogle in a MH zone with the symphonic_curator global calls and interacting +-- : with the MH moogle. +----------------------------------- xi = xi or {} xi.symphonic_curator = xi.symphonic_curator or {} @@ -18,32 +18,46 @@ xi.symphonic_curator.onTrigger = function(player, npc) player:setLocalVar('Symphonic_Curator_Music', 126) end + local completedROVMissions = false + -- All music type 6 (Moghouse) local songPacks = 0 -- Default: Mog House (126), Vana'diel March (108) songPacks = utils.mask.setBit(songPacks, 0, 1) + -- First Page songPacks = utils.mask.setBit(songPacks, 1, player:hasKeyItem(xi.ki.SHEET_OF_SAN_DORIAN_TUNES)) -- The Kingdom of San d'Oria (107), Chateau d'Oraguille (156), Ronfaure (109) songPacks = utils.mask.setBit(songPacks, 2, player:hasKeyItem(xi.ki.SHEET_OF_BASTOKAN_TUNES)) -- The Republic of Bastok (152), Metalworks (154), Gustaberg (116) songPacks = utils.mask.setBit(songPacks, 3, player:hasKeyItem(xi.ki.SHEET_OF_WINDURSTIAN_TUNES)) -- The Federation of Windurst (151), Heavens Tower (162), Sarutabaruta (113) songPacks = utils.mask.setBit(songPacks, 4, player:hasKeyItem(xi.ki.SHEET_OF_E_ADOULINIAN_TUNES)) -- The Sacred City of Adoulin (63) songPacks = utils.mask.setBit(songPacks, 5, player:hasKeyItem(xi.ki.SHEET_OF_W_ADOULINIAN_TUNES)) -- The Pioneers (59) songPacks = utils.mask.setBit(songPacks, 6, player:hasKeyItem(xi.ki.SHEET_OF_ZILART_TUNES)) -- Kazham (135), The Sanctuary of Zi'Tah (190), Tu'Lia (210) + + -- Next page + songPacks = utils.mask.setBit(songPacks, 7, player:hasKeyItem(xi.ki.SHEET_OF_CONFLICT_TUNES)) -- Awakening (119), Belief (195), A Realm of Emptiness (137) + songPacks = utils.mask.setBit(songPacks, 8, player:hasKeyItem(xi.ki.SHEET_OF_PROMATHIA_TUNES)) -- Distant Worlds (900) + songPacks = utils.mask.setBit(songPacks, 9, player:hasKeyItem(xi.ki.SHEET_OF_ADOULINIAN_TUNES)) -- Forever Today (76) + songPacks = utils.mask.setBit(songPacks, 10, completedROVMissions) -- Rhapsodies of Vana'diel (83) + songPacks = utils.mask.setBit(songPacks, 11, player:hasKeyItem(xi.ki.SHEET_OF_SHADOW_LORD_TUNES)) -- Awakening (The Shadow Lord Battle) (FFRK Ver.) (119) + songPacks = utils.mask.setBit(songPacks, 12, player:hasKeyItem(xi.ki.SHEET_OF_MAPITOTO_TUNES)) -- Full Speed Ahead! (84) + songPacks = utils.mask.setBit(songPacks, 13, player:hasKeyItem(xi.ki.SHEET_OF_ALTAIEU_TUNES)) -- The Celestial Capital - Al'Taieu (233) + songPacks = utils.mask.setBit(songPacks, 14, player:hasKeyItem(xi.ki.SHEET_OF_JEUNO_TUNES)) -- The Grand Duchy of Jeuno (110), Ru'Lude Gardens (117) + songPacks = utils.mask.setBit(songPacks, 15, player:hasKeyItem(xi.ki.SHEET_OF_HARVEST_TUNES)) -- Devils' Delight (29) + songPacks = utils.mask.setBit(songPacks, 16, player:hasKeyItem(xi.ki.SHEET_OF_ANCIENT_TUNES)) -- Griffons Never Die (254), Thunder of the March (180), Stargazing (182) + songPacks = utils.mask.setBit(songPacks, 17, player:hasKeyItem(xi.ki.SHEET_OF_ANCIENT_BATTLE_TUNES)) -- Autumn Footfalls (251), Echoes of a Zephyr (253), The Cosmic Wheel (141) + -- Next page - songPacks = utils.mask.setBit(songPacks, 7, player:hasKeyItem(xi.ki.SHEET_OF_CONFLICT_TUNES)) -- Awakening (119), Belief (195), A Realm of Emptiness (137) - songPacks = utils.mask.setBit(songPacks, 8, player:hasKeyItem(xi.ki.SHEET_OF_PROMATHIA_TUNES)) -- Distant Worlds (900) - songPacks = utils.mask.setBit(songPacks, 9, player:hasKeyItem(xi.ki.SHEET_OF_ADOULINIAN_TUNES)) -- Forever Today (76) - songPacks = utils.mask.setBit(songPacks, 10, false) -- Unknown Item: Rhapsodies of Vana'diel (83) - songPacks = utils.mask.setBit(songPacks, 11, player:hasKeyItem(xi.ki.SHEET_OF_SHADOW_LORD_TUNES)) -- Awakening (The Shadow Lord Battle) (FFRK Ver.) (119) - songPacks = utils.mask.setBit(songPacks, 12, player:hasKeyItem(xi.ki.SHEET_OF_MAPITOTO_TUNES)) -- Full Speed Ahead! (84) - songPacks = utils.mask.setBit(songPacks, 13, player:hasKeyItem(xi.ki.SHEET_OF_ALTAIEU_TUNES)) -- The Celestial Capital - Al'Taieu (233) - songPacks = utils.mask.setBit(songPacks, 14, player:hasKeyItem(xi.ki.SHEET_OF_JEUNO_TUNES)) -- The Grand Duchy of Jeuno (110), Ru'Lude Gardens (117) - songPacks = utils.mask.setBit(songPacks, 15, player:hasKeyItem(xi.ki.SHEET_OF_HARVEST_TUNES)) -- Devils' Delight (29) + songPacks = utils.mask.setBit(songPacks, 18, player:hasKeyItem(xi.ki.SHEET_OF_DESTINY_DESTROYER_TUNES)) -- The Destiny Destroyers (28) + songPacks = utils.mask.setBit(songPacks, 19, player:hasKeyItem(xi.ki.SHEET_OF_CHARACTER_SELECTION_TUNES)) -- Hume Male (133), Hume Female (168), Elvaan Male (132), Elvaan Female (131), Tarutaru Male (167), Tarutaru Female (130), Mithra (166), Galka (165) + songPacks = utils.mask.setBit(songPacks, 20, player:hasKeyItem(xi.ki.SHEET_OF_STARLIGHT_TUNES)) -- Jeuno - Starlight Celebration (239) + songPacks = utils.mask.setBit(songPacks, 21, player:hasKeyItem(xi.ki.SHEET_OF_CHOCOBO_TUNES)) -- Dash de Chocobo (181), Circuit de Chocobo (176), Run Chocobo Run! (177), Choc-a-bye Baby (188) + songPacks = utils.mask.setBit(songPacks, 22, player:hasKeyItem(xi.ki.SHEET_OF_NEAR_EAST_TUNES)) -- Bustle of the Capital (178), Jeweled Boughs (149), Bandits' Market (175), Illusions in the Mist (173) + songPacks = utils.mask.setBit(songPacks, 23, player:hasKeyItem(xi.ki.SHEET_OF_DIVINE_TUNES)) -- Fighters of the Crystal (196) -- 0000 = all instruments shown -- 1111 = all instruments hidden - local instrumentsAvailable = 15 + local instrumentsAvailable = 0xFF local orchestrion = player:findItem(426) local spinet = player:findItem(3677) @@ -60,13 +74,16 @@ xi.symphonic_curator.onTrigger = function(player, npc) instrumentsAvailable = utils.mask.setBit(instrumentsAvailable, 2, not hasNanaaStatue1) -- Nanaa Statue I instrumentsAvailable = utils.mask.setBit(instrumentsAvailable, 3, not hasNanaaStatue2) -- Nanaa Statue II - -- GMs get access to all music - if player:getGMLevel() > 0 then - songPacks = 65535 - instrumentsAvailable = 0 + -- Toggled-on GMs get access to all music + if player:getVisibleGMLevel() > 0 then + songPacks = 0xFFFFFFFF + instrumentsAvailable = 0x00 end - player:startEvent(30034, 0, 4095, songPacks, instrumentsAvailable) + -- Determines whether the songs are shown as ??? in the menu or not + local songMask = 0xFFFF + + player:startEvent(30034, 0, songMask, songPacks, instrumentsAvailable) end -- The options that comes through the event doesn't line up with the song request packet, @@ -110,6 +127,7 @@ local optionToSongLookup = [210] = 135, -- Kazham [226] = 190, -- The Sanctuary of Zi'Tah [242] = 210, -- Tu'Lia + -- Next Page [258] = 119, -- Awakening [274] = 195, -- Belief @@ -123,6 +141,35 @@ local optionToSongLookup = [402] = 110, -- The Grand Duchy of Jeuno [418] = 117, -- Ru'Lude Gardens [434] = 29, -- Devils' Delight + [450] = 254, -- Griffons Never Die + [466] = 180, -- Thunder of the March + [482] = 182, -- Stargazing + [498] = 251, -- Autumn Footfalls + + -- Next Page + [514] = 253, -- Echoes of a Zephyr + [530] = 141, -- The Cosmic Wheel + [546] = 28, -- The Destiny Destroyers + [562] = 133, -- Hume Male + [578] = 168, -- Hume Female + [594] = 132, -- Elvaan Male + [610] = 131, -- Elvaan Female + [626] = 167, -- Tarutaru Male + [642] = 130, -- Tarutaru Female + [558] = 166, -- Mithra + [674] = 165, -- Galka + [690] = 239, -- Jeuno - Starlight Celebration + [706] = 181, -- Dash de Chocobo + [722] = 176, -- Circuit de Chocobo + [738] = 177, -- Run Chocobo Run! + [754] = 188, -- Choc-a-bye Baby + + -- Next Page + [770] = 178, -- Bustle of the Capital + [786] = 149, -- Jeweled Boughs + [802] = 175, -- Bandits' Market + [818] = 173, -- Illusions in the Mist + [834] = 196, -- Fighters of the Crystal } xi.symphonic_curator.onEventUpdate = function(player, csid, option, npc) diff --git a/scripts/items/patio_design_plan_document.lua b/scripts/items/patio_design_plan_document.lua index c93bebb66dd..3a4cf31be15 100644 --- a/scripts/items/patio_design_plan_document.lua +++ b/scripts/items/patio_design_plan_document.lua @@ -7,12 +7,12 @@ local itemObject = {} itemObject.onItemCheck = function(target, item, param, caster) - -- TODO: Should there be a failure message here? - return target:hasKeyItem(xi.ki.MOG_PATIO_DESIGN_DOCUMENT) and 1 or 0 + -- TODO: The error message returned by this is wrong + return target:hasKeyItem(xi.keyItem.MOG_PATIO_DESIGN_DOCUMENT) and 1 or 0 end itemObject.onItemUse = function(target) - npcUtil.giveKeyItem(target, xi.ki.MOG_PATIO_DESIGN_DOCUMENT) + npcUtil.giveKeyItem(target, xi.keyItem.MOG_PATIO_DESIGN_DOCUMENT) end return itemObject diff --git a/scripts/items/sheet_of_divine_tunes.lua b/scripts/items/sheet_of_divine_tunes.lua new file mode 100644 index 00000000000..39d968eff9b --- /dev/null +++ b/scripts/items/sheet_of_divine_tunes.lua @@ -0,0 +1,20 @@ +----------------------------------- +-- ID: 6704 +-- Item: Divine Tunes +-- Grants keyitem: SHEET_OF_DIVINE_TUNES +----------------------------------- +---@type TItem +local itemObject = {} + +itemObject.onItemCheck = function(target, item, param, caster) + -- TODO: The error message returned by this is wrong + return target:hasKeyItem(xi.keyItem.SHEET_OF_DIVINE_TUNES) and 1 or 0 +end + +itemObject.onItemUse = function(target) + -- TODO: This actually produces the message: `->Obtained key item: {key item name}.` + -- TODO: We don't yet have this message type mapped out + npcUtil.giveKeyItem(target, xi.keyItem.SHEET_OF_DIVINE_TUNES) +end + +return itemObject diff --git a/scripts/items/sheet_of_near_east_tunes.lua b/scripts/items/sheet_of_near_east_tunes.lua new file mode 100644 index 00000000000..edb01635311 --- /dev/null +++ b/scripts/items/sheet_of_near_east_tunes.lua @@ -0,0 +1,20 @@ +----------------------------------- +-- ID: 6696 +-- Item: Near East Tunes +-- Grants keyitem: SHEET_OF_NEAR_EAST_TUNES +----------------------------------- +---@type TItem +local itemObject = {} + +itemObject.onItemCheck = function(target, item, param, caster) + -- TODO: The error message returned by this is wrong + return target:hasKeyItem(xi.keyItem.SHEET_OF_NEAR_EAST_TUNES) and 1 or 0 +end + +itemObject.onItemUse = function(target) + -- TODO: This actually produces the message: `->Obtained key item: {key item name}.` + -- TODO: We don't yet have this message type mapped out + npcUtil.giveKeyItem(target, xi.keyItem.SHEET_OF_NEAR_EAST_TUNES) +end + +return itemObject diff --git a/sql/item_basic.sql b/sql/item_basic.sql index 9b6ac60ff97..d7de7d00e38 100644 --- a/sql/item_basic.sql +++ b/sql/item_basic.sql @@ -6325,6 +6325,10 @@ INSERT INTO `item_basic` VALUES (6609,0,'serving_of_popotoes_con_queso','popo._c INSERT INTO `item_basic` VALUES (6610,0,'serving_of_popotoes_con_queso_+1','popo._con_que._+1',12,1544,@VEGETABLES,0,0); INSERT INTO `item_basic` VALUES (6611,0,'serving_of_seafood_gratin','seafood_gratin',12,1544,@BREADS_RICE,0,0); INSERT INTO `item_basic` VALUES (6612,0,'serving_of_seafood_gratin_+1','sea._gratin_+1',12,1544,@BREADS_RICE,0,0); +INSERT INTO `item_basic` VALUES (6690,0,'sheet_of_starlight_tunes','starlight_tunes',1,63048,@NONE,0,0); +INSERT INTO `item_basic` VALUES (6691,0,'sheet_of_mapitoto_tunes','mapitoto_tunes',1,63048,@NONE,0,0); +INSERT INTO `item_basic` VALUES (6696,0,'sheet_of_near_east_tunes','near_east_tunes',1,63048,@NONE,0,0); +INSERT INTO `item_basic` VALUES (6704,0,'sheet_of_divine_tunes','divine_tunes',1,63048,@NONE,0,0); INSERT INTO `item_basic` VALUES (8193,0,'harlequin_head','harlequin_head',1,0,@NONE,1,0); INSERT INTO `item_basic` VALUES (8194,0,'valoredge_x-900_head','valoredge_head',1,0,@NONE,1,0); INSERT INTO `item_basic` VALUES (8195,0,'sharpshot_z-500_head','sharpshot_head',1,0,@NONE,1,0); diff --git a/sql/item_usable.sql b/sql/item_usable.sql index 496cdf4e799..a284c1250ad 100644 --- a/sql/item_usable.sql +++ b/sql/item_usable.sql @@ -1969,6 +1969,10 @@ INSERT INTO `item_usable` VALUES (6571,'scroll_of_phalanx_ii',1,1,11,5,0,0,0,0); INSERT INTO `item_usable` VALUES (6576,'turkey_with_rolanberry_sauce',1,1,28,0,0,0,0,0); -- TODO: verify animation from retail INSERT INTO `item_usable` VALUES (6601,'omelette_sandwich',1,1,28,0,0,0,0,0); INSERT INTO `item_usable` VALUES (6602,'omelette_sandwich_+1',1,1,28,0,0,0,0,0); +INSERT INTO `item_usable` VALUES (6690,'sheet_of_starlight_tunes',1,1,117,0,0,0,0,0); +INSERT INTO `item_usable` VALUES (6691,'sheet_of_mapitoto_tunes',1,1,117,0,0,0,0,0); +INSERT INTO `item_usable` VALUES (6696,'sheet_of_near_east_tunes',1,1,117,0,0,0,0,0); +INSERT INTO `item_usable` VALUES (6704,'sheet_of_divine_tunes',1,1,117,0,0,0,0,0); INSERT INTO `item_usable` VALUES (10250,'moogle_suit',1,8,0,0,1,30,86400,0); INSERT INTO `item_usable` VALUES (10253,'decennial_coat_+1',1,8,0,0,1,30,86400,0); INSERT INTO `item_usable` VALUES (10254,'decennial_dress_+1',1,8,0,0,1,30,86400,0);