# npcpreservec
!! {It expects a Args containing a C array index}
!! {This initializes the array and acts as a gate to deny bad calls.}
$npctemp3 = $ARGS[0]
npctemp = mid($npctemp3, 2)
npclastsavedn = arrsize('$Bstat_PersType')
$npclastsaved = 'B'
$npclastsaved += npclastsavedn
if mid($npctemp3,1,1) = 'C':
	! {This copies the array from Array C to Array B}
	$Cstat_firstname[npctemp] = $Bstat_firstname[npclastsavedn]
	$Cstat_nickname[npctemp] = $Bstat_nickname[npclastsavedn]
	$Cstat_lastname[npctemp] = $Bstat_lastname[npclastsavedn]
	$Cstat_usedname[npctemp] = $Bstat_usedname[npclastsavedn]
	$Cstat_notes[npctemp] = $Bstat_notes[npclastsavedn]
	Cstat_dob[npctemp] = Bstat_dob[npclastsavedn]
	Cstat_vit[npctemp] = Bstat_vit[npclastsavedn]
	Cstat_str[npctemp] = Bstat_str[npclastsavedn]
	Cstat_int[npctemp] = Bstat_int[npclastsavedn]
	Cstat_agil[npctemp] = Bstat_agil[npclastsavedn]
	Cstat_spirit[npctemp] = Bstat_spirit[npclastsavedn]
	Cstat_mag[npctemp] = Bstat_mag[npclastsavedn]
	Cstat_drunk[npctemp] = Bstat_drunk[npclastsavedn]
	Cstat_undies[npctemp] = Bstat_undies[npclastsavedn]
	Cstat_cyc[npctemp] = Bstat_cyc[npclastsavedn]
	Cstat_fert[npctemp] = Bstat_fert[npclastsavedn]
	$Cstat_firstpart[npctemp] = $Bstat_firstpart[npclastsavedn]
	$Cstat_lastpart[npctemp] = $Bstat_lastpart[npclastsavedn]
	$Cstat_kidpater[npctemp] = $Bstat_kidpater[npclastsavedn]
	Cstat_gender[npctemp] = Bstat_gender[npclastsavedn]
	$Cstat_thdick[npctemp] = $Bstat_thdick[npclastsavedn]
	Cstat_dick[npctemp] = Bstat_dick[npclastsavedn]
	Cstat_sexskill[npctemp] = Bstat_sexskill[npclastsavedn]
	Cstat_spermpot[npctemp] = Bstat_spermpot[npclastsavedn]
	Cstat_vag[npctemp] = Bstat_vag[npclastsavedn]
	Cstat_ass[npctemp] = Bstat_ass[npclastsavedn]
	Cstat_hymen[npctemp] = Bstat_hymen[npclastsavedn]
	Cstat_horny[npctemp] = Bstat_horny[npclastsavedn]
	Cstat_Pavrep[npctemp] = Bstat_Pavrep[npclastsavedn]
	Cstat_Godrep[npctemp] = Bstat_Godrep[npclastsavedn]
	Cstat_app[npctemp] = Bstat_app[npclastsavedn]
	Cstat_lipstick[npctemp] = Bstat_lipstick[npclastsavedn]
	Cstat_makeup[npctemp] = Bstat_makeup[npclastsavedn]
	Cstat_sweat[npctemp] = Bstat_sweat[npclastsavedn]
	Cstat_dye[npctemp] = Bstat_dye[npclastsavedn]
	Cstat_hair[npctemp] = Bstat_hair[npclastsavedn]
	Cstat_skin[npctemp] = Bstat_skin[npclastsavedn]
	Cstat_bodyhair[npctemp] = Bstat_bodyhair[npclastsavedn]
	Cstat_breath[npctemp] = Bstat_breath[npclastsavedn]
	Cstat_hipcurv[npctemp] = Bstat_hipcurv[npclastsavedn]
	Cstat_hgt[npctemp] = Bstat_hgt[npclastsavedn]
	Cstat_bust[npctemp] = Bstat_bust[npclastsavedn]
	Cstat_nips[npctemp] = Bstat_nips[npclastsavedn]
	Cstat_fat[npctemp] = Bstat_fat[npclastsavedn]
	Cstat_pubes[npctemp] = Bstat_pubes[npclastsavedn]
	Cstat_hairlng[npctemp] = Bstat_hairlng[npclastsavedn]
	Cstat_haircol[npctemp] = Bstat_haircol[npclastsavedn]
	Cstat_haircurl[npctemp] = Bstat_haircurl[npclastsavedn]
	Cstat_tan[npctemp] = Bstat_tan[npclastsavedn]
	Cstat_lip[npctemp] = Bstat_lip[npclastsavedn]
	Cstat_lashes[npctemp] = Bstat_lashes[npclastsavedn]
	Cstat_eyesize[npctemp] = Bstat_eyesize[npclastsavedn]
	Cstat_eyecol[npctemp] = Bstat_eyecol[npclastsavedn]
	Cstat_dom[npctemp] = Bstat_dom[npclastsavedn]
	Cstat_sub[npctemp] = Bstat_sub[npclastsavedn]
	Cstat_glasses[npctemp] = Bstat_glasses[npclastsavedn]
	Cstat_grades[npctemp] = Bstat_grades[npclastsavedn]
	Cstat_run[npctemp] = Bstat_run[npclastsavedn]
	Cstat_vball[npctemp] = Bstat_vball[npclastsavedn]
	Cstat_nerd[npctemp] = Bstat_nerd[npclastsavedn]
	Cstat_shoot[npctemp] = Bstat_shoot[npclastsavedn]
	Cstat_sew[npctemp] = Bstat_sew[npclastsavedn]
	Cstat_serve[npctemp] = Bstat_serve[npclastsavedn]
	Cstat_chess[npctemp] = Bstat_chess[npclastsavedn]
	Cstat_dnc[npctemp] = Bstat_dnc[npclastsavedn]
	Cstat_erodnc[npctemp] = Bstat_erodnc[npclastsavedn]
	Cstat_jab[npctemp] = Bstat_jab[npclastsavedn]
	Cstat_punch[npctemp] = Bstat_punch[npclastsavedn]
	Cstat_kick[npctemp] = Bstat_kick[npclastsavedn]
	Cstat_def[npctemp] = Bstat_def[npclastsavedn]
	Cstat_sing[npctemp] = Bstat_sing[npclastsavedn]
	Cstat_teach[npctemp] = Bstat_teach[npclastsavedn]
	Cstat_Qstlvl[npctemp] = Bstat_Qstlvl[npclastsavedn]
	Cstat_rel[npctemp] = Bstat_rel[npclastsavedn]
	Cstat_love[npctemp] = Bstat_love[npclastsavedn]
	Cstat_job[npctemp] = Bstat_job[npclastsavedn]
	Cstat_cloc[npctemp] = Bstat_cloc[npclastsavedn]
	$Cstat_dad[npctemp] = $Bstat_dad[npclastsavedn]
	$Cstat_mom[npctemp] = $Bstat_mom[npclastsavedn]
	$Cstat_pic[npctemp] = $Bstat_pic[npclastsavedn]
	Cstat_herpes[npctemp] = Bstat_herpes[npclastsavedn]
	Cstat_syph[npctemp] = Bstat_syph[npclastsavedn]
	Cstat_gon[npctemp] = Bstat_gon[npclastsavedn]
	Cstat_chlam[npctemp] = Bstat_chlam[npclastsavedn]
	Cstat_Hiv[npctemp] = Bstat_Hiv[npclastsavedn]
	Cstat_genwart[npctemp] = Bstat_genwart[npclastsavedn]
	Cstat_Thrush[npctemp] = Bstat_Thrush[npclastsavedn]
	Cstat_Malen[npctemp] = Bstat_Malen[npclastsavedn]
	Cstat_Chem[npctemp] = Bstat_Chem[npclastsavedn]
	Cstat_Clothpref[npctemp] = Bstat_Clothpref[npclastsavedn]
	$Cstat_PersType[npctemp] = $Bstat_PersType[npclastsavedn]
	
	! {This checks the miscellanious arrays for the Entry and changes it to the new Array B}
	:npctempmloop
	npctemp2 = arrpos('$cumarrnam', $npctemp3)
	if npctemp2 >= 0: $cumarrnam[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$sparrnam', $npctemp3)
	if npctemp2 >= 0: $sparrnam[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$cumfthname', $npctemp3)
	if npctemp2 >= 0: $cumfthname[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$cumfthnames', $npctemp3)
	if npctemp2 >= 0: $cumfthnames[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$wombpotfath', $npctemp3)
	if npctemp2 >= 0: $wombpotfath[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$cumfathlotto', $npctemp3)
	if npctemp2 >= 0: $cumfathlotto[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$ChildFath', $npctemp3)
	if npctemp2 >= 0: $ChildFath[npctemp2] = $npclastsaved & jump 'npctempmloop'
	npctemp2 = arrpos('$ChildThFath', $npctemp3)
	if npctemp2 >= 0: $ChildThFath[npctemp2] = $npclastsaved & jump 'npctempmloop'
	
	! {Thic checks Array A for the Entry and changes it to the new Array B}
	:npctempaloop
	npctemp2 = arrpos('$Astat_firstpart', $npctemp3)
	if npctemp2 >= 0: $Astat_firstpart[npctemp2] = $npclastsaved & jump 'npctempaloop'
	npctemp2 = arrpos('$Astat_lastpart', $npctemp3)
	if npctemp2 >= 0: $Astat_lastpart[npctemp2] = $npclastsaved & jump 'npctempaloop'
	npctemp2 = arrpos('$Astat_kidpater', $npctemp3)
	if npctemp2 >= 0: $Astat_kidpater[npctemp2] = $npclastsaved & jump 'npctempaloop'
	npctemp2 = arrpos('$Astat_dad', $npctemp3)
	if npctemp2 >= 0: $Astat_dad[npctemp2] = $npclastsaved & jump 'npctempaloop'
	npctemp2 = arrpos('$Astat_mom', $npctemp3)
	if npctemp2 >= 0: $Astat_mom[npctemp2] = $npclastsaved & jump 'npctempaloop'

	! {This checks Array B for the Entry and changes it to the new array B}
	:npctempbloop
	npctemp2 = arrpos('$Bstat_firstpart', $npctemp3)
	if npctemp2 >= 0: $Bstat_firstpart[npctemp2] = $npclastsaved & jump 'npctempbloop'
	npctemp2 = arrpos('$Bstat_lastpart', $npctemp3)
	if npctemp2 >= 0: $Bstat_lastpart[npctemp2] = $npclastsaved & jump 'npctempbloop'
	npctemp2 = arrpos('$Bstat_kidpater', $npctemp3)
	if npctemp2 >= 0: $Bstat_kidpater[npctemp2] = $npclastsaved & jump 'npctempbloop'
	npctemp2 = arrpos('$Bstat_dad', $npctemp3)
	if npctemp2 >= 0: $Bstat_dad[npctemp2] = $npclastsaved & jump 'npctempbloop'
	npctemp2 = arrpos('$Bstat_mom', $npctemp3)
	if npctemp2 >= 0: $Bstat_mom[npctemp2] = $npclastsaved	 & jump 'npctempbloop'
	
	! {This checks Array C for the Entry and changes it to the new array B}
	:npctempcloop
	npctemp2 = arrpos('$Cstat_firstpart', $npctemp3)
	if npctemp2 >= 0: $Cstat_firstpart[npctemp2] = $npclastsaved & jump 'npctempcloop'
	npctemp2 = arrpos('$Cstat_lastpart', $npctemp3)
	if npctemp2 >= 0: $Cstat_lastpart[npctemp2] = $npclastsaved & jump 'npctempcloop'
	npctemp2 = arrpos('$Cstat_kidpater', $npctemp3)
	if npctemp2 >= 0: $Cstat_kidpater[npctemp2] = $npclastsaved & jump 'npctempcloop'
	npctemp2 = arrpos('$Cstat_dad', $npctemp3)
	if npctemp2 >= 0: $Cstat_dad[npctemp2] = $npclastsaved & jump 'npctempcloop'
	npctemp2 = arrpos('$Cstat_mom', $npctemp3)
	if npctemp2 >= 0: $Cstat_mom[npctemp2] = $npclastsaved & jump 'npctempcloop'

	! {This clears the Entry in Array C, seting it avaiable for overwrite or purging}
	$Cstat_firstname[npctemp] = ''
	$Cstat_nickname[npctemp] = ''
	$Cstat_lastname[npctemp] = ''
	$Cstat_usedname[npctemp] = ''
	$Cstat_notes[npctemp] = ''
	Cstat_dob[npctemp] = 0
	Cstat_vit[npctemp] = 0
	Cstat_str[npctemp] = 0
	Cstat_int[npctemp] = 0
	Cstat_agil[npctemp] = 0
	Cstat_spirit[npctemp] = 0
	Cstat_mag[npctemp] = 0
	Cstat_drunk[npctemp] = 0
	Cstat_undies[npctemp] = 0
	Cstat_cyc[npctemp] = 0
	Cstat_fert[npctemp] = 0
	$Cstat_firstpart[npctemp] = ''
	$Cstat_lastpart[npctemp] = ''
	$Cstat_kidpater[npctemp] = ''
	Cstat_gender[npctemp] = 0
	$Cstat_thdick[npctemp] = ''
	Cstat_dick[npctemp] = 0
	Cstat_sexskill[npctemp] = 0
	Cstat_spermpot[npctemp] = 0
	Cstat_vag[npctemp] = 0
	Cstat_ass[npctemp] = 0
	Cstat_hymen[npctemp] = 0
	Cstat_horny[npctemp] = 0
	Cstat_Pavrep[npctemp] = 0
	Cstat_Godrep[npctemp] = 0
	Cstat_app[npctemp] = 0
	Cstat_lipstick[npctemp] = 0
	Cstat_makeup[npctemp] = 0
	Cstat_sweat[npctemp] = 0
	Cstat_dye[npctemp] = 0
	Cstat_hair[npctemp] = 0
	Cstat_skin[npctemp] = 0
	Cstat_bodyhair[npctemp] = 0
	Cstat_breath[npctemp] = 0
	Cstat_hipcurv[npctemp] = 0
	Cstat_hgt[npctemp] = 0
	Cstat_bust[npctemp] = 0
	Cstat_nips[npctemp] = 0
	Cstat_fat[npctemp] = 0
	Cstat_pubes[npctemp] = 0
	Cstat_hairlng[npctemp] = 0
	Cstat_haircol[npctemp] = 0
	Cstat_haircurl[npctemp] = 0
	Cstat_tan[npctemp] = 0
	Cstat_lip[npctemp] = 0
	Cstat_lashes[npctemp] = 0
	Cstat_eyesize[npctemp] = 0
	Cstat_eyecol[npctemp] = 0
	Cstat_dom[npctemp] = 0
	Cstat_sub[npctemp] = 0
	Cstat_glasses[npctemp] = 0
	Cstat_grades[npctemp] = 0
	Cstat_run[npctemp] = 0
	Cstat_vball[npctemp] = 0
	Cstat_nerd[npctemp] = 0
	Cstat_shoot[npctemp] = 0
	Cstat_sew[npctemp] = 0
	Cstat_serve[npctemp] = 0
	Cstat_chess[npctemp] = 0
	Cstat_dnc[npctemp] = 0
	Cstat_erodnc[npctemp] = 0
	Cstat_jab[npctemp] = 0
	Cstat_punch[npctemp] = 0
	Cstat_kick[npctemp] = 0
	Cstat_def[npctemp] = 0
	Cstat_sing[npctemp] = 0
	Cstat_teach[npctemp] = 0
	Cstat_Qstlvl[npctemp] = 0
	Cstat_rel[npctemp] = 0
	Cstat_love[npctemp] = 0
	Cstat_job[npctemp] = 0
	Cstat_cloc[npctemp] = 0
	$Cstat_dad[npctemp] = ''
	$Cstat_mom[npctemp] = ''
	$Cstat_pic[npctemp] = ''
	Cstat_herpes[npctemp] = 0
	Cstat_syph[npctemp] = 0
	Cstat_gon[npctemp] = 0
	Cstat_chlam[npctemp] = 0
	Cstat_Hiv[npctemp] = 0
	Cstat_genwart[npctemp] = 0
	Cstat_Thrush[npctemp] = 0
	Cstat_Malen[npctemp] = 0
	Cstat_Chem[npctemp] = 0
	Cstat_Clothpref[npctemp] = 0
	$Cstat_PersType[npctemp] = ''
	! {This closes out the cleanup variables}
	gs 'npccleanc'
end
!! Preserves $npclastsaved and npclastsavedn. Giving the last B array saved.


killvar 'npctemp'
killvar 'npctemp2'
killvar '$npctemp3'

--- npcpreservec ---------------------------------

