;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@RefineAccessory]
{
#Define D1{PROB} D1
#Define D2{TYPE} D2
#Define D3{ATOM} D3


#SAY
<[ Please Enter the Item Name ]/@@testRefineAccessory>\

[@@testRefineAccessory]
#IF
#ACT
mov A1 %INPUTSTR

#IF
Equal A1 ""
#ACT
break

#IF

#SAY
You wish to refine a {FCOLOR/12}<$OUTPUT(A1)>{FCOLOR/10}?\
You require 3 items of the same type, and with the\
same attributes to be able to Refine. (2 Items if they are "Rare")\
You will also require 1 Piece of JadeOre\
What would you like to refine into your item?\
<[ DC ]/@doRefineAcc(0)>\
<[ M-All ]/@doRefineAcc(1)>\
<[ Ignis Element ]/@doRefineAcc(3,1)>\
<[ Gelu Element ]/@doRefineAcc(3,2)>\
<[ Fulmen Element ]/@doRefineAcc(3,3)>\
<[ Ventus Element ]/@doRefineAcc(3,4)>\
<[ Sacer Element ]/@doRefineAcc(3,5)>\
<[ Ater Element ]/@doRefineAcc(3,6)> \
<[ Phasma Element ]/@doRefineAcc(3,7)>\
<[ Exit ]/@exit>

[@retryRefine]
#ACT
goto @@testRefineAccessory

[@doRefineAcc()]
#IF
!CheckGold 10000
#ACT
goto @didnotMatchConditions
break
#IF
!CheckItem JadeOre 1
#ACT
goto @didnotMatchConditions
break

#IF
#ACT
mov D2{TYPE} %ARG(1)
mov D3{ATOM} %ARG(2)
TestRefineAccessories %A1 %D2 %D3
mov D1{PROB} %P9

#IF
Small D1{PROB} 0
#ACT
goto @didnotMatchConditions
break

#IF

#SAY
We are ready to refine your {FCOLOR/12}<$OUTPUT(A1)>{FCOLOR/10}, Success ratio <$@GetRefineProb>\
<[ Refine Item ]/@RefineAccNow>\
<[ Back ]/@retryRefine>\

[@GetRefineProb]
#IF
Small D1 30

#SAY
Less than {FCOLOR/10}30%{FCOLOR/12}

#ACT
break

#IF
Small D1 38

#SAY
Approx {FCOLOR/10}30%{FCOLOR/12}

#ACT
break

#IF
Small D1 45

#SAY
Approx {FCOLOR/10}40%{FCOLOR/12}

#ACT
break

#IF
Small D1 55

#SAY
Approx {FCOLOR/10}50%{FCOLOR/12}

#ACT
break

#IF
Small D1 65

#SAY
Approx {FCOLOR/10}60%{FCOLOR/12}

#ACT
break

#IF

#SAY
Approx {FCOLOR/10}70%{FCOLOR/12}

#ACT
break

[@RefineAccNow]
#IF
!CheckGold 10000
#ACT
goto @didnotMatchConditions
break
#IF
!CheckItem JadeOre 1
#ACT
goto @didnotMatchConditions
break

#IF
#ACT
Take JadeOre 1
Take Gold 10000
RefineAccessories %A1 %D2 %D3

#IF
Equal P9 1

#SAY
Success!!!\

#IF
Equal P9 0

#SAY
I am sorry, the refine failed\
<[ Back ]/@retryRefine>\

[@didnotMatchConditions]

#SAY
You did not have the materials required\
<[ Exit ]/@exit>\

}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;