;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@IntDye]
{
#IF
#ACT
mov  D1 ""
mov  D2 ""
mov  D3 ""
mov  D7 20
mov     A7  ""
#SAY
{FCOLOR/12}Do you want to change your armour colour?\
{FCOLOR/10}Price: <$OUTPUT(D7)> Integral{FCOLOR/12}\
{FCOLOR/12}You must be wearing the armour your wish to dye. {FCOLOR/12}\\
{FCOLOR/12}<[ Dye Armour ]/@DyeArmor>{FCOLOR/12}\
{FCOLOR/12}<[ Back ]/@IntegralMainMenu>{FCOLOR/12}\ \

[@DyeArmor]
#IF
#SAY
Please enter a standard {FCOLOR/1}R{FCOLOR/10}G{FCOLOR/11}B{FCOLOR/12} code to continue.\
Input {FCOLOR/1}Red{FCOLOR/12} Value {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} <[ Red Value (0-255) ]/@@RedDye>\
Input {FCOLOR/10}Green{FCOLOR/12} value {FCOLOR/10}<$OUTPUT(D2)>{FCOLOR/12} <[ Green Value (0-255) ]/@@GreenDye>\
Input {FCOLOR/11}Blue{FCOLOR/12} Value {FCOLOR/11}<$OUTPUT(D3)>{FCOLOR/12} <[ Blue Value (0-255) ]/@@BlueDye>\\
<[ Dye Armour ]/@DyeArmor1>\\
<[ Back ]/@IntegralMainMenu>\\

[@@RedDye]
#ACT
   mov  D0  %INPUTSTR
#IF
  elarge D0 256
#SAY
Please input a value between 0-255!
#act
break

#IF
  small D0 0
#SAY
Please input a value between 0-255!
#act
break

#IF
#act
  mov D1 %D0
SysMsg  "The Red value is set to <$OUTPUT(D1)>."
goto @DyeArmor
break

[@@GreenDye]
#ACT
   mov  D0  %INPUTSTR
#IF
  elarge D0 256
#SAY
Please input a value between 0-255!
#act
break
#IF
  small D0 0
#SAY
Please inputs a value between 0-255!
#act
break
#IF
#act
  mov D2 %D0
SysMsg  "The Green Value is <$OUTPUT(D2)>."
goto @DyeArmor
break

[@@BlueDye]
#ACT
   mov  D0  %INPUTSTR
#IF
  elarge D0 256
#SAY
Please input a value between 0-255!
#act
break
#IF
  small D0 0
#SAY
Please input a value between 0-255!
#act
break
#IF
#act
  mov D3 %D0
SysMsg  "The Blue Value is <$OUTPUT(D3)>."
goto @DyeArmor
break

[@DyeArmor1]
#ACT
          Delaygoto [local] 5 @CheckExIntDye
#SAY
{FCOLOR/10}Please Wait - your armour is now being dyed...{FCOLOR/12}\

[@CheckExIntDye]
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   ReadValueSql  "TBL_INTEGRAL"  %A9  "FLD_CHARACTER,FLD_INTEGRAL"  [@CheckExIntDye1]
[@CheckExIntDye1()]
#IF
#ACT
   mov    A0      %ARG(1)
   mov    D5      %ARG(2)
#IF
   Esmall D7 %D5
#ACT
   FormatStr "FLD_CHARACTER='%s'" %USERNAME
   mov   A8     %A9
   dec   D5     %D7
   mov   D4     %D5
   FormatStr "FLD_INTEGRAL='%s'" %D4
   UPDATEVALUESQL "TBL_INTEGRAL" %A8 %A9
   wearcolor %D3 %D1 %D2
   AddStr  A7 %USERNAME
   AddStr  A7 ","
   AddStr  A7 %D7
   AddStr  A7 ",ArmorDye"
   Savelog "QuestDiary\IntegralSystem\IntegralLog.txt" %A7
#SAY
{FCOLOR/10}Armour dyed successfully!{FCOLOR/12}\\
You have spent {FCOLOR/10}<$OUTPUT(D7)>{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(D5)>{FCOLOR/12}\
<[ Back ]/@IntegralMainMenu>\
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;