; Made by Silver for RoT
;
; New generation of test scripts, scenes up to scene ID 4000 will be used for it.
;
; note: level omhoog skippen, uren herinstellen.

; scene 4999 and 4998 are taken in qs2001.txt


; 
SCENE 4000

#include publickey.txt
#include proxbeta.txt
END


SCENE 4001

@wait
	N: 5 second wait initiated
	WAIT 5.0
	RETURN	
	END


SCENE 4002, bunkermesshall, SCENE 

	COMPARE #<888test>, 0
	IF> @skip
	SET 888test, %R4
	N: 888test is set: #<888test>
	END
@skip
	N: skipped it
	RETURN
	END
	
	CALL @challengeWarning
	N: CONTINUE
	END

@challengeWarning
	IF V29-V30-S35|V39-V40-S65|V49-V50-S95|V59-V60-S115|V69-V70-S135|V79-V80-S155|V89-V90-S175, @challengeWarningGive
	RETURN

@challengeWarningGive
	IF T5, @end
	N: Warning: you didn't do the level #<num.hostLevel> Challenge yet to earn a summon spell.
	RETURN

@end
	RETURN

END


	
	
SCENE 4003

	ACTOR 1, "Hit me!", a24, 4, 50, 79

	END
	
@eventActorSpell1	
	1: You hit me with %S#<spell.id>, how dare you!
	END


SCENE 4101, aaaleft, SCENE, "test"

	actor 1, "buzz kill", staticactors, 13, 50, 50
	
	END

@eventActorClick1	
	MENU "attempt this=4102@itworked"
	N: It didn't work
	END
	



SCENE 4102, , CUT

	bkgnd aaatajuin

	end
@itworked
	N: It worked!
	RETURN
	
	BKGND aaaleft
	GOTO scene 4102
	N: it worked!
	END

SCENE 4109, 

;	CALL 4102@eventHostGive
	END

	N: You clicked yourself
	END

@eventHostSpell
	N: YOu cast a spell on yourself
	END
	
	
	
SCENE 4108,	gunrange, CUT, "Dream"


	END

@eventHostClick


	ACTOR 1, "Gloom Reaper 1", gun016, 4, 20, 80
	ACTOR 2, "Gloom Reaper 2", gun016, 4, 30, 80, 1
	ACTOR 3, "Gloom Reaper 3", gun016, 4, 40, 80, 2
	ACTOR 4, "Gloom Reaper 4", gun016, 4, 50, 80, 4
	ACTOR 5, "Gloom Reaper King", gun016, 4, 60, 80, 5
	ACTOR 6, "Gloom Reaper 6", gun016, 4, 70, 80, 6
	ACTOR 1, "Gloom Reaper 7", gun016, 4, 80, 80, 26



	END


SCENE 4105
	FIGHT 120, 121, 122
	SET monsterCount, #<monster.lastFightCount>
	SET monsterAverage, 0

@calculateTotalMonsterLevel	
	COMPARE #<monsterCount>, "1"
	IF< @continuePPReward
	SET foughtMonster, "monster.lastFightId#<monsterCount>"
	SET monster.id,	"*#<foughtMonster>"
	ADD monsterAverage,	#<monster.level>		
	SUB monsterCount, 1
	GOTO @calculateTotalMonsterLevel
	
@continuePPReward
	DIV monsterAverage, #<monster.lastFightCount>
	SET temp, #<num.hostLevel>
	SUB temp, 2
	COMPARE #<monsterAverage>, #<temp>
	IF< @noReward
	
	COMPARE #<num.peopleInScene>, 1
	IF> @rewardPP1
	
	SET temp, #<num.HostLevel>
	ADD temp, 2
	COMPARE #<monsterAverage>, #<temp>
	IF> @rewardPP2
	GOTO @rewardPP1

@rewardPP1
	COMPARE #<monster.lastFightCount>, 1
	IF> @rewardPP1plural
	GIVE Z1.#<monster.lastFightCount>
	N: You received 1 %Z1.
	END

@rewardPP1plural
	HOST_GIVE Z1.#<monster.lastFightCount>
	N: You received #<monster.lastFightCount> %Z1s.
	END

@rewardPP2
	SET temp, #<monster.lastFightCount>
	MUL temp, 2
	HOST_GIVE Z1.#<temp>
	N: You received #<temp> %Z1s.

	END




SCENE 4998, vamp11, SCENE,"Ban script check",0,0,0

#include banscripts.txt

GOTO @skipthisline
@S11
	N: You were banned.
	END
@skipthisline

	N: Not banned, char is okay.
	END

SCENE 4999, vamp11,SCENE,"Basic camp scene",0,0,0
#include banscripts.txt
END

; Two basic test scenes.

SCENE 4100

	ASK	300

	SET terminalText, "Enter your input here:"

	SET text, "#<terminalText> #<lastAsk>"

	; determine concatonation
	N: text = '#<text>'
	END
	
	
SCENE 4101, check

	FLAGS 192
	
	ACTOR 12, "", circuitbuttons, 16, 50, 80
	ACTOR 13, "", circuitbuttons, 17, 70, 80


	ACTOR 16.2, "", gun64px, 49, 51, 55
	ACTOR 17.3, "", stealth2, 7, 51, 53
	ACTOR 18.4, "", abcall, 49, 51, 51
	ACTOR 19.-1, "", background, 0, 0, 0
	
	END

@eventActorClick16
@eventActorAttack16
	N: HIT 16: at #<num.hostX>, #<num.hostY>
	END
	
@eventActorClick17	
@eventActorAttack17	
	N: HIT 17: #<num.hostX>, #<num.hostY>
	END

@eventActorClick18	
@eventActorAttack18
	N: HIT 18: #<num.hostX>, #<num.hostY>
	END
	
@eventActorClick19
	SET 


SCENE 4102, check

	ACTOR 1, "up", circuitbuttonsup, 6, 50, 20
	POSE 6, 36
	
	ACTOR 2, "left", circuitbuttonsleft, 6, 20, 50
	POSE 6, 36

	ACTOR 3, "right", circuitbuttonsright, 6, 80, 50
	POSE 6, 36

	ACTOR 4, "down", circuitbuttonsdown, 6, 50, 80
	POSE 6, 36
	END
	
@eventActorClick1
	SEL 1
	POSE 7, 37
	END
	
@eventActorClick2
	SEL 2
	POSE 7, 37
	END
	
@eventActorClick3
	SEL 3
	POSE 7, 37
	END	

@eventActorClick4
	SEL 4
	POSE 7, 37
	END	

SCENE 4103

	SET poseActor1, "33"
	SET clicked, "1"

	SET temp, "poseActor#<clicked>"
	N: temp 1: #<temp>

	SET temp, *#<temp>
	N: temp2: #<temp>
	END

SCENE 4104
	
	ACTOR 4, "Howdy", boss026, 4, 20, 80
	ACTOR 5, "Hha", boss025, 4, 30, 80
	
	
	SET test, 4
	4: howdy talks
	5: hha talks
	#<test>: test talks
	#<test


	END
	


SCENE 4026, vamp11,SCENE,"",0,0,0
#include banscripts.txt

	FLAGS 0
	N: FLAGS = 0 num.mapFlags = #<num.mapFlags>
	FLAGS 256
 	N: FLAGS = 256 num.mapFlags = #<num.mapFlags>

	END


SCENE 4025, vamp11,SCENE,"",0,0,0
#include banscripts.txt

	ACTOR 1, "Exantiroja", boss015, 4, 40,95

	OFFER2 16,16,0
	END

@eventActorGive1
	COMPARE #<item.id>, "771"
	IF= @regainconsious
	COMPARE #<item.id>, "102"
	IF> @beersong2
@nobeer
	IF -R10, @end
	1: Thank you.
	1: I have no idea what I'm supposed to do with this...
	1: But thank you.
	END
@eventActorclick1
	COMPARE #<beersong>, "1"
	IF= @unconsious

	MENU 	"Change Exantiroa's skin=@changeskin","Change background=@changebackground","Change music=@changemusic","Change theme sound=@changetheme","Change color=@changecolor","Change weather=@changeweather","Change fx=@changefx","What is this place?=@explaining","Beer Song=@beersong","Cancel=@end"
	GOTO @eventActorclick1

@beersong
	1: To play the %I104 song with me just give me either %I104, %I106, %I108, %I110 or %I111 and we'll keep singing till we drop unconscious.
	1: Sounds like fun doesn't it?
	1: As long as you don't get me a major hangover tomorrow morning...
	1: Just feed me some %I771 if I'm unable to do anything anymore!
	1: %I771 neutralize the effect alcohol has on me.
	END

@beersong2
	COMPARE #<item.id>, "112"
	IF< @nobeer
	COMPARE #<beersong>, "0"
	IF< @startsong
	IF= @startsong
	COMPARE #<beersong>, "1"
	IF= @unconsious
	COMPARE #<beersong>, "2"
	IF= @lostconsiousness
	COMPARE #<beersong>, "26"
	IF< @drunk4
	COMPARE #<beersong>, "51"
	IF< @drunk3
	COMPARE #<beersong>, "76"
	IF< @drunk2
	GOTO @drunk1

@drunk1
	1: #<beersong> of bottles of #<item.name> on the wall, #<beersong> of #<item.name>,
	SUB beersong, "1"
	1: You take 1 down, pass it around, #<beersong> bottles of #<item.name> on the wall!
	END
@drunk2
	1: #<beersong> off bottless off #<item.name> on the wall, #<beersong> off #<item.name>,
	SUB beersong, "1"
	1: You take 1 down, pass it around, #<beersong> bottless off #<item.name> on the wall!
	END
@drunk3
	SET_LEN beerA, #<item.name>
	SET beerB,	#<beerA>
	SUB beerA, "1"
	SET_SUBSTR beerX, #<beerA>,#<beerB>,#<item.name>
	1: #<beersong> o' bottless o' #<item.name>#<beerX>#<beerX> on um... the wall, #<beersong> o' #<item.name>#<beerX>#<beerX>#<beerX>,
	SUB beersong, "1"
	1: ya take 1 um... down, pass i' around, #<beersong> bottles o' #<item.name>#<beerX>#<beerX> uh... on um... the <hic> wall!
	END
@drunk4
	SET_LEN beerA, #<item.name>
	SET beerB,	#<beerA>
	SUB beerA, "1"
	SET_SUBSTR beerX, #<beerA>,#<beerB>,#<item.name> 
	1: #<beersong> o' bottless <hic> o' #<item.name>#<beerX>#<beerX>#<beerX>#<beerX> on um... the wall, um... #<beersong> o' #<item.name>#<beerX>#<beerX>#<beerX>#<beerX>,
	SUB beersong, "1"
	1: ya take 1 um... down, passs i' arrround, #<beersong> uh... bottless um... o' uh... #<item.name>#<beerX>#<beerX>#<beerX>#<beerX> uh... <burp> on um... um... he... the <hic> wall!
	END

@startsong
	SET beersong, "100"
	1: #<beersong> of bottles of #<item.name> on the wall, #<beersong> of #<item.name>,
	SUB beersong, "1"
	1: You take 1 down, pass it around, #<beersong> bottles of #<item.name> on the wall!
	END
	
@lostconsiousness
	SET_LEN beerA, #<item.name>
	SET beerB,	#<beerA>
	SUB beerA, "1"
	SET_SUBSTR beerX, #<beerA>,#<beerB>,#<item.name>
	1: 2 bottles o' #<item.name>#<beerX>#<beerX>#<beerX>#<beerX> on the ..the wall, 2 bottles o' #<item.name>#<beerX>#<beerX>#<beerX>#<beerX>, ya take 1 down, 
	1: ya passss i' um... arrround, 1 bottle o' #<item.name>#<beerX>#<beerX>#<beerX>#<beerX> on the wall!
	1: 1 <hic> bottle <burp> o' #<item.name>#<beerX>#<beerX>#<beerX>#<beerX> on the wall, ya take <hic> 1 down, errr... <hic> passs uh... i' around, 
	1: uh... no bottless o' #<item.name>#<beerX> errr... on errr... the <hic> wall!
	1: No bottle o' #<item.name>#<beerX>#<beerX>#<beerX>, no bottles o' #<item.name>#<beerX>#<beerX>#<beerX>#<beerX>. 
	1: Go to the <burp> sstore, n' buy sshome more. 
	SET beersong, "1"
	1: <hic> 100 bottles o' #<item.name>#<beerX>#<beerX>#<beerX>#<beerX> on the wall!
	WAIT 5.0
	1: My head, no' feeling to errrrr... well...
	WAIT 3.0
	N: Exantiroja lost his consiousness!
	N: Feed him %I771 to neutralize the effect of the alcohol!
	END

@unconsious
	N: Exantiroja is unconsious!
	N: Feed him %I771 to neutralize the effect of all the alcohol on him!
	END

@regainconsious
	SET beersong, "0"
	1: Ahhhh!
	1: I'm feeling so much better already, thanks.
	1: Just eh... 
	1: Keep your voice low till my head stops pounding please...
	END



SCENE 4024, vamp11,SCENE,"",0,0,0
#include banscripts.txt

SET test1, S198

	IF #<test1>, @suc
	IF -#<test1>,@bad
	N: Test failed
	END
@bad
	N: You do not have %#<test1>.
	END
@suc
	N: You have %#<test1>
	END


END

SCENE 4023, vamp11,SCENE,"",0,0,0
#include banscripts.txt

	FLAGS	2048
@muchmoreksjaie
	SET k1, 220%R9
	SET k2, 220%R9
	SET k3, 220%R9
	SET k4, 220%R9
	SET kkilled, 0
	ADD kkilled, "%K2201"
	ADD kkilled, "%K2202"
	ADD kkilled, "%K2203"
	ADD kkilled, "%K2204"
	ADD kkilled, "%K2205"
	ADD kkilled, "%K2206"
	ADD kkilled, "%K2207"
	ADD kkilled, "%K2208"
	ADD kkilled, "%K2209"
	COMPARE #<kkilled>, 5
	IF< @normalkjaie
	IF R5 @fightlordscriptjaie
	GOTO @normalkjaie

@normalkjaie
	IF R45, @fight1kjaie
	IF R35, @fight2kjaie
	IF R15, @fight3kjaie
	IF R5, @fight4kjaie
	GOTO @normalkjaie

@fight1kjaie
	FIGHT #<k1>
	GOTO @finalend

@fight2kjaie
	FIGHT #<k1>, #<k2>
	GOTO @finalend

@fight3kjaie
	FIGHT #<k1>, #<k2>, #<k3>
	GOTO @finalend

@fight4kjaie
	FIGHT #<k1>, #<k2>, #<k3>, #<k4>
	GOTO @finalend

@fightlordscriptjaie
	FIGHT2 2210
	IF WIN @wonlordkjaie
	GOTO @finalend

@wonlordkjaie
	IF V55, @finalend
	IF T2029, @finalend
	IF T2028, @onekagobloodjaie
	HOST_GIVE T2028
	HOST_GIVE I8
	N: You found a %I8!
	GOTO @finalend

@onekagobloodjaie
	HOST_GIVE T2029
	HOST_GIVE I8
	N: You found a %I8!
	GOTO @finalend

@endkscriptjaie
@finalend
	END



; scene 4022 is taken

SCENE 4021, vamp11,SCENE,"",0,0,0
#include banscripts.txt

	IF #0, @mapzero
	N: no luck
	END
@mapzero
	N: luck
	END


SCENE 4020, vamp11,SCENE,"",0,0,0
#include banscripts.txt

	IF T999, @succes
	N: failed
	END
@succes
	N: succes
	END
@eventHostgive
	COMPARE #<item.id>,761
	IF= @succes2
	N: something gone wrong
	END
@succes2
	N: it works!
	END


SCENE 4019, vamp11,SCENE,"",0,0,0
#include banscripts.txt

	SET slavaon, "-220"

	SET slavaov1, #<slavaon>
	COMPARE #<slavaov1>, "-200"
	IF> @S11b
	SET slavaon, "0"
	SET slavaov1,"-%R500"
@slavaover1a

	SET slavaon, "220"

	SET slavaov2, #<slavaon>
	COMPARE #<slavaov2>, "200"
	IF< @S11c
	SET slavaon, "0"
	SET slavaov2,"%R500"
@slavaover2a

	N: not banned
	END

@S11b
	N: banned in A.
	END
@S11c
	N: banned in B.
	END



SCENE 4018, sky,SCENE,"",0,0,0
#include banscripts.txt

; Made by Sekuna for RoT.  This is basically the randomness for the werewolf quest. Does not make for a very good read ;)
; tokens 2030-2036, scenes 1400-1402

	IF T2033 @endscript6969
	IF T2031 @neitherwere
	IF T2032 @endscript6969
	IF T2030 @endscript6969
	IF C11 @werewolf1
	GOTO @endscript6969

@werewolf1
	COMPARE #<num.mapNum>, 23
	IF= @werewolf2
	GOTO @endscript6969

@werewolf2
	COMPARE #<num.serverTimeHour>, 18
	IF> @werewolf
	IF= @werewolf

	COMPARE #<num.serverTimeHour>, 6
	IF< @werewolf
	GOTO @endscript6969

@werewolf
	IF R10 @introwerewolf
	GOTO @endscript6969

@introwerewolf
	GOTO SCENE 1400

@neitherwere
	IF C11 @werewolf3
	GOTO @endscript6969

@werewolf3
	COMPARE #<num.mapNum>, 25
	IF= @werewolf4
	GOTO @endscript6969

@werewolf4
	COMPARE #<num.serverTimeHour>, 17
	IF> @werewolf5

	COMPARE #<num.serverTimeHour>, 6
	IF< @werewolf5
	GOTO @endscript6969

@werewolf5
	IF -V20+R10, @fightwere
	GOTO @endscript6969

@fightwere
	EJECT T172
	FIGHT 2002
	COMPARE #<KM.2002>, 5
	IF= @donewere
	GOTO @finalend

@donewere
	EJECT T172
	HOST_GIVE T2033
	IF V20, @rewardnormalwere
	COMPARE #<num.hostKills>, 300
	IF> @rewardnormalwere
	COMPARE #<num.hostDeaths>, 0
	IF> @rewardnormalwere
	COMPARE #<num.hostPets>, 1
	IF> @rewardnormalwere
	IF< @rewardnormalwere
	SET werelevel, #<num.hostLevel>
	SUB werelevel, "1"
	COMPARE #<num.hostPetLevel>, #<werelevel>
	IF< @rewardnormalwere
	IF T2033+T2031+T2030+T127, @donewere2
	GOTO @endscript6969

@donewere2
	IF -V15, @werechance1
	IF R20, @turnwolf
	GOTO @rewardnormalwere

@werechance1
	COMPARE #<num.hostKills>, 120
	IF< @werechance2
	IF R20, @turnwolf
	GOTO @rewardnormalwere

@werechance2
	IF -GS, @werechance16a
	IF R65, @turnwolf
	GOTO @rewardnormalwere
@werechance16a
	IF R60, @turnwolf
	GOTO @rewardnormalwere

@turnwolf
	GOTO SCENE 1402

@rewardnormalwere
	GOTO SCENE 1403

@endscript6969

;
;ik hou heeeeel veeeel van jasper!
;
@finalend

END


SCENE 4017, vamp11,SCENE,"",0,0,0
#include banscripts.txt

	SET unico, #<unica>
	N: unico = #<unico>
	ADD unico, 1
	N: unico = #<unico>
	END


SCENE 4016, vamp11,SCENE,"",0,0,0
#include banscripts.txt

	ACTOR 1, "test",pet012, 4, 20,80,2

END
@test
	N: success
	END


SCENE 4015, vamp11,SCENE,"",0,0,0
#include banscripts.txt

@vampslayerfinish
	MOVE 1,30,77,1
	1: My %I2143!
	1: You destroyed it!
	H: Yeah and now I'm going to put a %I2144 in your undead heart as well!
	WAIT 3.0
	N: You kill Count Ixion by staking him on a very painful way!
	WAIT 2.0
	MOVE 1,-30,77,1
	WAIT 3.0
	N: Search Haven to see if you can find the %I2146.
	ACTOR 7, "Hiding Place 1", stealth, 4,38,71
	ACTOR 8, "Hiding Place 2", stealth, 4,58,71
	ACTOR 9, "Hiding Place 3", stealth, 4,22,51
	ACTOR 10, "Hiding Place 4", stealth, 4,72,51
	SET rsearch, "%R4"
	END

@eventActorClick7
	COMPARE #<rsearch>, "1"
	IF= @vampslayerfinish2
	N: Nothing here...
	N: Keep searching though!
	WAIT 5.0
	END
@eventActorClick8
	COMPARE #<rsearch>, "2"
	IF= @vampslayerfinish2
	N: Nothing here...
	N: Keep searching though!
	WAIT 5.0
	END
@eventActorClick9
	COMPARE #<rsearch>, "3"
	IF= @vampslayerfinish2
	N: Nothing here...
	N: Keep searching though!
	WAIT 5.0
	END
@eventActorClick10
	COMPARE #<rsearch>, "4"
	IF= @vampslayerfinish2
	N: Nothing here...
	N: Keep searching though!
	WAIT 5.0
	END

@vampslayerfinish2
	N: You find the %I2146!
	WAIT 3.0
	HOST_GIVE I2146
	HOST_GIVE T599
	HOST_GIVE T595
	H: I guess I don't have much use of this anymore, but better late then never...
	ACTOR 5, "Priest", devil, 4, 110,90,5
	MOVE 5,80,90
	5: You found the %I2146?
	H: Yes I did...
	H: But how did you get in?
	5: The members of the Slayer Agency killed all the ghouls, there isn't any of them left now.
	5: By killing Count Ixion we only have 2 %C31 factions left to deal with.
	5: Things will return to a more peaceful state hopefully.
	1: So what can I do with the %I2146?
	5: This Amulet heals you after all normal fights completely if you have it equiped, it's very useful.	
	H: That will be very useful indeed...
	5: I better head back to the Cathedral, 
	5: I still do not feel very comfortable in this house of damnation.
	MOVE 5,120,90
	WAIT 10.0
	GOTO EXIT


SCENE 4014, vamp01,SCENE,"",0,0,0
#include banscripts.txt

	GOTO @test_1
	N: failure
	END
@test_1
	N: success
	END

SCENE 4013, vamp01,SCENE,"",0,0,0
#include banscripts.txt

	WAIT 1.0
	TAKE T575
	TAKE T576
	TAKE T577
	TAKE T578
	TAKE T579
	TAKE T580
	TAKE T581
	TAKE T582
	TAKE T583
	TAKE T584
	TAKE T585
	TAKE T586
	TAKE T587
	TAKE T588
	TAKE T589
	TAKE T590
	TAKE T591
	TAKE T592
	TAKE T593
	TAKE T594
	TAKE T595
	TAKE T596
	TAKE T597
	TAKE T598
	N: It is done!
	GOTO EXIT

SCENE 4012, vamp01,SCENE,"",0,0,0
#include banscripts.txt

	OFFER2 9,16
	END

SCENE 4011, vamp01,SCENE,"",0,0,0
#include banscripts.txt

	ACTOR 1 "test",silver,4,20,80,1000

	END


SCENE 4010
#include banscripts.txt

FLAGS 2048

@fightgorgath
	N: Gorgath is attacking you with his army!
	EJECT 172
	LOCK 1
	FIGHT2 1507,1507,1507,1507,1507,1507,1507,1507,1507,1508
	IF WIN, @gorgathjoin
	ACTOR 4, "Gorgath", summon1, 4, -20, 80
	4: Soa poawerful toa gain all summoans, yet noat be able toa beat me eh?
	4: Yoau are noat woarthy oaf such poawer %1!
	WAIT 5.0
	GOTO EXIT
@gorgathjoin
	ACTOR 4, "Gorgath", summon1, 4, -10, 80

	MOVE 4, 20,90
	SEL 4
	POSE 1,4
	WAIT 3.0
	4: I had toa see foar myself...
	4: Yoau are truly a summoan master!
	4: I wish toa joain yoau master...
	WAIT 3.0
	HOST_GIVE S265
	N: %M1507 joined you!
	GOTO @finalend
	
END

SCENE 4009, ,CUT,
#include banscripts.txt

	SET cookie1, "1"
	ACTOR 3, "click", proxbeta, 3, 50, 50
	END

@eventActorClick3
	IF R1, @won
	SET x, "10"
	ADD x, "%R80"
	SET y, "10"
	ADD y, "%R80"
	MOVE 3, #<x>, #<y>, 1
	ADD cookie1, "1"
	N: #<cookie1> Clicks!
	END
@won
	N: You won!
	MOVE 3,-100,0,1
	END


SCENE 4008
#include banscripts.txt

	SET cookieABC, "205%R5"
	GIVE I#<cookieABC>
	N: %I#<cookieABC> given.
	END

scene 4007
#include banscripts.txt

	SET app, 1
	SET kol, 2
	SET CH1, app
	SET CH2, kol
	COMPARE "*#<CH1>", "*#<CH2>"
	IF> @a
	IF= @b
	IF< @c
	N: Error!
	END
@a
	N: cookie 1 is larger then cookie 2.
	END
@b
	N: cookie 1 equals cookie 2.
	END
@c
	N: cookie 1 is smaller then cookie 2.
	END

scene 4006

	OFFER2 50,50, 12
	END

scene 4005

#include merchant2.txt	
END


scene 4004

@merchant
ACTOR 4 "Master Merchant", monster029, 4, 20,80
	LOCK 1
	IF C10,@mastermerch
	IF C51,@mastermerch
	IF C52,@mastermerch
	4: Hi there.
	4: I am the Master Merchant.
	4: I offer all useful items 5 levels above and 5 levels below your own level.
@masteroffer
	SET clevel, #<num.hostLevel>
	SET clevel1,#<clevel>
	SUB clevel1, "5"
	SET clevel2,#<clevel>
	ADD clevel2, "5"
	COMPARE #<clevel1>, "0"
	IF> @mastercheck
	SET clevel1, "1"
	COMPARE #<clevel2>, "100"
	IF< @mastercheck 
	SET clevel2, "99"

;	OFFER2 #<clevel1>,#<clevel2>, 
;	#<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23,
#include weaponscriptb.txt
@masterall
	OFFER2 #<clevel1>,#<clevel2>
	END
@master1
	OFFER2 #<clevel1>,#<clevel2>,12, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master2
	OFFER2 #<clevel1>,#<clevel2>,13, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master3
	OFFER2 #<clevel1>,#<clevel2>,14, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master4
	OFFER2 #<clevel1>,#<clevel2>,15, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master5
	OFFER2 #<clevel1>,#<clevel2>,16, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master6
	OFFER2 #<clevel1>,#<clevel2>,17, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master7
	OFFER2 #<clevel1>,#<clevel2>,18, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
	
@mastermerch
	IF T251, @masterfinished
	4: I see you are a fellow %C10.
	4: It is for me a great honor to meet you, your reputation went ahead of you.
	4: Do you happen to have a %I952 for me?
	IF -I952,@masterno
	H: Actually yes, I have a %I952 with me.
	4: Nice, I have been looking over for one everywhere!
	4: I will offer you 50,000 GP if you sell it to me.
	4: Will you sell it?
	ASK 300.0
	IF YES, @masteryes1
	4: To bad...
	4: Maybe another time, I really need that belt.
	END
@masteryes1
	4: Great!
	HOST_TAKE I952
	HOST_GIVE G50000
	HOST_GIVE T251
	GOTO @masteroffer
	END
@masterno
	H: I'm sorry but I do not have a %I952 with me right now.
	4: To bad...
	4: Maybe another time.
	GOTO @masteroffer
	END
@masterfinished
	4: Hi again %1, it is a pleasure to find you here.
	4: Thanks again for the %I952 I was able to sell it to a rich man for 150,000 GP.
	GOTO @masteroffer
	END

@eventActorGive4
	IF C51, @mastermerchskill
	IF C52, @mastermerchskill
	IF -C10, @endfi
@mastermerchskill
SET itemsell, #<item.id>
SET itemcost, #<item.price>
;MUL itemcost, "6"
;DIV itemcost, "4"
;DIV itemcost, "2"
;SET itemcostn,#<item.price>
;DIV itemcostn, "2"
COMPARE #<item.price>,#<itemcost>
IF< 	@banfi
	4: Since you are a fellow %C10 I will give you back the full price of each item.
;	1: Ah a #<item.name>, normally I would give you #<itemcostn> GP for it, but since you are a %C10 I will give you #<itemcost> GP.
	HOST_GIVE G#<itemcost>
	END
@endfi
	4: I'm sorry but I won't give you anything back for that.
	END
@banfi
	HOST_GIVE T172
	PARTY T172 
	GOTO LINK 99,0,1
	END


SCENE 4003
#include banscripts.txt

	SET cookieb, a
	SET cookiec, aap
	STRSTR #<cookiec>,#<cookieb>
	IF> @a
	N: Nothing
	end
@a
	N: succes
	end




SCENE 4002
#include banscripts.txt

	SET 10, 8
	SET beta, 10
	SET g#<beta>, 16
	N: 10 = #<anjo> g10 = #<g10>
	END



SCENE 4001
#include banscripts.txt

	COMPARE #<chkiun>, "0"
	IF> @skchkiun
	SET chkiun, #<num.hostKills>
@skchkiun
	SET chkiun2, #<num.hostKills>
	SUB chkiun2, #<chkiun>
	COMPARE #<chkiun2>, "200"
	IF> @S11
	SET chkiun, #<num.hostKills>
	END




SCENE 4022

	THEME
;	
; FIGHT SCENE
;

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

; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; SPECIAL FIGHT SCENE SCRIPT
;
; R A N D O M   E N C O U N T E R S
;
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

	IF T457, @link2
	COMPARE "#<num.serverTimeMonth>", "12"
	IF= @xmasmaybe

@link2

#include werewolfintro.txt

	IF R4+I2132,@randoma
	IF R1-I2132,@randoma
	IF #11, @lonewarrior
	IF #17, @specialslave
	IF GS+R1-S199, @summonmini
	IF #0+R5-I2132, @kittyraft
	IF #0+R20+I2132, @kittyraft
	IF V99+R4-I2132+S35+S36+S65+S66+S95+S96+S115+S116+S135+S136+S155+S156+S175+S176+S197+S198, @fightgorgath
	IF V99+R16+I2132+S35+S36+S65+S66+S95+S96+S115+S116+S135+S136+S155+S156+S175+S176+S197+S198, @fightgorgath
	IF C1-T520+R5,  @katanaupdate
	IF C16-T520+R5, @katanaupdate 
	IF C36-T520+R5, @katanaupdate 
	IF C37-T520+R5, @katanaupdate
	IF C38-T520+R5, @katanaupdate

	IF T299-T412,@rotwarscript 
	
	GOTO @fightcommand
	END
@kittyraft
	IF T504, @fightcommand
	IF T505, @fightcommand
	GOTO SCENE 1351

@xmasmaybe
	COMPARE "#<num.serverTimeDay>","24"
	IF= @randomxmass
	COMPARE "#<num.serverTimeDay>","25"
	IF= @randomxmass
	COMPARE "#<num.serverTimeDay>","26"
	IF= @randomxmass
	GOTO @link2
@randomxmass
	IF R90, @link2
	GOTO SCENE 1330

@rotwarscript
#include QS0002.txt
END
@randoma
	IF R75,@storyline
	IF R50,@stealthfight 
	IF R50,@randomally
	GOTO @wandering
	END	

@katanaupdate
	GOTO SCENE 1357

; random stealth monster fights
@stealthfight 
	IF T430,@wandering
	IF T435,@wandering
	IF T2031-V17, @wandering
	LOCK 1
	IF V99,@fighta5
	IF V75,@fighta4
	IF V50,@fighta3
	IF V20,@fighta2
	IF V1, @fighta1
@fighta1
	FIGHT2 506
	IF WIN,@winfighta
	IF LOSE,@losefighta
@fighta2
	FIGHT2 507
	IF WIN,@winfighta
	IF LOSE,@losefighta
@fighta3
	FIGHT2 508
	IF WIN,@winfighta
	IF LOSE,@losefighta
@fighta4
	FIGHT2 509
	IF WIN,@winfighta
	IF LOSE,@losefighta
@fighta5
	FIGHT2 510
	IF WIN,@winfighta
	IF LOSE,@losefighta
@winfighta
	HOST_GIVE T168
	GOTO @finalend
	END
@losefighta
	HOST_GIVE T169	
	SOUND "ëvillaugh.wav"
	WAIT 5.0
	GOTO SCENE 1

; random mysterious stranger fights
@randomally
	IF T430, @wandering
	IF T432, @wandering
	LOCK 1
	N: You receive help from a mysterious stranger.
	FIGHT2 *,*,*,-511
	HOST_GIVE T170
	WAIT 3.0
	GOTO SCENE 1
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; SUMMON MINI ME:
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@summonmini
	IF S199,@fightcommand
	IF -GS, @fightcommand
	
	ACTOR 1, "Angelica",pet001,1,-10,80

	POSE 1,4

	MOVE 1, 20,90
	WAIT 5.0
	1: Hiya sweetie!
	1: Say since you have a Golden Soul I got a little something here for ya.
	1: I think you'll like it!
	N: You learned %S199
	HOST_GIVE S199
	WAIT 3.0
	1: I gotta go again now.
	1: Cya later %1!
	MOVE 1,-20,80
	N: In memory of Angelica, may she live on forever in our hearts...
	WAIT 5.0
	N: Summon Mini Me gets auto summoned!
	WAIT 2.0
	SOUND "summon1.wav"
	WAIT 2.0
	SOUND "travel13.wav"
	WAIT 2.0
	SOUND "splash1.wav"
	WAIT 2.0
	FIGHT2 *,-1316,*,*
	WAIT 10
	GOTO EXIT


; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; STORY LINE:
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@storyline

	IF T442, @fightcommand

	IF T219, @storyliner
	IF T218, @storylineq
	IF T217, @storylinep
	IF T216, @storylineo
	IF T215, @storylinen
	IF T214, @storylinem
	IF T213, @storylinel
	IF T210, @storylinek
	IF T209, @storylinej
	IF T208, @storylinei
	IF T207, @storylineh
	IF T206, @storylineg
	IF T205, @storylinef
	IF T204, @storylinee	
	IF T203, @storylined
	IF T202, @storylinec
	IF T201, @storylineb
	IF T200, @storylinea

	GOTO SCENE 1175
@storylinea
	GOTO SCENE 1176
@storylineb
	GOTO SCENE 1177
@storylinec
	GOTO SCENE 1178
@storylined
	GOTO SCENE 1179
@storylinee
	GOTO SCENE 1180
@storylinef
	GOTO SCENE 1181
@storylineg
	GOTO SCENE 1182
@storylineh
	GOTO SCENE 1183
@storylinei
	GOTO SCENE 1184
@storylinej
	GOTO SCENE 1185
@storylinek
	GOTO SCENE 1185
@storylinel
	GOTO SCENE 1186
@storylinem
	GOTO SCENE 1187
@storylinen
	GOTO SCENE 1187
@storylineo
	GOTO SCENE 1188
@storylinep
	GOTO SCENE 1189
@storylineq
	IF -T433-T436, @storyliner
	GOTO SCENE 1190
@storyliner

	GOTO @fightcommand
; until I made the other movie scenes.	
	END

; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; FIGHT SCENE:
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@specialslave
	IF GS, @specialslavegs
	PARTY G7500
	GOTO SCENE 978
@specialslavegs
	PARTY GS
	PARTY G5000
	GOTO SCENE 978

@fightcommand
	IF #19+R1,@fightkagospirit
	IF #26, @terryandmary
	IF #15, @fightoffhellskitchen
#include R0001.txt
	IF V95, @fightcommand3
	IF  #1, @norun
	IF R15, @fightcommand2
	FIGHT
	GOTO @finalend	
	END
@fightcommand2
	FIGHT2
	GOTO @finalend	
	END
@fightcommand3
	FIGHT
	GOTO @finalend	
	END

@fightkagospirit
	FIGHT2 1503
	IF LOSE, @finalend
	HOST_GIVE I8
	N: %1 found a %I8!
	GOTO @finalend

@fightoffhellskitchen
#include R0006.txt
	END
@norun
	IF R85, @fightcommand2
	IF R15, @fightcommand3
	GOTO @norun
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; SPECIAL REWARDS:
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
@finalend
	IF -#19, @finalend2
	COMPARE #<monster.id>, "620"
	IF= @spower
	COMPARE #<monster.id>, "626"
	IF= @smight
	COMPARE #<monster.id>, "629"
	IF= @sarmour
	COMPARE #<monster.id>, "623"
	IF= @sevade
	COMPARE #<monster.id>, "622"
	IF= @svision
	GOTO @finalend2
@spower
	IF GS, @spower2
	IF -R10-I2132, @finalend2
	IF -R40+I2132, @finalend2
@spower3
	HOST_GIVE I20
	N: %1 found a %I20!
	GOTO @finalend2
@spower2
	IF -R15-I2132, @finalend2
	IF -R60+I2132, @finalend2
	GOTO @spower3
@smight
	IF GS, @smight2
	IF -R10-I2132, @finalend2
	IF -R40+I2132, @finalend2
@smight3
	HOST_GIVE I21
	N: %1 found a %I21!
	GOTO @finalend2
@smight2
	IF -R15-I2132, @finalend2
	IF -R60+I2132, @finalend2
	GOTO @smight3
@sarmour
	IF GS, @sarmour2
	IF -R10-I2132, @finalend2
	IF -R40+I2132, @finalend2
@sarmour3
	HOST_GIVE I22
	N: %1 found a %I22!
	GOTO @finalend2
@sarmour2
	IF -R15-I2132, @finalend2
	IF -R60+I2132, @finalend2
	GOTO @sarmour3
@sevade
	IF GS, @sevade2
	IF -R10-I2132, @finalend2
	IF -R40+I2132, @finalend2
@sevade3
	HOST_GIVE I23
	N: %1 found a %I23!
	GOTO @finalend2
@sevade2
	IF -R15-I2132, @finalend2
	IF -R60+I2132, @finalend2
	GOTO @sevade3
@svision
	IF GS, @svision2
	IF -R10-I2132, @finalend2
	IF -R40+I2132, @finalend2
@svision3
	HOST_GIVE I25
	N: %1 found a %I25!
	GOTO @finalend2	
@svision2
	IF -R15-I2132, @finalend2
	IF -R60+I2132, @finalend2
	GOTO @svision3

@finalend2

	IF DEAD, @finalend3

	IF T502+504+506+V90+R1-I2055-I2132, @givebonusses1a
	IF T503+505+V90+R1-I2053-I2132, @givebonusses1b
	IF T127+T219+V90+R1-I2055-I2132, @givebonusses1c 
	IF R1+R5-I2132, @givebonusses2a

	IF T502+504+506+V90+R4-I2055+I2132, @givebonusses1a
	IF T503+505+V90+R4-I2053+I2132, @givebonusses1b
	IF T127+T219+V90+R4-I2055+I2132, @givebonusses1c 
	IF R4+R5+I2132, @givebonusses2a

	IF V15-I2079+R1-I2132, @givemonsterkatana1
	IF V25-I2080+R1-I2132, @givemonsterkatana2
	IF V25-I2081+R1-I2132, @givemonsterkatana3
	IF V25-I2082+R1-I2132, @givemonsterkatana4

	IF V15-I2079+R4+I2132, @givemonsterkatana1
	IF V25-I2080+R4+I2132, @givemonsterkatana2
	IF V25-I2081+R4+I2132, @givemonsterkatana3
	IF V25-I2082+R4+I2132, @givemonsterkatana4

	IF R1-I2132+T429, @earnadditionalgp
	IF R4+I2132+T429, @earnadditionalgp

@finalend3

#include merchant2.txt
	COMPARE #<num.hostPetID>, "520"
	IF= @cprotocenablenuhb
	COMPARE #<num.hostPetID>, "521"
	IF= @cprotocenablenuhc

	GOTO @cprotocenablenuha
@cprotocenablenuhb
	COMPARE #<str.soul>, "SOUL 1373"
	IF= @cprotocenablenuha
	GOTO @S11
@cprotocenablenuhc
	IF -T129, @S11
@cprotocenablenuha

	STRCMP #<str.soul>, "744E0B37"
	IF= @skiplock	
	SET sceneLock, 0
	ACTOR	9, "Lock", danNoFloat, 6, 95, 10
	IF C2,  @autompheal
	IF C17, @autompheal
	IF C18, @autompheal
	IF C23, @autompheal
	IF C44, @autompheal
	IF E2146+T599, @autofulllife
	END
@autompheal
	HOST_GIVE M#<num.hostMaxMP>
	END
@autofulllife
	HOST_GIVE H#<num.hostMaxHP>
	HOST_GIVE M#<num.hostMaxMP>
	END

@givebonusses1a
	HOST_GIVE I2055
	GOTO @finalend3

@givebonusses1b	
	HOST_GIVE I2053
	GOTO @finalend3

@givebonusses1c	
	HOST_GIVE I2055
	GOTO @finalend3

@givebonusses2a
	SET bonus, %R24
	ADD bonus, 2100
	HOST_GIVE I#<bonus>
	COMPARE #<num.peopleInScene>, "1"
	IF> @givebonusses2a1
	N: You found a %I#<bonus>!
	GOTO @finalend3
@givebonusses2a1
	N: %1 found a %I#<bonus>!
	GOTO @finalend3

@givemonsterkatana1
	COMPARE #<num.peopleInScene>, "1"
	IF> @givemonsterkatana1b
	N: You found a %I2079
	HOST_GIVE I2079
	GOTO @finalend3
@givemonsterkatana1b
	N: %1 found a %I2079!
	HOST_GIVE I2079
	GOTO @finalend3

@givemonsterkatana2
	COMPARE #<num.peopleInScene>, "1"
	IF> @givemonsterkatana2b
	N: You found a %I2080
	HOST_GIVE I2080
	GOTO @finalend3
@givemonsterkatana2b
	N: %1 found a %I2080!
	HOST_GIVE I2080
	GOTO @finalend3

@givemonsterkatana3
	COMPARE #<num.peopleInScene>, "1"
	IF> @givemonsterkatana3b
	N: You found a %I2081
	HOST_GIVE I2081
	GOTO @finalend3
@givemonsterkatana3b
	N: %1 found a %I2081!
	HOST_GIVE I2081
	GOTO @finalend3

@givemonsterkatana4
	COMPARE #<num.peopleInScene>, "1"
	IF> @givemonsterkatana4b
	N: You found a %I2082
	HOST_GIVE I2082
	GOTO @finalend3
@givemonsterkatana4b
	N: %1 found a %I2082!
	HOST_GIVE I2082
	GOTO @finalend3

@earnadditionalgp
	COMPARE #<monster.level>, #<num.hostLevel>
	IF< @finalend3
	IF= @finalend3
	COMPARE #<num.peopleInScene>, "1"
	IF> @finalend3

	IF -GS, @earnadditionalgp2
	SET extracash, #<num.hostLevel>
	MUL extracash, "150"
	ADD extracash, "%R30000"
	N: You earn #<extracash> additional GP for killing a stronger monster then yourself alone.
	HOST_GIVE G#<extracash>
	SET extracash, "0"
	GOTO @finalend3

@earnadditionalgp2
	SET extracash, #<num.hostLevel>
	MUL extracash, "100"
	ADD extracash, "%R20000"
	N: You earn #<extracash> additional GP for killing a stronger monster then yourself alone.
	HOST_GIVE G#<extracash>
	SET extracash, "0"
	GOTO @finalend3

@skiplock
	END
@skiplockx2
	END

@terryandmary
	IF R50, @fightterry
@fightmary
	IF T302, @terryandmaryend
	IF T309, @terryandmaryend
	IF T311, @terryandmaryend
	N: Watch out! 
	N: Mary is attacking you!
	FIGHT2 15
	END
@fightterry
	IF T303, @terryandmaryend
	IF T310, @terryandmaryend
	IF T312, @terryandmaryend
	N: Watch out!
	N: Terry is attacking you!
	FIGHT2 14
	END	
@terryandmaryend
	GOTO EXIT

; The scene host has clicked on the little lock icon
@eventActorClick9
#include lpscript2.txt	

;	MENU "Lock Scene=@lockscenenow","Unlock Scene=@unlockscenenow"
;	END
@unlockscenenow
	COMPARE #<sceneLock>, 0
	IF= @lockscenenow
	LOCK 0
	SET sceneLock, 0
	SEL 9
	POSE	6
	HOST_TAKE T163
	HOST_TAKE T164
	HOST_TAKE T165
	HOST_TAKE T166
	COUNTDOWN 10
	WAIT 10
	END
@lockscenenow
	LOCK 1
	SET sceneLock, 1
	SEL 9
	POSE	5
	HOST_TAKE T163
	HOST_TAKE T164
	HOST_TAKE T165
	HOST_TAKE T166
	COUNTDOWN 10
	WAIT 10 
	END
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; WANDERING SLAVER
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; I will make a wandering merchant(for each main class) here with special rare stuff. 
@wandering
	LOCK 1
	IF R50,@slaverwan
	IF R75,@merchant

	GOTO @wandering

@slaverwan
	ACTOR 5, "Slaver",boss014, 4, 15,85
	IF C20,@fellowslaver
	OFFER 794,795,796,797,798,799,649,650,651
	5: Hi %2
	5: I got some nice slaves for sale.
	5: Their level is the highest you can get in RoT.
	END
@fellowslaver
	OFFER 794,795,796,797,798,799,649,650,651
	5: I see you are a fellow %C.
	5: Keep up your good evil work, all of our slavers benefit from your actions.
	IF T440, @endslavefi
	5: In fact... 
	5: because of you my profits went up so much I can easily give you some money...
	HOST_GIVE G10000
	HOST_GIVE T440
@endslavefi
	END
@eventActorGive5
	IF  C51, @traderskill
	IF  C52, @traderskill
	IF -C10, @endfi
@traderskill
SET itemsell, #<item.id>
SET itemcost, #<item.price>
MUL itemcost, "6"
DIV itemcost, "4"
DIV itemcost, "2"
SET itemcostn,#<item.price>
DIV itemcostn, "2"
COMPARE #<item.price>,#<itemcost>
IF< 	@banfi	
	5: I'll give #<itemcost> GP for this #<item.name>.
	HOST_GIVE G#<itemcost>
	END
@endfi
	5: I only trade with %C10s %1, you are a %C.
	END
@banfi
	HOST_GIVE T172
	PARTY T172 
	GOTO LINK 99,0,1
	END
END
@eventActorClick5
	COMPARE #<num.g>, "1"
	IF= @slavegendera
	IF> @slavegenderb
	END
@slavegendera
	5: You like touching me don't you?
	5: Please go on...
	END
@slavegenderb
	5: Ahem...
	5: I only want to be touched by males...
	END
@eventActorSpell5
	5: That tickles, please stop it.
	END
@eventActorAttack5
	5: WHOA THERE!
	5: No need for getting hostile!
	WAIT 3.0
	GOTO EXIT
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; WANDERING MERCHANT QUEST
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
;
@merchant
ACTOR 4 "Master Merchant", monster029, 4, 20,80
	LOCK 1
	IF C10,@mastermerch
	IF C51,@mastermerch
	IF C52,@mastermerch
	4: Hi there.
	4: I am the Master Merchant.
	4: I offer all useful items 5 levels above and 5 levels below your own level.
@masteroffer
	SET clevel, #<num.hostLevel>
	SET clevel1,#<clevel>
	SUB clevel1, "5"
	SET clevel2,#<clevel>
	ADD clevel2, "5"
	COMPARE #<clevel1>, "0"
	IF> @mastercheck
	SET clevel1, "1"
	COMPARE #<clevel2>, "100"
	IF< @mastercheck 
	SET clevel2, "99"

;	OFFER2 #<clevel1>,#<clevel2>, 
;	#<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23,
#include weaponscriptb.txt
@masterall
	OFFER2 #<clevel1>,#<clevel2>
	END
@master1
	OFFER2 #<clevel1>,#<clevel2>,12, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master2
	OFFER2 #<clevel1>,#<clevel2>,13, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master3
	OFFER2 #<clevel1>,#<clevel2>,14, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master4
	OFFER2 #<clevel1>,#<clevel2>,15, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master5
	OFFER2 #<clevel1>,#<clevel2>,16, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master6
	OFFER2 #<clevel1>,#<clevel2>,17, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
@master7
	OFFER2 #<clevel1>,#<clevel2>,18, #<clevel1>,#<clevel2>,10, #<clevel1>,#<clevel2>,11, #<clevel1>,#<clevel2>,20,	#<clevel1>,#<clevel2>,21, #<clevel1>,#<clevel2>,22, #<clevel1>,#<clevel2>,23
	END
	
@mastermerch
	IF T251, @masterfinished
	4: I see you are a fellow %C10.
	4: It is for me a great honor to meet you, your reputation went ahead of you.
	4: Do you happen to have a %I952 for me?
	IF -I952,@masterno
	H: Actually yes, I have a %I952 with me.
	4: Nice, I have been looking over for one everywhere!
	4: I will offer you 50,000 GP if you sell it to me.
	4: Will you sell it?
	ASK 300.0
	IF YES, @masteryes1
	4: To bad...
	4: Maybe another time, I really need that belt.
	END
@masteryes1
	4: Great!
	HOST_TAKE I952
	HOST_GIVE G50000
	HOST_GIVE T251
	GOTO @masteroffer
	END
@masterno
	H: I'm sorry but I do not have a %I952 with me right now.
	4: To bad...
	4: Maybe another time.
	GOTO @masteroffer
	END
@masterfinished
	4: Hi again %1, it is a pleasure to find you here.
	4: Thanks again for the %I952 I was able to sell it to a rich man for 150,000 GP.
	GOTO @masteroffer
	END

@eventActorGive4
	IF C51, @mastermerchskill
	IF C52, @mastermerchskill
	IF -C10, @endfi
@mastermerchskill
SET itemsell, #<item.id>
SET itemcost, #<item.price>
;MUL itemcost, "6"
;DIV itemcost, "4"
;DIV itemcost, "2"
;SET itemcostn,#<item.price>
;DIV itemcostn, "2"
COMPARE #<item.price>,#<itemcost>
IF< 	@banfi
	4: Since you are a fellow %C10 I will give you back the full price of each item.
;	1: Ah a #<item.name>, normally I would give you #<itemcostn> GP for it, but since you are a %C10 I will give you #<itemcost> GP.
	HOST_GIVE G#<itemcost>
	END
@endfi
	4: I'm sorry but I won't give you anything back for that.
	END
@banfi
	HOST_GIVE T172
	PARTY T172 
	GOTO LINK 99,0,1
	END

; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; SUMMON GORGATH
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
;
@fightgorgath
	N: Gorgath is attacking you with his army!
	EJECT 172
	LOCK 1
	FIGHT2 1301,1301,1507,1507,1507,1508
	IF WIN, @gorgathjoin
	ACTOR 4, "Gorgath", summon1, 4, -20, 80
	4: Soa poawerful toa gain all summoans, yet noat be able toa beat me eh?
	4: Yoau are noat woarthy oaf such poawer %1!
	WAIT 5.0
	GOTO EXIT
@gorgathjoin
	ACTOR 4, "Gorgath", summon1, 4, -10, 80

	MOVE 4, 20,90
	SEL 4
	POSE 1,4
	WAIT 3.0
	4: I had toa see foar myself...
	4: Yoau are truly a summoan master!
	4: I wish toa joain yoau master...
	WAIT 3.0
	HOST_GIVE S265
	HOST_GIVE T523
	N: %M1507 joined you!
	MOVE 4,-20,90,1
	GOTO @finalend
	 

; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
; LONE WARRIOR QUEST
; XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
;
@lonewarrior
	IF T412, @fightcommand
	IF T299, @rotwarscript
	IF T331, @fightcommand 
	IF T332, @fightcommand

	IF R5, @lonewarriors
	GOTO @fightcommand

@lonewarriors
	ACTOR 6, "Lone Warrior", a31,3,-10,70

	LOCK 1
	MOVE	6,20,80
	WAIT 5.0	
	6: AAAAHH!
	SOUND "pain15.wav"
	6: Please...
	6: HeLP .... me....
	6: I am dYing...
	6: Help...  mE... eNd tHIs MIsserY... ENd thiS PAin!
	6: You caNn eiTher cure Me witHhh a God speLL Or kILl mE wITh an attACK or SPEll.
	6: But please...
	6: Helpp meee....
	END

@eventActorAttack6
	IF T331, @finishlonenow
	IF T332, @finishlonenow
	HOST_GIVE T332
	SOUND "pain1.wav"
	6: Thank... you....
	WAIT 5.0
	MOVE 6,-100,100,1
	N: You find a %I952.
	HOST_GIVE I952
	WAIT 5.0
	N: You searched through the dead corpse and found 5,000 GP.
	HOST_GIVE G5000
	END
@eventActorGive6
	6: Thank... you.... but that doesn't help me much right now...
	6: Please, either heal me or end my missery...
	END
@eventActorClick6
	6: help me... 
	WAIT 10.0
	END
@finishlonenow
	GOTO EXIT

@eventActorSpell6
	IF T331, @finishlonenow
	IF T332, @finishlonenow
	COMPARE #<spell.id> ,"8"
	IF< @savelone
	HOST_GIVE T332
	SOUND "pain1.wav"
	6: Thank... you....
	WAIT 5.0
	MOVE 6,-100,100,1
	N: You find a %I952.
	HOST_GIVE I952
	END	
@savelone
	HOST_GIVE T331
	WAIT 3.0
	6: AAAAHH!
	SOUND "pain15.wav"
	POSE 4
	WAIT 0.2
	POSE 1
	6: Thank you!
	6: I'm feeling a lot better now.
	6: You can have this %I952 of mine, it's the least I can give.
	HOST_GIVE I952
	WAIT 3.0
	N: You received a %I952.
	6: I'll be going now.
	6: Maybe I see you sometime later.
	WAIT 3.0
	MOVE 6,-30,-70
	WAIT 30.0
	END
#include qspotions.txt



; Comment: WHO STOLE MY SCRIPTING PEN!?	