@echo off

REM Set the path to the nwn_erf.exe executable
set nwn_erf=..\_tools\nwn_erf.exe

REM Set the output ERF file name
set erf_output=prc8_companion.hak

REM Set the Baseitem directory path
set working_dir=..\_content\DynamicPlayerModels\

REM Set folder for the various merge 2DAs
set source_dir=..\_content\2DAs\

REM Delete existing 2DAs
del %working_dir%\2DA\*.2da

REM Copy correct 2DAs into working folder
copy "%source_dir%\NWN_2DAs\*.2da" "%working_dir%\2DA\"

REM Create the ERF file by iterating through subfolders
%nwn_erf% -f %erf_output% -e HAK -r 99 -v -c %working_dir%

REM echo Source directory: %source_dir%
REM echo Destination directory: %working_dir%

echo Hak file created: %erf_output%
pause