f;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;









[@SAMAK_NPC1_0]
{
#IF
IsCastleGuild TAOSUNG
#ACT
goto @SAMAK_NPC1_1
break


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_0

#ELSEACT
break

[@SAMAK_NPC1_1]
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@SAMAK_NPC1_Read]

[@SAMAK_NPC1_Read()]
#IF
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)
Mov D0 %ARG(4)
Mov D1 %ARG(5)

#IF
IsOnCastleWar TAOSUNG

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_1

#IF
Equal A0 ""
Equal A1 ""
Equal A2 ""
Equal D0 0
Equal D1 0
IsGuildMaster
#ACT
goto @SAMAK_NPC1_1_1
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Complete"
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_2

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 1
Equal D1 3
#ACT
goto @SAMAK_NPC1_2
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 1
Equal D1 1
#ACT
goto @SAMAK_NPC1_1_1
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 1
Equal D1 2
#ACT
goto @SAMAK_NPC1_1_Retry
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 2
Equal D1 1
#ACT
goto @SAMAK_NPC1_3
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 2
Equal D1 2
#ACT
goto @SAMAK_NPC1_3Re
break

#IF
Equal A2 "Ready"
Equal D0 2
Equal D1 6
#ACT
goto @SAMAK_NPC1_4
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 2
Equal D1 8
#ACT
goto @SAMAK_NPC1_4Re
break

#IF
Equal A2 "Ready"
Equal D0 2
Equal D1 10
#ACT
goto @SAMAK_NPC1_5
break

#IF
Equal A2 "Ready"
Equal D0 3
Equal D1 1
#ACT
goto @SAMAK_NPC1_5_MoveRootin
break

#IF
Equal A2 "Ready"
Equal D0 3
Equal D1 2
#ACT
goto @SAMAK_NPC1_5_Playing
break

#IF
Equal A2 "Ready"
Equal D0 3
Equal D1 3
#ACT
goto @SAMAK_NPC1_5_Playing
break

#IF
Equal A2 "Ready"
Equal D0 3
Equal D1 4
#ACT
goto @SAMAK_NPC1_5_Complete
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D0 3
Equal D1 11
#ACT
goto @SAMAK_NPC1_6
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D0 4
Equal D1 13
#ACT
goto @SAMAK_NPC1_7
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D0 2
Equal D1 7
#ACT
goto @SAMAK_NPC1_QuestRetry
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D0 2
Equal D1 9
#ACT
goto @SAMAK_NPC1_QuestRetry
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D0 3
Equal D1 0
#ACT
goto @SAMAK_NPC1_QuestRetry
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D0 3
Equal D1 12
#ACT
goto @SAMAK_NPC1_QuestRetry
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D0 4
Equal D1 0
#ACT
goto @SAMAK_NPC1_QuestRetry
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D0 3
Equal D1 0
#ACT
goto @SAMAK_NPC1_QuestRetry
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D0 5
Equal D1 1
#ACT
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D0 5
Equal D1 2
#ACT
goto @Samak_NPC1_QuestRetryHelp
break

#ELSEACT
break

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_3

[@SAMAK_NPC1_1_1]
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
Mov A8 %A9
FormatStr "'%s','%s','%s'" %GUILDNAME %USERNAME "Ready"
Mov A7 %A9
FormatStr ",'%s','%s'" 1 1
AddStr A7 %A9
WriteValueSQL "TBL_SAMAKCASTLEQUEST" %A8 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" %A7

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_4

[@SAMAK_NPC1_1_2]
#IF
#ACT
MonClear DQ1901_001
Map DQ1901_001
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUSRDY=2"
Delaygoto [Local] 3 @SAMAK_NPC1_1_EventMSG

[@SAMAK_NPC1_1_EventMSG]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg0]
EventMSG [DQ1901_001] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_1_EventMSG_1

[@SAMAK_NPC1_1_EventMSG_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg1]
EventMSG [DQ1901_001] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_1_EventMSG_2

[@SAMAK_NPC1_1_EventMSG_2]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg2]
EventMSG [DQ1901_001] %A7
MongenP "DQ1901_001,30,30,30" 石像狮子 10
Delaygoto [Grobal] 600 @SAMAK_NPC1_1_TimeOut

[@SAMAK_NPC1_1_TimeOut]
#IF
CheckPos DQ1901_001 30 30 30
#ACT
Map 5
#ELSEACT
break

[@SAMAK_NPC1_1_Retry]
#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_5

[@SAMAK_NPC1_2]
#IF
checkitemw 头子证件 1
#ACT
goto @SAMAK_NPC1_2_EventMSG
break


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_6

[@SAMAK_NPC1_2_EventMSG]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg3]
EventMSG [D1901] %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_2_EventMSG_1_1
break

[@SAMAK_NPC1_2_EventMSG_1_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg4]
EventMSG [D1901] %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_2_EventMSG_1

[@SAMAK_NPC1_2_EventMSG_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg5]
EventMSG [D1901] %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_2_1

[@SAMAK_NPC1_2_1]
#IF
checkitemw 头子证件 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_7


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_8

[@SAMAK_NPC1_2_QuestStart]
#IF
#ACT
Delaygoto [Grobal] 1800 @Samak_NPC1_2_QuestTimeOut
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='2',FLD_SAMAKSTATUSRDY='1'"


#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_9

[@Samak_NPC1_2_QuestTimeOut]
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@Samak_NPC1_2_QuestTimeOut_Read]

[@Samak_NPC1_2_QuestTimeOut_Read()]
#IF
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)
Mov D1 %ARG(4)
Mov D2 %ARG(5)

#IF
Equal D1 2
Equal D2 1
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='1',FLD_SAMAKSTATUSRDY='3'"
#ELSEACT
break

[@SAMAK_NPC1_3]
#IF
checkitemw 头子证件 1
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg6]
EventMSG [D1901] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_3_EventMSG


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_10

[@SAMAK_NPC1_3_EventMSG]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg7]
EventMSG [D1901] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_3_EventMSG_1

[@SAMAK_NPC1_3_EventMSG_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg8]
EventMSG [D1901] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_3_EventMSG_2

[@SAMAK_NPC1_3_EventMSG_2]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg9]
EventMSG [D1901] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_3_EventMSG_3

[@SAMAK_NPC1_3_EventMSG_3]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg10]
EventMSG [D1901] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_3_EventMSG_4

[@SAMAK_NPC1_3_EventMSG_4]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg11]
EventMSG [D1901] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_3_EventMSG_5

[@SAMAK_NPC1_3_EventMSG_5]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg12]
EventMSG [D1901] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_3_EventMSG_6

[@SAMAK_NPC1_3_EventMSG_6]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg13]
EventMSG [D1901] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_3_EventMSG_7

[@SAMAK_NPC1_3_EventMSG_7]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg14]
EventMSG [D1901] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_3_EventMSG_8

[@SAMAK_NPC1_3_EventMSG_8]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg15]
EventMSG [D1901] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_3_EventMSG_9

[@SAMAK_NPC1_3_EventMSG_9]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg16]
EventMSG [D1901] %A7
Delaygoto [Local] 7 @SAMAK_NPC1_3_EventMSG_10

[@SAMAK_NPC1_3_EventMSG_10]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg17]
EventMSG [D1901] %A7
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='2',FLD_SAMAKSTATUSRDY='2'"
MonClear D1901 春
MonClear D1901 夏
MonClear D1901 秋
MonClear D1901 冬
MongenP "D1901,150,150,150" 沙漠风魔 1 "Noitem,诞生珠子"
ApplyMonEX "D1901,150,150,150" 沙漠风魔 [RunAway] 春
MongenP "D1901,150,150,150" 沙漠风魔 1 "Noitem,老化珠子"
ApplyMonEX "D1901,150,150,150" 沙漠风魔 [RunAway] 夏
MongenP "D1901,150,150,150" 红衣法师 1 "Noitem,疾病珠子"
ApplyMonEX "D1901,150,150,150" 红衣法师 [RunAway] 秋
MongenP "D1901,150,150,150" 红衣法师 1 "Noitem,死亡珠子"
ApplyMonEX "D1901,150,150,150" 红衣法师 [RunAway] 冬
Delaygoto [Grobal] 3600 @Samak_NPC1_3_TimeOut
Delaygoto [Grobal] 7 @Samak_NPC1_3_MonCheck

[@Samak_NPC1_3_MonCheck]
#IF
!CheckMonMap D1901 1 春
#ACT
MongenP "D1901,150,150,150" 沙漠风魔 1 "Noitem,诞生珠子"
ApplyMonEX "D1901,150,150,150" 沙漠风魔 [RunAway] 春
Delaygoto [Grobal] 7 @Samak_NPC1_3_MonCheck
break

#IF
!CheckMonMap D1901 1 夏
#ACT
MongenP "D1901,150,150,150" 沙漠风魔 1 "Noitem,老化珠子"
ApplyMonEX "D1901,150,150,150" 沙漠风魔 [RunAway] 夏
Delaygoto [Grobal] 7 @Samak_NPC1_3_MonCheck
break

#IF
!CheckMonMap D1901 1 秋
#ACT
MongenP "D1901,150,150,150" 红衣法师 1 "Noitem,疾病珠子"
ApplyMonEX "D1901,150,150,150" 红衣法师 [RunAway] 秋
Delaygoto [Grobal] 7 @Samak_NPC1_3_MonCheck
break

#IF
!CheckMonMap D1901 1 冬
#ACT
MongenP "D1901,150,150,150" 红衣法师 1 "Noitem,死亡珠子"
ApplyMonEX "D1901,150,150,150" 红衣法师 [RunAway] 冬
Delaygoto [Grobal] 7 @Samak_NPC1_3_MonCheck
break

#ELSEACT
break

[@SAMAK_NPC1_3Re]
#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_11

[@Samak_NPC1_3_TimeOut]
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@Samak_NPC1_3_TimeOut_Read]

[@Samak_NPC1_3_TimeOut_Read()]
#IF
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)
Mov D1 %ARG(4)
Mov D2 %ARG(5)

#IF
Equal D1 2
Small D2 6
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='2',FLD_SAMAKSTATUSRDY='7'"
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg18]
EventMSG [D1901] %A7
#ELSEACT
break

[@SAMAK_NPC1_4]
#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
checkitemw 头子证件 1
#ACT
goto @Samak_NPC1_4_GuildMaster
break


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_12

[@Samak_NPC1_4_GuildMaster]
#IF
checkitem 诞生珠子 1
checkitem 老化珠子 1
checkitem 疾病珠子 1
checkitem 死亡珠子 1
#ACT
take 诞生珠子 1
take 老化珠子 1
take 疾病珠子 1
take 死亡珠子 1
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='2',FLD_SAMAKSTATUSRDY='8'"
Delaygoto [Local] 7 @Samak_NPC1_4_EventMSG

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_13


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_14

[@Samak_NPC1_4_EventMSG]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg19]
EventMSG [D1901] %A7
Delaygoto [Grobal] 7 @Samak_NPC1_4_EventMSG_1

[@Samak_NPC1_4_EventMSG_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg20]
EventMSG [D1901] %A7
Delaygoto [Grobal] 7 @Samak_NPC1_4_EventMSG_2

[@Samak_NPC1_4_EventMSG_2]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg21]
EventMSG [D1901] %A7
Delaygoto [Grobal] 7 @Samak_NPC1_4_EventMSG_3

[@Samak_NPC1_4_EventMSG_3]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg22]
EventMSG [D1901] %A7
Delaygoto [Grobal] 7 @Samak_NPC1_4_EventMSG_4

[@Samak_NPC1_4_EventMSG_4]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg23]
EventMSG [D1901] %A7
Delaygoto [Grobal] 7 @Samak_NPC1_4_EventMSG_5

[@Samak_NPC1_4_EventMSG_5]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg24]
EventMSG [D1901] %A7
Delaygoto [Grobal] 7200 @Samak_NPC1_4_TimeOut
goto @Samak_NPC1_4_MapSpell
break

[@Samak_NPC1_4_MapSpell]
#IF
#ACT
Mapspell [Light] "D1901,275,120,290,140, +d80, +t5, +r10, +h
Mapspell [Light] "D1901,10,10,290,290, +d80, +t5, +r100, +h
Delaygoto [Grobal] 30 @Samak_NPC1_4_MapSpell

[@SAMAK_NPC1_4Re]
#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_15

[@Samak_NPC1_4_TimeOut]
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@Samak_NPC1_4_TimeOut_Read]

[@Samak_NPC1_4_TimeOut_Read()]
#IF
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)
Mov D1 %ARG(4)
Mov D2 %ARG(5)

#IF
Equal D1 2
Small D2 8
#ACT
MapTing D1901 5 252 103
MapTing D1902 5 252 103
MapTing D1903 5 252 103
MapTing DQ1901_001 5 252 103
MapTing DQ1901_002 5 252 103
MapTing DQ1902_001 5 252 103
MapTing DQ1902_002 5 252 103
MapTing DQ1902_003 5 252 103
MapTing DQ1902_004 5 252 103
MapTing DQ1902_005 5 252 103
MapTing DQ1903_001 5 252 103
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='2',FLD_SAMAKSTATUSRDY='9'"
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg25]
EventMSG "D1901,DQ1901_001" %A7

[@SAMAK_NPC1_5]
#IF
IsCastleGuild TAOSUNG
!IsGuildMaster

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_16

#ACT
break

#IF
IsCastleGuild TAOSUNG
IsGuildMaster
!checkitem 森罗片 1
checkitemw 头子证件 1
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_17

#IF
IsCastleGuild TAOSUNG
IsGuildMaster
checkitem 森罗片 1
!checkitemw 头子证件 1
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_18

#IF
IsCastleGuild TAOSUNG
IsGuildMaster
checkitem 森罗片 1
checkitemw 头子证件 1
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg26]
EventMSG [D1901] %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_5_EventMSG
MonClear DQ1902_003
MonClear DQ1902_004
MonClear DQ1902_005

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_19

#ELSEACT
break

[@SAMAK_NPC1_5_EventMSG]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg27]
EventMSG "D1901,D1902,D1903" %A7
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='3',FLD_SAMAKSTATUSRDY='1'"
MapMove DQ1902_003 27 51
Mapting DQ1901_002 DQ1902_003 27 51
Delaygoto [Grobal] 7 @SAMAK_NPC1_5_EventMSG_1_1
Delaygoto [Grobal] 100 @Samak_NPC1_5_Mongen

[@SAMAK_NPC1_5_EventMSG_1_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg28]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_5_EventMSG_1

[@SAMAK_NPC1_5_EventMSG_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg29]
EventMSG "DQ1902_003,DQ1902_004,DQ1902_005" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_5_EventMSG_2

[@SAMAK_NPC1_5_EventMSG_2]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg30]
EventMSG "DQ1902_003,DQ1902_004,DQ1902_005" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_5_EventMSG_3

[@SAMAK_NPC1_5_EventMSG_3]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg31]
EventMSG "DQ1902_003,DQ1902_004,DQ1902_005" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_5_EventMSG_4

[@SAMAK_NPC1_5_EventMSG_4]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg32]
EventMSG "DQ1902_003,DQ1902_004,DQ1902_005" %A7
Delaygoto [Grobal] 7200 @Samak_NPC1_5_TimeOut

[@Samak_NPC1_5_TimeOut]
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@Samak_NPC1_5_TimeOut_Read]

[@Samak_NPC1_5_TimeOut_Read()]
#IF
#ACT
Mov D1 %ARG(1)
Mov D2 %ARG(2)

#IF
Equal D1 3
Equal D2 4
#ACT
break

#ELSEACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg33]
EventMSG "D1901,D1902,D1903,DQ1902_003,DQ1902_004,DQ1902_005" %A7
MapTing D1901 5 252 103
MapTing D1902 5 252 103
MapTing DQ1902_003 5 252 103
MapTing DQ1902_004 5 252 103
MapTing DQ1902_005 5 252 103
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='3',FLD_SAMAKSTATUSRDY='0'"

[@Samak_NPC1_5_Mongen]
#IF
#ACT
Delaygoto [Grobal] 120 @Samak_NPC1_5_Mongen

#IF
!CheckMonMap DQ1902_003 50
#ACT
MongenP "DQ1902_003,40,40,40" 潘夜战士 10
MongenP "DQ1902_003,40,40,40" 潘夜火魔 10
MongenP "DQ1902_003,40,40,40" 潘夜冰魔 10
MongenP "DQ1902_003,40,40,40" 潘夜云魔 10
MongenP "DQ1902_003,40,40,40" 潘夜风魔 10
MongenP "DQ1902_003,40,40,40" 潘夜左护卫 10
MongenP "DQ1902_003,40,40,40" 潘夜右护卫 10

#IF
!CheckMonMap DQ1902_004 50
#ACT
MongenP "DQ1902_004,40,40,40" 潘夜战士 10
MongenP "DQ1902_004,40,40,40" 潘夜火魔 10
MongenP "DQ1902_004,40,40,40" 潘夜冰魔 10
MongenP "DQ1902_004,40,40,40" 潘夜云魔 10
MongenP "DQ1902_004,40,40,40" 潘夜风魔 10
MongenP "DQ1902_004,40,40,40" 潘夜左护卫 10
MongenP "DQ1902_004,40,40,40" 潘夜右护卫 10

#IF
!CheckMonMap DQ1902_005 50
#ACT
MongenP "DQ1902_005,40,40,40" 潘夜战士 10
MongenP "DQ1902_005,40,40,40" 潘夜火魔 10
MongenP "DQ1902_005,40,40,40" 潘夜冰魔 10
MongenP "DQ1902_005,40,40,40" 潘夜云魔 10
MongenP "DQ1902_005,40,40,40" 潘夜风魔 10
MongenP "DQ1902_005,40,40,40" 潘夜左护卫 10
MongenP "DQ1902_005,40,40,40" 潘夜右护卫 10

[@SAMAK_NPC1_5_MoveRootin]
#IF
#ACT
Movr D0 2

#IF
Equal D0 0
#ACT
Mapmove DQ1902_003 27 51
break

#IF
Equal D0 1
#ACT
Mapmove DQ1902_004 27 51
break

#IF
Equal D0 2
#ACT
Mapmove DQ1902_005 27 51
break

#ELSEACT
Mapmove DQ1902_005 27 51
break

[@SAMAK_NPC1_5_Playing]
#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_20

[@SAMAK_NPC1_5_Complete]
#IF
IsCastleGuild TAOSUNG
!IsGuildMaster

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_21

#ACT
break

#IF
IsCastleGuild TAOSUNG
IsGuildMaster
#ACT
goto @Samak_NPC1_5_MasterCheck
break

[@Samak_NPC1_5_MasterCheck]
#IF
Checkitem 简易钥匙 3
!checkitemw 头子证件 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_22

#ACT
break

#IF
Checkitem 简易钥匙 3
checkitemw 头子证件 1
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg34]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @Samak_NPC1_5_NextMission

[@Samak_NPC1_5_NextMission]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg35]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @Samak_NPC1_5_NextMission_1

[@Samak_NPC1_5_NextMission_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg36]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @Samak_NPC1_5_NextMission_2

[@Samak_NPC1_5_NextMission_2]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg37]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @Samak_NPC1_5_NextMission_3

[@Samak_NPC1_5_NextMission_3]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg38]
EventMSG "D1901,D1902,D1903" %A7
take 简易钥匙 3
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='3',FLD_SAMAKSTATUSRDY='5'"
break

[@SAMAK_NPC1_6]
#IF
IsGuildMaster
#ACT
goto @Samak_NPC1_6_Check
break


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_23

[@Samak_NPC1_6_Check]
#IF
!checkitemw 头子证件 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_24

#IF
checkitem 森罗片 2
checkitemw 头子证件 1
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg39]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 10 @Samak_NPC1_6_EventMSG

#IF
!checkitem 森罗片 2
checkitemw 头子证件 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_25

[@Samak_NPC1_6_EventMSG]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg40]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @Samak_NPC1_6_EventMSG_1

[@Samak_NPC1_6_EventMSG_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg41]
EventMSG "D1901,D1902,D1903" %A7
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='4',FLD_SAMAKSTATUSRDY='1'"

[@SAMAK_NPC1_7]
#IF
IsGuildMaster
Checkitemw 头子证件 1
checkitem 森罗片 3
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg42]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @Samak_NPC1_7_1
break

#IF
IsGuildMaster
Checkitemw 头子证件 1
!checkitem 森罗片 3

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_26

#ACT
break

#IF
IsGuildMaster
!Checkitemw 头子证件 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_27

#ACT
break

#IF
!IsGuildMaster

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_28

#ACT
break

[@Samak_NPC1_7_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg43]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @Samak_NPC1_7_2

[@Samak_NPC1_7_2]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg44]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @Samak_NPC1_7_3

[@Samak_NPC1_7_3]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg45]
EventMSG "D1901,D1902,D1903" %A7
take 森罗片 3
give 森罗石 1
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='4',FLD_SAMAKSTATUSRDY='14'"

[@SAMAK_NPC1_QuestRetry]
#IF
!IsGuildMaster

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_29

#ACT
break

#IF
IsGuildMaster
!checkitemw 头子证件 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_30

#ACT
break

#IF
IsGuildMaster
checkitemw 头子证件 1
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg46]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_QuestRetry_1
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='5',FLD_SAMAKSTATUSRDY='1'"

[@SAMAK_NPC1_QuestRetry_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg47]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [grobal] 7 @SAMAK_NPC1_QuestRetry_2

[@SAMAK_NPC1_QuestRetry_2]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg48]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [grobal] 7 @SAMAK_NPC1_QuestRetry_3

[@SAMAK_NPC1_QuestRetry_3]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg49]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [grobal] 7 @SAMAK_NPC1_QuestRetry_4

[@SAMAK_NPC1_QuestRetry_4]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg50]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_QuestRetry_5

[@SAMAK_NPC1_QuestRetry_5]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg51]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_QuestRetry_6

[@SAMAK_NPC1_QuestRetry_6]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg52]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_QuestRetry_7

[@SAMAK_NPC1_QuestRetry_7]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg53]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_QuestRetry_8

[@SAMAK_NPC1_QuestRetry_8]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg54]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_QuestRetry_9

[@SAMAK_NPC1_QuestRetry_9]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg55]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_QuestRetry_10

[@SAMAK_NPC1_QuestRetry_10]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg56]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_QuestRetry_11

[@SAMAK_NPC1_QuestRetry_11]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg57]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_QuestRetry_12

[@SAMAK_NPC1_QuestRetry_12]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg58]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_QuestRetry_13

[@SAMAK_NPC1_QuestRetry_13]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg59]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @SAMAK_NPC1_QuestRetry_14

[@SAMAK_NPC1_QuestRetry_14]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg60]
EventMSG "D1901,D1902,D1903" %A7
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='5',FLD_SAMAKSTATUSRDY='2'"

[@Samak_NPC1_QuestRetryHelp]
#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_31

}

[@SAMAK_NPC2_0]
{
#IF
IsCastleGuild TAOSUNG
IsGuildMaster
#ACT
goto @Samak_NPC2_1
break

#ELSEACT
break

[@SAMAK_NPC2_1]
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@SAMAK_NPC2_Read]

[@SAMAK_NPC2_Read()]
#IF
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)
Mov D1 %ARG(4)
Mov D2 %ARG(5)

#IF
Equal A2 "Ready"
Equal D0 3
Equal D1 1
#ACT
goto @SAMAK_NPC2_1_MoveRootin
break

#IF
Equal A2 "Ready"
Equal D0 3
Equal D1 4
#ACT
goto @SAMAK_NPC2_1_Complete
break

#ELSEACT
break


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_32

[@SAMAK_NPC2_1_MoveRootin]
#IF
#ACT
Movr D0 2

#IF
Equal D0 0
#ACT
Mapmove DQ1902_003 27 51
break

#IF
Equal D0 1
#ACT
Mapmove DQ1902_004 27 51
break

#IF
Equal D0 2
#ACT
Mapmove DQ1902_005 27 51
break

#ELSEACT
Mapmove DQ1902_005 27 51
break

[@SAMAK_NPC2_1_Complete]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg61]
EventMSG "D1901,D1902,D1903,DQ1902_003,DQ1902_004,DQ1902_005" %A7
break

}

[@Samak_NPC3_0]
{
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@SAMAK_NPC3_Read]

[@SAMAK_NPC3_Read()]
#IF
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)
Mov D1 %ARG(4)
Mov D2 %ARG(5)

#IF
Equal A0 %GUILDNAME
!Equal A1 %USERNAME
Equal A2 "Ready"

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_33

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 5
#ACT
goto @Samak_NPC3_1
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 6
#ACT
goto @Samak_NPC3_1
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 7
#ACT
goto @Samak_NPC3_1
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 8
#ACT
goto @Samak_NPC3_2
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 9
#ACT
goto @Samak_NPC3_3
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 12
#ACT
goto @Samak_NPC3_2
break

[@Samak_NPC3_1]
#IF
Equal D2 7
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg62]
EventMSG "D1901,D1902,D1903" %A7
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='4',FLD_SAMAKSTATUSRDY='8'"
break

#IF
!IsGuildMaster
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg63]
EventMSG "D1901,D1902,D1903" %A7
Inc D2 1
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
Mov A8 %A9
FormatStr "FLD_SAMAKSTATUSRDY='%s'" %D2
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A8 %A9

#ELSEACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg64]
EventMSG "D1901,D1902,D1903" %A7
Inc D2 1
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
Mov A8 %A9
FormatStr "FLD_SAMAKSTATUSRDY='%s'" %D2
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A8 %A9

[@Samak_NPC3_2]
#IF
IsGuildMaster
checkitemw 头子证件 1
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg65]
EventMSG "D1901,D1902,D1903,DQ1903_002" %A7
Delaygoto [Grobal] 7 @Samak_NPC3_Num1_EventMSG

#ELSEACT
break

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_34

[@Samak_NPC3_Num1_EventMSG]
#IF
#ACT
MonClear DQ1903_002
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg66]
EventMSG "D1901,D1902,D1903,DQ1903_002" %A7
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='4',FLD_SAMAKSTATUSRDY='9'"

[@Samak_NPC3_3]
#IF
!CheckHum DQ1903_002 1
#ACT
MonClear DQ1903_002

#IF
IsGuildMaster
#ACT
Mapting D1901 DQ1903_002 40 40
Mapting D1902 DQ1903_002 40 40
Mapting D1903 DQ1903_002 40 40
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg67]
EventMSG "PRIVATE" %A7
Mov D0 0
Mov D1 0
Mov D2 0
Mov D3 0
Mov D4 0
Delaygoto [Grobal] 7 @Samak_NPC3_3_Helper

[@Samak_NPC3_3_Helper]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg68]
EventMSG "PRIVATE" %A7
Delaygoto [Grobal] 7 @Samak_NPC3_3_Helper_1

[@Samak_NPC3_3_Helper_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg69]
EventMSG "PRIVATE" %A7
Delaygoto [Grobal] 7 @Samak_NPC3_3_PuzzleSet
break

#ELSEACT
break

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_35

[@Samak_NPC3_3_PuzzleSet]







#IF
#ACT
Movr D0 10

#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_36

#IF
Equal D1 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_37

#IF
Equal D0 0

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_38

#IF
Equal D0 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_39

#IF
Equal D0 2

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_40

#IF
Equal D0 3

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_41

#IF
Equal D0 4

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_42

#IF
Equal D0 5

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_43

#IF
Equal D0 6

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_44

#IF
Equal D0 7

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_45

#IF
Equal D0 8

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_46

#IF
Equal D0 9

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_47

[@Samak_NPC3_PuzzleN()]






#IF
#ACT
Mov D4 %ARG(1)

#IF
Equal D1 0
#ACT
Mov D1 1
Mov D2 %D4
goto @Samak_NPC3_3_PuzzleSet
break

#IF
Equal D1 1
#ACT
Mov D1 2
Mov D3 %D4
goto @Samak_NPC3_3_PuzzleResult
break

[@Samak_NPC3_3_PuzzleResult]
#IF
Equal D2 1
Equal D3 10
#ACT
MonClear DQ1903_002
Delaygoto [Grobal] 3 @Samak_NPC3_3_PuzzleResult_1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_48

#ELSEACT
Mul D2 D3
MongenP "DQ1903_002,40,40,30" 地牢女神1 %P9
Delaygoto [Grobal] 3 @Samak_NPC3_3_PuzzleFail

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_49

[@Samak_NPC3_3_PuzzleFail]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg70]
EventMSG "D1901,D1902,D1903,DQ1903_002" %A7

[@Samak_NPC3_3_PuzzleResult_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg71]
EventMSG "D1901,D1902,D1903,DQ1903_002" %A7
Delaygoto [Grobal] 3 @Samak_NPC3_3_PuzzleResult_2

[@Samak_NPC3_3_PuzzleResult_2]
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg72]
EventMSG "D1901,D1902,D1903,DQ1903_002" %A7
Mapting DQ1903_002 5 253 102
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='4',FLD_SAMAKSTATUSRDY='10'"
break

}

[@Samak_NPC4_0]
{
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@SAMAK_NPC4_Read]

[@SAMAK_NPC4_Read()]
#IF
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)
Mov D1 %ARG(4)
Mov D2 %ARG(5)

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 5
#ACT
goto @Samak_NPC4_1
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 6
#ACT
goto @Samak_NPC4_1
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 7
#ACT
goto @Samak_NPC4_1
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 8
#ACT
goto @Samak_NPC4_Miss
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 9
#ACT
goto @Samak_NPC4_Miss
break

#IF
Equal A0 %GUILDNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 10
#ACT
goto @Samak_NPC4_2
break

[@Samak_NPC4_2]
#IF
!IsGuildMaster
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg73]
EventMSG "D1901,D1902,D1903" %A7
Delaygoto [Grobal] 7 @Samak_NPC4_2_1
break

#ELSEACT
MonClear DQ1903_003
Mapting D1901 DQ1903_003 40 40
Mapting D1902 DQ1903_003 40 40
Mapting D1903 DQ1903_003 40 40
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg74]
EventMSG "D1901,D1902,D1903,DQ1903_003" %A7
Delaygoto [Grobal] 7 @Samak_NPC4_EventMSG

[@Samak_NPC4_2_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg75]
EventMSG "D1901,D1902,D1903,DQ1903_003" %A7

[@Samak_NPC4_EventMSG]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg76]
EventMSG "D1901,D1902,D1903,DQ1903_003" %A7
Delaygoto [Grobal] 7 @Samak_NPC4_EventMSG_1

[@Samak_NPC4_EventMSG_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg77]
EventMSG "D1901,D1902,D1903,DQ1903_003" %A7
Delaygoto [Grobal] 7 @Samak_NPC4_EventMSG_2

[@Samak_NPC4_EventMSG_2]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg78]
EventMSG "D1901,D1902,D1903,DQ1903_003" %A7
Delaygoto [Grobal] 100 @Samak_NPC4_Mongen
goto @Samak_NPC4_MapSpell

[@Samak_NPC4_Mongen]
#IF
CheckHum DQ1903_003 1
!CheckMonMap DQ1903_003 2 震天首将
#ACT
MongenP "DQ1903_003,40,40,30" 震天首将 5 "Noitem"

#IF
#ACT
MongenP "DQ1903_003,40,40,30" 地牢女神1 10 "Noitem"
MongenP "DQ1903_003,40,40,30" 地牢女神2 10 "Noitem"
MongenP "DQ1903_003,40,40,30" 石像狮子 10 "Noitem"
MongenP "DQ1903_003,40,40,30" 火焰狮子 10 "Noitem"

Delaygoto [Grobal] 480 @Samak_NPC4_Mongen

#ELSEACT
Delaygoto [Grobal] 480 @Samak_NPC4_Mongen

[@Samak_NPC4_MapSpell]
#IF
CheckHum DQ1903_003 1
#ACT
MapSpell [FireWall] "DQ1903_003,5,5,80,80, +d80, +t30, +r20, +h
Delaygoto [Grobal] 50 @Samak_NPC4_MapSpell

[@Samak_NPC4_Miss]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg79]
EventMSG "D1901,D1902,D1903" %A7
break

[@Samak_NPC4_1]
#IF
Equal D2 7
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg80]
EventMSG "D1901,D1902,D1903" %A7
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='4',FLD_SAMAKSTATUSRDY='8'"
break

#IF
!IsGuildMaster
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg81]
EventMSG "D1901,D1902,D1903" %A7
Inc D2 1
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
Mov A8 %A9
FormatStr "FLD_SAMAKSTATUSRDY='%s'" %D2
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A8 %A9
#ELSEACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg82]
EventMSG "D1901,D1902,D1903" %A7
Inc D2 1
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
Mov A8 %A9
FormatStr "FLD_SAMAKSTATUSRDY='%s'" %D2
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A8 %A9

}

[@Samak_NPC5_0]
{
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@SAMAK_NPC5_Read]

[@SAMAK_NPC5_Read()]
#IF
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)
Mov D1 %ARG(4)
Mov D2 %ARG(5)

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 5
#ACT
goto @Samak_NPC5_1
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 6
#ACT
goto @Samak_NPC5_1
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 7
#ACT
goto @Samak_NPC5_1
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 8
#ACT
goto @Samak_NPC5_Miss
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 9
#ACT
goto @Samak_NPC5_Miss
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 10
#ACT
goto @Samak_NPC5_Miss
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 12
#ACT
goto @Samak_NPC5_Miss
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D1 4
Equal D2 11
#ACT
goto @Samak_NPC5_2
break

[@Samak_NPC5_Miss]
#IF
IsGuildMaster
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg83]
EventMSG "D1901,D1902,D1903" %A7
break

#ELSEACT
break

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_50

[@Samak_NPC5_1]
#IF
Equal D2 7
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg84]
EventMSG "D1901,D1902,D1903" %A7
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='4',FLD_SAMAKSTATUSRDY='8'"
break

#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg85]
EventMSG "D1901,D1902,D1903" %A7
Inc D2 1
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
Mov A8 %A9
FormatStr "FLD_SAMAKSTATUSRDY='%s'" %D2
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A8 %A9
#ELSEACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg86]
EventMSG "D1901,D1902,D1903" %A7
Inc D2 1
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
Mov A8 %A9
FormatStr "FLD_SAMAKSTATUSRDY='%s'" %D2
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A8 %A9

[@Samak_NPC5_2]
#IF
!checkitemw 头子证件 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_51

#IF
checkitemw 头子证件 1
#ACT
MonClear DQ1903_003
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg87]
EventMSG "D1901,D1902,D1903,DQ1903_003" %A7
Mapting D1901 DQ1903_003 40 40
Mapting D1902 DQ1903_003 40 40
Mapting D1903 DQ1903_003 40 40
Delaygoto [Grobal] 10 @Samak_NPC5_EventMSG

[@Samak_NPC5_EventMSG]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg88]
EventMSG "D1901,D1902,D1903,DQ1903_003" %A7
Delaygoto [Grobal] 10 @Samak_NPC5_EventMSG_1

[@Samak_NPC5_EventMSG_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg89]
EventMSG "D1901,D1902,D1903,DQ1903_003" %A7
Delaygoto [Grobal] 100 @Samak_NPC5_Mongen

[@Samak_NPC5_Mongen]
#IF
!CheckMonMap DQ1903_003 1 震天魔神
#ACT
MongenP "DQ1903_003,40,40,30" 震天魔神 1 "Noitem,森罗片"

#IF
!CheckMonMap DQ1903_003 20
#ACT
MongenP "DQ1903_003,40,40,30" 震天首将 5 "Noitem"
MongenP "DQ1903_003,40,40,30" 武力神将2 10 "Noitem"
MongenP "DQ1903_003,40,40,30" 地牢女神1 10 "Noitem"
MongenP "DQ1903_003,40,40,30" 地牢女神2 10 "Noitem"
MongenP "DQ1903_003,40,40,30" 石像狮子 10 "Noitem"
MongenP "DQ1903_003,40,40,30" 火焰狮子 10 "Noitem"
Delaygoto [Grobal] 480 @Samak_NPC5_Mongen

#ELSEACT
Delaygoto [Grobal] 480 @Samak_NPC5_Mongen

}

[@Samak_Pagoda_UserDie]
{


#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg90]
EventMSG [Private] %A7
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='4',FLD_SAMAKSTATUSRDY='12'"
}

[@Samak_NPC6_0]
{
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@SAMAK_NPC6_Read]

[@SAMAK_NPC6_Read()]
#IF
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)
Mov D0 %ARG(4)
Mov D1 %ARG(5)

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 5
Equal D1 3
#ACT
goto @Samak_NPC6_1
break

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 5
Equal D1 4
#ACT
goto @Samak_NPC6_2
break

#IF
Equal A0 %GUILDNAME
!Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 5
Equal D1 3
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_52

[@Samak_NPC6_1]
#IF
checkitemw 头子证件 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_53

#ELSEACT
break

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_54

[@Samak_NPC6_Puzzle]
#IF
#ACT
Movr D1 2
Movr D2 2
Movr D3 2
Movr D4 2
Movr D5 2
Movr D6 2
Movr D7 2
Movr D8 2
Movr D9 2
goto @Samak_NPC6_Puzzle_Set

[@Samak_NPC6_Puzzle_Set]
#IF
Equal D1 0
#ACT
Mov A1 ≯
#ELSEACT
Mov A1 ≤

#IF
Equal D2 0
#ACT
Mov A2 ≯
#ELSEACT
Mov A2 ≤

#IF
Equal D3 0
#ACT
Mov A3 ≯
#ELSEACT
Mov A3 ≤

#IF
Equal D4 0
#ACT
Mov A4 ≯
#ELSEACT
Mov A4 ≤

#IF
Equal D5 0
#ACT
Mov A5 ≯
#ELSEACT
Mov A5 ≤

#IF
Equal D6 0
#ACT
Mov A6 ≯
#ELSEACT
Mov A6 ≤

#IF
Equal D7 0
#ACT
Mov A7 ≯
#ELSEACT
Mov A7 ≤

#IF
Equal D8 0
#ACT
Mov A8 ≯
#ELSEACT
Mov A8 ≤

#IF
Equal D9 0
#ACT
Mov A9 ≯
#ELSEACT
Mov A9 ≤

#IF
#ACT
goto @Samak_NPC6_Puzzle_Check

[@Samak_NPC6_Puzzle_Check]
#IF
Equal D1 0
Equal D2 0
Equal D3 0
Equal D4 0
Equal D5 0
Equal D6 0
Equal D7 0
Equal D8 0
Equal D9 0
#ACT
goto @Samak_NPC6_Puzzle_Finish
break

#IF
Equal D1 1
Equal D2 1
Equal D3 1
Equal D4 1
Equal D5 1
Equal D6 1
Equal D7 1
Equal D8 1
Equal D9 1
#ACT
goto @Samak_NPC6_Puzzle_Finish
break

#ELSEACT
goto @Samak_NPC6_puzzle_Penal
goto @Samak_NPC6_Puzzle_Display

[@Samak_NPC6_puzzle_Penal]
#IF
#ACT
MongenP "DQ1902_006,40,40,30" 盔甲蚂蚁 20
MongenP "DQ1902_006,40,40,30" 爆毒蚂蚁 10

goto @Samak_NPC6_2_MapSpell

[@Samak_NPC6_Puzzle_Display]
#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_55

[@Samak_NPC6_Puzzle_N()]
#IF
#ACT
Mov D0 %ARG(1)

#IF
Equal D0 1
#ACT
goto @Samak_NPC6_Puzzle_N1Set
break

#IF
Equal D0 2
#ACT
goto @Samak_NPC6_Puzzle_N2Set
break

#IF
Equal D0 3
#ACT
goto @Samak_NPC6_Puzzle_N3Set
break

#IF
Equal D0 4
#ACT
goto @Samak_NPC6_Puzzle_N4Set
break

#IF
Equal D0 5
#ACT
goto @Samak_NPC6_Puzzle_N5Set
break

#IF
Equal D0 6
#ACT
goto @Samak_NPC6_Puzzle_N6Set
break

#IF
Equal D0 7
#ACT
goto @Samak_NPC6_Puzzle_N7Set
break

#IF
Equal D0 8
#ACT
goto @Samak_NPC6_Puzzle_N8Set
break

#IF
Equal D0 9
#ACT
goto @Samak_NPC6_Puzzle_N9Set
break

[@Samak_NPC6_Puzzle_N1Set]
#IF
Equal D1 0
#ACT
Mov D1 1
#ELSEACT
Mov D1 0

#IF
Equal D2 0
#ACT
Mov D2 1
#ELSEACT
Mov D2 0

#IF
Equal D4 0
#ACT
Mov D4 1
#ELSEACT
Mov D4 0

#IF
Equal D5 0
#ACT
Mov D5 1
#ELSEACT
Mov D5 0

#IF
#ACT
goto @Samak_NPC6_Puzzle_Set

[@Samak_NPC6_Puzzle_N2Set]
#IF
Equal D1 0
#ACT
Mov D1 1
#ELSEACT
Mov D1 0

#IF
Equal D2 0
#ACT
Mov D2 1
#ELSEACT
Mov D2 0

#IF
Equal D3 0
#ACT
Mov D3 1
#ELSEACT
Mov D3 0

#IF
Equal D4 0
#ACT
Mov D4 1
#ELSEACT
Mov D4 0

#IF
Equal D5 0
#ACT
Mov D5 1
#ELSEACT
Mov D5 0

#IF
Equal D6 0
#ACT
Mov D6 1
#ELSEACT
Mov D6 0

#IF
#ACT
goto @Samak_NPC6_Puzzle_Set

[@Samak_NPC6_Puzzle_N3Set]
#IF
Equal D2 0
#ACT
Mov D2 1
#ELSEACT
Mov D2 0

#IF
Equal D3 0
#ACT
Mov D3 1
#ELSEACT
Mov D3 0

#IF
Equal D5 0
#ACT
Mov D5 1
#ELSEACT
Mov D5 0

#IF
Equal D6 0
#ACT
Mov D6 1
#ELSEACT
Mov D6 0

#IF
#ACT
goto @Samak_NPC6_Puzzle_Set

[@Samak_NPC6_Puzzle_N4Set]
#IF
Equal D1 0
#ACT
Mov D1 1
#ELSEACT
Mov D1 0

#IF
Equal D2 0
#ACT
Mov D2 1
#ELSEACT
Mov D2 0

#IF
Equal D4 0
#ACT
Mov D4 1
#ELSEACT
Mov D4 0

#IF
Equal D5 0
#ACT
Mov D5 1
#ELSEACT
Mov D5 0

#IF
Equal D7 0
#ACT
Mov D7 1
#ELSEACT
Mov D7 0

#IF
Equal D8 0
#ACT
Mov D8 1
#ELSEACT
Mov D8 0

#IF
#ACT
goto @Samak_NPC6_Puzzle_Set

[@Samak_NPC6_Puzzle_N5Set]
#IF
Equal D1 0
#ACT
Mov D1 1
#ELSEACT
Mov D1 0

#IF
Equal D2 0
#ACT
Mov D2 1
#ELSEACT
Mov D2 0

#IF
Equal D3 0
#ACT
Mov D3 1
#ELSEACT
Mov D3 0

#IF
Equal D4 0
#ACT
Mov D4 1
#ELSEACT
Mov D4 0

#IF
Equal D5 0
#ACT
Mov D5 1
#ELSEACT
Mov D5 0

#IF
Equal D6 0
#ACT
Mov D6 1
#ELSEACT
Mov D6 0

#IF
Equal D7 0
#ACT
Mov D7 1
#ELSEACT
Mov D7 0

#IF
Equal D8 0
#ACT
Mov D8 1
#ELSEACT
Mov D8 0

#IF
Equal D9 0
#ACT
Mov D9 1
#ELSEACT
Mov D9 0

#IF
#ACT
goto @Samak_NPC6_Puzzle_Set

[@Samak_NPC6_Puzzle_N6Set]
#IF
Equal D2 0
#ACT
Mov D2 1
#ELSEACT
Mov D2 0

#IF
Equal D3 0
#ACT
Mov D3 1
#ELSEACT
Mov D3 0

#IF
Equal D5 0
#ACT
Mov D5 1
#ELSEACT
Mov D5 0

#IF
Equal D6 0
#ACT
Mov D6 1
#ELSEACT
Mov D6 0

#IF
Equal D8 0
#ACT
Mov D8 1
#ELSEACT
Mov D8 0

#IF
Equal D9 0
#ACT
Mov D9 1
#ELSEACT
Mov D9 0

#IF
#ACT
goto @Samak_NPC6_Puzzle_Set

[@Samak_NPC6_Puzzle_N7Set]
#IF
Equal D4 0
#ACT
Mov D4 1
#ELSEACT
Mov D4 0

#IF
Equal D5 0
#ACT
Mov D5 1
#ELSEACT
Mov D5 0

#IF
Equal D7 0
#ACT
Mov D7 1
#ELSEACT
Mov D7 0

#IF
Equal D8 0
#ACT
Mov D8 1
#ELSEACT
Mov D8 0

#IF
#ACT
goto @Samak_NPC6_Puzzle_Set

[@Samak_NPC6_Puzzle_N8Set]
#IF
Equal D4 0
#ACT
Mov D4 1
#ELSEACT
Mov D4 0

#IF
Equal D5 0
#ACT
Mov D5 1
#ELSEACT
Mov D5 0

#IF
Equal D6 0
#ACT
Mov D6 1
#ELSEACT
Mov D6 0

#IF
Equal D7 0
#ACT
Mov D7 1
#ELSEACT
Mov D7 0

#IF
Equal D8 0
#ACT
Mov D8 1
#ELSEACT
Mov D8 0

#IF
Equal D9 0
#ACT
Mov D9 1
#ELSEACT
Mov D9 0

#IF
#ACT
goto @Samak_NPC6_Puzzle_Set

[@Samak_NPC6_Puzzle_N9Set]
#IF
Equal D6 0
#ACT
Mov D6 1
#ELSEACT
Mov D6 0

#IF
Equal D5 0
#ACT
Mov D5 1
#ELSEACT
Mov D5 0

#IF
Equal D8 0
#ACT
Mov D8 1
#ELSEACT
Mov D8 0

#IF
Equal D9 0
#ACT
Mov D9 1
#ELSEACT
Mov D9 0

#IF
#ACT
goto @Samak_NPC6_Puzzle_Set

[@Samak_NPC6_Puzzle_Finish]
#IF
#ACT
MonClear DQ1902_006
MonClear DQ1902_002
MonClear DQ1902_007
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='5',FLD_SAMAKSTATUSRDY='4'"
Delaygoto [Grobal] 10 @Samak_NPC6_2

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_56

[@Samak_NPC6_2]
#IF
#ACT
Mapting DQ1902_006 DQ1902_007 40 40
Delaygoto [Grobal] 100 @Samak_NPC6_2_Mongen

[@Samak_NPC6_2_MapSpell]
#IF
CheckHum DQ1902_006 1
#ACT
MapSpell [IceWall] "DQ1902_006,5,5,80,80, +d120, +t8, +r30, +h
Delaygoto [Grobal] 10 @Samak_NPC6_2_MapSpell
#ELSEACT
Delaygoto [Grobal] 10 @Samak_NPC6_2_MapSpell

[@Samak_NPC6_2_Mongen]
#IF
CheckHum DQ1902_007 1
!CheckMonMap DQ1902_007 20 盔甲蚂蚁
#ACT
MongenP "DQ1902_007,40,40,30" 盔甲蚂蚁 40
MongenP "DQ1902_007,40,40,30" 爆毒蚂蚁 40
MongenP "DQ1902_007,40,40,30" 蚂蚁道士 40
MonPWR "DQ1902_007" "盔甲蚂蚁,蚂蚁道士,爆毒蚂蚁" [HP] 800
MonPWR "DQ1902_007" "盔甲蚂蚁,蚂蚁道士,爆毒蚂蚁" [DC] 60
MonPWR "DQ1902_007" "盔甲蚂蚁,蚂蚁道士,爆毒蚂蚁" [MC] 60
MonPWR "DQ1902_007" "盔甲蚂蚁,蚂蚁道士,爆毒蚂蚁" [AC] 40
MonPWR "DQ1902_007" "盔甲蚂蚁,蚂蚁道士,爆毒蚂蚁" [MAC] 45
Delaygoto [Grobal] 600 @Samak_NPC6_2_Mongen
#ELSEACT
Delaygoto [Grobal] 600 @Samak_NPC6_2_Mongen
}

[@Samak_NPC7_0]
{
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@SAMAK_NPC7_Read]

[@SAMAK_NPC7_Read()]
#IF
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)
Mov D0 %ARG(4)
Mov D1 %ARG(5)

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 5
Equal D1 5
#ACT
goto @Samak_NPC7_1
break

#IF
Equal A0 %GUILDNAME
!Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 5
Equal D1 5
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_57

#ELSEACT
break

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_58

[@Samak_NPC7_1]
#IF
Checkitemw 头子证件 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_59

#ELSEACT
break

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_60

[@Samak_NPC7_1_1]
#IF
#ACT
Mov D0 0
Mov D1 0
Mov D2 0
Mov D3 0
Mov D4 0
Mov D5 0
Mov D6 0
Mov D7 0
Mov D8 0
Mov D9 0

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_61

[@Samak_NPC7_Puzzle]










#IF
#ACT
Movr D0 10
Movr D1 10
Movr D2 10
Inc D0 1
Inc D1 1
Inc D2 1
Inc D4 1
goto @Samak_NPC7_Puzzle_Display

[@Samak_NPC7_Puzzle_Display]
#IF
Equal D4 4
#ACT
goto @Samak_NPC7_Puzzle_Result
break


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_62

[@Samak_NPC7_Puzzle_N()]
#IF
#ACT
Mov D9 %ARG(1)

#IF
Equal D4 1
#ACT
Inc D4 1
Mov D5 %D9
goto @Samak_NPC7_Puzzle_Display
break

#IF
Equal D4 2
#ACT
Inc D4 1
Mov D6 %D9
goto @Samak_NPC7_Puzzle_Display
break

#IF
Equal D4 3
#ACT
Inc D4 1
Mov D7 %D9
goto @Samak_NPC7_Puzzle_Display
break

[@Samak_NPC7_Puzzle_Result]
#IF
Equal D0 %D5
Equal D1 %D6
Equal D2 %D7
#ACT
goto @Samak_NPC7_Puzzle_Finish
break


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_63

#ELSEACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg91]
EventMSG "D1901,D1902,D1903,DQ1902_007" %A7
Delaygoto [Grobal] 10 @Samak_NPC7_Puzzle_Mapting

[@Samak_NPC7_Puzzle_Mapting]
#IF
#ACT
Mapting DQ1902 5 252 103

[@Samak_NPC7_Puzzle_Finish]
#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_64

#ACT
Delaygoto [Grobal] 7 @Samak_NPC7_Puzzle_Finish_1
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
UpdateValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKSTATUS='0',FLD_SAMAKSTATUSRDY='0'"

[@Samak_NPC7_Puzzle_Finish_1]
#IF
#ACT
Mapting DQ1902_007 5 252 103

}

[@Samak_NPC8_0]
{
#IF
#ACT
FormatStr "FLD_SAMAKGUILD='%s'" %GUILDNAME
ReadValueSQL "TBL_SAMAKCASTLEQUEST" %A9 "FLD_SAMAKGUILD,FLD_SAMAKGUILDMASTER,FLD_SAMAKCONDITION,FLD_SAMAKSTATUS,FLD_SAMAKSTATUSRDY" [@SAMAK_NPC8_Read]

[@SAMAK_NPC8_Read()]
#IF
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)
Mov D0 %ARG(4)
Mov D1 %ARG(5)

#IF
Equal A0 %GUILDNAME
Equal A1 %USERNAME
Equal A2 "Ready"
Equal D0 4
Equal D1 15
#ACT
goto @Samak_NPC8_1
break

#IF
!IsGuildMaster

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_65

#ACT
break

[@Samak_NPC8_1]
#IF
checkitemw 头子证件 1
!CheckMonMap DQ1903_001 1 霸王守卫
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg92]
EventMSG "D1901,D1902,D1903,DQ1903_001" %A7
Delaygoto [Grobal] 7 @Samak_NPC8_EventMSG

#ELSEACT
break


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] @Convert_SamakCastleQuest_66

[@Samak_NPC8_EventMSG]
#If
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg93]
EventMSG "D1901,D1902,D1903,DQ1903_001" %A7
Delaygoto [Grobal] 7 @Samak_NPC8_EventMSG_1

[@Samak_NPC8_EventMSG_1]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg94]
EventMSG "D1901,D1902,D1903,DQ1903_001" %A7
MongenP "DQ1903_001,40,30,1" 霸王守卫 1 "Noitem,大魔神血杯"
MonPWR "DQ1903_001" "霸王守卫" [HP] 20000
Delaygoto [Grobal] 7 @Samak_NPC8_EventMSG_2

[@Samak_NPC8_EventMSG_2]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg95]
EventMSG "D1901,D1902,D1903,DQ1903_001" %A7
Delaygoto [Grobal] 7 @Samak_NPC8_EventMSG_3

[@Samak_NPC8_EventMSG_3]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\SamakCastleQuest\SamakCastleQuest.txt] [Convert] [Msg96]
EventMSG "D1901,D1902,D1903,DQ1903_001" %A7
goto @Samak_NPC8_Mongen

[@Samak_NPC8_Mongen]
#IF
Equal A2 "Conplete"
#ACT
break

#IF
Checkhum DQ1903_001 1
!CheckMonMap DQ1903_001 30
#ACT
MongenP "DQ1903_001,40,30,15" 神舰守卫 20 "noitem"
MongenP "DQ1903_001,40,30,25" 犬猴魔 10 "noitem"
MongenP "DQ1903_001,40,30,25" 触角神魔 10 "noitem"
MongenP "DQ1903_001,40,30,25" 海神将领 10 "noitem"
Delaygoto [Grobal] 480 @Samak_NPC8_Mongen

#ELSEACT
Monclear DQ1903_001
Delaygoto [Grobal] 480 @Samak_NPC8_Mongen
break

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