;Kroxville
;Kroxville Equipment
SCENE 37 bwEuroStreet
#Include prtychk.txt
#include steal.txt
MUSIC	waltz2.mid
	ACTOR	1,	"Darren", joshTownsFolk, 9, 25, 90
	POSE 9, 10
COMPARE #<num.hostClass> "35"
IF> @monster
IF= @monster
	SEL		1
	MOVE	1,	15, 80
	1: We have the GREATEST equipment available to buy!
	H: Like what.
	1: Ummm, well take a look for yourself!
	1: Right click me for armour or weapons
END
@eventactorclick1
COMPARE #<num.hostClass> "35"
IF> @monster
IF= @monster
MENU "Armour=@armour", "Weapons=@weapons"
END
@armour
	OFFER2 80,99,10, 80,99,11, 80,99,21, 80,99,22, 80,99,23
END
@weapons
	OFFER2 80,99,12, 80,99,13, 80,99,14, 80,99,15, 80,99,16, 80,99,17, 80,99,18, 80,99,19,
END

@monster
1: Human equipment only here
END

;Kroxville House
SCENE 38 bazaar
#Include prtychk.txt
#include steal.txt
ACTOR 1	"Sarah", joshtownsfolk, 4, 25, 90
POSE 4, 24
COMPARE #<num.hostClass> "35"
IF> @monster
IF= @monster
1: Im Sarah
H: Hello Sarah, %1 here, nice to meet you.
1: Do you own a boat?
1: Because if you do I have heared of a HIDDEN island somewhere!
1: Maybe YOU shoudl search for it?
HOST_GIVE T207
H: Ok
END

@monster
1: I have nothing for you beast
1: Leave here now!
END

;Kroxville Inn
SCENE 39 bazaar
#Include prtychk.txt
#include steal.txt
MUSIC steel.mid
ACTOR 1 "Innkeeper", Joshtownsfolk, 17, 25, 90
COMPARE #<num.hostClass> "35"
IF> @monster
IF= @monster
If Alive @sleep
1: AHHHH you are DEAD, this is NOT the graveyard!
1: I cannot help you, go back to your home town to get resurected, or go find a grave to rot in!
END
@sleep
1: Hi there, welcome to my inn.
1: We great heated beds here, you recover 2000HP and 2000MP every time, and get the best nights sleep on the island.
1: 1000GP what do ya say?
ASK 30
IF Qyes @stay
1: No? Fine
END
@stay
TAKE G1000
1: Great, good night!
WAIT 2
IF R01 @badsleep
GIVE H1000
GIVE M1000
1: I hope you slept well, goodbye.
END

@badsleep
1: I hope you slept well!
H: No, It was hard to sleep at all
1: WHAT? But these are the best beds on the island!
H: It was TOO hot, were you tryin to cook me or something?
1: I see...
1: Well We cant have that, here have a night on the house!
H: Thanks!
GOTO @stay
END

@monster
1: Monsters can sleep in the plains where they belong
1: Now go away
END

;Kroxville Herbs
SCENE 40 bwEuroStreet
#Include prtychk.txt
#include steal.txt
ACTOR 1 "Harriet", joshtownsfolk 24, 25, 90
POSE 24, 25
COMPARE #<num.hostClass> "35"
IF> @monster
IF= @monster
1: The miners island is great for growing herbs. Shame I dont get so many customers though.
OFFER 1, 2, 3, 4, 7, 12, 13, 14, 15, 16, 18, 19, 24, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38
END

@monster
1: Leave me alone you monster!
END

;head of the mining town
SCENE 41 bazaa
#Include prtychk.txt
#include steal.txt
ACTOR 1 "Mining chief", joshtownsfolk, 9, 25, 90
POSE 9, 10
COMPARE #<num.hostClass> "35"
IF> @monster
IF= @monster
1: Hello, Im the head of this mine, and the island.
1: I controll what comes.
1: And what goes.
1: Are you ready to leave?
ASK 30
IF yes @ready
H: Not yet.
1: Well come see me when you want to go.
END

@ready
H: I want to go back to the mainland.
1: Ok, Ill put you on the next ship.
GOTO link 7, 0
END

@monster
ACTOR 2 "Passenger", joshtownsfolk, 31, 40, 90
FACE 2, 1
1: No pets on the ships
2: Thats NOT my pet!
MOVE 2,  -30, 90 
1: What? Go away you fiend!
END

SCENE 42 cave1
#Include prtychk.txt
#include steal.txt
ACTOR 1 "Miner", joshtownsfolk, 7, 25, 90
POSE 7, 7, 1
COMPARE #<num.hostClass> "35"
IF> @monster
IF= @monster
1: Hey the mine doubles as a public PK arena in the right...
1: and a public monster arena to the left.
1: down the pit is the time machine we dug up!
1: Straight on is off limmits to the public OK?
1: And finally I sell tickets to the arenas, 1k each.
@RiorLe
1: Right or Left, pit or tickets?
ASK 30
IF Qleft @left
IF Qmonster @left
IF Qright @right
IF QPK @right
IF Qshop @tick
IF Qtickets @tick
IF Qbuy @tick
IF Qdown @time
IF Qpit @time
IF Qmachine @time
IF Qtime @time
1: Well?
GOTO @RiorLe
END
@time
GOTO SCENE 200
END
@left
1: Ok monster arena it is!
GOTO link 15, 0
END

@right
1: Ok Pk arena it is!
GOTO link 16, 0
END

@tick
1: I have PK or monster arena tickets!
OFFER 97, 98
END

@monster
1: No monsters in the mines!
1: Unless you want to buy tickets or go in the PK or pet arena?
ASK 30
IF QPK @right
IF Qpet @left
IF Qtickets @tick
1: Well leave at once then
END

;shadey dude
SCENE 45 fort
#Include prtychk.txt
#include steal.txt
If T33 @gone
ACTOR 1 "Shadey character", joshtownsfolk, 19, 25, 90
COMPARE #<num.hostClass> "35"
IF> @monster
IF= @monster
1: PSSSSSSSSSSSSSSSSSSSSSSST
H: What?
1: I got something real good for you.
H: What?
1: This real cool thing, SO cool that I cant tell ya what it is ya buy it.
H: Sounds dodgy...
1: Well 50k, want one or not?
ASK 30
If Qyes @yes
If Qno @No
If Q10000 @cheep
If Qexpensive @cheep
If Qcheep @cheep
If Qcheeper @cheep
If QDie @free
IF Qkill^you @free
END

@yes
If G50000 @skip
1: HA you dont have enough, later
MOVE 1, -20, 90
END
@skip
1: He He He thanks, here
TAKE G50000
GIVE I100
GIVE T33
MOVE 1, -20, 90 
WAIT 5
H: Hey this is just a stupid rock!
1: Ha Ha Ha
H: Damn.
END

@no
1: WHAT no??? Ha you probably can't afford it, well if you get back here soon enough, who knows mabee Ill still be here.
END

@cheep
If G10000 @cheep2
1: Ok Ill let ya have it for just 10000 GP
1: You dont even have 10000GP HA, no sale.
END

@cheep2
1: Ok Ill let ya have it for just 10000 GP
H: Ok that sounds fair
1: He He He thanks, here
TAKE G10000
GIVE I100
GIVE T33
MOVE 1, -20, 90 
WAIT 5
H: Hey this is just a stupid rock!
1: Ha Ha Ha
H: Damn.
END

@free
1: AHHHH please don't hurt me!!
1: Take the stupid rock!
MOVE 1, -20, 90
H: Rock? Thats it?? Oh well.
GIVE I100
GIVE T33
END

@gone
H: He is gone!
END

@monster
1: Hey, your a ... your a monster!
H: Grrrrr
1: DONT HURT ME!
MOVE 1, 10, 90
1: /a cowers in the corner
N: He appears to be holding a rock
END

;----------------------------
;The bank!
;----------------------------
SCENE 54 bazaar
#Include prtychk.txt
#include steal.txt
ACTOR 1 "Bank Manager", joshtownsfolk, 38, 25, 90
POSE 38, 38, 37
COMPARE #<loandue>, 0
IF> @loanrepay
COMPARE #<num.hostClass> "35"
IF> @monster
IF= @monster
@usebanknow
@askbank1
1: Hello, welcome to the bank!
1: Here you can buy bank notes, deposit money in a bank account, take a loan or invest in the stock market!
1: Which would you like?
ASK 100
If Qinvest @stocks
If Qstocks @stocks
If Qstock @stocks
If Qgame @stocks
IF Qaccount @Bankaccount
IF Qdeposit @Bankaccount
IF Qwithdraw @Bankaccount
IF Qstore @Bankaccount
IF Qborrow @loan
IF Qloan @loan
If Qnotes @notes
If Qbank @notes
If Qshop @notes
1: That is not an available service.
GOTO @askbank1
END

@monster
1: Your a monster!
1: But if you must you can use the bank, I mean i guess even you have money for me tospe*AHEM* I mean bank for you.
1: So want to use my fine bank?
ASK 30
If Qyes @usebanknow
1: Well, leave imediatly
END

;-------------------------------------
;STOCKS
;-------------------------------------
@stocks
Game 7
END

;-------------------------------------
;BANK NOTES
;-------------------------------------
@notes
OFFER 2000
1: We have a variety of bank notes, thes can only be bought here, but may be sold anywhere
1: Please type the the letter for the value of the banknote you wish to buy, 
1: you may choose A:1000, B:5000, C:10000, D:25000, E:50000, F:100000, G:250000, H:500000, or I:1000000!
ASK 100
IF QA @Bank1000
IF QB @Bank5000
IF QC @Bank10000
IF QD @Bank25000
IF QE @Bank50000
IF QF @Bank100000
IF QG @Bank250000
IF QH @Bank500000
IF QI @Bank1000000
1: That value is not available
GOTO @notes
END

@Bank1000
IF -G1000 @cantafford
1: Here you go!
HOST_TAKE G1000
HOST_GIVE I44
1: Please come again!
GOTO @notes
END

@Bank5000
IF -G5000 @cantafford
1: Here you go!
HOST_TAKE G5000
HOST_GIVE I45
1: Please come again!
GOTO @notes
END

@Bank10000
IF -G10000 @cantafford
1: Here you go!
HOST_TAKE G10000
HOST_GIVE I46
1: Please come again!
GOTO @notes
END

@Bank25000
IF -G25000 @cantafford
1: Here you go!
HOST_TAKE G25000
HOST_GIVE I47
1: Please come again!
GOTO @notes
END

@Bank50000
IF -G50000 @cantafford
1: Here you go!
HOST_TAKE G50000
HOST_GIVE I48
1: Please come again!
GOTO @notes
END

@Bank100000
IF -G100000 @cantafford
1: Here you go!
HOST_TAKE G100000
HOST_GIVE I49
1: Please come again!
GOTO @notes
END

@Bank250000
IF -G250000 @cantafford
1: Here you go!
HOST_TAKE G250000
HOST_GIVE I50
1: Please come again!
GOTO @notes
END

@Bank500000
IF -G500000 @cantafford
1: Here you go!
HOST_TAKE G500000
HOST_GIVE I51
1: Please come again!
GOTO @notes
END

@Bank1000000
IF -G1000000 @cantafford
1: Here you go!
HOST_TAKE G1000000
HOST_GIVE I52
1: Please come again!
GOTO @notes
END

@cantafford
1: Im afraid you cannot aford that bank note.
GOTO @notes
END

;-------------------------------------
;BANK ACCOUNT
;-------------------------------------
@Bankaccount

;checking if this is the first visit, and setting up the account
COMPARE #<cashstored>, 0
IF> @bankaccountisokhascashin
SET cashstored, 0
@bankaccountisokhascashin

;setting the last time visited
COMPARE #<lasttime>, 0
If< @skipsetlasttime
If> @skipsetlasttime
SET lasttime, #<num.hostAge>

;Calculating time sience last visit
@skipsetlasttime
SET bankreturn, #<num.hostAge>
SUB bankreturn, #<lasttime>

;Checking if interest is due
COMPARE #<bankreturn>, 0
IF= @skipint

;Calculating interest
SET bankTEMP, #<cashstored>
MUL bankTEMP, #<bankreturn>
DIV bankTEMP, 100
DIV bankTEMP, 60
ADD cashstored, #<bankTEMP>
SET lasttime, #<num.hostAge>
@skipint
1: You currently have #<cashstored> GP in your account, including #<bankTEMP> interest sience you last visited. 
1: Do you wish to withdraw or deposit any cash in this account? (type info for bank account information)
ASK 30
IF Qwithdraw @withdraw
IF Qdeposit @deposit
IF Qwith @withdraw
IF Qdepo @deposit
IF Qinfo @bankhelp1
IF Qno @askbank1
1: No, well throw any cash to me you wish to deposit, to do so, select the ammount at the bottom of the screen, click OK and then click me.
END
@bankhelp1
1: The bank account is simple, you give me cash, and I store it in an account.
1: You need the cash back, just ask for a withdrawl
1: Bank accounts here earn 1% interest per hour.
GOTO @bankaccount
END

@withdrawB
1: So you want to withdraw in stead?
@withdraw
1: How much do you want to withdraw?
ASK 30
IF Qnone @bankaccount
COMPARE #<cashstored>, 0
If< @toomuch
COMPARE #<cashstored>, #<lastask>
IF< @Toomuch
COMPARE #<lastask>, 0
IF< @depositB
IF= @bankaccount
SUB cashstored, #<lastask>
HOST_GIVE G#<lastask>
GOTO @bankaccount
END

@Toomuch
1: Im afraid you dont have enough GP in this account
GOTO @bankaccount
END

@depositB
1: So you want to deposit in stead?
@deposit
1: How much do you want to deposit?
ASK 30
IF Qnone @bankaccount
COMPARE #<num.hostGP>, #<lastask>
IF< @NotenouthGPfordeposit
COMPARE #<lastask>, 0
IF< @withdrawB
IF= @bankaccount
ADD cashstored, #<lastask>
HOST_TAKE G#<lastask>
GOTO @bankaccount
END

@NotenouthGPfordeposit
1: Im afraid you dont have that much!
GOTO @bankaccount
END

@eventActorGive1
ADD cashstored, #<item.goldGiven>
GOTO @bankaccount
END
@loanrepay
GOTO SCENE 72
END
@loan
GOTO SCENE 72
END

;-------------------------------------
;LOANS
;-------------------------------------
SCENE 72 bazaar
#Include prtychk.txt
#include steal.txt
ACTOR 1 "Bank Manager", joshtownsfolk, 38, 25, 90
POSE 38, 38, 37
COMPARE #<loandue>, 0
IF> @loanrepay
@loan
1: So you want to take out a loan? (type help for information on loans)
ASK 30
IF Qyes @loan2
If Qinfo @info
If Qhelp @info
IF Qno @askbank1
GOTO @loan
END
@askbank1
GOTO SCENE 54
END
@info
1: Loans can be DANGEROUS things, getting in to debt is not a good idea
1: There is an instant 5%% loan charge, this will be added to your total loan.
1: Every ten minutes the ammount due will increace by 1%% interest.
1: You may loan upto 1000000 GP
1: Whenever you come here, you may repay the loan, but you cannot use any other bank services untill you do!
@loan2
1: If you still want a loan type the ammount, type No to return to other services
ASK 30
IF QNo @askbank1
COMPARE #<lastask>, 0
If> @loan3
GOTO @loan2
@loan3
SET TEMPloan, #<lastask>
1: You want a loan of #<TEMPloan> GP?
ASK 30
IF Qyes @loan4
IF Qno @askbank1
GOTO @loan3

;Calculating loan, and giving the cash
@loan4
SET loandue, #<TEMPloan>
SET loantaken, #<num.hostAge>
HOST_GIVE G#<TEMPloan>
SET TEMPloanB, #<TEMPloan>
DIV TEMPloanB, 20
ADD loandue, #<TEMPloanB>
1: Here is your loan of #<TEMPloan> GP.
1: You now owe the bank #<loandue> including the 5%% regestration fee of #<TemploanB>
1: Remember, no other services untill paid with interest in FULL, good day.
END

;Checking if monney still is due
@loanrepay
COMPARE #<loandue>, 0
IF= @loan
IF< @toomuchrepaid
1: Here to repay your loan I hope?

;Calculating time sience last visit
SET loanreturn, #<num.hostAge>
SUB loanreturn, #<loantaken>

;calculating interest
SET loandueTEMP, #<loandue>
MUL loandueTEMP, #<loanreturn>
DIV loandueTEMP, 1000
ADD loandue, #<loandueTEMP>

;Setting last visit to now
SET loantaken, #<num.hostAge>
1: You are now due #<loandue> GP, thats with interest of #<loandueTEMP>
1: Please toss any cash to me to repay the loan, to do so, select the ammount at the bottom of the screen, click OK and then click me. Alternativly, rightclick me and I will ask how much you wish to repay.
END
@eventActorGive1
SUB loandue, #<item.goldGiven>
1: Thankyou for the repayment of #<item.goldGiven> GP
GOTO @loanrepay
END
@toomuchrepaid
1: you gave me too much, but the donation is welcome thanks :)
SET loandue, 0
GOTO @loan
END

@EventActorClick1
1: How much of your #<loandue> loan do you wish to repay?
ASK 30
IF Qnone @loanrepay
COMPARE #<lastask>, 0
IF= @loanrepay
IF< @loanrepay
COMPARE #<num.hostGP>, #<lastask>
IF< @notenouthGPtopay
SET loanrepaymentGP, #<lastask>
1: You want to repay #<lastask> GP on your #<loandue> GP loan?
ASK 30
IF Qno @loanrepay
IF Qyes @askpaynow
GOTO @loanrepay
END

@askpaynow
HOST_TAKE G#<loanrepaymentGP>
SUB loandue, #<loanrepaymentGP>
1: You have paid #<loanrepaymentGP> GP leaving #<loandue> GP left to repay.
GOTO @loanrepay
END

@notenouthGPtopay
1: You don't have enouth GP to pay #<lastask> on your #<loandue> loan!
END