;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@IntSRScroll]
{
#IF
#SAY
You can now open your SR wherever you are\
Each SRScroll costs 200 integral\
<[ Buy SRScroll ]/@IntSRScroll1(SRScroll,200)>\
<[ Back ]/@IntegralMainMenu>\

[@IntSRScroll1()]
#ACT
   MOV  A0   %ARG(1)
   MOV  D3   %ARG(2)
#SAY
Are you sure?\
<[ Buy Scroll ]/@IntSRScroll2>\
<[ Back ]/@IntegralMainMenu>\

[@IntSRScroll2]
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   ReadValueSql  "TBL_INTEGRAL"  %A9  "FLD_CHARACTER,FLD_INTEGRAL"  [@IntSRScroll3]
[@IntSRScroll3()]
#IF
#ACT
   mov    D2      %ARG(2)
#IF
   Esmall D3 %D2
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   mov   A8     %A9
   dec   D2     %D3
   mov   D4     %D2
   FormatStr "FLD_INTEGRAL='%s'" %D4
   UPDATEVALUESQL "TBL_INTEGRAL" %A8 %A9
   Give %A0 1
   mov     A7  ""
   AddStr  A7 %USERNAME
   AddStr  A7 ","
   AddStr  A7 %D3
   AddStr  A7 ","
   AddStr  A7 %A0
   Savelog "QuestDiary\IntegralSystem\IntegralLog.txt" %A7
#SAY
Here is your <$OUTPUT(A0)>, use it wisely!\
Your current Integral is {FCOLOR/10}<$OUTPUT(D4)>{FCOLOR/12}\
<[ Back ]/@IntegralMainMenu>
#Elsesay
You do not have enough Integral Points\
Your current Integral is {FCOLOR/10}<$OUTPUT(D2)>{FCOLOR/12}\
<[ Back ]/@IntegralMainMenu>
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;