;;不要删掉此行

[@Main]
#ACT
Loadvalue A4 "QuestDiary\AncientSword.txt" [%USERNAME] Active

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

#IF
Equal A4 "Yes"
#ACT
GoTo @ReturnSword
#ELSEACT
GoTo @Main2

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

[@Main2]
#SAY
Welcome <$USERNAME>\
I know of a Ancient Sword.\
If you bring me 50 Ancient Elements\
I will craft this sword for you the \
sword will only last 7 days\\
<I Have 50 Ancient Elements/@Check_Item>\

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

[@Check_Item]
#SAY
What Element do you have?\\
Ancient Element: <Fire (Ignis)/@AncientElement(Ignis)>\
Ancient Element: <Cold (Gelu)/@AncientElement(Gelu)>\
Ancient Element: <Lightning (Fulmen)/@AncientElement(Fulmen)>\
Ancient Element: <Wind (Ventus)/@AncientElement(Ventus)>\
Ancient Element: <Holy (Sacer)/@AncientElement(Sacer)>\
Ancient Element: <Dark (Ater)/@AncientElement(Ater)>\
Ancient Element: <Phantom (Phasma)/@AncientElement(Phasma)>\\
<Leave/@Exit>\

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

[@AncientElement()]
#ACT
Mov A0 AncientElement
Mov A1 %ARG(1)
AddStr A0 (
AddStr A0 %A1
AddStr A0 )

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

#IF
CheckItem %A0 50
#ACT
GoTo @MakeSword
#ELSESAY
Sorry...\\
You do not have 50 x <$OUTPUT(A0)>.\\
<Leave/@Exit>

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

[@MakeSword]
#ACT
Take %A0 50
GoTo @ChangeElementToSword

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

[@ChangeElementToSword]
#ACT
Mov A0 AncientSword
AddStr A0 (
AddStr A0 %A1
AddStr A0 )
#SAY
The sword will last 7 days.\
This sword can not be refined.\
If you do not bring the sword back to\
me within 7 days, I will tell the Bichon Adminstrator\
that you are a theif and he will stop all merchants from\
talking to you...or Vamp will think of a better punishment :P\
<I will bring it back/@GetSword>\

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

[@GetSword]
#IF
DayofWeek Mon
#ACT
Mov A2 Monday
GoTo @SetDay

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

#IF
DayofWeek Tue
#ACT
Mov A2 Tuesday
GoTo @SetDay

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

#IF
DayofWeek Wed
#ACT
Mov A2 Wednesday
GoTo @SetDay

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

#IF
DayofWeek Thu
#ACT
Mov A2 Thursday
GoTo @SetDay

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

#IF
DayofWeek Fri
#ACT
Mov A2 Friday
GoTo @SetDay

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

#IF
DayofWeek Sat
#ACT
Mov A2 Saterday
GoTo @SetDay

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

#IF
DayofWeek Sun
#ACT
Mov A2 Sunday
GoTo @SetDay

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

[@SetDay]
#ACT
SaveValue "QuestDiary\AncientSword.txt" [%USERNAME] Active Yes
SaveValue "QuestDiary\AncientSword.txt" [%USERNAME] ReturnDay %A2
SaveValue "QuestDiary\AncientSword.txt" [%USERNAME] RentedSword %A0
Give %A0 1
#SAY
There is your <$OUTPUT(A0)> you must bring it back next <$OUTPUT(A2)>.\\
<Leave/@Exit>\

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

[@ReturnSword]
#ACT
Loadvalue A1 "QuestDiary\AncientSword.txt" [%USERNAME] ReturnDay %A2
Loadvalue A0 "QuestDiary\AncientSword.txt" [%USERNAME] RentedSword %A0
#SAY
Ancient Sword: <$OUTPUT(A0)>\
Return Day: <$OUTPUT(A1)>\\
<I have come to return my sword/@TakeSword>\

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

[@TakeSword]
#IF
CheckItem %A0 1
#ACT
SaveValue "QuestDiary\AncientSword.txt" [%USERNAME] Active No
SaveValue "QuestDiary\AncientSword.txt" [%USERNAME] ReturnDay Returned
SaveValue "QuestDiary\AncientSword.txt" [%USERNAME] RentedSword None
Take %A0 1
#SAY
Please come back and get another sword soon...\\
<Leave/@Exit>
#ELSESAY
Sorry...\\
You do not have your <$OUTPUT(A0)>\
In your bag.\

;;不要删掉此行