;;Ҫɾ

[@AdministratorMain]
{
#SAY
Welcome <$USERNAME>,\
How may i help you?\
{FCOLOR/10}
Make: <Guild/@MakeGuild>\
;Ask How To: <Make Guild/@buildguildexp> \ \
Start <Guild War/@guildwar>
;Ask How To: <Start Guild War/@guildwarexp>\ \
Change: <Guild Flag/@UserChangeFlag>\\
;<Guild Gold Storage/@GoldStorage>\
;<Guild Palace/@GuildPalace>\\
<Leave/@Exit>

;-----------------------------------------

[@GuildPalace]
#IF
!IsAdmin
#say
busy

#ELSEACT
Goto @testSR

[@testSR]
#SAY
Special Repair: <Weapon/@SRepair(1)> <$@GetWeaponCost>\\


[@SRepair()]
#ACT
mov P0 %ARG(1)
GetRepairCost %P0
Div %P9 2

#IF
CheckGold %P9
#ACT
RepairItem %P0
Take Gold %P9
Goto @SpecialRepair
#ELSESAY
You do not have enought gold...\\
<Leave/@Exit>


[@GetWeaponCost]
#ACT
;mov P0 1
GetRepairCost 1
#IF
Equal P9 0
#SAY
{FCOLOR/10}Repaired{FCOLOR/12}
#ELSESAY
Cost: {FCOLOR/10}<$OUTPUT(P9)>{FCOLOR/12}

[@testing
#ACT
Loadvalue A1 "QuestDiary\Guild\Palace.txt" [Legends] [Palace]
Loadvalue A2 "QuestDiary\Guild\Palace.txt" [DigitalEmpire] [Palace]
Loadvalue A3 "QuestDiary\Guild\Palace.txt" [New_Dawn] [Palace]
#SAY
What guild are you in?\\

#IF
Equal A1 "Active"
#SAY
<Legends/@GuildPalace(Legends)>\
#ELSESAY
{FCOLOR/1}Legends{FCOLOR/12}\

#IF
Equal A2 "Active"
#SAY
<Digital Empire/@GuildPalace(DigitalEmpire)>\
#ELSESAY
{FCOLOR/1}Digital Empire{FCOLOR/12}\

#IF
Equal A3 "Active"
#SAY
<New Dawn/@GuildPalace(New_Dawn)>\\
<Leave/@Exit>
#ELSESAY
{FCOLOR/1}New Dawn{FCOLOR/12}\\
<I want to purchase a palace/@Buy_Palace>\
<Leave/@Exit>

;-----------------------------------------

[@Buy_Palace]
#IF
IsGuildMaster
#SAY
What guild are you leader of?\\
<Legends/@BuyPalace(Legends)>\
<Digital Empire/@BuyPalace(DigitalEmpire)>\
<New Dawn/@BuyPalace(New_Dawn)>\\
<Leave/@Exit>
#ELSESAY
Only the guild leader can buy a palace...\\
<Leave/@Exit>

;-----------------------------------------

[@GoldStorage]
#IF
!IsAdmin
#SAY
What guild are you in?\\
<Legends/@GuildStorage(Legends)>
#ELSEACT
GoTo @LegendsGuild

;-----------------------------------------

[@GuildStorage()]
#ACT
mov A1 %ARG(1)
#IF
Equal A1 %GUILDNAME
#ACT
GoTo @LegendsGuild
#ELSESAY
You are not in  {FCOLOR/10}<$OUTPUT(A1)>{FCOLOR/12} Guild...\\
<Leave/@Exit>

;-----------------------------------------

[@LegendsGuild]
#IF
IsGuildMaster
#ACT
Loadvalue A2 "QuestDiary\GoldStorage.txt" [Legends] [Gold]
#SAY
{FCOLOR/10}Legends Gold Storage{FCOLOR/12}\
Current Gold: {FCOLOR/10}<$OUTPUT(A2)>{FCOLOR/12}\\
What do you wish to do?\\
<Input Amount Of Gold To Deposit Gold/@@DepositGoldLegends>\
<Input Amount Of Gold To With Draw Gold/@@WithDrawGoldLegends>\
<Leave/@Exit>

#ELSEACT
Loadvalue A2 "QuestDiary\GoldStorage.txt" [Legends] [Gold]
#ELSESAY
{FCOLOR/10}Legends Gold Storage{FCOLOR/12}\
Current Gold: {FCOLOR/10}<$OUTPUT(A2)>{FCOLOR/12}\\
What do you wish to do?\\
<Input Amount Of Gold To Deposit Gold/@@DepositGoldLegends>\\
<Leave/@Exit>

;-----------------------------------------

[@@DepositGoldLegends]
#ACT
mov D2 %A2
mov D3 %INPUTSTR

#IF
CheckGold %D3
#ACT
Take Gold %D3
INC D2 %D3
SaveValue "QuestDiary\GoldStorage.txt" [Legends] [Gold] %D2
#SAY
Done...\\
Legends Guild Gold: {FCOLOR/10}<$OUTPUT(D2)>{FCOLOR/12}\\
<Leave/@Exit>
#ELSESAY
You do not have {FCOLOR/10}<$OUTPUT(D3)>{FCOLOR/12} Gold...\\
<Leave/@Exit>

;-----------------------------------------

[@@WithDrawGoldLegends]
#ACT
mov D2 %A2
mov D3 %INPUTSTR

#IF
Large D3 %D2
#SAY
sorry your guild only has {FCOLOR/10}<$OUTPUT(D2)>{FCOLOR/12} Gold...\\
<Leave/@Exit>

#ELSEACT
Give Gold %D3
Dec D2 %D3
SaveValue "QuestDiary\GoldStorage.txt" [Legends] [Gold] %D2
#ELSESAY
Done...\\
Legends Guild Gold: {FCOLOR/10}<$OUTPUT(D2)>{FCOLOR/12}\\
<Leave/@Exit>

;-------------------------------------------------------------------------------

[@UserChangeFlag]
#IF
IsGuildMaster
#SAY
To change the guild flag you need {FCOLOR/10}100,000{FCOLOR/10} gold coins.\\
<Change Flag/@UserChangeFlag_next>\
<Leave/@Exit>

#ELSESAY
You are not a guild leader...\\
<Leave/@Exit>

;-------------------------------------------------------------------------------

[@UserChangeFlag_next]
#ACT
SendCmd "0,169,199,1" GuildFlag @TestUserFlag

;-------------------------------------------------------------------------------

[@MakeGuild]
#IF
HasGuild
#SAY
Can not make a guild because you are already in one.\\
<Leave/@Exit>
#ACT
break

;-------------------------------------------------------------------------------

#IF
!checkgold 1000000
#SAY
You need {FCOLOR/10}1,000,000{FCOLOR/10}Gold to make a guild...\\
<Leave/@Exit>
#ACT
break

;-------------------------------------------------------------------------------

#IF
checkitem WoomaTaurusHorn 1
checkgold 1000000
#ACT
EnableCmd @@buildguild
break
#SAY
<Create guild now/@@BuildGuild> \ \
<Leave/@Exit>
;-------------------------------------------------------------------------------

#IF
#SAY
You dont have enough gold or you dont have WoomaTaurusHorn. \ \
<Leave/@Exit>

;-------------------------------------------------------------------------------

[@@buildguild]
#IF
checkitem WoomaTaurusHorn 1
checkgold 1000000
#ACT
take Gold 1000000
take WoomaTaurusHorn 1
BuildGuild @MakeGuildOK
#ELSESAY
You do not have a {FCOLOR/10}WoomaTaurusHorn  \ \
<Leave/@Exit>

;-------------------------------------------------------------------------------

[@MakeGuildOK]
#ACT
Mov A1 %INPUTSTR
SysMsg [GROBAL] "Congratulations to <$USERNAME> for making <$OUTPUT(A1)> guild!"
#SAY
{FCOLOR/10}<$USERNAME>{FCOLOR/12} is now leader of "{FCOLOR/10}<$INPUTSTR>{FCOLOR/12}"  Guild. \ \
<Leave/@Exit>

;-------------------------------------------------------------------------------

[@MakeGuildOK~]
#SAY
There is already a guild with this name.\\
<Leave/@Exit>
#ACT
give WoomaTaurusHorn 1
give Gold 1000000

;-------------------------------------------------------------------------------

[@buildguildexp]
#SAY
л\
ʧ԰ŽǣȡôлʸˡȻŽǴңٸ100ҵѣͿԴлˡ\ \
<Leave/@Exit>

;-------------------------------------------------------------------------------

[@guildwar]
#SAY
Guild war costs 30,000 Gold.\ \
<Start Guild War/@comfirmGuildWar> \
<Leave/@Exit>

;-------------------------------------------------------------------------------

[@ComfirmGuildWar]
#IF
checkgold 30000
#ACT
EnableCmd @@guildwar
#SAY
<Input Enemy Guild Name Now/@@guildwar>\
#ELSESAY
You do not have 30,000 Gold.\ \
<Leave/@Exit>

;-------------------------------------------------------------------------------

[@@GuildWar]
#IF
checkgold 30000
#ACT
Mov A1 %INPUTSTR
#ELSEACT
break
#ELSESAY
You do not have 30,000 Gold.\ \
<Leave/@Exit>

;-------------------------------------------------------------------------------

#IF
Equal A1 %GUILDNAME
#ACT
break
#SAY
You can not start a guild with your own guild.\ \
<Leave/@Exit>
#ELSEACT
take Gold 30000
GuildWar @GuildMakeWarOK

;-------------------------------------------------------------------------------

[@GuildMakeWarOK]
#SAY
<$GUILD> has declared war to the enemy guild: <$INPUTSTR>.\ \
<Leave/@Exit>

;-------------------------------------------------------------------------------

[@GuildMakeWarOK~]

#SAY
There was an error with the guild name.\\
<Leave/@Exit>
#ACT
give Gold 30000

;-------------------------------------------------------------------------------

[@guildwarexp]
#SAY
<лս/@guildwar2>ָǺϷеս\
Ŀǰڵл֮ͻ಻ϣֻ</@warrule>£űкϷս\
</@propose>1Σά1Сʱս״̬սΪ3ҡ\ \
< /@exit>

;-------------------------------------------------------------------------------

[@guildwar2]
#SAY
лսͬһлԱֱɫжлԱֱɫսʱ촰лʾս״̬ϢɱжлĳԱҲ\ \
<ǰһ/@guildwarexp>

;-------------------------------------------------------------------------------

[@warrule]
#SAY
лսڳ˳ĵڲڲԶеĵطС\ \
<ǰһ/@guildwarexp>

;-------------------------------------------------------------------------------

[@propose]
#SAY
ֻлʸлս\ \
<ǰһ/@guildwarexp>

}
;;Ҫɾ