;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@IntWarpMove]
{
#IF
#SAY
You can now fix a spot almost anywhere in the world\
and move yourself to that spot in seconds!\
Each GateTeleport costs 10 integral\
Each WarpTeleport costs 5 Integral\
How Many Would you Like to Buy?\
<[ Buy GateTeleport ]/@IntBuyTeleport(GateTeleport,10)>\
<[ Buy WarpTeleport ]/@IntBuyTeleport(warpTeleport,5)>\
<[ Buy 10 * GateTeleport ]/@IntBuyTeleport10(GateTeleport,100)>\
<[ Buy 10 * WarpTeleport ]/@IntBuyTeleport10(warpTeleport,50)>\
<[ Back ]/@IntegralMainMenu>\

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

[@CheckIntBuyTeleport1]
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   ReadValueSql  "TBL_INTEGRAL"  %A9  "FLD_CHARACTER,FLD_INTEGRAL"  [@CheckIntBuyTeleport2]
[@CheckIntBuyTeleport2()]
#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>


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

[@CheckIntBuyTeleport110]
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   ReadValueSql  "TBL_INTEGRAL"  %A9  "FLD_CHARACTER,FLD_INTEGRAL"  [@CheckIntBuyTeleport210]
[@CheckIntBuyTeleport210()]
#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 10
   mov     A7  ""
   AddStr  A7 %USERNAME
   AddStr  A7 ","
   AddStr  A7 %D3
   AddStr  A7 ","
   AddStr  A7 %A0
   Savelog "QuestDiary\IntegralSystem\IntegralLog.txt" %A7
#SAY
Here are your 10 * <$OUTPUT(A0)>, use them 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>
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;