; Quest 5, The Temple of Light
;	50, "I met the Temple Guardian Elanzo and he told me of thieves that stole the key to the Temple of Light."
;	51, "I went to the Thief Hideout and the leader denied knowledge of it."
;	52, "I found the secret hideout in the Forest of the Dead."
;	53, "I took the key to the Light Temple and unsealed it."
;	54, "I found my way to the pillar but it was guarded by strange statues."
;	55, "I solved the riddle of the statues."
;	56, "I defeated the guardian, Light Gazer, and lit the pillar."

SCENE	500	CastleGates, SCENE, "Temple of Light"
ACTOR	1, "Elanzo", "josh94", 1, 17, 71
IF	T50, @hasT50
1: This is the Temple of Light.
1: Normally, these gates are open for all to enter.
1: However, a thief has stolen the key and taken off with it.
H: Didn't you send people after it?
1: Are you dumb? Of course we did!
1: We sent soldiers, but they have yet to return.
1: I cannot offer you much as a reward, but if you would please return the key, I'd be grateful.
GIVE T50
END
@hasT50
IF	T52, @hasT52
1: Still looking? Though I don't know for sure, I heard of a group of thieves housed up to the northwest.
1: I don't know if that will help you or not, but it may. 
END
@hasT52
IF	T53, @hasT53
1: Oh! That's the key!
1: So, tell me what happened!
WAIT	4
N: A few moments later...
WAIT	3
1: Oh, so the soldiers that we sent to retrieve the key were actually the thieves.
1: Well, %1, you did a good job in returning the key. Please take this as a reward.
WAIT	4
HOST_GIVE	G20000
GIVE	T53
N: %1 received 20000 Septi!
WAIT	3
H: Thank you.
1: I understand you are trying to light all the 8 temples, right?
H: Yes, why?
1: In that case, I wish you luck. Step forward into the Temple of Light.
WAIT	3
GOTO LINK	97, 0
END
@hasT53
GOTO LINK	97, 0
END

SCENE 501	Holyland5,	SCENE,	"Teacher's Statue"
MUSIC	Holyscene.mid
IF	T54, @hasT54
N: A statue speaks into your mind...
WAIT	3
N: "From the mother and father, two children are born."
WAIT	3
N: "From the two children come the beggars."
WAIT	3
N: After that, a click could be heard from the east.
GIVE	T54
END
@hasT54
N: The statue has spoken. it is now asleep.
END

SCENE	502	Holylands,	SCENE,	"Statue"
MUSIC Holyscene.mid
IF	T55, @done
COMPARE #<num.closestlink>, 2
IF=	@Parents
COMPARE #<num.closestlink>, 3
IF=	@Child1
COMPARE #<num.closestlink>, 4
IF=	@Child2
COMPARE #<num.closestlink>, 5
IF=	@Beggar1
COMPARE #<num.closestlink>, 6
IF=	@Beggar2
COMPARE	#<num.closestlink>, 7
IF=	@Beggar3
COMPARE	#<num.closestlink>, 8
IF=	@beggar4
@Parents
N: You hear a click.
WAIT	2
N: "Find our children."
WAIT	2
N: "They appear in the order the source of Tolaria's light appears."
GIVE	T54
SET	StatueCounter, 10
END
@Child1
COMPARE #<StatueCounter>, 10
IF> @End
IF< @End
N: You hear a click.
WAIT	2
N: "Please... Find my sibling."
ADD StatueCounter, 5
END
@child2
COMPARE #<StatueCounter>, 15
IF> @End
IF< @End
N: You hear a click.
WAIT	2
N: "You... You battle the dark."
WAIT	2
N: "As time passes in Tolaria, beggars stand and stare at the clock."
WAIT	4
N: "Meet the beggars in the order their eyes follow the clock."
ADD StatueCounter, 5
END
@beggar1
COMPARE	#<StatueCounter>, 20
IF> @End
IF< @End
N: You hear a click.
WAIT	2
N: "I was once a very rich man."
WAIT	2
N: "However, I was foolish and spent it on dishonourable things."
WAIT	4
N: "If you would, would you give me all of your gold?"
WAIT	3
@Menu1
MENU	"Yes=@Yes1", "No=@no1"
GOTO	@Menu1
@Yes1
N: "You would give your money to another without reason?"
WAIT	3
N: "Then you truly are compassionate."
SET	konegaishimasu, #<num.hostGP>
HOST_TAKE	G#<num.hostGP>
WAIT	3
N: "Move on to the next beggar."
ADD	StatueCounter, 1
END
@no1
N: "I truly am disheartened."
END
@Beggar2
COMPARE	#<StatueCounter>, 21
IF> @End
IF< @End
N: You hear a click.
WAIT	2
N: "My entire life, I've needed blood transfusions."
WAIT	3
N: "However, my blood type is very rare. You seem to have it though."
WAIT	3
N: "Would you be willing to sacrifice your blood for me?"
@Menu2
MENU	"Yes=@Yes2", "No=@no2"
GOTO	@Menu2
@Yes2
N: "You truly are a hero."
WAIT	3
N: "I thank you for your sacrifice."
HOST_TAKE H500
ADD StatueCounter, 1
END
@no2
N: "I truly am disheartened."
HOST_GIVE G#<Konegaishimasu>
SET	Konegaishimasu, 0
END
@beggar3
COMPARE	#<StatueCounter>, 22
IF> @EnD
IF< @End
N: You hear a click.
WAIT	2
N: "You have given of your wallet and of your blood, but have you ever given of your mind?"
WAIT	4
N: "Your mind is your most important possession... Can you truly press on without it?"
WAIT	3
@Menu3
MENU	"Yes=@yes3", "No=@no3"
GOTO	@Menu3
@yes3
N: "You have proven your courage thrice now... There is but one final test to endure..."
HOST_TAKE	M1000
ADD StatueCounter, 1
WAIT	4
N: Move on to the final beggar.
END
@no3
N: "I am truly disheartened."
HOST_GIVE	#<Konegaishimasu>
SET	Konegaishimasu, 0
HOST_GIVE	L1
HOST_GIVE	H500
@beggar4
COMPARE	#<StatueCounter>, 23
IF< @End
IF> @End
N: You hear a click.
WAIT	2
N: "The end of everything is at hand."
WAIT	3
N: "When the End comes, will you be prepared to give your very existance against it?"
WAIT	4
@Menu4
MENU	"Yes=@yes4", "No=@no4"
GOTO	@Menu4
@yes4
N: "Very well, for I am the End! I will take your existance from you!"
HOST_TAKE H32000
HOST_TAKE M32000
MUSIC thissongdoesntexist.mid
BKGND Black
WAIT	4
H: ...
H: Is this what it's like... to die?
WAIT	3
N: "Congratulations."
WAIT	2
N: "You have passed your final test."
WAIT	3
N: "You have proven your Compassion, Selflessness, Strength of Mind, and even Determination."
WAIT	3
N: "Now, the Pillar of Light awaits you, the worthy."
HOST_GIVE	L1
HOST_GIVE	H32000
HOST_GIVE	M32000
HOST_GIVE	G#<Konegaishimasu>
SET	Konegaishimasu, 0
GIVE	T55
GOTO	EXIT
@no4
N: "The End is coming..."
HOST_GIVE H500
HOST_GIVE M32000
HOST_GIVE	G#<Konegaishimasu>
SET	Konegaishimasu, 0
END
@End
HOST_GIVE	G#<Konegaishimasu>
SET	Konegaishimasu, 0
END
@done
END

SCENE	503	Holyland5, SCENE, "Pillar of Light"
MUSIC Holyscene.mid
IF	T56, @hasT56
N: The power of the pillar resonates in darkness...
WAIT	4
N: But then, a monster attacked!
IF	T68, @KinomuBattle
MUSIC	Boss5.mid
FIGHT	100
IF WIN, @win
@Lose
N: And thus you were defeated...
WAIT	3
N: Would you like to return to Talroa?
@Menu1
MENU	"Yes=@yes", "No=@no"
GOTO	@Menu1
@yes
GOTO	LINK	54, 0
@no
N: Have fun walking.
END
@kinomuBattle
MUSIC	Boss5.mid
FIGHT	100, -105
IF LOSE, @lose
@Win
GIVE	T56
GOTO	SCENE	504
@hasT56
END

SCENE	504	Holyland5, SCENE, "The Pillar of Light"
ACTOR	1, "Kinomu", "Kinomu", 1, 17, 71
MUSIC Holyscene.mid
1: The Holylands once again shine with the light of brilliance.
1: Well, the next area awaits. Soon, the lies of the Elementalists shall be exposed.
H: Er... Lies of the Elementalists?
1: Oh, nevermind. I was just talking to myself.
H: Uh, right...
END

SCENE	505	Bedroom, "SCENE", "Starry Knights"
SET	Innprice, 60
MUL	Innprice, #<num.peopleinscene>
ACTOR	1, "Guido", "joshTownsfolk", 14, 17, 71
1: Hello, and welcome to our establishment.
1: For your group of #<num.peopleinscene> to stay, it will cost #<innprice> Septi.
1: Is this okay?
@Menu
MENU	"Stay the Night=@yes", "Decline=@no", "Set as Save Point=@save"
GOTO	@menu
@yes
COMPARE #<num.peopleinscene>, 1
IF> @multiple
IF -G#<innprice>, @nomoney
HOST_TAKE	G#<innprice>
GIVE	L1
GIVE	H32000
GIVE	M32000
1: Thank you for staying. Please come again.
END
@multiple
1: How would you like to pay for this?
@Menu2
MENU "Leader pays for all=@leader", "Party members pay equally=@party"
GOTO	@Menu2
@leader
MUL	innprice, #<num.peopleinscene>
IF -G#<innprice>, @nomoney
HOST_TAKE	G#<innprice>
GIVE	L1
GIVE	H32000
GIVE	M32000
1: Thank you, come again!
END
@party
IF -G#<innprice>, @nomoney
TAKE	G#<innprice>
GIVE	L1
GIVE	H32000
GIVE	M32000
1: Thank you, come again!
END
@no
1: Come again.
END
@nomoney
1: I'm sorry, but you can't afford the room.
END
@save
N: Talroa set as current save point.
SET	SPID, 54
SET	SPlocation, "Talroa"
SET	SPset, 1
END

SCENE	506	Town2, SCENE, "Traveling Merchant"
ACTOR	1, "Big Delphi", "JoshRoyalty", 17, 17, 71
IF	T62, @hasGems
1: *chomp* Welcome to my *snarf* shop.
1: *gulp* We don't have a lot here, but we will *gnaw* get more goods later.
1: I have this shiny gem, too, but it's not like YOU could afford it. Haw haw.
OFFER 1, 2, 3, 4, 7, 8, 12, 13, 15, 16, 99, 141, 153, 157, 253
END
@hasGems
IF	T63, @hasT63
1: HMMM!?
1: What's that... Luscious pile of gems you've got there?
1: It looks so... Gorgeous!
1: I'll give you this ultra-special, magical gem in return!
1: It's called Sylphid's Fortility.
1: Give me those gems and you can have it.
@menu
MENU "Yes=@yes", "No=@no"
GOTO	@Menu
@yes
1: All right! I'll take those... Hee hee hee...
TAKE	I167
1: And here you go...
GIVE	I165
GIVE	T63
1: Thanks for the business... Anything else you wanna buy?
OFFER 1, 2, 3, 4, 7, 8, 12, 13, 15, 16, 99, 141, 153, 157, 253
END
@No
1: Aww...But those gems are so gorgeous!
1: Oh well. Buy something else, or leave.
OFFER 1, 2, 3, 4, 7, 8, 12, 13, 15, 16, 99, 141, 153, 157, 253
END
@hasT63
1: Welcome to my shop.
OFFER 1, 2, 3, 4, 7, 8, 12, 13, 15, 16, 99, 141, 153, 157, 253
END
;----------------
SCENE 507	Kitchen, SCENE, "The Doom Brigade"
ACTOR	1, "Thief Leader", josh56, 1, 17, 71
MUSIC	Dude2.mid
IF	T51, @hasT51
1: ...
1: Get out.
END
@hasT51
IF	T52, @hasT52
1: Hm? Are you here to join the Doom Brigade, the army of fallen Paladins who owns the key to the power of Light?
H: You! You have the key to the Light Temple!
1: Yes, what do you plan to do about it, punk?
H: I'm going to kick your ass and take it!
1: You will kick MY ass? Doubtful... Try kicking the collective asses of my 20 men!
FIGHT	26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26
IF	WIN, @win
1: Har har har! You wimp!
END
@win
1: N...No! I can't be defeated that easily! It's impossible!
H: Face it... You're beaten.
1: Bah! Fine! Take this stupid gem.
GIVE	I163
GIVE	T52
1: Now get out of here!
END
@hasT52
1: You're not welcome here, you big meanie.
END

SCENE	508	Armorshop, SCENE, "Alex's Awesome Alliterated Armor Shop"
ACTOR	1, "Alex", joshTownsfolk, 11, 17, 71
1: I respectfully recept you into my enchanting establishment.
1: Our awesome armor is astoundingly almighty!
OFFER	214, 218, 222, 226, 230, 238, 242, 246
END

SCENE	509	Armorshop, SCENE, "William's Weapons"
ACTOR	1, "William", joshTownsfolk, 20, 17, 71
1: Welcome to William's Weapons!
1: We have a large selection of pointy things to buy.
1: No ID required, either!
OFFER	153, 157, 161, 190, 194, 198, 202, 203, 210, 234
END

SCENE	510	Itemshop, SCENE, "Pulaide's Pet Palace"
ACTOR	1, "Pulaide", joshTownsfolk, 17, 17, 71
1: /a yawns.
1: Welcome to my shop.
1: We have a lot of pets and stuff...
1: Boy, am I tired...
OFFER	1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008
END