@echo off
:value
set /p funds=Desired vendors money amount mod (from 1 to 99):
set /p sale=Desired sale percentage (from 01 to 99):
Set "basefunds=mod_funds;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1"
Set "basesale=mod_sale;0.50;0.50;0.50;0.50;0.50;0.50;0.50;0.50"
Set "singledigit=mod_funds;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%                            "
Set "doubledigit=mod_funds;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%;%funds%           "
Set "salereplace=mod_sale;0.%sale%;0.%sale%;0.%sale%;0.%sale%;0.%sale%;0.%sale%;0.%sale%;0.%sale%"
set "source=InstallWVwFS\gameplay\globals\economy_tagmodifiers_base.csv"
set "target=InstallWVwFS\gameplay\globals\economy_tagmodifiers.csv"
if %funds% LSS 10 goto singledigit
if %funds% GEQ 10 goto doubledigit
:singledigit
setlocal enableDelayedExpansion
(
   for /F "tokens=1* delims=:" %%a in ('findstr /N "^" %source%') do (
      set "line=%%b"
      if defined line set "line=!line:%basefunds%=%singledigit%!"
	  if defined line set "line=!line:%basesale%=%salereplace%!"
      echo(!line!
   )
) > %target%
endlocal
goto reimport
:doubledigit
setlocal enableDelayedExpansion
(
    for /F "tokens=1* delims=:" %%a in ('findstr /N "^" %source%') do (
      set "line=%%b"
      if defined line set "line=!line:%basefunds%=%doubledigit%!"
	  if defined line set "line=!line:%basesale%=%salereplace%!"
      echo(!line!
   )
) > %target%
endlocal
goto reimport

:reimport
@echo on
quickbms -G -w -r witcher.bms startup.bundle InstallWVwFS/