;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@ATMainStart]
{
#IF
Check [399]  1
#SAY
You have already completed this part of the Ancient\
Temple Quests... and you have my thanks\\
<[ Cyas ]/@exit>\\\
#ACT
Break


#IF
Check [398]  0
#SAY
You have done the quest to enter the Temple, that\
means you will have no problems with my tasks, Yes?\
If you will complete my tasks then you will be\
allowed in the next part of Ancient Temple!\\
<[ What do I need to do? ]/@ATNext>\\

#ELSEACT
Goto @ATQuestMain


[@ATNext]
#SAY
You must defeat a few creatures to prove your\
worth, If you check back with me, I will tell\
You what you still have left to defeat\\
Kill 700 AncientDesertWarrior\
Kill 400 AncientRedWarrior\
Kill 300 AncientWarrior\
Kill 100 AncientGhost\
Kill 125 AncientHound\
Kill 90 AncientTong\
Kill 80 AncientBoar\
Kill 1 AncientSoul\\
Now, off you go :)\\
<[ I am up for that.. sign me up ]/@ATNext1>\\\


[@ATNext1]
#ACT
Set  [398]  1
Mov  A0  %USERNAME
Mov  A1  "ATQuest"
Mov  D0  1
FormatStr "'%s','%s',%s" %A0 %A1 %D0
Mov A8 %A9
FormatStr "FLD_CHARACTER='%s' and FLD_QUEST='%s'" %A0 %A1
WriteValueSql "TBL_StingQuests" %A9 "FLD_CHARACTER,FLD_QUEST,FLD_STAGE" %A8
Goto @ATQuestSet1

[@ATQuestSet1]
#ACT
FormatStr "FLD_QUEST ='ATQuest' and FLD_CHARACTER='%s'" %USERNAME
mov   A8     %A9
FormatStr "FLD_VAR1='%s'" 700
UPDATEVALUESQL "TBL_StingQuests" %A8 %A9
FormatStr "FLD_VAR2='%s'" 400
UPDATEVALUESQL "TBL_StingQuests" %A8 %A9
FormatStr "FLD_VAR3='%s'" 300
UPDATEVALUESQL "TBL_StingQuests" %A8 %A9
FormatStr "FLD_VAR4='%s'" 100
UPDATEVALUESQL "TBL_StingQuests" %A8 %A9
FormatStr "FLD_VAR5='%s'" 125
UPDATEVALUESQL "TBL_StingQuests" %A8 %A9
FormatStr "FLD_VAR6='%s'" 90
UPDATEVALUESQL "TBL_StingQuests" %A8 %A9
FormatStr "FLD_VAR7='%s'" 80
UPDATEVALUESQL "TBL_StingQuests" %A8 %A9
FormatStr "FLD_VAR8='%s'" 1
UPDATEVALUESQL "TBL_StingQuests" %A8 %A9
Goto @ATQuestSet2

[@ATQuestSet2]
#SAY
Your all set, off you go :)\\


[@ATQuestMain]
#ACT
FormatStr "FLD_QUEST ='ATQuest' and FLD_CHARACTER='%s'" %USERNAME
ReadValueSql  "TBL_StingQuests"  %A9 "FLD_VAR1,FLD_VAR2,FLD_VAR3,FLD_VAR4,FLD_VAR5"  [@ATQuestMain1]


[@ATQuestMain1()]
#ACT
Mov   D1   %ARG(1)
Mov   D2   %ARG(2)
Mov   D3   %ARG(3)
Mov   D4   %ARG(4)
Mov   D5   %ARG(5)
FormatStr "FLD_QUEST ='ATQuest' and FLD_CHARACTER='%s'" %USERNAME
ReadValueSql  "TBL_StingQuests"  %A9 "FLD_VAR6,FLD_VAR7,FLD_VAR8"  [@ATQuestMain2]


[@ATQuestMain2()]
#ACT
Mov   D6   %ARG(1)
Mov   D7   %ARG(2)
Mov   D8   %ARG(3)
Goto @ATQuestMainCheck


[@ATQuestMainCheck]
#IF
Equal  D1  0
Equal  D2  0
Equal  D3  0
Equal  D4  0
Equal  D5  0
Equal  D6  0
Equal  D7  0
Equal  D8  0
#ACT
Goto @ATQuestComplete
Break
#ELSESAY
You still have the following left to kill!\\
<$OUTPUT(D1)> AncientDesertWarrior\
<$OUTPUT(D2)> AncientRedWarrior\
<$OUTPUT(D3)> AncientWarrior\
<$OUTPUT(D4)> AncientGhost\
<$OUTPUT(D5)> AncientHound\
<$OUTPUT(D6)> AncientTong\
<$OUTPUT(D7)> AncientBoar\
<$OUTPUT(D8)> AncientSoul\\
Hop to it :P\\
<[ Cyas ]/@exit>\\\

[@ATQuestComplete]
#ACT
Set  [399]  1
Set  [398]  0
#SAY
All done.. You can now enter the Lower Floors\
<[ Back to Main ]/@Main>\\\
}

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