@echo off

echo.
echo  Lineage II C4 Encoder Tool       By: Remolus
echo  -------------------------------------------------------------------
echo.
echo  This program will encode 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 encode file armorgrp.dat? - 
if /i %armorgrp%==Y goto armorgrpinstall
if /i %armorgrp%==N goto creditgrp
if /i %armorgrp%==Q goto end

:armorgrpinstall
l2encdec -h 413 armorgrp.dat
goto creditgrp

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

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

:creditgrpinstall
l2encdec -h 413 creditgrp-e.dat
goto etcitemgrp

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

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

:etcitemgrpinstall
l2encdec -h 413 etcitemgrp.dat
goto itemname

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

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

:itemnameinstall
l2encdec -h 413 itemname-e.dat
goto npcname

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

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

:npcnameinstall
l2encdec -h 413 npcname-e.dat
goto npcgrp

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

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

:npcgrpinstall
l2encdec -h 413 npcgrp.dat
goto servername

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

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

:servernameinstall
l2encdec -h 413 servername-e.dat
goto skillname

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

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

:skillnameinstall
l2encdec -h 413 skillname-e.dat
goto skillgrp

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

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

:skillgrpinstall
l2encdec -h 413 skillgrp.dat
goto symbolname

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

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

:symbolnameinstall
l2encdec -h 413 symbolname-e.dat
goto systemmsg

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

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

:systemmsginstall
l2encdec -h 413 systemmsg-e.dat
goto weapongrp

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

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

:weapongrpinstall
l2encdec -h 413 weapongrp.dat
goto zonename

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

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

:zonenameinstall
l2encdec -h 413 zonename-e.dat
goto l2ini

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

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

:decl2ini
l2encdec -h 413 l2.ini
goto Optionini

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

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

:decOptionini
l2encdec -h 413 Option.ini
goto intfiles

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

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

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

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

echo All files has been sucessfully encoded!
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(Decoded)
move creditgrp-e.dat .\Backup(Decoded)
move etcitemgrp.dat .\Backup(Decoded)
move itemname-e.dat .\Backup(Decoded)
move npcname-e.dat .\Backup(Decoded)
move npcgrp.dat .\Backup(Decoded)
move servername-e.dat .\Backup(Decoded)
move skillname-e.dat .\Backup(Decoded)
move skillgrp.dat .\Backup(Decoded)
move symbolname-e.dat .\Backup(Decoded)
move systemmsg-e.dat .\Backup(Decoded)
move weapongrp.dat .\Backup(Decoded)
move zonename-e.dat .\Backup(Decoded)
move l2.ini .\Backup(Decoded)
move Option.ini .\Backup(Decoded)
move alaudio.int .\Backup(Decoded)
move bighead.int .\Backup(Decoded)
move cloak.int .\Backup(Decoded)
move core.int .\Backup(Decoded)
move engine.int .\Backup(Decoded)
move env.int .\Backup(Decoded)
move hair.int .\Backup(Decoded)
move ipdrv.int .\Backup(Decoded)
move l2.int .\Backup(Decoded)
move lineage2.int .\Backup(Decoded)
move lineagemonster2.int .\Backup(Decoded)
move lineagemonster.int .\Backup(Decoded)
move lineagenpc.int .\Backup(Decoded)
move lineagewarrior.int .\Backup(Decoded)
move soulshot.int .\Backup(Decoded)
move timeenv0.int .\Backup(Decoded)
move timeenv1.int .\Backup(Decoded)
move timeenv2.int .\Backup(Decoded)
move windrv.int .\Backup(Decoded)

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

echo All files has been sucessfully saved!
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 enc-armorgrp.dat armorgrp.dat
ren enc-creditgrp-e.dat creditgrp-e.dat
ren enc-etcitemgrp.dat etcitemgrp.dat
ren enc-itemname-e.dat itemname-e.dat
ren enc-npcname-e.dat npcname-e.dat
ren enc-servername-e.dat servername-e.dat
ren enc-skillname-e.dat skillname-e.dat
ren enc-skillgrp.dat skillgrp.dat
ren enc-symbolname-e.dat symbolname-e.dat
ren enc-systemmsg-e.dat systemmsg-e.dat
ren enc-weapongrp.dat weapongrp.dat
ren enc-zonename-e.dat zonename-e.dat
ren enc-l2.ini l2.ini
ren enc-Option.ini Option.ini
ren enc-alaudio.int alaudio.int
ren enc-bighead.int bighead.int
ren enc-cloak.int cloak.int
ren enc-core.int core.int
ren enc-engine.int engine.int
ren enc-env.int env.int
ren enc-hair.int hair.int
ren enc-ipdrv.int ipdrv.int
ren enc-l2.int l2.int
ren enc-lineage2.int lineage2.int
ren enc-lineagemonster2.int lineagemonster2.int
ren enc-lineagemonster.int lineagemonster.int
ren enc-lineagenpc.int lineagenpc.int
ren enc-lineagewarrior.int lineagewarrior.int
ren enc-soulshot.int soulshot.int
ren enc-timeenv0.int timeenv0.int
ren enc-timeenv1.int timeenv1.int
ren enc-timeenv2.int timeenv2.int
ren enc-windrv.int windrv.int
ren enc-npcgrp.dat npcgrp.dat
REM ################################################################

echo All files has been sucessfully renamed!
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 .\New-Files
move *.ini .\New-Files
move *.int .\New-Files

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 Encoder by Remolus ® 2006 (Press now Q to quit) - 
if /i %finish%==Q goto end


