(@@Withdrawal)
;Sabuk Admin NPC
[@MAIN]
#IF
ISCASTLEGUILD
#SAY
I am the Administrator of Sabukwall who serves under <$LORD>.\
Any income or maintenance of SabukWall goes through me.\
How may I be of assistance for you today?\ 
<Castle Status/@SabukWallStatus>\
<Case Maintenance/@SabukWallManage>\ \
<Leave/@Exit>\
#ELSESAY
What are you doing in here... get out now!\ \
<Leave/@Exit>\

[@SabukWallStatus]
#IF
#SAY
The income from sales today is {<$TODAYINCOME> Gold=FCO=251}.\
The current Balance of SabukWall is {<$CASTLEGOLD> Gold=FCO=251}.\
Archers current stance is {<$GUARDRULE>=FCO=253}.\
The castle door is {<$CASTLEDOORSTATE>=FCO=253}.\ 
<Back/@Main>   <Leave/@Exit>\

[@SabukWallManage]
#IF
ISCASTLEMASTER
#SAY
<&{Withdraw Castle Funds=FCO=251}/@@withdrawal>\
<&{Deposit Castle Funds=FCO=251}/@@receipts>\
<&{Manage Archers=FCO=251}/@ganarch>\
<&{Manage Gate and Walls=FCO=251}/@repa>\ \
<&{Back=FCO=251}/@Main>\
#ELSESAY
Only <$LORD> is allowed to perform maintenance on SabukWall.\
<Back/@main>   <Leave/@Exit>\

[@ganarch]
#if
CHECKCASTLESTATE ARCHER 0
#act
MOV S4 "{Archer Hired(Palace)=FCO=250}"
#elseact
MOV S4 "<Hire Archer(Palace)/@hirearchernow1>"
#if
CHECKCASTLESTATE ARCHER 1
#act
MOV S5 "{Archer Hired(Palace)=FCO=250}"
#elseact
MOV S5 "<Hire Archer(Palace)/@hirearchernow2>"
#if
CHECKCASTLESTATE ARCHER 2
#act
MOV S6 "{Archer Hired(Palace)=FCO=250}"
#elseact
MOV S6 "<Hire Archer(Palace)/@hirearchernow3>"
#if
CHECKCASTLESTATE ARCHER 3
#act
MOV S7 "{Archer Hired(Palace)=FCO=250}"
#elseact
MOV S7 "<Hire Archer(Palace)/@hirearchernow4>"
#if
CHECKCASTLESTATE ARCHER 4
#act
MOV S8 "{Archer Hired(LeftWall)=FCO=250}"
#elseact
MOV S8 "<Hire Archer(LeftWall)/@hirearchernow5>"
#if
CHECKCASTLESTATE ARCHER 5
#act
MOV S9 "{Archer Hired(LeftWall)=FCO=250}"
#elseact
MOV S9 "<Hire Archer(LeftWall)/@hirearchernow6>"
#if
CHECKCASTLESTATE ARCHER 6
#act
MOV S10 "{Archer Hired(LeftWall)=FCO=250}"
#elseact
MOV S10 "<Hire Archer(LeftWall)/@hirearchernow7>"
#if
CHECKCASTLESTATE ARCHER 7
#act
MOV S11 "{Archer Hired(RightWall)=FCO=250}"
#elseact
MOV S11 "<Hire Archer(RightWall)/@hirearchernow8>"
#if
CHECKCASTLESTATE ARCHER 8
#act
MOV S12 "{Archer Hired(RightWall)=FCO=250}"
#elseact
MOV S12 "<Hire Archer(RightWall)/@hirearchernow9>"
#if
CHECKCASTLESTATE ARCHER 9
#act
MOV S13 "{Archer Hired(RightWall)=FCO=250}"
#elseact
MOV S13 "<Hire Archer(RightWall)/@hirearchernow10>"
#if
CHECKCASTLESTATE ARCHER 10
#act
MOV S14 "{Archer Hired(Entrance)=FCO=250}"
#elseact
MOV S14 "<Hire Archer(Entrance)/@hirearchernow11>"
#if
CHECKCASTLESTATE ARCHER 11
#act
MOV S15 "{Archer Hired(Entrance)=FCO=250}"
#elseact
MOV S15 "<Hire Archer(Entrance)/@hirearchernow12>"

#IF
#SAY
SabukWall Balance: {<$CASTLEGOLD> Gold=FCO=251}\
The cost to recover Archers are {<$ARCHERFEE> Gold=FCO=251}.\
Archers current stance is {<$GUARDRULE>=FCO=253}\
<Normal Stance/@guardrule_normalnow>   <Red Attack Stance/@guardrule_pkattack>\ \
<$STR(S4)>  <$STR(S5)>  <$STR(S6)>\
<$STR(S7)>  <$STR(S8)>  <$STR(S9)>\
<$STR(S10)>  <$STR(S11)>   <$STR(S12)>\
<$STR(S13)>  <$STR(S14)>   <$STR(S15)>\
<Back/@SabukWallManage>   <Leave/@Exit>\


[@repa]
#if
CHECKCASTLESTATE DOOR
#act
MOV S0 "{Gate does not need Maintenance=FCO=250}"
#elseact
MOV S0 <Repair Castle Gate/@repairdoornow>
#if
CHECKCASTLESTATE WALL 1
#act
MOV S1 "{Left wall does not need Maintenance=FCO=250}"
#elseact
MOV S1 "<Repair Palace Left Wall/@repairwallnow1>"
#if
CHECKCASTLESTATE WALL 2
#act
MOV S2 "{Center wall does not need Maintenance=FCO=250}"
#elseact
MOV S2 "<Repair Palace Center Wall/@repairwallnow2>"
#if
CHECKCASTLESTATE WALL 3
#act
MOV S3 "{Right wall does not need Maintenance=FCO=250}"
#elseact
MOV S3 "<Repair Palace Right Wall/@repairwallnow3>"

#IF
#SAY
SabukWall Balance: {<$CASTLEGOLD> Gold=FCO=251}\
The cost to repair the Main Door is {<$REPAIRDOORGOLD> Gold.=FCO=251}\ 
The cost to repair the Palace Walls is {<$REPAIRWALLGOLD> Gold.=FCO=251}\
Castle Gate Current State is {<$CASTLEDOORSTATE>=FCO=253}\
<Open gate/@openmaindoor>   <Close gate/@closemaindoor>\ \
<$STR(S0)>\
Castle Walls Current State is as following:\
<$STR(S1)>\
<$STR(S2)>\
<$STR(S3)>\
<Back/@SabukWallManage>   <Leave/@Exit>\
