;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

%100
+10
+11
[@main]
#IF
checkpkpoint 2

#SAY
#INCLUDE [..\Market_Def\00BuySell_Std.txt] @Convert_BuySellStd_PK

#ELSESAY
Hi, My name is {FCOLOR/10}<$NPCNAME>{FCOLOR/12}, how can I help you?\
<[ Buy ]/@buy> Armour\
<[ Sell ]/@sell> Armour\
<[ Repair ]/@Repair> Armour\
<[ Special Repair ]/@SpecialRepairArm>\
#IF
Check  [257]  1
Check  [258]  0
#SAY
<[ Test Quest ]/@TestQuest>\
#IF
#SAY
<[ Exit ]/@exit>\

[@SpecialRepairArm]
#ACT
GetRepairCost  0
Mov P1 %P9
Mov P2 2
Mul P1 P2
Mov D1 %P9
#SAY
This will cost you <$OUTPUT(P9)> Gold\
<[ Continue ]/@SpecialRepairArm1>\
<[ Main Menu ]/@Main>\

[@SpecialRepairArm1]
#IF
#ACT
GetRepairCost  0
Mov P1 %P9
Mov P2 2
Mul P1 P2
Mov D1 %P9
#IF
CheckGold %D1
#ACT
RepairItem  0
Take Gold %D1
#SAY
All Repaired\
#ELSESAY
You don't have that much gold\\
<[ Main Menu ]/@Main>\

[@buy]
#SAY
#INCLUDE [..\Market_Def\00BuySell_Std.txt] @Convert_BuySellStd_Buy

[@sell]
#SAY
#INCLUDE [..\Market_Def\00BuySell_Std.txt] @Convert_BuySellStd_Sell

[@repair]
#SAY
#INCLUDE [..\Market_Def\00BuySell_Std.txt] @Convert_BuySellStd_Rep

[~@repair]
#SAY
#INCLUDE [..\Market_Def\00BuySell_Std.txt] @Convert_BuySellStd_Rep1

[@TestQuest]
#IF
Check [257] 1
Check [258] 0
#ACT
FormatStr "FLD_QUEST ='Mary' and FLD_CHARACTER='%s'" %USERNAME
ReadValueSql "TBL_StingQuests" %A9 "FLD_Stage" @MaryQuestStage
Break

[@MaryQuestStage()]
#IF
#ACT
Mov    D1  %ARG(1)

#IF
Small  D1  9
#ACT
Goto @MaryQuest0
Break

#IF
Equal  D1  9
#ACT
Goto @MaryQuest9
Break

#IF
Equal  D1  10
#ACT
Goto @MaryQuest10
Break

#IF
Equal  D1  11
#ACT
Goto @MaryQuest11
Break

#IF
Large D1  11
#ACT
Goto @MaryQuest12
Break


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Part 0
[@MaryQuest0]
#SAY
The time for me to play my part in your test\
has not arrived, please call back later when\
the time is right\\
<[ Exit ]/@exit>\\
#ACT
Break

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Part 9
[@MaryQuest9]
#IF
#SAY
In the {FCOLOR/10}Desert{FCOLOR/12} reside many creatures, who often \
block our trade routes to Numa Village. The \
worst of these is the {FCOLOR/10}GreatNumaMonk{FCOLOR/12}, who \
attacks every caravan he sees, wipes out the \
travellers, and steals their goods. Seek out this \
mad creature, and put an end to him. If you can do\
this, you will earn the respect of all.\\
<[ I am looking forward to the challenge ]/@MaryQuest10_1>\
<[ I dont do sun and sand, sorry ]/6exit>\\\

#ACT
Mov  A0  %USERNAME
Mov  A1  "Mary"
Mov  D0  10
FormatStr "FLD_STAGE=%s" %D0
Mov A8 %A9
FormatStr "FLD_CHARACTER='%s' and FLD_QUEST='%s'" %A0 %A1
UpdateValueSql "TBL_StingQuests" %A9 %A8
Break

[@MaryQuest10_1]
#SAY
Thats what I like to see.. commitment!\\
<[ Exit ]/@exit>\
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Part 10
[@MaryQuest10]
#SAY
{FCOLOR/10}GreatNumaMonk{FCOLOR/12} has taken out another Caravan in \
the {FCOLOR/10}Desert{FCOLOR/12}! Kill him soon!\\
<[ I will prevail ]/@exit>\
#ACT
Break

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Part 11
[@MaryQuest11]

#IF
#SAY
You are indeed fearless my friend, and have \
richly deserved this reward. You are now ready\
to take on many fierce creatures in this land\
<[ I am here to serve! ]/@exit>\\\

#ACT
Mov  A0  %USERNAME
Mov  A1  "Mary"
Mov  D0  12
FormatStr "FLD_STAGE=%s" %D0
Mov A8 %A9
FormatStr "FLD_CHARACTER='%s' and FLD_QUEST='%s'" %A0 %A1
UpdateValueSql "TBL_StingQuests" %A9 %A8
GIVEEXP %A0 1000000
Set   [258] 1
Break


[Goods]

DurableBasicArmour(M) 20 1
DurableBasicArmour(F) 20 1
LightArmour(M) 20 1
LightArmour(F) 20 1

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;