; Made by Silver for StarWars
;
; This is a small 'minigame' that Jedies will get to see once they destroyed the empire.
; It will allow them to take Princes Leia out on a Candlelight dinner date. 
; I know this is very weird since she's supposed to be your sister, but what the heck! Just add it for me please. ;-)
;
; To add it:
;- put the starwarsdinner.txt in the main folder and #include starwarsdinner.txt in the quest.txt
;- 2 jpg files, sky.jpg and silverplace.jpg belong in the Scenes folder
;- silver.bmp in the monster folder
;- Please put CelesMix.mid in midi folder
;
;- Add a link on a map somewhere. I'm sorta hoping it could be on Yavin IV in the north east. ^_^
;- Ow yeah, you could protect that link with token 128, so it won't show up until people actually destroyed the Emperium.
;  It doesn't really matter though, I put in a small protection that should prevent that people can see the script before
;  they did the quest. 
;
; Final note: If you deceide to add this (which I'm really hoping for..) then please add it in unchanged, it's been tested 
; several times and I'm pretty sure it's all bug free. I can't find any bugs myself anymore. I hope you'll like it! ^_^
;
;

SCENE 1225, aaarunes,SCENE,"????",0,0 

	IF T397, @stopnow
	COMPARE #<smugnu>, "1"
	IF= @mapcheck1
	COMPARE #<smugnu>, "2"
	IF= @mapcheck2
	COMPARE #<smugnu>, "3"
	IF= @mapcheck3
	COMPARE #<smugnu>, "4"
	IF= @mapcheck4
	COMPARE #<smugnu>, "5"
	IF= @mapcheck5
	COMPARE #<smugnu>, "6"
	IF= @mapcheck6
@stopnow
	N: There is nothing here...
	END

@mapcheck1
	IF #5, @linkn1
	N: There is nothing here...
	END
@mapcheck2
	IF #5, @linkn2
	N: There is nothing here...
	END
@mapcheck3
	IF #6, @linkw1
	N: There is nothing here...
	END
@mapcheck4
	IF #6, @linkw2
	N: There is nothing here...
	END
@mapcheck5
	IF #7, @linke1
	N: There is nothing here...
	END
@mapcheck6
	IF #7, @linke2
	N: There is nothing here...
	END
@linkn1
	COMPARE "#<num.closestLink>", "5"
	IF= @startit
	N: There is nothing here...
	END
@linkn2
	COMPARE "#<num.closestLink>", "7"
	IF= @startit
	N: There is nothing here...
	END
@linkw1
	COMPARE "#<num.closestLink>", "5"
	IF= @startit
	N: There is nothing here...
	END
@linkw2
	COMPARE "#<num.closestLink>", "6"
	IF= @startit
	N: There is nothing here...
	END
@linke1
	COMPARE "#<num.closestLink>", "3"
	IF= @startit
	N: There is nothing here...
	END
@linke2
	COMPARE "#<num.closestLink>", "4"
	IF= @startit
	N: There is nothing here...
	END
@startit
	ACTOR 1, "Smuggler Dune", a50, 4,18,81

	MOVE 1,38,90

	H: Are you Kodoki's contact person?
	1: Yes, that's me.
	H: He told me you will give drugs that I have to bring to Neither Lands.
	1: Maybe he did...
	1: But to know for sure if he really sent you I first want to have the password.
	H: WHAT THE HECK!?
	H: He never gave me a password!!
	1: Ho there! 
	1: Calm down, I was just testing ya.
	1: There isn't a password.
	H: Euh... yeah right...
	H: So about the drugs, do you have it or not?
	1: Yup, here you go.
	WAIT 3.0
	N: Smuggler Dune hands over the %I746.
	HOST_GIVE I746
	HOST_GIVE T397
	WAIT 3.0
	1: Just bring this stuff to Doctor Luke in Neither Lands.
	1: Doctor Luke will give you your rewards then.
	1: I better get going again, I have more stuff to deliver today.
	H: Aight, cya Dune.
	1: Ciao!
	WAIT 2.0
	MOVE 1,18,81
	WAIT 3.0
	MOVE 1,-50,50,1
	END


END


SCENE 1224

#include lpscript3.txt

	EJECT T172
	TAKE T163
	TAKE T164
	TAKE T165
	TAKE T166
	GOTO LINK 30,0,0
@exit
	GOTO EXIT

SCENE 1223, meadow, SCENE, "",0,0

	FLAGS 2048

	IF  T449, @finishitnow
	IF -T447, @finishitnow

	EJECT T172
	TAKE T163
	TAKE T164
	TAKE T165
	TAKE T166

	IF T448, @timeup
	IF XP, @timeup

	IF -V89, @skipnoxpset
	FLAGS 2048
@skipnoxpset

	SET linkno2, #<linkno>
	COMPARE #<linkno2>,#<num.closestLink>
	IF= @startit
	SET niwrong, "%R14"
	COMPARE #<niwrong>, "1"
	IF= @wrong1
	COMPARE #<niwrong>, "2"
	IF= @wrong2
	COMPARE #<niwrong>, "3"
	IF= @wrong3
	COMPARE #<niwrong>, "4"
	IF= @wrong4
	COMPARE #<niwrong>, "5"
	IF= @wrong5
	COMPARE #<niwrong>, "6"
	IF= @wrong6
	COMPARE #<niwrong>, "7"
	IF= @wrong7
	COMPARE #<niwrong>, "8"
	IF= @wrong8
	COMPARE #<niwrong>, "9"
	IF= @wrong9
	COMPARE #<niwrong>, "10"
	IF= @wrong10
	COMPARE #<niwrong>, "11"
	IF= @wrong11
	COMPARE #<niwrong>, "12"
	IF= @wrong12


	N: Wrong shell!
	END
@wrong1
	N: Ah Ahh! Wrong one!
	END
@wrong2
	N: Try another one!
	END
@wrong3
	N: Nothing here!
	END
@wrong4
	N: This one is empty!
	END
@wrong5
	N: Fooled ya!
	END
@wrong6
	N: Only air here!
	END
@wrong7
	N: Nope, nothing!
	END
@wrong8
	N: Empty!!
	END
@wrong9
	N: You're wasting your time on this one!
	END	
@wrong10
	N: Nothing here, better luck next time!
	END
@wrong11
	N: Close... but nothing!
	END
@wrong12
	N: Not even a pearl in this shell!
	END

@timeup
	HOST_GIVE T448
	N: Your time is up!
	N: Return to the Trial Master!
	END
@finishitnow
	N: There is nothing here!
	END
@startit
	N: Bingo!
	SET bon1, "0"
	COMPARE #<bon1>, "0"
	IF> @ban
	SET fightxsx, #<num.hostLevel>
	ADD fightxsx, "30"
	SET exbonusnu, "90"
	SUB exbonusnu, "#<num.hostLevel>"
	SET fightx, "0"
	COMPARE #<fightx>, "0"
	IF> @ban
@randomm
	IF R45, @fight1
	IF R35, @fight2
	IF R15, @fight3
	IF R5,  @fight4
	GOTO @randomm

@fight1
	SET fight1, "69"
	ADD fight1, "%R174"
	SET monster.id, "#<fight1>"
	COMPARE #<monster.hp>, "0"
	IF= @fight1
	COMPARE #<monster.level>, #<fightxsx>
	IF> @fight1
	SET bon1x, #<monster.level>
	MUL bon1x, "3"
	DIV bon1x, "20"
	ADD bon1, #<bon1x>
	ADD bon1, #<exbonusnu>
	SET fightx, "1"
	FIGHT2 #<fight1>
	GOTO @random

@fight2
	SET fight1, "69"
	ADD fight1, "%R174"
	SET monster.id, "#<fight1>"
	COMPARE #<monster.hp>, "0"
	IF= @fight2
	COMPARE #<monster.level>, #<fightxsx>
	IF> @fight2
	SET bon1x, #<monster.level>
	MUL bon1x, "3"
	DIV bon1x, "20"
	ADD bon1, #<bon1x>
	ADD bon1, #<exbonusnu>
@fight2a
	SET fight2, "69"
	ADD fight2, "%R174"
	SET monster.id, "#<fight2>"
	COMPARE #<monster.hp>, "0"
	IF= @fight2a
	COMPARE #<monster.level>, #<fightxsx>
	IF> @fight2a
	SET bon1x, #<monster.level>
	MUL bon1x, "3"
	DIV bon1x, "20"
	ADD bon1, #<bon1x>
	DIV exbonusnu, "2"
	ADD bon1, #<exbonusnu>
	SET fightx, "2"
	FIGHT2 #<fight1>,#<fight2>
	GOTO @random

@fight3
	SET fight1, "69"
	ADD fight1, "%R174"
	SET monster.id, "#<fight1>"
	COMPARE #<monster.hp>, "0"
	IF= @fight3
	COMPARE #<monster.level>, #<fightxsx>
	IF> @fight3
	SET bon1x, #<monster.level>
	MUL bon1x, "3"
	DIV bon1x, "20"
	ADD bon1, #<bon1x>
	ADD bon1, #<exbonusnu>
@fight3a
	SET fight2, "69"
	ADD fight2, "%R174"
	SET monster.id, "#<fight2>"
	COMPARE #<monster.hp>, "0"
	IF= @fight3a
	COMPARE #<monster.level>, #<fightxsx>
	IF> @fight3a
	SET bon1x, #<monster.level>
	MUL bon1x, "3"
	DIV bon1x, "20"
	ADD bon1, #<bon1x>
	DIV exbonusnu, "2"
	ADD bon1, #<exbonusnu>
@fight3b
	SET fight3, "69"
	ADD fight3, "%R174"
	SET monster.id, "#<fight3>"
	COMPARE #<monster.hp>, "0"
	IF= @fight3b
	COMPARE #<monster.level>, #<fightxsx>
	IF> @fight3b
	SET bon1x, #<monster.level>
	MUL bon1x, "3"
	DIV bon1x, "20"
	ADD bon1, #<bon1x>
	DIV exbonusnu, "2"
	ADD bon1, #<exbonusnu>
	SET fightx, "3"
	FIGHT2 #<fight1>,#<fight2>,#<fight3>
	GOTO @random
	END
@fight4
	SET fight1, "69"
	ADD fight1, "%R174"
	SET monster.id, "#<fight1>"
	COMPARE #<monster.hp>, "0"
	IF= @fight4
	COMPARE #<monster.level>, #<fightxsx>
	IF> @fight4
	SET bon1x, #<monster.level>
	MUL bon1x, "3"
	DIV bon1x, "20"
	ADD bon1, #<bon1x>
	ADD bon1, #<exbonusnu>
@fight4a
	SET fight2, "69"
	ADD fight2, "%R174"
	SET monster.id, "#<fight2>"
	COMPARE #<monster.hp>, "0"
	IF= @fight4a
	COMPARE #<monster.level>, #<fightxsx>
	IF> @fight4a
	SET bon1x, #<monster.level>
	MUL bon1x, "3"
	DIV bon1x, "20"
	ADD bon1, #<bon1x>
	DIV exbonusnu, "2"
	ADD bon1, #<exbonusnu>
@fight4b
	SET fight3, "69"
	ADD fight3, "%R174"
	SET monster.id, "#<fight3>"
	COMPARE #<monster.hp>, "0"
	IF= @fight4b
	COMPARE #<monster.level>, #<fightxsx>
	IF> @fight4b
	SET bon1x, #<monster.level>
	MUL bon1x, "3"
	DIV bon1x, "20"
	ADD bon1, #<bon1x>
	DIV exbonusnu, "2"
	ADD bon1, #<exbonusnu>
@fight4c
	SET fight4, "69"
	ADD fight4, "%R174"
	SET monster.id, "#<fight4>"
	COMPARE #<monster.hp>, "0"
	IF= @fight4c
	COMPARE #<monster.level>, #<fightxsx>
	IF> @fight4c
	SET bon1x, #<monster.level>
	MUL bon1x, "3"
	DIV bon1x, "20"
	ADD bon1, #<bon1x>
	DIV exbonusnu, "2"
	ADD bon1, #<exbonusnu>
	SET fightx, "4"
	FIGHT2 #<fight1>,#<fight2>,#<fight3>,#<fight4>
	GOTO @random

@random
	SET linkno, "%R10"
	COMPARE #<linkno>,#<linkno2>
	IF= @random
	IF ALIVE, @bonustime
	N: Get a rez and try another shell!
	WAIT 3.0
	GOTO EXIT
@bonustime
	IF XP, @timeup
	SET ninbon, "0"
	ADD ninmo, #<fightx>	
	SET ninmo4, #<ninmo>
	COMPARE #<ninbon>, "0"
	IF> @ban
	SET ninbon, #<bon1>
	ADD ninbon, #<num.countDown>
	COUNTDOWN #<ninbon>
	N: You have defeated #<ninmo> opponents in total and you received #<bon1> bonus seconds!
	N: Find the next shell fight!
	WAIT 3.0
	GOTO EXIT

@ban
	HOST_GIVE T172
	PARTY T172
	GOTO LINK 99,0,1

END

SCENE 1222, meadow, SCENE, "",0,0

	ACTOR 1, "Trial Master",a95,4,-10,90

	MOVE 1, 20,90
	EJECT T172
	
	WAIT 3.0
	
	IF V75, @ready
	1: Welcome #<g.ssir> %1.
	1: You should visit me once you reached at least level 75.
	1: Then you will be strong enough for a trial that we prepared for you.
	END
@ready
	IF T449, @back
	IF V90, @toold
	IF T447, @donetrial
	1: Welcome #<g.ssir> %1.
	1: I see you reached level #<num.hostLevel>.
	1: Your level is now high enough for our trial.
	1: South of here is a link to a new map called Ninja Trials.
	1: On that map are 10 shells.
	1: One or more monsters will randomly appear in one of the shells.
	1: You get 20 minutes to kill as many monsters possible, spellcasters receive 25 minutes due to magic taking more time to cast.
	1: For each monster that you kill you gain a little bonus time that's 15%% of the monsters level.
	1: If you manage to kill 45 monsters in 20 minutes then you will receive a special reward.
	1: Once your time is up you have to return to me.
	1: Are you ready for the trial?
	ASK 300
	IF YES, @startitup
	1: Perhaps later then.
	1: Feel free to return when you think you are ready.
	END
@startitup
	1: Good, very good.
	1: I shall activate your timer now.
	HOST_GIVE T447
	TAKE T163
	TAKE T164
	TAKE T165
	TAKE T166
	SET ninmo, "0"
	SET linkno, "%R10"
	SET ninmo2, "%R15"
	ADD ninmo2, "50"
	SET ninmo3, "%R25"
	ADD ninmo3, "40"
	
	COMPARE #<num.hostMagicRatio>, "50"
	IF> @giveExtraTime	
	COUNTDOWN 1200	
	
@startContinue	
	1: Good luck #<g.ssir> %1!
	WAIT 3.0
	GOTO EXIT

@giveExtraTime	
	COUNTDOWN 1500
	GOTO @startContinue
	
@stilltime
	COMPARE #<ninmo>, "44"
	IF> @quitEarly
	1: You have killed #<ninmo> monsters, you should kill more monsters while there is still time left!
	WAIT 4.0 
	GOTO EXIT
	
@quitEarly
	1: Hah, you still had #<num.countDown> seconds left, yet you beat the Trial already!
	COUNTDOWN 0	
	GOTO @donetrial

@donetrial
	IF -XP, @stilltime
	1: I see you killed #<ninmo> monsters in total.
	COMPARE #<ninmo>, "45"
	IF< @notenough
	1: Congratulations #<g.ssir> %1, you are worthy to receive your special reward.
	WAIT 3.0
	
	IF -T118, @skipGunslingerReward
	HOST_GIVE I8.2
	N: You received two %I8s!
	
@skipGunslingerReward	
	IF T118, @skipRegularReward
	HOST_GIVE I718
	N: You received a pair of %I718!

@skipRegularReward	
	CALL @calculateGPReward

@resetgp2
	HOST_GIVE G#<gpgive>
	N: You also received #<gpgive> GP.
	HOST_GIVE T449
	1: I hope you can use this well.
	END
	
@calculateGPReward
	SET gpgive, "0"
	COMPARE #<gpgive>,"0"
	IF> @ban
	SET gpgive, #<ninmo>
	SUB gpgive, "45"
	MUL gpgive, "100"
	ADD gpgive, "%R5000"
	COMPARE #<gpgive>, "100000"
	IF> @resetgp
	RETURN 	
	
@resetgp
	SET gpgive, "100000"
	COMPARE #<gpgive>, "100000"
	IF> @ban
	RETURN
	
@back
	1: Welcome back #<g.ssir> %1.
	1: I'm afraid I don't have anymore trials for you right now.
	END
@notenough
	HOST_TAKE T447
	HOST_TAKE T448
	1: I'm afraid you didn't kill enough monsters to receive your reward, %1.
	1: You killed #<ninmo> in total.
	1: Do you wish to try again?
	ASK 300
	IF YES, @startitup
	1: Return later to me if try again.
	END
@toold
	1: I'm afraid your level is to high to do the Ninja Trial now #<g.ssir> %1.
	1: However I will allow you to visit the trial map.
	1: Just don't expect anything special to happen.
	HOST_GIVE T447
	END
@ban
	HOST_GIVE T172
	PARTY T172
	GOTO LINK 99,0,1
	
END



SCENE 1221, meadow, SCENE, "",0,0

SET slavaon, #<rating>	
#include banscripts.txt

	ACTOR 1, "Ninja",a95,4,-10,90

	EJECT T172
	IF GS, @gs
@end
	N: There is nothing here.
	END
@gs
	IF T430, @end
	IF T431, @end
	IF -T127,@end
	IF T444, @end
	IF T445, @end
	IF C9,   @end
	IF C4,   @end
	IF C7,   @end
	COMPARE #<num.peopleInScene>, "1"
	IF> @end

	MOVE 1,20,90
	WAIT 5.0
	1: I see you rejected the training of Fastom.
	1: Only those who are willing to train the hard way are worthy of becoming a %C36.
	IF T118, @gunslinger
	1: %1, do you wish to become a %C36?
	ASK 300
	IF YES, @morph
	HOST_GIVE T445
	1: Too bad.
	1: You would have made a perfect %C36.
	END
@morph
	WAIT 4.0
	SET num.hostClass, "36"
	HOST_GIVE H#<num.hostMaxHP>
	HOST_GIVE M#<num.hostMaxMP>
	HOST_GIVE T444
	HOST_TAKE S83
	HOST_TAKE S84
	1: You are now a %C36.
	1: We expect you to keep our name high.
	1: Try to get your hands/ elements levels and hunt radar up to level 9 so you are worthy to be called a %C.
	1: We might meet again later %1, right now I have to go.
	WAIT 4.0
	MOVE 1,-20,90
	END

@gunslinger
	1: However, you already walk a different path and thus you can not become a %C36.
	1: I wish you luck with your journeys.
	END


SCENE 1220, sky, CUT, "",0,7

	MUSIC CelesMix.mid
	STRCMP #<str.soul>, "SOUL 1373"
	IF= @special
	STRCMP "#<str.soul>", "SOUL 2189"
	IF= @seteveup
	EJECT T454
	END
@special
	SET candleh,"Jasper"
	SET candleskin,"silver2"
	SET candlehskin,"silver"
	SET candlep, "4"

	ASK 300
	SET candle, "#<lastAsk>"
	ASK 300
	SET dinnernu, "#<lastAsk>"

@startitnu
	ACTOR 1, "#<candleh>", #<candlehskin>,#<candlep>,80,95
	ACTOR 2, #<candle>, #<candleskin>,4,90,95
	ACTOR 3, "Waiter", silver2, 6,-30,90
	ACTOR 4, "",silver2,7,61,-100

	STRCMP #<candlehskin>, "silver"
	IF= @skippose1
	SEL 1
	POSE 1,2
@skippose1
	SEL 2
	POSE 3,4
	MOVE 1, -20,85
	MOVE 2,-20,90
	2: Where are we going to #<candleh>?
	1: Wait and see...
	WAIT 20.0

	BKGND silverplace
	WEATHER 0
	MOVE 3,92,64,1
	MOVE 4,61,100,1
	MOVE 2,76,100,1
	FACE 1,4
	MOVE 1,44,100,1
	1: SURPRISE!
	2: Wowww...
	WAIT 2.0
	MOVE 3,82,73
	WAIT 2.0
	MOVE 3,70,81
	WAIT 4.0
	3: Can I take your orders please?
	1: What would you like to have #<candle>?
	2: #<dinnernu> for me please.
	1: Hmmmm...
	1: #<dinnernu> sounds fine.
	1: Two times #<dinnernu> please.
	3: As you wish sir, milady.
	WAIT 3.0
	MOVE 3,110,76
	WAIT 5.0
	1: How do you like your evening so far?
	2: It is great so far.
	2: I wonder what more is coming.
	WAIT 5.0
	SEL 3
	POSE 5
	MOVE 3,65,83
	WAIT 8.0
	3: Dinner is ready.
	1: Thank you.
	WAIT 4.0
	MOVE 1,-44,100,1
	MOVE 2,-76,100,1
	MOVE 3,-65,83,1
	MOVE 4,-61,100,1
	BKGND sky
	WEATHER 7
	WAIT 3.0
	N: After a long and romantic dinner #<candleh> and #<candle> finally decide to go home.
	WAIT 7.0
	BKGND silverplace
	WEATHER 0
	MOVE 1,44,100,1
	MOVE 2,76,100,1
	MOVE 3,65,83,1
	MOVE 4,61,100,1
	1: Thank you for this most wonderful evening waiter.
	3: No problem sir, it was my pleasure.
	1: Let's go #<candle>, the night is still young.
	WAIT 5.0
	GOTO EXIT
@endnu1
	N: Aren't you missing somebody?
	WAIT 3.0
	GOTO EXIT
@endnu2
	N: Three is a crowd...
	WAIT 3.0
	GOTO EXIT
@seteveup
	COMPARE #<num.peopleInScene>, "2"
	IF< @endnu1
	EJECT T454

	N: This scene was specially added for Eve and Ulfric. ;-) 
	SET candleh,"Ulfric"
	SET candleskin,"silver2"
	SET candlehskin,"silver2"
	SET candlep, "2"

	SET candle, "Eve"
	SET dinnernu, "Chicken and green beans"
	GOTO @startitnu


; Comment: No Comments today!