;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@sinGisun_open]
{
#ACT
FormatStr "FLD_SINUSERNAME='%s'" %USERNAME

ReadValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINUSERNAME,FLD_SINMAINSTEP,FLD_SINSTEP_READY" [@SinGiMain_1_0]

[@SinGiMain_1_0()]
#ACT
mov A1 %ARG(1)
mov D1 %ARG(2)
mov D2 %ARG(3)

#IF
Equal A1 ""

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_0

#ACT
break

#IF
Equal D1 3
Equal D2 2
checkitem 霸王教主雕像 1
#ACT
goto @SinQuest_Pachun
break

#IF
Equal D1 3
Equal D2 1
#ACT
goto @SinQuest_Pachun_start
break

#IF
Equal D1 2
Equal D2 3
checkitem 遗骸 1
checkjob taoist
#ACT
goto @SinQuest_End_3
break

#IF
Equal D1 2
Equal D2 3
checkitem 遗骸 1
checkjob wizard
#ACT
goto @SinQuest_End_2
break

#IF
Equal D1 2
Equal D2 3
checkitem 遗骸 1
checkjob warrior
#ACT
goto @SinQuest_End
break

#IF
Equal D1 2
Equal D2 2
#ACT
goto @SinQuest_SeeAgain_1
break

#IF
Equal D1 2
Equal D2 1
#ACT
goto @SinQuest_SeeAgain
break

#IF
Equal D1 2
Equal D2 0
#ACT
goto @SinQuest_Spritstest_Check_1
break

#IF
Equal D1 1
Equal D2 4
checkitem 魔灵牌 1
#ACT
goto @SinQuest_Spritstest_Check
break

#IF
Equal D1 1
Equal D2 3
checkitem 魔灵牌 1
#ACT
goto @SinQuest_Spritstest_retry
break

#IF
Equal D1 1
Equal D2 2
checkitem 魔灵牌 1
#ACT
goto @SinQuest_Spritstest
break

#IF
#ACT
goto @SinQuest_Pachun_start_0
break






[@SinQuest_Spritstest]
#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_1

[@SinQuest_Spritstest_0]
#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_2

[@SinQuest_Spritstest_1]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_3

#ACT
FormatStr "FLD_SINUSERNAME='%s'" %USERNAME
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINMAINSTEP=1"
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINSTEP_READY=3"
set [204] 1




[@SinQuest_Spritstest_retry]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_4

[@SinQuest_Spritstest_Check]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_5

[@SinGiSun_Spritstest_Check2]
#IF
checkitem 魔灵牌 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_6

#ACT
FormatStr "FLD_SINUSERNAME='%s'" %USERNAME
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINMAINSTEP=2"
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINSTEP_READY=0"
take 魔灵牌 1
give 航海日志 1


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_7

[@SinGiSun_Spritstest_Check3]
#IF
#ACT
mapmove 5 225 122

[@SinQuest_Spritstest_Check_1]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_8

[@SinQuest_SeeAgain]
#ACT
FormatStr "FLD_SINUSERNAME='%s'" %USERNAME
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINMAINSTEP=2"
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINSTEP_READY=2"
set [204] 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_9

[@SinQuest_SeeAgain_1]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_10

[@SinQuest_End]
#IF
checkitem 遗骸 1
checkjob warrior
#ACT
mov A0 "SinGiSun"
mov D0 2
mov D1 0
mov D2 0
mov D3 0
goto @EveryThingReward
FormatStr "FLD_SINUSERNAME='%s'" %USERNAME
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINMAINSTEP=3,FLD_SINSTEP_READY=0"

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_11

#ELSEACT
break

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_12

[@SinQuest_End_2]
#IF
checkjob wizard
checkitem 遗骸 1
#ACT
mov A0 "SinGiSun"
mov D0 2
mov D1 1
mov D2 0
mov D3 0
goto @EveryThingReward
FormatStr "FLD_SINUSERNAME='%s'" %USERNAME
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINMAINSTEP=3,FLD_SINSTEP_READY=0"

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_13

#ELSEACT
break

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_14

[@SinQuest_End_3]
#ACT
mov A0 "SinGiSun"
mov D0 2
mov D1 2
mov D2 0
mov D3 0
goto @EveryThingReward
FormatStr "FLD_SINUSERNAME='%s'" %USERNAME
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINMAINSTEP=3,FLD_SINSTEP_READY=0"

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_15

#ELSEACT
break

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_16

[@SinQuest_Pachun]
#IF
checkitem 霸王教主雕像 1
checkjob warrior

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_17

#ACT
mov A0 "SinGiSun"
mov D0 4
mov D1 0
mov D2 0
goto @EveryThingReward
set [203] 1
take 霸王教主雕像 1
FormatStr "FLD_SINUSERNAME='%s'" %USERNAME
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINMAINSTEP=4,FLD_SINSTEP_READY=0"
break

#IF
checkitem 霸王教主雕像 1
checkjob taoist

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_18

#ACT
mov A0 "SinGiSun"
mov D0 4
mov D1 1
mov D2 0
goto @EveryThingReward
set [203] 1
take 霸王教主雕像 1
FormatStr "FLD_SINUSERNAME='%s'" %USERNAME
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINMAINSTEP=4,FLD_SINSTEP_READY=0"
break

#IF
checkitem 霸王教主雕像 1
checkjob wizard

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_19

#ACT
mov A0 "SinGiSun"
mov D0 4
mov D1 2
mov D2 0
goto @EveryThingReward
set [203] 1
take 霸王教主雕像 1
FormatStr "FLD_SINUSERNAME='%s'" %USERNAME
UpdateValueSql "TBL_SinGiSunQuest" %A9 "FLD_SINMAINSTEP=4,FLD_SINSTEP_READY=0"
break

#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_20

[@SinQuest_Pachun_start]
#IF
checkitem 连环明珠 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_21

#ELSEACT
goto @SinQuest_Pachun_start_0
break

[@SinQuest_Pachun_start_0]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_22

[@SinQuest_Pachun_start_1]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SinGiSun\SinHwanmaNpc.txt] @Convert_SinHwanmaNpc_23

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