@echo off

echo.
echo  Lineage II C4 Decoder Tool       By: Remolus
echo  -------------------------------------------------------------------
echo.
echo  This program will decode these files:
echo.
echo  armorgrp.dat       creditgrp-e.dat
echo  etcitemgrp.dat     itemname-e.dat
echo  npcname-e.dat      servername-e.dat
echo  skillname-e.dat    symbolname-e.dat
echo  systemmsg-e.dat    weapongrp.dat
echo  zonename-e.dat     l2.ini
echo  Option.ini	 All *.int files
echo  npcgrp.dat	 skillgrp.dat
echo  -------------------------------------------------------------------
echo.
echo.
echo.

echo  #######################################
echo  # Options:                            #
echo  #######################################
echo  #                                     #
echo  # Y = Yes        N = No      Q = Quit #
echo  #######################################
echo.

REM ##################################################################

:armorgrp
set armorgrp=x
set /p armorgrp=Desire to decode file armorgrp.dat? - 
if /i %armorgrp%==Y goto armorgrpinstall
if /i %armorgrp%==N goto creditgrp
if /i %armorgrp%==Q goto end

:armorgrpinstall
l2encdec -s armorgrp.dat
goto creditgrp

REM #################################################################

:creditgrp
set creditgrp=x
set /p creditgrp=Desire to decode file creditgrp-e.dat? - 
if /i %creditgrp%==Y goto creditgrpinstall
if /i %creditgrp%==N goto etcitemgrp
if /i %creditgrp%==Q goto end

:creditgrpinstall
l2encdec -s creditgrp-e.dat
goto etcitemgrp

REM ################################################################

:etcitemgrp
set etcitemgrp=x
set /p etcitemgrp=Desire to decode file etcitemgrp.dat? - 
if /i %etcitemgrp%==Y goto etcitemgrpinstall
if /i %etcitemgrp%==N goto itemname
if /i %etcitemgrp%==Q goto end

:etcitemgrpinstall
l2encdec -s etcitemgrp.dat
goto itemname

REM ################################################################

:itemname
set itemname=x
set /p itemname=Desire to decode file itemname-e.dat? - 
if /i %itemname%==Y goto itemnameinstall
if /i %itemname%==N goto npcname
if /i %itemname%==Q goto end

:itemnameinstall
l2encdec -s itemname-e.dat
goto npcname

REM ################################################################

:npcname
set npcname=x
set /p npcname=Desire to decode file npcname-e.dat? - 
if /i %npcname%==Y goto npcnameinstall
if /i %npcname%==N goto npcgrp
if /i %npcname%==Q goto end

:npcnameinstall
l2encdec -s npcname-e.dat
goto npcgrp

REM ################################################################

:npcgrp
set npcgrp=x
set /p npcgrp=Desire to decode file npcgrp.dat? - 
if /i %npcgrp%==Y goto npcgrpinstall
if /i %npcgrpe%==N goto servername
if /i %npcgrp%==Q goto end

:npcgrpinstall
l2encdec -s npcgrp.dat
goto servername
REM ################################################################

:servername
set servername=x
set /p servername=Desire to decode file servername-e.dat? - 
if /i %servername%==Y goto servernameinstall
if /i %servername%==N goto skillname
if /i %servername%==Q goto end

:servernameinstall
l2encdec -s servername-e.dat
goto skillname

REM ################################################################

:skillname
set skillname=x
set /p skillname=Desire to decode file skillname-e.dat? - 
if /i %skillname%==Y goto skillnameinstall
if /i %skillname%==N goto symbolname
if /i %skillname%==Q goto end

:skillnameinstall
l2encdec -s skillname-e.dat
goto symbolname

REM ################################################################

:symbolname
set symbolname=x
set /p symbolname=Desire to decode file symbolname-e.dat? - 
if /i %symbolname%==Y goto symbolnameinstall
if /i %symbolname%==N goto systemmsg
if /i %symbolname%==Q goto end

:symbolnameinstall
l2encdec -s symbolname-e.dat
goto systemmsg

REM ################################################################

:systemmsg
set systemmsg=x
set /p systemmsg=Desire to decode file systemmsg-e.dat? - 
if /i %systemmsg%==Y goto systemmsginstall
if /i %systemmsg%==N goto weapongrp
if /i %systemmsg%==Q goto end

:systemmsginstall
l2encdec -s systemmsg-e.dat
goto weapongrp

REM ################################################################

:weapongrp
set weapongrp=x
set /p weapongrp=Desire to decode file weapongrp.dat? - 
if /i %weapongrp%==Y goto weapongrpinstall
if /i %weapongrp%==N goto zonename
if /i %weapongrp%==Q goto end

:weapongrpinstall
l2encdec -s weapongrp.dat
goto zonename

REM ################################################################

:zonename
set zonename=x
set /p zonename=Desire to decode file zonename.dat? - 
if /i %zonename%==Y goto zonenameinstall
if /i %zonename%==N goto skillgrp
if /i %zonename%==Q goto end

:zonenameinstall
l2encdec -s zonename-e.dat
goto skillgrp

REM ################################################################

:skillgrp
set skillgrp=x
set /p skillgrp=Desire to decode file skillgrp.dat? - 
if /i %skillgrp%==Y goto skillgrpinstall
if /i %skillgrp%==N goto l2ini
if /i %skillgrp%==Q goto end

:skillgrpinstall
l2encdec -s skillgrp.dat
goto l2ini

REM ################################################################

:l2ini
set l2ini=x
set /p l2ini=Desire to decode file l2.ini? - 
if /i %l2ini%==Y goto decl2ini
if /i %l2ini%==N goto Optionini
if /i %l2ini%==Q goto end

:decl2ini
l2encdec -s l2.ini
goto Optionini

REM ################################################################

:Optionini
set Optionini=x
set /p Optionini=Desire to decode file Option.ini? - 
if /i %Optionini%==Y goto decOptionini
if /i %Optionini%==N goto intfiles
if /i %Optionini%==Q goto end

:decOptionini
l2encdec -s Option.ini
goto intfiles

REM ################################################################

:intfiles
set intfiles=x
set /p intfiles=Desire to decode all *.int files? - 
if /i %intfiles%==Y goto decintfiles
if /i %intfiles%==N goto backup
if /i %intfiles%==Q goto end

:decintfiles
l2encdec -s alaudio.int
l2encdec -s bighead.int
l2encdec -s cloak.int
l2encdec -s core.int
l2encdec -s engine.int
l2encdec -s env.int
l2encdec -s hair.int
l2encdec -s ipdrv.int
l2encdec -s l2.int
l2encdec -s lineage2.int
l2encdec -s lineagemonster2.int
l2encdec -s lineagemonster.int
l2encdec -s lineagenpc.int
l2encdec -s lineagewarrior.int
l2encdec -s soulshot.int
l2encdec -s timeenv0.int
l2encdec -s timeenv1.int
l2encdec -s timeenv2.int
l2encdec -s windrv.int
goto backup

REM ################################################################

echo.
echo.
echo All files has been sucessfully decoded!
echo.
echo.
goto backup

REM ################################################################

:backup
set backup=x
set /p backup=Desire to make Backup? - 
if /i %backup%==Y goto backupexec
if /i %backup%==N goto rename
if /i %backup%==Q goto end

:backupexec
move armorgrp.dat .\Backup(Encoded)
move etcitemgrp.dat .\Backup(Encoded)
move creditgrp-e.dat .\Backup(Encoded)
move itemname-e.dat .\Backup(Encoded)
move npcname-e.dat .\Backup(Encoded)
move npcgrp.dat .\Backup(Encoded)
move servername-e.dat .\Backup(Encoded)
move skillname-e.dat .\Backup(Encoded)
move skillgrp.dat .\Backup(Encoded)
move symbolname-e.dat .\Backup(Encoded)
move systemmsg-e.dat .\Backup(Encoded)
move weapongrp.dat .\Backup(Encoded)
move zonename-e.dat .\Backup(Encoded)
move l2.ini .\Backup(Encoded)
move Option.ini .\Backup(Encoded)
move alaudio.int .\Backup(Encoded)
move bighead.int .\Backup(Encoded)
move cloak.int .\Backup(Encoded)
move core.int .\Backup(Encoded)
move engine.int .\Backup(Encoded)
move env.int .\Backup(Encoded)
move hair.int .\Backup(Encoded)
move ipdrv.int .\Backup(Encoded)
move l2.int .\Backup(Encoded)
move lineage2.int .\Backup(Encoded)
move lineagemonster2.int .\Backup(Encoded)
move lineagemonster.int .\Backup(Encoded)
move lineagenpc.int .\Backup(Encoded)
move lineagewarrior.int .\Backup(Encoded)
move soulshot.int .\Backup(Encoded)
move timeenv0.int .\Backup(Encoded)
move timeenv1.int .\Backup(Encoded)
move timeenv2.int .\Backup(Encoded)
move windrv.int .\Backup(Encoded)

REM ################################################################

echo.
echo.
echo All files has been sucessfully saved!
echo.
echo.
goto rename

REM ################################################################

:rename
set rename=x
set /p rename=Desire to rename the files? - 
if /i %rename%==Y goto renameexec
if /i %rename%==N goto finish
if /i %rename%==Q goto end

:renameexec
ren dec-armorgrp.dat armorgrp.dat
ren dec-creditgrp-e.dat creditgrp-e.dat
ren dec-etcitemgrp.dat etcitemgrp.dat
ren dec-itemname-e.dat itemname-e.dat
ren dec-npcname-e.dat npcname-e.dat
ren dec-npcgrp.dat npcgrp.dat
ren dec-servername-e.dat servername-e.dat
ren dec-skillname-e.dat skillname-e.dat
ren dec-skillgrp.dat skillgrp.dat
ren dec-symbolname-e.dat symbolname-e.dat
ren dec-systemmsg-e.dat systemmsg-e.dat
ren dec-weapongrp.dat weapongrp.dat
ren dec-zonename-e.dat zonename-e.dat
ren dec-l2.ini l2.ini
ren dec-Option.ini Option.ini
ren dec-alaudio.int alaudio.int
ren dec-bighead.int bighead.int
ren dec-cloak.int cloak.int
ren dec-core.int core.int
ren dec-engine.int engine.int
ren dec-env.int env.int
ren dec-hair.int hair.int
ren dec-ipdrv.int ipdrv.int
ren dec-l2.int l2.int
ren dec-lineage2.int lineage2.int
ren dec-lineagemonster2.int lineagemonster2.int
ren dec-lineagemonster.int lineagemonster.int
ren dec-lineagenpc.int lineagenpc.int
ren dec-lineagewarrior.int lineagewarrior.int
ren dec-soulshot.int soulshot.int
ren dec-timeenv0.int timeenv0.int
ren dec-timeenv1.int timeenv1.int
ren dec-timeenv2.int timeenv2.int
ren dec-windrv.int windrv.int

REM ################################################################

echo.
echo.
echo All files has been sucessfully renamed!
echo.
echo.
goto move

REM ################################################################

:move
set move=x
set /p move=Desire to move the files? - 
if /i %move%==Y goto moveexec
if /i %move%==N goto finish
if /i %move%==Q goto end

:moveexec 
move *.dat .\en
move *.ini .\en
move *.int .\en

REM ################################################################

echo.
echo.
echo All files has been sucessfully moved!
echo.
echo.
goto finish

REM ################################################################

:finish
set finish=x
set /p finish=Thanks for using Lineage II Decoder by Remolus ® 2006 (Press now Q to quit) - 
if /i %finish%==Q goto end


