;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@Var_Initial]
{
#ACT

ReadValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME,FLD_JOBCONDITION" [@Var_Initial_0]

[@Var_Initial_0()]
#ACT
mov B1 %ARG(1)
mov B2 %ARG(2)


#IF
#ACT
SaveValue "QuestDiary\Judgement\Flag.txt" [MainTimer] [SuperQuest] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [MainTimer] [EventQuest] 0

#IF
Equal B1 "T1"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='T0',FLD_JOBDAYCOUNT=0,FLD_JOBCONDITION='End'"


#IF
Equal B1 "Q052"
!Equal B2 "End"
#ACT
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='T1',FLD_JOBDAYCOUNT=0,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [052] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [052] [Position] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [052] [PreTell] 0

#IF
Equal B1 "T2"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q052',FLD_JOBDAYCOUNT=1,FLD_JOBCONDITION='End'"


#IF
Equal B1 "Q050"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='T2',FLD_JOBDAYCOUNT=1,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [050] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [050] [GiveTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [050] [KillNuma] 0

#IF
Equal B1 "T3"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q050',FLD_JOBDAYCOUNT=2,FLD_JOBCONDITION='End'"


#IF
Equal B1 "T4"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='T3',FLD_JOBDAYCOUNT=2,FLD_JOBCONDITION='End'"


#IF
Equal B1 "Q050"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='T4',FLD_JOBDAYCOUNT=2,FLD_JOBCONDITION='End'"

SaveValue "QuestDiary\Judgement\Flag.txt" [MainTimer] [SuperQuest] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [051] [MonZen] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [051] [EnterGate] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [051] [CloseGate] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [051] [HumanRun] 0

#IF
Equal B1 "T00"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q051',FLD_JOBDAYCOUNT=3,FLD_JOBCONDITION='End'"


#IF
Equal B1 "T001"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='T00',FLD_JOBDAYCOUNT=3,FLD_JOBCONDITION='End'"


#IF
Equal B1 "Q002"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='T001',FLD_JOBDAYCOUNT=3,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [002] [GiveTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [002] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [002] [ReadingNow] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [002] [ReadLetter] 0

#IF
Equal B1 "Q004"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q002',FLD_JOBDAYCOUNT=3,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [004] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [004] [GiveTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [004] [GroupTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [004] [EventStart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [004] [QuestSuccess] 0

#IF
Equal B1 "Q005"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q004',FLD_JOBDAYCOUNT=4,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [005] [OpenGate] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [005] [CloseGate] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [005] [QuestSuccess] 0

#IF
Equal B1 "Q006"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q005',FLD_JOBDAYCOUNT=4,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [006] [GateOpen] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [006] [GateClose] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [006] [FirstFailed] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [006] [SecondFailed] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [006] [ThirdFailed] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [006] [QuestSuccess] 0

#IF
Equal B1 "Q007"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q006',FLD_JOBDAYCOUNT=7,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [007] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [007] [RecieveMail] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [007] [SendMail] 0

#IF
Equal B1 "Q008"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q007',FLD_JOBDAYCOUNT=7,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [008] [EventStart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [008] [GiveTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [008] [Result] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [008] [Result2] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [008] [HumanCount] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [008] [HumanCount2] 0

#IF
Equal B1 "T01"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q008',FLD_JOBDAYCOUNT=8,FLD_JOBCONDITION='End'"

#IF
Equal B1 "Q009"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='T01',FLD_JOBDAYCOUNT=8,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [009] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [009] [GrupTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [009] [EventStart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [009] [QuestSuccess] 0

#IF
Equal B1 "Q010"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q009',FLD_JOBDAYCOUNT=8,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [010] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [010] [GrupTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [010] [EventStart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [010] [QuestSuccess] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [010] [GiveTimeOver] 0

#IF
Equal B1 "Q011"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q010',FLD_JOBDAYCOUNT=8,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [011] [mon] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [011] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [011] [GrupTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [011] [EventStart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [011] [QuestSuccess] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [011] [GiveTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [011] [Missionsay] 0

#IF
Equal B1 "Q012"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q011',FLD_JOBDAYCOUNT=9,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [012] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [012] [RecieveSay] 0

#IF
Equal B1 "Q013"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q012',FLD_JOBDAYCOUNT=9,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [013] [OpenGate] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [013] [CloseGate] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [013] [FirstFailed] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [013] [SecondFailed] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [013] [ThirdFailed] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [013] [QuestSuccess] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [013] [GateOpen] 0

#IF
Equal B1 "T02"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q013',FLD_JOBDAYCOUNT=11,FLD_JOBCONDITION='End'"


#IF
Equal B1 "Q1318"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='T02',FLD_JOBDAYCOUNT=12,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [014] [end] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [014] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [014] [GiveTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [014] [GroupTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [014] [EventStart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [014] [QuestSuccess] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [018] [end] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [018] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [018] [RecieveMail] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [018] [QuestSuccess] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [019] [end] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [019] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [019] [RecieveMail] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [019] [SendMail] 0


#IF
Equal B1 "Q1323"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q1318',FLD_JOBDAYCOUNT=12,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [020] [EventStart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [020] [GiveTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [020] [Result] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [008] [Result2] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [020] [HumanCount] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [020] [HumanCount2] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [020] [HumanCountr] 0

#IF
Equal B1 "Q1418"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q1323',FLD_JOBDAYCOUNT=13,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [015] [end] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [015] [HumanCount] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [015] [SuccessCount] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [017] [end] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [017] [HumanCount] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [021] [end] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [021] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [021] [RecieveMail] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [021] [SendMail] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [022] [end] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [022] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [022] [RecieveMail] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [022] [Eventstart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [022] [GrupTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [022] [SendMail] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [026] [end] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [026] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [026] [GrupTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [026] [EventStart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [026] [QuestSuccess] 0

#IF
Equal B1 "Q1422"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='1418',FLD_JOBDAYCOUNT=13,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [016] [Open] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [016] [end] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [016] [HumanCount] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [023] [end] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [023] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [023] [GrupTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [023] [Eventstart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [023] [QuestSuccess] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [027] [end] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [027] [QuestUserName1] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [027] [QuestUserName2] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [027] [QuestUserName3] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [027] [AmorMove] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [027] [JeasMove] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [027] [TumoMove] 0


#IF
Equal B1 "Q024"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q1422',FLD_JOBDAYCOUNT=14,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [024] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [024] [QuestSuccess] 0

#IF
Equal B1 "Q025"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q024',FLD_JOBDAYCOUNT=14,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [025] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [025] [GrupTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [025] [EventStart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [025] [QuestSuccess] 0

#IF
Equal B1 "T03"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q025',FLD_JOBDAYCOUNT=15,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [T03] [GiveTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [T03] [MapClose] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [T03] [Eventstart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [028] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [028] [AttackGuild] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [028] [NormalGuild] 0


#IF
Equal B1 "T04"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='T03',FLD_JOBDAYCOUNT=16,FLD_JOBCONDITION='End'"



#IF
Equal B1 "Q029"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='T04',FLD_JOBDAYCOUNT=16,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [029] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [029] [GiveTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [029] [GroupTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [029] [EventStart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [029] [QuestSuccess] 0

#IF
Equal B1 "Q030"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q029',FLD_JOBDAYCOUNT=17,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [030] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [030] [GiveTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [030] [GroupTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [030] [EventStart] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [030] [QuestSuccess] 0

#IF
Equal B1 "Q031"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q030',FLD_JOBDAYCOUNT=17,FLD_JOBCONDITION='End'"
SaveValue "QuestDiary\Judgement\Flag.txt" [031] [QuestUserName] ""
SaveValue "QuestDiary\Judgement\Flag.txt" [031] [GiveTimeOver] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [031] [RecieveMail] 0
SaveValue "QuestDiary\Judgement\Flag.txt" [031] [SendMail] 0

#IF
Equal B1 "T06"
!Equal B2 "End"
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBSTORY'" "FLD_JOBNAME='Q031',FLD_JOBDAYCOUNT=18,FLD_JOBCONDITION='End'"





#IF
#ACT

UpdateValueSql "TBL_JobServerMain" "FLD_JOB='JOBRANDOM'" "FLD_JOBNAME='T0',FLD_JOBCONDITION='End'"





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