diff --git a/resources/scripts/Global.lua b/resources/scripts/Global.lua index c22cb70..08897d3 100644 --- a/resources/scripts/Global.lua +++ b/resources/scripts/Global.lua @@ -1,21 +1,5 @@ -function onBeginLogin(player) - -- send a welcome message - player:send_message("Welcome to Kawari!") -end - -function onCommandRequiredRankInsufficientError(player) - player:send_message("You do not have permission to run this command.") -end - -function onCommandRequiredRankMissingError(additional_information, player) - local error_msg = "Your script does not define the required_rank variable. Please define it in your script for it to run." - - player:send_message(string.format("%s\nAdditional information: %s", error_msg, additional_information)) -end - -function onUnknownCommandError(command_name, player) - player:send_message(string.format("Unknown command %s", command_name)) -end +-- This file should only be used for globally useful constants and functions. +-- Please put new events, actions, items, etc. in their respective 'main' Lua files. function split(input, separator) if separator == nil then @@ -39,279 +23,3 @@ GM_RANK_SUPPORT = 5 GM_RANK_SENIOR = 7 GM_RANK_DEBUG = 90 GM_RANK_MAX = 255 -- Doesn't exist, used for purposes of testing permissions in scripts - --- please keep these ids sorted! - --- Actions -registerAction(3, "actions/Sprint.lua") -registerAction(5, "actions/Teleport.lua") -registerAction(9, "actions/FastBlade.lua") - --- Items -registerAction(6221, "items/Fantasia.lua") - --- Events -registerEvent(131077, "common/GenericWarp.lua") -- Ferry Skipper from Old Gridania to East Shroud: Sweetbloom Pier -registerEvent(131078, "common/GenericWarp.lua") -- Ferry Skipper from East Shroud: Sweetbloom Pier to Old Gridania -registerEvent(131079, "warp/WarpInnGeneric.lua") -- Exit Limsa Upper Decks to Mizzenmast Inn room -registerEvent(131080, "warp/WarpInnGeneric.lua") -- Exit New Gridania to The Roost Inn room -registerEvent(131081, "warp/WarpInnGeneric.lua") -- Exit Ul'dah: Steps of Nald to The Hourglass Inn room -registerEvent(131082, "common/GenericWarp.lua") -- Exit Mizzenmast Inn to Limsa Upper Decks -registerEvent(131083, "common/GenericWarp.lua") -- Exit The Roost to New Gridania -registerEvent(131084, "common/GenericWarp.lua") -- Exit The Hourglass to Ul'dah: Steps of Nald -registerEvent(131092, "common/GenericWarp.lua") -- Exit from Limsa Bulwark Hall and/or Drowning Wench to Airship Landing -registerEvent(131093, "common/GenericWarp.lua") -- Exit from Limsa Bullwark Hall and/or Airship Landing to Drowning Wench -registerEvent(131094, "common/GenericWarp.lua") -- Exit from Limsa Airship Landing and/or Drowning Wench to Bulwark Hall -registerEvent(131095, "common/GenericWarp.lua") -- Exit from Ul'dah Hustings Strip and/or Ruby Road Exchange to Airship Landing, these three events get reused in several places to ensure thay all connect -registerEvent(131096, "common/GenericWarp.lua") -- Exit from Ul'dah Airship Landing and/or Ruby Road Exchange to Hustings Strip -registerEvent(131097, "common/GenericWarp.lua") -- Exit from Ul'dah Airship Landing and/or Husting Strip to Ruby Road Exchange ---registerEvent(131113, "common/GenericWarp.lua") -- (currently doesn't react, seems to need different handling) Ferry Skipper from Upper La Noscea: Memeroon's Trading Post to Upper La Noscea: Jijiroon's Trading Post ---registerEvent(131114, "common/GenericWarp.lua") -- (currently doesn't react, seems to need different handling) Ferry Skipper from Upper La Noscea: Jijiroon's Trading Post to Upper La Noscea: Memeroon's Trading Post -registerEvent(131126, "common/GenericWarp.lua") -- Gatekeeper from Southern Thanalan: Nald's Reflection to Southern Thanalan: The Minotaur Malm ---registerEvent(131158, None) -- Ferry Skipper from Old Gridania to The Lavender Beds, needs special handling for housing ---registerEvent(131169, "common/GenericWarp.lua") -- Ferry Skipper from Eastern La Noscea: Costa Del Sol to ELN: Rhotano Privateer (currently broken) -registerEvent(131195, "common/GenericWarp.lua") -- Exit from Fortemps manor to Ishgard: The Pillars -registerEvent(131204, "warp/WarpInnGeneric.lua") -- Exit Ishgard: Foundation to Cloud Nine Inn room -registerEvent(131205, "common/GenericWarp.lua") -- Exit Cloud Nine to Ishgard: Foundation -registerEvent(131245, "warp/WarpInnGeneric.lua") -- Exit Kugane to Bokairo Inn room -registerEvent(131246, "common/GenericWarp.lua") -- Exit Bokairo Inn to Kugane -registerEvent(131250, "common/GenericWarp.lua") -- Gatekeeper from The Fringes: Castrum Oriens to East Shroud: Amarissaaix's Spire -registerEvent(131266, "common/GenericWarp.lua") -- Gatekeeper from The House of the Fierce to dead-end cave (unable to dive currently) -registerEvent(131268, "common/GenericWarp.lua") -- Enclave Skiff Captain from The Doman Enclave to Yanxia: The Glittering Basin -registerEvent(131312, "common/GenericWarp.lua") -- Exit The Pendants Personal Suite to Crystarium -registerEvent(131313, "common/GenericWarp.lua") -- Exit from The Crown Lift (Lift Operator) to Eulmore: The Canopy -registerEvent(131402, "common/GenericWarp.lua") -- Exit Andron to Old Sharlayan -registerEvent(131428, "common/GenericWarp.lua") -- Mothercrystal Exit (note: warp doesn't work for some reason?) -registerEvent(131519, "common/GenericWarp.lua") -- Faire Adventurer from Eastern La Noscea: bottom of the Moonfire Festival (2023) tower to the first tier of the tower -registerEvent(131578, "common/GenericWarp.lua") -- Exit The For'ard Cabins to Tuliyollal - --- A Realm Reborn Aetherytes -registerEvent(327683, "common/GenericAetheryte.lua") -- Bentbranch Meadows Aetheryte -registerEvent(327684, "common/GenericAetheryte.lua") -- The Hawthorne Hut Aetheryte -registerEvent(327685, "common/GenericAetheryte.lua") -- Quarrymill Aetheryte -registerEvent(327686, "common/GenericAetheryte.lua") -- Camp Tranquil Aetheryte -registerEvent(327687, "common/GenericAetheryte.lua") -- Fallgourd Float Aetheryte -registerEvent(327690, "common/GenericAetheryte.lua") -- Moraby Drydocks Aetheryte -registerEvent(327691, "common/GenericAetheryte.lua") -- Costa del Sol Aetheryte -registerEvent(327692, "common/GenericAetheryte.lua") -- Wineport Aetheryte -registerEvent(327693, "common/GenericAetheryte.lua") -- Swiftperch Aetheryte -registerEvent(327694, "common/GenericAetheryte.lua") -- Aleport Aetheryte -registerEvent(327695, "common/GenericAetheryte.lua") -- Camp Bronze Lake Aetheryte -registerEvent(327696, "common/GenericAetheryte.lua") -- Camp Overlook Aetheryte -registerEvent(327697, "common/GenericAetheryte.lua") -- Horizon Aetheryte -registerEvent(327698, "common/GenericAetheryte.lua") -- Camp Drybone Aetheryte -registerEvent(327699, "common/GenericAetheryte.lua") -- Little Ala Mhigo Aetheryte -registerEvent(327700, "common/GenericAetheryte.lua") -- Forgotten Springs Aetheryte -registerEvent(327701, "common/GenericAetheryte.lua") -- Camp Bluefog Aetheryte -registerEvent(327702, "common/GenericAetheryte.lua") -- Ceruleum Processing Plant Aetheryte -registerEvent(327703, "common/GenericAetheryte.lua") -- Camp Dragonhead Aetheryte -registerEvent(327705, "common/GenericAethernetShard.lua") -- Gridania: Archers' Guild Aethernet shard -registerEvent(327706, "common/GenericAethernetShard.lua") -- Gridania: Leatherworkers' Guild & Shaded Bower Aethernet shard -registerEvent(327707, "common/GenericAethernetShard.lua") -- Gridania: Lancers' Guild Aethernet shard -registerEvent(327708, "common/GenericAethernetShard.lua") -- Gridania: Conjurer' Guild Aethernet shard -registerEvent(327709, "common/GenericAethernetShard.lua") -- Gridania: Botanists' Guild Aethernet shard -registerEvent(327710, "common/GenericAethernetShard.lua") -- Gridania: Mih Khetto's Amphitheatre Aethernet shard -registerEvent(327713, "common/GenericAethernetShard.lua") -- Ul'dah: Adventurers' Guild Aethernet shard -registerEvent(327714, "common/GenericAethernetShard.lua") -- Ul'dah: Thaumaturges' Guild Aethernet shard -registerEvent(327715, "common/GenericAethernetShard.lua") -- Ul'dah: Gladiators' Guild Aethernet shard -registerEvent(327716, "common/GenericAethernetShard.lua") -- Ul'dah: Miners' Guild Aethernet shard -registerEvent(327717, "common/GenericAethernetShard.lua") -- Ul'dah: Alchemists' Guild Aethernet shard -registerEvent(327721, "common/GenericAethernetShard.lua") -- Limsa Lominsa: The Aftcastle Aethernet shard -registerEvent(327722, "common/GenericAethernetShard.lua") -- Limsa Lominsa: Culinarians' Guild Aethernet shard -registerEvent(327723, "common/GenericAethernetShard.lua") -- Limsa Lominsa: Arcanists' Guild Aethernet shard -registerEvent(327724, "common/GenericAethernetShard.lua") -- Limsa Lominsa: Fishermen's Guild Aethernet shard -registerEvent(327727, "common/GenericAethernetShard.lua") -- Ul'dah: Weaver's Guild Aethernet shard -registerEvent(327728, "common/GenericAethernetShard.lua") -- Limsa Lominsa: Marauders' Guild Aethernet shard -registerEvent(327729, "common/GenericAethernetShard.lua") -- Limsa Lominsa: Hawker's Alley Aethernet shard -registerEvent(327730, "common/GenericAethernetShard.lua") -- Ul'dah: Goldsmith's Guild Aethernet shard -registerEvent(327731, "common/GenericAethernetShard.lua") -- Ul'dah: The Chamber of Rule Aethernet shard -registerEvent(327732, "common/GenericAetheryte.lua") -- Summerford Farms Aetheryte -registerEvent(327733, "common/GenericAetheryte.lua") -- Black Brush Station Aetheryte -registerEvent(327735, "common/GenericAetheryte.lua") -- Wolves' Den Pier Aetheryte --- registerevent(327???, "common/GenericAetheryte.lua") -- Ul'dah: Steps of Nald Aetheryte, currently unknown due to the entity not spawning --- registerevent(327???, "common/GenericAetheryte.lua") -- Limsa Lominsa: The Lower Decks Aetheryte, currently unknown due to the entity not spawning -registerEvent(327742, "common/GenericAetheryte.lua") -- The Gold Saucer Aetheryte - --- Heavensward Aetherytes -registerEvent(327750, "common/GenericAetheryte.lua") -- Ishgard: Foundation Aetheryte -registerEvent(327751, "common/GenericAetheryte.lua") -- Falcon's Nest Aetheryte -registerEvent(327752, "common/GenericAetheryte.lua") -- Camp Cloudtop Aetheryte -registerEvent(327753, "common/GenericAetheryte.lua") -- Ok' Zundu Aetheryte -registerEvent(327754, "common/GenericAetheryte.lua") -- Helix Aetheryte -registerEvent(327755, "common/GenericAetheryte.lua") -- Idyllshire Aetheryte -registerEvent(327756, "common/GenericAetheryte.lua") -- Tailfeather Aetheryte -registerEvent(327757, "common/GenericAetheryte.lua") -- Anyx Trine Aetheryte -registerEvent(327758, "common/GenericAetheryte.lua") -- Moghome Aetheryte -registerEvent(327759, "common/GenericAetheryte.lua") -- Zenith Aetheryte -registerEvent(327760, "common/GenericAethernetShard.lua") -- Ishgard: The Forgotten Knight Aethernet shard -registerEvent(327761, "common/GenericAethernetShard.lua") -- Ishgard: Skysteel Manufactory Aethernet shard -registerEvent(327762, "common/GenericAethernetShard.lua") -- Ishgard: The Brume Aethernet shard -registerEvent(327763, "common/GenericAethernetShard.lua") -- Ishgard: Anathaeum Astrologicum Aethernet shard -registerEvent(327764, "common/GenericAethernetShard.lua") -- Ishgard: The Jewled Crozier Aethernet shard -registerEvent(327765, "common/GenericAethernetShard.lua") -- Ishgard: Saint Reymanaud's Cathedral Aethernet shard -registerEvent(327766, "common/GenericAethernetShard.lua") -- Ishgard: The Tribunal Aethernet shard -registerEvent(327767, "common/GenericAethernetShard.lua") -- Ishgard: The Last Vigil Aethernet shard -registerEvent(327770, "common/GenericAethernetShard.lua") -- Idyllshire: West Idyllshire Aethernet shard - --- Stormblood Aetherytes -registerEvent(327778, "common/GenericAetheryte.lua") -- Castrum Oriens Aetheryte -registerEvent(327779, "common/GenericAetheryte.lua") -- The Peering Stones Aetheryte -registerEvent(327780, "common/GenericAetheryte.lua") -- Ala Gannha Aetheryte -registerEvent(327781, "common/GenericAetheryte.lua") -- Ala Ghiri Aetheryte -registerEvent(327782, "common/GenericAetheryte.lua") -- Porta Praetoria Aetheryte -registerEvent(327783, "common/GenericAetheryte.lua") -- The Ala Mhigan Quarter Aetheryte -registerEvent(327784, "common/GenericAetheryte.lua") -- Rhalgr's Reach Aetheryte -registerEvent(327785, "common/GenericAetheryte.lua") -- Tamamizu Aetheryte -registerEvent(327786, "common/GenericAetheryte.lua") -- Onokoro Aetheryte -registerEvent(327787, "common/GenericAetheryte.lua") -- Namai Aetheryte -registerEvent(327788, "common/GenericAetheryte.lua") -- The House of the Fierce Aetheryte -registerEvent(327789, "common/GenericAetheryte.lua") -- Reunion Aetheryte -registerEvent(327790, "common/GenericAetheryte.lua") -- The Dawn Throne Aetheryte -registerEvent(327791, "common/GenericAetheryte.lua") -- Kugane Aetheryte -registerEvent(327792, "common/GenericAethernetShard.lua") -- Kugane: Shiokaze Hostelry Aethernet shard -registerEvent(327793, "common/GenericAethernetShard.lua") -- Kugane: Pier #1 Aethernet shard -registerEvent(327794, "common/GenericAethernetShard.lua") -- Kugane: Thavnairian Consulate Aethernet shard -registerEvent(327795, "common/GenericAethernetShard.lua") -- Kugane: Kogane Dori Markets Aethernet shard -registerEvent(327796, "common/GenericAethernetShard.lua") -- Kugane: Bokairo Inn Aethernet shard -registerEvent(327797, "common/GenericAethernetShard.lua") -- Kugane: The Ruby Bazaar Aethernet shard -registerEvent(327798, "common/GenericAethernetShard.lua") -- Kugane: Sekiseigumi Barracks Aethernet shard -registerEvent(327799, "common/GenericAethernetShard.lua") -- Kugane: Rakuza District Aethernet shard -registerEvent(327801, "common/GenericAethernetShard.lua") -- Rhalgr's Reach: Western Rhalgr's Reach Aethernet shard -registerEvent(327802, "common/GenericAethernetShard.lua") -- Rhalgr's Reach: Northeastern Rhalgr's Reach Aethernet shard -registerEvent(327805, "common/GenericAethernetShard.lua") -- Ul'dah: Sapphire Avenue Exchange Aethernet shard -registerEvent(327807, "common/GenericAetheryte.lua") -- The Doman Enclave Aetheryte -registerEvent(327808, "common/GenericAetheryte.lua") -- Dhoro Iloh Aetheryte -registerEvent(327809, "common/GenericAethernetShard.lua") -- The Doman Enclave: The Northern Enclave Aethernet shard -registerEvent(327810, "common/GenericAethernetShard.lua") -- The Doman Enclave: The Southern Enclave Aethernet shard - --- Shadowbringers Aetherytes -registerEvent(327812, "common/GenericAetheryte.lua") -- Fort Jobb Aetheryte -registerEvent(327814, "common/GenericAetheryte.lua") -- Eulmore Aetheryte -registerEvent(327815, "common/GenericAethernetShard.lua") -- Eulmore: Southeast Derelicts Aethernet shard -registerEvent(327816, "common/GenericAetheryte.lua") -- The Ostal Imperative Aetheryte -registerEvent(327817, "common/GenericAetheryte.lua") -- Stilltide Aetheryte -registerEvent(327818, "common/GenericAetheryte.lua") -- Wright Aetheryte -registerEvent(327819, "common/GenericAetheryte.lua") -- Tomra Aetheryte -registerEvent(327820, "common/GenericAetheryte.lua") -- Mord Souq Aetheryte -registerEvent(327821, "common/GenericAetheryte.lua") -- Twine Aetheryte -registerEvent(327822, "common/GenericAetheryte.lua") -- Slitherbough Aetheryte -registerEvent(327823, "common/GenericAetheryte.lua") -- Fanow Aetheryte -registerEvent(327824, "common/GenericAetheryte.lua") -- Lydha Lran Aetheryte -registerEvent(327825, "common/GenericAetheryte.lua") -- Pla Enni Aetheryte -registerEvent(327826, "common/GenericAetheryte.lua") -- Wolekdorf Aetheryte -registerEvent(327827, "common/GenericAetheryte.lua") -- The Ondo Cups Aetheryte -registerEvent(327828, "common/GenericAetheryte.lua") -- The Macarenses Angle Aetheryte -registerEvent(327829, "common/GenericAethernetShard.lua") -- The Crystarium: Musica Universalis Markets Aethernet shard -registerEvent(327830, "common/GenericAethernetShard.lua") -- The Crystarium: Temenos Rookery Aethernet shard -registerEvent(327831, "common/GenericAethernetShard.lua") -- The Crystarium: The Dossal Gate Aethernet shard -registerEvent(327832, "common/GenericAethernetShard.lua") -- The Crystarium: The Pendants Aethernet shard -registerEvent(327833, "common/GenericAethernetShard.lua") -- The Crystarium: The Amaro Launch Aethernet shard -registerEvent(327834, "common/GenericAethernetShard.lua") -- The Crystarium: The Crystalline Mean Aethernet shard -registerEvent(327835, "common/GenericAethernetShard.lua") -- The Crystarium: The Cabinet of Curiosity Aethernet shard -registerEvent(327837, "common/GenericAethernetShard.lua") -- Eulmore: The Mainstay Aethernet shard -registerEvent(327838, "common/GenericAethernetShard.lua") -- Eulmore: Nightsoil Pots Aethernet shard -registerEvent(327839, "common/GenericAethernetShard.lua") -- Eulmore: The Glory Gate Aethernet shard -registerEvent(327841, "common/GenericAetheryte.lua") -- The Inn at Journey's Head Aetheryte -registerEvent(327842, "common/GenericAethernetShard.lua") -- The Doman Enclave: Ferry Docks Aethernet shard --- registerEvent(3278??, "common/GenericAetheryte.lua") -- The Crystarium Aetheryte, currently unknown due to the entity not spawning - --- Endwalker Aetherytes -registerEvent(327846, "common/GenericAetheryte.lua") -- The Archeion Aetheryte -registerEvent(327847, "common/GenericAetheryte.lua") -- Sharlayan Hamlet Aetheryte -registerEvent(327848, "common/GenericAetheryte.lua") -- Aporia Aetheryte -registerEvent(327849, "common/GenericAetheryte.lua") -- Yedlihmad Aetheryte -registerEvent(327850, "common/GenericAetheryte.lua") -- The Great Work Aetheryte -registerEvent(327851, "common/GenericAetheryte.lua") -- Palaka's Stand Aetheryte -registerEvent(327852, "common/GenericAetheryte.lua") -- Camp Broken Glass Aetheryte -registerEvent(327853, "common/GenericAetheryte.lua") -- Tertium Aetheryte -registerEvent(327854, "common/GenericAetheryte.lua") -- Sinus Lacrimarum Aetheryte -registerEvent(327855, "common/GenericAetheryte.lua") -- Bestways Burrow Aetheryte -registerEvent(327856, "common/GenericAetheryte.lua") -- Anagnorisis Aetheryte -registerEvent(327857, "common/GenericAetheryte.lua") -- The Twelve Wonders Aetheryte -registerEvent(327858, "common/GenericAetheryte.lua") -- Poieten Oikos Aetheryte -registerEvent(327859, "common/GenericAetheryte.lua") -- Reah Tahra Aetheryte -registerEvent(327860, "common/GenericAetheryte.lua") -- Abode of the Ea Aetheryte -registerEvent(327861, "common/GenericAetheryte.lua") -- Base Omicron Aetheryte -registerEvent(327862, "common/GenericAetheryte.lua") -- Old Sharlayan Aetheryte -registerEvent(327863, "common/GenericAetheryte.lua") -- Radz-at-Han Aetheryte -registerEvent(327864, "common/GenericAethernetShard.lua") -- Old Sharlayan: The Studium Aethernet shard -registerEvent(327865, "common/GenericAethernetShard.lua") -- Old Sharlayan: The Baldesion Annex Aethernet shard -registerEvent(327866, "common/GenericAethernetShard.lua") -- Old Sharlayan: The Rostrum Aethernet shard -registerEvent(327867, "common/GenericAethernetShard.lua") -- Old Sharlayan: The Leveilleur Estate Aethernet shard -registerEvent(327868, "common/GenericAethernetShard.lua") -- Old Sharlayan: Journey's End Aethernet shard -registerEvent(327869, "common/GenericAethernetShard.lua") -- Old Sharlayan: Scholar's Harbor Aethernet shard -registerEvent(327871, "common/GenericAethernetShard.lua") -- Radz-at-Han: Meghaduta Aethernet shard -registerEvent(327872, "common/GenericAethernetShard.lua") -- Radz-at-Han: Ruveydah Fibers Aethernet shard -registerEvent(327873, "common/GenericAethernetShard.lua") -- Radz-at-Han: Airship Landing Aethernet shard -registerEvent(327874, "common/GenericAethernetShard.lua") -- Radz-at-Han: Alzadaal's Peace Aethernet shard -registerEvent(327875, "common/GenericAethernetShard.lua") -- Radz-at-Han: The Hall of the Radiant Host Aethernet shard -registerEvent(327876, "common/GenericAethernetShard.lua") -- Radz-at-Han: Mehryde's Meyhane Aethernet shard -registerEvent(327878, "common/GenericAethernetShard.lua") -- Radz-at-Han: Kama Aethernet shard -registerEvent(327879, "common/GenericAethernetShard.lua") -- Radz-at-Han: The High Crucible of Al-Kimiya Aethernet shard - --- Dawntrail Aetherytes -registerEvent(327880, "common/GenericAetheryte.lua") -- Wachunpelo Aetheryte -registerEvent(327881, "common/GenericAetheryte.lua") -- Worlar's Echo Aetheryte -registerEvent(327882, "common/GenericAetheryte.lua") -- Ok'hanu Aetheryte -registerEvent(327883, "common/GenericAetheryte.lua") -- Many Fires Aetheryte -registerEvent(327884, "common/GenericAetheryte.lua") -- Earthenshire Aetheryte -registerEvent(327885, "common/GenericAetheryte.lua") -- Iq Br'aax Aetheryte -registerEvent(327886, "common/GenericAetheryte.lua") -- Mamook Aetheryte -registerEvent(327887, "common/GenericAetheryte.lua") -- Hhusatahwi Aetheryte -registerEvent(327888, "common/GenericAetheryte.lua") -- Sheshenewezi Springs Aetheryte -registerEvent(327889, "common/GenericAetheryte.lua") -- Mehwahhetsoan Aetheryte -registerEvent(327890, "common/GenericAetheryte.lua") -- Yyasulani Station Aetheryte -registerEvent(327891, "common/GenericAetheryte.lua") -- The Outskirts Aetheryte -registerEvent(327892, "common/GenericAetheryte.lua") -- Electrope Strike Aetheryte -registerEvent(327893, "common/GenericAetheryte.lua") -- Leynode Mnemo Aetheryte -registerEvent(327894, "common/GenericAetheryte.lua") -- Leynode Pyro Aetheryte -registerEvent(327895, "common/GenericAetheryte.lua") -- Leynode Aero Aetheryte -registerEvent(327896, "common/GenericAetheryte.lua") -- Tuliyollal Aetheryte -registerEvent(327897, "common/GenericAetheryte.lua") -- Solution Nine Aetheryte -registerEvent(327898, "common/GenericAethernetShard.lua") -- Tuliyollal: Dirgible Landing Aethernet shard -registerEvent(327899, "common/GenericAethernetShard.lua") -- Tuliyollal: The Resplendent Quarter Aethernet shard -registerEvent(327900, "common/GenericAethernetShard.lua") -- Tuliyollal: The For'ard Cabins Aethernet shard -registerEvent(327901, "common/GenericAethernetShard.lua") -- Tuliyollal: Bayside Bevy Marketplace Aethernet shard -registerEvent(327902, "common/GenericAethernetShard.lua") -- Tuliyollal: Vollok Shoonsa Aethernet shard -registerEvent(327904, "common/GenericAethernetShard.lua") -- Tuliyollal: Brightploom Post Aethernet shard -registerEvent(327910, "common/GenericAethernetShard.lua") -- Solution Nine: Information Center Aethernet shard -registerEvent(327911, "common/GenericAethernetShard.lua") -- Solution Nine: True Vue Aethernet shard -registerEvent(327912, "common/GenericAethernetShard.lua") -- Solution Nine: Neon Stein Aethernet shard -registerEvent(327913, "common/GenericAethernetShard.lua") -- Solution Nine: The Arcadion Aethernet shard -registerEvent(327914, "common/GenericAethernetShard.lua") -- Solution Nine: Resolution Aethernet shard -registerEvent(327915, "common/GenericAethernetShard.lua") -- Solution Nine: Nexus Arcade Aethernet shard -registerEvent(327916, "common/GenericAethernetShard.lua") -- Solution Nine: Residential District Aethernet shard -registerEvent(327918, "common/GenericAetheryte.lua") -- Dock Poga Aetheryte - --- Misc. Events -registerEvent(720898, "tosort/DeliveryMoogle.lua") -registerEvent(720915, "common/GenericMender.lua") -registerEvent(720916, "custom/000/cmndefinnbed_00020.lua") -registerEvent(721096, "tosort/ToyChest.lua") -registerEvent(721028, "tosort/UnendingJourney.lua") -registerEvent(721044, "tosort/CrystalBell.lua") -registerEvent(721226, "tosort/Orchestrion.lua") -registerEvent(721347, "tosort/GlamourDresser.lua") -registerEvent(721440, "tosort/SummoningBell.lua") -registerEvent(720935, "tosort/MarketBoard.lua") -registerEvent(720978, "tosort/Armoire.lua") -registerEvent(1179657, "tosort/Chocobokeep.lua") -- Chocobokeep in Central Shroud -registerEvent(1245185, "opening/OpeningLimsaLominsa.lua") -registerEvent(1245186, "opening/OpeningGridania.lua") -registerEvent(1245187, "opening/OpeningUldah.lua") - --- TODO: Generic warps might be decided through ArrayEventHandler? - --- Commands -registerCommand("setpos", "commands/debug/SetPos.lua") -registerCommand("classjob", "commands/debug/ClassJob.lua") -registerCommand("setspeed", "commands/debug/SetSpeed.lua") -registerCommand("nudge", "commands/debug/Nudge.lua") -registerCommand("festival", "commands/debug/Festival.lua") -registerCommand("permtest", "commands/debug/PermissionTest.lua") -registerCommand("unlock", "commands/debug/Unlock.lua") -registerCommand("wireframe", "commands/debug/ToggleWireframe.lua") -registerCommand("invis", "commands/debug/ToggleInvisibility.lua") -registerCommand("unlockaetheryte", "commands/debug/UnlockAetheryte.lua") -registerCommand("teri", "commands/debug/ChangeTerritory.lua") -registerCommand("ost", "commands/debug/OnScreenTest.lua") diff --git a/resources/scripts/Init.lua b/resources/scripts/Init.lua new file mode 100644 index 0000000..32fe480 --- /dev/null +++ b/resources/scripts/Init.lua @@ -0,0 +1,27 @@ +BASE_DIR = "resources/scripts/" + +dofile(BASE_DIR.."commands/Commands.lua") +dofile(BASE_DIR.."actions/Actions.lua") +dofile(BASE_DIR.."events/Events.lua") +dofile(BASE_DIR.."items/Items.lua") +dofile(BASE_DIR.."Global.lua") + +-- Lua error handlers, and other server events like player login +function onBeginLogin(player) + -- send a welcome message + player:send_message("Welcome to Kawari!") +end + +function onCommandRequiredRankInsufficientError(player) + player:send_message("You do not have permission to run this command.") +end + +function onCommandRequiredRankMissingError(additional_information, player) + local error_msg = "Your script does not define the required_rank variable. Please define it in your script for it to run." + + player:send_message(string.format("%s\nAdditional information: %s", error_msg, additional_information)) +end + +function onUnknownCommandError(command_name, player) + player:send_message(string.format("Unknown command %s", command_name)) +end diff --git a/resources/scripts/actions/Actions.lua b/resources/scripts/actions/Actions.lua new file mode 100644 index 0000000..64380ac --- /dev/null +++ b/resources/scripts/actions/Actions.lua @@ -0,0 +1,5 @@ +-- Please keep these ids sorted! + +registerAction(3, "actions/Sprint.lua") +registerAction(5, "actions/Teleport.lua") +registerAction(9, "actions/FastBlade.lua") diff --git a/resources/scripts/commands/Commands.lua b/resources/scripts/commands/Commands.lua new file mode 100644 index 0000000..2ed54de --- /dev/null +++ b/resources/scripts/commands/Commands.lua @@ -0,0 +1,16 @@ +DBG_DIR = "commands/debug/" + +-- Please keep these in alphabetical order! + +registerCommand("classjob", DBG_DIR.."ClassJob.lua") +registerCommand("festival", DBG_DIR.."Festival.lua") +registerCommand("invis", DBG_DIR.."ToggleInvisibility.lua") +registerCommand("nudge", DBG_DIR.."Nudge.lua") +registerCommand("ost", DBG_DIR.."OnScreenTest.lua") +registerCommand("permtest", DBG_DIR.."PermissionTest.lua") +registerCommand("setpos", DBG_DIR.."SetPos.lua") +registerCommand("setspeed", DBG_DIR.."SetSpeed.lua") +registerCommand("teri", DBG_DIR.."ChangeTerritory.lua") +registerCommand("unlock", DBG_DIR.."Unlock.lua") +registerCommand("unlockaetheryte", DBG_DIR.."UnlockAetheryte.lua") +registerCommand("wireframe", DBG_DIR.."ToggleWireframe.lua") diff --git a/resources/scripts/events/Events.lua b/resources/scripts/events/Events.lua new file mode 100644 index 0000000..b72f0ca --- /dev/null +++ b/resources/scripts/events/Events.lua @@ -0,0 +1,330 @@ +-- Please keep these ids sorted in each table! + +-- TODO: Generic warps might be decided through ArrayEventHandler? +generic_warps = { + 131077, -- Ferry Skipper from Old Gridania to East Shroud: Sweetbloom Pier + 131078, -- Ferry Skipper from East Shroud: Sweetbloom Pier to Old Gridania + 131079, -- Exit Limsa Upper Decks to Mizzenmast Inn room + 131080, -- Exit New Gridania to The Roost Inn room + 131081, -- Exit Ul'dah: Steps of Nald to The Hourglass Inn room + 131082, -- Exit Mizzenmast Inn to Limsa Upper Decks + 131083, -- Exit The Roost to New Gridania + 131084, -- Exit The Hourglass to Ul'dah: Steps of Nald + 131092, -- Exit from Limsa Bulwark Hall and/or Drowning Wench to Airship Landing + 131093, -- Exit from Limsa Bullwark Hall and/or Airship Landing to Drowning Wench + 131094, -- Exit from Limsa Airship Landing and/or Drowning Wench to Bulwark Hall + 131095, -- Exit from Ul'dah Hustings Strip and/or Ruby Road Exchange to Airship Landing, these three events get reused in several places to ensure thay all connect + 131096, -- Exit from Ul'dah Airship Landing and/or Ruby Road Exchange to Hustings Strip + 131097, -- Exit from Ul'dah Airship Landing and/or Husting Strip to Ruby Road Exchange + --131113, -- (currently doesn't react, seems to need different handling Ferry Skipper from Upper La Noscea: Memeroon's Trading Post to Upper La Noscea: Jijiroon's Trading Post + --131114, -- (currently doesn't react, seems to need different handling Ferry Skipper from Upper La Noscea: Jijiroon's Trading Post to Upper La Noscea: Memeroon's Trading Post + 131126, -- Gatekeeper from Southern Thanalan: Nald's Reflection to Southern Thanalan: The Minotaur Malm + --131158, None -- Ferry Skipper from Old Gridania to The Lavender Beds, needs special handling for housing + --131169, -- Ferry Skipper from Eastern La Noscea: Costa Del Sol to ELN: Rhotano Privateer (currently broken + 131195, -- Exit from Fortemps manor to Ishgard: The Pillars + 131204, -- Exit Ishgard: Foundation to Cloud Nine Inn room + 131205, -- Exit Cloud Nine to Ishgard: Foundation + 131245, -- Exit Kugane to Bokairo Inn room + 131246, -- Exit Bokairo Inn to Kugane + 131250, -- Gatekeeper from The Fringes: Castrum Oriens to East Shroud: Amarissaaix's Spire + 131266, -- Gatekeeper from The House of the Fierce to dead-end cave (unable to dive currently + 131268, -- Enclave Skiff Captain from The Doman Enclave to Yanxia: The Glittering Basin + 131312, -- Exit The Pendants Personal Suite to Crystarium + 131313, -- Exit from The Crown Lift (Lift Operator to Eulmore: The Canopy + 131402, -- Exit Andron to Old Sharlayan + 131428, -- Mothercrystal Exit (note: warp doesn't work for some reason? + 131519, -- Faire Adventurer from Eastern La Noscea: bottom of the Moonfire Festival (2023 tower to the first tier of the tower + 131578, -- Exit The For'ard Cabins to Tuliyollal +} + +generic_inns = { + 131079, -- Exit Limsa Upper Decks to Mizzenmast Inn room + 131080, -- Exit New Gridania to The Roost Inn room + 131081, -- Exit Ul'dah: Steps of Nald to The Hourglass Inn room + 131204, -- Exit Ishgard: Foundation to Cloud Nine Inn room + 131245, -- Exit Kugane to Bokairo Inn room +} + +generic_aetherytes = { + -- A Realm Reborn Aetherytes + 327683, -- Bentbranch Meadows Aetheryte + 327684, -- The Hawthorne Hut Aetheryte + 327685, -- Quarrymill Aetheryte + 327686, -- Camp Tranquil Aetheryte + 327687, -- Fallgourd Float Aetheryte + 327690, -- Moraby Drydocks Aetheryte + 327691, -- Costa del Sol Aetheryte + 327692, -- Wineport Aetheryte + 327693, -- Swiftperch Aetheryte + 327694, -- Aleport Aetheryte + 327695, -- Camp Bronze Lake Aetheryte + 327696, -- Camp Overlook Aetheryte + 327697, -- Horizon Aetheryte + 327698, -- Camp Drybone Aetheryte + 327699, -- Little Ala Mhigo Aetheryte + 327700, -- Forgotten Springs Aetheryte + 327701, -- Camp Bluefog Aetheryte + 327702, -- Ceruleum Processing Plant Aetheryte + 327703, -- Camp Dragonhead Aetheryte + 327732, -- Summerford Farms Aetheryte + 327733, -- Black Brush Station Aetheryte + 327735, -- Wolves' Den Pier Aetheryte + -- registerevent(327???, -- Ul'dah: Steps of Nald Aetheryte, currently unknown due to the entity not spawning + -- registerevent(327???, -- Limsa Lominsa: The Lower Decks Aetheryte, currently unknown due to the entity not spawning + 327742, -- The Gold Saucer Aetheryte + + -- Heavensward Aetherytes + 327750, -- Ishgard: Foundation Aetheryte + 327751, -- Falcon's Nest Aetheryte + 327752, -- Camp Cloudtop Aetheryte + 327753, -- Ok' Zundu Aetheryte + 327754, -- Helix Aetheryte + 327755, -- Idyllshire Aetheryte + 327756, -- Tailfeather Aetheryte + 327757, -- Anyx Trine Aetheryte + 327758, -- Moghome Aetheryte + 327759, -- Zenith Aetheryte + + -- Stormblood Aetherytes + 327778, -- Castrum Oriens Aetheryte + 327779, -- The Peering Stones Aetheryte + 327780, -- Ala Gannha Aetheryte + 327781, -- Ala Ghiri Aetheryte + 327782, -- Porta Praetoria Aetheryte + 327783, -- The Ala Mhigan Quarter Aetheryte + 327784, -- Rhalgr's Reach Aetheryte + 327785, -- Tamamizu Aetheryte + 327786, -- Onokoro Aetheryte + 327787, -- Namai Aetheryte + 327788, -- The House of the Fierce Aetheryte + 327789, -- Reunion Aetheryte + 327790, -- The Dawn Throne Aetheryte + 327791, -- Kugane Aetheryte + 327807, -- The Doman Enclave Aetheryte + 327808, -- Dhoro Iloh Aetheryte + + -- Shadowbringers Aetherytes + 327812, -- Fort Jobb Aetheryte + 327814, -- Eulmore Aetheryte + 327816, -- The Ostal Imperative Aetheryte + 327817, -- Stilltide Aetheryte + 327818, -- Wright Aetheryte + 327819, -- Tomra Aetheryte + 327820, -- Mord Souq Aetheryte + 327821, -- Twine Aetheryte + 327822, -- Slitherbough Aetheryte + 327823, -- Fanow Aetheryte + 327824, -- Lydha Lran Aetheryte + 327825, -- Pla Enni Aetheryte + 327826, -- Wolekdorf Aetheryte + 327827, -- The Ondo Cups Aetheryte + 327828, -- The Macarenses Angle Aetheryte + 327841, -- The Inn at Journey's Head Aetheryte + 327842, -- The Doman Enclave: Ferry Docks Aethernet shard + -- 3278??, -- The Crystarium Aetheryte, currently unknown due to the entity not spawning + + -- Endwalker Aetherytes + 327846, -- The Archeion Aetheryte + 327847, -- Sharlayan Hamlet Aetheryte + 327848, -- Aporia Aetheryte + 327849, -- Yedlihmad Aetheryte + 327850, -- The Great Work Aetheryte + 327851, -- Palaka's Stand Aetheryte + 327852, -- Camp Broken Glass Aetheryte + 327853, -- Tertium Aetheryte + 327854, -- Sinus Lacrimarum Aetheryte + 327855, -- Bestways Burrow Aetheryte + 327856, -- Anagnorisis Aetheryte + 327857, -- The Twelve Wonders Aetheryte + 327858, -- Poieten Oikos Aetheryte + 327859, -- Reah Tahra Aetheryte + 327860, -- Abode of the Ea Aetheryte + 327861, -- Base Omicron Aetheryte + 327862, -- Old Sharlayan Aetheryte + 327863, -- Radz-at-Han Aetheryte + + -- Dawntrail Aetherytes + 327880, -- Wachunpelo Aetheryte + 327881, -- Worlar's Echo Aetheryte + 327882, -- Ok'hanu Aetheryte + 327883, -- Many Fires Aetheryte + 327884, -- Earthenshire Aetheryte + 327885, -- Iq Br'aax Aetheryte + 327886, -- Mamook Aetheryte + 327887, -- Hhusatahwi Aetheryte + 327888, -- Sheshenewezi Springs Aetheryte + 327889, -- Mehwahhetsoan Aetheryte + 327890, -- Yyasulani Station Aetheryte + 327891, -- The Outskirts Aetheryte + 327892, -- Electrope Strike Aetheryte + 327893, -- Leynode Mnemo Aetheryte + 327894, -- Leynode Pyro Aetheryte + 327895, -- Leynode Aero Aetheryte + 327896, -- Tuliyollal Aetheryte + 327897, -- Solution Nine Aetheryte + 327918, -- Dock Poga Aetheryte +} + +generic_anetshards = { + -- A Realm Reborn Aetherytes + 327705, -- Gridania: Archers' Guild Aethernet shard + 327706, -- Gridania: Leatherworkers' Guild & Shaded Bower Aethernet shard + 327707, -- Gridania: Lancers' Guild Aethernet shard + 327708, -- Gridania: Conjurer' Guild Aethernet shard + 327709, -- Gridania: Botanists' Guild Aethernet shard + 327710, -- Gridania: Mih Khetto's Amphitheatre Aethernet shard + 327713, -- Ul'dah: Adventurers' Guild Aethernet shard + 327714, -- Ul'dah: Thaumaturges' Guild Aethernet shard + 327715, -- Ul'dah: Gladiators' Guild Aethernet shard + 327716, -- Ul'dah: Miners' Guild Aethernet shard + 327717, -- Ul'dah: Alchemists' Guild Aethernet shard + 327721, -- Limsa Lominsa: The Aftcastle Aethernet shard + 327722, -- Limsa Lominsa: Culinarians' Guild Aethernet shard + 327723, -- Limsa Lominsa: Arcanists' Guild Aethernet shard + 327724, -- Limsa Lominsa: Fishermen's Guild Aethernet shard + 327727, -- Ul'dah: Weaver's Guild Aethernet shard + 327728, -- Limsa Lominsa: Marauders' Guild Aethernet shard + 327729, -- Limsa Lominsa: Hawker's Alley Aethernet shard + 327730, -- Ul'dah: Goldsmith's Guild Aethernet shard + 327731, -- Ul'dah: The Chamber of Rule Aethernet shard + + -- Heavensward Aetherytes + 327760, -- Ishgard: The Forgotten Knight Aethernet shard + 327761, -- Ishgard: Skysteel Manufactory Aethernet shard + 327762, -- Ishgard: The Brume Aethernet shard + 327763, -- Ishgard: Anathaeum Astrologicum Aethernet shard + 327764, -- Ishgard: The Jewled Crozier Aethernet shard + 327765, -- Ishgard: Saint Reymanaud's Cathedral Aethernet shard + 327766, -- Ishgard: The Tribunal Aethernet shard + 327767, -- Ishgard: The Last Vigil Aethernet shard + 327770, -- Idyllshire: West Idyllshire Aethernet shard + + -- Stormblood Aetherytes + 327792, -- Kugane: Shiokaze Hostelry Aethernet shard + 327793, -- Kugane: Pier #1 Aethernet shard + 327794, -- Kugane: Thavnairian Consulate Aethernet shard + 327795, -- Kugane: Kogane Dori Markets Aethernet shard + 327796, -- Kugane: Bokairo Inn Aethernet shard + 327797, -- Kugane: The Ruby Bazaar Aethernet shard + 327798, -- Kugane: Sekiseigumi Barracks Aethernet shard + 327799, -- Kugane: Rakuza District Aethernet shard + 327801, -- Rhalgr's Reach: Western Rhalgr's Reach Aethernet shard + 327802, -- Rhalgr's Reach: Northeastern Rhalgr's Reach Aethernet shard + 327805, -- Ul'dah: Sapphire Avenue Exchange Aethernet shard + 327809, -- The Doman Enclave: The Northern Enclave Aethernet shard + 327810, -- The Doman Enclave: The Southern Enclave Aethernet shard + + -- Shadowbringers Aetherytes + 327815, -- Eulmore: Southeast Derelicts Aethernet shard + 327829, -- The Crystarium: Musica Universalis Markets Aethernet shard + 327830, -- The Crystarium: Temenos Rookery Aethernet shard + 327831, -- The Crystarium: The Dossal Gate Aethernet shard + 327832, -- The Crystarium: The Pendants Aethernet shard + 327833, -- The Crystarium: The Amaro Launch Aethernet shard + 327834, -- The Crystarium: The Crystalline Mean Aethernet shard + 327835, -- The Crystarium: The Cabinet of Curiosity Aethernet shard + 327837, -- Eulmore: The Mainstay Aethernet shard + 327838, -- Eulmore: Nightsoil Pots Aethernet shard + 327839, -- Eulmore: The Glory Gate Aethernet shard + 327842, -- The Doman Enclave: Ferry Docks Aethernet shard + + -- Endwalker Aetherytes + 327864, -- Old Sharlayan: The Studium Aethernet shard + 327865, -- Old Sharlayan: The Baldesion Annex Aethernet shard + 327866, -- Old Sharlayan: The Rostrum Aethernet shard + 327867, -- Old Sharlayan: The Leveilleur Estate Aethernet shard + 327868, -- Old Sharlayan: Journey's End Aethernet shard + 327869, -- Old Sharlayan: Scholar's Harbor Aethernet shard + 327871, -- Radz-at-Han: Meghaduta Aethernet shard + 327872, -- Radz-at-Han: Ruveydah Fibers Aethernet shard + 327873, -- Radz-at-Han: Airship Landing Aethernet shard + 327874, -- Radz-at-Han: Alzadaal's Peace Aethernet shard + 327875, -- Radz-at-Han: The Hall of the Radiant Host Aethernet shard + 327876, -- Radz-at-Han: Mehryde's Meyhane Aethernet shard + 327878, -- Radz-at-Han: Kama Aethernet shard + 327879, -- Radz-at-Han: The High Crucible of Al-Kimiya Aethernet shard + + -- Dawntrail Aetherytes + 327898, -- Tuliyollal: Dirgible Landing Aethernet shard + 327899, -- Tuliyollal: The Resplendent Quarter Aethernet shard + 327900, -- Tuliyollal: The For'ard Cabins Aethernet shard + 327901, -- Tuliyollal: Bayside Bevy Marketplace Aethernet shard + 327902, -- Tuliyollal: Vollok Shoonsa Aethernet shard + 327904, -- Tuliyollal: Brightploom Post Aethernet shard + 327910, -- Solution Nine: Information Center Aethernet shard + 327911, -- Solution Nine: True Vue Aethernet shard + 327912, -- Solution Nine: Neon Stein Aethernet shard + 327913, -- Solution Nine: The Arcadion Aethernet shard + 327914, -- Solution Nine: Resolution Aethernet shard + 327915, -- Solution Nine: Nexus Arcade Aethernet shard + 327916, -- Solution Nine: Residential District Aethernet shard +} + +-- TODO: Should probably break misc. events and their tables off into separate NPCs and objects eventually, but this is fine for now. +to_sort = { + [720898] = "DeliveryMoogle.lua", + [721096] = "ToyChest.lua", + [721028] = "UnendingJourney.lua", + [721044] = "CrystalBell.lua", + [721226] = "Orchestrion.lua", + [721347] = "GlamourDresser.lua", + [721440] = "SummoningBell.lua", + [720935] = "MarketBoard.lua", + [720978] = "Armoire.lua", + [1179657] = "Chocobokeep.lua", -- Chocobokeep in Central Shroud +} + +-- Events in /common that aren't already get covered by other tables +common_events = { + [720915] = "GenericMender.lua", +} + +-- Not custom in the sense of non-SQEX content, just going based off the directory name +custom0_events = { + [720916] = "cmndefinnbed_00020.lua", +} + +-- Events in quests/* +quests = { + [1245185] = "OpeningLimsaLominsa.lua", + [1245186] = "OpeningGridania.lua", + [1245187] = "OpeningUldah.lua", +} + +COMMON_DIR = "events/common/" +WARP_DIR = "events/warp/" +TOSORT_DIR = "events/tosort/" +OPENING_DIR = "events/quest/opening/" +CUSTOM0_DIR = "events/custom/000/" + +for _, event_id in pairs(generic_warps) do + registerEvent(event_id, "events/common/GenericWarp.lua") +end + +for _, event_id in pairs(generic_inns) do + registerEvent(event_id, "events/warp/WarpInnGeneric.lua" ) +end + +for _, event_id in pairs(generic_aetherytes) do + registerEvent(event_id, "events/common/GenericAetheryte.lua") +end + +for _, event_id in pairs(generic_anetshards) do + registerEvent(event_id, "events/common/GenericAethernetShard.lua") +end + +for event_id, script_file in pairs(to_sort) do + registerEvent(event_id, TOSORT_DIR..script_file) +end + +for event_id, script_file in pairs(common_events) do + registerEvent(event_id, COMMON_DIR..script_file) +end + +for event_id, script_file in pairs(custom0_events) do + registerEvent(event_id, CUSTOM0_DIR..script_file) +end + +for event_id, script_file in pairs(quests) do + registerEvent(event_id, OPENING_DIR..script_file) +end diff --git a/resources/scripts/common/GenericAethernetShard.lua b/resources/scripts/events/common/GenericAethernetShard.lua similarity index 100% rename from resources/scripts/common/GenericAethernetShard.lua rename to resources/scripts/events/common/GenericAethernetShard.lua diff --git a/resources/scripts/common/GenericAetheryte.lua b/resources/scripts/events/common/GenericAetheryte.lua similarity index 100% rename from resources/scripts/common/GenericAetheryte.lua rename to resources/scripts/events/common/GenericAetheryte.lua diff --git a/resources/scripts/common/GenericMender.lua b/resources/scripts/events/common/GenericMender.lua similarity index 100% rename from resources/scripts/common/GenericMender.lua rename to resources/scripts/events/common/GenericMender.lua diff --git a/resources/scripts/common/GenericWarp.lua b/resources/scripts/events/common/GenericWarp.lua similarity index 100% rename from resources/scripts/common/GenericWarp.lua rename to resources/scripts/events/common/GenericWarp.lua diff --git a/resources/scripts/custom/000/cmndefinnbed_00020.lua b/resources/scripts/events/custom/000/cmndefinnbed_00020.lua similarity index 100% rename from resources/scripts/custom/000/cmndefinnbed_00020.lua rename to resources/scripts/events/custom/000/cmndefinnbed_00020.lua diff --git a/resources/scripts/opening/OpeningGridania.lua b/resources/scripts/events/quest/opening/OpeningGridania.lua similarity index 100% rename from resources/scripts/opening/OpeningGridania.lua rename to resources/scripts/events/quest/opening/OpeningGridania.lua diff --git a/resources/scripts/opening/OpeningLimsaLominsa.lua b/resources/scripts/events/quest/opening/OpeningLimsaLominsa.lua similarity index 100% rename from resources/scripts/opening/OpeningLimsaLominsa.lua rename to resources/scripts/events/quest/opening/OpeningLimsaLominsa.lua diff --git a/resources/scripts/opening/OpeningUldah.lua b/resources/scripts/events/quest/opening/OpeningUldah.lua similarity index 100% rename from resources/scripts/opening/OpeningUldah.lua rename to resources/scripts/events/quest/opening/OpeningUldah.lua diff --git a/resources/scripts/tosort/Armoire.lua b/resources/scripts/events/tosort/Armoire.lua similarity index 100% rename from resources/scripts/tosort/Armoire.lua rename to resources/scripts/events/tosort/Armoire.lua diff --git a/resources/scripts/tosort/Chocobokeep.lua b/resources/scripts/events/tosort/Chocobokeep.lua similarity index 100% rename from resources/scripts/tosort/Chocobokeep.lua rename to resources/scripts/events/tosort/Chocobokeep.lua diff --git a/resources/scripts/tosort/CrystalBell.lua b/resources/scripts/events/tosort/CrystalBell.lua similarity index 100% rename from resources/scripts/tosort/CrystalBell.lua rename to resources/scripts/events/tosort/CrystalBell.lua diff --git a/resources/scripts/tosort/DeliveryMoogle.lua b/resources/scripts/events/tosort/DeliveryMoogle.lua similarity index 100% rename from resources/scripts/tosort/DeliveryMoogle.lua rename to resources/scripts/events/tosort/DeliveryMoogle.lua diff --git a/resources/scripts/tosort/GlamourDresser.lua b/resources/scripts/events/tosort/GlamourDresser.lua similarity index 100% rename from resources/scripts/tosort/GlamourDresser.lua rename to resources/scripts/events/tosort/GlamourDresser.lua diff --git a/resources/scripts/tosort/MarketBoard.lua b/resources/scripts/events/tosort/MarketBoard.lua similarity index 100% rename from resources/scripts/tosort/MarketBoard.lua rename to resources/scripts/events/tosort/MarketBoard.lua diff --git a/resources/scripts/tosort/Orchestrion.lua b/resources/scripts/events/tosort/Orchestrion.lua similarity index 100% rename from resources/scripts/tosort/Orchestrion.lua rename to resources/scripts/events/tosort/Orchestrion.lua diff --git a/resources/scripts/tosort/SummoningBell.lua b/resources/scripts/events/tosort/SummoningBell.lua similarity index 100% rename from resources/scripts/tosort/SummoningBell.lua rename to resources/scripts/events/tosort/SummoningBell.lua diff --git a/resources/scripts/tosort/ToyChest.lua b/resources/scripts/events/tosort/ToyChest.lua similarity index 100% rename from resources/scripts/tosort/ToyChest.lua rename to resources/scripts/events/tosort/ToyChest.lua diff --git a/resources/scripts/tosort/UnendingJourney.lua b/resources/scripts/events/tosort/UnendingJourney.lua similarity index 100% rename from resources/scripts/tosort/UnendingJourney.lua rename to resources/scripts/events/tosort/UnendingJourney.lua diff --git a/resources/scripts/warp/WarpInnGeneric.lua b/resources/scripts/events/warp/WarpInnGeneric.lua similarity index 100% rename from resources/scripts/warp/WarpInnGeneric.lua rename to resources/scripts/events/warp/WarpInnGeneric.lua diff --git a/resources/scripts/items/Items.lua b/resources/scripts/items/Items.lua new file mode 100644 index 0000000..826100f --- /dev/null +++ b/resources/scripts/items/Items.lua @@ -0,0 +1,3 @@ +-- Please keep these ids sorted! + +registerAction(6221, "items/Fantasia.lua") diff --git a/src/bin/kawari-world.rs b/src/bin/kawari-world.rs index c456faf..840346d 100644 --- a/src/bin/kawari-world.rs +++ b/src/bin/kawari-world.rs @@ -20,7 +20,7 @@ use kawari::packet::oodle::OodleNetwork; use kawari::packet::{ ConnectionType, PacketSegment, PacketState, SegmentData, SegmentType, send_keep_alive, }; -use kawari::world::{ChatHandler, ExtraLuaState, Zone, ZoneConnection, load_global_script}; +use kawari::world::{ChatHandler, ExtraLuaState, Zone, ZoneConnection, load_init_script}; use kawari::world::{ ClientHandle, Event, FromServer, LuaPlayer, PlayerData, ServerHandle, StatusEffects, ToServer, WorldDatabase, handle_custom_ipc, server_main_loop, @@ -526,7 +526,7 @@ async fn client_loop( lua.load( std::fs::read(&file_name) - .expect("Failed to locate scripts directory!"), + .expect(format!("Failed to load script file {}!", &file_name).as_str()), ) .set_name("@".to_string() + &file_name) .exec()?; @@ -976,8 +976,8 @@ async fn main() { { let mut lua = lua.lock().unwrap(); - if let Err(err) = load_global_script(&mut lua) { - tracing::warn!("Failed to load Global.lua: {:?}", err); + if let Err(err) = load_init_script(&mut lua) { + tracing::warn!("Failed to load Init.lua: {:?}", err); } } diff --git a/src/world/connection.rs b/src/world/connection.rs index 2b982d7..b8489cb 100644 --- a/src/world/connection.rs +++ b/src/world/connection.rs @@ -35,7 +35,7 @@ use super::{ Actor, CharacterData, EffectsBuilder, Event, LuaPlayer, StatusEffects, ToServer, WorldDatabase, Zone, common::{ClientId, ServerHandle}, - load_global_script, + load_init_script, lua::Task, }; @@ -682,8 +682,8 @@ impl ZoneConnection { /// Reloads Global.lua pub fn reload_scripts(&mut self) { let mut lua = self.lua.lock().unwrap(); - if let Err(err) = load_global_script(&mut lua) { - tracing::warn!("Failed to load Global.lua: {:?}", err); + if let Err(err) = load_init_script(&mut lua) { + tracing::warn!("Failed to load Init.lua: {:?}", err); } } diff --git a/src/world/lua.rs b/src/world/lua.rs index dce8896..da95c1e 100644 --- a/src/world/lua.rs +++ b/src/world/lua.rs @@ -414,8 +414,8 @@ impl FromLua for EffectsBuilder { } } -/// Loads `Global.lua` -pub fn load_global_script(lua: &mut Lua) -> mlua::Result<()> { +/// Loads `Init.lua` +pub fn load_init_script(lua: &mut Lua) -> mlua::Result<()> { let register_action_func = lua.create_function(|lua, (action_id, action_script): (u32, String)| { let mut state = lua.app_data_mut::().unwrap(); @@ -448,7 +448,7 @@ pub fn load_global_script(lua: &mut Lua) -> mlua::Result<()> { .set("EffectsBuilder", effectsbuilder_constructor)?; let config = get_config(); - let file_name = format!("{}/Global.lua", &config.world.scripts_location); + let file_name = format!("{}/Init.lua", &config.world.scripts_location); lua.load(std::fs::read(&file_name).expect("Failed to locate scripts directory!")) .set_name("@".to_string() + &file_name) .exec()?; diff --git a/src/world/mod.rs b/src/world/mod.rs index 9f723d6..8658cf1 100644 --- a/src/world/mod.rs +++ b/src/world/mod.rs @@ -11,7 +11,7 @@ mod database; pub use database::{CharacterData, WorldDatabase}; mod lua; -pub use lua::{EffectsBuilder, LuaPlayer, load_global_script}; +pub use lua::{EffectsBuilder, LuaPlayer, load_init_script}; mod event; pub use event::Event;