;;Ҫɾ
[@RefineACMain]
{

#IF
;CheckGold 100000
;CheckItem RefineItem 1
#ACT
Delaygoto [local] 1 @ADVRefineAcNxt
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12} \
#ELSESAY
To use the Armour Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 100000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} RefineItem 1{FCOLOR/12}\\
<Leave/@Exit>
;-----------------------------------------------------------------------------------------

[@ADVRefineAcNxt]
#ACT
;FormatStr "FLD_CHARACTER='%s' AND FLD_TYPE='%s'" %A1 %D0
FormatStr "FLD_CHARACTER='%s' AND FLD_TYPE='%s'" %A1 0
ReadValueSql  "TBL_ITEM"  %A9 "FLD_CHARACTER,FLD_TYPE,FLD_DESC0,FLD_COLORR"  [@armourTypeAC]

;---------------------------------------------------------------

[@armourTypeAC()]
#ACT
mov A4 %ARG(1)
mov D9 %ARG(2)
mov A8 %ARG(3)
mov A3 %ARG(4)

;---------------------------------------------------------------

#IF
equal A4 ""
#SAY
{FCOLOR/1} <$OUTPUT(A1)> is not wearing armour! {FCOLOR/12} \\
<Leave/@exit>
#ACT
break

;---------------------------------------------------------------

#IF
;Small A7 "75"
;Large A3 "70"
#ACT
goto @ADVRefineLevelOK

;---------------------------------------------------------------

[@ADVRefineLevelOK]
#ACT
Delaygoto [local] 1 @ADVRefineAc1
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12}\

;---------------------------------------------------------------

[@ADVRefineAc1]
#IF
equal A8 "0"
#SAY
The armour refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
<Next/@ADVRefineAcNxt1(1)>
#ACT
Break

#IF
equal A8 "1"
#SAY
The armour refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
<Next/@ADVRefineAcNxt1(2)>
#ACT
Break

#IF
equal A8 "2"
#SAY
The armour refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
<Next/@ADVRefineAcNxt1(3)>
#ACT
Break

#IF
equal A8 "3"
#SAY
The armour refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
<Next/@ADVRefineAcNxt1(4)>
#ACT
Break

#IF
equal A8 "4"
#SAY
The armour refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
<Next/@ADVRefineAcNxt1(5)>
#ACT
Break

#IF
equal A8 "5"
#SAY
The armour refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
<Next/@ADVRefineAcNxt1(6)>
#ACT
Break

#IF
equal A8 "6"
#SAY
The armour refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
<Next/@ADVRefineAcNxt1(7)>
#ACT
Break

#IF
equal A8 "7"
#SAY
The armour refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
<Next/@ADVRefineAcNxt1(8)>
#ACT
Break

#IF
equal A8 "8"
#SAY
The armour refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
<Next/@ADVRefineAcNxt1(9)>
#ACT
Break

#IF
equal A8 "9"
#SAY
The armour refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
<Next/@ADVRefineAcNxt1(10)>
#ACT
Break

#IF
equal A8 "10"
#SAY
You can not refine any more Ac onto this armour.
#ACT
Break

#ELSESAY
your armour is not suitable for armour refining..\

;---------------------------------------------------------------

[@ADVRefineAcNxt1()]
#ACT
mov A0 %ARG(1)
goto @ADVRefineAcNxt2

;---------------------------------------------------------------

[@ADVRefineAcNxt2]
#ACT
FormatStr "FLD_CHARACTER='%s' AND FLD_TYPE='%s'" %A1 %D0
ReadValueSql  "TBL_ITEM"  %A9 "FLD_CHARACTER,FLD_TYPE,FLD_DESC0"  [@ADVRefineAcNxt3]

;---------------------------------------------------------------

[@ADVRefineAcNxt3()]
#IF
;CheckGold 100000
;CheckItem RefineItem 1
#ACT
;Take Gold 100000
;TakeItem RefineItem 1
Delaygoto [local] 1 @ADVRefineAcNxt4
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12}\
#ELSESAY
To use the armour Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 100000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} RefineItem 1{FCOLOR/12}\\
<Leave/@Exit>

;---------------------------------------------------------------

[@ADVRefineAcNxt4]
#IF
Random 3
#ACT
Delaygoto [local] 1 @ADVRefineAcNxt5
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12}\
#ELSEACT
Goto @ADVRefineAcFAIL

;---------------------------------------------------------------

[@ADVRefineAcFAIL]
#ACT
Delaygoto [local] 1 @ADVRefineAcFAIL1
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12}\

;---------------------------------------------------------------

[@ADVRefineAcFAIL1]
#SAY
{FCOLOR/10}<$OUTPUT(A1)>'s{FCOLOR/12} armour has
{FCOLOR/10} failed{FCOLOR/12} to be {FCOLOR/10}upgraded!{FCOLOR/12}\\
<Leave/@exit>

;---------------------------------------------------------------

[@ADVRefineAcNxt5]
#ACT
FormatStr "FLD_CHARACTER='%s' AND FLD_TYPE='%s'" %A1 0
mov A6 %A9
FormatStr "FLD_DESC0='%s'" %A0
UPDATEVALUESQL "TBL_ITEM" %A6 %A9
#SAY
<$OUTPUT(A1)>'s armour has been enhanced by {FCOLOR/10}1{FCOLOR/12} Ac\
This makes the total Ac: {FCOLOR/10}+<$OUTPUT(A0)>{FCOLOR/12}\\
<Leave/@exit>

;---------------------------------------------------------------

}
;;Ҫɾ