;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@IntClearPk]
{
#IF
checkpkpoint 2
#say
I can now clear 100 of your PK points for just 10 Integral!\
Just note that if you have less than 100 PK points\
it will still cost you 100 Integral\
<[ Reduce 100 PK Points ]/@CheckIntClear100PK>\\
<[ Back ]/@IntegralMainMenu>\\
#ELSESAY
You are not red!\
<[ Back ]/@IntegralMainMenu>\\

[@CheckIntClear100PK]
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   ReadValueSql  "TBL_INTEGRAL"  %A9  "FLD_CHARACTER,FLD_INTEGRAL"  [@CheckIntClear100PK1]
[@CheckIntClear100PK1()]
#ACT
   mov    D2      %ARG(2)
   mov    D3      100
#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
   HLSCRIPTCMD SETPKPOINT - 100
   mov     A7  ""
   AddStr  A7 %USERNAME
   AddStr  A7 ","
   AddStr  A7 %D3
   AddStr  A7 ",Clear100PK,"
   Savelog "QuestDiary\IntegralSystem\IntegralLog.txt" %A7
#SAY
I have reduced your PK points by 100!\\
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>\

}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;