;;-----------vimascript
[@Castle_Manager]
{
#IF
IsCastleGuild [Sabuk]
IsGuildMaster
#SAY
Sabuk Wall Attackers: <$CS_SABUK_ATTACKGUILDS>\
Sabuk Wall Gold: <$CS_SABUK_CASTLEGOLD> Gold\
Sabuk Wall Tax: <$CS_SABUK_TODAYTAX> Gold\
Sabuk Wall Gate Status \
<$@DoorState1>\
<$@DoorState2>\
<$@DoorState3>\\
<Set Online Notice/@setonlinenotice>\\
#IF
!IsOnCastleWar [SaBuk]
IsCastleGuild [Sabuk]
IsGuildMaster
#SAY

<Get Sabuk Tax/@@DrawTax> \\
#IF
!IsOnCastleWar [SaBuk]
IsCastleGuild [Sabuk]
#SAY
<Sabuk Wall Additional Tax/@lingqusx>\\



#IF
#ACT
MOV D0 0
loadvalue D0 "系统设置.INI" 开区后 开启沙巴克攻城时间

#IF
Esmall D0 %CURHOUR
#SAY
<View War Schedule/@view_warschedule>\
<Apply For War/@Propse_CastleWar> \
;;昨日行会贡献者少与5人，不得申请。\\
<Enquire About War/@requestcastlewar> \\
<Close/@exit>\\
#elsesay
Temporarily not open Sabuk Wall War!\
<Close/@exit>

[@@DrawTax]
#IF
!IsOnCastleWar [SaBuk]
#ACT
mov D1 %SABUKGOLD
mov D2 %INPUTNUM
goto @DrawTax
#ELSEACT
break
#ELSESAY
Cant Do During a War!\
<Close/@exit>

[@DrawTax]
#IF
large D2 %D1
or small d2 1
#SAY
Input more than is available. \\
<Close/@exit>
#ELSESAY
Withdrew <$OUTPUT(D2)>  \\
<Close/@exit>

#ELSEACT
mov P9 1
makelog 62 9999 %D2 %NPCNAME
GetBackCastleGold [SABUK] %d2


[@Propse_CastleWar]
#IF
IsOnCastleWar [SaBuk]
#SAY
There is already a war planned, cannot apply. \\
<Return/@main>
#ACT
break

#IF
!IsGuildMaster
#SAY
Only the Guild leader may apply for War.\\
<Return/@main>
#ACT
break

#IF
IsCastleGuild [Sabuk]
#SAY
The Current owners cannot apply for war.\\
<Return/@main>
#ACT
break

#IF
IsCastleGuild [TAOSUNG]
#SAY
The Current owners cannot apply for war.\\
<Return/@main>
#ACT
break

#IF
!checkitem ZumaRelic 1
#SAY
You do not have the ZumaRelic, cannot apply.\\
<Return/@main>
#ACT
break


#IF
CanProposeCastleWar [Sabuk]
#ELSESAY
You already applied for War, cannot apply again\\
<Return/@main>
#ELSEACT
break


#IF
#ACT
ProposeCastleWar [Sabuk]
take ZumaRelic 1
#SAY
War now Applied for.\ \
{FCOLOR/10}3 Days time at 8pm{FCOLOR/12} The war will begin.\ \
<Return/@main>

#ELSESAY
Every Wednesday before they can apply only the siege.\\

<Return/@main>


[@requestcastlewar]

#SAY
Must have the ZumaRelic to apply for war.\
War will start in {FCOLOR/10}3 days time at 8pm{FCOLOR/12}.\ \
<Return/@main>

[@view_warschedule]

#SAY
Sabuk War Date:\
{FCOLOR/10}<$CS_SABUK_WARDATE>{FCOLOR/12} \ \
Mudwall War Date:\
{FCOLOR/10}<$CS_TAOSUNG_WARDATE>{FCOLOR/12} \ \
<Return/@main>



[@lingquyingmeisha]
#IF
IsCastleGuild [Sabuk]
IsGuildMaster
checkgold 30000000
#ACT
take Gold 30000000
give DoomBlade(Sand)
#SAY
恭喜你成为沙城主，这把旷世好刀拥有3大项链的隐藏属性，更可以进行炼制.\\
如果你失去沙城主系统不会收回该武器，但是你也将无法佩戴.\
该武器永远不会掉落，除非你丢弃，不然她终生都是你的.\
是最佳的纪念品.\\
<关闭/@exit>


[@DoorState1]
#IF

#SAY
正面城门

#IF
CheckCastleDoor [SABUK] 1

#SAY
_（正常）

#ELSESAY
_(<没有/@Make_door(1,正面)>)

#ELSEACT
break

#IF
CheckCastleDoorOpen [SABUK] 1

#SAY
_(<敞开/@Close_Door(1,正面)>)

#ELSESAY
_(<关闭/@Open_Door(1,正面)>)

[@DoorState2]
#IF

#SAY
左侧城门

#IF
CheckCastleDoor [SABUK] 3

#SAY
_（正常）

#ELSESAY

_(<没有/@Make_door(3,左侧)>)
#ELSEACT
break

#IF
CheckCastleDoorOpen [SABUK] 3

#SAY
_(<敞开/@Close_Door(3,左侧)>)

#ELSESAY
_(<关闭/@Open_Door(3,左侧)>)

[@DoorState3]
#IF

#SAY
右侧城门

#IF
CheckCastleDoor [SABUK] 4

#SAY
_（正常）

#ELSESAY
_(<没有/@make_door(4,右侧)>)
#ELSEACT
break

#IF
CheckCastleDoorOpen [SABUK] 4

#SAY
_(<敞开/@Close_Door(4,右侧)>)

#ELSESAY
_(<关闭/@Open_Door(4,右侧)>)


[@Make_door()]
#IF
#ACT
Mov D0 %ARG(1)
Mov A0 %ARG(2)

#IF
!IsOnCastleWar Sabuk

#SAY
制作城门的费用是50万金币。 \\
支付50万金币<制作/@Make_door_comfirm><$OUTPUT(A0)>城门。 \


#ELSESAY
攻城战进行时，不能制作城门。 \\
<关 闭/@exit>

[@Make_door_comfirm]
#IF
!checkgold 500000

#SAY
钱不够，不能制作城门。\\
<返 回/@main>
#ACT
break

#IF
!CheckCastleDoor [SABUK] %D0
#ACT
take 金币 500000
MakeCastleDoor [SABUK] %D0

#SAY
城门制作完毕。\\
<返 回/@main>

#ELSESAY
那儿已经有城门了。\\
<返 回/@main>


[@Open_door()]
#IF
#ACT
Mov D0 %ARG(1)
Mov A0 %ARG(2)

#IF
Equal D0 1
#ACT
mov D1 234
mov D2 151

#IF
Equal D0 3
#ACT
mov D1 169
mov D2 151

#IF
Equal D0 4
#ACT
mov D1 233
mov D2 87

#IF
CheckCastleDoor [SABUK] %D0
!CheckCastleDoorOpen [SABUK] %D0
#ACT
Formatstr "沙巴克城门%s" %D0
mov A8 %A9
Formatstr "3,%s,%s,50" %D1 %D2
SENDCMD %A9 %A8 OPEN

#SAY
打开沙巴克城<$OUTPUT(A0)>城门了。\\
<返 回/@main>

#ELSESAY
没有城门或城门敞开着。 \\
<返 回/@main>

[@Close_door()]
#IF
#ACT
Mov D0 %ARG(1)
Mov A0 %ARG(2)

#IF
Equal D0 1
#ACT
mov D1 234
mov D2 151

#IF
Equal D0 3
#ACT
mov D1 169
mov D2 151

#IF
Equal D0 4
#ACT
mov D1 233
mov D2 87

#IF
CheckCastleDoor [SABUK] %D0
CheckCastleDoorOpen [SABUK] %D0
#ACT
Formatstr "沙巴克城门%s" %D0
mov A8 %A9
Formatstr "3,%s,%s,50" %D1 %D2
SENDCMD %A9 %A8 CLOSE

#SAY
关闭了沙巴克城城门。\\
<返 回/@main>

#ELSESAY
没有城门或城门关闭着。\\
<返 回/@main>

[@lingqusx]
#CALL [Vimascript\批量购买.txt] @读税收

[@setonlinenotice]
#IF
#SAY
<设定上线提示开启/@setonlineon>\
<设定上线提示关闭/@setonlineoff>\


[@setonlineon]
#ACT
set [598] 0

[@setonlineoff]
#ACT
set [598] 1

}
;;-----------vimascript