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

[@SetDairyQuest]

{







#IF

!StartDailyQuest



#SAY

#INCLUDE [..\Convert_Def\QuestDiary\TodayQuest\QT_SettingBook.txt] @Convert_QT_SettingBook_0



#ACT

break



#IF

Checklevel 51

#ACT

mov D1 10

mov D2 25

mov D3 50

mov D4 90

goto @SetDairyQuest_Setting

break



#IF

Checklevel 41

#ACT

mov D1 8

mov D2 20

mov D3 40

mov D4 72

goto @SetDairyQuest_Setting

break





#IF

Checklevel 31

#ACT

mov D1 6

mov D2 15

mov D3 30

mov D4 54

goto @SetDairyQuest_Setting

break



#IF

Checklevel 21

#ACT

mov D1 4

mov D2 10

mov D3 20

mov D4 36

goto @SetDairyQuest_Setting

break



#IF

Checklevel 11

#ACT

mov D1 2

mov D2 5

mov D3 10

mov D4 18

goto @SetDairyQuest_Setting

break









[@SetDairyQuest_Setting]

#IF

#ACT

movr P0 100



#IF

Large D4 100



#SAY

#INCLUDE [..\Convert_Def\QuestDiary\TodayQuest\QT_SettingBook.txt] @Convert_QT_SettingBook_1



#ACT

break



#IF

Small P0 %D1

#ACT

goto @SetDairyQuest_Setting_Grade1

break



#IF

Small P0 %D2

#ACT

goto @SetDairyQuest_Setting_Grade2

break



#IF

Small P0 %D3

#ACT

goto @SetDairyQuest_Setting_Grade3

break



#IF

Small P0 %D4

#ACT

goto @SetDairyQuest_Setting_Grade4

break



#IF

#ACT

goto @SetDairyQuest_Setting_Grade5

break



[@SetDairyQuest_Setting_Grade1]

begin

#IF

#ACT

movr P0 20



#IF

small P0 100

#ACT

inc P0 101

RandSetDailyQuest %P0 %P0

mov D8 %P0

goto @SetDairyQuest_Setting_PreSet

break

end



[@SetDairyQuest_Setting_Grade2]

begin

#IF

#ACT

movr P0 40



#IF

small P0 100

#ACT

inc P0 201

RandSetDailyQuest %P0 %P0

mov D8 %P0

goto @SetDairyQuest_Setting_PreSet

break

end



[@SetDairyQuest_Setting_Grade3]

begin

#IF

#ACT

movr P0 40



#IF

small P0 100

#ACT

inc P0 301

RandSetDailyQuest %P0 %P0

mov D8 %P0

goto @SetDairyQuest_Setting_PreSet

break

end



[@SetDairyQuest_Setting_Grade4]

begin

#IF

#ACT

movr P0 99



#IF

small P0 100

#ACT

inc P0 401

RandSetDailyQuest %P0 %P0

mov D8 %P0

goto @SetDairyQuest_Setting_PreSet

break

end



[@SetDairyQuest_Setting_Grade5]

begin

#IF

#ACT

movr P0 100



#IF

small P0 100

#ACT

inc P0 501

RandSetDailyQuest %P0 %P0

mov D8 %P0

goto @SetDairyQuest_Setting_PreSet

break



#IF

small P0 200

#ACT

inc P0 900

RandSetDailyQuest %P0 %P0

mov D8 %P0

goto @SetDairyQuest_Setting_PreSet

break

end



[@SetDairyQuest_Setting_PreSet]

#ACT

Set [209] 1

Set [210] 0

Set [409] 0

Formatstr "FLD_TQIDX=%s" %D8

Mov A8 %A9

ReadValueSql "TBL_DairyQuestSet" %A8 "FLD_TQCASE,FLD_TQCondition1,FLD_TQCondition1Amount,FLD_TQCondition2,FLD_TQCondition2Amount,FLD_TQCondition3" [@SetDairyQuest_Setting_ReadSet]



#SAY

#INCLUDE [..\Convert_Def\QuestDiary\TodayQuest\QT_SettingBook.txt] @Convert_QT_SettingBook_2



[@SetDairyQuest_Setting_ReadSet()]

#ACT

Mov D1 %ARG(1)

Mov A2 %ARG(2)

Mov D2 %ARG(3)

Mov A3 %ARG(4)

Mov D3 %ARG(5)

Mov A4 %ARG(6)



Formatstr "FLD_TQIDX=%s" %D8

Mov A8 %A9

ReadValueSql "TBL_DairyQuestSet" %A8 "FLD_TQCondition3Amount,FLD_TQFame,FLD_TQNPC,FLD_TQPosition" [@SetDairyQuest_Setting_ReadSet_Addon]



[@SetDairyQuest_Setting_ReadSet_Addon()]

#ACT

Mov D4 %ARG(1)

Mov D5 %ARG(2)

Mov A5 %ARG(3)

Mov A6 %ARG(4)

Set [409] 0



FormatStr "'%s',%s,'%s'" %USERNAME %D8 "Ready"

Mov A8 %A9

FormatStr "FLD_UserName='%s'" %USERNAME

WriteValueSql "TBL_DairyQuestUser" %A9 "FLD_UserName,FLD_QuestIdx,FLD_Status" %A8



FormatStr "FLD_Step='%s',FLD_TQCASE=%s,FLD_Condition1='%s'" "NULL" %D1 %A2

Mov A8 %A9

FormatStr "FLD_UserName='%s'" %USERNAME

UpdateValueSql "TBL_DairyQuestUser" %A9 %A8



FormatStr "FLD_Condition1Amount=%s,FLD_Condition2='%s',FLD_Condition2Amount=%s" %D2 %A3 %D3

Mov A8 %A9

FormatStr "FLD_UserName='%s'" %USERNAME

UpdateValueSql "TBL_DairyQuestUser" %A9 %A8



FormatStr "FLD_Condition3='%s',FLD_Condition3Amount=%s,FLD_TQFame=%s" %A4 %D4 %D5

Mov A8 %A9

FormatStr "FLD_UserName='%s'" %USERNAME

UpdateValueSql "TBL_DairyQuestUser" %A9 %A8



FormatStr "FLD_TQNPC='%s',FLD_TQPosition='%s'" %A5 %A6

Mov A8 %A9

FormatStr "FLD_UserName='%s'" %USERNAME

UpdateValueSql "TBL_DairyQuestUser" %A9 %A8



goto @Call_SetDairyQuest_Setting



[@Call_SetDairyQuest_Setting]

#CALL [TodayQuest\QT_ReadyBook.txt] @Ready_QuestDairyToday

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