From 013c0d0a6bedfcefe623a1639dc35b1e3e8a71d4 Mon Sep 17 00:00:00 2001 From: emma-kenpo-star Date: Tue, 27 Jan 2026 14:35:02 -0500 Subject: [PATCH 1/2] [Module] era_moongate_time_set_to_July_13_2011_update --- modules/era/lua/era_moongate_time.lua | 68 +++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 modules/era/lua/era_moongate_time.lua diff --git a/modules/era/lua/era_moongate_time.lua b/modules/era/lua/era_moongate_time.lua new file mode 100644 index 00000000000..d977db49d41 --- /dev/null +++ b/modules/era/lua/era_moongate_time.lua @@ -0,0 +1,68 @@ +----------------------------------- +-- Era Override: Ro'Meave Moongate Time +-- Opens only on Full Moon between 00:00 and 03:00 +-- +-- Source: https://ffxiclopedia.fandom.com/wiki/Moongate_Pass_Quest?oldid=1493013 +-- Moongate Pass Quest did not change to 18:00 - 06:00 until the July 13, 2011 version update. +----------------------------------- +require('modules/module_utils') +require('scripts/globals/npc_util') +xi.module.ensureTable('xi.zones.RoMaeve') +----------------------------------- +local ID = zones[xi.zone.ROMAEVE] +----------------------------------- +local m = Module:new('era_moongate_time') + +local function setMoongatesOpen(isOpen) + local moongate1 = GetNPCByID(ID.npc.MOONGATE_OFFSET) + local moongate2 = GetNPCByID(ID.npc.MOONGATE_OFFSET + 1) + + if not moongate1 or not moongate2 then + return + end + + local desiredState = isOpen and 1 or 0 + if moongate1:getLocalVar('romaeveActive') == desiredState then + return + end + + for i = ID.npc.MOONGATE_OFFSET, ID.npc.MOONGATE_OFFSET + 7 do + local npc = GetNPCByID(i) + if npc then + npc:setAnimation(isOpen and xi.anim.OPEN_DOOR or xi.anim.CLOSE_DOOR) + end + end + + moongate2:setUntargetable(isOpen) + moongate1:setUntargetable(isOpen) + moongate1:setLocalVar('romaeveActive', desiredState) +end + +m:addOverride('xi.zones.RoMaeve.Zone.onInitialize', function(zone) + super(zone) + setMoongatesOpen(false) +end) + +m:addOverride('xi.zones.RoMaeve.Zone.onGameHour', function(zone) + local vanadielHour = VanadielHour() + local qm2 = GetNPCByID(ID.npc.BASTOK_7_1_QM) + local newPosition = npcUtil.pickNewPosition(ID.npc.BASTOK_7_1_QM, ID.npc.BASTOK_7_1_QM_POS, false) + + local isOpenWindow = + (getVanadielMoonCycle() == xi.moonCycle.FULL_MOON) and + (vanadielHour >= 0 and vanadielHour < 3) + setMoongatesOpen(isOpenWindow) + + if + vanadielHour == 0 or + vanadielHour == 6 or + vanadielHour == 12 or + vanadielHour == 18 + then + if qm2 then + npcUtil.queueMove(qm2, newPosition) + end + end +end) + +return m \ No newline at end of file From 4fcc2803d330a4a69bb3c3d81ebb6c8259d130aa Mon Sep 17 00:00:00 2001 From: emma-kenpo-star Date: Wed, 28 Jan 2026 15:13:36 -0500 Subject: [PATCH 2/2] [Module] era_moongate_time_to_open_gate --- modules/era/lua/era_moongate_time.lua | 65 +++++++++++++-------------- 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/modules/era/lua/era_moongate_time.lua b/modules/era/lua/era_moongate_time.lua index d977db49d41..27f3bb651d0 100644 --- a/modules/era/lua/era_moongate_time.lua +++ b/modules/era/lua/era_moongate_time.lua @@ -13,56 +13,51 @@ local ID = zones[xi.zone.ROMAEVE] ----------------------------------- local m = Module:new('era_moongate_time') -local function setMoongatesOpen(isOpen) - local moongate1 = GetNPCByID(ID.npc.MOONGATE_OFFSET) - local moongate2 = GetNPCByID(ID.npc.MOONGATE_OFFSET + 1) +local function activateRoMaeve(zone) + local validMoon = (getVanadielMoonCycle() == xi.moonCycle.FULL_MOON) + local validHour = (VanadielHour() >= 0 and VanadielHour() < 3) + local validWeather = (zone:getWeather() == xi.weather.NONE or zone:getWeather() == xi.weather.SUNSHINE) + + local shouldDoorsOpen = (validMoon and validHour) + local shouldFountainActivate = (validMoon and validHour and validWeather) - if not moongate1 or not moongate2 then - return + local moongate1 = GetNPCByID(ID.npc.MOONGATE_OFFSET) + if moongate1 then + moongate1:setUntargetable(shouldDoorsOpen) end - local desiredState = isOpen and 1 or 0 - if moongate1:getLocalVar('romaeveActive') == desiredState then - return + local moongate2 = GetNPCByID(ID.npc.MOONGATE_OFFSET + 1) + if moongate2 then + moongate2:setUntargetable(shouldDoorsOpen) end + -- Determine what the animation/status of the NPCs should be. + local doorStatus = shouldDoorsOpen and xi.anim.OPEN_DOOR or xi.anim.CLOSE_DOOR + local fountainStatus = shouldFountainActivate and xi.anim.OPEN_DOOR or xi.anim.CLOSE_DOOR + + -- Loop over the affected NPCs: Moongates, bridges and fountain for i = ID.npc.MOONGATE_OFFSET, ID.npc.MOONGATE_OFFSET + 7 do local npc = GetNPCByID(i) - if npc then - npc:setAnimation(isOpen and xi.anim.OPEN_DOOR or xi.anim.CLOSE_DOOR) + if i == ID.npc.MOONGATE_OFFSET + 6 then -- Fountain + if npc and npc:getAnimation() ~= fountainStatus then + npc:setAnimation(fountainStatus) + end + else + if npc and npc:getAnimation() ~= doorStatus then + npc:setAnimation(doorStatus) + end end end - - moongate2:setUntargetable(isOpen) - moongate1:setUntargetable(isOpen) - moongate1:setLocalVar('romaeveActive', desiredState) end m:addOverride('xi.zones.RoMaeve.Zone.onInitialize', function(zone) super(zone) - setMoongatesOpen(false) + activateRoMaeve(zone) end) m:addOverride('xi.zones.RoMaeve.Zone.onGameHour', function(zone) - local vanadielHour = VanadielHour() - local qm2 = GetNPCByID(ID.npc.BASTOK_7_1_QM) - local newPosition = npcUtil.pickNewPosition(ID.npc.BASTOK_7_1_QM, ID.npc.BASTOK_7_1_QM_POS, false) - - local isOpenWindow = - (getVanadielMoonCycle() == xi.moonCycle.FULL_MOON) and - (vanadielHour >= 0 and vanadielHour < 3) - setMoongatesOpen(isOpenWindow) - - if - vanadielHour == 0 or - vanadielHour == 6 or - vanadielHour == 12 or - vanadielHour == 18 - then - if qm2 then - npcUtil.queueMove(qm2, newPosition) - end - end + super(zone) + activateRoMaeve(zone) end) -return m \ No newline at end of file +return m