;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@IntChangeSex]
{
#SAY
Do you want to change sex????\
Price: 1000 Integral{FCOLOR/12}\
<[ Change Sex ]/@IntChangeSex1>\
<[ Back ]/@IntegralMainMenu>\

[@IntChangeSex1]
#SAY
Are you sure?\
<[ Yes ]/@IntChangeSex2>\
<[ Back ]/@IntegralMainMenu>\

[@IntChangeSex2]
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   ReadValueSql  "TBL_INTEGRAL"  %A9  "FLD_CHARACTER,FLD_INTEGRAL"  [@IntChangeSex3]
[@IntChangeSex3()]
#IF
#ACT
   mov    A0      %ARG(1)
   mov    D2      %ARG(2)
   mov    D3      1000
#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
   mov     A7  ""
   AddStr  A7 %USERNAME
   AddStr  A7 ","
   AddStr  A7 %D3
   AddStr  A7 ",ChangeSex,"
   AddStr  A7 %D0
   Savelog "QuestDiary\IntegralSystem\IntegralLog.txt" %A7
   Goto @IntCheckSex
#Elsesay
You do not have enough Integral Points\
Your current Integral is {FCOLOR/10}<$OUTPUT(D2)>{FCOLOR/12}\
<[ Back ]/@IntegralMainMenu>\

[@IntCheckSex]
#IF
   Gender man
#ACT
   HLSCRIPTCMD CHANGESEX 1
   break
#SAY
OMG! Your a woman! <$OUTPUT(A0)>!\
Your current Integral is {FCOLOR/10}<$OUTPUT(D4)>{FCOLOR/12}\
<[ Back ]/@IntegralMainMenu>\
#IF
   !Gender man
#ACT
   HLSCRIPTCMD CHANGESEX 0
   break
#SAY
OMG! Your a Man! <$OUTPUT(A0)>!\
Your current Integral is {FCOLOR/10}<$OUTPUT(D4)>{FCOLOR/12}\
<[ Back ]/@IntegralMainMenu>\

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