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



[@DaebakMainMenu]
{
#IF
checklevel 42
#ACT
goto @DaebakMainMenu_2
break

#IF
checklevel 30
#ACT
goto @DaebakMainMenu_1
break

#ELSEACT
goto @DaebakMainMenu_0
break

[@DaebakMainMenu_0]
#ACT
FormatStr "FLD_Name='%s'" "DAEBAKMON1"
ReadValueSql "TBL_EventSystemTotal" %A9 "FLD_Step" [@Join_BakMon_0]

[@DaebakMainMenu_1]
#IF
#ACT
FormatStr "FLD_Name='%s'" "DAEBAKMON2"
ReadValueSql "TBL_EventSystemTotal" %A9 "FLD_Step" [@Join_BakMon_0]

[@DaebakMainMenu_2]
#IF
#ACT
FormatStr "FLD_Name='%s'" "DAEBAKMON3"
ReadValueSql "TBL_EventSystemTotal" %A9 "FLD_Step" [@Join_BakMon_0]

[@Join_BakMon_0()]
#ACT
mov A1 %ARG(1)

#IF
IsAdmin

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_0

#IF
!Equal A1 "StartGame"

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_1

#IF
Equal A1 "StartClose"

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_2

#IF
Equal A1 "StartGame"

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_3

#IF
Equal A1 "Ready"

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_4

#IF
Equal A1 "Start"

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_5

#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_6

[@JoinDAEBAKGame]
#IF
checklevel 42
#ACT
goto @42LevelDaebak
break

#ELSEACT
goto @No42LevelDaebak
break

[@No42LevelDaebak]
#IF
checklevel 30
#ACT
goto @30LevelDaebak
break

#ELSEACT
goto @ChoboLevelDaebak
break

[@BeginDaeBakGame]
#IF
checklevel 42
#ACT
goto @DAEBAKLevel42
break

#ELSEACT
goto @DAEBAKLevelno42
break

[@DAEBAKLevelno42]
#IF
checklevel 30
#ACT
goto @DAEBAKLevel30
break

#ELSEACT
goto @DAEBAKLevelno
break




[@42LevelDaebak]
#CALL [EventSystem\Daebakmon\DaeBakMonNpc.txt] @Join_Event_BakMon3

[@30LevelDaebak]
#CALL [EventSystem\Daebakmon\DaeBakMonNpc.txt] @Join_Event_BakMon2

[@ChoboLevelDaebak]
#CALL [EventSystem\Daebakmon\DaeBakMonNpc.txt] @Join_Event_BakMon1





[@DAEBAKLevel42]
#CALL [EventSystem\Daebakmon\DaeBakMonNpc.txt] @StartDaebak42

[@DAEBAKLevel30]
#CALL [EventSystem\Daebakmon\DaeBakMonNpc.txt] @StartDaebak30

[@DAEBAKLevelno]
#CALL [EventSystem\Daebakmon\DaeBakMonNpc.txt] @StartDaebakno





[@InitalIsDAEBAKGameEvent]
#CALL [EventSystem\Daebakmon\DaeBakMonNpc.txt] @Reset_Daebak

}



[@StartDaebak42]
{
#ACT
ReadValueSql "TBL_EventSystemTotal" "FLD_NAME='TotalControl'" "FLD_STEP" @PreSettingDaebak

[@PreSettingDaebak()]
#ACT
mov A9 %ARG(1)

#IF
Equal A9 "Ready"
#ACT
ReadValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON3'" "FLD_STEP" @StartDAEBAKGame


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_7

[@StartDAEBAKGame()]
#ACT
mov A9 %ARG(1)

#IF
!Checkitem 通用卷 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_8

#ACT
break

#IF
Equal A9 "Ready"
Checkitem 通用卷 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_9

#ACT

take 通用卷 1
FormatStr "FLD_USER='%s',FLD_STEP='StartClose'" %USERNAME
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON3'" %A9
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='TotalControl'" "FLD_STEP='Act'"
Monclear E006
Mapting E006 5 238 129
UpdateValueSql "TBL_EventSystemTotal" "FLD_Name='DAEBAKMON3'" "FLD_Point1=1"
Mapmove E006 32 24
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg0]
EventMsg Grobal %A7 10371
Delaygoto [Grobal] 180 @Event3_playercall 10100
break

#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_10

#ACT
break


[@Event3_playercall]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg1]
EventMsg Grobal %A7 10371
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON3'" "FLD_STEP='Start'"
DelayGoto [Grobal] 12 @BakMon3_join1_1 10100

SetAreaAttr "E006, 8, 27, 17" "NoLack"
SetAreaAttr "E006, 41, 27, 17" "NoLack"
SetAreaAttr "E006, 8, 27, 17" "NoRevival"
SetAreaAttr "E006, 41, 27, 17" "NoRevival"
Goto @Event3_wait2
break

[@BakMon3_join1_1]
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg2]
EventMsg Grobal %A7 10371
DelayGoto [Grobal] 12 @BakMon3_join1_2 10100

[@BakMon3_join1_2]
#CALL [EventSystem\Daebakmon\DaeBakStart.txt] @DBMmain3

}




[@StartDaebak30]
{
#ACT
ReadValueSql "TBL_EventSystemTotal" "FLD_NAME='TotalControl'" "FLD_STEP" @PreSettingDaebak30

[@PreSettingDaebak30()]
#ACT
mov A9 %ARG(1)

#IF
Equal A9 "Ready"
#ACT
ReadValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON2'" "FLD_STEP" @StartDaeBakGame30


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_11

[@StartDaeBakGame30()]
#ACT
mov A9 %ARG(1)

#IF
!Checkitem 通用卷 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_12

#ACT
break

#IF
Equal A9 "Ready"
Checkitem 通用卷 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_13

#ACT

take 通用卷 1
FormatStr "FLD_USER='%s',FLD_STEP='StartClose'" %USERNAME
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON2'" %A9
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='TotalControl'" "FLD_STEP='Act'"
Monclear E006
Mapting E006 5 238 129
UpdateValueSql "TBL_EventSystemTotal" "FLD_Name='DAEBAKMON2'" "FLD_Point1=1"
Mapmove E006 32 24
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg3]
EventMsg Grobal %A7 10371
Delaygoto [Grobal] 180 @Event2_playercall 10100
break

#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_14

#ACT
break

[@Event2_playercall]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg4]
EventMsg Grobal %A7 10371
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON2'" "FLD_STEP='Start'"
DelayGoto [Grobal] 12 @BakMon2_join1_1 10100

SetAreaAttr "E006, 8, 27, 17" "NoLack"
SetAreaAttr "E006, 41, 27, 17" "NoLack"
SetAreaAttr "E006, 8, 27, 17" "NoRevival"
SetAreaAttr "E006, 41, 27, 17" "NoRevival"
break

[@BakMon2_join1_1]
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg5]
EventMsg Grobal %A7 10371
DelayGoto [Grobal] 12 @BakMon2_join1_2 10100

[@BakMon2_join1_2]
#CALL [EventSystem\Daebakmon\DaeBakStart.txt] @DBMmain2


}





[@StartDaebakno]
{
#ACT
ReadValueSql "TBL_EventSystemTotal" "FLD_NAME='TotalControl'" "FLD_STEP" @PreSettingDaebakno

[@PreSettingDaebakno()]
#ACT
mov A9 %ARG(1)

#IF
Equal A9 "Ready"
#ACT
ReadValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON3'" "FLD_STEP" @StartDaeBakGameno


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_15

[@StartDaeBakGameno()]
#ACT
mov A9 %ARG(1)

#IF
!Checkitem 通用卷 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_16

#ACT
break

#IF
Equal A9 "Ready"
Checkitem 通用卷 1

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_17

#ACT

take 通用卷 1
FormatStr "FLD_USER='%s',FLD_STEP='StartClose'" %USERNAME
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON1'" %A9
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='TotalControl'" "FLD_STEP='Act'"
Monclear E006
Mapting E006 5 238 129
UpdateValueSql "TBL_EventSystemTotal" "FLD_Name='DAEBAKMON1'" "FLD_Point1=1"
Mapmove E006 32 24
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg6]
EventMsg Grobal %A7 10371
Delaygoto [Grobal] 180 @Event1_playercall 10100
break

#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_18

#ACT
break


[@Event1_playercall]
#IF
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg7]
EventMsg Grobal %A7 10371
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON1'" "FLD_STEP='Start'"
DelayGoto [Grobal] 12 @BakMon1_join1_1 10100

SetAreaAttr "E006, 8, 27, 17" "NoLack"
SetAreaAttr "E006, 41, 27, 17" "NoLack"
SetAreaAttr "E006, 8, 27, 17" "NoRevival"
SetAreaAttr "E006, 41, 27, 17" "NoRevival"
break

[@BakMon1_join1_1]
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg8]
EventMsg Grobal %A7 10371
DelayGoto [Grobal] 12 @BakMon1_join1_2 10100

[@BakMon1_join1_2]
#CALL [EventSystem\Daebakmon\DaeBakStart.txt] @DBMmain1

}




[@Join_Event_BakMon3]
{
#IF
checkgold 80000
#ACT
goto @JoinEvent_BakMon3_1
break


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_19

#ELSEACT
break

[@JoinEvent_BakMon3_1]
#IF
checkmonrecall
#ACT
goto @JoinEvent_MonFight


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_20

#ELSEACT
break

[@JoinEvent_MonFight]
#ACT
FormatStr "FLD_Name='%s'" "DAEBAKMON3"
ReadValueSql "TBL_EventSystemTotal" %A9 "FLD_MAXUSER1,FLD_MAXUSER2,FLD_POINT1,FLD_POINT2" [@JoinEvent_BakMon3_2]

[@JoinEvent_BakMon3_2()]
#ACT
mov D1 %ARG(1)
mov D2 %ARG(2)
mov D3 %ARG(3)
mov D4 %ARG(4)

#IF
Equal D3 %D4
#ACT
goto @Event_BakMon3_MirTeamJoin
break

#IF
Small D3 %D4
#ACT
goto @Event_BakMon3_MirTeamJoin
break

#IF
Large D3 %D4
#ACT
goto @Event_BakMon3_LegendTeamJoin
break

#IF
Equal D3 %D1
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_21

#IF
Equal D4 %D2
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_22

[@Event_BakMon3_MirTeamJoin]
#IF
Small D3 %D1
#ACT
take 金币 80000
inc D3 1
FormatStr "FLD_Point1='%S'" %D3
UpdateValueSql "TBL_EventSystemTotal" "FLD_Name='DAEBAKMON3'" %A9
Mapmove E006 32 24
break

[@Event_BakMon3_LegendTeamJoin]
#IF
Small D4 %D2
#ACT

inc D4 1
FormatStr "FLD_Point2='%S'" %D4
UpdateValueSql "TBL_EventSystemTotal" "FLD_Name='DAEBAKMON3'" %A9
Mapmove E006 18 25
break


}




[@Join_Event_BakMon2]
{
#IF
checkgold 40000
#ACT
goto @JoinEvent_BakMon2_1
break


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_23

#ELSEACT
break

[@JoinEvent_BakMon2_1]
#IF
checkmonrecall
#ACT
goto @JoinEvent_MonFight30


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_24

#ELSEACT
break

[@JoinEvent_MonFight30]
#ACT
FormatStr "FLD_Name='%s'" "DAEBAKMON2"
ReadValueSql "TBL_EventSystemTotal" %A9 "FLD_MAXUSER1,FLD_MAXUSER2,FLD_POINT1,FLD_POINT2" [@JoinEvent_BakMon2_2]

[@JoinEvent_BakMon2_2()]
#ACT
mov D1 %ARG(1)
mov D2 %ARG(2)
mov D3 %ARG(3)
mov D4 %ARG(4)

#IF
Equal D3 %D4
#ACT
goto @Event_BakMon2_MirTeamJoin
break

#IF
Small D3 %D4
#ACT
goto @Event_BakMon2_MirTeamJoin
break

#IF
Large D3 %D4
#ACT
goto @Event_BakMon2_LegendTeamJoin
break

#IF
Equal D3 %D1
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_25

#IF
Equal D4 %D2
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_26

[@Event_BakMon2_MirTeamJoin]
#IF
Small D3 %D1
#ACT
take 金币 40000
inc D3 1
FormatStr "FLD_Point1='%S'" %D3
UpdateValueSql "TBL_EventSystemTotal" "FLD_Name='DAEBAKMON2'" %A9
Mapmove E006 32 24
break

[@Event_BakMon2_LegendTeamJoin]
#IF
Small D4 %D2
#ACT
take 金币 40000
inc D4 1
FormatStr "FLD_Point2='%S'" %D4
UpdateValueSql "TBL_EventSystemTotal" "FLD_Name='DAEBAKMON2'" %A9
Mapmove E006 18 25
break

}





[@Join_Event_BakMon1]
{
#IF
checkgold 20000
#ACT
goto @JoinEvent_BakMon1_1
break


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_27

#ELSEACT
break

[@JoinEvent_BakMon1_1]
#IF
checkmonrecall
#ACT
goto @JoinEvent_MonFight29


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_28

#ELSEACT
break

[@JoinEvent_MonFight29]
#ACT
FormatStr "FLD_Name='%s'" "DAEBAKMON1"
ReadValueSql "TBL_EventSystemTotal" %A9 "FLD_MAXUSER1,FLD_MAXUSER2,FLD_POINT1,FLD_POINT2" [@JoinEvent_BakMon1_2]

[@JoinEvent_BakMon1_2()]
#ACT
mov D1 %ARG(1)
mov D2 %ARG(2)
mov D3 %ARG(3)
mov D4 %ARG(4)

#IF
Equal D3 %D4
#ACT
goto @Event_BakMon1_MirTeamJoin
break

#IF
Small D3 %D4
#ACT
goto @Event_BakMon1_MirTeamJoin
break

#IF
Large D3 %D4
#ACT
goto @Event_BakMon1_LegendTeamJoin
break

#IF
Equal D3 %D1
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_29

#IF
Equal D4 %D2
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_30

[@Event_BakMon1_MirTeamJoin]
#IF
Small D3 %D1
#ACT
take 金币 20000
inc D3 1
FormatStr "FLD_Point1='%S'" %D3
UpdateValueSql "TBL_EventSystemTotal" "FLD_Name='DAEBAKMON1'" %A9
Mapmove E006 32 24
break

[@Event_BakMon1_LegendTeamJoin]
#IF
Small D4 %D2
#ACT
take 金币 20000
inc D4 1
FormatStr "FLD_Point2='%S'" %D4
UpdateValueSql "TBL_EventSystemTotal" "FLD_Name='DAEBAKMON1'" %A9
Mapmove E006 18 25
break

}





[@Reset_Daebak]
{

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] @Convert_DaeBakMonNpc_31

[@29Finish_Daebak]
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg9]
LineMsg [Grobal] %A7
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON1'" "FLD_STEP='Ready',FLD_POINT1='0',FLD_POINT2='0'"
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='TotalControl'" "FLD_STEP='Ready'"
MonClear "E006"
MapTing E006 5 240 129
ClearDelaygoto 10100
break

[@30Finish_Daebak]
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg10]
LineMsg [Grobal] %A7
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON2'" "FLD_STEP='Ready',FLD_POINT1='0',FLD_POINT2='0'"
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='TotalControl'" "FLD_STEP='Ready'"
MonClear "E006"
MapTing E006 5 240 129
ClearDelaygoto 10100
break

[@41Finish_Daebak]
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\Daebakmon\DaeBakMonNpc.txt] [Convert] [Msg11]
LineMsg [Grobal] %A7
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='DAEBAKMON3'" "FLD_STEP='Ready',FLD_POINT1=0,FLD_POINT2=0"
UpdateValueSql "TBL_EventSystemTotal" "FLD_NAME='TotalControl'" "FLD_STEP='Ready'"
MonClear "E006"
MapTing E006 5 240 129
ClearDelaygoto 10100
break

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