;;; HalloweenNPC / Warrior Statue to sell RedRose / Toxin ;;;


[@CursedStatueNPC1]
{
#IF
checkjob Warrior

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

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



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


[@WarriorStatueImpact]
#SAY
not done yet..\

[@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>\\
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;