;;不要删掉此行

[@Main]
#IF
;IsAdmin
#ELSESAY
Removed due to error in script :P\\
<Leave/@Exit>
#ACT
GoTo @CheckWeapon

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

[@CheckWeapon]
#ACT
mov D0 1
#IF
!HLSCRIPTCMD CHECKISTAKEITEM %D0
#ACT
Break
#SAY
You must be wearing your weapon\
to use advance refine.\\
<Leave/@Exit>
#ELSEACT
GoTo @WearingWeapon

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

[@CALL_Npc_TodayQuest]
#CALL [TodayQuest\QT_NPCSetting.txt] @NPCSetDairyQuest

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

[@WearingWeapon]
#IF
HLSCRIPTCMD CHECKITEMPRO 1 14 75
#SAY
You can only use advanced refine when a \
weapon reachs its {FCOLOR/10}MAX{FCOLOR/12} level.\ \
<Make Dragon Eye Crystal/@MakeDragonEyeCrystal>\\
<Talk with/@CALL_Npc_TodayQuest> <$NPCNAME>\\
<Leave/@Exit>
#ELSEACT
GoTo @TestMaxRefine

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

[@TestMaxRefine]
#SAY
What do you wish to refine onto your Weapon ?\\
{FCOLOR/10}Attack: <Destructive Class/@ADVRefineDC>\
Attack: <Velocity/@ADVRefineSpeed>\
Attack: <Accuracy/@ADVRefineAccuracy>\\
Magic: <All/@ADVRefineMagic>\
Magic: <Nature/@ADVRefineMagic>\
Magic: <Soul/@ADVRefineMagic>\\
Miscellaneous: <Luck/@ADVRefineLuck>\
Miscellaneous: <Strength/@ADVRefineStrength>\\
<Make Dragon Eye Crystal/@MakeDragonEyeCrystal>\\
<Talk with/@CALL_Npc_TodayQuest> <$NPCNAME>\
<Leave/@Exit>

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

[@MakeDragonEyeCrystal]
#IF
CheckItem DragonPiece 1
CheckItem DragonPowder 1
#SAY
You have the items needed to make a\
{FCOLOR/10}Dragon Eye Crystal{FCOLOR/12}\\
I will require a small fee for this work\
because it is simple i will only ask that\
you Donate to me...\\
<Enter Amount To Donate/@@AmountToDonate>\
<Leave/@Exit>
#ELSESAY
To make a {FCOLOR/10}Dragon Eye Crystal{FCOLOR/12}\
You need:\
{FCOLOR/15}Dragon Piece{FCOLOR/12} and {FCOLOR/15}Dragon Powder{FCOLOR/12} \\
<Leave/@Exit>

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

[@@AmountToDonate]
#ACT
mov A0 %INPUTSTR
#ACT
Goto @CheckDEGold

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

[@CheckDEGold]
#IF
CheckGold %A0
CheckItem DragonPiece 1
CheckItem DragonPowder 1
#ACT
Delaygoto [local] 1 @TestGold
Take Gold %A0
Take DragonPiece 1
Take DragonPowder 1
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12} \
#ELSESAY
You do not have {FCOLOR/10}<$OUTPUT(A0)>{FCOLOR/12} Gold...\\
<Leave/@Exit>

[@TestGold]
#IF
Random 2
#ACT
Goto @MakeDragonEyeCrystal1
#ELSESAY
{FCOLOR/10}The Dragon Eye Crystal...Failed{FCOLOR/12}\\
<Leave/@Exit>

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

[@MakeDragonEyeCrystal1]
#IF
Random 2
#ACT
Give DragonEyeCrystal 1
#SAY
{FCOLOR/10}The Dragon Eye Crystal...Worked{FCOLOR/12}\\
<Leave/@Exit>
#ELSESAY
{FCOLOR/10}The Dragon Eye Crystal...Failed{FCOLOR/12}\\
<Leave/@Exit>

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

[@ADVRefineDC]
#SAY
You may refine up to {FCOLOR/10}+25 DC{FCOLOR/12} on to your weapon.\
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 100000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} DamageCrystal 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Refine/@RefineDC>\
<Leave/@Exit>

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

[@ADVRefineSpeed]
#SAY
You may refine up to {FCOLOR/10}+3 Velocity{FCOLOR/12} on to your weapon.\
{FCOLOR/1}WARNING: This has a chance of breaking your weapon\
Do not use this on a weapon that has base Velocity.\{FCOLOR/12}
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}\\
<Refine/@RefineSpeed>\
<Leave/@Exit>

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

[@ADVRefineAccuracy]
#SAY
You may refine up to {FCOLOR/10}+5 accuracy{FCOLOR/12} on to your weapon.\
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 100000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} AccuracyCrystal 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Refine/@RefineAccuracy>\
<Leave/@Exit>

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

[@ADVRefineMagic]
#SAY
You may refine up to {FCOLOR/10}+25 Magic{FCOLOR/12} on to your weapon.\
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 100000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} MagicCrystal 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Refine/@RefineMagic>\
<Leave/@Exit>

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

[@ADVRefineLuck]
#SAY
You may refine up to {FCOLOR/10}+7 Luck{FCOLOR/12} on to your weapon.\
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 100000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} LuckPotion 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Refine/@RefineLuck>\
<Leave/@Exit>

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

[@ADVRefineStrength]
#SAY
You may refine up to {FCOLOR/10}+5 Strength{FCOLOR/12} on to your weapon.\
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 100000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} StrengthPotion 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Refine/@RefineStrength>\
<Leave/@Exit>

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

[@RefineDC]
#IF
CheckGold 100000
CheckItem DamageCrystal 1
CheckItem DragonEyeCrystal 1
#ACT
Delaygoto [local] 1 @ADVRefineDcNxt
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12} \
#ELSESAY
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 100000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} DamageCrystal 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Leave/@Exit>

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

[@RefineSpeed]
#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>

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

[@RefineAccuracy]
#IF
CheckGold 100000
CheckItem AccuracyCrystal 1
CheckItem DragonEyeCrystal 1
#ACT
Delaygoto [local] 1 @ADVRefineAccuracyNxt
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12} \
#ELSESAY
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 100000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} AccuracyCrystal 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Leave/@Exit>

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

[@RefineMagic]
#IF
CheckGold 100000
CheckItem MagicCrystal 1
CheckItem DragonEyeCrystal 1
#ACT
Delaygoto [local] 1 @ADVRefineMagicNxt
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12} \
#ELSESAY
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 100000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} MagicCrystal 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Leave/@Exit>

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

[@RefineLuck]
#IF
CheckGold 50000
CheckItem LuckPotion 1
CheckItem DragonEyeCrystal 1
#ACT
Delaygoto [local] 1 @ADVRefineLuckNxt
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12} \
#ELSESAY
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 50000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} LuckPotion 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Leave/@Exit>

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

[@RefineStrength]
#IF
CheckGold 50000
CheckItem StrengthPotion 1
CheckItem DragonEyeCrystal 1
#ACT
Delaygoto [local] 1 @ADVRefineStrengthNxt
#SAY
{FCOLOR/10}Please Wait...{FCOLOR/12} \
#ELSESAY
To use the Advanced Refining System You Need:\\
{FCOLOR/15}1){FCOLOR/10} 50000 Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} StrengthPotion 1{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} DragonEyeCrystal 1{FCOLOR/12}\\
<Leave/@Exit>

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

[@ADVRefineDcNxt]
#IF
HLSCRIPTCMD CHECKITEMPRO 1 0 24
#ELSEACT
BREAK
#ELSESAY
This weapon can not have any more dc refined on to it...\
<Leave/@Exit>
#ACT
Take Gold 100000
Take DamageCrystal 1
Take DragonEyeCrystal 1
GoTo @ADVRefineDcNxt1
CLOSE

[@ADVRefineDcNxt1]
#IF
Random 2
#ACT
HLSCRIPTCMD ITEMREMAKEADD 1 0 1
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg0]
SysMsg %A7
#ELSEACT
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg1]
SysMsg %A7

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

[@ADVRefineVelocityNxt]
#IF
HLSCRIPTCMD CHECKITEMPRO 1 6 2
#ELSEACT
BREAK
#ELSESAY
This weapon can not have any more velocity refined on to it...\
<Leave/@Exit>
#ACT
Take VelocityCrystal 1
Take DragonEyeCrystal 1
Take Gold 100000
GoTo @AttackSpeed3
CLOSE

[@AttackSpeed3]
#IF
HLSCRIPTCMD CHECKITEMPRO 1 6 0
#ACT
GoTo @Give1Speed
#ELSEACT
GoTo @Have1Speed

[@Give1Speed]
#IF
#ACT
HLSCRIPTCMD ITEMREMAKEADD 1 6 11
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg0]
SysMsg %A7
Close

[@Have1Speed]
#IF
Random 4
#ACT
HLSCRIPTCMD ITEMREMAKEADD 1 6 1
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg0]
SysMsg %A7
Close
#ELSEACT
Goto @Fail

[@Fail]
#IF
Random 4
#ACT
ResetRefineWeapon
Close
#ELSEACT
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg1]
SysMsg %A7

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

[@ADVRefineAccuracyNxt]
#IF
HLSCRIPTCMD CHECKITEMPRO 1 5 4
#ELSEACT
BREAK
#ELSESAY
This weapon can not have any more accuracy refined on to it...\
<Leave/@Exit>
#ACT
Take AccuracyCrystal 1
Take DragonEyeCrystal 1
Take Gold 100000
GoTo @ADVRefineAccuracyNxt1
CLOSE

[@ADVRefineAccuracyNxt1]
#IF
Random 2
#ACT
HLSCRIPTCMD ITEMREMAKEADD 1 5 1
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg0]
SysMsg %A7
#ELSEACT
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg1]
SysMsg %A7

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

[@ADVRefineMagicNxt]
#IF
HLSCRIPTCMD CHECKITEMPRO 1 1 24
#ELSEACT
BREAK
#ELSESAY
This weapon can not have any more magic refined on to it...\
<Leave/@Exit>
#ACT
Take Gold 100000
GoTo @ADVRefineMagicNxt1
CLOSE

[@ADVRefineMagicNxt1]
#IF
Random 2
#ACT
Take MagicCrystal 1
Take DragonEyeCrystal 1
HLSCRIPTCMD ITEMREMAKEADD 1 1 1
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg0]
SysMsg %A7
#ELSEACT
Take MagicCrystal 1
Take DragonEyeCrytal 1
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg1]
SysMsg %A7

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

[@ADVRefineLuckNxt]
#IF
HLSCRIPTCMD CHECKITEMPRO 1 3 6
#ELSEACT
BREAK
#ELSESAY
This weapon can not have any more luck refined on to it...\
<Leave/@Exit>
#ACT
Take Gold 50000
Take LuckPotion 1
Take DragonEyeCrystal 1
GoTo @ADVRefineLuckNxt1
CLOSE

[@ADVRefineLuckNxt1]
#IF
Random 4
#ACT
HLSCRIPTCMD ITEMREMAKEADD 1 3 1
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg0]
SysMsg %A7
#ELSEACT
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg1]
SysMsg %A7

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

[@ADVRefineStrengthNxt]
#IF
HLSCRIPTCMD CHECKITEMPRO 1 7 4
#ELSEACT
BREAK
#ELSESAY
This weapon can not have any more strength refined on to it...\
<Leave/@Exit>
#ACT
Take Gold 50000
Take StrengthPotion 1
Take DragonEyeCrystal 1
GoTo @ADVRefineStrengthNxt1
CLOSE

[@ADVRefineStrengthNxt1]
#IF
Random 4
#ACT
HLSCRIPTCMD ITEMREMAKEADD 1 7 1
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg0]
SysMsg %A7
#ELSEACT
LoadValue A7 [Convert_Def\QuestDiary\Refine\AdvanceRefines.txt] [Convert] [Msg1]
SysMsg %A7

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

;;不要删掉此行