;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@GuildEventSystemTimeControl]
{
#ACT
ClearDelaygoto 1004
TimeCall 21 00 @GuildEventSystemTime

[@GuildEventSystemTime]
#ACT
MapTing E001 5 195 207
ChangeMapAttr "E001" "TEAMFIGHT"
UpdateValueSQL "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GUILD1POINT=1000,FLD_GUILD2POINT=1000,FLD_WINGUILD=''"
ReadValueSQL "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GUILDNAME1,FLD_GUILDNAME2" @GuildEventSystemTime_TeamCheck

[@GuildEventSystemTime_TeamCheck()]
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)

#IF
Equal A1 ""
#ACT
break
#ELSEACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg0]
LineMsg [Grobal] %A7
UpdateValueSql "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GATECONTROL='OpenGate'"
Delaygoto [Grobal] 2400 @GuildEventSystemTime_Startting 1004


[@GuildEventSystemTime_Startting]
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg1]
LineMsg [Grobal] %A7
UpdateValueSql "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GATECONTROL='CloseGate'"
Delaygoto [Grobal] 1200 @GuildEventSystemTime_Actting 1004


[@GuildEventSystemTime_Actting]
#ACT
Mov D3 0
Mov D4 0
Mov P9 0

#IF
CheckTeamCount 1 "E602" 0
#ACT
Mov D3 %P9
goto @GuildEventSystemTime_Actting_1
break
#ELSEACT
goto @GuildEventSystemTime_Actting_1
break


[@GuildEventSystemTime_Actting_1]
#ACT
Mov P9 0

#IF
CheckTeamCount 2 "E602" 0
#ACT
Mov D4 %P9
goto @GuildEventSystemTime_Actting_2
#ELSEACT
goto @GuildEventSystemTime_Actting_2
break

[@GuildEventSystemTime_Actting_2]
#ACT
ReadValueSQL "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GUILDNAME1,FLD_GUILD1POINT,FLD_GUILDNAME2,FLD_GUILD2POINT" @GuildEventSystemTime_Result

[@GuildEventSystemTime_Result()]
#ACT
Mov A0 %ARG(1)
Mov D0 %ARG(2)
Mov A1 %ARG(3)
Mov D1 %ARG(4)


goto @GuildEventSystemTime_Result_1
break

[@GuildEventSystemTime_Result_1]
#IF
!Equal D3 0
#ACT
inc D0 %D3

#IF
!Equal D4 0
#ACT
inc D1 %D4

#IF
Equal D0 %D1
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg2]
LineMsg [Grobal] %A7
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg3]
LineMsg [Grobal] %A7
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg4]
LineMsg [Grobal] %A7
MapTing E001 5 195 207

Delaygoto [Grobal] 300 @GuildEventSystemTime_Clear 1004
break

#IF
Large D0 %D1
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg5]
LineMsg [Grobal] %A7
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg6]
LineMsg [Grobal] %A7
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg7]
LineMsg [Grobal] %A7
UpdateValueSql "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GUILDNAME2='',FLD_WINGUILD=''"
MapTing E001 5 195 207
Delaygoto [Grobal] 30 @GuildEventSystemTime_Clear 1004
break

#IF
Large D1 %D0
#ACT
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg8]
LineMsg [Grobal] %A7
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg9]
LineMsg [Grobal] %A7
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg10]
LineMsg [Grobal] %A7
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarMain.txt] [Convert] [Msg11]
LineMsg [Grobal] %A7
FormatSTR "FLD_GUILDNAME2='',FLD_WINGUILD='%s'" %A1
UpdateValueSql "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" %A9
MapTing E001 5 195 207
Delaygoto [Grobal] 3600 @GuildEventSystemTime_Clear 1004

break

[@GuildEventSystemTime_Clear]
#ACT
UpdateValueSQL "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GUILD1POINT=1000,FLD_GUILD2POINT=1000,FLD_WINGUILD=''"
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;