hey want defense] 
!!IF&-3:Q4/33/1/34/1/7/z104006; 
!!VRv600&-3/4:S2; [v600=2 = they want spell power] 
!!VRv600&-3/-4:S3; [v600=3 = they want knowledge] 
 
!!VRv601:S4; [v601=4 = no payment chosen] 
!!IF&v600<>0:Q5/31/0/2/z104007; 
!!VRv601&v600<>0/5:S0; [v601=0 = pay with attack] 
!!IF&v600<>1/v601=4:Q5/32/0/2/z104008; 
!!VRv601&v600<>1/v601=4/5:S1; [v601=1 = pay with defense] 
!!IF&v600<>2/v601=4:Q5/33/0/2/z104009; 
!!VRv601&v600<>2/v601=4/5:S2; [v601=2 = pay with spell power] 
!!IF&v600<>3/v601=4:Q5/34/0/2/z104010; 
!!VRv601&v600<>3/v601=4/5:S3; [v601=3 = pay with knowledge] 
 
!!IF&v601=4:M1/z104011; 
!!FU622&v601<4:P; [continue if both skills picked] 
 
** end of function 
 
 
** function to handle trades once skills are selected 
 
!?FU622; 
 
!!VRv602:Sv600 +31; [get picture # of skill they want] 
!!VRv603:Sv601 +31; [get picture # of skill they pay] 
!!HE-1:F?v604/?v605/?v606/?v607; [fetch skill values] 
!!VRv608:S604 +v600; [variable # of amount of skill they want] 
!!VRv609:S604 +v601; [variable # of amount of skill they pay] 
 
!!FU625:P; [get "clean" skill values in v611-v614 (no artifacts)] 
!!VRv618:S611 +v601; [variable # of clean skill amount to pay] 
!!VRv610:Svv618; [times they can trade] 
!!VRv610&v601>1:-1; [can trade one less if spell power or knowledge] 
!!IF&v610<1:M1/z104012; 
!!FU623&v610>0:P; [continue if they can pay] 
 
** end of function 
 
 
** function to trade once we know they can 
 
!?FU623; 
 
!!IF:V2/1; [flag indicates we'll make trade] 
!!DO624/1/30/1:P; [allow them to make the chosen trade as many times as they can] 
!!IF:M1/z104013; 
 
** end of function 
 
 
** function to trade one skill point, done repeatedly 
 
!?FU624; 
 
!!VRvv609&2:-1; [deduct one point of paying skill] 
!!VRvv608&2:+1; [add one point to wanted skill] 
!!HE-1&2:Fv604/v605/v606/v607; [save new skill values] 
!!VRv610&2:-1; [countdown times we can make trade] 
!!IF&2/v610=0:Q1/v602/1/1/z104014; 
!!IF&2/v610=0:V2/0; 
!!IF&2/v610>0:Q2/v602/1/2/z104015; 
 
** end of function 
 
 
** function to get real s