; Made by Silver
;
; To make it easy on myself I deceided to simply include the RoT war script on the place where it belongs in SCENE 2. ^_^
; Getting to many scripts in there anyway right now. I estimate there will be near 500 script lines in SCENE 2, while this
; normally is only like 5 lines. (Well 5 lines in Evergreen that is.) You normally don't need much more then that.
;
; Anyway, the largest quest so far, I present you, the RoT WAR!
; Not that many people will ever read the crap I write down here anyways, but it's the idea that matters. >-P
;
; Hmm, where to start...
; Let's start with lunch, the script can wait! =D
; 
;
;
	IF -V50, @fightcommand
	LOCK 1
	EJECT V50

	SET checkrw, "0"
	COMPARE #<checkrw>, "0"
	IF< @S11
	IF> @S11
	SET checkrw, "1"
	COMPARE #<checkrw>, "1"
	IF< @S11
	IF> @S11

	SET nudfynt, #<nudfynl>
	ADD nudfynt, #<nudfynw>
	COMPARE #<nudfynt>, "99"
	IF= @rotwardone2
	IF> @rotwardone2
	COMPARE #<nudfynt2>,"99"
	IF= @rotwardone2
	IF> @rotwardone2	

	IF #0,  @rotworldmap
	IF #3,  @tajuinrock
	IF #11, @lock
	IF #13, @noremorse
	IF #29, @noremorse
	IF #23, @sacredplaines
	IF #24, @greendestiny
	IF #25, @neitherlands
	IF #26, @makustunner
	GOTO @fightcommand
@rotworldmap
	COMPARE #<nudfyn1>, "17"
	IF= @rotwardone
	IF> @rotwardone
	ADD nudfyn1, "1"
	GOTO @rottotalwar

@tajuinrock
	COMPARE #<nudfyn2>, "7"
	IF= @rotwardone
	IF> @rotwardone
	ADD nudfyn2, "1"
	GOTO @rottotalwar

@lock
	COMPARE #<nudfyn3>, "15"
	IF= @rotwardone
	IF> @rotwardone
	ADD nudfyn3, "1"
	GOTO @rottotalwar

@noremorse
	COMPARE #<nudfyn4>, "10"
	IF= @rotwardone
	IF> @rotwardone
	ADD nudfyn4, "1"
	GOTO @rottotalwar

@sacredplaines
	COMPARE #<nudfyn5>, "13"
	IF= @rotwardone
	IF> @rotwardone
	ADD nudfyn5, "1"
	GOTO @rottotalwar

@greendestiny
	COMPARE #<nudfyn6>, "12"
	IF= @rotwardone
	IF> @rotwardone
	ADD nudfyn6, "1"
	GOTO @rottotalwar

@neitherlands
	COMPARE #<nudfyn7>, "13"
	IF= @rotwardone
	IF> @rotwardone
	ADD nudfyn7, "1"
	GOTO @rottotalwar

@makustunner
	COMPARE #<nudfyn8>, "12"
	IF= @rotwardone
	IF> @rotwardone
	ADD nudfyn8, "1"
	GOTO @rottotalwar
@rotwardone
	IF T296, @rotwarempm
	N: There are no more rebels left to fight on this map!
	N: Move on to the next map!
	GOTO @fightcommand
@rotwarempm
	N: There are no more Imperial soldiers left to fight on this map!
	N: Move on to the next map!
	GOTO @fightcommand
@rotwardone2
	HOST_TAKE I2092
	IF T296, @rotwarempm2
	SET nudfynt, "99"
	SUB nudfynt, #<nudfynw>
	SET nudfynl, #<nudfynt>
	N: Looks like you took out all rebels.
	N: Time to report to Emperor Shinzobi!
	HOST_GIVE T412
	END
@rotwarempm2
	SET nudfynt, "99"
	SUB nudfynt, #<nudfynw>
	SET nudfynl, #<nudfynt>
	N: Looks like you took out all Imperial soldiers.
	N: Time to report to Warlord Keithuso!
	HOST_GIVE T412
	END
@rotwarintro
	ACTOR 1, "Kamatari", a22, 4,20,80
	POSE 4,3

	MENU "Follow introduction=@continuerotwarintro","Skip introduction=@skiprotwarintroduction"
	GOTO @rotwarintro

@continuerotwarintro
	1: Alright rookie, let me give you a general introduction about how you're supposed to fight this war.
	1: I know you have some field experience already, seeing you somehow managed to get to level #<num.hostLevel>.
	1: However, believe me, there is no better way to learn how to fight a battle than from a veteran like me.
	1: First of all, forget about taking them all on at once.
	1: You can't flee during this war since you'd be marked as a traitor.
	1: Not to mention you will automatically lose that battle if you decide to flee.
	1: There are only two ways to end a battle; either your side wins, or your side loses.
	1:  If you die and a comrade finishes the fight, then you still won; however, if everybody on your side is dead, then you lose.
	1:  I'll randomly assist you in the tough battles, but most of the battles you'll have to fight alone.
	1:  I'll be doing my fights in other places.
	1:  During battles you can't receive help from friends. 
	1: If you need their help, then be sure they're in your party before you enter the battle.
	1:  You'll have to fight a certain amount of battles on each map.
	1:  When you finish all the battles you were supposed to fight, a message will show up telling you that:
	1:  "There are no more enemies left to fight on this map," and you'll have to move on to the next map.
	1:  When you fought 99 battles a new message will appear and say that:
	1:  "There are no more enemies left to fight and you'll have to go to the enemy's main base."
	1:  Or something like that, heck, even my memory gets a little fuzzy at times.
	1:  You might want to check your own base first.
	1:  The total amount of battles you'll have to fight is 99, but some maps will require more battles than others.
	1:  I expect you to know the basics of combat by now, so I'll skip that explanation.
	1:  Just make sure that you're on full health before entering a battle, as most likely you'll need it.
	1: I think I hear the first enemies approaching!
	1: Let me restore your full HP and MP before they get here.
	WAIT 3.0
@skiprotwarintroduction
	GIVE L1
	GIVE H#<num.hostMaxHP>
	GIVE M#<num.hostMaxMP>
	MOVE 1,-30,90,2
	1: To help you out, I'll give you a %I2092 to check your progress during the war.
	HOST_GIVE I2092
	WAIT 2.0
	SET nudfynl, "0"
	SET nudfynw, "0"
	SET SET nudfynt, "0"
	N: You received the %I2092.
	WAIT 2.0
	1: Good luck with your battles, %1!
	WAIT 3.0
	GOTO @rottotalwar2

@rottotalwar
	COMPARE #<nudfynt2>, "0"
	IF= @rotwarintro
@rottotalwar2
	ADD nudfynl, "1"
	IF T295, @rotwarfightrebels

@rotwarfightemps
	SET rwch, "%R20"
	GOTO @rotfightemp#<rwch>

@rotwarfightrebels
	SET rwch, "%R20"
	GOTO @rotfightrebels#<rwch>

@rotfightemp1
	IF -T331, @rotfightemp1a
	N: You receive help from a %M661!
	SET rotwarA, "-661"
@rotfightemp1b
	FIGHT2 656,660,660, #<rotwarA>
	GOTO @afterFight

@rotfightemp1a
	N: You receive assistance from a %M651!
	SET rotwarA, "-651"
	GOTO @rotfightemp1b

@rotfightemp2
	FIGHT2 656
	GOTO @afterFight

@rotfightemp3
	FIGHT2 658,660,660
	GOTO @afterFight

@rotfightemp4
	FIGHT2 657,660
	GOTO @afterFight

@rotfightemp5
	FIGHT2 660,659,659
	GOTO @afterFight

@rotfightemp6
	FIGHT2 660,659
	GOTO @afterFight
	
@rotfightemp7
	FIGHT2 660
	GOTO @afterFight

@rotfightemp8 
	FIGHT2 659
	GOTO @afterFight

@rotfightemp9
	FIGHT2 658
	GOTO @afterFight

@rotfightemp10
	IF T264, @rotfightemp10a
	SET rotwarA, "662" 
@rotfightemp10b
	IF R40, @rotfightemp10c
	SET rotwarB, "-650"
	N: You receive assistance from a %M650!
@rotfightemp10e
	N: You receive help from %M663!
	FIGHT2 #<rotwarA>,#<rotwarB>,-663,656,656,656
	GOTO @afterFight

@rotfightemp10a
	SET rotwarA, 656
	GOTO @rotfightemp10b
@rotfightemp10c
	IF -T331, @rotfightemp10e
	SET rotwarB, "-661"
	N: You receive help from a %M661!
	GOTO @rotfightemp10e

@rotfightemp11
	FIGHT2 656,659,659
	GOTO @afterFight

@rotfightemp12
	N: You receive help from %M663!
	FIGHT2 657,657,658,658,-663
	GOTO @afterFight

@rotfightemp13
	FIGHT2 658,659,660
	GOTO @afterFight

@rotfightemp14
	FIGHT2 657,659,659
	GOTO @afterFight

@rotfightemp15
	FIGHT2 657,659
	GOTO @afterFight

@rotfightemp16
	FIGHT2 656,660
	GOTO @afterFight

@rotfightemp17
	FIGHT2 659,659,660
	GOTO @afterFight

@rotfightemp18
	FIGHT2 658,658,658, 
	GOTO @afterFight

@rotfightemp19
	N: You receive assistance from a %M652!
	FIGHT2 660,660,660,659,-652
	GOTO @afterFight

@rotfightemp20
	N: You receive assistance from 2 %M653s!
	FIGHT2 659,657,658,-653,-654
	GOTO @afterFight

@rotfightrebels1
	IF -T331, @rotfightrebels1a
	SET rotwarA, "-661"
	N: You receive help from a %M661!
@rotfightrebels1b
	FIGHT2 650,651,651,#<rotwarA>
	GOTO @afterFight

@rotfightrebels1a
	SET rotwarA, "-658"
	N: You receive assistance from a %M658!
	GOTO @rotfightrebels1b

@rotfightrebels2
	FIGHT2 652,653,654
	GOTO @afterFight

@rotfightrebels3
	FIGHT2 651,654
	GOTO @afterFight

@rotfightrebels4
	FIGHT2 651,655
	GOTO @afterFight

@rotfightrebels5
	FIGHT2 654
	GOTO @afterFight

@rotfightrebels6
	FIGHT2 653
	GOTO @afterFight

@rotfightrebels7
	FIGHT2 650
	GOTO @afterFight

@rotfightrebels8
	FIGHT2 651
	GOTO @afterFight

@rotfightrebels9
	FIGHT2 652
	GOTO @afterFight

@rotfightrebels10
	FIGHT2 655,654
	GOTO @afterFight

@rotfightrebels11
	IF T331, @rotfightrebels11a
	SET rotwarA, "-657"
	N: You receive assistance from a %M657!
	IF -T264, @rotfightrebels11c 
	SET rotwarB, "-656"
	N: You receive assistance from a %M656!
@rotfightrebels11b
	N: You receive help from %M663!
	FIGHT2 650,651,652,653,654,655,655,#<rotwarA>,#<rotwarB>,-663
	GOTO @afterFight

@rotfightrebels11a
	SET rotwarA, "-661"
	N: You receive help from a %M661!
	GOTO @rotfightrebels11b
@rotfightrebels11c
	N: You receive help from %M662!
	SET rotwarB, "-662"
	GOTO @rotfightrebels11b

@rotfightrebels12
	IF -T264, @rotfightrebels12a
	SET rotwarA, "-656"
	N: You receive assistance from a %M656!
@rotfightrebels12b
	FIGHT2 651,651,652,652,#<rotwarA>
	GOTO @afterFight

@rotfightrebels12a
	N: You receive help from %M662!
	SET rotwarA, "-662"
	GOTO @rotfightrebels12b

@rotfightrebels13
	N: You receive assistance from a %M659!
	FIGHT2 653,653,654,655,-659
	GOTO @afterFight

@rotfightrebels14
	FIGHT2 651,652
	GOTO @afterFight

@rotfightrebels15
	FIGHT2 653,654
	GOTO @afterFight

@rotfightrebels16
	N: You receive help from %M663!
	FIGHT2 652,652,653,-663
	GOTO @afterFight

@rotfightrebels17
	FIGHT2 653,655
	GOTO @afterFight

@rotfightrebels18
	FIGHT2 654,655
	GOTO @afterFight

@rotfightrebels19
	FIGHT2 652
	GOTO @afterFight
	
@rotfightrebels20
	FIGHT2 651,651
	GOTO @afterFight
	
@afterFight
	SET nudfynt2,#<nudfyn1>
	ADD nudfynt2,#<nudfyn2>
	ADD nudfynt2,#<nudfyn3>
	ADD nudfynt2,#<nudfyn4>
	ADD nudfynt2,#<nudfyn5>
	ADD nudfynt2,#<nudfyn6>
	ADD nudfynt2,#<nudfyn7>
	ADD nudfynt2,#<nudfyn8>	
	CALL 984@rewardMissionPP		
	IF WIN, @rotwonfight	
	CALL 5198@gunslingerCPRAndAfterFightQuotes
	GOTO SCENE 1

@rotwonfight
	SUB nudfynl, "1"
	ADD nudfynw, "1"
	SET randomg, "%R1000"
	ADD randomg, "1000"
	COMPARE #<randomg>, "2000"
	IF> @S11
	N: You earn #<randomg> additional gold coins.
	HOST_GIVE G#<randomg>
	IF C2,  @automphealwar
	IF C17, @automphealwar
	IF C18, @automphealwar
	IF C23, @automphealwar
	IF C44, @automphealwar
	IF R1-T540, @kinoaprotest
	IF R1-T541, @soldierprotest
	CALL 5198@gunslingerCPRAndAfterFightQuotes	
	GOTO SCENE 1
	
@automphealwar
	HOST_GIVE M#<num.hostMaxMP>
	IF R1-T540, @kinoaprotest
	IF R1-T541, @soldierprotest
	GOTO SCENE 1

@kinoaprotest
	IF T227, @skipkinoa
	ACTOR 1, "Kinoa",a18, 1, -20,92	
	MOVE 1,20,92
	WAIT 4.0
	1: Oh my gosh!
	1: You MONSTER!	
	1: You killed my second husband!
	MOVE 1,-30,92,2
	WAIT 3.0
	N: You watch Kinoa run away sobbing.
	HOST_GIVE T540
	WAIT 4.0
@skipkinoa
	GOTO SCENE 1

@soldierprotest
	IF T295, @rebelprotest
	ACTOR 1, "Imperial Soldier", a49, 1, -20,90
	MOVE 1,20,90
	WAIT 3.0
	SEL 1
	POSE 4
	1: Yeah, yeah... 
	1: I guess you want to kill me too now, huh?
	H: That's the idea.
	1: Yeah well, it won't work you know?
	H: And why is that?
	1: Because, eh-...
	1: Because, I know a good joke that you absolutely want to hear?
	H: Ah, ah...
	H: Nope, that won't work.
	1: Well...
	MOVE 1,-20,90,2
	WAIT 2.0
	N: You watch the Imperial Soldier run like hell to save his own hide!
	WAIT 3.0
	H: Pfft, imperial scum.
	GOTO @soldierprotestend
@rebelprotest
	ACTOR 1, "Rebel Soldier", a37, 1, -20,90
	MOVE 1,20,90
	WAIT 3.0
	SEL 1
	POSE 4
	1: Awww, geez man!
	1: It's just sick to kill us like that!
	1: Don't you have any mercy at all!?
	H: Ehm, no?
	H: Oh, and hey... 
	H: ! YOU'RE NEXT!
	1: ! AHHHHH!!
	WAIT 2.0
	MOVE 1,-20,90,2
	WAIT 3.0
	H: Rebel whimp...
@soldierprotestend
	WAIT 4.0
	HOST_GIVE T541
	GOTO SCENE 1


; Comment: War... what is it really good for?
