@PROMPT #
@SET NCL2=%ProgramFiles%\NCSoft\Lineage II\system\
@SET L2DEC=.\l2encdec_2.10.1\l2encdec.exe
@SET L2DIS=.\l2asm-disasm_1.4.1\l2disasm.exe
@SET DDF=.\l2asm-disasm_1.4.1\DAT_defs\CT2_5en\

@IF NOT EXIST "%L2DEC%"    @(ECHO %L2DEC%がみつかりません。 & PAUSE & GOTO :EOF)
@IF NOT EXIST "%L2DIS%"    @(ECHO %L2DIS%がみつかりません。 & PAUSE & GOTO :EOF)
@IF NOT EXIST "%DDF%*.ddf" @(ECHO %DDF%*.ddfがみつかりません。 & PAUSE & GOTO :EOF)

MKDIR temp 2>NUL
@rem decode.
"%L2DEC%" -g "%NCL2%\itemname-j.dat"   temp\itemname-j.dat
"%L2DEC%" -g "%NCL2%\npcname-j.dat"    temp\npcname-j.dat
"%L2DEC%" -g "%NCL2%\CastleName-j.dat" temp\castlename-j.dat
"%L2DEC%" -g "%NCL2%\skillname-j.dat"  temp\skillname-j.dat
"%L2DEC%" -g "%NCL2%\questname-j.dat"  temp\questname-j.dat
"%L2DEC%" -g "%NCL2%\sysstring-j.dat"  temp\sysstring-j.dat
"%L2DEC%" -g "%NCL2%\systemmsg-j.dat"  temp\systemmsg-j.dat
"%L2DEC%" -g "%NCL2%\ServerName-j.dat" temp\servername-j.dat
"%L2DEC%" -g "%NCL2%\npcstring-j.dat"  temp\npcstring-j.dat

touch -r "%NCL2%\itemname-j.dat"   temp\itemname-j.dat
touch -r "%NCL2%\npcname-j.dat"    temp\npcname-j.dat
touch -r "%NCL2%\CastleName-j.dat" temp\castlename-j.dat
touch -r "%NCL2%\skillname-j.dat"  temp\skillname-j.dat
touch -r "%NCL2%\questname-j.dat"  temp\questname-j.dat
touch -r "%NCL2%\sysstring-j.dat"  temp\sysstring-j.dat
touch -r "%NCL2%\systemmsg-j.dat"  temp\systemmsg-j.dat
touch -r "%NCL2%\ServerName-j.dat" temp\servername-j.dat
touch -r "%NCL2%\npcstring-j.dat"  temp\npcstring-j.dat

@rem disasamble.
"%L2DIS%" -d "%DDF%itemname-e.ddf"   temp\itemname-j.dat   temp\itemname-j.txt
"%L2DIS%" -d "%DDF%npcname-e.ddf"    temp\npcname-j.dat    temp\npcname-j.txt
"%L2DIS%" -d "%DDF%castlename-e.ddf" temp\castlename-j.dat temp\castlename-j.txt
"%L2DIS%" -d "%DDF%skillname-e.ddf"  temp\skillname-j.dat  temp\skillname-j.txt
"%L2DIS%" -d "%DDF%questname-e.ddf"  temp\questname-j.dat  temp\questname-j.txt
"%L2DIS%" -d "%DDF%sysstring-e.ddf"  temp\sysstring-j.dat  temp\sysstring-j.txt
"%L2DIS%" -d "%DDF%systemmsg-e.ddf"  temp\systemmsg-j.dat  temp\systemmsg-j.txt
"%L2DIS%" -d "%DDF%servername-e.ddf" temp\servername-j.dat temp\servername-j.txt
"%L2DIS%" -d "%DDF%npcstring-e.ddf"  temp\npcstring-j.dat  temp\npcstring-j.txt

touch -r temp\itemname-j.dat   temp\itemname-j.txt
touch -r temp\npcname-j.dat    temp\npcname-j.txt
touch -r temp\castlename-j.dat temp\castlename-j.txt
touch -r temp\skillname-j.dat  temp\skillname-j.txt
touch -r temp\questname-j.dat  temp\questname-j.txt
touch -r temp\sysstring-j.dat  temp\sysstring-j.txt
touch -r temp\systemmsg-j.dat  temp\systemmsg-j.txt
touch -r temp\servername-j.dat temp\servername-j.txt
touch -r temp\npcstring-j.dat temp\npcstring-j.txt

@rem formatting.
itemname_ja_sql.pl
npcname_ja_sql.pl
castlename_ja_sql.pl
skillname_ja_sql.pl
questname_ja_sql.pl
sysstring_ja_txt.pl
systemmsg_ja_txt.pl
servername_ja_xml.pl
npcstring_ja_txt.pl

@TITLE
@PAUSE
@PROMPT