;;不要删掉此行

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

[@Main]
#ACT
Loadvalue A1 "QuestDiary\Guild\Palace.txt" %GUILDNAME [Repair]
#IF
Equal A1 "Active"
#SAY
Welcome <$USERNAME>,\
How may i help you?\
{FCOLOR/10}Special Repair: <Weapon/@SRepair(1)> <$@GetWeaponCost>
{FCOLOR/10}Special Repair: <Armour/@Armour>\
{FCOLOR/10}Special Repair: <Accessory/@Accessory>\\
{FCOLOR/10}Special Repair: <All/@Repair_ALL>\\
<Leave/@Exit>
#ELSESAY
I can spacial repair items for 50% of town price\
If your guild wish to use my skills it will\
cost you 2,000,000 Gold...per week\\
<We will hire you/@Hire>\
<Leave/@Exit>

[@Hire]
#IF
CheckGold 2000000
#ACT
SaveValue "QuestDiary\Guild\Palace.txt" %GUILDNAME [Repair] Active
Take Gold 2000000
GoTo @FindDay
#ELSESAY
I wont work for such a poor man...\\
<Leave/@Exit>

[@FindDay]
#IF
DAYOFWEEK Monday
#ACT
Mov A2 Monday
GoTo @SetDay
BREAK

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

#IF
DAYOFWEEK Tuesday
#ACT
Mov A2 Tuesday
GoTo @SetDay
BREAK

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

#IF
DAYOFWEEK Wednesday
#ACT
Mov A2 Wednesday
GoTo @SetDay
BREAK

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

#IF
DAYOFWEEK Thursday
#ACT
Mov A2 Thursday
GoTo @SetDay
BREAK

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

#IF
DAYOFWEEK Friday
#ACT
Mov A2 Friday
GoTo @SetDay
BREAK

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

#IF
DAYOFWEEK Saterday
#ACT
Mov A2 Saterday
GoTo @SetDay
BREAK

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

#IF
DAYOFWEEK Sunday
#ACT
Mov A2 Sunday
GoTo @SetDay
BREAK

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

[@SetDay]
#ACT
SaveValue "QuestDiary\Guild\Palace.txt" %GUILDNAME [RepairPurchase] %A2
GoTo @Main

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

[@Accessory]
#SAY
What do you want me to repair?\\
<Necklace/@SRepair(3)> <$@GetNecklaceCost>
<Left Bracelet/@SRepair(5)> <$@GetLeftBraceCost>
<Right Bracelet/@SRepair(6)> <$@GetRighBraceCost>
<Left Ring/@SRepair(7)> <$@GetRingCostLeft>
<Right Ring/@SRepair(8)> <$@GetRightRingCost>
<Back/@Main>\
<Leave/@Exit>

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

[@Armour]
#SAY
What do you want me to repair?\\
<Armour/@SRepair(0)> <$@GetArmourCost>
<Helmet/@SRepair(4)> <$@GetHelmetCost>
<Shoes/@SRepair(10)> <$@GetFootWearCost>
<Back/@Main>\
<Leave/@Exit>

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

[@GetWeaponCost]
#ACT
;mov P0 1
GetRepairCost 1
#ACT
Mov N95 %P9
Mov N94 2
Div N95 N94
#SAY
Cost: {FCOLOR/10}<$OUTPUT(P9)>{FCOLOR/12}\

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

[@GetNecklaceCost]
#ACT
;mov P0 3
GetRepairCost 3
#ACT
Mov N95 %P9
Mov N94 2
Div N95 N94
#SAY
Cost: {FCOLOR/10}<$OUTPUT(P9)>{FCOLOR/12}\

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

[@GetLeftBraceCost]
#ACT
;mov P0 5
GetRepairCost 5
#ACT
Mov N95 %P9
Mov N94 2
Div N95 N94
#SAY
Cost: {FCOLOR/10}<$OUTPUT(P9)>{FCOLOR/12}\

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

[@GetRighBraceCost]
#ACT
;mov P0 6
GetRepairCost 6
#ACT
Mov N95 %P9
Mov N94 2
Div N95 N94
#SAY
Cost: {FCOLOR/10}<$OUTPUT(P9)>{FCOLOR/12}\

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

[@GetRingCostLeft]
#ACT
;mov P0 7
GetRepairCost 7
#ACT
Mov N95 %P9
Mov N94 2
Div N95 N94
#SAY
Cost: {FCOLOR/10}<$OUTPUT(P9)>{FCOLOR/12}\

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

[@GetRightRingCost]
#ACT
;mov P0 8
GetRepairCost 8
#ACT
Mov N95 %P9
Mov N94 2
Div N95 N94
#SAY
Cost: {FCOLOR/10}<$OUTPUT(P9)>{FCOLOR/12}\

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

[@GetArmourCost]
#ACT
;mov P0 0
GetRepairCost 0
#ACT
Mov N95 %P9
Mov N94 2
Div N95 N94
#SAY
Cost: {FCOLOR/10}<$OUTPUT(P9)>{FCOLOR/12}\

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

[@GetHelmetCost]
#ACT
;mov P0 4
GetRepairCost 4
#ACT
Mov N95 %P9
Mov N94 2
Div N95 N94
#SAY
Cost: {FCOLOR/10}<$OUTPUT(P9)>{FCOLOR/12}\

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

[@GetFootWearCost]
#ACT
;mov P0 1
GetRepairCost 10
#ACT
Mov N95 %P9
Mov N94 2
Div N95 N94
#SAY
Cost: {FCOLOR/10}<$OUTPUT(P9)>{FCOLOR/12}\

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

[@SRepair()]
#ACT
Mov P0 %ARG(1)
GetRepairCost %P0
Mov N95 %P9
Mov N94 2
Div N95 N94

#IF
CheckGold %P9
#ACT
RepairItem %P0
Take Gold %P9
Goto @Main
#ELSESAY
You do not have enought gold...\\

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

[@Repair_ALL]
#ACT
Mov P0 0
GetRepairCost %P0
Mov N95 %P9
Mov N94 2
Div N95 N94

#IF
CheckGold %P9
#ACT
RepairItem %P0
Take Gold %P9
DelayGoto [Local] 1 @Repair_ALL_1
#SAY
Repairing: {FCOLOR/10}Armour{FCOLOR/10}
#ELSESAY
You do not have enought gold...\\

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

[@Repair_ALL_1]
#ACT
Mov P0 1
GetRepairCost %P0
Mov N95 %P9
Mov N94 2
Div N95 N94

#IF
CheckGold %P9
#ACT
RepairItem %P0
Take Gold %P9
DelayGoto [Local] 1 @Repair_ALL_2
#SAY
Repairing: {FCOLOR/10}Weapon{FCOLOR/10}
#ELSESAY
You do not have enought gold...\\

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

[@Repair_ALL_2]
#ACT
Mov P0 4
GetRepairCost %P0
Mov N95 %P9
Mov N94 2
Div N95 N94

#IF
CheckGold %P9
#ACT
RepairItem %P0
Take Gold %P9
DelayGoto [Local] 1 @Repair_ALL_3
#SAY
Repairing: {FCOLOR/10}Helmet{FCOLOR/10}
#ELSESAY
You do not have enought gold...\\

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

[@Repair_ALL_3]
#ACT
Mov P0 3
GetRepairCost %P0
Mov N95 %P9
Mov N94 2
Div N95 N94

#IF
CheckGold %P9
#ACT
RepairItem %P0
Take Gold %P9
DelayGoto [Local] 1 @Repair_ALL_4
#SAY
Repairing: {FCOLOR/10}Necklace{FCOLOR/10}
#ELSESAY
You do not have enought gold...\\

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

[@Repair_ALL_4]
#ACT
Mov P0 5
GetRepairCost %P0
Mov N95 %P9
Mov N94 2
Div N95 N94

#IF
CheckGold %P9
#ACT
RepairItem %P0
Take Gold %P9
DelayGoto [Local] 1 @Repair_ALL_5
#SAY
Repairing: {FCOLOR/10}Left Bracelet{FCOLOR/10}
#ELSESAY
You do not have enought gold...\\

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

[@Repair_ALL_5]
#ACT
Mov P0 6
GetRepairCost %P0
Mov N95 %P9
Mov N94 2
Div N95 N94

#IF
CheckGold %P9
#ACT
RepairItem %P0
Take Gold %P9
DelayGoto [Local] 1 @Repair_ALL_6
#SAY
Repairing: {FCOLOR/10}Right Bracelet{FCOLOR/10}
#ELSESAY
You do not have enought gold...\\

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

[@Repair_ALL_6]
#ACT
Mov P0 7
GetRepairCost %P0
Mov N95 %P9
Mov N94 2
Div N95 N94

#IF
CheckGold %P9
#ACT
RepairItem %P0
Take Gold %P9
DelayGoto [Local] 1 @Repair_ALL_7
#SAY
Repairing: {FCOLOR/10}Left Ring{FCOLOR/10}
#ELSESAY
You do not have enought gold...\\

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

[@Repair_ALL_7]
#ACT
GetRepairCost %P0
Mov N95 %P9
Mov N94 2
Div N95 N94

#IF
CheckGold %P9
#ACT
RepairItem %P0
Take Gold %P9
DelayGoto [Local] 1 @Repair_ALL_8
#SAY
Repairing: {FCOLOR/10}Right Ring{FCOLOR/10}
#ELSESAY
You do not have enought gold...\\

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

[@Repair_ALL_8]
#ACT
Mov P0 8
GetRepairCost %P0
Mov N95 %P9
Mov N94 2
Div N95 N94

#IF
CheckGold %P9
#ACT
RepairItem %P0
Take Gold %P9
DelayGoto [Local] 1 @Repair_ALL_9
#SAY
Repairing: {FCOLOR/10}Shoes{FCOLOR/10}
#ELSESAY
You do not have enought gold...\\

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

[@Repair_ALL_9]
#ACT
Loadvalue A5 "QuestDiary\Guild\GoldStorage.txt" %GUILDNAME [Gold]

#ACT
mov D2 %A5
mov D3 2000

#IF
CheckGold %D3
#ACT
Take Gold %D3
INC D2 %D3
SaveValue "QuestDiary\Guild\GoldStorage.txt" %GUILDNAME [Gold] %D2
#SAY
Finished...\\
<Leave/@Exit>
#ELSESAY
Finished...\\
<Leave/@Exit>

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

;;不要删掉此行