@ECHO OFF
SET DG=..\GameDataFolder\level0_Final
FOR %%L IN (1 2 3 4 6 8 9 10 11 12 13 14 18 19) DO (
    FOR %%D IN (..\GameDataFolder\level%%L_Final) DO (
        IF EXIST %%D (
            ECHO Level %%L: moving local ONCC and subtrees to level 0...
            OniSplit.exe -move:delete %DG% %%D\ONCC*.oni
            ECHO Level %%L: moving orphan ONCC children to level 0...
            OniSplit.exe -move:delete %DG% %%D\TRBS*.oni
            OniSplit.exe -move:delete %DG% %%D\TRSC*.oni
            OniSplit.exe -move:delete %DG% %%D\TRAC*.oni
            OniSplit.exe -move:delete %DG% %%D\TRMA*.oni
            OniSplit.exe -move:delete %DG% %%D\TRCM*.oni
            ECHO Level %%L: moving orphan TRAC children to level 0...
            OniSplit.exe -move:delete %DG% %%D\TRAM*.oni
            ERASE %DG%\TRCM*.oni
        )
    )
)
