;;不要删掉此行

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

[@Main]
#IF
;IsAdmin
#ACT
GoTo @MainPalace
#ELSESAY
Coming Soon...\\\
<Leave/@exit>

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

[@MainPalace]
#ACT
Loadvalue A1 "QuestDiary\Guild\Palace.txt" [PalaceQuest] %GUILDNAME
Loadvalue A0 "QuestDiary\Guild\Palace.txt" [PalaceQuest] %GUILDNAME

#IF
Equal A1 "Stage4"
#ACT
GoTo @Quest_Stage4
BREAK

#IF
Equal A1 "Stage5"
#ACT
GoTo @Quest_Stage5
BREAK

#ELSEACT
GoTo @MainPalace2

[@MainPalace2]
#ACT
Loadvalue A1 "QuestDiary\Guild\Palace.txt" [Palace] [Room1]
Loadvalue A2 "QuestDiary\Guild\Palace.txt" [Palace] [Room2]
Loadvalue A3 "QuestDiary\Guild\Palace.txt" [Palace] [Room3]
Loadvalue A4 "QuestDiary\Guild\Palace.txt" [Palace] [Room4]
Loadvalue A5 "QuestDiary\Guild\Palace.txt" [Palace] [Room5]
Loadvalue A6 "QuestDiary\Guild\Palace.txt" [Palace] [Room6]
#SAY
Palace Infomation:\\
#IF
Equal A1 "InActive"
#SAY
Palace 1: {FCOLOR/1}<$OUTPUT(A1)>{FCOLOR/12}\
#ELSESAY
Palace 1: {FCOLOR/10}<$OUTPUT(A1)>{FCOLOR/12}\

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

#IF
Equal A2 "InActive"
#SAY
Palace 2: {FCOLOR/1}<$OUTPUT(A2)>{FCOLOR/12}\
#ELSESAY
Palace 2: {FCOLOR/10}<$OUTPUT(A2)>{FCOLOR/12}\

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

#IF
Equal A3 "InActive"
#SAY
Palace 3: {FCOLOR/1}<$OUTPUT(A3)>{FCOLOR/12}\
#ELSESAY
Palace 3: {FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/12}\

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

#IF
Equal A4 "InActive"
#SAY
Palace 4: {FCOLOR/1}<$OUTPUT(A4)>{FCOLOR/12}\
#ELSESAY
Palace 4: {FCOLOR/10}<$OUTPUT(A4)>{FCOLOR/12}\

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

#IF
Equal A5 "InActive"
#SAY
Palace 5: {FCOLOR/1}<$OUTPUT(A5)>{FCOLOR/12}\
#ELSESAY
Palace 5: {FCOLOR/10}<$OUTPUT(A5)>{FCOLOR/12}\

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

#IF
Equal A6 "InActive"
#SAY
Palace 6: {FCOLOR/1}<$OUTPUT(A6)>{FCOLOR/12}\\
#ELSESAY
Palace 6: {FCOLOR/10}<$OUTPUT(A6)>{FCOLOR/12}\\

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

Welcome <$USERNAME>...\\

#IF
Equal A0 "END"
#SAY
<Teleport to my guild's palace/@MainPalaceCheckPalace> {FCOLOR/1}(Costs 5,000 gold){FCOLOR/10}\\
#ELSESAY
{FCOLOR/15}Teleport to my guild's palace{FCOLOR/10}\\

#IF
#SAY
<I want to buy my guild a palace/@BuyGuildPalce> {FCOLOR/1}(Guild Leader Only){FCOLOR/10}\\
<Leave/@Exit>

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

[@MainPalaceCheckPalace]
#ACT
Loadvalue A5 "QuestDiary\Guild\GoldStorage.txt" %GUILDNAME [Gold]

#ACT
mov D2 %A5
mov D3 5000

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

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

[@MainPalaceCheckPalaceNext]
#ACT
Loadvalue A1 "QuestDiary\Guild\Palace.txt" [Palace] [Room1]
Loadvalue A2 "QuestDiary\Guild\Palace.txt" [Palace] [Room2]
Loadvalue A3 "QuestDiary\Guild\Palace.txt" [Palace] [Room3]
Loadvalue A4 "QuestDiary\Guild\Palace.txt" [Palace] [Room4]
Loadvalue A5 "QuestDiary\Guild\Palace.txt" [Palace] [Room5]
Loadvalue A6 "QuestDiary\Guild\Palace.txt" [Palace] [Room6]

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

#IF
Equal A1 %GUILDNAME
#ACT
MapMove Guild1 23 50
BREAK

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

#IF
Equal A2 %GUILDNAME
#ACT
MapMove Guild2 23 50
BREAK

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

#IF
Equal A3 %GUILDNAME
#ACT
MapMove Guild3 23 50
BREAK

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

#IF
Equal A4 %GUILDNAME
#ACT
MapMove Guild4 23 50
BREAK

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

#IF
Equal A5 %GUILDNAME
#ACT
MapMove Guild5 23 50
BREAK

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

#IF
Equal A6 %GUILDNAME
#ACT
MapMove Guild6 23 50
BREAK

#ELSEACT
GoTo @NoGuildPalce

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

[@NoGuildPalce]
#SAY
Your guild does not own a palace...\\\
<Leave/@Exit>

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

[@BuyGuildPalce]
#IF
IsGuildMaster
#ACT
GoTo @BuyGuildPalceCheck
#ELSESAY
Sorry...\
You are not a Guild Leader...\\
<Leave/@Exit>

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

[@BuyGuildPalceCheck]
#IF
Equal A1 %GUILDNAME
#ACT
GoTo @AlreadyOwnPalace
BREAK

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

#IF
Equal A2 %GUILDNAME
#ACT
MapMove Guild2 23 50
GoTo @AlreadyOwnPalace
BREAK

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

#IF
Equal A3 %GUILDNAME
#ACT
GoTo @AlreadyOwnPalace
BREAK

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

#IF
Equal A4 %GUILDNAME
#ACT
GoTo @AlreadyOwnPalace
BREAK

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

#IF
Equal A5 %GUILDNAME
#ACT
GoTo @AlreadyOwnPalace
BREAK

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

#IF
Equal A6 %GUILDNAME
#ACT
GoTo @AlreadyOwnPalace
BREAK

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

#ELSEACT
GoTo @NoGuildPalceBuyNow

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

[@AlreadyOwnPalace]
#SAY
Your guild already owns a palace...\\\
<Leave/@Exit>

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

[@NoGuildPalceBuyNow]
#ACT
Loadvalue A1 "QuestDiary\Guild\Palace.txt" [Palace] [Room1]
Loadvalue A2 "QuestDiary\Guild\Palace.txt" [Palace] [Room2]
Loadvalue A3 "QuestDiary\Guild\Palace.txt" [Palace] [Room3]
Loadvalue A4 "QuestDiary\Guild\Palace.txt" [Palace] [Room4]
Loadvalue A5 "QuestDiary\Guild\Palace.txt" [Palace] [Room5]
Loadvalue A6 "QuestDiary\Guild\Palace.txt" [Palace] [Room6]
#SAY
Please Select what palace you wish to buy:\\

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

#IF
Equal A1 "InActive"
#SAY
Palace 1: {FCOLOR/10}<$OUTPUT(A1)>{FCOLOR/12} <Purchase/@PurchasePalace(Room1)>\
#ELSESAY
Palace 1: {FCOLOR/1}<$OUTPUT(A1)>{FCOLOR/12}\

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

#IF
Equal A2 "InActive"
#SAY
Palace 2: {FCOLOR/10}<$OUTPUT(A2)>{FCOLOR/12} <Purchase/@PurchasePalace(Room2)>\
#ELSESAY
Palace 2: {FCOLOR/1}<$OUTPUT(A2)>{FCOLOR/12}\

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

#IF
Equal A3 "InActive"
#SAY
Palace 3: {FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/12} <Purchase/@PurchasePalace(Room3)>\
#ELSESAY
Palace 3: {FCOLOR/1}<$OUTPUT(A3)>{FCOLOR/12}\

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

#IF
Equal A4 "InActive"
#SAY
Palace 4: {FCOLOR/10}<$OUTPUT(A4)>{FCOLOR/12} <Purchase/@PurchasePalace(Room4)>\
#ELSESAY
Palace 4: {FCOLOR/1}<$OUTPUT(A4)>{FCOLOR/12}\

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

#IF
Equal A5 "InActive"
#SAY
Palace 5: {FCOLOR/10}<$OUTPUT(A5)>{FCOLOR/12} <Purchase/@PurchasePalace(Room5)>\
#ELSESAY
Palace 5: {FCOLOR/1}<$OUTPUT(A5)>{FCOLOR/12}\

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

#IF
Equal A6 "InActive"
#SAY
Palace 6: {FCOLOR/10}<$OUTPUT(A6)>{FCOLOR/12} <Purchase/@PurchasePalace(Room6)>\
#ELSESAY
Palace 6: {FCOLOR/1}<$OUTPUT(A6)>{FCOLOR/12}\

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

[@PurchasePalace()]
#ACT
mov A7 %ARG(1)
#SAY
To buy a palace you will need:\\
{FCOLOR/15}1){FCOLOR/10} 35 Million Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} Palace Key{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} Red Moon Crystal{FCOLOR/12}\\
<My guild and I will work together to get them/@Start_Quest>\
#IF
Equal A0 "END"
#SAY
<My guild is ready to purchase a palace/@PurchasePalaceNow>\
#ELSESAY
{FCOLOR/15}My guild is ready to purchase a palace{FCOLOR/10}\

#IF
#SAY
<Leave/@Exit>

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

[@PurchasePalaceNow]
#IF
CheckGold 35000000
CheckItem PalaceKey 1
CheckItem RedMoonCrystal 1
#ACT
Take Gold 35000000
Take PalaceKey 1
Take RedMoonCrystal 1
GoTo @Palace_WriteGuildName
#ELSESAY
To buy a palace you need:\\
{FCOLOR/15}1){FCOLOR/10} 35 Million Gold {FCOLOR/12}\
{FCOLOR/15}2){FCOLOR/10} Palace Key{FCOLOR/12}\
{FCOLOR/15}3){FCOLOR/10} Red Moon Crystal{FCOLOR/12}\\
<My guild and I will work together to get them/@Start_Quest>\
<Leave/@Exit>

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

[@Palace_WriteGuildName]
#ACT
SaveValue "QuestDiary\Guild\Palace.txt" [Palace] %A7 %GUILDNAME
CLOSE

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

[@Start_Quest]
#ACT
Loadvalue A1 "QuestDiary\Guild\Palace.txt" [PalaceQuest] %GUILDNAME

#IF
Equal A1 ""
#ACT
Give RustedPalaceKey 1
SaveValue "QuestDiary\Guild\Palace.txt" [PalaceQuest] %GUILDNAME Start
SET [050] 1
#SAY
Listen to me now...\\
You must take this key to the black smith\
who has been hiding in a place where\
Fire worships Lightning...Only he will be able\
to break the rust from the key...\\
<Leave/@Exit>

#ELSESAY
Fire worships Lightning...Only he will be able\
to break the rust from the key...\\
<Leave/@Exit>

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

[@Quest_Stage4]
#IF
CheckItem BrokenPalaceKey 1
#ACT
SaveValue "QuestDiary\Guild\Palace.txt" [PalaceQuest] %GUILDNAME Stage5
#SAY
I see the Keeper has lost his touch...\\
Now that it is a {FCOLOR/10}Broken Palace Key{FCOLOR/12}\
Take it to the {FCOLOR/10}Black Smith{FCOLOR/12} You\
can find him in a place with {FCOLOR/10}Blood{FCOLOR/12} and {FCOLOR/10}Evil{FCOLOR/12}..\\
<Leave/@Exit>
#ELSESAY
{FCOLOR/10}I hope you havent lost your key...{FCOLOR/12}

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

[@Quest_Stage5]
#SAY
Now that it is a {FCOLOR/10}Broken Palace Key{FCOLOR/12}\
Take it to the {FCOLOR/10}Black Smith{FCOLOR/12} You\
can find him in a place with {FCOLOR/10}Blood{FCOLOR/12} and {FCOLOR/10}Evil{FCOLOR/12}..\\
<Leave/@Exit>

;;不要删掉此行