#!/bin/bash
mv * ../
cd ../
if [ -e ../NWINTER.GRP ]; then
mv ../NWINTER.GRP ./
fi
if [ -e NWINTER.GRP ]; then
./kextract NWINTER.GRP E2L*.MAP
mv E2L1.MAP nwl1.map
mv E2L2.MAP nwl2.map
mv E2L3.MAP nwl3.map
mv E2L4.MAP nwl4.map
mv E2L5.MAP nwl5.map
mv E2L6.MAP nwl6.map
mv E2L7.MAP nwl7.map
mv E2L8.MAP nwl8.map
./bspatch nwl1.map nwl1.map nwl1.patch
./bspatch nwl2.map nwl2.map nwl2.patch
./bspatch nwl3.map nwl3.map nwl3.patch
./bspatch nwl4.map nwl4.map nwl4.patch
./bspatch nwl5.map nwl5.map nwl5.patch
./bspatch nwl6.map nwl6.map nwl6.patch
./bspatch nwl7.map nwl7.map nwl7.patch
./bspatch nwl8.map nwl8.map nwl8.patch
echo "Patching complete!"
else
echo "NWINTER.GRP does not exist."
echo "Run this script again with NWINTER.GRP in this directory."
fi