-----------------------------------
-- Zone: Southern_San_dOria_[S] (80)
-----------------------------------
local ID = zones[xi.zone.SOUTHERN_SAN_DORIA_S]
-----------------------------------
---@type TZone
local zoneObject = {}

zoneObject.onInitialize = function(zone)
    xi.chocobo.initZone(zone)
    xi.extravaganza.shadowEraHide(ID.npc.SHIXO)
end

zoneObject.onZoneIn = function(player, prevZone)
    if prevZone == xi.zone.EAST_RONFAURE_S then
        if
            player:getQuestStatus(xi.questLog.CRYSTAL_WAR, xi.quest.id.crystalWar.KNOT_QUITE_THERE) == xi.questStatus.QUEST_ACCEPTED and
            player:getCharVar('KnotQuiteThere') == 2
        then
            return 62
        end
    end

    return xi.moghouse.onMoghouseZoneEvent(player, prevZone)
end

zoneObject.onTriggerAreaEnter = function(player, triggerArea)
end

zoneObject.onEventUpdate = function(player, csid, option, npc)
end

zoneObject.onEventFinish = function(player, csid, option, npc)
    if csid == 62 then
        player:setCharVar('KnotQuiteThere', 3)
    end
end

return zoneObject
