;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[@GuildWarEventSystem]
{
#IF
ISADMIN

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_0

#IF

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_1

[@GuildEventSystemWinA]
#ACT
Close
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] [Convert] [Msg0]
LineMsg [Grobal] %A7
UpdateValueSql "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GUILDNAME2='',FLD_WINGUILD=''"

[@GuildEventSystemWinB]
#ACT
Close
ReadValueSQL "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GUILDNAME2" @GuildEventSystemWinB_Next

[@GuildEventSystemWinB_Next()]
#ACT
Mov A1 %ARG(1)
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] [Convert] [Msg1]
LineMsg [Grobal] %A7
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] [Convert] [Msg2]
LineMsg [Grobal] %A7
FormatSTR "FLD_GUILDNAME2='',FLD_WINGUILD='%s'" %A1
UpdateValueSql "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" %A9


[@SamakTaosungMake]
#IF
IsCastleGuild SABUK
or IsCastleGuild TAOSUNG
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_2

#IF
IsGuildMaster
#ACT
ReadValueSQL "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_WINGUILD" @SamakTaosungMake_Give

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_3

[@SamakTaosungMake_Give()]
#ACT
Mov A0 %ARG(1)

#IF
Equal A0 %GUILDNAME
#ACT
FormatSTR "FLD_GUILDNAME1='%s'" %GUILDNAME
UpdateValueSQL "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" %A9
LoadValue A7 [Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] [Convert] [Msg3]
LineMsg [Grobal] %A7
CaptureCastleFlag TAOSUNG
Close

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_4

[@ConfirmWarEventSystem]
#ACT
ReadValueSql "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GUILDNAME2" @ConfirmWarEventSystem_Case

[@ConfirmWarEventSystem_Case()]
#ACT
Mov A6 %ARG(1)

#IF
!Equal A6 ""

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_5


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_6

[@StartGuildWarEventSystem]
#ACT
ReadValueSql "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GUILDNAME1,FLD_GUILDNAME2,FLD_GATECONTROL" @StartGuildWarEventSystem_Check

[@StartGuildWarEventSystem_Check()]
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
Mov A2 %ARG(3)

#IF
Equal A2 "OpenGate"
#ELSEACT
break

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_7

#IF
Equal A0 %GUILDNAME
#ACT
TeamMakeTeam 1
Killslave
Map E001
break

#IF
Equal A1 %GUILDNAME
#ACT
TeamMakeTeam 2
Killslave
Map E001
break


[@JoinGuildWarEventSystem]
#IF
!hour 17 19
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_8

#IF
IsGuildMaster
#ACT
ReadValueSql "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" "FLD_GUILDNAME1,FLD_GUILDNAME2" @JoinGuildWarEventSystem_Check

#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_9

[@JoinGuildWarEventSystem_Check()]
#IF
hour 17 19
#ACT
Mov A0 %ARG(1)
Mov A1 %ARG(2)
#ELSEACT
break

#IF
IsCastleGuild Sabuk
or IsCastleGuild Taosung
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_10

#IF
!checkitem ÒÅÖ·µñÏñ 1
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_11

#IF
Equal A1 %GUILDNAME
#ACT
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_12

#IF
Equal A1 ""
#ACT
take ÒÅÖ·µñÏñ 1
FormatStr "FLD_GUILDNAME2='%s'" %GUILDNAME
UpdateValueSql "TBL_GuildWar" "FLD_GUILDWARTITLE='Taosung'" %A9
break

#SAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_13


#ELSESAY
#INCLUDE [..\Convert_Def\QuestDiary\EventSystem\GuildWar\GuildWarNPC.txt] @Convert_GuildWarNPC_14

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