#!/usr/bin/env bash
# Changelog:
# 2021-01-10
#   - Add syc_* appratus which i missed earlier, looking only on direct conflicts
# 2021-01-11
#   - Rename remaining SM apparatus
#
# vim: nowrap
# command used for formatting text: '<,'>EasyAlign 4/\-\-/r0 ; '<,'>EasyAlign / '/r0
result="Syc_AtHomeAlchemy - BTBGI.esp"
source1="Syc_AtHomeAlchemy.esp"
tes3cmd="./tes3cmd"

# copy original file
cp -v "${source1}" "${result}"

# modify records
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_a_alembic_01"     --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.3')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_a_alembic_01"     --run "\$R->set({t=>'AADT',f=>'Weight'},   '30')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_a_calcinator_01"  --run "\$R->set({t=>'AADT',f=>'Value'},    '25')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_a_calcinator_01"  --run "\$R->set({t=>'AADT',f=>'Weight'},   '40')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_a_mortar_01"      --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.6')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_a_mortar_01"      --run "\$R->set({t=>'AADT',f=>'Weight'},   '10')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_a_retort_01"      --run "\$R->set({t=>'AADT',f=>'Value'},    '75')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_a_retort_01"      --run "\$R->set({t=>'AADT',f=>'Weight'},   '20')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_alembic_01"     --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.2')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_alembic_01"     --run "\$R->set({t=>'AADT',f=>'Value'},    '10000')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_alembic_01"     --run "\$R->set({t=>'AADT',f=>'Weight'},   '15')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_calcinator_01"  --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.2')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_calcinator_01"  --run "\$R->set({t=>'AADT',f=>'Value'},    '7500')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_calcinator_01"  --run "\$R->set({t=>'AADT',f=>'Weight'},   '20')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_mortar_01"      --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.2')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_mortar_01"      --run "\$R->set({t=>'AADT',f=>'Value'},    '15000')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_mortar_01"      --run "\$R->set({t=>'AADT',f=>'Weight'},   '5')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_retort_01"      --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.2')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_retort_01"      --run "\$R->set({t=>'AADT',f=>'Value'},    '12500')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_g_retort_01"      --run "\$R->set({t=>'AADT',f=>'Weight'},   '10')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_alembic_01"     --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.6')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_alembic_01"     --run "\$R->set({t=>'AADT',f=>'Value'},    '300')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_alembic_01"     --run "\$R->set({t=>'AADT',f=>'Weight'},   '25')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_calcinator_01"  --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.75')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_calcinator_01"  --run "\$R->set({t=>'AADT',f=>'Value'},    '200')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_calcinator_01"  --run "\$R->set({t=>'AADT',f=>'Weight'},   '30')"
# these two are PfP's really
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_calcinator_01"  --run "\$R->set({t=>'ITEX',f=>'Icon'},     'm\\Tx_calcinator_02.tga')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_calcinator_01"  --run "\$R->set({t=>'MODL',f=>'Model'},    'm\\App_J_Calcinator_01.nif')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_mortar_01"      --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.9')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_mortar_01"      --run "\$R->set({t=>'AADT',f=>'Value'},    '500')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_mortar_01"      --run "\$R->set({t=>'AADT',f=>'Weight'},   '8')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_retort_01"      --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.75')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_retort_01"      --run "\$R->set({t=>'AADT',f=>'Value'},    '400')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_j_retort_01"      --run "\$R->set({t=>'AADT',f=>'Weight'},   '15')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_alembic_01"     --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.9')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_alembic_01"     --run "\$R->set({t=>'AADT',f=>'Value'},    '1500')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_alembic_01"     --run "\$R->set({t=>'AADT',f=>'Weight'},   '20')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_calcinator_01"  --run "\$R->set({t=>'AADT',f=>'Quality'},  '1')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_calcinator_01"  --run "\$R->set({t=>'AADT',f=>'Value'},    '1000')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_calcinator_01"  --run "\$R->set({t=>'AADT',f=>'Weight'},   '25')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_mortar_01"      --run "\$R->set({t=>'AADT',f=>'Quality'},  '1')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_mortar_01"      --run "\$R->set({t=>'AADT',f=>'Value'},    '2500')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_mortar_01"      --run "\$R->set({t=>'AADT',f=>'Weight'},   '7')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_retort_01"      --run "\$R->set({t=>'AADT',f=>'Quality'},  '1')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_retort_01"      --run "\$R->set({t=>'AADT',f=>'Value'},    '2000')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_m_retort_01"      --run "\$R->set({t=>'AADT',f=>'Weight'},   '12')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_alembic_01"    --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.3')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_alembic_01"    --run "\$R->set({t=>'AADT',f=>'Value'},    '12000')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_alembic_01"    --run "\$R->set({t=>'AADT',f=>'Weight'},   '10')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_alembic_01"    --run "\$R->set({t=>'FNAM',f=>'Name'},     'Secret Master\'s Alembic')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_calcinator_01" --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.3')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_calcinator_01" --run "\$R->set({t=>'AADT',f=>'Value'},    '10000')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_calcinator_01" --run "\$R->set({t=>'AADT',f=>'Weight'},   '15')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_calcinator_01" --run "\$R->set({t=>'FNAM',f=>'Name'},     'Secret Master\'s Calcinator')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_mortar_01"     --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.3')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_mortar_01"     --run "\$R->set({t=>'AADT',f=>'Value'},    '18000')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_mortar_01"     --run "\$R->set({t=>'AADT',f=>'Weight'},   '3')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_mortar_01"     --run "\$R->set({t=>'FNAM',f=>'Name'},     'Secret Master\'s Mortar & Pestle')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_retort_01"     --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.3')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_retort_01"     --run "\$R->set({t=>'AADT',f=>'Value'},    '15000')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_retort_01"     --run "\$R->set({t=>'AADT',f=>'Weight'},   '8')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "apparatus_sm_retort_01"     --run "\$R->set({t=>'FNAM',f=>'Name'},     'Secret Master\'s Retort')"
# Change: 2021-01-10 - Add syc_* appratus which i missed earlier, looking only on direct conflicts
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_a_alembic"              --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.3')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_a_mortar"               --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.6')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_g_alembic"              --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.2')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_g_calcinator"           --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.2')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_g_mortar"               --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.2')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_g_retort"               --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.2')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_j_alembic"              --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.6')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_j_calcinator"           --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.75')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_j_mortar"               --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.9')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_j_retort"               --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.75')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_m_alembic"              --run "\$R->set({t=>'AADT',f=>'Quality'},  '0.9')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_m_calcinator"           --run "\$R->set({t=>'AADT',f=>'Quality'},  '1')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_m_mortar"               --run "\$R->set({t=>'AADT',f=>'Quality'},  '1')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_m_retort"               --run "\$R->set({t=>'AADT',f=>'Quality'},  '1')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_sm_alembic"             --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.3')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_sm_calcinator"          --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.3')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_sm_mortar"              --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.3')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_sm_retort"              --run "\$R->set({t=>'AADT',f=>'Quality'},  '1.3')"
# Change: 2021-01-11 - Rename remaining SM apparatus
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_sm_alembic"             --run "\$R->set({t=>'FNAM',f=>'Name'},     'Secret Master\'s Alembic')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_sm_calcinator"          --run "\$R->set({t=>'FNAM',f=>'Name'},     'Secret Master\'s Calcinator')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_sm_mortar"              --run "\$R->set({t=>'FNAM',f=>'Name'},     'Secret Master\'s Mortar & Pestle')"
$tes3cmd modify "${result}" --hide-backups --type APPA --exact-id "syc_sm_retort"              --run "\$R->set({t=>'FNAM',f=>'Name'},     'Secret Master\'s Retort')"
