SCENE 207 fight, SCENE, "Goldsmith"
ACTOR 1, "Goldsmith", ronnie, 1,20,80
LOCK 1
GIVE L9999
GIVE M9999
COMPARE #<num.peopleInScene>, "1"
IF>,@mob
IF #0, @robcheck
@reallynormal
COMPARE #<loan>, "1"
IF=, @onlywithdraw
COMPARE #<totalmoney>, "499999"
IF>, @special2
@normal2
COMPARE #<totalmoney>, "249999"
IF>, @special
@normal3
1: Ahh, welcome! I am the goldsmith!
COMPARE #<goldsmithtaught>, 1
IF= @normal
1: While the bank may be gone, I'm even better!
1: Here, you can exchange gold that you find for bills.
1: These bills can be kept in your inventory, traded, and sold.
1: If you sell a bill, you will get just as much money back as you paid when you got the bill to begin with.
1: If you trade a bill, be sure that you get the item you were promised!
1: Like always, if you get ripped off, contact either Gandalf or Simmen and we will be sure to stop this person.
1: All of your bank funds have been transferred to me, so if you need money, just ask.
SET goldsmithtaught, 1
@normal
1: What would you like to do?
WAIT 0.5
@normalmenu
MENU "Buy Bills=@buy","Withdraw Money From Bank=@withdraw","Sell Bills=@sell"
WAIT 0.5
GOTO @normalmenu

@buy
N: Buy what kind of bill?
WAIT 0.5
@buymenu
MENU "100 Gold Bill=@buy100","500 Gold Bill=@buy500","1,000 Gold Bill=@buy1000","5,000 Gold Bill=@buy5000","10,000 Gold Bill=@buy10000","50,000 Gold Bill=@buy50000","100,000 Gold Bill=@buy100000","500,000 Gold Bill=@buy500000","Back=@normal"
WAIT 1
GOTO @buymenu

@buy100
COMPARE #<num.hostGP>, 100
IF< @cantafford
ADD totalmoney, 100
TAKE G100
GIVE I20
N: 100 gold bill bought.
GOTO @normal

@buy500
COMPARE #<num.hostGP>, 500
IF< @cantafford
ADD totalmoney, 500
TAKE G500
GIVE I25
N: 500 gold bill bought.
GOTO @normal

@buy1000
COMPARE #<num.hostgp>, 1000
IF< @cantafford
ADD totalmoney, 1000
TAKE G1000
GIVE I21
N: 1,000 gold bill bought.
GOTO @normal

@buy5000
COMPARE #<num.hostGP>, 5000
IF< @cantafford
ADD totalmoney, 5000
TAKE G5000
GIVE I26
N: 5,000 gold bill bought.
GOTO @normal

@buy10000
COMPARE #<num.hostgp>, 10000
IF< @cantafford
ADD totalmonet, 10000
TAKE G10000
GIVE I22
N: 10,000 gold bill bought.
GOTO @normal

@buy50000
COMPARE #<num.hostGP>, 50000
IF< @cantafford
ADD totalmoney, 50000
TAKE G50000
GIVE I27
N: 50,000 gold bill bought.
GOTO @normal

@buy100000
COMPARE #<num.hostgp>, 100000
IF< @cantafford
ADD totalmoney, 100000
TAKE G100000
GIVE I23
N: 100,000 gold bill bought.
GOTO @normal

@buy500000
COMPARE #<num.hostgp>, 500000
IF< @cantafford
TAKE G500000
GIVE I24
N: 500,000 gold bill bought.
GOTO @normal

@cantafford
1: Hey! You don't have enough money to buy that!
GOTO @normal

@sell
1: Alright. Sell whatever you would like to here. When you're done, right click me.
OFFER -1
END

@eventactorclick1
OFFER 0
GOTO @normal
END

@withdraw
1: Your current balance is #<money> gold. How much money would you like to withdraw?
WAIT 1
SET withdraw, "0"
@withdrawmenu
MENU "100 Gold=@withdraw1","1,000 Gold=@withdraw2","10 000 Gold=@withdraw3","50,000 Gold=@withdraw4","100,000 Gold=@withdraw5","500,000 Gold=@withdraw6","Back=@normal"
WAIT 0.5
GOTO @withdrawmenu
END

@withdrawcheck
COMPARE #<money>, #<withdraw>
IF< @nogo
COMPARE #<withdraw>, 1000000
IF> @nogo
IF< @continuew
IF= @continuew
1: You do not have that much money deposited.  Your current balance is #<money>.
GOTO @withdraw
END

@continuew
SET loanLevel, #<num.hostLevel>
MUL loanLevel, 10000
ADD loanLevel, 10000
SUB loanLevel, #<num.hostGP>
COMPARE #<withdraw>, #<loanLevel>
IF>, @cantholdit
1: Withdrawing #<withdraw> gold..
GIVE G#<withdraw>
SUB money, #<withdraw>
1: Thank you for using our bank!
GOTO @normal
END 

@cantholdit
1: Looks like you can't hold that much gold.
1: Please choose a number up to #<loanLevel> gold.
GOTO @withdraw
END

@withdraw1
SET withdraw, 100
GOTO @withdrawcheck

@withdraw2
SET withdraw, 1000
GOTO @withdrawcheck

@withdraw3
SET withdraw, 10000
GOTO @withdrawcheck

@withdraw4
SET withdraw, 50000
GOTO @withdrawcheck

@withdraw5
SET withdraw, 100000
GOTO @withdrawcheck

@withdraw6
SET withdraw, 500000
GOTO @withdrawcheck

@special
IF T1059, @normal3
1: Wow, you've already bought #<totalmoney> gold in bills!
1: That's a lot of money! Here, have a stick!
1: Hope you like it!
GIVE I454
GIVE T1059
GOTO @normal3
END

@special2
IF T720, @normal2
1: Hey, you've already bought #<totalmoney> gold in bills!
1: For being such a good customer, here's a brand new TV!
H: Alright! No more squinting for me!
1: I'll deliver it to your house!
GIVE T720
GOTO @normal2
END

@robcheck
COMPARE #<didhearrob>, 0
IF= @reallynormal
IF XP, @robexp
ACTOR 2, "Robber", robber, 1,50,90
ACTOR 3, "Robber", robber, 4,40,70
2: Yeah, thanks for the money!
3: We really appreciate it!
1: Wait! Wait! Don't leave!
2: Yeah, so long suckers!
3: See ya!
H: Hold it right there!
2: *gasp* It is %1!
3: %1? Who is that?!
H: Put down that lot -o- money!
3: Never! You'll have to fight us for it!
2: Hey, hey, you don't know who that guy is...
H: Very well then! Prepare to die!
WAIT 1
MOVE 2,-100,-100,1
MOVE 3,-100,-100,1
FIGHT 511,511
IF WIN, @robwin
MOVE 2,50,90,1
MOVE 3,40,70,1
SET robbed1, #<money>
DIV robbed1, 5
SUB money, #<robbed1>
SET didhearrob, 0
3: Ehehe, we showed you!
2: Yea, and we'll be takin' this money here with us!
2: So long!
BKGND black.jpg
WAIT 0.5
MOVE 2,-100,-100,1
MOVE 3,-100,-100,1
WAIT 0.5
BKGND fight.jpg
1: Oh no! They took one fifth of the money in the bank!
1: That means you've lost #<robbed1> gold!
1: Well, thanks for trying for trying to stop the robbers.
1: I suppose it is back to business, just with less gold!
1: Hahahahaha...
END

@robwin
COUNTDOWN 0
MOVE 2,50,90,1
MOVE 3,40,70,1
SEL 2
POSE 3
SEL 3
POSE 3
3: Ugg...
2: Agg...
2: I tried to warn you...
3: ...
2: ...
1: Thank you, %1!
1: The robbers were carrying away a TON of money!
SET robbed2, #<money>
DIV robbed2, 2
ADD money, #<robbed2>
SET didhearrob, 0
1: For your heroism, we are adding #<robbed2> gold to your account!
1: Also, I'm going to add a channel to your TV!
H: Wonderful!
1: No problem! It'll be ready by the time you get home!
GIVE T721
END

@robexp
COUNTDOWN 0
SET robbed1, #<money>
DIV robbed1, 5
SUB money, #<robbed1>
SET didhearrob, 0
1: Hey! We've just been robbed!
1: They stole #<robbed1> gold from your account!
1: I sure hope this never happens again...
END

@mob
1: I'm sorry, but I can only help one person at a time.
1: Come back soon!
END

@nogo
1: Sorry, but you don't have that much money.
GOTO @normal

;----------------------------------------------
SCENE	38	fight,	SCENE,	"Loan Bank",	0,	0
	THEME	0
	MUSIC	#nochange
	ACTOR	1, "Lender",	ronnie,	1,	25,	90
	POSE	1,	2,	3
	SEL		1
	COMPARE #<loan>, "1"
	IF=, @repay
	1: Well, hello there.
	1: Can I interest you in a loan?
	ASK 9999
	IF YES, @loan
	1: That's too bad.
	1: Come back any time!
END

@loan
	1: How much money would you like?
	ASK 9999
	SET loanAmount, #<lastAsk>
	SET loanLevel, #<num.hostLevel>
	MUL loanLevel, 10000
	ADD loanLevel, 10000
	SUB loanLevel, #<num.hostGP>
	COMPARE #<loanAmount>, #<loanLevel>
	IF>, @cantholdit
	COMPARE #<loanAmount>, "0"
	IF<, @urstupid
	1: Okay, looks like you can get a loan.
	GOTO @gotloan
END

@gotloan
	1: Here, have your #<loanAmount>G.
	GIVE G#<loanAmount>
	SET firstLoan, #<num.hostAge>
	SET loan, 1
	1: Just remember, you have to pay it back.
	1: If you don't, you have to pay interest, too, it costs two percent of your loan every minute you don't pay!
	1: Also, your bank account is frozen until you repay the loan.
END

@urstupid
	1: Hey, I just can't take your money!
	1: C'mon, do you want a loan or not?
	GOTO @loan
END

@cantholdit
	1: Hey! You can only hold #<loanLevel> more gold!
	1: Enter a number from 0 to #<loanLevel>, okay?
	GOTO @loan
END

@repay
	1: So, back to repay your loan?
	ASK 9999
	IF YES, @repaycont
	1: I see...well, that interest is piling up...
END

@repaycont
	1: Good!
	SET repayLoan, #<num.hostAge>
	SUB repayLoan, #<firstLoan>
	MUL repayLoan, ".02"
	SET repayRepay, #<loanAmount>
	MUL repayRepay, #<repayLoan>
	ADD repayRepay, #<loanAmount>
	SET loanLevel, #<num.hostLevel>
	MUL loanLevel, 10000
	ADD loanLevel, 10000
	ADD loanlevel, #<money>
	1: You now owe me #<loanAmount>G!
	COMPARE #<loanamount>, 0
	IF<, @iou
	COMPARE #<loanAmount>, #<loanLevel>
	IF>, @problem
	IF -G#<repayRepay>, @cantpay
	1: Now, just pay me that money...
	TAKE G#<repayRepay>
	1: Thank you! Pleasure doing business with you!
	@repaycont2
	1: Now, to unfreeze your account...
	TAKE T704
	SET bankMoney, #<bankFreeze>
	SET loan, 0
	1: There you are, unfrozen! You can now use the bank again!
END

@problem
	1: *sigh* Look what you've gotten yourself into..
	1: Fine, since I gave you that much money and knew you couldn't carry it..
	1: I'll just take every penny you have so that you can repay me as best you can..
	SET money, 0
	TAKE G999999
	1: Very well..
	GOTO @repaycont2
	

@iou
	1: Hey, wait! That's a NEGATIVE number!
	1: Here, here's the money I owe you!
	GIVE G#<repayRepay>
	GOTO @repaycont2
END
	
@repaycomplete
	1: I see you've finished paying your installments! Wonderful!
	1: Thank you! Pleasure doing business with you!
	1: Now, to unfreeze your account...
	TAKE T704
	SET bankMoney, #<bankFreeze>
	SET loan, 0
	1: There you are, unfrozen! You can now use the bank again!
END

@cantpay
	1: Oh, you can't repay the loan I see...
	1: Unless you can pay it in INSTALLMENTS...
	1: Would you like to pay me #<num.hostGP> and pay the rest later?
	ASK 9999
	IF NO, @dontpay
	1: Good...
	SUB loanAmount, #<num.hostGP>
	TAKE G#<num.hostGP>
	COMPARE #<repayRepay>, "0"
	IF=, @repaycomplete
	1: You now owe me #<loanAmount>G.
END

@dontpay
	1: Too bad.
	1: Come back later.
	1: No, seriously...come back later...
	1: I NEED that money!
END
