;;; HalloweenNPC / Taoist Statue to sell GreenRose / Toxin ;;;


[@CursedStatueNPC3]
{
#IF
checkjob Taoist

#SAY
Welcome <$USERNAME>, Skilled healer of mir.\
\
I can see that you're trained in the power of my\
fathers and that means I must offer my services to\
you in your fight against the evil that plagues mir.\
\
<[ How can you help ]/@TaoistStatue1>\
<[ Thanks but no thanks ]/@exit>\\\

#ELSESAY
.....\
\
<[ close ]/@exit>\\\



[@TaoistStatue1]
#SAY
I can offer you the following to help you on your way.\
\
\
<[ TaoistRose ]/@IntPurchase(TaoistRose,20)> - 20 Integral\
Wearing this will give you a 10-10 SC boost as long as\
you are wearing it.  However, it will break on death so\
please be careful out there.\
\
<[ Nothing Thanks ]/@exit>


[@IntPurchase()]
#ACT
   Mov   A0    %ARG(1)
   Mov   D3    %ARG(2)
#SAY
Your new {FCOLOR/10}<$OUTPUT(A0)>{FCOLOR/12} will cost you\
{FCOLOR/10}<$OUTPUT(D3)>{FCOLOR/12} Integral\\
Are you sure?\\
<[ Yes ]/@IntPurchase1>\
<[ Exit]/@Exit>\\

[@IntPurchase1]
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   ReadValueSql  "TBL_INTEGRAL"  %A9  "FLD_CHARACTER,FLD_INTEGRAL"  [@IntPurchase2]
[@IntPurchase2()]
#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
   AddStr  A7 ""
   AddStr  A7 %USERNAME
   AddStr  A7 ","
   AddStr  A7 %D3
   AddStr  A7 ",Shop,"
   AddStr  A7 %A0
   Savelog "QuestDiary\IntegralSystem\IntegralLog.txt" %A7
#SAY
You have purchased a {FCOLOR/10}<$OUTPUT(A0)>{FCOLOR/12}
\

Your current Integral is {FCOLOR/10}<$OUTPUT(D4)>{FCOLOR/12}\\
<[ Exit]/@Exit>\\
#ELSESAY
You do not have enough Integral Points\
Your current Integral is {FCOLOR/10}<$OUTPUT(D2)>{FCOLOR/12}\\
<[ Exit]/@Exit>\\
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;