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

[@SabukStoneQuest_start2]
{
#IF
IsCastleGuild Sabuk
IsGuildMaster
#ACT
goto @SabukStoneQuest_Master
break

#IF
IsCastleGuild Sabuk
#ACT
goto @SabukStoneQuest_Guild
break

[@SabukStoneQuest_Master]

#ACT


ReadValueSql "TBL_SabukGuildQuest" "FLD_SabukQuest='SabukQuest'" "FLD_SabukGuildName,FLD_SabukUserName,FLD_SabukCondition" [@SabukStoneQuest_Call_0]

[@SabukStoneQuest_Call_0()]
#ACT
mov A1 %ARG(1)
mov A2 %ARG(2)
mov A3 %ARG(3)

#IF
!Equal A1 %GUILDNAME

#ACT
FormatStr "'%s','%s','%s'," "SabukQuest" %GUILDNAME %USERNAME
mov A8 %A9
FormatStr "'%s',%s,%s" "STOP" 0 0
AddStr A8 %A9

WriteValueSql "TBL_SabukGuildQuest" "FLD_SabukQuest='SabukQuest'" "FLD_SabukQuest,FLD_SabukGuildName,FLD_SabukUserName,FLD_SabukCondition,FLD_SabukStatus,FLD_SabukStatusReady" %A8
goto @SabukGuildQuest_start
break

#IF
Equal A1 %GUILDNAME
Equal A3 "Stop"
#ACT
goto @SabukGuildQuest_start
break

#IF
Equal A1 %GUILDNAME
Equal A3 "Start"
#ACT
goto @SabukGuildQuest_open
break

#IF
Equal A1 %GUILDNAME
Equal A3 "ADVANCE"
#ACT
goto @SabukGuildQuest_close
break

#IF
#ACT
goto @SabukGuildQuest_start
break


[@SabukStoneQuest_Guild]
#ACT


ReadValueSql "TBL_SabukGuildQuest" "FLD_SabukQuest='SabukQuest'" "FLD_SabukGuildName,FLD_SabukUserName,FLD_SabukCondition" [@SabukStonQuest_start2_0]

[@SabukStonQuest_start2_0()]
#ACT
mov A1 %ARG(1)
mov A2 %ARG(2)
mov A3 %ARG(3)

#IF
Equal A1 %GUILDNAME
Equal A3 "Advance"
#ACT
goto @SabukGuildQuest_close
break

#IF
#ACT
goto @SabukGuildQuest_Open
break

[@SabukGuildQuest_start]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SabukCastleQuest\SabukQuestNpc.txt] @Convert_SabukQuestNpc_0

[@SabukGuildQuest_start1]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SabukCastleQuest\SabukQuestNpc.txt] @Convert_SabukQuestNpc_1

[@SabukGuildQuest_start2]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SabukCastleQuest\SabukQuestNpc.txt] @Convert_SabukQuestNpc_2

[@SabukGuildQuest_start3]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SabukCastleQuest\SabukQuestNpc.txt] @Convert_SabukQuestNpc_3

#ACT
mapting D1701 3 228 112
mapting D1702 3 228 112
mapting D1703 3 228 112
mapting D1704 3 228 112
MapMove D1701 25 35
FormatStr "FLD_SabukUserName='%s'" %USERNAME
Mov A8 %A9

UpdateValueSql "TBL_SabukGuildQuest" "FLD_SabukQuest='SabukQuest'" %A8
UpdateValueSql "TBL_SabukGuildQuest" "FLD_SabukQuest='SabukQuest'" "FLD_SabukCondition='Start',FLD_SabukStatus=0,FLD_SabukStatusReady=0"
goto @SabukUserFace
Delaygoto [Grobal] 1800 @SabukGuildQuest_Move
Delaygoto [Grobal] 180 @SabukGuildQuest_Control


[@SabukGuildQuest_Move]
#ACT

UpdateValueSql "TBL_SabukGuildQuest" "FLD_SabukQuest='SabukQuest'" "FLD_SabukCondition='Advance'"

[@SabukGuildQuest_close]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SabukCastleQuest\SabukQuestNpc.txt] @Convert_SabukQuestNpc_4

[@SabukGuildQuest_open]

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SabukCastleQuest\SabukQuestNpc.txt] @Convert_SabukQuestNpc_5

[@SabukGuildQuest_open1]
#ACT
MapMove D1701 25 35


[@SabukUserFace]
#CALL [System\EventUserFace.txt] @jobcheckEvent

[@SabukGuildQuest_Control]
#CALL [SabukCastleQuest\SabukQuestEvent.txt] @SabukQuest_Control
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;