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

[@NPC_QuestDairyToday_Result]

{

#IF

#ACT

movr D9 100



#IF

Small D9 10

#ACT

FormatStr "FLD_TQIDX=%s" %D0

ReadValueSql "TBL_DairyQuestSet" %A9 "FLD_TQReword1,FLD_TQReword1Amount,FLD_TQFame" [@NPCReword_QuestDairyToday_Result_Next]

break



#IF

Small D9 30

#ACT

FormatStr "FLD_TQIDX=%s" %D0

ReadValueSql "TBL_DairyQuestSet" %A9 "FLD_TQReword2,FLD_TQReword2Amount,FLD_TQFame" [@NPCReword_QuestDairyToday_Result_Next]

break



#IF

#ACT

FormatStr "FLD_TQIDX=%s" %D0

ReadValueSql "TBL_DairyQuestSet" %A9 "FLD_TQReword3,FLD_TQReword3Amount,FLD_TQFame" [@NPCReword_QuestDairyToday_Result_Next]

break



[@NPCReword_QuestDairyToday_Result_Next()]

#IF

Checkfame



#SAY

#INCLUDE [..\Convert_Def\QuestDiary\TodayQuest\QT_NPCReword.txt] @Convert_QT_NPCReword_0



#ACT

mov A4 %ARG(1)

mov D4 %ARG(2)

mov D5 %ARG(3)

mov D6 %P9

inc D6 %D5



FormatStr "FLD_TQIDX=%s" %D0

ReadStringSql "TBL_DairyQuestSet" %A9 "FLD_TQNPCContent3" [@NPCReword_QuestDairyToday_Result_Next1]

break



[@NPCReword_QuestDairyToday_Result_Next1]

#ACT

Mov A5 %ARG(1)



#IF

Equal A4 "Exp"



#SAY

#INCLUDE [..\Convert_Def\QuestDiary\TodayQuest\QT_NPCReword.txt] @Convert_QT_NPCReword_1



#ACT

GiveExp %USERNAME %D4

Set [210] 0

Set [409] 1

goto @NPCReword_QuestDairyToday_GiveFame

break



#IF

Equal A4 "Money"



#SAY

#INCLUDE [..\Convert_Def\QuestDiary\TodayQuest\QT_NPCReword.txt] @Convert_QT_NPCReword_2



#ACT

Give ½ð±Ò %D4

Set [210] 0

Set [409] 1

goto @NPCReword_QuestDairyToday_GiveFame

break



#IF

!Equal A4 "Exp"

!Equal A4 "Money"

Large D4 10000



#SAY

#INCLUDE [..\Convert_Def\QuestDiary\TodayQuest\QT_NPCReword.txt] @Convert_QT_NPCReword_3



#ACT

goto @NPCSet_QuestDairyToday_Next2_Monster

break



#IF



#SAY

#INCLUDE [..\Convert_Def\QuestDiary\TodayQuest\QT_NPCReword.txt] @Convert_QT_NPCReword_4



#ACT

Give %A4 %D4

Set [210] 0

Set [409] 1

goto @NPCReword_QuestDairyToday_GiveFame

break





[@NPCSet_QuestDairyToday_Next2_Monster]

#IF

checkmonrecall

#ACT

GiveExp %USERNAME 20000

goto @NPCReword_QuestDairyToday_GiveFame

break



#IF



#SAY

#INCLUDE [..\Convert_Def\QuestDiary\TodayQuest\QT_NPCReword.txt] @Convert_QT_NPCReword_5



#ACT

Dec D4 10000

monrecall %A4 %D4 0

Set [210] 0

Set [409] 1

goto @NPCReword_QuestDairyToday_GiveFame

break



[@NPCReword_QuestDairyToday_GiveFame]

#IF

!Equal D5 0

#ACT

SetFame %D6

LoadValue A7 [Convert_Def\QuestDiary\TodayQuest\QT_NPCReword.txt] [Convert] [Msg0]

SysMsg %A7

LoadValue A7 [Convert_Def\QuestDiary\TodayQuest\QT_NPCReword.txt] [Convert] [Msg1]

SysMsg %A7

FormatStr "FLD_USERNAME='%s'" %USERNAME

UpdateValueSql "TBL_DairyQuestUser" %A9 "FLD_Status='End',FLD_Step='NULL'"

#ELSEACT

FormatStr "FLD_USERNAME='%s'" %USERNAME

UpdateValueSql "TBL_DairyQuestUser" %A9 "FLD_Status='End',FLD_Step='NULL'"

}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;