;;Ҫɾ
[@ADVRefineVelocityMain]
{
#IF
;CheckGold 1000000
;CheckItem VelocityCrystal 1
;CheckItem DragonEyeCrystal 1
#ACT
Delaygoto [local] 1 @ADVRefineVelocityNxt
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12} \
#ELSESAY
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 1000000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} VelocityCrystal 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Leave/@Exit>
;-----------------------------------------------------------------------------------------

[@ADVRefineVelocityNxt]
#ACT
;FormatStr "FLD_CHARACTER='%s' AND FLD_TYPE='%s'" %A1 %D0
FormatStr "FLD_CHARACTER='%s' AND FLD_TYPE='%s'" %A1 1
ReadValueSql  "TBL_ITEM"  %A9 "FLD_CHARACTER,FLD_TYPE,FLD_DESC6,FLD_COLORR"  [@WeaponTypeSpeed]

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

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

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

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

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

#IF
#ACT
goto @ADVRefineLevelVelocityOK

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

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

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

[@ADVRefineVelocity1]
#IF
equal A8 "0"
#SAY
The advanced refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
{FCOLOR/1}Note: Velocity is harder to refine than \
DC and your weapon may curse!{FCOLOR/12}\
<Next/@ADVRefineVelocityNxt1(11)>
#ACT
Break

#IF
equal A8 "11"
#SAY
The advanced refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
{FCOLOR/1}Note: Velocity is harder to refine than \
DC and your weapon may curse!{FCOLOR/12}\
<Next/@ADVRefineVelocityNxt1(12)>
#ACT
Break

#IF
equal A8 "12"
#SAY
The advanced refine has a chance of failure!\
Due to how skilled my work is i cannot afford\
to give refunds if it fails!\\
{FCOLOR/1}Note: Velocity is harder to refine than \
DC and your weapon may curse!{FCOLOR/12}\
<Next/@ADVRefineVelocityNxt1(13)>
#ACT
Break

#IF
equal A8 "13"
#SAY
You can not refine any more velocity onto this weapon.
#ACT
Break

#ELSESAY
your weapon is not suitable for advanced refining..\

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

[@ADVRefineVelocityNxt1()]
#ACT
mov A0 %ARG(1)

#IF
Random 5
#ACT
goto @ADVRefineVelocityNxt2

#ELSEACT
Dec A0 1
goto @ADVRefineVelocityNxt2

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

[@ADVRefineVelocityNxt2]
#ACT
FormatStr "FLD_CHARACTER='%s' AND FLD_TYPE='%s'" %A1 %D0
ReadValueSql  "TBL_ITEM"  %A9 "FLD_CHARACTER,FLD_TYPE,FLD_DESC6"  [@ADVRefineVelocityNxt3]

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

[@ADVRefineVelocityNxt3()]
#IF
;CheckGold 1000000
;CheckItem VelocityCrystal 1
;CheckItem DragonEyeCrystal 1
#ACT
;Take Gold 1000000
;TakeItem VelocityCrystal 1
;TakeItem DragonEyeCrystal 1
Delaygoto [local] 1 @ADVRefineVelocityNxt4
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12}\
#ELSESAY
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 1000000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} VelocityCrystal 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Leave/@Exit>

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

[@ADVRefineVelocityNxt4]
#IF
Random 3
#ACT
Delaygoto [local] 1 @ADVRefineVelocityNxt5
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12}\

#ELSEACT
Goto @ADVRefineVelocityFAIL

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

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


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

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

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

[@ADVRefineVelocityNxt5]
#ACT
FormatStr "FLD_CHARACTER='%s' AND FLD_TYPE='%s'" %A1 1
mov A6 %A9
FormatStr "FLD_DESC6='%s'" %A0
UPDATEVALUESQL "TBL_ITEM" %A6 %A9
#SAY
<$OUTPUT(A1)>'s weapon has been enhanced by {FCOLOR/10}1{FCOLOR/12} Velocity\
This makes the total Velocity: {FCOLOR/10}+<$OUTPUT(A0)>{FCOLOR/12}\\
{FCOLOR/10}Note: Please Ignor The First Digit (so +11 = +1){FCOLOR/12}\\
<Leave/@exit>

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

}
;;Ҫɾ