****************
*Install Scripts*
****************
inst
new: vhcl 3 3 56515 "bgalcv" 16 0 1000
attr 4
bhvr 0
pat: dull 1 "bgalcv" 1 0 0 2
pat: dull 2 "bgalcv" 2 45 -4 0
pat: dull 3 "bgalcv" 10 140 82 0
pat: butt 4 "bgalcv" 15 1 136 129 0 [] 1000 0
perm 80
accg 3
fric 100
elas 0
mvto 2140 11450
cabw 1
cabn 38 54 114 191
cabp 1
part 3
anim [1 2 3 4 3 2 1 0 255]
setv ov00 0
tick 1

new: vhcl 3 3 56515 "bgalcv" 16 0 1000
attr 4
bhvr 0
pat: dull 1 "bgalcv" 1 0 0 2
pat: dull 2 "bgalcv" 2 45 -4 0
pat: dull 3 "bgalcv" 10 140 82 0
pat: butt 4 "bgalcv" 15 1 136 129 0 [] 1000 0
perm 80
accg 3
fric 100
elas 0
mvto 2460 11450
cabw 1
cabn 38 54 114 191
cabp 1
part 3
anim [1 2 3 4 3 2 1 0 255]
setv ov00 0
tick 1

new: vhcl 3 3 56515 "bgalcv" 16 0 1000
attr 4
bhvr 0
pat: dull 1 "bgalcv" 1 0 0 2
pat: dull 2 "bgalcv" 2 45 -4 0
pat: dull 3 "bgalcv" 10 140 82 0
pat: butt 4 "bgalcv" 15 1 136 129 0 [] 1000 0
perm 80
accg 3
fric 100
elas 0
mvto 2761 11450
cabw 1
cabn 38 54 114 191
cabp 1
part 3
anim [1 2 3 4 3 2 1 0 255]
setv ov00 0
tick 1

new: vhcl 3 3 56515 "bgalcv" 16 0 1000
attr 4
bhvr 0
pat: dull 1 "bgalcv" 1 0 0 2
pat: dull 2 "bgalcv" 2 45 -4 0
pat: dull 3 "bgalcv" 10 140 82 0
pat: butt 4 "bgalcv" 15 1 136 129 0 [] 1000 0
perm 80
accg 3
fric 100
elas 0
mvto 2460 11725
cabw 1
cabn 38 54 114 191
cabp 1
part 3
anim [1 2 3 4 3 2 1 0 255]
setv ov00 0
tick 1

new: vhcl 3 3 56515 "bgalcv" 16 0 1000
attr 4
bhvr 0
pat: dull 1 "bgalcv" 1 0 0 2
pat: dull 2 "bgalcv" 2 45 -4 0
pat: dull 3 "bgalcv" 10 140 82 0
pat: butt 4 "bgalcv" 15 1 136 129 0 [] 1000 0
perm 80
accg 3
fric 100
elas 0
mvto 2761 11725
cabw 1
cabn 38 54 114 191
cabp 1
part 3
anim [1 2 3 4 3 2 1 0 255]
setv ov00 0
tick 1

new: simp 1 3 56515 "fav_place_artic" 1 0 1
attr 272
mvto 2534 11712
tick 10

new: simp 1 1 56575 "cbwall" 1 0 5000
mvto 1980 11710

new: simp 1 1 56575 "icepole" 1 0 5000
mvto 345 11681


***************
*End Installs**
***************

***************
*Alcove Script*
***************

scrp 2 12 56506 1
	attr 0
	bhvr 0
	pose 1
	enum 2 12 56504
		doif targ ne null
			attr 0
			bhvr 0
		endi
	next
	enum 2 12 56505
		doif targ ne null
			attr 0
			bhvr 0
		endi
	next
	enum 3 1 56503
		doif targ ne null
			part 1
			anim [3 4 5 6 7 8]
			over
			wait 5
			gpas 4 0 0 0
			anim [8 7 6 5 4 3]
			over
			anim [2 2 2 2 2 0 0 0 0 0 255]
			loop
				velo 0 -10
			untl posy lt 5965
			velo 0 0
			part 1
			anim [3 4 5 6 7 8]
			over
			wait 5
			dpas 4 0 0
			anim [8 7 6 5 4 3]
			over
			anim [2 2 2 2 2 0 0 0 0 0 255]
			addv ov00 1
			setv ov01 0
			targ ownr
			pose 0
			enum 2 12 56504
				doif targ ne null
					attr 4
					bhvr 1
				endi
			next
			enum 2 12 56505
				doif targ ne null
					attr 4
					bhvr 1
				endi
			next
		endi
	next
endm

scrp 2 12 56504 1
	attr 0
	bhvr 0
	pose 1
	enum 2 12 56505
		doif targ ne null
			attr 0
			bhvr 0
		endi
	next
	enum 2 12 56506
		doif targ ne null
			attr 0
			bhvr 0
		endi
	next
	enum 3 1 56503
		doif targ ne null
			part 1
			anim [3 4 5 6 7 8]
			over
			wait 5
			gpas 4 0 0 0
			anim [8 7 6 5 4 3]
			over
			anim [2 2 2 2 2 0 0 0 0 0 255]
			loop
				velo 0 10
			untl posy gt 6445
			velo 0 0
			part 1
			anim [3 4 5 6 7 8]
			over
			wait 5
			dpas 4 0 0
			anim [8 7 6 5 4 3]
			over
			anim [2 2 2 2 2 0 0 0 0 0 255]
			addv ov00 1
			setv ov01 0
			targ ownr
			pose 0
			enum 2 12 56505
				doif targ ne null
					attr 4
					bhvr 1
				endi
			next
			enum 2 12 56506
				doif targ ne null
					attr 4
					bhvr 1
				endi
			next
		endi
	next
endm

scrp 2 12 56505 1
	attr 0
	bhvr 0
	pose 1
	enum 2 12 56504
		doif targ ne null
			attr 0
			bhvr 0
		endi
	next
	enum 2 12 56506
		doif targ ne null
			attr 0
			bhvr 0
		endi
	next
	enum 3 1 56503
		doif targ ne null and posy gt 6440
			part 1
			anim [3 4 5 6 7 8]
			over
			wait 5
			gpas 4 0 0 0
			anim [8 7 6 5 4 3]
			over
			anim [2 2 2 2 2 0 0 0 0 0 255]
			loop
				velo 0 -10
			untl posy lt 6265
			velo 0 0
			part 1
			anim [3 4 5 6 7 8]
			over
			wait 5
			dpas 4 0 0
			anim [8 7 6 5 4 3]
			over
			anim [2 2 2 2 2 0 0 0 0 0 255]
			addv ov00 1
			setv ov01 0
			targ ownr
			pose 0
			enum 2 12 56504
				doif targ ne null
					attr 4
					bhvr 1
				endi
			next
			enum 2 12 56506
				doif targ ne null
					attr 4
					bhvr 1
				endi
			next
		elif posy lt 6000
			part 1
			anim [3 4 5 6 7 8]
			over
			wait 5
			gpas 4 0 0 0
			anim [8 7 6 5 4 3]
			over
			anim [2 2 2 2 2 0 0 0 0 0 255]
			loop
				velo 0 10
			untl posy gt 6265
			velo 0 0
			part 1
			anim [3 4 5 6 7 8]
			over
			wait 5
			dpas 4 0 0
			anim [8 7 6 5 4 3]
			over
			anim [2 2 2 2 2 0 0 0 0 0 255]
			addv ov00 1
			setv ov01 0
			targ ownr
			pose 0
			enum 2 12 56504
				doif targ ne null
					attr 4
					bhvr 1
				endi
			next
			enum 2 12 56506
				doif targ ne null
					attr 4
					bhvr 1
				endi
			next
		endi
	next
endm


scrp 2 2 56549 1
	inst
	sndc "gui1"
	anim [1 2 3 4 5 6 7 8 9 10]
	enum 2 2 56549
		doif targ ne ownr and targ ne null
			sndc "gui1"
			anim [1 2 3 4 5 6 7 8 9 10]
			seta va00 targ
			setv va01 posx
			setv va02 posy
			targ ownr
			over
			etch 4 0 0
				doif targ ne null
					mvsf va01 va02
				endi
			next
			doif from eq pntr
				scam null -1
				cmrp va01 va02 1
			endi
			sndc "gui3"
			anim [10 9 8 7 6 5 4 3 2 1 0]
			targ va00
			sndc "gui3"
			anim [10 9 8 7 6 5 4 3 2 1 0]
		endi
	next
endm


scrp 3 3 56595 1001
	doif _p1_ ne 0
		mesg writ ownr 1000
	endi
endm

scrp 3 3 56595 1002
	prt: send 0 _p1_
endm


scrp 3 3 56595 1
	sndc "beep"
	mesg writ ownr 1000
endm


scrp 3 3 56595 1000
	part 1
	anim [0 1 0 1 0 1 0]
	rtar 1 1 56595
	doif targ ne null
		mesg writ targ 1000
	endi
	targ ownr
	over
	anim [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 255]

endm


scrp 1 1 56595 1000
	lock
	doif ov50 = 0
		setv ov50 1
		sndc "trap"

		setv ov00 grap posx posy
		setv ov01 grid targ _up_
		setv ov02 grid targ down


		rtar 3 3 56595
		doif targ ne null
			mesg wrt+ targ 1002 255 0 0
		endi
		targ ownr
		anim [0 1 2 3 4 5]
		door ov00 ov01 100
		door ov00 ov02 100
		inst
		etch 0 0 0
			velo 0 0
		next
		slow
		targ ownr
		over
		wait 30
		inst
		setv va66 0
		etch 4 0 0
			addv va66 1
		next
		doif va66 < 1
			tick 0
			setv ov50 0
			anim [5 4 3 2 1 0]
			sndc "trap"
			door ov00 ov01 50
			door ov00 ov02 50
			over
			rtar 3 3 56595
			doif targ ne null
				mesg wrt+ targ 1002 0 0 0
			endi
		else
			tick 20
		endi
	endi

endm


scrp 1 1 56595 9
	inst
	lock
	setv va66 0
	etch 4 0 0
		addv va66 1
	next
	doif va66 < 1
		tick 0
		setv ov50 0
		anim [5 4 3 2 1 0]
		sndc "trap"
		door ov00 ov01 50
		door ov00 ov02 50
		over
		rtar 3 3 56595
		doif targ ne null
			mesg wrt+ targ 1002 0 0 0
		endi
	else
		tick 20
	endi
endm

scrp 2 2 56545 1
	inst
	new: simp 1 2 56545 "bgport3" 10 0 4000
	mvto 2358 8978
	tick 1
	targ ownr
	anim [1 2 3 4 5 6 7 8 9 10]
	over
	esee 4 0 0
		doif targ ne null
			mvsf 1700 11785
		endi
	next
	new: simp 1 2 56545 "bgport3" 10 0 4000
	mvto 1650 11750
	tick 1
	targ ownr
	doif from eq pntr
		scam null -1
		cmra 1421 11395 0
	endi
	anim [11 12 13 14 15 16 17 18 19 0]
	over
endm

scrp 2 2 56546 1
	inst
	new: simp 1 2 56545 "bgport3" 10 0 4000
	mvto 1650 11750
	tick 1
	targ ownr
	anim [1 2 3 4 5 6 7 8 9 10]
	over
	esee 4 0 0
		doif targ ne null
			mvsf 2400 9030
		endi
	next
	new: simp 1 2 56545 "bgport3" 10 0 4000
	mvto 2358 8978
	tick 1
	targ ownr
	doif from eq pntr
		scam null -1
		cmra 2071 8742 0
	endi
	anim [11 12 13 14 15 16 17 18 19 0]
	over
endm

scrp 2 2 56547 1
	inst
	anim [0 1 2 3 4 5 6 7 8 9 10 11 12 13]
	sndc "dr_o"
	enum 2 2 56547
		doif targ ne ownr and targ ne null
			setv va00 posx
			setv va01 posy
			seta va02 targ
			sndc "dr_o"
			anim [0 1 2 3 4 5 6 7 8 9 10 11 12 13]
			over
			targ ownr
			esee 4 0 0
				doif targ ne null
					mvsf va00 va01
				endi
			next
			targ ownr
			doif from eq pntr
				scam null -1
				cmrp va00 va01 0
			endi
			targ va02
			sndc "dr_c"
			anim [13 12 11 10 9 8 7 6 5 4 3 2 1 0]
			targ ownr
			sndc "dr_c"
			anim [13 12 11 10 9 8 7 6 5 4 3 2 1 0]
			over
		endi
	next
endm

scrp 1 2 56545 9
	sndc "bgte"
	anim [1 2 3 4 5 6 7 8 9]
	over
	wait 20
	kill targ
endm


scrp 3 3 56515 1000
	inst
	doif ov00 eq 0
		tick 0
		targ norn
		doif targ ne null and dead eq 0
			seta ov03 norn
			doif movs eq 0 and chem 185 gt 0
				gsub chem
				wait 1
				zomb 1
				motr 0
				wait 1
				mind 0
				wait 1
				pose 102
				setv ov01 dftx
				setv ov02 dfty
				gsub teleport
				wait 1
				dirn 1
				zomb 0
				wait 1
				drop
				aslp 1
				drea 1
				soul 4 0
				soul 8 0
				wait 1
				targ ownr
				gsub teleport
				wait 5
				over
				spas ownr norn
				setv ov00 1
				loop
					sndc "alcv"
					reps 4
						part 2
						anim [1 2 3 4 5 6 7 6 5 4 3 2 1 0]
						over
						wait 4
					repe
					targ ownr
				untl ov00 eq 0
			endi
			targ ownr
		endi
		targ ownr
	elif ov00 eq 1
		epas 4 0 0
			seta va04 targ
		next
		doif targ ne null
			gsub teleport
			setv va99 ov01
			setv va98 ov02
			gsub bob
			wait 5
			over
			targ ownr
			dpas 0 0 0
			targ va04
			doif tmvf ov01 ov02 eq 1
				mvft ov01 ov02
			endi
			motr 1
			aslp 0
			mind 1
			aslp 0
			drea 0
			soul 4 1
			soul 8 1
			gsub chem
			targ ownr
			setv ov00 0
			tick 1
		endi
		targ ownr
	endi
	targ ownr





	subr chem
		chem 185 1
		chem 214 -1
		chem 159 -1
		chem 92 1.0
		chem 93 1.0
		chem 94 1.0
		chem 95 1.0
		chem 96 1.0
		chem 97 1.0
		chem 98 1.0
		chem 99 1.0
		chem 100 1.0
		chem 102 1.0
		chem 103 1.0
		chem 104 1.0
		chem 105 1.0
		chem 106 1.0
		chem 107 1.0
		chem 108 1.0
		chem 109 1.0
		chem 127 -1
		chem 128 -1
		chem 148 -1
		chem 154 -1
		chem 155 -1
		chem 156 -1
		chem 157 -1
		chem 158 -1
		chem 159 -1
		chem 160 -1
		chem 161 1
		chem 162 1
		chem 39 1
		chem 40 1
	retn

	subr bob
		subv va99 100
		subv va98 110
		seta va02 targ
		new: comp 3 2 56515 "bgprt2" 10 0 6000
		attr 0
		bhvr 0
		mvto va99 va98
		tick 1
		targ va02
	retn


	subr teleport
		setv va00 posx
		setv va01 posy
		subv va00 100
		subv va01 110
		seta va02 targ
		new: comp 3 2 56515 "bgprt2" 10 0 6000
		attr 0
		bhvr 0
		mvto va00 va01
		tick 1
		targ va02
	retn

endm

scrp 3 3 56515 9
	inst
	enum 4 0 0
		doif targ ne null
			doif aslp eq 0
				doif chem 154 gt 0.3 or chem 155 gt 0.3
					doif movs eq 0 and dead eq 0 and chem 185 gt 0
						sndc "rgn1"
						gsub chem

						wait 1
						zomb 1
						motr 0
						wait 1
						mind 0
						wait 1
						pose 102
						wait 1
						dirn 1
						zomb 0
						wait 1
						drop
						aslp 1
						drea 1
						soul 4 0
						soul 8 0
						wait 15
						gsub teleport
						setv va01 dftx
						setv va02 dfty
						seta va00 targ
						targ ownr
						gsub teleport
						wait 5
						over
						spas ownr va00
						setv va03 0
						loop
							sndc "alcv"
							reps 4
								part 2
								anim [1 2 3 4 5 6 7 6 5 4 3 2 1 0]
								over
								wait 4
							repe
							addv va03 1
							targ ownr
						untl va03 eq 4
						sndc "rgn2"
						wait 15
						gsub teleport
						gsub teleport2
						wait 5
						dpas 0 0 0
						targ va00
						doif movs eq 0
							motr 1
							aslp 0
							doif tmvf va01 va02 eq 1
								mvft va01 va02
							endi
							mind 1
							aslp 0
							drea 0
							soul 4 1
							soul 8 1
							gsub chem
						endi
						targ ownr
					endi
					targ ownr
				endi
				targ ownr
			endi
			targ ownr
		endi
	next

	subr chem
		chem 185 1
		chem 214 -1
		chem 159 -1
		chem 92 1.0
		chem 93 1.0
		chem 94 1.0
		chem 95 1.0
		chem 96 1.0
		chem 97 1.0
		chem 98 1.0
		chem 99 1.0
		chem 100 1.0
		chem 102 1.0
		chem 103 1.0
		chem 104 1.0
		chem 105 1.0
		chem 106 1.0
		chem 107 1.0
		chem 108 1.0
		chem 109 1.0
		chem 127 -1
		chem 128 -1
		chem 148 -1
		chem 154 -1
		chem 155 -1
		chem 156 -1
		chem 157 -1
		chem 158 -1
		chem 159 -1
		chem 160 -1
		chem 161 1
		chem 162 1
		chem 39 1
		chem 40 1
	retn

	subr teleport
		setv va99 posx
		setv va98 posy
		subv va99 100
		subv va98 110
		seta va97 targ
		new: comp 3 2 56515 "bgprt2" 10 0 6000
		attr 0
		bhvr 0
		mvto va99 va98
		tick 1
		targ va97
	retn

	subr teleport2
		setv va99 va01
		setv va98 va02
		subv va99 110
		subv va98 140
		seta va97 targ
		new: comp 3 2 56515 "bgprt2" 10 0 6000
		attr 0
		bhvr 0
		mvto va99 va98
		tick 1
		targ va97
	retn


	tick 1
endm

scrp 3 2 56515 9
	sndc "bgpt"
	anim [1 2 3 4 5 6 7 8 9]
	over
	wait 20
	kill targ
endm

rscr
enum 3 3 56515
	kill targ
next
scrx 3 3 56515 9
scrx 3 3 56515 1000
scrx 3 2 56515 9
endm
*************
*END ALCOVE**
*************