;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@main]
#IF
checkpkpoint 2

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

#ELSESAY
Hi, My name is {FCOLOR/10}<$NPCNAME>{FCOLOR/12}.\
<[ Change Style or Colour ]/@HairDress>\
#IF
Check [255] 1
Check [256] 0
#SAY
<[ Poor Soul Quest ]/@PoorSoulQuest>\
#IF
#SAY
<[ Exit ]/@exit>\

[@_startup]
#ACT
Break

[@PoorSoulQuest]
#IF
#ACT
FormatStr "FLD_QUEST ='Paul' and FLD_CHARACTER='%s'" %USERNAME
ReadValueSql "TBL_StingQuests" %A9 "FLD_Stage" @PoorSoulQuest_Check

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

#IF
Equal  D1  0
#ACT
Goto @PoorSoulQuest0
Break

#IF
Equal  D1  1
#ACT
Goto @PoorSoulQuest1
Break

#IF
Equal  D1  2
#ACT
Goto @PoorSoulQuest2
Break

[@PoorSoulQuest0]
#IF
CheckItem IntroductionLetter 1
#SAY
Many years ago, it is said that a man lost his\
son in a terrible accident. For a long time, he \
would not believe his son was dead, and kept \
trying to find him. \
<[ OMG, What Happened ]/@PoorSoulQuest0_1>\
<[ Not my problem, Sorry ]/@PoorSoulQUest0_0>\
#ELSESAY
Sorry, I don't talk to people I don't know\\
<[ Exit ]/@exit>\\

[@PoorSoulQuest0_0]
#SAY
Here me out, this is a sad story\\
<[ OK, bore me more! ]/@PoorSoulQuest0_1>\
<[ No more BOOOOORINNGG ]/@exit>\\

[@PoorSoulQuest0_1]
#SAY
When the truth finally dawned on him, he was \
totally distraught, and decided to try and find \
someone who could bring back his son from the grave. \
<[ Thats sick! Did he find someone? ]/@PoorSoulQuest0_2>\
<[ Too much for me, Cya ]/@exit>\

[@PoorSoulQuest0_2]
#SAY
Well, He finally found a necromancer who agreed to \
help him, but sadly did not tell him of the terrible \
price he would pay. In exchange for his son's \
resurrection, he would forfeit his own soul, and \
would be condemned to roam the {FCOLOR/10}DeadPit{FCOLOR/12} forever as a \
{FCOLOR/10}Ghoul{FCOLOR/12}, neither dead nor alive. Can you seek out \
this poor creature on the third floor of {FCOLOR/10}DeadPit{FCOLOR/12},\
and put him out of his misery?\\
<[ I'll do my best ]/@PoorSoulQuest0_3>\
<[ No, he can stay there for all I care ]/@exit>\\\

[@PoorSoulQuest0_3]
#SAY
Do all you can for that poor tortured soul\
Let me take that letter from you\\
<[ No Problem ]/@exit>\
#ACT
Mov  A0  %USERNAME
Mov  A1  "Paul"
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
Take IntroductionLetter 1

[@PoorSoulQuest1]
#IF
#SAY
Can you please try and free that tormented\
Soul from the {FCOLOR/10}DeadPit{FCOLOR/12}, that {FCOLOR/10}Ghoul{FCOLOR/12}
\
is really a nice person!\
<[ I'll keep trying ]/@exit>\\


[@PoorSoulQuest2]
#IF
#SAY
You have done both the town a welcome service\
and put that poor tortured soul out of its\
misery. Thankyou, and please accept this reward \
on behalf of us all.\\
<[ I'm like a superhero! ]/@exit>\\
#ACT
Mov  A0  %USERNAME
Mov  A1  "Paul"
Mov  D0  3
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 50000
Set  [256] 1
Set  [255] 0

[@HairDress]
#CALL [System\HairChange.txt] @HairControl

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