;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@IntItemProte]
{
#if
#say
Do you want Equipment Drop Protection?\
Price: 50 Per Week\
{FCOLOR/10}Protects an item for 7 days!{FCOLOR/12}\
<[ Item Protection ]/@StartItemProte>\
<[ Exit ]/@exit>


[@StartItemProte]
#IF
#SAY
{FCOLOR/10}Please choose the equipment you wish to protect:{FCOLOR/12}\
<[ Weapon ]/@ItemProteSe(1)>  <[ Light ]/@ItemProteSe(2)>\
<[ Helmet ]/@ItemProteSe(4)>  <[ Necklace ]/@ItemProteSe(3)>\
<[ Armour ]/@ItemProteSe(0)>  <[ Shoes ]/@ItemProteSe(10)>\
<[ Bracelet(L) ]/@ItemProteSe(5)>  <[ Bracelet(R) ]/@ItemProteSe(6)>\
<[ Ring(L) ]/@ItemProteSe(7)>  <[ Ring(R) ]/@ItemProteSe(8)>\
<[ Misc ]/@ItemProteSe(9)>\\
<[ Back ]/@IntegralMainMenu>\\


[@ItemProteSe()]
#ACT
  Mov        D0       %ARG(1)
  Mov        D3       50
  mov     A7  ""
  goto @CheckExIntProte

[@CheckExIntProte]
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   ReadValueSql  "TBL_INTEGRAL"  %A9  "FLD_CHARACTER,FLD_INTEGRAL"  [@CheckExIntProte1]
[@CheckExIntProte1()]
#IF
#ACT
   mov    A0      %ARG(1)
   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
   HLSCRIPTCMD ITEMPROTE %D0 7
   AddStr  A7 %USERNAME
   AddStr  A7 ","
   AddStr  A7 %D3
   AddStr  A7 ",ItemProte,"
   AddStr  A7 %D0
   Savelog "QuestDiary\IntegralSystem\IntegralLog.txt" %A7
#SAY
Your Item now has protection, type @EquipProtect at any time to activate.\
You have spent {FCOLOR/10}<$OUTPUT(D3)>{FCOLOR/12} Integral\
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>\
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;