#This is the script file for Vikings of Midgard.  I've tried to document it as thouroughly as
#possible, but that's not always possible!  Whenever you see comments like these that start every 
#line with a (pound key) sign, they indicate that that line will not be read by the
#script itself.  So we can write whatever we want here!



include, plotscr.hsd
include, viking.hsi
include, scancode.hsi
include, utility.lib






define script (1,run,none)
define script (2,afterbattle,none)
define script (3,HPtab,none)
define script (4,MPtab,none)
define script (5,opening scene,none)
define script (6,inn,none)
define script (7,inn2,none)
define script (8,inn3,none)
define script (9,earthfiend,none)
define script (10,die in battle,none)
define script (11,cthulhu1,none)
define script (12,tulzcha,none)
define script (13,dagon,none)
define script (14,cthulhu,none)
define script (15,kyle,none)
define script (16,azathoth,none)
define script (17,credits,none)
define script (18,Bramget,none)
define script (19,warriorget,none)
define script (20,missionaryget,none)
define script (21,shamanget,none)
define script (22,rangerget,none)
define script (23,westernpit,none)
define script (24,easternpit,none)
define script (25,southernpit,none)
define script (26,firstpit,none)
define script (27,valkyrieget,none)
define script (28,grinlow,none)
define script (29,skaldget,none)
define script (30,whalepunch,none)
define script (31,whaleland,none)
define script (32,berserkerget,none)
define script (33,randomboxpuzzle,none)
define script (34,randomboxprize,none)
define script (35,enteralfheim,none)
define script (36,jint,none)
define script (37,thule1,none)
define script (38,thule2,none)
define script (39,alfheim1,none)
define script (40,niffbox,none)
define script (41,elfshouse1,none)
define script (42,alfheim2,none)
define script (43,alfheim3,none)
define script (44,alfheim4,none)
define script (45,jotunheim1,none)
define script (46,jotunheim2,none)
define script (47,stairsup,none)
define script (48,stairsdown,none)
define script (49,Gahn,none)
define script (50,JO,none)
define script (51,orlock,none)
define script (52,finalbrising,none)
define script (53,BramReturns,none)
define script (54,Frumpyback,none)
define script (55,Hel,none)
define script (56,vulpes,none)
define script (57,BramSLOW,none)
define script (58,NightSLEEP,none)
define script (59,OlafMANA,none)
define script (60,KittSLASH,none)
define script (61,FrumpForce,none)
define script (62,StyrgeWERE,none)
define script (63,antidote,none)
define script (64,Hildaback,none)
define script (65,housemaster,none)
define script (66,FrumpyLINGUE,none)
define script (67,FrumpyAWAKE,none)
define script (68,FrumpyNURSE,none)
define script (69,FrumpyLIFE,none)
define script (70,FrumpySUBLIME,none)
define script (71,Lyngvi,none)
define script (72,Freya,none)
define script (73,brising,none)
define script (74,NIGHTTHUNDER,none)
define script (75,Grue,none)
define script (76,MontereyPenguin,none)
define script (77,Triangletrap,none)
define script (78,Garm,none)
define script (79,Chainsaw Jack,none)
define script (80,Rell,none)
define script (81,Crimson,none)
define script (82,Josh,none)
define script (83,Walrus,none) 
define script (84,Surlaw,none)
define script (85,Deactivated,none)
define script (86,triangle1,none)
define script (87,triangle2,none)
define script (88,fiends1,none)
define script (89,fiends2,none)
define script (90,Hatifinal,none)
define script (91,zidane,none)
define script (92,EricSILENCE,none)
define script (93,BossIntroduction,none)
define script (94,Dogero,none)
define script (95,Dracula,none)
define script (96,Narvi,none)
define script (97,Shayna,none)
define script (98,Velius,none)
define script (99,Delvire,none)
define script (100,Sasha,none)
define script (101,Siva,none)
define script (102,Alex,none)
define script (103,Collies1,none)
define script (104,mindscrew,none)
define script (105,Ericback,none)
define script (106,misteroo,none)
define script (107,fourfiends,none)
define script (108,firesmash,none)
define script (109,icebrand,none)
define script (110,boltslash,none)
define script (111,utgard,none)
define script (112,delvirearena,none)

define script (113,arena,none)
define script (114,arenaHorace,none)
define script (115,arenacomrade,none)
define script (116,slimesalad,none)
define script (117,lowteir,none)
define script (118,midteir,none)
define script (119,upperteir,none)
define script (120,highteir,none)
define script (121,quarterfinals,none)
define script (122,semifinals,none)
define script (123,tunneler,none)
define script (124,crone,none)
define script (125,TELEPORT,none)
define script (126,tele0,none)
define script (127,tele1,none)
define script (128,tele2,none)
define script (129,tele3,none)
define script (130,tele4,none)
define script (131,tele5,none)
define script (132,tele6,none)
define script (133,tele7,none)
define script (134,tele8,none)
define script (135,tele9,none)
define script (136,tele10,none)
define script (137,skadi1,none)
define script (138,skadi2,none)
define script (139,olaf1,none)
define script (140,Delvire2,none)
define script (141,fafnir,none)
define script (142,Manafight,none)
define script (143,Cthulhu2,none)
define script (144,Collies2,none)
define script (145,Eikthymir,none)
define script (146,lifemist,none)
define script (147,Cthulhu3,none)
define script (148,thisisademo,none)




script,run,begin 
if,begin 
key is pressed (key:x) 
#change this to choose your own key.  
#By default, holding "x" when walking will make you run
end 
then,begin 
if (hero is walking (me)==false) 
then,begin 
set hero speed (me,5) 
#This basically states that if "x" is held down, you'll move a little faster
if (checktag(tag:SPRINT)==on) then (set hero speed (me,10))
#This line shows that if the stated tag is on, you'll dash faster. This particular tag is set to the 
#Brigand's "Is Leader" bitset, so when the brigand is in charge, you'll run quite fast.
if (checktag(tag:DASH)==on) then (set hero speed (me,20))
#This line is like the above lines in that if the tag is on, you'll run at a blazing 20 pixels per tick.
#That's one tile per tick!
end 
end 
else,begin 
#This line states that if the player isn't holding "x", then the hero will only walk normally.
if (hero is walking (me)==false) 
then,begin 
set hero speed (me,4) 
end 
end 
end 

script,afterbattle,begin

#This section will increment the user of the CHicken Knife's accuracy by 1, if they have it equipped.

if (check equipment ((find hero(hero:Bram)),1) == 118) 	then 	( Add To Stat ((find hero(hero:Bram)),stat:Accuracy,1))


#Bluemagic time now, yes?
if (checktag(tag:Photoheal1)) 	then 	(write spell((find hero(hero:Renard)),1,0,atk:Photoheal))
if (checktag(tag:Siphon1)) 	then 	(write spell((find hero(hero:Renard)),1,1,atk:Siphon))
if (checktag(tag:Lifedrain1)) 	then 	(write spell((find hero(hero:Renard)),1,2,atk:Lifedrain))
if (checktag(tag:Crush1)) 	then 	(write spell((find hero(hero:Renard)),1,3,atk:Crush))
if (checktag(tag:Maim1)) 	then 	(write spell((find hero(hero:Renard)),1,4,atk:Maim))
if (checktag(tag:Dissolve1)) 	then 	(write spell((find hero(hero:Renard)),1,5,atk:Dissolve))
if (checktag(tag:Greenfire1)) 	then 	(write spell((find hero(hero:Renard)),1,6,atk:Greenfire))
if (checktag(tag:Purplhaze1)) 	then 	(write spell((find hero(hero:Renard)),1,7,atk:Purplhaze))
if (checktag(tag:Icewave1)) 	then 	(write spell((find hero(hero:Renard)),1,8,atk:Icewave))
if (checktag(tag:Explode1)) 	then 	(write spell((find hero(hero:Renard)),1,9,atk:Explode))
if (checktag(tag:Barrier1)) 	then 	(write spell((find hero(hero:Renard)),1,10,atk:Barrier))
if (checktag(tag:Supernova1)) 	then 	(write spell((find hero(hero:Renard)),1,12,atk:Supernova))

end


script,HPtab,begin
#This script is short, and to the point.
#It will bring up a pickbox to choose the hero, then add 25 points to that hero's HP!
#Just be sure to link it to a textbox, and have an item call that textbox when used in the field.
 Add To Stat 	((pickhero),stat:HP,25)
 items menu
end

script,MPtab,begin
#This script is short, and to the point.
#It will bring up a pickbox to choose the hero, then add 25 points to that hero's MP!
#Just be sure to link it to a textbox, and have an item call that textbox when used in the field.
 Add To Stat 	((pickhero),stat:MP,25)
 items menu
end

script,opening scene,begin
 suspend player
 suspend box advance
#This part will only play if this game is the YPSILIFORM release candidate
 thisisademo
#It'll be altered, removed outright, or even changed for YGGDRASIL, whenever that is
 walk NPC 	(0,right,1)
 wait 		(10)
 show text box 	(586)
 focus camera 	(29,57,2)
 wait 		(120)
 advance text box
 show text box 	(587)
 wait 		(120)
 advance text box
 wait for camera
 wait 		(5)
 focus camera 	(29,13,2)
 show textbox 	(588)
 wait 		(140)
 advance text box
 show textbox 	(589)
 wait 		(140)
 advance text box
 show textbox 	(590)
 wait 		(140)
 advance textbox
 wait 		(10)
 fade screen out
 wait 		(5)
 show textbox 	(591)
 camera follows hero (me)
 wait 		(2)
 fade screen in
 wait 		(140)
 fade screen out
 wait 		(5)
 advance textbox
 use door 	(0)
 set hero direction (me,left)
 wait 		(5)
 set hero direction (me,up)
 wait 		(5)
 set hero direction (me,right)
 wait 		(5)
 set hero direction (me,up)
 wait 		(5)
 walk hero 	(me,up,4)
 wait for hero 	(me)
 wait 		(10)
 walk hero 	(me,up,6)
 wait 		(10)
 show textbox 	(1)
 resume player
 resume box advance
end

script,inn,begin
 suspend player
 suspend box advance
 walk hero (me,left,7)
 focus camera (4,6,4)
 wait for hero (me)
 suspend caterpillar
 wait (2)
 set hero speed (2)
 set hero direction (me,down)
 wait (3)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (2)
 set caterpillar mode (on)
 set hero position (1, 4, 6)
 set hero position (2, 4, 6)
 set hero position (3, 4, 6)
 wait (4)
 walk hero (0,up,2)
 walk hero (1,up,2)
 walk hero (2,down,2)
 walk hero (3,down,2)

 wait (1)
 walk hero (0,left,2)
 walk hero (1,right,2)
 walk hero (2,left,2)
 walk hero (3,right,2)

 wait for hero (me)
 set hero z (0, 5)
 set hero z (1, 5)
 set hero z (2, 5)
 set hero z (3, 5)
 wait (5)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)

 tweak palette (-20,-20,20)
 fade screen in
 play song (song:Sleeptime)
 wait (200)
 stop song
 wait (5)
 reset palette
 play song (get ambient music)
 wait (5)
 fade screen in
 wait (5)
 set hero z (0, 0)
 set hero z (1, 0)
 set hero z (2, 0)
 set hero z (3, 0)
 wait (5)
 #Now the heroes get out of bed
 wait (1)
 walk hero (0,right,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,left,1)
 wait (3)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (1)
 set hero direction (0,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left)
 wait (1)
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 set hero direction (0,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (1)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (1)
 set hero direction (0,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left)
 wait (1)
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 set hero direction (0,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (1)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (1)
 set hero direction (0,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left)
 wait (1)
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 set hero direction (0,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (1)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (5)
 set hero z (0, 5)
 set hero z (1, 5)
 set hero z (2, 5)
 set hero z (3, 5)
 wait (1)
 set hero z (0, 10)
 set hero z (1, 10)
 set hero z (2, 10)
 set hero z (3, 10)
 wait (1)
 set hero z (0, 15)
 set hero z (1, 15)
 set hero z (2, 15)
 set hero z (3, 15)
 wait (1)
 set hero z (0, 20)
 set hero z (1, 20)
 set hero z (2, 20)
 set hero z (3, 20)
 wait (1)
 set hero z (0, 15)
 set hero z (1, 15)
 set hero z (2, 15)
 set hero z (3, 15)
 set hero z (0, 10)
 set hero z (1, 10)
 set hero z (2, 10)
 set hero z (3, 10)
 wait (1)
 set hero z (0, 5)
 set hero z (1, 5)
 set hero z (2, 5)
 set hero z (3, 5)
 wait (1)
 set hero z (0, 0)
 set hero z (1, 0)
 set hero z (2, 0)
 set hero z (3, 0)
 wait (5)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (2)
 walk hero (0,right,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,left,1)
 wait (1)
 walk hero (0,down,2)
 walk hero (1,down,2)
 walk hero (2,up,2)
 walk hero (3,up,2)
 wait for hero (me)
 set caterpillar mode (off)
 wait (1) 
 camera follows hero (me)
 resume player
 resume box advance
end






script,inn2,begin
 suspend player
 suspend box advance
 walk hero (me,left,7)
 focus camera (4,27,4)
 wait for hero (me)
 suspend caterpillar
 wait (2)
 set hero speed (2)
 set hero direction (me,down)
 wait (3)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (2)
 set caterpillar mode (on)
 set hero position (1, 4, 27)
 set hero position (2, 4, 27)
 set hero position (3, 4, 27)
 wait (4)
 walk hero (0,up,2)
 walk hero (1,up,2)
 walk hero (2,down,2)
 walk hero (3,down,2)

 wait (1)
 walk hero (0,left,2)
 walk hero (1,right,2)
 walk hero (2,left,2)
 walk hero (3,right,2)

 wait for hero (me)

 wait (5)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)

 tweak palette (-20,-20,20)
 fade screen in
 play song (song:Sleeptime)
 wait (180)
 stop song
 wait (5)
 reset palette
 play song (get ambient music)
 wait (5)
 fade screen in
 wait (5)
 #Now the heroes get out of bed
 set hero z (0, 5)
 set hero z (1, 5)
 set hero z (2, 5)
 set hero z (3, 5)
 wait (1)
 walk hero (0,right,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,left,1)
 wait (3)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (1)
 set hero direction (0,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left)
 wait (1)
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 set hero direction (0,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (1)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (1)
 set hero direction (0,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left)
 wait (1)
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 set hero direction (0,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (1)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (1)
 set hero direction (0,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left)
 wait (1)
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 set hero direction (0,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (1)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (5)
 set hero z (0, 10)
 set hero z (1, 10)
 set hero z (2, 10)
 set hero z (3, 10)
 wait (1)
 set hero z (0, 15)
 set hero z (1, 15)
 set hero z (2, 15)
 set hero z (3, 15)
 wait (1)
 set hero z (0, 20)
 set hero z (1, 20)
 set hero z (2, 20)
 set hero z (3, 20)
 wait (1)
 set hero z (0, 15)
 set hero z (1, 15)
 set hero z (2, 15)
 set hero z (3, 15)
 set hero z (0, 10)
 set hero z (1, 10)
 set hero z (2, 10)
 set hero z (3, 10)
 wait (1)
 set hero z (0, 5)
 set hero z (1, 5)
 set hero z (2, 5)
 set hero z (3, 5)
 wait (1)
 set hero z (0, 0)
 set hero z (1, 0)
 set hero z (2, 0)
 set hero z (3, 0)
 wait (5)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (2)
 walk hero (0,right,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,left,1)
 wait (1)
 walk hero (0,down,2)
 walk hero (1,down,2)
 walk hero (2,up,2)
 walk hero (3,up,2)
 wait for hero (me)
 set caterpillar mode (off)
 wait (1) 
 camera follows hero (me)
 resume player
 resume box advance
end



script,inn3,begin
 suspend player
 suspend box advance
 walk hero (me,left,7)
 focus camera (4,44,4)
 wait for hero (me)
 suspend caterpillar
 wait (2)
 set hero speed (2)
 set hero direction (me,down)
 wait (3)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (2)
 set caterpillar mode (on)
 set hero position (1, 4, 44)
 set hero position (2, 4, 44)
 set hero position (3, 4, 44)
 wait (4)
 walk hero (0,up,2)
 walk hero (1,up,2)
 walk hero (2,down,2)
 walk hero (3,down,2)

 wait (1)
 walk hero (0,left,2)
 walk hero (1,right,2)
 walk hero (2,left,2)
 walk hero (3,right,2)

 wait for hero (me)

 wait (5)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)

 tweak palette (-20,-20,20)
 fade screen in
 play song (song:Sleeptime)
 wait (200)
 stop song
 wait (5)
 reset palette
 play song (get ambient music)
 wait (5)
 fade screen in
 wait (5)
 #Now the heroes get out of bed
 set hero z (0, 5)
 set hero z (1, 5)
 set hero z (2, 5)
 set hero z (3, 5)
 wait (1)
 walk hero (0,right,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,left,1)
 wait (3)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (1)
 set hero direction (0,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left)
 wait (1)
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 set hero direction (0,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (1)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (1)
 set hero direction (0,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left)
 wait (1)
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 set hero direction (0,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (1)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (1)
 set hero direction (0,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left)
 wait (1)
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 set hero direction (0,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (1)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (5)
 set hero z (0, 10)
 set hero z (1, 10)
 set hero z (2, 10)
 set hero z (3, 10)
 wait (1)
 set hero z (0, 15)
 set hero z (1, 15)
 set hero z (2, 15)
 set hero z (3, 15)
 wait (1)
 set hero z (0, 20)
 set hero z (1, 20)
 set hero z (2, 20)
 set hero z (3, 20)
 wait (1)
 set hero z (0, 15)
 set hero z (1, 15)
 set hero z (2, 15)
 set hero z (3, 15)
 set hero z (0, 10)
 set hero z (1, 10)
 set hero z (2, 10)
 set hero z (3, 10)
 wait (1)
 set hero z (0, 5)
 set hero z (1, 5)
 set hero z (2, 5)
 set hero z (3, 5)
 wait (1)
 set hero z (0, 0)
 set hero z (1, 0)
 set hero z (2, 0)
 set hero z (3, 0)
 wait (5)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (2)
 walk hero (0,right,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,left,1)
 wait (1)
 walk hero (0,down,2)
 walk hero (1,down,2)
 walk hero (2,up,2)
 walk hero (3,up,2)
 wait for hero (me)
 set caterpillar mode (off)
 wait (1) 
 camera follows hero (me)
 resume player
 resume box advance
end








#Finally! Now time for some more scripts!



script,earthfiend,begin
 suspend player
 suspend box advance
 suspend random enemies
 #We don't want to run into any extra encounters, do we?
 walk hero (me,left,4)
 wait for hero (me) 
 wait (1)
 #These set the heroes to face up, and look up at the boss
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 #This sets the other party members to appear at the leader's position
 set caterpillar mode (on)
 set hero position (1, 12, 9)
 set hero position (2, 12, 9)
 set hero position (3, 12, 9)
 wait (1)
 suspend caterpillar
 #These actions then cause the party to move a bit, so they can all be seen at once.
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2, right,1)
 wait for hero (me)
 #Now, beacuse they've moved, we set the heroes on the side to all face the same direction.
 set hero direction (1,up)
 set hero direction (2,up)
 #Now it's time for some introductory dialogue.  Though its not shown here, Text box 83 has the 
 #party leader say something.
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 #The previous set of commands makes the given hero "twitch" in place.  It's one way of showing
 #that they're speaking.  It's not always needed, but here it's a good idea.
 show textbox (83)
 wait (7)
 #I've found that the delay between just skipping through boxes is *ABOUT* 7-10 ticks.
 #So, since we don't want the game to be too sensitive between when you press a key to
 #advance a text box, we've a delay of 7 ticks before you can advance it.
 wait for key (usekey)
 advance text box
 walk hero (1,up,1)
 #The next textbox has hero (1) saying something, so its only reasonable to indicate that
 #by having whoever's in that slot move to indicate they're doing something.
 wait for hero (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (84)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (2,up,1)
 wait for hero (2)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 #Again, another textbox, this one having hero (2) say something, and move in some way to indicate it.
 #It's not alway needed to have each hero move, or twich or whatever before they speak, but
 #it does give the player the sense that what's being said on screen isn't just text, but
 #being spoken by a character.  Many well known professional games do this too.
 show textbox (85)
 wait (7)
 wait for key (usekey)
 advance text box
 #Now that talking is done, it's time for the enemy to attack!
 walk NPC (1,down,2)
 #So he moves down to face the party first
 wait for NPC (1)
 #....Except he's kinda slow, so we want to wait a bit for him.
 #This next script part was originally done by Mad Cacti.
 #Truthfully, I have no idea what's going on here.
 #Seriously.  But you should always try to indicate to the player that something BIG is coming.
 wait (3)
BossIntroduction
 fight formation (22)
 #Shub-Niggurath, the first boss, can be found in-game at formation 22, so we call that right now.
 set tag (tag:ShubNiggurath, on)
 #Since the boss isn't there, we have to make it vanish!  Set a tag to the NPC so it'll
 #Vanish once the player beats it!
 walk hero (me,up,1)
 wait for hero (me)
 #Now the party's going to face eachother to talk amoungst themselves.
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (105)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (106)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,down,1)
 walk hero (1,right,1)
 walk hero (2,left,1)
 walk hero (3,up,1)
 wait for hero (me)
 set caterpillar mode (off)
 resume caterpillar
 wait (1)
 resume player
 resume random enemies
 resume box advance
end


script,die in battle,begin
  variable(i)

  if(check tag(tag:DO NOT DIE)==OFF)
  then,begin
   (show textbox (596),wait for key (anykey),fade screen out (0,0,0),game over,end)
  else,begin
    for(i,0,3) do,begin
      if (get hero stat(i,stat:HP,current stat) <= 0)
      then (set hero stat(i,stat:HP,1))
    end
  end
end

script,cthulhu1,begin
 suspend player
 suspend box advance
 suspend random enemies
 walk hero (me,down,2)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 46, 13)
 set hero position (2, 46, 13)
 set hero position (3, 46, 13)
 wait (1)
 suspend caterpillar
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2, right,1)
 wait for hero (me)
 #Now, beacuse they've moved, we set the heroes on the side to all face the same direction.
 set hero direction (1,up)
 set hero direction (2,up)
 wait (1)
  show textbox (107)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (108)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (109)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (110)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (1)
 tweak palette (20,-20,20)
 fade screen in
 wait (4)
 set tag (tag:CTHULHU1, on)
 wait (3)
 set tag (tag:CTHULHU1, off)
 wait (3)
 set tag (tag:CTHULHU1, on)
 wait (3)
 set tag (tag:CTHULHU1, off)
 wait (3)
 set tag (tag:CTHULHU1, on)
 wait (3)
 set tag (tag:CTHULHU1, off)
 wait (3)
 set tag (tag:CTHULHU1, on)
 wait (3)
 reset palette
 fade screen in
 walk hero (3,down,1)
 wait for hero (3)
 set hero direction (3,left)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,up)
 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (597)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,down,1)
 walk hero (1,right,1)
 walk hero (2,left,1)
 walk hero (3,up,1)
 wait for hero (me)
 set caterpillar mode (off)
 resume caterpillar
 wait (1)
 resume player
 resume random enemies
 resume box advance
end

script,Tulzcha,begin
 suspend player
 suspend box advance
 suspend random enemies
 walk hero (me,up,3)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 21, 10)
 set hero position (2, 21, 10)
 set hero position (3, 21, 10)
 wait (1)
 suspend caterpillar
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2, right,1)
 wait for hero (me)
 #Now, beacuse they've moved, we set the heroes on the side to all face the same direction.
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 show textbox (118)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (119)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (120)
 wait (7)
 wait for key (usekey)
 advance text box
 #The boss now has to freak out.  Since this character talks REALLY hyper, it should move fast
 #Therefore its speed as an NPC is set to 10.
 #Also, we should have it move around a lot.  In this case, it circles around a well a bunch
 #Before attacking the party.
 wait (2)
 walk NPC (10,up,1)
 wait for NPC (10)
 walk NPC (10,left,1)
 wait for NPC (10)
 walk NPC (10,down,2)
 wait for NPC (10)
 walk NPC (10,right,2)
 wait for NPC (10)
 walk NPC (10,up,2)
 wait for NPC (10)
 walk NPC (10,left,2)
 wait for NPC (10)
 walk NPC (10,down,2)
 wait for NPC (10)
 walk NPC (10,right,2)
 wait for NPC (10)
 walk NPC (10,up,2)
 wait for NPC (10)
 walk NPC (10,left,2)
 wait for NPC (10)
 walk NPC (10,down,2)
 wait for NPC (10)
 walk NPC (10,right,2)
 wait for NPC (10)
 walk NPC (10,up,2)
 wait for NPC (10)
 walk NPC (10,left,2)
 wait for NPC (10)
 walk NPC (10,down,2)
 wait for NPC (10)
 walk NPC (10,right,2)
 wait for NPC (10)
 walk NPC (10,up,2)
 wait for NPC (10)
 walk NPC (10,left,2)
 wait for NPC (10)
 walk NPC (10,down,2)
 wait for NPC (10)
 walk NPC (10,right,2)
 wait for NPC (10)
 walk NPC (10,up,2)
 wait for NPC (10)
 walk NPC (10,left,2)
 wait for NPC (10)
 walk NPC (10,down,2)
 wait for NPC (10)
 walk NPC (10,right,2)
 wait for NPC (10)
 walk NPC (10,up,2)
 wait for NPC (10)
 walk NPC (10,left,2)
 wait for NPC (10)
 walk NPC (10,down,2)
 wait for NPC (10)
 walk NPC (10,right,1)
 wait for NPC (10)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (121)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (122)
 wait (7)
 wait for key (usekey)
 advance text box
 #This next script part was originally done by Mad Cacti.
 #Truthfully, I have no idea what's going on here.
 #Seriously.  But you should always try to indicate to the player that something BIG is coming.
 wait (3)
 BossIntroduction
 #After the nifty color inverting takes place, we've got a battle to fight!  
 fight formation (42)
 #Tulzcha, the second boss, can be found in-game at formation 42, so we call that right now.
 set tag (tag:Tulzcha, on)
 #Since the boss isn't there, we have to make it vanish!  Set a tag to the NPC so it'll
 #Vanish once the player beats it!
 wait (3)
 walk hero (1,down,1)
 wait for hero (1)
 walk hero (1,right,1)
 set hero direction (me,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
  show textbox (123)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (124)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (125)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (126)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (127)
 wait (7)
 wait for key (usekey)
 advance text box

 wait (1)
 tweak palette (20,-20,20)
 fade screen in
 wait (4)
 set tag (tag:CTHULHU2, on)
 wait (3)
 set tag (tag:CTHULHU2, off)
 wait (3)
 set tag (tag:CTHULHU2, on)
 wait (3)
 set tag (tag:CTHULHU2, off)
 wait (3)
 set tag (tag:CTHULHU2, on)
 wait (3)
 set tag (tag:CTHULHU2, off)
 wait (3)
 set tag (tag:CTHULHU2, on)
 wait (3)
 reset palette
 fade screen in
 wait (3)
 walk hero (3,left,1)
 wait for hero (3)
 
 wait (3)
 set hero direction (me,down)
 set hero direction (3,right)
 set hero direction (2,left)
 set hero direction (1,up)
 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (597)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,down,1)
 walk hero (3,right,1)
 walk hero (2,left,1)
 walk hero (1,up,1)
 wait for hero (me)
 set caterpillar mode (off)
 resume caterpillar
 wait (1)
 resume player
 resume random enemies
 resume box advance
end

script,dagon,begin
 suspend player
 suspend box advance
 suspend random enemies
 walk hero (me,up,3)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 5, 55)
 set hero position (2, 5, 55)
 set hero position (3, 5, 55)
 wait (1)
 suspend caterpillar
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2, right,1)
 wait for hero (me)
 #Now, beacuse they've moved, we set the heroes on the side to all face the same direction.
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 show textbox (186)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero z (0, 5)
 wait (2)
 set hero z (0, 0)
 wait (2)
 set hero z (0, 5)
 wait (2)
 set hero z (0, 0)
 wait (2)
 show textbox (187)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (188)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero z (0, 5)
 wait (2)
 set hero z (0, 0)
 wait (2)
 set hero z (0, 5)
 wait (2)
 set hero z (0, 0)
 wait (2)
 show textbox (189)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (190)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero z (1, 5)
 wait (2)
 set hero z (1, 0)
 wait (2)
 set hero z (1, 5)
 wait (2)
 set hero z (1, 0)
 wait (2)
 show textbox (191)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (192)
 wait (7)
 wait for key (usekey)
 advance text box
 #This next script part was originally done by Mad Cacti.
 #Truthfully, I have no idea what's going on here.
 #Seriously.  But you should always try to indicate to the player that something BIG is coming.
 wait (3) #The new boss fight effect!
 BossIntroduction
 #After the nifty color inverting takes place, we've got a battle to fight!  
 fight formation (67)
 #Dagon, the third boss, can be found in-game at formation 67, so we call that right now.
 set tag (tag:Fight Dagon, on)
 #Since the boss isn't there, we have to make it vanish!  Set a tag to the NPC so it'll
 #Vanish once the player beats it!
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (193)
 wait (7)
 wait for key (usekey)
 advance text box
 focus camera (5,51,4)
 wait for camera


 show textbox (194)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (195)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (196)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (197)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (198)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (1)
 tweak palette (20,-20,20)
 fade screen in
 wait (4)
 set tag (tag:CTHULHU3, on)
 wait (3)
 set tag (tag:CTHULHU3, off)
 wait (3)
 set tag (tag:CTHULHU3, on)
 wait (3)
 set tag (tag:CTHULHU3, off)
 wait (3)
 set tag (tag:CTHULHU3, on)
 wait (3)
 set tag (tag:CTHULHU3, off)
 wait (3)
 set tag (tag:CTHULHU3, on)
 wait (3)
 reset palette
 fade screen in
 wait (3)


 focus camera (5,54,4)
 wait for camera
 wait (3)
 set hero direction (me,right)
 walk hero (3,down,1)
 set hero direction (3,up)
 wait (3)
 camera follows hero (me)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,up)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (199)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,down,1)
 walk hero (1,right,1)
 walk hero (2,left,1)
 walk hero (3,up,1)
 wait for hero (me)
 set caterpillar mode (off)
 resume caterpillar
 wait (1)
 resume player
 resume random enemies
 resume box advance
end

script,cthulhu,begin
 suspend player
 suspend box advance
 suspend random enemies
 walk hero to y (me,72)
 wait for hero (me)
 walk hero to x (me,8)
 wait for hero (me)
 set hero direction (me,up)
 set caterpillar mode (on)
 set hero position (1, 8, 72)
 set hero position (2, 8, 72)
 set hero position (3, 8, 72)
 wait (1)
 suspend caterpillar
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2, right,1)
 wait for hero (me)
 #Now, beacuse they've moved, we set the heroes on the side to all face the same direction.
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 show textbox (305)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (306)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (307)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (308)
 wait (7)
 wait for key (usekey)
 advance text box
 #This next script part was originally done by Mad Cacti.
 #Truthfully, I have no idea what's going on here.
 #Seriously.  But you should always try to indicate to the player that something BIG is coming.
 wait (3)
 BossIntroduction
 #After the nifty color inverting takes place, we've got a battle to fight!  
 fight formation (85)
 show textbox (309)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (310)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (311)
 wait (7)
 wait for key (usekey)
 advance text box
 #Cthulhu threatens the party by approaching them
 walk npc (11,down,1)
 show textbox (312)
 wait (7)
 walk hero (me,down,1)
 walk hero (1,down,1)
 walk hero (2,down,1)
 walk hero (3,down,1)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait for hero (me)
 wait for key (usekey)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (313)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (314)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (315)
 wait (7)
 wait for key (usekey)
 advance text box
 BossIntroduction
 fight formation (86)
 show textbox (316)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (317)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (318)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (1)
 tweak palette (20,-20,20)
 fade screen in
 wait (4)
 set tag (tag:defeat Cthulhu, on)
 wait (3)
 set tag (tag:defeat Cthulhu, off)
 wait (3)
 set tag (tag:defeat Cthulhu, on)
 wait (3)
 set tag (tag:defeat Cthulhu, off)
 wait (3)
 set tag (tag:defeat Cthulhu, on)
 wait (3)
 set tag (tag:defeat Cthulhu, off)
 wait (3)
 set tag (tag:defeat Cthulhu, on)
 wait (3)
 reset palette
 fade screen in
 wait (3)
 set hero direction (me,right)
 walk hero (3,down,1)
 set hero direction (3,up)
 wait (3)
 camera follows hero (me)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,up)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (319)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,down,1)
 walk hero (1,right,1)
 walk hero (2,left,1)
 walk hero (3,up,1)
 wait for hero (me)
 set caterpillar mode (off)
 resume caterpillar
 wait (1)
 resume player
 resume random enemies
 resume box advance
end

script,kyle,begin
 suspend player
 suspend box advance
 suspend random enemies
 resume NPC walls
 walk hero to x (me,31)
 wait for hero (me)
 set hero direction (me,up)
 set caterpillar mode (on)
 set hero position (1, 31, 123)
 set hero position (2, 31, 123)
 set hero position (3, 31, 123)
 wait (1)
 suspend caterpillar
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2, right,1)
 wait for hero (me)
 pan camera (up,1,2)
 wait for camera
 #Now, beacuse they've moved, we set the heroes on the side to all face the same direction.
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 show textbox (494)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (495)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (496)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (497)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (498)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (4)
 walk NPC (9,down,1)
 walk hero (me,down,1)
 walk hero (1,down,1)
 walk hero (2,down,1)
 walk hero (3,down,1)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait for hero (me)
 wait (3)
 show textbox (499)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (500)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (501)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (502)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (4)
 greyscale palette
 fade screen in
 wait (10)
 #The new boss fight effect!
 BossIntroduction
 #After the nifty color inverting takes place, we've got a battle to fight!  
 fight formation (104)
 show textbox (505)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (506)
 wait (7)
 walk hero (me,up,1)
 wait for key (usekey)
 advance text box
 show textbox (507)
 wait (7)
 walk hero (1,up,1)
 wait for key (usekey)
 advance text box
 show textbox (508)
 wait (7)
 walk hero (2,up,1)
 wait for key (usekey)
 advance text box
 show textbox (509)
 wait (7)
 walk hero (3,up,1)
 wait for key (usekey)
 advance text box
 show textbox (510)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (511)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (512)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (7)
 set hero direction (me,left)
 set hero direction (1,left)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (5)
 walk NPC (9,down,1)
 walk hero (me,down,1)
 walk hero (1,down,1)
 walk hero (2,down,1)
 walk hero (3,down,1)
 wait for hero (me)
 wait (5)
 stop song
 wait (5)
 tweak palette (-10,-10,-10)
 fade screen in
 wait (5)
 show text box (1763)
 wait (10)
 wait for key (use key)
 advance text box
 wait (5)
 reset palette
 fade screen in
 wait (5)
 set hero direction (me,left)
 set hero direction (1,left)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (5)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (5)
 
#kezef appears
 play sound (sfx:earthquake,false,true)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 wait (5)
 set NPC direction (9,left)
 wait (3)
 set NPC direction (9,up)
 wait (3)
 show text box (1764)
 wait (10)
 wait for key (use key)
 advance text box
 wait (5)
 tweak palette (-10,-10,-10)
 fade screen in
 wait (5)
 show text box (1765)
 wait (10)
 wait for key (use key)
 advance text box
 show text box (1766)
 wait (10)
 wait for key (use key)
 advance text box
 wait (5)
 reset palette
 fade screen in
 wait (5)
 play sound (sfx:earthquake,false,true)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 set tag (tag:suck1,on)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 wait (5)
 show text box (1767)
 wait (7)
 wait for key (use key)
 advance text box


 set NPC direction (9,left)
 wait (3)
 set NPC direction (9,down)
 wait (5)
 show text box (1768)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 tweak palette (-10,-10,-10)
 fade screen in
 wait (5)
 show text box (1769)
 wait (10)
 wait for key (use key)
 advance text box

 wait (5)
 reset palette
 fade screen in
 wait (5)
 play sound (sfx:earthquake,false,true)
 walk NPC (9,up,2)
 set NPC direction (9,down)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 set tag (tag:suck2,on)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 wait (5)
 wait for NPC (9)
 show text box (1770)
 wait (10)
 wait for key (use key)
 advance text box
 wait (5)
 tweak palette (-10,-10,-10)
 fade screen in
 wait (5)
 show text box (1771)
 wait (10)
 wait for key (use key)
 advance text box
 show text box (1772)
 wait (10)
 wait for key (use key)
 advance text box
 wait (5)
 reset palette
 fade screen in
 wait (5)
 play sound (sfx:earthquake,false,true)
 walk NPC (9,up,1)
 set NPC direction (9,down)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera
 set tag (tag:suck3,on) 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 wait (5)
 show text box (1773)
 wait (10)
 wait for key (use key)
 advance text box
 wait (5)
 tweak palette (-10,-10,-10)
 fade screen in
 wait (5)
 show text box (1774)
 wait (10)
 wait for key (use key)
 advance text box
 wait (5)
 reset palette
 fade screen in
 wait (5)
 play sound (sfx:earthquake,false,true)
 walk NPC (9,up,1)
 set NPC direction (9,down)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera
 fade screen out (63,63,63)
 wait (5)
 set caterpillar mode (off)
 resume caterpillar
 camera follows hero (me)
 wait (1)





 use door (63)
 wait (7)
 fade screen in
 show textbox (513)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (514)
 wait (7)
 wait for key (usekey)
 advance text box

 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 12, 14)
 set hero position (2, 12, 14)
 set hero position (3, 12, 14)
 wait (1)
 suspend caterpillar
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,down,1)
 wait for hero (me) 
 wait (3)
 set hero direction (me,right)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,right)
 wait (3)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,up)
 wait (3)
 show textbox (515)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (516)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (517)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,down,1)
 walk hero (1,right,1)
 walk hero (2,left,1)
 walk hero (3,up,1)
 wait for hero (me)
 set caterpillar mode (off)
 resume caterpillar
 wait (1)
 resume player
 resume random enemies
 resume box advance
end

script,azathoth,begin
 suspend player
 suspend box advance
 suspend random enemies
 walk hero to y (me,46)
 wait for hero (me)
 set hero direction (me,up)
 set caterpillar mode (on)
 set hero position (1, 33, 46)
 set hero position (2, 33, 46)
 set hero position (3, 33, 46)
 wait (1)
 suspend caterpillar
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2, right,1)
 wait for hero (me)
 #Now, beacuse they've moved, we set the heroes on the side to all face the same direction.
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 show textbox (518)
 wait (7)
 wait for key (usekey)
 advance text box
 focus camera (33,44,2)
 wait for camera
 wait (12)
 show textbox (519)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (520)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (521)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (522)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (523)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (524)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (525)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (526)
 wait (7)
 wait for key (usekey)
 advance text box
 #At this point, what we THINK is the villan gets scared and runs to the right.
 #This is mostly for comedic effect, but the confrontation is yet to begin!
 walk NPC (1,right,4)
 wait for NPC (1)
 set hero direction (me,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
 wait (12)
 walk NPC (1,down,8)
 wait (4)
 set tag (tag:Azathoth appears, on)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (5)
 walk NPC (13,down,7)
 wait (3)
 walk NPC (9,down,7)
 wait (3)
 walk NPC (17,down,7)
 wait (3)
 walk NPC (5,down,7)
 wait (3)
 walk NPC (12,down,7)
 wait (3)
 walk NPC (21,down,7) 
 wait (3)
 walk NPC (8,down,7)
 wait (3)
 walk NPC (16,down,7)
 wait (3)
 walk NPC (4,down,7)
 wait (3)
 walk NPC (11,down,7)
 wait (3)
 walk NPC (20,down,7)
 wait (3)
 walk NPC (10,down,7)
 wait (3)
 walk NPC (15,down,7)
 wait (3)
 walk NPC (7,down,7)
 wait (3)
 walk NPC (19,down,7)
 wait (3)
 walk NPC (3,down,7)
 wait (3)
 walk NPC (6,down,7)
 wait (3)
 walk NPC (14,down,7)
 wait (3)
 walk NPC (2,down,7)
 wait (3)
 walk NPC (18,down,7)
 wait for NPC (18)
 wait (3)
 set NPC direction (2,right)
 set NPC direction (3,right)
 set NPC direction (4,right)
 set NPC direction (5,right)
 set NPC direction (6,right)
 set NPC direction (7,right)
 set NPC direction (8,right)
 set NPC direction (9,right)
 set NPC direction (10,right)
 set NPC direction (11,right)
 set NPC direction (12,right)
 set NPC direction (13,right)
 set NPC direction (14,right)
 set NPC direction (15,right)
 set NPC direction (16,right)
 set NPC direction (17,right)
 set NPC direction (18,right)
 set NPC direction (19,right)
 set NPC direction (20,right)
 set NPC direction (21,right) 
 wait (3)
 set NPC direction (2,up)
 set NPC direction (3,up)
 set NPC direction (4,up)
 set NPC direction (5,up)
 set NPC direction (6,up)
 set NPC direction (7,up)
 set NPC direction (8,up)
 set NPC direction (9,up)
 set NPC direction (10,up)
 set NPC direction (11,up)
 set NPC direction (12,up)
 set NPC direction (13,up)
 set NPC direction (14,up)
 set NPC direction (15,up)
 set NPC direction (16,up)
 set NPC direction (17,up)
 set NPC direction (18,up)
 set NPC direction (19,up)
 set NPC direction (20,up)
 set NPC direction (21,up) 
 wait (3)
 show textbox (527)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (528)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (529)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (530)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (531)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (532)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (533)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (534)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (4)
 greyscale palette
 fade screen in
 wait (10)
 BossIntroduction
 fight formation (68)

 show textbox (535)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (536)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (537)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (538)
 wait (7)
 wait for key (usekey)
 advance text box
 fade screen out (63,63,63)
 wait (20)
 set caterpillar mode (off)
 resume caterpillar
 camera follows hero (me)
 wait (5) 
 
 use door (0)
 show textbox (539)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (540)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (541)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (542)
 wait (7)
 wait for key (usekey)
 advance text box
 resume player
 resume random enemies
 resume box advance
end


script,credits,begin
 suspend player
set hero speed (me,2) 
 use door (0)
 walk hero (me,down,120)
 wait for hero
 wait (20)
 gameover
end

script,Bramget,begin
 suspend player
 suspend box advance
 focus camera (8,7,4)

 wait for camera
 walk hero (me,down,3)
 wait for hero (me)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (601)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (602)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (5,down,2)
 wait for NPC (5)
 wait (10)
 walk NPC (5,right,2)
 set NPC direction (5,down)
 wait for NPC (5)
 wait (10)
 walk NPC (5,right,2)
 set NPC direction (5,down)
 wait for NPC (5)
 wait (10)
 walk NPC (5,down,1)
 show textbox (603)
 play sound (sfx:Soft_Airy_Swish,false,true)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero z (me,5)
 wait (2)
 set hero z (me,10)
 wait (2)
 set hero z (me,5)
 wait (2)
 set hero z (me,0)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (604)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (605)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (606)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (5,up,1)
 set NPC direction (5,down)
 show textbox (607)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (608)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (5,left,1)
 walk hero (me,right,1)
 wait for hero (me)
 walk NPC (5,down,1)
 walk hero (me,up,1)
 wait for hero (me)
 set NPC direction (5,right)
 set hero direction (me,left)
 show textbox (609)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (610)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,left,1)
 wait for hero (me)
 walk hero (me,up,2)
 wait for hero (me)
 walk NPC (5,right,1)
 wait for NPC (5)
 set NPC direction (5,up)
 set hero direction (me,left)
 wait (4)
 set hero direction (me,down)
 wait (4)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (611)
 wait (7)
 wait for key (usekey)
 advance text box
 add hero (hero:Bram)
 wait (4)
 fade screen out
 wait (1)
 set tag(5,on)
 wait (3)
 set hero direction (me,up)
 camera follows hero
 swap out hero (hero:Freki)
 lock hero (hero:Freki)
 wait (1)
 use door (0)
 resume player
 resume box advance
 #Let's equip Bram with her initial gear!

 force equip ((find hero (hero:Bram)),1,197)
 force equip ((find hero (hero:Bram)),2,205)
 force equip ((find hero (hero:Bram)),3,208)
 force equip ((find hero (hero:Bram)),4,211)
 

end

script,warriorget,begin
 suspend player
 suspend box advance
 swap by position (0,find hero (hero:Bram))
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (612)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,left,2)
 wait for hero (me)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,right)
 wait (3)
 walk NPC (17,left,1)
 show textbox (613)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (614)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (17,down,1)
 show textbox (615)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (me,down)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (616)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,down,1)
 wait for hero
 walk hero (me,right,1)
 wait for hero
 set NPC direction (17,left)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (617)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (618)
 wait (7)
 wait for key (usekey)
 advance text box
 add hero (hero:Kitt)
 suspend obstruction
 walk NPC (17,left,1)
 wait (4)
 resume obstruction
 force equip ((find hero (hero:Kitt)),1,198)
 force equip ((find hero (hero:Kitt)),2,206)
 force equip ((find hero (hero:Kitt)),3,209)
 force equip ((find hero (hero:Kitt)),4,210)
 wait (1)
 set tag(79,on)
 wait (3)
 set hero direction (me,down)
 camera follows hero
 wait (1)
 fade screen in
 resume player
 resume box advance
end

script,missionaryget,begin
 suspend player
 suspend box advance
 show textbox (619)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero to x (me,42)
 wait for hero (me)
 walk hero to y (me,28)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 42, 28)
 wait (1)
 suspend caterpillar
 walk hero (1,down,1)
 wait for hero (1)
 set hero direction (me,right)
 set hero direction (1,right)
 wait (2)
 focus camera (46,28,4)
 wait for camera
 show textbox (620)
 wait (7)
 wait for key (usekey)
 advance text box 
 show textbox (621)
 wait (7)
 wait for key (usekey)
 advance text box
 focus camera (20,28,20)
 wait for camera 
 wait (10)
 focus camera (46,28,20)
 wait for camera
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (622)
 walk hero (1,right,1)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (18,down,1)
 wait for NPC (18)
 walk NPC (18,left,2)
 set NPC direction (19,down)
 wait for NPC (18)
 show textbox (623)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,right,1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (624)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (625)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (1,up,1)
 suspend obstruction
 walk NPC (18,left,2)
 wait for NPC (18)
 set caterpillar mode (off)
 wait (5)
 resume obstruction
 resume caterpillar
 wait (1)
 set tag(80,on)
 focus camera (43,28,4)
 wait for camera
 camera follows hero (me)
 add hero (hero:Frumpy)
 wait (1)
 resume player
 resume box advance
 force equip ((find hero (hero:Frumpy)),1,199)
 force equip ((find hero (hero:Frumpy)),2,205)
 force equip ((find hero (hero:Frumpy)),3,207)
 force equip ((find hero (hero:Frumpy)),4,212)
end

script,shamanget,begin
 suspend player
 suspend box advance
 swap by position (0,find hero (hero:Bram))
 swap by position (1,find hero (hero:Kitt))
 swap by position (2,find hero (hero:Frumpy))
 set caterpillar mode (on)
 set hero position (1, 10, 36)
 set hero position (2, 10, 36)
 wait (1)
 suspend caterpillar
 walk hero (1,down,1)
 walk hero (2,up,1)
 wait for hero (1)
 set hero direction (me,right)
 set hero direction (1,right)
 set hero direction (2,right)
 wait (2)
 show textbox (626)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (627)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (2,right,1)
 wait for hero (2)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (628)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (20, down)
 wait (5)
 set NPC direction (20,left)
 wait (5)
 show textbox (629)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (1,right)
 wait for hero (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (630)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (2,down)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (631)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (632)
 set hero z (me,5)
 wait (2)
 set hero z (me,0)
 wait (2)
 set hero z (me,5)
 wait (2)
 set hero z (me,0)
 wait (2)
 set hero z (me,5)
 wait (2)
 set hero z (me,0)
 wait (2)
 wait for key (usekey)
 advance text box
 show textbox (633)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (0,right,2)
 walk hero (1,left,1)
 wait for hero (0)
 walk hero (1,up,1)
 walk hero (2,down,1)
 set NPC direction (20, down)
 wait (5)
 set hero direction (2,right)
 set NPC direction (20,left)
 wait (5)
 set hero direction (1,right)
 wait (2)
 show textbox (634)
 wait (7)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set NPC direction (20,down)
 wait (5)
 set hero direction (0,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set NPC direction (20,left)
 walk NPC (19,right,8)
 wait for key (usekey)
 advance text box
 show textbox (635)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (1,down,1)
 show textbox (636)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (20,down,2)
 wait for hero (1)
 walk hero (1,right,3)
 wait for NPC (20)
 walk NPC (20,left,3)
 wait for NPC (20)
 walk hero (1,up,1)
 walk NPC (20,up,2)
 wait for NPC (20)
 set hero direction (1,left)
 set NPC direction (20,left)
 show textbox (637)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (638)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (639)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (640)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (641)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (19,left,8)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (642)
 wait (7)
 wait for key (usekey)
 advance text box
 suspend obstruction
 wait (1)
 walk NPC (20,right,2)
 walk hero (1,left,1)
 walk hero (2,right,1)
 wait for NPC (20)
 swap by position (0,find hero (hero:Kitt))
 set caterpillar mode (off)
 wait (5)
 resume obstruction
 resume caterpillar
 wait (2)
 add hero (hero:Night)
 set tag (81,on)
 resume player
 resume box advance
 force equip ((find hero (hero:Night)),1,200)
 force equip ((find hero (hero:Night)),2,205)
 force equip ((find hero (hero:Night)),3,207)
 force equip ((find hero (hero:Night)),4,212)
end

script,rangerget,begin
 suspend player
 suspend box advance
 suspend obstruction
 walk NPC (23,left,2)
 show textbox (643)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (644)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (645)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (646)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (647)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (648)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (649)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,right,1)
 walk NPC (23,left,1)
 wait for hero (me)
 resume obstruction
 wait (2)
 add hero (hero:Styrge)
 set tag (82,on)
 resume player
 resume box advance
 force equip ((find hero (hero:Styrge)),1,201)
 force equip ((find hero (hero:Styrge)),2,206)
 force equip ((find hero (hero:Styrge)),3,208)
 force equip ((find hero (hero:Styrge)),4,211)
end

script,westernpit,begin
 suspend player
 suspend box advance
 walk hero (me,left,3)
 wait for hero (me)
 set hero direction (me,down)
 wait (10)
 walk hero (me,down,1)
 wait (5)
 set hero direction (me,up)
 walk hero (me,down,4)
 set hero speed (me,10)
 wait for hero (me)
 set hero direction (me,down)
 set hero speed (me,4)
 resume player
 resume box advance
end

script,easternpit,begin
 suspend player
 suspend box advance
 walk hero (me,right,3)
 wait for hero (me)
 set hero direction (me,down)
 wait (10)
 walk hero (me,down,1)
 wait (5)
 set hero direction (me,up)
 walk hero (me,down,4)
 set hero speed (me,10)
 wait for hero (me)
 set hero direction (me,down)
 set hero speed (me,4)
 resume player
 resume box advance
end

script,southernpit,begin
 suspend player
 suspend box advance
 walk hero to y (me,56)
 wait for hero (me)
 walk hero to x (me,51)
 wait for hero (me)
 set hero direction (me,down)
 wait (10)
 walk hero (me,down,1)
 wait (5)
 set hero direction (me,up)
 walk hero (me,down,4)
 set hero speed (me,10)
 wait for hero (me)
 set hero direction (me,down)
 set hero speed (me,4)
 resume player
 resume box advance
end

script,firstpit,begin
 suspend player
 suspend box advance
 walk hero to x (me,39)
 wait for hero (me)
 set hero direction (me,down)
 wait (10)
 set hero direction (me,up)
 walk hero (me,down,4)
 set hero speed (me,10)
 wait for hero (me)
 set hero direction (me,down)
 set hero speed (me,4)
 resume player
 resume box advance
end

script,valkyrieget,begin
 suspend player
 suspend box advance
 suspend random enemies
 walk hero (me,down,1)
 wait for hero (me)
 set hero direction (me,up)
 set caterpillar mode (on)
 set NPC direction (5,down)
 set hero position (1, 21, 11)
 set hero position (2, 21, 11)
 set hero position (3, 21, 11)
 wait (1)
 suspend caterpillar
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2, right,1)
 wait for hero (me)
 #Now, beacuse they've moved, we set the heroes on the side to all face the same direction.
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 show textbox (651)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (652)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (653)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (654)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (655)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (656)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (657)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (658)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (1,right,1)
 walk hero (me,down,1)
 walk NPC (5,down,2)
 wait for NPC (5)
 set hero direction (me,right)
 set hero direction (1,right)
 set hero direction (3,right)
 set NPC direction (5,right)
 set hero direction (2,left)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (659)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (660)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (2,left,1)
 add hero (hero:Hilda)
 set tag (84,on)
 wait (2)
 resume obstruction
 set caterpillar mode (off)
 resume caterpillar
 resume player
 resume box advance
 force equip ((find hero (hero:Hilda)),1,204)
 force equip ((find hero (hero:Hilda)),2,206)
 force equip ((find hero (hero:Hilda)),3,209)
 force equip ((find hero (hero:Hilda)),4,210)
end

script,grinlow,begin
 suspend player
 suspend box advance
 suspend random enemies
 walk hero (me,down,1)
 wait for hero (me)
 walk hero to x (me,51)
 focus camera (51,51,4)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 51, 51)
 set hero position (2, 51, 51)
 set hero position (3, 51, 51)
 wait (1)
 suspend caterpillar
 walk hero (1,left,1)
 walk hero (2,up,1)
 walk hero (3,right,1)
 wait for hero (3)
 set hero direction (me,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (679)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (680)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (681)
 wait (7)
 wait for key (usekey)
 advance text box
 set tag (86,on)
 wait (5)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 focus camera (51,47,4)
 wait for camera
 wait (5)
 walk NPC (11,down,1)
 wait for NPC (11)
 show textbox (682)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (683)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (684)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (685)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (686)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (5)
 stop song
 wait (5)
 show textbox (687)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (688)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (5)
 tweak palette (-20,-20,-20)
 fade screen in
 wait (4)
 focus camera (51,51,4)
 wait for camera
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (689)
 wait (7)
 wait for key (usekey)
 advance text box
 BossIntroduction
 fight formation (119)
 set tag (87,on)
 walk hero (me,down)
 wait for hero (me)
 set hero direction (me,left)
 set hero direction (2,left)
 wait (3)
 set hero direction (me,up)
 set hero direction (1,right)
 set hero direction (2,down)
 set hero direction (3,left)
 wait (5)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (690)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (691)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (3,up)
 wait (5)
 walk hero (3,up,1)
 wait for hero (3)
 focus camera (51,47,4)
 wait for camera
 wait (15)
 focus camera (51,51,4)
 wait for camera
 walk hero (3,down,1)
 wait for hero (3)
 set hero direction (3,left)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (692)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (693)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (694)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,up,1)
 walk hero (1,right,1)
 walk hero (2,down,1)
 walk hero (3,left,1)
 wait for hero (me)
 camera follows hero (me)
 set caterpillar mode (off)
 resume caterpillar
 wait (1)
 resume player
 resume random enemies
 resume box advance
end

script,skaldget,begin
 suspend player
 suspend box advance
 suspend random enemies
 show textbox (695)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero to y (me,9)
 wait for hero (me)
 walk hero to x (me,17)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 17, 9)
 set hero position (2, 17, 9)
 set hero position (3, 17, 9)
 wait (1)
 suspend caterpillar
 walk hero (1,left,1)
 walk hero (2,down,1)
 walk hero (3,right,1)
 walk NPC (4,down,7)
 wait for hero (3)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 suspend obstruction
 show textbox (696)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (697)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (698)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (699)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (700)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (701)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (702)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (4,down,2)
 walk hero (1,right,1)
 walk hero (2,up,1)
 walk hero (3,left,1)
 wait for NPC (4)
 resume obstruction
 set tag (88,on)
 add hero (hero:Eric)
 set caterpillar mode (off)
 resume caterpillar
 wait (1)
 resume player
 resume random enemies
 resume box advance
 force equip ((find hero (hero:Eric)),1,203)
 force equip ((find hero (hero:Eric)),2,205)
 force equip ((find hero (hero:Eric)),3,208)
 force equip ((find hero (hero:Eric)),4,211)
end

script,whalepunch,begin
 suspend player
 suspend box advance
 suspend random enemies
 walk NPC (6,left,2)
 wait for NPC (6)
 wait (10)
 set NPC speed (6,20)
 walk NPC (6,right,2)
 wait for NPC (6)
 play sound (sfx:Crush8Bit,false,true)
 suspend hero walls
 set hero speed (me,20)
 walk hero to x (me,56)
 set hero direction (me,left)
 show textbox (711)
 wait (1)
 set hero z (me,10)
 wait (1)
 set hero z (me,20)
 wait (1)
 set hero z (me,30)
 wait (1)
 set hero z (me,40)
 wait (1)
 set hero z (me,50)
 wait (1)
 set hero z (me,60)
 wait (1)
 set hero z (me,70)
 wait (1)
 set hero z (me,80)
 wait (1)
 set hero z (me,90)
 wait (1)
 set hero z (me,100)
 wait (1)
 set hero z (me,120)
 wait (1)
 set hero z (me,130)
 wait for hero (me)
 wait (1)
 set hero z (me,120)
 wait (1)
 set hero z (me,110)
 wait (1)
 set hero z (me,100)
 wait (1)
 set hero z (me,90)
 wait (1)
 set hero z (me,80)
 wait (1)
 set hero z (me,70)
 wait (1)
 set hero z (me,60)
 wait (1)
 set hero z (me,50)
 wait (1)
 set hero z (me,40)
 wait (1)
 set hero z (me,30)
 wait (1)
 set hero z (me,20)
 wait (1)
 set hero z (me,10)
 wait (1)
 set hero z (me,0)
 play sound (sfx:Collision8Bit,false,true)
 wait (1)
 set hero z (me,10)
 wait (1)
 set hero z (me,20)
 wait (1)
 set hero z (me,30)
 wait (1)
 set hero z (me,40)
 wait (1)
 set hero z (me,30)
 wait (1)
 set hero z (me,20)
 wait (1)
 set hero z (me,10)
 wait (1)
 set hero z (me,0)
 play sound (sfx:Collision8Bit,false,true)
 wait (1)
 set hero z (me,10)
 wait (1)
 set hero z (me,20)
 wait (1)
 set hero z (me,30)
 wait (1)
 set hero z (me,20)
 wait (1)
 set hero z (me,10)
 wait (1)
 set hero z (me,0)
 play sound (sfx:Collision8Bit,false,true)
 wait (1)
 set hero z (me,10)
 wait (1)
 set hero z (me,20)
 wait (1)
 set hero z (me,10)
 wait (1)
 set hero z (me,0)
 play sound (sfx:Collision8Bit,false,true)
 wait (1)
 set hero z (me,10)
 wait (1)
 set hero z (me,0)
 play sound (sfx:Collision8Bit,false,true)
 wait (1)
 advance textbox
 resume hero walls
 wait (1)
 resume player
 resume random enemies
 resume box advance
end

script,whaleland,begin
 suspend player
 suspend box advance
 suspend random enemies
 walk hero (me,left,1)
 wait for hero (me)
 suspend hero walls
 walk hero (me,down,5)
 set hero direction (me,up)
 wait for hero (me)
 resume hero walls
 resume player
 resume box advance
 resume random enemies
end

script,berserkerget,begin
 suspend player
 suspend box advance
 suspend random enemies
 show textbox (712)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (713)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero to y (me,28)
 wait for hero (me)
 suspend obstruction
 walk hero to x (me,29)
 wait for hero (me)
 set hero direction (me,up)
 wait (10)
 walk hero (me,up,4)
 wait for hero (me)
 swap by position (0,find hero (hero:Kitt))
 swap by position (2,find hero (hero:Frumpy))
 wait (2)
 walk hero (me,up,3)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 23, 27)
 set hero position (2, 23, 27)
 set hero position (3, 23, 27)
 wait (1)
 suspend caterpillar
 walk hero (1,left,1)
 walk hero (2,down,1)
 walk hero (3,right,1)
 wait for hero (3)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (5)
 focus camera (23,25,4)
 wait for camera
 set NPC direction (17,down)
 show textbox (714)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (715)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (716)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (717)
 walk NPC (12,left,1)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (718)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (12,down)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,up)
 set hero direction (3,left)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (719)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (720)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (12,right,1)
 wait for NPC (12)
 walk NPC (12,down,1)
 wait for NPC (12)
 show textbox (721)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (722)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (723)
 wait (7)
 wait for key (usekey)
 advance text box
 BossIntroduction
 fight formation (120)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (724)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (725)
 wait (7)
 wait for key (usekey)
 advance text box
 focus camera (23,27,4)
 walk NPC (20,up,3)
 show textbox (726)
 wait (7)
 wait for key (usekey)
 set hero direction (me,left)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,left)
 advance text box
 wait (3)
 set hero direction (me,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 walk NPC (12,down,2)
 show textbox (727)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (17,down,1)
 show textbox (728)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (12,left)
 set hero direction (me,left)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,left)
 wait (3)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 show textbox (729)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (730)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (731)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (732)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (733)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (1,right,1)
 walk hero (2,up,1)
 walk hero (3,left,1)
 walk NPC (12,down)
 set tag (89,on)
 add hero (hero:Olaf)
 resume obstruction
 set caterpillar mode (off)
 resume caterpillar
 wait (1)
 set hero direction (me,left)
 wait (5)
 set hero direction (me,down)
 wait (5)
 show textbox (734)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (20,down,3)
 resume player
 resume box advance
 resume random enemies
 camera follows hero (me)
 force equip ((find hero (hero:Olaf)),1,202)
 force equip ((find hero (hero:Olaf)),2,203)
 force equip ((find hero (hero:Olaf)),3,209)
 force equip ((find hero (hero:Olaf)),4,210)
end

script,randomboxpuzzle,begin
 if (random(1,100) >= 50)   then (set tag(90,on)) else (set tag(90,off))
 if (random(1,100) >= 50)   then (set tag(91,on)) else (set tag(91,off))
 if (random(1,100) >= 50)   then (set tag(92,on)) else (set tag(92,off))
 if (random(1,100) >= 50)   then (set tag(93,on)) else (set tag(93,off))
 if (random(1,100) >= 50)   then (set tag(94,on)) else (set tag(94,off))
 if (random(1,100) >= 50)   then (set tag(95,on)) else (set tag(95,off))
 if (random(1,100) >= 50)   then (set tag(96,on)) else (set tag(96,off))
 set tag (98,off)
 use door (8)
end

script,randomboxprize,begin
 #Happens at Midnight, you get an apple!
 if (system hour == 0) then (show text box (747))
 #At 1 AM, you get 100 Gold
 if (system hour == 1) then (show text box (748))
 #At 2 AM, you get a jar of Honey!
 if (system hour == 2) then (show text box (749))
 #At 3 AM, you get a Soma Drop!
 if (system hour == 3) then (show text box (750))
 #At 4 AM, you get a Panacea!
 if (system hour == 4) then (show text box (751))
 #At 5 AM, you find a Throwing Dart!
 if (system hour == 5) then (show text box (752))
 #At 6 AM, you find 3 Meads!
 if (system hour == 6) then (show text box (753), get item (1,3))
 #At 7 AM, you get a sleeping bag!
 if (system hour == 7) then (show text box (754))
 #At 8 AM, you get 500 Gold!
 if (system hour == 8) then (show text box (755))
 #At 9 AM, you get 100 Gold and 1 Mead!
 if (system hour == 9) then (show text box (756), get item (1,1))
 #At 10 AM, you get 1 Apple and 1 Soma!
 if (system hour == 10) then (show text box (757), get item (115,1), get item (116,1))
 #at 11 AM, you get either a potion of vigor, or 100 gold!
 if (system hour == 11) then (show text box (758))

 #Happens at Midday, you get an apple!
 if (system hour == 12) then (show text box (747))
 #At 1 PM, you get 100 Gold
 if (system hour == 13) then (show text box (748))
 #At 2 PM, you get a jar of Honey!
 if (system hour == 14) then (show text box (749))
 #At 3 PM, you get a Soma Drop!
 if (system hour == 15) then (show text box (750))
 #At 4 PM, you get a Panacea!
 if (system hour == 16) then (show text box (751))
 #At 5 PM, you find a Throwing Dart!
 if (system hour == 17) then (show text box (752))
 #At 6 PM, you find 3 Meads!
 if (system hour == 18) then (show text box (753), get item (1,3))
 #At 7 PM, you get a sleeping bag!
 if (system hour == 19) then (show text box (754))
 #At 8 PM, you get 500 Gold!
 if (system hour == 20) then (show text box (755))
 #At 9 PM, you get 100 Gold and 1 Mead!
 if (system hour == 21) then (show text box (756), get item (1,1))
 #At 10 PM, you get 1 Apple and 1 Soma!
 if (system hour == 22) then (show text box (757), get item (115,1), get item (116,1))
 #at 11 PM, you get either a potion of vigor, or 100 gold!
 if (system hour == 23) then (show text box (758))
end

script,enteralfheim,begin
 suspend player
 suspend box advance
 suspend random enemies
 swap by position (0,find hero (hero:Styrge))
 set caterpillar mode (on)
 set hero position (1, 10, 13)
 set hero position (2, 10, 13)
 set hero position (3, 10, 13)
 wait (1)
 suspend caterpillar
 walk hero (me,right,1)
 walk hero (1,up,1)
 walk hero (2,left,1)
 walk hero (3,down,1)
 wait for hero (me)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,down)
 set hero direction (3,right)
 wait (5)
 set hero direction (me,left)
 set hero direction (1,down)
 set hero direction (2,left)
 set hero direction (3,up)
 wait (5)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (804)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (805)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,left,1)
 walk hero (1,down,1)
 walk hero (2,right,1)
 walk hero (3,up,1)
 wait for hero (me)
 resume caterpillar
 set caterpillar mode (off)
 resume player
 resume box advance
 resume random enemies
end

script, jint, begin
 suspend player
 suspend box advance
 suspend random enemies
 walk hero (me,up,2)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 47, 37)
 set hero position (2, 47, 37)
 set hero position (3, 47, 37)
 wait (1)
 suspend caterpillar
 walk hero (1,left,1)
 walk hero (2,down,1)
 walk hero (3,right,1)
 wait for hero (3)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (5)
 focus camera (47,34,4)
 wait for camera
 walk NPC (11,down,3)
 wait for NPC (11)
 show textbox (818)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (819)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (820)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (821)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (1,up,1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (822)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (823)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,up,1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (824)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (825)
 wait (7)
 wait for key (usekey)
 advance text box

 show textbox (826)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (827)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (5)
 stop song
 wait (5)
 show textbox (828)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (829)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (5)
 tweak palette (-20,-20,-20)
 fade screen in
 wait (4)
 focus camera (47,36,4)
 wait for camera
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (830)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (2,up,1)
 walk hero (3,up,1)
 BossIntroduction
 fight formation (121)
 set tag (99,on)
 camera follows hero (me)
 walk hero (me,up,1)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (3,left)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (831)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (832)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (833)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (13,right,9  )
 wait for NPC (13)
 set NPC direction (13,down)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (3,up)
 show textbox (834)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (835)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (836)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (837)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (838)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (839)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (840)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (841)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (842)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,down,1)
 walk hero (1,right,1)
 walk hero (2,up,1)
 walk hero (3,left,1)
 wait for hero (me)
 resume caterpillar
 set caterpillar mode (off)
 resume player
 resume box advance
 resume random enemies
 use door (1)
 set tag (100,on)
end

script,thule1,begin
 suspend player
 suspend box advance
 suspend random enemies
 suspend obstruction
 walk hero (me,down,1)
 wait for hero (me)
 swap by position (0,find hero (hero:Hilda))
 swap by position (1,find hero (hero:Styrge))
 swap by position (2,find hero (hero:Eric))
 swap by position (3,find hero (hero:Frumpy))


 set caterpillar mode (on)
 walk NPC (9,left,8)
 set hero position (1, 13, 27)
 set hero position (2, 13, 27)
 set hero position (3, 13, 27)
 set NPC position (5,13,27)
 set NPC position (6,13,27)
 set NPC position (7,13,27)
 set NPC position (8,13,27)
 focus camera (13,27,4)
 wait for camera
 wait (1)
 suspend caterpillar
 walk NPC (8,left,1)
 walk NPC (6,down,1)
 wait for NPC (6)
 walk NPC (8,left,1)
 walk NPC (6,left,1)
 walk NPC (7,left,1)
 walk NPC (5,down,1)
 wait for NPC (5)
 walk NPC (8,left,1)
 walk NPC (6,left,1)
 walk NPC (7,left,1)
 walk NPC (5,left,1)
 walk hero (1,up,1)
 walk hero (2,left,1)
 walk hero (3,down,1)
 wait for hero (3)
 set hero direction (1,right)
 set hero direction (2,down)
 set hero direction (3,right)
 set NPC direction (5,down)
 set NPC direction (6,down)
 set NPC direction (7,down)
 set NPC direction (8,down)
 wait (5)
 set NPC direction (5,right)
 set NPC direction (6,right)
 set NPC direction (7,right)
 set NPC direction (8,right)
 set hero direction (me,right)
 set hero direction (2,right)
 wait (5)
#everyone should be in position now to do their talking?

 show textbox (844)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (845)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (9,right,8)
 set NPC direction (7,down)
 show textbox (846)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (3,down)
 wait (3)
 set hero direction (3,left)
 wait (3)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (847)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (7,right)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (848)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (0,down)
 set hero direction (3,up)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (849)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (5,down)
 show textbox (850)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (1,down)
 set NPC direction (5,right)
 wait (3)
 set NPC direction (5,up)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (851)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,right,1)
 walk hero (1,right,1)
 wait for hero (me)
 set hero direction (1,left)
 set hero direction (me,left)
 set hero direction (2,right)
 set hero direction (3,up)
 set NPC direction (5,right)
 set NPC direction (6,right)
 set NPC direction (7,right)
 set NPC direction (8,right)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (852)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (853)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (6,down)
 wait (3)
 set NPC direction (6,left)
 show textbox (854)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (2,right,1)
 wait for hero (2)
 set hero direction (2,down)
 wait (3)
 set hero direction (2,left)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (855)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (856)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,right,8)
 walk hero (1,right,8)
 walk hero (2,right,8)
 walk hero (3,right,2)
 wait for hero (3)
 wait (10)
 set hero direction (3,down)
 set NPC direction (5,right)
 set NPC direction (6,right)
 set NPC direction (7,right)
 set NPC direction (8,right)
 wait (3)
 set hero direction (3,left)
 wait (3)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (857)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (7,right,2)
 wait (5)
 show textbox (858)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (859)
 wait (7)
 wait for key (usekey)
 advance text box
 
 fade screen out
 lock hero (hero:Kitt)
 lock hero (hero:Bram)
 lock hero (hero:Olaf)
 lock hero (hero:Night)
 wait (2)
 resume caterpillar
 set caterpillar mode (off)
 resume player
 resume box advance
 resume random enemies
 resume obstruction
 set tag (101,on)
 wait (1)
 camera follows hero (me)
 wait (4)
 fade screen in
 end

script,thule2,begin
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (861)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (862)
 wait (7)
 wait for key (usekey)
 advance text box
#walk to doggy
 walk hero to X (me,16)
 wait for hero (me)
 walk hero to Y (me,19)
 wait for hero (me)
 set hero direction (me,right)
 wait (3)

 set hero position (1, 16, 19)
 set hero position (2, 16, 19)
 set hero position (3, 16, 19)
 wait (1)
 set caterpillar mode (on)
 suspend caterpillar
 wait (1)
 walk hero (1,up,1)
 walk hero (2,left,1)
 walk hero (3,down,1)
 wait for hero (3)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)

 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (863)
 wait (7)
 wait for key (usekey)
 advance text box
#dogero jumps and turns
 set NPC frame (1,0)
 wait (1)
 set NPC frame (1,1)
 wait (1)
 set NPC frame (1,0)
 wait (1)
 set NPC frame (1,1)
 wait (1)
 set NPC frame (1,0)
 wait (1)
 set NPC frame (1,1)
 wait (1)
 set NPC direction (1,down)
 wait (3)
 set NPC direction (1,left)
 wait (3)
 show textbox (864)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (865)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (866)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (867)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,right,1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (868)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,left,1)
 set hero direction (me,right)

 show textbox (869)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (870)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (1,left,1)
 wait for NPC (1)
 show textbox (871)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (1,up)
 wait (3)
 show textbox (872)
 wait (7)
 wait for key (usekey)
 advance text box
#walk bob down to fight too!

 walk NPC (2,down,2)
 set hero direction (me,up)
 set hero direction (3,up)
 wait for NPC (2)

 show textbox (873)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (874)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (875)
 wait (7)
 wait for key (usekey)
 advance text box
#walk chewie left to fight!
 walk NPC (3,left,7)
 wait for NPC (2)
 set NPC direction (2,down)
 wait (3)
 show textbox (876)
 wait (7)
 wait for key (usekey)
 advance text box

 show textbox (877)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (878)
 wait (7)
 wait for key (usekey)
 advance text box

#fight with bobn chewie
 wait (3)
 BossIntroduction
 fight formation (109)
 show textbox (879)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (1,left)
 set hero direction (me,right)
 set hero direction (3,right)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (880)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (1, right,3)
 wait for NPC (1)
 walk NPC (1, down,10)
 walk NPC (3,down,1)
 wait for NPC (10)
 show textbox (881)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (me,up)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (882)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (2,left)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (883)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (884)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (5)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (885)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (3,down,1)
 set hero direction (0,right)
 set hero direction (1,right)
 set hero direction (2,right)
 set hero direction (3,right)
 show textbox (886)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (3,down,4)
 wait for NPC (3)
 set hero direction (0,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 walk NPC (3,down,10)
 wait for NPC (3)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (887)
 wait (7)
 wait for key (usekey)
 advance text box
 set tag (tag:Thule2,on)
 walk NPC (2,up,2)
 walk hero (1,down,1)
 walk hero (2,right,1)
 walk hero (3,up,1)
 wait for hero (me)
 resume caterpillar
 set caterpillar mode (off)
 resume player
 resume box advance
end





script,alfheim1,begin
 suspend random enemies
 suspend player
 suspend box advance
 suspend NPCs
 suspend obstruction
 walk hero to X (me,26)
 wait for hero (me)
 walk hero to Y (me,10)
 focus camera (26,11,4)


 suspend caterpillar
 wait (2)
 set hero direction (me,down)
 wait (2)
 set caterpillar mode (on)
 set NPC position (11,26,18)
 set hero position (1, 26, 10)
 set hero position (2, 26, 10)
 set hero position (3, 26, 10)
 walk NPC (11,up,6)
 wait for NPC (11)
 set NPC position (12,26,12)
 set NPC position (13,26,12)
 set NPC position (14,26,12)
 wait (1)
 swap by position (0,find hero (hero:Styrge))
 swap by position (1,find hero (hero:Hilda))
 swap by position (2,find hero (hero:Eric))
 swap by position (3,find hero (hero:Frumpy))

 wait (3)
 walk hero (1,up,1)
 walk hero (2,left,1)
 walk hero (3,right,1)
 walk NPC (12,left,1)
 walk NPC (13,down,1)
 walk NPC (14,right,1)
 wait (3)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 set NPC direction (12,up)
 set NPC direction (13,up)
 set NPC direction (14,up)
 wait (1)

 wait for hero (me)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (895)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (896)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (897)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero Z (2,5)
 wait (1)
 set hero Z (2,0)
 wait (1)
 set hero Z (2,5)
 wait (1)
 set hero Z (2,0)
 wait (1)
 set hero Z (2,5)
 wait (1)
 set hero Z (2,0)
 wait (1)
 show textbox (898)
 wait (7)
 wait for key (usekey)
 advance text box

 set hero Z (3,5)
 wait (1)
 set hero Z (3,0)
 wait (1)
 set hero Z (3,5)
 wait (1)
 set hero Z (3,0)
 wait (1)
 set hero Z (3,5)
 wait (1)
 set hero Z (3,0)
 wait (1)
 show textbox (899)
 wait (7)
 wait for key (usekey)
 advance text box

 set NPC frame (12,0)
 wait (1)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 set NPC frame (12,1)
 wait (1)
 show textbox (900)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (901)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (902)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (11,left)
 wait (2)
 show textbox (903)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (12,right)
 wait (2)
 show textbox (904)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (905)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (11,up)
 set NPC direction (12,up)

 show textbox (906)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (907)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (908)
 wait (7)
 wait for key (usekey)
 advance text box
 fade screen out
 focus camera (26,22,20)
 swap by position (0,find hero (hero:Styrge))
 swap by position (1,find hero (hero:Olaf))
 swap by position (2,find hero (hero:Eric))
 swap by position (3,find hero (hero:Night))
 wait (1)
 unlock hero (hero:Olaf)
 unlock hero (hero:Night)
 lock hero (hero:Frumpy)
 lock hero (hero:Hilda)
 wait (2)
 stop song

 set tag (tag:CTHULHU1, off)
 wait for camera
 fade screen in
 wait (1)
 play song (song:Vile)

 set NPC direction (19,left)
 wait (3)
 set NPC direction (19,down)
 wait (3)
 show textbox (909)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (910)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (16,right)
 set NPC direction (17,right)
 set NPC direction (19,right)
 wait (2)
 show textbox (911)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (912)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (913)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (914)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (16,up)
 set NPC direction (17,up)
 set NPC direction (19,down)
 wait (1)
 show textbox (915)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (2)
 tweak palette (20,-20,20)
 fade screen in
 wait (4)
 set tag (tag:CTHULHU1, on)
 wait (3)
 set tag (tag:CTHULHU1, off)
 wait (3)
 set tag (tag:CTHULHU1, on)
 wait (3)
 set tag (tag:CTHULHU1, off)
 wait (3)
 set tag (tag:CTHULHU1, on)
 wait (3)
 set tag (tag:CTHULHU1, off)
 wait (3)
 set tag (tag:CTHULHU1, on)
 wait (3)
 reset palette
 fade screen in
 walk NPC (18,up,2)
 wait for NPC (18)
 play song (song:21  The Long Silence)
 set NPC direction (16,right)
 set NPC direction (17,right)
 show textbox (916)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (917)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (18,left)
 wait (3)
 set NPC direction (18,down)
 wait (3)
 show textbox (918)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (919)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (920)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (18,left)
 wait (3)
 set NPC direction (18,up)
 wait (3)
 show textbox (921)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (17,left,1)
 show textbox (922)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (923)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (924)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (925)
 wait (7)
 wait for key (usekey)
 advance text box
 fade screen out 
 wait (3)
 stop song
 wait (2)
 set tag (104,on)
 wait (2)
 camera follows hero (me)
 resume random enemies
 resume player
 resume obstruction
 resume NPCs
 resume box advance
 resume caterpillar
 set caterpillar mode (off)
 wait (4)
 play song (song:forest02)
 fade screen in
end

script,niffbox,begin
 suspend player
 suspend box advance
 show textbox (932)
 wait (7)
 wait for key (usekey)
 advance text box
 focus camera (10,18,5)
 wait for camera
 wait (10)
 focus camera (12,28,5)
 wait for camera
 wait (10)
 focus camera (22,24,5)
 wait for camera
 wait (5)
 camera follows hero (me)
 resume box advance
 resume player
end

script,elfshouse1,begin
 suspend player
 suspend box advance
 walk hero to x (me,47)
 wait for hero (me)
 walk hero to y (me,7)
 wait for hero (me)
 suspend caterpillar
 swap by position (0,find hero (hero:Styrge))
 swap by position (1,find hero (hero:Olaf))
 swap by position (2,find hero (hero:Eric))
 swap by position (3,find hero (hero:Night))
 wait (1)
 set caterpillar mode (on)
 set hero position (1, 47, 7)
 set hero position (2, 47, 7)
 set hero position (3, 47, 7)
 wait (2)
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (929)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (3,down,1)
 wait for hero (3)
 wait (3)
 set hero direction (me,left)
 set hero direction (1,down)
 set hero direction (2,down)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (930)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (3,down,4)
 wait for hero (3)
 wait (3)
 walk hero (2,down,1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (931)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (2,left)
 wait (5)
 set hero direction (2,down)
 wait (5)
 fade screen out
 wait (1)
 swap by position (0,find hero (hero:Night))
 swap out hero (hero:Styrge)
 swap out hero (hero:Olaf)
 swap out hero (hero:Eric)
 wait (1)
 lock hero (hero:Styrge)
 lock hero (hero:Olaf)
 lock hero (hero:Eric)
 set caterpillar mode (off)
 wait (3)
 use door (15)
 resume box advance
 resume player
 wait (2)
 fade screen in
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (959)
 wait (7)
 wait for key (use key)
 advance text box
end

script,alfheim2,begin
 suspend box advance
 suspend player
 show text box (960)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero to y (me,21)
 wait for hero (me)
 walk hero to x (me,47)
 wait for hero (me)
 set hero direction (me,up)
 wait (4)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (961)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (962)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (7,down,1)
 walk hero (me,down,1)
 set hero direction (me,up)
 wait for NPC (11)
 show text box (963)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (964)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (7,left)
 wait (4)
 set NPC direction (7,up)
 wait (4)
 show text box (965)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (966)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,up,1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (967)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (7,left)
 show text box (968)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (969)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (7,down)
 wait (4)
 show text box (970)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (971)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (-20,20,20)
 fade screen in
 wait (4)
 set tag (tag:HATI2, on)
 wait (3)
 set tag (tag:HATI2, off)
 wait (3)
 set tag (tag:HATI2, on)
 wait (3)
 set tag (tag:HATI2, off)
 wait (3)
 set tag (tag:HATI2, on)
 wait (3)
 set tag (tag:HATI2, off)
 wait (3)
 set tag (tag:HATI2, on)
 wait (3)
 reset palette
 fade screen in
 walk hero (me,up,2)
 wait for hero (me)
 wait (4)
 set hero direction (me,left)
 wait (4)
 set hero direction (me,right)
 wait (4)
 set hero direction (me,left)
 wait (4)
 set hero direction (me,right)
 wait (4)
 set hero direction (me,left)
 wait (4)
 set hero direction (me,right)
 wait (4)
 walk NPC (6,down,6)
 wait for NPC (6)
 focus camera (47,17,4)
 wait for camera
 show text box (972)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,left)
 wait (4)
 set hero direction (me,up)
 wait (4)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (973)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (974)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (975)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (976)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (977)
 wait (7)
 wait for key (use key)
 advance text box
 stop song
 wait (2)
 show text box (978)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (979)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 tweak palette (-20,-20,-20)
 fade screen in

 walk NPC (8,right,10)
 wait for NPC (8)
 show text box (980)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (981)
 wait (7)
 wait for key (use key)
 advance text box

 swap in hero (hero:Freki)
 set hero direction (me,up)
 set NPC direction (8,up)
 wait (3)
 BossIntroduction
 fight formation (122)
 set tag (tag:TRIANGLE, on)
 focus camera (47,19,4)
 swap out hero (hero:Freki)
 show text box (984)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (985)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (6,up,6)
 show text box (986)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,left)
 set NPC direction (8,right)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (987)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (988)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (989)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (8,left,2)
 wait for NPC (8)
 wait (4)
 set NPC direction (8,down)
 wait (4)
 set NPC direction (8,right)
 wait (4)
 show text box (990)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 swap by position (0,find hero (hero:Styrge))
 swap out hero (hero:Night)
 camera follows hero (me)
 lock hero (hero:Night)
 use door (14)
 resume box advance
 resume player
end

script,alfheim3,begin
 suspend player
 suspend box advance
 stop song
 walk hero to Y (me,22)
 wait for hero (me)
 walk hero to X (me,61)
 wait for hero (me)
 set hero direction (me,up)
 wait (5)
 play song (song:Towards Odds Impassible)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1000)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1001)
 wait (7)
 wait for key (usekey)
 advance textbox
 wait (5)
 fade screen out
 wait (3)
 show textbox (1002)
 wait (2)
 fade screen in
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1003)
 wait (7)
 wait for key (usekey)
 advance textbox

 show textbox (1004)
 wait (7)
 wait for key (usekey)
 advance textbox

 show textbox (1005)
 wait (7)
 wait for key (usekey)
 fade screen out
 wait (3)
 advance textbox
 wait (2)
 fade screen in
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1006)
 wait (7)
 wait for key (usekey)
 advance textbox

 set NPC position (10,61,24)
 set NPC direction (10,up)
 wait (3)
 walk NPC (10,up,1)
 show textbox (1007)
 wait (7)
 wait for key (usekey)
 advance textbox
 wait (5)
 set hero direction (me,left)
 wait (5)
 set hero direction (me,down)
 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1008)
 wait (7)
 wait for key (usekey)
 advance textbox
 fade screen out
 wait (2)
 swap in hero (hero:Olaf)
 swap in hero (hero:Eric)
 swap in hero (hero:Night)
 wait (3)
 use door (14)
 wait (1)
 set ambient music (song:forest01)
 wait (1)
 save map state
 resume player
 resume box advance
end

script,alfheim4,begin
 swap by position (0,find hero (hero:Styrge))
 swap by position (1,find hero (hero:Olaf))
 swap by position (2,find hero (hero:Night))
 swap by position (3,find hero (hero:Eric))
 suspend player
 suspend box advance
 suspend obstruction
 walk hero (me,up,2)
 wait for hero (me)
 suspend caterpillar
 set caterpillar mode (on)
 set hero position (1, 14, 13)
 set hero position (2, 14, 13)
 set hero position (3, 14, 13)
 wait (2)
 walk hero (me,left,1)
 walk hero (1,up,1)
 walk hero (2,down,1)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left)
 wait for hero (me)
 walk NPC (14,right,11)
 wait for NPC (14)
 show textbox (1017)
 wait (7)
 wait for key (usekey)
 advance textbox
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (1018)
 walk hero (1,left,1)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1019)
 wait (7)
 wait for key (usekey)
 set NPC direction (14,down)
 wait (5)
 set NPC direction (14,left)
 wait (5)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1020)
 wait (7)
 wait for key (usekey)
 advance textbox
 set NPC direction (14,down)
 wait (5)
 set NPC direction (14,right)
 wait (5)
 show textbox (1021)
 wait (7)
 wait for key (usekey)
 advance textbox
 stop song
 wait (2)
 show text box (978)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (979)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 BossIntroduction
 fight formation (124)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1022)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1023)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1024)
 wait (7)
 wait for key (use key)
 advance text box
 stop song
 wait (2)
 walk hero (2,left,1)
 show text box (978)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (979)
 wait (7)
 wait for key (use key)
 advance text box
 wait (15)
 set NPC direction (14,left)
 wait (3)
 set NPC direction (14,right)
 wait (3)
 set NPC direction (14,left)
 wait (3)
 set NPC direction (14,right)
 wait (3)
 set NPC direction (14,left)
 wait (3)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1025)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (1,down)
 set hero direction (2,up)
 set hero direction (me,down)
 wait (5)
 set hero direction (me,right)
 set hero direction (1,right)
 set hero direction (2,right)
 wait (5)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1026)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1027)
 set NPC direction (14,right)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1028)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set hero direction (1,down)
 set hero direction (2,up)
 set hero direction (me,down)
 wait (5)
 set hero direction (me,left)
 set hero direction (1,left)
 set hero direction (2,left)
 wait (5)
 BossIntroduction
 fight formation (125)
 set tag (tag:AlfheimFinish,on)
 show text box (1030)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1031)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1032)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1033)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1034)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1035)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,left,1)
 walk hero (1,left,2)
 walk hero (2,left,2)
 walk hero (3,left,1)
 wait for hero (me)
 set hero direction (1,down)
 set hero direction (2,up)
 wait (10)
 fade screen out
 wait (5)
 show text box (1036)
 wait (5)
 fade screen in
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1037)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1038)
 wait (7)
 wait for key (use key)
 fade screen out
 wait (5)
 advance text box
 show text box (1039)
 wait (5)
 fade screen in
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1040)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1041)
 wait (7)
 wait for key (use key)
 fade screen out
 wait (5)
 advance text box
 wait (2)
 fade screen in
 wait (5)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1042)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1043)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 stop song
 wait (5)
 set NPC direction (14,down)
 wait (5)
 show text box (1044)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1045)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1046)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1047)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (5)
 set hero position (0, 23, 26)
 set hero position (1, 22, 26)
 set hero position (2, 24, 26)
 set hero position (3, 23, 25)
 set NPC position (14, 23, 28)
 set NPC direction (14,down)
 wait (2)
 set hero direction (me,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (2)
 fade screen in
 wait (10)
 walk hero (me,down,1)
 wait for hero (me)
 wait (10)
 set NPC position (19, 23, 28)
 wait (10)

 walk NPC (14,down,3)
 walk NPC (19,down,3)
 wait for NPC (19)
 set tag (tag:TriangleDies, off)
 wait (3)
 set tag (tag:TriangleDies, on)
 wait (3)
 set tag (tag:TriangleDies, off)
 wait (3)
 set tag (tag:TriangleDies, on)
 wait (3)
 set tag (tag:TriangleDies, off)
 wait (3)
 set tag (tag:TriangleDies, on)
 wait (10)
 set tag (tag:BurnOver, on)
 wait (3)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1048)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1049)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 unlock hero (hero:Kitt)
 unlock hero (hero:Hilda)
 unlock hero (hero:Olaf)
 unlock hero (hero:Styrge)
 unlock hero (hero:Eric)
 unlock hero (hero:Bram)
 unlock hero (hero:Frumpy)
 unlock hero (hero:Night)
 wait (5)
 resume caterpillar
 set caterpillar mode (off)
 set tag (tag:HeroesRegained,on)
 use door (0)
 fade screen in
 resume obstruction
 show text box (1050)
 wait (7)
 wait for key (use key)
 advance text box

 resume box advance
 resume player
end

script,jotunheim1,begin
 suspend player
 suspend box advance
 suspend random enemies
 walk hero (me,down,2)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 37, 26)
 set hero position (2, 37, 26)
 set hero position (3, 37, 26)
 wait (1)
 suspend caterpillar
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2, right,1)
 wait for hero (me)
 #Now, beacuse they've moved, we set the heroes on the side to all face the same direction.
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)

 show text box (1053)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1054)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1055)
 wait (7)
 wait for key (use key)
 advance text box
 wait (1)
 walk hero (1,up,1)
 wait for hero (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1056)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1057)
 wait (7)
 wait for key (use key)
 advance text box
 wait (1)
 walk hero (2,up,1)
 wait for hero (2)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1058)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1059)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (3,up,1)
 wait for hero (3)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1060)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1061)
 wait (7)
 wait for key (use key)
 advance text box

 wait (5)
 stop song
 wait (5)
 show textbox (828)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (829)
 wait (7)
 wait for key (usekey)
 advance text box
 tweak palette (-20,-20,-20)
 fade screen in
 wait (4)
 show textbox (830)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (5)
 BossIntroduction
 fight formation (126)
 stop song

 show textbox (1064)
 wait (7)
 wait for key (usekey)
 advance textbox
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1065)
 wait (7)
 wait for key (usekey)
 advance textbox
 wait (10)
 play song (song:GodsOfSpite)
 wait (5)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1066)
 wait (7)
 wait for key (usekey)
 advance textbox
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1067)
 wait (7)
 wait for key (usekey)
 advance textbox
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1068)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1069)
 wait (7)
 wait for key (usekey)
 advance textbox
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1070)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1071)
 wait (7)
 wait for key (usekey)
 advance textbox
 set NPC direction (7,left)
 wait (5)
 set NPC direction (7,up)
 wait (5)
 set NPC direction (7,right)
 wait (5)
 set NPC direction (7,down)
 wait (5)
 set NPC direction (7,left)
 wait (4)
 set NPC direction (7,up)
 wait (4)
 set NPC direction (7,right)
 wait (4)
 set NPC direction (7,down)
 wait (4)
 set NPC direction (7,left)
 wait (3)
 set NPC direction (7,up)
 wait (3)
 set NPC direction (7,right)
 wait (3)
 set NPC direction (7,down)
 wait (3)
 set NPC direction (7,left)
 wait (2)
 set NPC direction (7,up)
 wait (2)
 set NPC direction (7,right)
 wait (2)
 set NPC direction (7,down)
 wait (2)
 set NPC direction (7,left)
 wait (1)
 set NPC direction (7,up)
 wait (1)
 set NPC direction (7,right)
 wait (1)
 set NPC direction (7,down)
 wait (1)
 set tag (tag:Jotun1,on)
 walk hero (me,down)
 walk hero (1,right)
 walk hero (2,left)
 resume player
 resume box advance
 resume random enemys
 set caterpillar mode (off)
 resume caterpillar
end



script,jotunheim2,begin
 suspend player
 suspend box advance
 suspend random enemies
 set tag (tag:CTHULHU1, off)
 walk hero (me,down,2)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 6, 9)
 set hero position (2, 6, 9)
 set hero position (3, 6, 9)
 wait (1)
 suspend caterpillar
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2, right,1)
 wait for hero (me)
 #Now, beacuse they've moved, we set the heroes on the side to all face the same direction.
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (5)
 focus camera (6,6,4)
 wait for camera
 wait (5)
 walk NPC (5,right,1)
 walk NPC (6,left,1)
 walk NPC (3,down,1)
 wait for NPC (3)
 walk NPC (6,down,2)
 walk NPC (5,down,2)
 walk NPC (3,down,2)
 walk NPC (4,down,3)
 wait for NPC (3)
 wait (5)
 walk NPC (4,left,1)
 set NPC direction (4,down)
 wait for NPC (4)
 show textbox (1072)
 wait (7)
 wait for key (usekey)
 advance textbox 
 set hero frame (0, 0)
 wait (1)
 set hero frame (0, 1)
 wait (1)
 set hero frame (0, 0)
 wait (1)
 set hero frame (0, 1)
 wait (1)
 show textbox (1073)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1074)
 wait (7)
 wait for key (usekey)
 advance textbox
 set hero frame (0, 0)
 wait (1)
 set hero frame (0, 1)
 wait (1)
 set hero frame (0, 0)
 wait (1)
 set hero frame (0, 1)
 wait (1)
 show textbox (1075)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1076)
 wait (7)
 wait for key (usekey)
 advance textbox
 set hero frame (0, 0)
 wait (1)
 set hero frame (0, 1)
 wait (1)
 set hero frame (0, 0)
 wait (1)
 set hero frame (0, 1)
 wait (1)
 show textbox (1077)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1078)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1079)
 wait (7)
 wait for key (usekey)
 advance textbox
 wait (2)
 tweak palette (20,-20,20)
 fade screen in
 wait (4)
 set tag (tag:CTHULHU1, on)
 wait (3)
 set tag (tag:CTHULHU1, off)
 wait (3)
 set tag (tag:CTHULHU1, on)
 wait (3)
 set tag (tag:CTHULHU1, off)
 wait (3)
 set tag (tag:CTHULHU1, on)
 wait (3)
 set tag (tag:CTHULHU1, off)
 wait (3)
 set tag (tag:CTHULHU1, on)
 wait (3)
 reset palette
 fade screen in
 show textbox (1080)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1081)
 wait (7)
 wait for key (usekey)
 advance textbox
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1082)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1083)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1084)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1085)
 wait (7)
 wait for key (usekey)
 advance textbox
 wait (5)
 stop song
 wait (5)
 set NPC direction (6,right)
 set NPC direction (5,left)
 walk NPC (4,right,1)
 set NPC direction (4,up)
 show textbox (1086)
 wait (7)
 wait for key (usekey)
 advance textbox
 wait for NPC (4)
 walk NPC (5,up,2)
 walk NPC (6,up,2)
 wait for NPC (6)
 walk NPC (5,left,1)
 walk NPC (6,right,1)
 wait for NPC (6)
 wait (5)
 walk NPC (4,up,2)
 wait for NPC (4)
 wait (5)
 fade screen out
 wait (5)
 resume random enemys
 resume caterpillar
 set caterpillar mode (off)
 wait (5)
 show text box (1087)
 wait (5)
 fade screen in
 wait (20)
 fade screen out
 wait (2)
 camera follows hero (me)
 advance textbox
 wait (1)
 fade screen in
 play song (song:Jotunheim01)
 resume box advance
 resume player
end

script,stairsup,begin
 set tag (tag:stairs,on)
 suspend player
 suspend box advance
 walk hero (me,up,5)
 walk hero (me,left,5)
 wait for hero (me)
 walk hero (me,left,2)
 wait for hero (me)
 set tag (tag:stairs,off)
 resume player
 resume box advance
end

script,stairsdown,begin
 set tag (tag:stairs,on)
 suspend player
 suspend box advance
 walk hero (me,right,1)
 wait for hero (me)
 walk hero (me,down,5)
 walk hero (me,right,5)
 wait for hero (me)
 walk hero (me,right,1)
 wait for hero (me)
 set tag (tag:stairs,off)
 resume player
 resume box advance
end

script,Gahn,begin
 suspend player
 suspend box advance
 focus camera (5,45,4)
 walk hero (me,down,1)
 set hero direction (me,up)
 wait for hero (me)
 walk hero (me,left,1)
 set hero direction (me,up)
 wait for hero (me)
 set NPC direction (26,left)
 wait (5)
 set NPC direction (26,up)
 wait (5)
 show textbox (1088)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1089)
 wait (7)
 wait for key (usekey)
 advance textbox

 walk NPC (26,left,2)
 wait for NPC (26)
 walk NPC (26,up,2)
 wait for NPC (26)
 focus camera (5,50,4)
 wait for camera
 camera follows hero (me)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set tag (tag:gahn,on)
 resume player
 resume box advance
end

script,JO,begin
 suspend player
 suspend box advance
 walk hero to Y (me,52)
 wait for hero (me)
 walk hero to X (me,30)
 wait for hero (me)
 set hero direction (me,up)
 focus camera (30,46,4)
 wait for camera
 show textbox (1090)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1091)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1092)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1093)
 wait (7)
 wait for key (usekey)
 advance textbox
 show textbox (1094)
 wait (7)
 wait for key (usekey)
 advance textbox
 focus camera (30,52,4)
 wait for camera
 set tag (tag:jo,on)
 resume box advance
 resume player
 camera follows hero (me)
end

script,orlock,begin
 suspend player
 suspend box advance
 walk hero to x (me,83)
 wait for hero (me)
 walk hero to y (me,4)
 wait for hero (me)
 set hero direction (me,up)
 suspend NPCs
 suspend NPC walls
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1095)
 wait (7)
 wait for key (usekey)
 advance textbox 

 walk NPC (32,down,3)
 wait for NPC (32)
 wait (4)
 BossIntroduction
 fight formation (127)

 set tag (tag:orlock,on)
 resume NPC walls
 resume box advance
 wait (1)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:Wind,false,true)
 wait (10)
 reset palette
 fade screen in
 show textbox (1249)
 wait (7)
 wait for key (usekey)
 advance textbox 

 resume NPCs
 resume player
 resume box advance
end

script,finalbrising,begin
 suspend player
 suspend box advance
 suspend NPCs
 suspend obstruction


 walk hero to y (me,71)
 wait for hero (me)
 walk hero to x (me,8)
 wait for hero (me)
 wait (2)
 suspend caterpillar
 set caterpillar mode (on)
 set hero position (1, 8, 71)
 set hero position (2, 8, 71)
 set hero position (3, 8, 71)
 wait (2)
 walk hero (me,down,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,up,1)
 wait for hero (me)
 set hero direction (me,left)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,left)
 wait (4)
 set hero direction (me,up)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,down)
 wait (4)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1096)
 wait (7)
 wait for key (usekey)
 advance textbox
 show text box (1097)
 wait (7)
 wait for key (usekey)
 advance textbox
 walk NPC to y (30,74)

 set hero direction (me,left)
 set hero direction (1,down)
 set hero direction (2,down)
 wait (4)
 set hero direction (me,down)
 wait (4)
 set tag (tag:gahn,off)
 set tag (tag:jo,off)
 wait for NPC (30)
 wait (2)
 set NPC position (26, 8, 74)
 set NPC position (27, 8, 74)
 wait (1)
 walk NPC (26,left,1)
 walk NPC (27,right,1)
 wait (5)
 set NPC direction (26,up)
 set NPC direction (27,up)
 wait (5)
 walk hero (2,down,1)
 wait for hero (2)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1098)
 wait (7)
 wait for key (usekey)
 advance textbox
 show text box (1099)
 wait (7)
 wait for key (usekey)
 advance textbox
 walk hero (1,down,1)
 wait for hero (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1100)
 wait (7)
 wait for key (usekey)
 advance textbox
 show text box (1101)
 wait (7)
 wait for key (usekey)
 advance textbox
 show text box (1102)
 wait (7)
 wait for key (usekey)
 advance textbox
 show text box (1103)
 wait (7)
 wait for key (usekey)
 advance textbox
 walk hero (3,down,1)
 wait for hero (3)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1104)
 wait (7)
 wait for key (usekey)
 advance textbox
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1105)
 wait (7)
 wait for key (usekey)
 advance textbox
 walk NPC (30,up,1)
 wait for NPC (30)
 show text box (1106)
 wait (7)
 wait for key (usekey)
 advance textbox
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1107)
 wait (7)
 wait for key (usekey)
 advance textbox

 walk NPC (26,up,1)
 wait for NPC (26)
 show text box (1108)
 wait (7)
 wait for key (usekey)
 advance textbox
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1109)
 wait (7)
 wait for key (usekey)
 advance textbox
 walk NPC (27,up,1)
 wait for NPC (27)
 show text box (1110)
 wait (7)
 wait for key (usekey)
 advance textbox
 wait (4)
 fade screen out
 wait (2)
 show text box (1111)
 wait (2)
 greyscale palette
 wait (2)
 fade screen in
 wait (7)
 wait for key (usekey)
 advance textbox
 show text box (1112)
 wait (7)
 wait for key (usekey)
 advance textbox
 walk NPC (30,down)
 walk NPC (26,down)
 walk NPC (27,down)
 show text box (1113)
 wait (7)
 set NPC direction (30,up)
 set NPC direction (26,up)
 set NPC direction (27,up)
 wait for key (usekey)
 advance textbox
 show text box (1114)
 wait (7)
 wait for key (usekey)
 fade screen out
 wait (2)
 advance textbox
 wait (2)
 reset palette
 wait (2)
 fade screen in
 wait (2)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1115)
 wait (7)
 wait for key (usekey)
 advance textbox
 show text box (1116)
 wait (7)
 wait for key (usekey)
 advance textbox
 walk NPC (33,up,1)
 wait for NPC (33)
 walk NPC (33,right,3)
 wait for NPC (33)
 set NPC direction (33,up)
 play sound (sfx:Soft_Airy_Swish,false,true)
 wait (3)
 walk NPC (33,left,2)
 wait for NPC (33)
 set hero direction (me,left)
 set hero direction (2,left)
 set NPC direction (26,left)
 set NPC direction (27,left)
 set NPC direction (30,left)
 walk NPC (33,down,2)
 wait for NPC (33)
 set hero direction (me,down)
 set hero direction (2,down)
 set NPC direction (26,down)
 set NPC direction (27,down)
 set NPC direction (30,down)
 walk NPC (33,down,10)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1117)
 walk hero (me,down,1)
 wait (7)
 wait for key (usekey)
 advance textbox
 show text box (1118)
 wait (7)
 wait for key (usekey)
 advance textbox
 show text box (1119)
 wait (7)
 wait for key (usekey)
 advance textbox
 walk hero (me,down,5)
 walk hero (1,down,5)
 walk hero (2,down,5)
 walk hero (3,down,5)
 walk NPC (26,down,5)
 walk NPC (27,down,5)
 walk NPC (30,down,5)
 wait (10)
 fade screen out
 wait for hero (me)
 camera follows hero (me)
 use door (55)
 resume NPCs
 resume obstruction
 set tag (tag:gahn,on)
 set tag (tag:jo,on)
 wait (20)
 wait for key (anykey)
 wait (2)
 fade screen out
 wait (1)
 swap by position (0,find hero (hero:Freki))
 wait (1)
 swap out hero (hero:Kitt)
 swap out hero (hero:Styrge)
 swap out hero (hero:Bram)
 swap out hero (hero:Eric)
 swap out hero (hero:Hilda)
 swap out hero (hero:Olaf)
 swap out hero (hero:Night)
 swap out hero (hero:Frumpy)
 wait (1)
 lock hero (hero:Kitt)
 lock hero (hero:Styrge)
 lock hero (hero:Bram)
 lock hero (hero:Eric)
 lock hero (hero:Hilda)
 lock hero (hero:Olaf)
 lock hero (hero:Night)
 lock hero (hero:Frumpy)
 walk hero (me,up,1)
 wait for hero (me)
 use door (1)
 wait (5)
 focus camera (6,20,4)
 wait for camera 
 wait (2)
 walk hero (me,up,1)
 set hero direction (me,down)
 show text box (1120)
 wait (7)
 wait for key (usekey)
 advance textbox
 focus camera (6,9,4)
 walk NPC to y (1,9)
 wait for camera

 tweak palette (-30,5,5)
 update palette
 wait (1)
 reset palette
 update palette
 wait (1)

 show text box (1121)
 wait (7)
 wait for key (usekey)
 advance textbox
 set NPC direction (1,left)
 wait (2)
 set NPC direction (1,right)
 wait (2)
 set NPC direction (1,left)
 wait (2)
 set NPC direction (1,right)
 wait (2)
 set NPC direction (1,up)
 wait (2)
 show text box (1122)
 wait (7)
 wait for key (usekey)
 advance textbox

 tweak palette (-30,5,5)
 update palette
 wait (1)
 reset palette
 update palette
 wait (1)

 show text box (1123)
 wait (7)
 wait for key (usekey)
 advance textbox

 tweak palette (-30,5,5)
 update palette
 wait (1)
 reset palette
 update palette
 wait (1)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 show text box (1124)
 wait (7)
 wait for key (usekey)
 advance textbox
 show text box (1125)
 wait (7)
 wait for key (usekey)
 advance textbox

 tweak palette (-30,5,5)
 update palette
 wait (1)
 reset palette
 update palette
 wait (1)

 show text box (1126)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1127)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1128)
 wait (7)
 wait for key (use key)
 advance text box

 tweak palette (-30,5,5)
 update palette
 wait (1)
 reset palette
 update palette
 wait (1)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 show text box (1129)
 wait (7)
 wait for key (use key)
 advance text box

 show text box (1130)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (-30,5,5)
 update palette
 wait (1)
 reset palette
 update palette
 wait (1)
 tweak palette (-30,5,5)
 update palette
 wait (1)
 reset palette
 update palette
 wait (1)
 tweak palette (-30,5,5)
 update palette
 wait (1)
 reset palette
 update palette
 wait (1)
 show text box (1131)
 wait (7)
 wait for key (use key)
 advance text box
 stop song
 play sound (sfx:Nuclear,false,true)
 show text box (1132)
 wait (7)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 fade screen out (63,63,63)
 wait (45)
 advance text box
 set tag (tag:WORLDOFRUIN,on)
 wait (1)
 fade screen in
 play song (song:21  The Long Silence)
 wait (5)
 walk NPC (3,down,1)
 wait for NPC (3)
 show text box (1133)
 wait (7)
 unlock hero (hero:Freki)
 wait for key (use key)
 advance text box
 walk NPC to y (6,10)
 wait for NPC (6)
 walk NPC (6,right,1)
 wait for NPC (6)
 set NPC direction (6,up)
 show text box (1134)
 wait (7)
 wait for key (use key)
 advance text box
 suspend obstruction
 walk NPC (3, down, 2)
 wait for NPC (3)
 play sound (sfx:Crush8Bit,false,true)
 wait (2)
 Alter NPC (6,NPCstat:picture,122)
 walk NPC (3,up,1)
 set NPC direction (3,down)
 wait for NPC (3)
 wait (2)
 walk NPC (3,down,1)
 wait for NPC (3)
 walk NPC (3,down,2)
 walk NPC (6,down,2)
 wait for NPC (3)
 walk NPC (6,right,1)
 set NPC direction (3,right)
 wait for NPC (6)
 set NPC direction (3,down)
 resume obstruction
 walk NPC (2,down,3)
 walk NPC (4,down,3)
 focus camera (6,12,4)
 walk NPC (5,up,8)
 walk NPC (7,up,8)
 walk NPC (8,up,8)
 wait for NPC (5)
 show text box (1135)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1136)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1137)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (4,down,1)
 show text box (1138)
 wait (7)
 wait for key (use key)
 walk NPC (2,down,1)
 advance text box
 show text box (1139)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (5,left)
 wait (3)
 show text box (1140)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (8,up,1)
 wait for NPC (8)
 show text box (1141)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1142)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (5,up)
 show text box (1143)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 play sound (sfx:Soft_Airy_Swish,false,true)
 set NPC position (5,6,7)
 focus camera (6,9,4)
 wait for camera
 set NPC direction (2,up)
 set NPC direction (3,up)
 set NPC direction (4,up)
 wait (5)
 walk NPC (7,up,1)
 show text box (1161)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1162)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (5,right)
 wait (4)
 set NPC direction (5,down)
 wait (4)

 show text box (1144)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1145)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 fade screen out (63,63,63)
 wait (1)
 set tag (tag:GATE1,on)
 wait (1)
 fade screen in
 wait (5) 
 focus camera (6,12,4)
 wait for camera
 set NPC direction (2,down)
 set NPC direction (3,down)
 set NPC direction (4,down)
 wait (5)
 show text box (1146)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (4,left)
 show text box (1147)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (2,right)
 show text box (1148)
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 set NPC direction (4,down)
 wait (3)
 set NPC direction (4,right)
 wait (3)
 show text box (1149)
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 set NPC direction (3,right)
 wait (3)
 show text box (1150)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 fade screen out
 wait (2)
 show text box (1151)
 wait (2)
 fade screen in
 wait (10)
 wait for key (use key)
 fade screen out
 wait (2)
 advance text box
 #This section is reserved specifically for whether the game is a demo
 #Or the final version release
 #Just make sure to disable the script from here on
 #If it's the actual end of the game




 walk hero (me,up,1)
 wait for hero (me)
 camera follows hero (me)
 wait (1)
 force equip (0,slot:weapon,item:Katana)
 wait (1)
 set hero direction (me,down)
 wait (1)
 use door (4)
 stop song


 wait (10)
 set hero direction (me,left)
 wait (10)
 set hero direction (me,right)
 wait (10)
 set hero speed (me,1)
 walk hero (me,right,1)
 wait for hero (me)
 set hero speed (me,4)
 wait (10)
 set NPC direction (1,left)
 wait (5)
 show text box (1152)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)

 show text box (1153)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1154)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)

 show text box (1155)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1156)
 wait (7)
 wait for key (use key)
 advance text box
 wait (7)
 set hero direction (me,down)
 wait (7)
 show text box (1157)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,down,1)
 wait for hero (me)
 show text box (1158)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (1,down)
 show text box (1159)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (1,down,1)
 wait for NPC (1)
 set hero direction (me,right)
 set NPC direction (1,left)
 show text box (1160)
 wait (7)
 wait for key (use key)
 advance text box
 suspend obstruction
 wait (2)
 walk NPC (1,left,1)
 wait for NPC (1)
 wait (1)
 set tag (tag:AddFox,on)
 resume obstruction
 add hero (hero:Renard)
 wait (1)
 resume caterpillar
 set caterpillar mode (off)
 resume box advance
 resume player
 force equip ((find hero (hero:Renard)),2,203)
 force equip ((find hero (hero:Renard)),3,209)
 force equip ((find hero (hero:Renard)),4,210)
end

script,BramReturns,begin
 suspend player
 suspend box advance
 swap by position (0,find hero (hero:Freki))
 swap by position (1,find hero (hero:Renard))
 set caterpillar mode (on)
 suspend caterpillar
 walk hero (me,left,1)
 walk hero (1,down,1)
 wait for hero (me)
 set hero direction (me,down)
 wait (5)
 set hero direction (1,left)
 set hero direction (me,right)
 wait (5)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1169)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1165)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1166)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1167)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set hero direction (1,down)
 wait (3)
 set hero direction (1,right)
 wait (10)
 walk hero (1,down,1)
 wait for hero (1)
 set hero direction (1,right)
 wait (10)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1168)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero to y (me,5)
 walk hero to x (1,12)
 wait for hero (me)
 walk hero to x (me,12)
 wait for hero (me)
 wait (5)
 #Party enters the otehr room to find Bram there
 wait (5)
 walk hero (1,up,1)
 wait for hero (1)
 set hero direction (1,right)
 pan camera (right,1,2)
 wait for camera
 wait (5)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1170)
 wait (7)
 wait for key (use key)
 advance text box

 set NPC direction (2,left)
 show text box (1171)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,right,1)
 wait for hero (me)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1172)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (2,down)
 wait (5)
 set NPC direction (2,right)
 wait (5)
 walk NPC (2,right,1)
 wait for NPC (2)
 wait (5)
 show text box (1173)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set NPC direction (2,down)
 wait (5)
 set NPC direction (2,left)
 wait (5)
 show text box (1174)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1175)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1176)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (2,left,2)
 walk hero (1,down,1)
 wait for hero (1)
 walk hero (1,right,1)
 wait for NPC (2)
 wait (3)
 set tag (tag:Bramreturns,on)
 set caterpillar mode (off)
 resume caterpillar
 camera follows hero (me)
 resume box advance
 resume player
 unlock hero (hero:Bram)
 swap by position (2,find hero (hero:Bram))
 
end

script,Frumpyback,begin
 suspend player
 suspend box advance
 swap by position (0,find hero (hero:Freki))
 swap by position (1,find hero (hero:Renard))
 swap by position (2,find hero (hero:Bram))
 walk hero to Y (me,28)
 wait for hero (me)
 walk hero to X (me,42)
 wait for hero (me)
 set hero position (1, 42, 28)
 set hero position (2, 42, 28)
 set hero position (3, 40, 29)
 set caterpillar mode (on)
 suspend caterpillar
 focus camera (39,28,4)
 walk hero (1,down,1)
 walk hero (2,down,2)
 wait for hero (1)
 set hero direction (1,left)
 wait (5)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1181)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1182)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1183)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,left,1)
 walk hero (1,left,1)
 walk hero (2,left,1)
 show text box (1184)
 wait (7)
 wait for key (use key)
 advance text box

 show text box (1185)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1186)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1187)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1188)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1189)
 wait (7)
 wait for key (use key)
 advance text box
 swap by position (3,find hero (hero:Frumpy))
 unlock hero (hero:Frumpy)
 set tag (tag:Frumpyreturns,on)
 wait (3)
 BossIntroduction 
 fight formation (128)
 show text box (1190)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1191)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,up,1)
 walk hero (1,up,1)
 walk hero (2,up,1)
 wait for hero (me)
 walk hero (me,left,1)
 walk hero (1,up,1)
 walk hero (2,up,1)
 walk hero (3,right,1)
 wait for hero (me)
 walk hero (me,left,1)
 walk hero (1,left,1)
 walk hero (2,up,1)
 walk hero (3,up,1)
 wait for hero (me)
 walk hero (me,left,1)
 walk hero (1,left,1)
 walk hero (2,left,1)
 walk hero (3,up,1)
 wait for hero (me)
 walk hero (me,left,1)
 walk hero (1,left,1)
 walk hero (2,left,1)
 walk hero (3,left,1)
 wait for hero (me)
 set NPC direction (23,up)
 set NPC direction (24,up)
 walk NPC (22,right,3)
 show text box (1192)
 wait (7)
 wait for NPC (22)
 set NPC direction (22,down)
 wait (2)
 set NPC direction (22,left)
 wait for key (use key)
 advance text box
 set hero direction (me,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait (5)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1193)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,right)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1194)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (3,left)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1195)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (1,left,1)
 walk hero (2,left,1)
 walk hero (3,left,1)
 wait for hero (3)

 walk hero (2,left,1)
 walk hero (3,left,1)
 wait for hero (3)
 walk hero (3,left,1)
 wait for hero (3)
 set caterpillar mode (off)
 resume caterpillar
 focus camera (37,27,4)
 wait for camera
 camera follows hero (me)
 wait (5)
 set hero direction (me,down)
 wait (5)
 set hero direction (me,left)
 wait (5)
 walk hero (me,left,2)
 wait for hero (me)
 set NPC direction (24,left)
 set NPC direction (23,left)
 walk hero (me,down,1)
 wait for hero (me)
 walk hero (me,left,7)
 wait for hero (me)
 walk hero (me,up,3)
 wait for hero (me)
 walk hero (me,left,4)
 wait for hero (me)
 walk hero (me,up,6)
 wait for hero (me)
 walk hero (me,left,7)
 wait for hero (me)
 walk hero (me,up,3)
 wait for hero (me)
 walk hero (me,left,2)
 wait for hero (me)
 wait (5)
 pan camera (left,1)
 wait for camera
 wait (5)
 show text box (1196)
 wait (7)
 wait for key (use key)
 advance text box
 suspend obstruction
 walk hero (me,left,1)
 wait for hero (me)
 resume obstruction
 set tag (tag:Frumpyover,on)
 camera follows hero
 resume box advance
 resume player
end

script,Hel,begin
 suspend player
 suspend box advance
 walk hero to y (me,24)
 wait for hero (me)
 walk hero to x (me,12)
 wait for hero (me)
 set hero direction (me,up)
 stop song
 show text box (1197)
 wait (7)
 wait for key (use key)
 advance text box
 focus camera (12,22,4)
 wait for camera
 suspend obstruction
 set NPC position (4,12,24)
 wait (1)
 walk NPC (4,up,3)
 wait for NPC (4)
 wait (2)
 fade screen out
 wait (2)
 resume obstruction
 set tag (tag:HelAlive,on)
 wait (2)
 fade screen in
 play song (song:31  Animated Elements)
 wait (2)

 set caterpillar mode (on)
 set hero position (1,12,24)
 set hero position (2,12,24)
 set hero position (3,12,24)
 suspend caterpillar
 wait (3)
 walk hero (1,down,1)
 walk hero (2,down,1)
 walk hero (3,down,1)
 wait for hero (1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 wait for hero (1)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1198)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1199)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1200)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (1,down,1)
 wait (4)
 show text box (1201)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1202)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1203)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1204)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1205)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1206)
 wait (7)
 wait for key (use key)
 advance text box

 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1207)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1208)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1209)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1210)
 wait (7)
 wait for key (use key)
 advance text box

#baddle
 BossIntroduction
 fight formation (99)
 stop song
 wait (10)
 Alter NPC (0,NPCstat:picture,126)
 wait (10)
 play song (song:Requiem Animus)
 show text box (1211)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 walk hero (2,up,1)
 wait for hero (2)
 wait (5)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1212)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 Alter NPC (0,NPCstat:picture,89)
 wait (5)
 show text box (1213)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 walk hero (1,up,1)
 wait for hero (1)
 wait (5)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1214)
 wait (7)
 wait for key (use key)
 advance text box
 wait (15)
 show text box (1215)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 Alter NPC (0,NPCstat:picture,126)
 wait (10)
 show text box (1216)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 fade screen out
 wait (2)
 set tag (tag:DefeatHel,on)
 wait (2)
 fade screen in
 show text box (1217)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 walk hero (me,up,1)
 wait for hero (me)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,left) 
 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1218)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1219)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,down,1)
 walk hero (1,right,1)
 walk hero (2,left,1)
 walk hero (3,up,1)
 pan camera (down,2)
 wait for camera
 camera follows hero (me)
 wait (2)
 set caterpillar mode (off)
 resume caterpillar
 resume player
 resume box advance
end

script,vulpes,begin
 suspend player
 suspend box advance
 focus camera (7,3,4)
 wait for camera
 show text box (1222)
 wait (7)
 wait for key (use key)
 advance text box
 play sound (sfx:baa,false,true)
 set NPC direction (1,down)
 wait (10)
 set NPC direction (1,up)
 wait (3)
 focus camera (7,7,4)
 wait for camera
 resume box advance
 resume player
 camera follows hero (me)
end

script,bramSLOW,begin
 suspend player
 suspend box advance
 swap by position (0,find hero (hero:Bram))
 teach spell ((find hero(hero:Bram)),82)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1223)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (0,right)
 wait (3)
 show text box (1224)
 wait (7)
 wait for key (use key)
 advance text box
 play sound (sfx:baa,false,true)
 set NPC direction (1,down)
 wait (10)
 set NPC direction (1,up)
 wait (3)
 set NPC direction (0,down)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:bubbles,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1225)
 wait (7)
 wait for key (use key)
 advance text box
 resume box advance
 resume player
end

script,NightSLEEP,begin
 suspend player
 suspend box advance
 swap by position (0, find hero (hero:Night))
 teach spell ((find hero(hero:Night)),atk:Slumber)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1226)
 wait (7)
 wait for key (use key)
 advance text box
 play sound (sfx:Select8Bit,false,true)
 show backdrop (30)
 wait (10)
 show text box (1227)
 wait (7)
 wait for key (use key)
 advance text box
 play sound (sfx:baa,false,true)
 set NPC direction (1,down)
 wait (10)
 set NPC direction (1,up)
 wait (3)
 set NPC direction (0,down)
 wait (1)
 play sound (sfx:Select8Bit,false,true)
 show map
 wait (3)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:Heal8bit,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1228)
 wait (7)
 wait for key (use key)
 advance text box
 resume player
 resume box advance
end

script,OlafMANA,begin
 suspend player
 suspend box advance
 swap by position (0, find hero (hero:Olaf))
 teach spell ((find hero(hero:Olaf)),atk:Mana Rage)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1229)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (0,left)
 show text box (1230)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,right)
 play sound (sfx:baa,false,true)
 set NPC direction (1,down)
 wait (10)
 set NPC direction (1,up)
 wait (3)
 set NPC direction (0,down)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1231)
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 tweak palette (0,10,0)
 update palette
 play sound (sfx:Metal_Hit,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1232)
 wait (7)
 wait for key (use key)
 advance text box
 resume box advance
 resume player
end

script,KittSLASH,begin
 suspend player
 suspend box advance
 swap by position (0, find hero (hero:Kitt))
 teach spell ((find hero(hero:Kitt)),atk:Slash All)
 tweak palette (63,63,63)
 update palette
 wait (1)
 set tag (tag:ROACHES,on)
 reset palette
 update palette
 wait (1)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 focus camera (7,5,4)
 wait for camera 
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1235)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1236)
 wait (7)
 wait for key (use key)
 advance text box
 play sound (sfx:baa,false,true)
 set NPC direction (1,down)
 wait (10)
 set NPC direction (1,up)
 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1237)
 wait (7)
 wait for key (use key)
 advance text box
 play sound (sfx:Soft_Airy_Swish,false,true)
 set hero position (me,4,7)
 wait (3)
 play sound (sfx:Soft_Airy_Swish,false,true)
 set hero position (me,8,5)
 wait (3)
 play sound (sfx:Soft_Airy_Swish,false,true)
 set hero position (me,4,5)
 wait (3)
 play sound (sfx:Soft_Airy_Swish,false,true)
 set hero position (me,10,4)
 wait (3)
 play sound (sfx:Soft_Airy_Swish,false,true)
 set hero position (me,8,7)
 wait (3)
 play sound (sfx:Soft_Airy_Swish,false,true)
 set hero position (me,6,4)
 wait (3)
 play sound (sfx:Soft_Airy_Swish,false,true)
 set hero position (me,10,6)
 wait (3)
 play sound (sfx:Soft_Airy_Swish,false,true)
 set hero position (me,7,5)
 wait (3)
 camera follows hero (me)
 wait (1)
 set tag (tag:ROACHES,off)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:Soft_Airy_Swish,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1238)
 wait (7)
 wait for key (use key)
 advance text box
 resume player
 resume box advance
end

script,FrumpForce,begin
 suspend player
 suspend box advance
 walk hero to x (me,9)
 walk hero to y (me,13)
 wait for hero (me)
 set caterpillar mode (on)
 suspend caterpillar
 swap by position (0, find hero (hero:Kitt))
 swap by position (1, find hero (hero:Bram))
 swap by position (2, find hero (hero:Frumpy))
 swap by position (3, find hero (hero:Night))
 teach spell ((find hero(hero:Frumpy)),atk:Force)
 set hero position (1,9,13)
 set hero position (2,9,13)
 set hero position (3,9,13)
 wait (2)
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,down,1)
 wait for hero (me)
 set hero direction (me,left)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,left)
 wait (4)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,up)
 wait (4)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1239)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (1240)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero to x (1,3)
 wait for hero (1)
 walk hero to y (1,10)
 wait for hero (1)
 walk hero (1,left,1)
 wait for hero (1)
 wait (10)
 walk hero (1,right,1)
 wait for hero (1)
 walk hero (1,up,5)
 wait for hero (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (1241)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (1242)
 wait (7)
 wait for key (use key)
 advance text box

 walk hero to y (1,13)
 wait for hero (1)
 set hero direction (1,right)
 set hero direction (me,left)
 set hero direction (2,left)
 set hero direction (3,left)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (1243)
 wait (7)
 wait for key (use key)
 advance text box

 walk NPC to y (6,11)
 wait for NPC (6)
 set hero direction (1,up)
 wait (2)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show textbox (1244)
 wait (7)
 wait for key (use key)
 advance text box

 walk hero (2,left,2)
 wait for hero (2)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show textbox (1245)
 wait (7)
 wait for key (use key)
 advance text box
 play sound (sfx:Wind,false,true)
 fade screen out (63,63,63)
 wait (5)
 set tag (tag:FORCE,on)
 wait (10)
 fade screen in
 wait (5)

 tweak palette (10,0,0)
 update palette
 play sound (sfx:Wind,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1246)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (2,right,2)
 walk hero to x (1,8)
 wait for hero (1)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,up)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show textbox (1247)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1248)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,down,1)
 walk hero (1,right,1)
 walk hero (2,left,1)
 walk hero (3,up,1)
 wait for hero (me)
 resume caterpillar
 set caterpillar mode (off)
 resume box advance
 resume player
end

script,StyrgeWERE,begin
 suspend player
 suspend box advance
 swap by position (0, find hero (hero:Styrge))
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show textbox (1250)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (22,right)
 wait (5)
 set NPC direction (22,down)
 wait (5)
 play sound (sfx:Growl,false,true)
 wait (15)
#baddle
 BossIntroduction
 fight formation (146)

 set tag (tag:WERERED,on)
 wait (10)
 fade screen in
 wait (5)

 tweak palette (10,0,0)
 update palette
 play sound (sfx:Growl,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1251)
 wait (7)
 wait for key (use key)
 advance text box
 teach spell ((find hero(hero:Styrge)),atk:Were Bust)
 show text box (1252)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1253)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1254)
 wait (7)
 wait for key (use key)
 advance text box
 resume player
 resume box advance
end

script,antidote,begin
 suspend player
 suspend box advance
 set caterpillar mode (on)
 suspend caterpillar
 swap by position (0, find hero (hero:Styrge))
 swap by position (1, find hero (hero:Frumpy))
 set hero position (1,60,21)
 set hero position (2,1,1)
 set hero position (3,1,1)
 wait (2)
 walk hero (1,down,1)
 wait for hero (1)
 set hero direction (1,right)
 wait (2)
 show text box (1259)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1260)
 wait (7)
 wait for key (use key)
 advance text box

 #Teach styrge Unvenom
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8 Bit,false,true)
 teach spell ((find hero(hero:Styrge)),atk:Unvenom)
 wait (10)
 reset palette
 fade screen in
 show text box (1261)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1262)
 wait (7)
 wait for key (use key)
 advance text box

 #Teach Frumpy Antidote
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8 Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Antidote)
 wait (10)
 reset palette
 fade screen in
 show text box (1263)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1264)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1265)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (1,up)
 wait for hero (1)
 wait (1)
 resume caterpillar
 set caterpillar mode (off)
 resume box advance
 resume player
end

script,Hildaback,begin
 suspend player
 suspend box advance
 suspend caterpillar
 swap by position (0, find hero (hero:Freki))
 swap by position (1, find hero (hero:Renard))
 swap by position (2, find hero (hero:Bram))
 swap by position (3, find hero (hero:Frumpy))
 wait (1)
 set hero position(1, 3, 25)
 set hero position(2, 3, 25)
 set hero position(3, 3, 25)
 wait (1)
 set caterpillar mode (on)
 wait (1)
 walk hero (1,left,1)
 walk hero (2,down,1)
 walk hero (3,right,1)
 wait for hero (1)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (2)
 show text box (1267)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (1,right)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1268)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (3,left)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1269)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (1,up)
 set hero direction (3,up)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 suspend map music
 show text box (1270)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1271)
 wait (7)
 wait for key (use key)
 advance text box










#Off to Valhalla for a cut scene
 fade screen out
 wait (2)
 greyscale palette
 teleport to map (1, 33, 1)
 wait (2)
 focus camera (33,4,4)
 wait for camera
 play song (song:Towards Odds Impassible)
 fade screen in
 show text box (1272)
 wait (7)
 wait for key (use key)
 advance text box

 walk NPC (23,down,4)
 wait for NPC (23)
 wait (20)
 walk NPC (23,up,4)
 walk NPC (24,up,4)
 walk NPC (25,up,4)
 walk NPC (26,up,4)
 walk NPC (27,up,4)
 wait for NPC (23)






 show text box (1273)
 wait (7)
 wait for key (use key)
 advance text box

 show text box (1274)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1275)
 wait (7)
 wait for key (use key)
 advance text box




 #The action returns to Gnipahellir
 fade screen out
 wait (2)
 reset palette
 camera follows hero (me)
 wait (2)
 teleport to map (43, 3, 25)
 wait (2)
 set hero position (1,2,25)
 set hero position (2,3,26)
 set hero position (3,4,25)
 set NPC direction (0,down)
 wait (2)
 fade screen in
 wait (5)

 show text box (1276)
 wait (7)
 wait for key (use key)
 advance text box
 resume map music
 show text box (1277)
 wait (7)
 suspend obstruction
 wait for key (use key)
 advance text box
 walk NPC (0,down,1)
 walk hero (1,right,1)
 walk hero (2,up,1)
 walk hero (3,left,1)
 wait for hero (1)
 unlock hero (hero:Hilda)
 set tag (tag:Hildareturns,on)
 resume obstruction
 resume player
 resume box advance
 resume caterpillar
 set caterpillar mode (off)
end

script,housemaster,begin
 suspend player
 suspend box advance
 walk hero to y (me,11)
 wait for hero (me)
 walk hero to x (me,39)
 wait for hero (me)
 set hero direction (me,up)
 swap by position (0, find hero (hero:Hilda))
 swap by position (1, find hero (hero:Freki))
 swap by position (2, find hero (hero:Bram))
 swap by position (3, find hero (hero:Renard))
 set caterpillar mode (on)
 suspend caterpillar
 set hero position (1,39,11)
 set hero position (2,39,11)
 set hero position (3,39,11)
 wait (1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,down,1)
 wait for hero (3)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)


 focus camera (39,6,4)
 wait for camera 
 walk NPC (1,down,1)
 wait for NPC (1)
 show text box (1278)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1279)
 wait (7)
 wait for key (use key)
 advance text box

 walk hero (1,left,2)
 walk hero (2,right,2)
 walk hero (me,left,1)
 walk hero (3,up,1)
 walk hero (3,right,1)
 wait for hero (1)

 show text box (1280)
 walk hero (1,up,2)
 walk hero (2,up,2)
 walk hero (me,left,2)
 walk hero (3,right,2)
 wait for hero (1)

 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (me,up,2)
 walk hero (3,up,2)
 wait for hero (me)


 walk hero (1,up,2)
 walk hero (2,up,2)
 walk hero (me,left,1)
 walk hero (3,right,1)
 wait for hero (1)
 advance textbox
 show textbox (1281)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (me,up,2)
 walk hero (3,up,2)
 wait for hero (1)

 walk hero (1,up,3)
 walk hero (2,up,3)
 wait for hero (1)
 set hero direction (me,right)
 set hero direction (3,left)
 walk hero (1,right,1)
 walk hero (2,left,1)
 wait for hero (1)
 advance textbox
 set NPC direction (1,left)
 wait (3)
 set NPC direction (1,right)
 wait (3)
 set NPC direction (1,left)
 wait (3)
 set NPC direction (1,right)
 wait (3)
 set NPC direction (1,left)
 show text box (1282)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1283)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1284)
 wait (7)
 wait for key (use key)
 advance text box

 wait (5)
 stop song
 wait (5)
 show textbox (828)
 wait (7)
 wait for key (usekey)
 advance text box
 show textbox (829)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (5)
 tweak palette (-20,-20,-20)
 fade screen in
 wait (4)
 show textbox (830)
 wait (7)
 wait for key (usekey)
 advance text box
 #The new boss fight effect!
 BossIntroduction  
 fight formation (156)
 stop song

 show text box (1285)
 wait (7)
 wait for key (use key)
 advance text box

 show text box (1286)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (1,left,1)
 wait for NPC (1)
 walk NPC (1,up,1)
 wait for NPC (1)
 set NPC direction (1,left)
 wait (3)
 set NPC speed (1,10)
 set NPC direction (1,down)
 wait (3)
 suspend NPC walls
 suspend obstruction
 pan camera (down,2)
 walk NPC (1,down,7)
 wait (5)






 show text box (1287)
 wait (7)
 wait for NPC (1)
 walk NPC (4,up,2)

 advance text box
 wait for NPC (4)
 play sound (sfx:Crush8Bit,false,true)
 set NPC speed (1,20)
 walk NPC (1,up,1)
 set NPC direction (1,left)
 wait for NPC (1)
 walk NPC (1,up,1)
 set NPC direction (1,up)
 wait for NPC (1)
 walk NPC (1,up,1)
 set NPC direction (1,right)
 wait for NPC (1)
 walk NPC (1,up,1)
 set NPC direction (1,down)
 wait for NPC (1)
 walk NPC (1,up,1)
 set NPC direction (1,left)
 wait for NPC (1)
 walk NPC (1,up,1)
 set NPC direction (1,up)
 wait for NPC (1)
 walk NPC (1,up,1)
 set NPC direction (1,right)
 wait for NPC (1)
 walk NPC (1,up,1)
 set NPC direction (1,down)
 wait for NPC (1)
 set NPC direction (1,left)
 wait (3)
 set NPC direction (1,up)
 wait (3)
 set NPC direction (1,right)
 wait (3)
 set NPC direction (1,down)
 wait (3)
 walk NPC (1,down,1)
 wait for NPC (1)

 wait (1)
 set NPC speed (1,4)
 pan camera (up,2)
 walk NPC (5,right,1)
 walk NPC (4,left,1)
 wait for NPC (5)
 walk NPC (5, up, 3)
 walk NPC (4,up,1)
 wait for NPC (5)
 wait for NPC (4)
 show text box (1288)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (1,right,1)
 wait for NPC (1)
 set NPC direction (1,down)
 show text box (1289)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (157)

 unlock hero (hero:Olaf)


 show text box (1290)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 fade screen out
 wait (3)
 show text box (1293)
 wait (3)
 fade screen in
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1294)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1295)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1296)
 wait (7)
 wait for key (use key)
 fade screen out
 wait (2)
 advance text box
 wait (3)
 fade screen in
 wait (2)

 show text box (1291)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1292)
 wait (7)
 wait for key (use key)
 advance text box

 play sound (sfx:Electricity,false,true)
 walk NPC (10,down,3)
 walk NPC (11,down,3)
 walk NPC (12,down,3)
 walk NPC (13,down,3)
 wait for NPC (10)

 walk NPC (10,left,1)
 walk NPC (11,up,1)
 walk NPC (12,right,1)
 walk NPC (13,down,1)
 wait for NPC (10)

 #the dance of electricity!
 play sound (sfx:Electricity,false,true)
 walk NPC (10,up,1)
 walk NPC (10,right,1)
 walk NPC (11,right,1)
 walk NPC (11,down,1)
 walk NPC (12,left,1)
 walk NPC (12,down,1)
 walk NPC (13,left,1)
 walk NPC (13,up,1)
 wait for NPC (10)
 walk NPC (10,right,1)
 walk NPC (10,down,1)
 walk NPC (11,left,1)
 walk NPC (11,down,1)
 walk NPC (12,left,1)
 walk NPC (12,up,1)
 walk NPC (13,up,1)
 walk NPC (13,right,1)
 wait for NPC (10)
 walk NPC (10,left,1)
 walk NPC (10,down,1)
 walk NPC (11,left,1)
 walk NPC (11,up,1)
 walk NPC (12,up,1)
 walk NPC (12,right,1)
 walk NPC (13,right,1)
 walk NPC (13,down,1)
 wait for NPC (10)
 walk NPC (10,left,1)
 walk NPC (10,up,1)
 walk NPC (11,up,1)
 walk NPC (11,right,1)
 walk NPC (12,right,1)
 walk NPC (12,down,1)
 walk NPC (13,down,1)
 walk NPC (13,left,1)
 wait for NPC (10)
 play sound (sfx:Electricity,false,true)
 walk NPC (10,up,1)
 walk NPC (10,right,1)
 walk NPC (11,right,1)
 walk NPC (11,down,1)
 walk NPC (12,left,1)
 walk NPC (12,down,1)
 walk NPC (13,left,1)
 walk NPC (13,up,1)
 wait for NPC (10)
 walk NPC (10,right,1)
 walk NPC (10,down,1)
 walk NPC (11,left,1)
 walk NPC (11,down,1)
 walk NPC (12,left,1)
 walk NPC (12,up,1)
 walk NPC (13,up,1)
 walk NPC (13,right,1)
 wait for NPC (10)
 walk NPC (10,left,1)
 walk NPC (10,down,1)
 walk NPC (11,left,1)
 walk NPC (11,up,1)
 walk NPC (12,up,1)
 walk NPC (12,right,1)
 walk NPC (13,right,1)
 walk NPC (13,down,1)
 wait for NPC (10)
 walk NPC (10,left,1)
 walk NPC (10,up,1)
 walk NPC (11,up,1)
 walk NPC (11,right,1)
 walk NPC (12,right,1)
 walk NPC (12,down,1)
 walk NPC (13,down,1)
 walk NPC (13,left,1)
 wait for NPC (10)
 play sound (sfx:Electricity,false,true)
 walk NPC (10,up,1)
 walk NPC (10,right,1)
 walk NPC (11,right,1)
 walk NPC (11,down,1)
 walk NPC (12,left,1)
 walk NPC (12,down,1)
 walk NPC (13,left,1)
 walk NPC (13,up,1)
 wait for NPC (10)
 walk NPC (10,right,1)
 walk NPC (10,down,1)
 walk NPC (11,left,1)
 walk NPC (11,down,1)
 walk NPC (12,left,1)
 walk NPC (12,up,1)
 walk NPC (13,up,1)
 walk NPC (13,right,1)
 wait for NPC (10)
 walk NPC (10,left,1)
 walk NPC (10,down,1)
 walk NPC (11,left,1)
 walk NPC (11,up,1)
 walk NPC (12,up,1)
 walk NPC (12,right,1)
 walk NPC (13,right,1)
 walk NPC (13,down,1)
 wait for NPC (10)
 walk NPC (10,left,1)
 walk NPC (10,up,1)
 walk NPC (11,up,1)
 walk NPC (11,right,1)
 walk NPC (12,right,1)
 walk NPC (12,down,1)
 walk NPC (13,down,1)
 walk NPC (13,left,1)
 wait for NPC (10)
 play sound (sfx:lightning,false,true)
 walk NPC (10,right,3)
 walk NPC (11,down,3)
 walk NPC (12,left,3)
 walk NPC (13,up,3)
 wait for NPC (13)

 fade screen out (63,63,63)
 wait (10)
 resume obstruction
 resume NPC walls
 set tag (tag:Housemaster,on)
 wait (10)
 fade screen in
 wait (5)
 show textbox (1297)
 wait (7)
 wait for key (usekey)
 advance textbox

 wait (3)
 fade screen out
 wait (1)
 resume box advance
 resume caterpillar
 set hero direction (me,down)
 set caterpillar mode (off)
 camera follows hero
 set tag (tag:Gnipaover,on)
 use door (7)
 resume player
end



script,FrumpyLINGUE,begin
 suspend player
 suspend box advance
 swap by position (0, find hero (hero:Frumpy))


 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1306)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1307)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (158)




 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1308)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1309)
 wait (7)
 wait for key (use key)
 advance text box

 tweak palette (0,0,10)
 update palette
 play sound (sfx:Menu8Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Lingue)
 wait (10)
 reset palette
 fade screen in
 show text box (1310)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out (63,63,63)
 wait (1)
 set tag (tag:Frumling,on)
 wait (1)

 resume box advance

 wait (2)
 fade screen in
 wait (2)
 resume player
end




script,FrumpyAWAKE,begin
 suspend player
 suspend box advance
 
 swap by position (0, find hero (hero:Frumpy))
 wait (1)
 wait (1)
 walk hero to x (me,38)
 walk hero to y (me,16)
 wait for hero (me)

 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1312)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1313)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (159)




 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1314)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1315)
 wait (7)
 wait for key (use key)
 advance text box

 tweak palette (0,0,10)
 update palette
 play sound (sfx:Menu8Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Awake)
 wait (10)
 reset palette
 fade screen in
 show text box (1316)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out (63,63,63)
 wait (1)
 set tag (tag:Frumawak,on)
 wait (1)

 resume box advance

 wait (2)
 fade screen in
 wait (2)
 resume player
end






script,FrumpyNURSE,begin
 suspend player
 suspend box advance

 swap by position (0, find hero (hero:Frumpy))
 wait (1)
 walk hero to x (me,24)
 walk hero to y (me,41)
 wait for hero (me)

 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1318)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1319)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (160)




 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1320)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1321)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Nurse)
 wait (10)
 reset palette
 fade screen in
 show text box (1322)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out (63,63,63)
 wait (1)
 set tag (tag:Frumnurs,on)
 wait (1)
 resume box advance
 wait (2)
 fade screen in
 wait (2)
 resume player
end




script,FrumpyLIFE,begin
 suspend player
 suspend box advance
 swap by position (0, find hero (hero:Frumpy))
 wait (1)
 walk hero to x (me,17)
 walk hero to y (me,41)
 wait for hero (me)
 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1334)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1335)
 wait (7)
 wait for key (use key)
 advance text box
 play song (song:Vile)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1336)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1337)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1338)
 wait (7)
 wait for key (use key)
 advance text box



 BossIntroduction
 fight formation (161)




 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1339)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1340)
 wait (7)
 wait for key (use key)
 advance text box
 wait (1)
 play sound (sfx:lightning,false,true)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 camera follows hero (me)
 fade screen out (63,63,63)
 wait (1)
 set tag (tag:Frumlife,on)
 wait (1)
 fade screen in
 wait (2)
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Life)
 wait (10)
 reset palette
 fade screen in
 show text box (1341)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out (63,63,63)
 wait (1)
 resume box advance
 wait (2)
 fade screen in
 wait (2)
 resume player
end

script,FrumpySUBLIME,begin
 suspend player
 suspend box advance
 show text box (1344)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1345)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1346)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (162)

 wait (2)
 tweak palette (0,10,0)
 update palette
 play sound (sfx:Metal_Hit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Sublime)
 set tag (tag:sublime,on)
 wait (10)
 reset palette
 fade screen in
 show text box (1347)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1348)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1349)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1350)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1351)
 wait (7)
 wait for key (use key)
 advance text box
 resume box advance
 resume player
end













script, Lyngvi, begin
 suspend player
 suspend box advance
 suspend random enemys
 swap by position (0, find hero (hero:Freki))
 wait (3)
 suspend caterpillar
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (2)
 focus camera (16,13,4)
 set caterpillar mode (on)
 set hero position (1, 16, 13)
 set hero position (2, 16, 13)
 set hero position (3, 16, 13)
 wait (2)
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,down,1)
 wait for hero (me)
 set hero direction (me,left)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,left)
 wait (4)
 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,up)
 wait (4)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1362)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1363)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,up,1)
 wait for hero (me)
 set hero direction (1,up)
 walk hero (me,left,2)
 wait for hero (me)
 walk hero (me,up,2)
 wait for hero (me)
 focus camera (14,7,2)

 set NPC frame (6,1)
 wait (1)
 set NPC frame (6,0)
 wait (1)
 set NPC frame (6,1)
 wait (1)
 set NPC frame (6,0)
 wait (1)
 show text box (1364)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1365)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (6,1)
 wait (1)
 set NPC frame (6,0)
 wait (1)
 set NPC frame (6,1)
 wait (1)
 set NPC frame (6,0)
 wait (1)
 show text box (1366)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 stop song
 wait (10)
 show text box (1367)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 set NPC direction (6,left)
 wait (3)
 set NPC direction (6,up)
 wait (3)
 set NPC frame (6,1)
 wait (1)
 set NPC frame (6,0)
 wait (1)
 set NPC frame (6,1)
 wait (1)
 set NPC frame (6,0)
 wait (1)
 show text box (1368)
 wait (7)
 wait for key (use key)
 advance text box

 show text box (1369)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (6,left,2)
 wait for NPC (6)
 set NPC direction (6,down)
 wait (3)
 set NPC direction (6,right)
 wait (3)
 show text box (1371)
 wait (7)
 wait for key (use key)
 advance text box
 stop song
 wait (10)
 walk hero (me,up,1)
 wait for hero (me)
 wait (5)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1372)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1373)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1374)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (6,1)
 wait (1)
 set NPC frame (6,0)
 wait (1)
 set NPC frame (6,1)
 wait (1)
 set NPC frame (6,0)
 wait (1)
 show text box (1375)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1376)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1377)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (2)
 show text box (1378)
 wait (2)
 fade screen in
 wait (7)
 wait for key (usekey)
 show text box (1379)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1380)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1381)
 wait (7)
 wait for key (use key)
 fade screen out
 wait (2)
 advance text box
 wait (2)
 fade screen in
 wait (2)
 set NPC frame (6,1)
 wait (1)
 set NPC frame (6,0)
 wait (1)
 set NPC frame (6,1)
 wait (1)
 set NPC frame (6,0)
 wait (1)
 show text box (1382)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1383)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1384)
 wait (7)
 wait for key (use key)
 advance text box
 set hero position (1, 13, 14)
 set hero position (2, 15, 14)
 set hero position (3, 14, 15)
 wait (2)
 lock hero (hero:Freki)
 walk hero to x (1,13)
 walk hero to x (2,15)
 walk hero to x (3,14)
 wait for hero (3)
 show text box (1385)
 wait (7)
 wait for key (use key)
 advance text box
 use shop (shop:Before Combat)
 wait (5)
 stop song
 BossIntroduction 
 fight formation (2)
 stop song
 swap by position (0, find hero (hero:Freki))

 unlock hero (hero:Freki)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1386)
 wait (7)
 wait for key (use key)
 advance text box
 wait (15)
 show text box (1387)
 wait (7)
 wait for key (use key)
 advance text box 
 walk hero (1,down,5)
 walk hero (2,down,5)
 walk hero (3,down,5)
 wait (15)

 show text box (1388)
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 tweak palette (-10,-20,-10)
 fade screen in
 wait (3)
 set tag (tag:Beat Fenrisulf,on)
 wait (3)
 set tag (tag:Beat Fenrisulf,off)
 wait (3)
 set tag (tag:Beat Fenrisulf,on)
 wait (3)
 set tag (tag:Beat Fenrisulf,off)
 wait (3)
 set tag (tag:Beat Fenrisulf,on)
 wait (3)
 reset palette
 fade screen in
 wait (3)



 play sound (sfx:earthquake,false,true) 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(left,1,20),waitforcamera
 pancamera(right,2,20),waitforcamera
 pancamera(left,2,20),waitforcamera
 pancamera(right,1,20),waitforcamera 
 pan camera (up,1,20), pan camera (right,1,20), wait for camera
 pan camera (down,2,20), pan camera (left,2,20), wait for camera

 pan camera (up,2,20), pan camera (right,2,20), wait for camera
 pan camera (down,1,20), pan camera (left,1,20), wait for camera
 fade screen out (63,63,63)
 wait (1)

 set tag (tag:FENRIRBREAK,on)
 wait (1)
 fade screen in
 wait (4)
  set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1389)
 wait (7)
 wait for key (use key)
 advance text box 
 show text box (1390)
 wait (7)
 wait for key (use key)
 advance text box 
 show text box (1391)
 wait (7)
 wait for key (use key)
 advance text box 
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1392)
 wait (7)
 wait for key (use key)
 advance text box 
 show text box (1393)
 wait (7)
 wait for key (use key)
 advance text box 

 show text box (1394)
 wait (7)
 wait for key (use key)
 advance text box 
 show text box (1395)
 wait (7)
 wait for key (use key)
 advance text box 

 show text box (1403)
 wait (7)
 wait for key (use key)
 advance text box 
 camera follows hero (me)
 resume caterpillar
 set caterpillar mode (off)
 resume box advance
 resume player

end





script,Freya,begin
 suspend player
 suspend box advance
 wait (2)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (385)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (386)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (387)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (388)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (2)
 show text box (389)
 wait (2)
 fade screen in
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (390)
 wait (2)
 fade screen in
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (391)
 wait (2)
 fade screen in
 wait (7)
 wait for key (usekey)
 fade screen out
 wait (2)
 advance text box
 wait (2)
 fade screen in
 wait (2)

 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1396)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1397)
 wait (7)
 wait for key (use key)
 advance text box

 resume box advance
 resume player
end

script,brising,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 teleport to map (map:Boundless Ocean,26,44)
 wait (1)
 fade screen in
 wait (1)
 resume player
end

script,NIGHTTHUNDER,begin
 suspend player
 suspend box advance
 swap by position (0, find hero (hero:Night))
 teach spell ((find hero(hero:Night)),atk:Thunder)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1440)
 wait (7)
 wait for key (use key)
 advance text box

 show text box (1441)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1442)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1443)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1444)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1445)
 wait (7)
 wait for key (use key)
 advance text box

 show text box (1446)
 wait (7)
 wait for key (use key)
 advance text box

 wait (3)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:ChargedLightningAttack8Bit,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1447)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1448)
 wait (7)
 wait for key (use key)
 advance text box
 play sound (sfx:lightning,false,true)
 fade screen out (63,63,63)
 wait (20)
 set tag (tag:ThorLake2,on)
 wait (2)
 fade screen in

 resume box advance
 resume player
end


script,Grue,begin
 suspend player
 suspend box advance
 BossIntroduction
 fight formation (173)
 resume player
 resume box advance
end


script,MontereyPenguin,begin
 suspend player
 suspend box advance
 BossIntroduction  
 fight formation (169)
 resume player
 resume box advance
end

script,Triangletrap,begin
 suspend player
 suspend box advance
 BossIntroduction
 fight formation (59)
 resume player
 resume box advance
end

script,Garm,begin
 suspend player
 suspend box advance
 BossIntroduction
 fight formation (98)
 resume player
 resume box advance
end

script,Chainsaw Jack,begin
 suspend player
 suspend box advance
 BossIntroduction
 fight formation (105)
 set tag (tag:stickman,on)
 resume player
 resume box advance
end

script,Rell,begin
 suspend player
 suspend box advance
 swap by position (2, find hero (hero:Eric))
 suspend caterpillar 
 wait (1)
 set caterpillar mode (on)
 set hero position (1, 40, 17)
 set hero position (2, 40, 17)
 set hero position (3, 40, 17)
 wait (1)
 suspend caterpillar 
 walk hero (1,left)
 walk hero (2,right)
 walk hero (3,up)
 wait for hero (1)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1940)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1941)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1942)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1943)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 set tag (tag:RELLFIGHT,on)
 fight formation (106)

 wait (3)
 tweak palette (0,10,0)
 update palette
 play sound (sfx:DrainMagic,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1944)
 wait (7)
 wait for key (use key)
 advance text box 
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1945)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (1,right,1)
 walk hero (2,left,1)
 walk hero (3,down,1)
 wait for hero (3)
 set caterpillar mode (off)
 wait (1)
 resume player
 resume caterpillar
 
 resume box advance
end

script,Crimson,begin
 suspend player
 suspend box advance
 walk hero (me,down,1)
 wait for hero (me)
 show text box (2088)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,right)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2089)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (15,left,3)
 wait for NPC (3)

 show text box (574)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction 
 fight formation (107)
 set tag (tag:IrregularDefeated,on)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2090)
 wait (7)
 wait for key (use key)
 advance text box
 stop song
 fade screen out
 wait (1)
 show text box (2087)
 wait (2)
 fade screen in
 wait (7)
 wait for key (use key)
 fade screen out
 wait (1)
 advance text box
 wait (2)
 teleport to map (16,8,66)
 stop song
 wait (1)
 fade screen in
 play song (song:Vile)
 focus camera (8,71,4)
 wait for camera
 show text box (2091)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2092)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2093)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (11,down,1)
 wait for NPC (11)
 show text box (2094)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (-5,-10,-10)
 fade screen in
 wait (5)
 set NPC position (37,8,72)
 play sound (sfx:FlameMagic,false,true)
 wait (5)
 set hero direction (me,down)
 reset palette
 fade screen in
 wait (5)
 show text box (2095)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2096)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2097)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (15,0,0)
 update palette
 wait (3)
 reset palette
 update palette
 wait (1)
 show text box (2098)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (-5,-10,-10)
 play sound (sfx:FlameMagic,false,true)
 Alter NPC (37,NPCstat:picture,113)
 Alter NPC (37,NPCstat:palette,10)
 fade screen in
 wait (5)
 set NPC position (37,1,1)
 wait (3)
 reset palette
 fade screen in
 wait (3)
 stop song
 wait (2)
 set NPC position (30,8,79)
 walk NPC (30,up,7)
 wait for NPC (30)
 set NPC position (26,8,72)  #Dogero
 set NPC position (27,8,72)  #Housemaster
 walk NPC (26,left)
 walk NPC (27,right)
 wait for NPC (16)
 set NPC direction (26,up)
 set NPC direction (27,up)
 show text box (2099)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2100)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (11,up,1)
 set NPC direction (11,down)
 show text box (2101)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (30,up,1)
 wait for NPC (30)
 show text box (2102)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2103)
 wait (7)
 wait for key (use key)
 advance text box
 wait (4)
 set NPC direction (30,left)
 wait (4)
 show text box (2104)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (26,right)
 show text box (2105)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (26,down,10)
 wait (4)
 walk NPC (11,down,1)
 wait for NPC (11)
 show text box (2106)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (30,left)
 wait (2)
 set NPC direction (30,down)
 wait (2)
 show text box (2107)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2108)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 walk NPC (30,down,10)
 walk NPC (27,down,10)
 wait (5)
 walk NPC (11,down,1)
 wait for NPC (11)
 show text box (2109)
 wait (7)
 wait for key (use key)
 advance text box 
 show text box (2110)
 wait (7)
 wait for key (use key)
 advance text box 

 fade screen out
 wait (1)
 camera follows hero (me)
 wait (1)
 teleport to map (6,10,54)
 wait (1)
 fade screen in
 resume player
 resume box advance
end

script,Josh,begin
 suspend player
 suspend box advance
 BossIntroduction 
 fight formation (108)
 resume player
 resume box advance
end

script,Walrus,begin
 suspend player
 suspend box advance
 BossIntroduction
 fight formation (110)
 resume player
 resume box advance
end

script,Surlaw,begin
 suspend player
 suspend box advance
 BossIntroduction
 fight formation (111)
 resume player
 resume box advance
end


script,Deactivated,begin
 suspend player
 suspend box advance
 swap by position (0, find hero (hero:Bram))
 swap by position (1, find hero (hero:Styrge))
 wait (1)
 set caterpillar mode (on)
 set hero position (1, 58, 30)
 set hero position (2, 2, 2)
 set hero position (3, 3, 3)
 wait (1)
 suspend caterpillar 
 walk hero (1,left,1)
 wait for hero (1)
 set hero direction (1,down)
 wait (3)
 set hero direction (1,right)
 wait (3)

 teach spell ((find hero(hero:Bram)),atk:Beam)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1449)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1450)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1451)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1452)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1453)
 wait (7)
 wait for key (use key)
 advance text box
 play sound (sfx:Soft_Airy_Swish,false,true) 
 show text box (1454)
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:Beam Attack,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1455)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1456)
 wait (7)
 wait for key (use key)
 advance text box
 play sound (sfx:Beam Attack,false,true)
 wait (10)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,right)
 wait (2)
 BossIntroduction
 fight formation (177)
 set tag (tag:deactivated,on)
 wait (3)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:Beam Attack,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1460)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1457)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1458)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1459)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1461)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (1,right,1)
 wait for hero (1)
 set caterpillar mode (off)
 resume caterpillar

 resume player
 resume box advance
end


script,triangle1,begin
 suspend player
 suspend box advance
 

 focus camera (8,14,4)
 wait for camera
 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1469)
 wait (7)
 wait for key (use key)
 advance text box

 walk NPC (0,down,7)
 wait (3)
 walk NPC (2,left,1)
 wait for NPC (2)
 wait (3)
 set NPC direction (2,up)
 set NPC frame (2,1)
 wait (1)
 set  NPC frame (2,0)
 wait (1)
 set  NPC frame (2,1)
 wait (1)
 set  NPC frame (2,0)
 wait (1)
 show text box (1470)
 wait (7)
 wait for key (use key)
 advance text box




 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1471)
 wait (7)
 wait for key (use key)
 advance text box



 walk hero (me,down,2)
 walk NPC (2,up,2)
 wait for hero (me)
 set hero direction (me,right)
 set NPC direction (2,left)
 set NPC frame (2,1)
 wait (1)
 set  NPC frame (2,0)
 wait (1)
 set  NPC frame (2,1)
 wait (1)
 set  NPC frame (2,0)
 wait (1)
 show text box (1472)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1473)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1474)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (2,down)
 wait (5)
 set NPC direction (2,right)
 wait (5)
 set NPC frame (2,1)
 wait (1)
 set  NPC frame (2,0)
 wait (1)
 set  NPC frame (2,1)
 wait (1)
 set  NPC frame (2,0)
 wait (1)
 show text box (1475)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1476)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (2,1)
 wait (1)
 set  NPC frame (2,0)
 wait (1)
 set  NPC frame (2,1)
 wait (1)
 set  NPC frame (2,0)
 wait (1)
 show text box (1477)
 wait (7)
 wait for key (use key)
 advance text box
 suspend obstruction
 wait (1)
 walk NPC (2,left,1)
 wait for NPC (2)
 camera follows hero (me)
 unlock hero (hero:Styrge)
 set tag (tag:Styrgerejoins,on)
 resume box advance
 resume player
 resume obstruction
end

script,triangle2,begin
 suspend player
 suspend box advance
 suspend NPCs
 focus camera (53,26,4)
 wait for camera
 swap by position (0, find hero (hero:Styrge))
 wait (1)
 set caterpillar mode (on)
 set hero position (1, 53, 29)
 set hero position (2, 53, 29)
 set hero position (3, 53, 29)
 wait (1)
 suspend caterpillar 
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (me,up,1)
 wait for hero (me)
 set hero direction (1,up)
 set hero direction (2,up)

 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1478)
 wait (7)
 wait for key (use key)
 advance text box
  set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1479)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set NPC direction (9,left)
 wait (5)
 set NPC direction (9,down)
 show text box (1480)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1481)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1482)
 wait (7)
 wait for key (use key)
 advance text box
 #MrT should morph into Guilt now


 fade screen out (63,63,63)
 wait (1)
 Alter NPC (9,NPCstat:picture,4)
 Alter NPC (9,NPCstat:palette,147)
 wait (1)
 fade screen in
 wait (5)


 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1483)
 wait (7)
 wait for key (use key)
 advance text box

 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1484)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1485)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1486)
 wait (7)
 wait for key (use key)
 advance text box

 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1487)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (9,down,1)
 wait for NPC (9)
 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1488)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,up,1)
 wait for hero (me)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1489)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1490)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (1)
 show text box (1491)
 wait (1)
 fade screen in
 wait (7)
 wait for key (usekey)
 show text box (1492)
 wait (7)
 wait for key (use key)
 fade screen out
 wait (1)
 advance text box
 wait (1)
 fade screen in
 wait (3)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1493)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1494)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1495)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (1,up,1)
 wait for hero (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1496)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1497)
 wait (7)
 wait for key (use key)
 advance text box


 walk hero (2,up,1)
 wait for hero (2)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1498)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1499)
 wait (7)
 wait for key (use key)
 advance text box

 walk hero (3,up,1)
 wait for hero (3)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1500)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (9,left)
 wait (5)
 set NPC direction (9,up)
 wait (5)
 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1501)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1502)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1503)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (9,left)
 wait (3)
 set NPC direction (9,down)
 wait (3)
 show text box (1504)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (193)
 set tag (tag:Guiltdefeated,on)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1505)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (10,10,10)
 play sound (sfx:Heal8Bit,false,true)
 force equip (0,slot:weapon,item:Cosmos)
 wait (1)
 delete item (item:Cursed,1)
 wait (1)
 reset palette
 fade screen in
 show text box (1506)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 fade screen out (63,63,63)
 wait (2)
 focus camera (50,15,4)
 wait for camera
 set caterpillar mode (off)
 resume caterpillar
 set hero position (me, 47, 15)
 set hero direction (me,right)
 fade screen in
 show text box (1507)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1508)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1509)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1510)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 fade screen out
 wait (1)
 camera follows hero (me)
 wait (1)
 use door (2)

 resume box advance
 resume NPCs
 resume player
end

script,fiends1,begin
 suspend player
 suspend box advance
 focus camera (9,79,4)
 wait for camera
 wait (5)
 show text box (1511)
 wait (7)
 wait for key (use key)
 advance text box

 focus camera (9,85,4)
 wait for camera
 camera follows hero (me)
 resume box advance
 resume player
end

script,fiends2,begin
 suspend player
 suspend box advance
 wait (5)
 set hero direction (me,left)
 wait (5)
 set hero direction (me,right)
 wait (5)
 set hero direction (me,left)
 wait (5)
 set hero direction (me,right)
 wait (5)
 set hero direction (me,left)
 wait (5)
 set hero direction (me,right)
 wait (5)
 set hero direction (me,down)
 show text box (1512)
 wait (7)
 wait for key (use key)
 advance text box
 resume box advance
 resume player
 resume random enemies
 resume obstruction
end

script,Hatifinal,begin
 suspend player
 suspend NPCs
 suspend box advance

 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1513)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1514)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1515)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set NPC direction (9,right)
 wait (5)
 set NPC direction (9,up)
 wait (5)
 set NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 set  NPC frame (9,1)
 wait (1)
 set  NPC frame (9,0)
 wait (1)
 show text box (1516)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1517)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1518)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (9,right)
 show text box (1519)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1520)
 wait (7)
 wait for key (use key)
 advance text box
#hati goes to the moon now
 

 play sound (sfx:wind,false,true)
 fade screen out (63,63,63)
 wait (15)
 swap by position (0, find hero (hero:Night))
 swap out hero (hero:Kitt)
 swap out hero (hero:Styrge)
 swap out hero (hero:Bram)
 swap out hero (hero:Eric)
 swap out hero (hero:Hilda)
 swap out hero (hero:Olaf)

 swap out hero (hero:Frumpy)
 swap out hero (hero:Freki)
 swap out hero (hero:Renard)
 swap out hero (hero:Xephes)
 swap out hero (hero:Dragon)
 wait (5)
 use door (6)
 wait (3)
 walk NPC (0,right,3)
 wait for NPC (0)
 wait (5)
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1521)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set NPC direction (0,up)
 wait (10)
 set NPC direction (0,right)
 wait (3)
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1522)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 stop song
 walk NPC (0,right,1)
 wait for NPC (0)
 wait (3)
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1523)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 play song (song:Towards Odds Impassible)
 wait (10)
 set NPC direction (1,right)
 wait (10)
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 show text box (1524)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1525)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (1,down)
 wait (3)
 set NPC direction (1,left)
 wait (3)
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 show text box (1526)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (1,left,1)
 show text box (1527)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 walk NPC (0,right,1)
 wait for NPC (0)
 wait (3)
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1528)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 show text box (1529)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1530)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (0,down)
 wait (3)
 set NPC direction (0,left)
 wait (3)
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1531)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1532)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1533)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (1,left,1)
 wait for NPC (1)
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 show text box (1534)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (0,down)
 wait (3)
 set NPC direction (0,right)
 wait (3)
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1535)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (2)
 set NPC position (0, 14, 6)
 set NPC position (1, 13, 6)
 set NPC direction (0,left)
 set NPC direction (1,right)
 wait (2)
 fade screen in
 wait (5)
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set NPC frame (0,1)
 wait (1)
 set NPC direction (1,up)
 wait (7)
 set NPC direction (1,right)
 wait (5)
 fade screen out
 wait (2)
 set NPC position (0, 2, 8)
 set NPC position (1, 2, 7)
 set NPC direction (0,up)
 set NPC direction (1,down)
 wait (2)
 fade screen in
 wait (5)
 walk NPC (5,up,4)
 wait (5)
 set NPC direction (0,right)
 set NPC direction (1,right)
 wait for NPC (5)
 play sound (sfx:Beam Attack,false,true)
 wait (10)
 set NPC direction (0,up)
 set NPC direction (1,down)
 wait (10) 
 set NPC direction (0,right)
 set NPC direction (1,right)
 wait (3)
 walk NPC (0,right,1)
 walk NPC (1,right,1)
 wait for NPC (0)
 walk NPC (5,right,1)
 wait for NPC (5)
 wait (3)
 set NPC direction (0,up)
 set NPC direction (1,down)
 wait (10) 
 set NPC direction (0,right)
 set NPC direction (1,right)
 wait (3)
 set NPC frame (5,1)
 wait (1)
 set  NPC frame (5,0)
 wait (1)
 set  NPC frame (5,1)
 wait (1)
 set  NPC frame (5,0)
 wait (1)
 play sound (sfx:Beam Attack,false,true)
 wait (10)
 walk NPC (0,right,5)
 walk NPC (1,right,1)
 walk NPC (5,right,5)
 wait for NPC (5)
 walk NPC (5,down,4)
 wait (3)
 set NPC direction (0,down)
 wait for NPC (5)
 wait (3)
 fade screen out
 wait (2)
 set NPC position (0, 7, 5)
 set NPC position (1, 8, 5)
 set NPC direction (0,up)
 set NPC direction (1,up) 
 set NPC position (3, 0, 2)
 set NPC direction (3,right)
 wait (2)
 fade screen in
 wait (2)
 walk NPC (3,right,3)
 wait for NPC (3)
 walk NPC (3,right,2)
 walk NPC (3,up,1)
 wait for NPC (3)
 walk NPC (3,right,3)
 wait for NPC (3)
 walk NPC (3,right,2)
 walk NPC (3,down,1)
 wait for NPC (3)
 walk NPC (3,right,3)
 wait for NPC (3)
 wait (5)
 Alter NPC (3,NPCstat:move speed,5)
 set NPC position (4, 15, 2)
 wait (3)
 walk NPC (3,left,10)
 walk NPC (4,left,10)
 wait for NPC (3)
 fade screen out
 wait (2)
 set NPC position (0, 12, 4)
 set NPC position (1, 8, 5)
 set NPC direction (0,left)
 set NPC direction (1,right) 
 wait (2)
 set NPC position (3, 0, 11)
 set NPC position (4, 1, 11)
 wait (2)
 fade screen in
 Alter NPC (0,NPCstat:move speed,2)
 Alter NPC (1,NPCstat:move speed,2)
 wait (5)
 walk NPC (0,up,2)
 set NPC direction (0,left)
 wait for NPC (0)
 wait (2)
 walk NPC (0,down,2)
 set NPC direction (0,left)
 wait for NPC (0)
 wait (5)
 walk NPC (1,up,2)
 set NPC direction (1,right)
 wait for NPC (1)
 wait (2)
 walk NPC (1,down,2)
 set NPC direction (1,right)
 wait for NPC (1)
 wait (5)
 walk NPC (0,up,2)
 set NPC direction (0,left)
 wait for NPC (0)
 wait (2)
 walk NPC (0,down,2)
 set NPC direction (0,left)
 wait for NPC (0)
 wait (5)
 walk NPC (1,up,2)
 set NPC direction (1,right)
 wait for NPC (1)
 wait (2)
 walk NPC (1,down,2)
 set NPC direction (1,right)
 wait for NPC (1)
 wait (5)
 walk NPC (0,up,4)
 set NPC direction (0,left)
 wait for NPC (0)
 wait (5)
 set NPC direction (0,down)
 wait (2)
 Alter NPC (0,NPCstat:move speed,4)
 Alter NPC (1,NPCstat:move speed,5)
 walk NPC (1,right,4)
 wait for NPC (1)
 set NPC direction (1,up)
 wait (5)
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1) 
 walk NPC (1,up,2)
 wait for NPC (1)
 wait (1)
 walk NPC (1,down,2)
 set NPC direction (1,up)
 wait for NPC (1)
 wait (1) 
 walk NPC (1,up,2)
 wait for NPC (1)
 wait (1)
 walk NPC (1,down,2)
 set NPC direction (1,up)
 wait for NPC (1)
 wait (1) 
 walk NPC (1,up,2)
 wait for NPC (1)
 wait (1)
 walk NPC (1,down,2)
 set NPC direction (1,up)
 wait for NPC (1)
 fade screen out
 wait (2)
 set NPC position (0, 7, 6)
 set NPC position (1, 8, 6)
 set NPC direction (0,up)
 set NPC direction (1,up)
 wait (2)
 fade screen in
 wait (2)
 walk NPC (1,up,1)
 wait for NPC (1)

 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 show text box (1536)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1537)
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 set NPC direction (1,left)
 wait (3)
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 show text box (1538)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (0,up,1)
 wait for NPC (0)
 set NPC direction (0,right)
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1539)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1540)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 show text box (1541)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (195)

 wait (3)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:ChargedSonicBoomAttack8Bit,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1542)
 wait (7)
 wait for key (use key)
 advance text box

 teach spell ((find hero(hero:Night)),atk:Flare)
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1543)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 show text box (1544)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 set  NPC frame (0,1)
 wait (1)
 set  NPC frame (0,0)
 wait (1)
 show text box (1545)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 fade screen out (63,63,63)
 wait (15)

 wait (5)
 walk hero (me,right,1)
 wait (5)
 use door (1)
 wait (2)
 fade screen in
 wait (1)
 show text box (1050)
 wait (7)
 wait for key (use key)
 advance text box
 resume random enemies
 resume obstruction
resume player
resume box advance
end




script,zidane,begin
 show textbox (1547)
 wait (16)
 walk hero (me,down,3)
 walk NPC (25,down,3)
 wait for NPC (25)
 walk NPC (25,up,3)
 wait for NPC (25)
 resume random enemies
 resume obstruction
end


script,EricSILENCE,begin
 suspend player
 suspend box advance
 swap by position (0, find hero (hero:Eric))
 wait (1)
 show text box (1577)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (1578)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (me,down)
 wait (10)
 set hero z (me,5)
 wait (2)
 set hero z (me,10)
 wait (2)
 set hero z (me,5)
 wait (2)
 set hero z (me,0)
 wait (2)
 set hero direction (me,up)
 wait (5)
 show text box (1579)
 wait (7)
 wait for key (usekey)
 advance text box


 wait (1)
 set tag (tag:EricSilen,on)
 wait (1)
 fade screen in
 wait (2)
 tweak palette (10,0,0)
 update palette

 teach spell ((find hero(hero:Eric)),atk:Silence)
 wait (10)
 reset palette
 fade screen in
 show text box (1580)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out (63,63,63)
 wait (1)
 resume box advance
 wait (2)
 fade screen in
 wait (2)
 resume player
 resume random enemies
 resume obstruction
end

script, BossIntroduction,begin
 #The new boss fight effect!
 show text box (1361)
 tweak palette (30,-10,-10)
 fade screen in
 play sound (sfx:WARNING,false,true) 
 wait (10)
 reset palette
 fade screen in
 advance textbox


 Variable (var1) 
 Variable (var2) 
 #This next script part was originally done by Mad Cacti.
 #Truthfully, I have no idea what's going on here.
 #Seriously.  But you should always try to indicate to the player that something BIG is coming.
 wait (3) 
 For (var1,0,2,1) 
 Do(for(var2,0,255,1) 
 Do(Write color (var2,var1,63--read color (var2,var1)))) 
 Fade screen in 
 wait (1)
 reset palette
 #After the nifty color inverting takes place, we've got a battle to fight!  
end

script,Dogero,begin
 suspend player
 suspend box advance
 walk hero to y (me,22)
 wait for hero (me)
 walk hero to x (me,12) 
 wait for hero (me)
 wait (3)
 pan camera (down,2)
 set caterpillar mode (on)
 set hero position (1, 12, 22)
 set hero position (2, 12, 22)
 set hero position (3, 12, 22)
 wait (1)
 suspend caterpillar 
 wait (1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (3,down,1)
 wait for hero (1)
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)

 set NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 set  NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 show text box (1554)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1555)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 set  NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 show text box (1556)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1557)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 set  NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 show text box (1558)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1559)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (6,left)
 wait (5)
 set NPC direction (6,up)
 wait (5)
 set NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 set  NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 show text box (1560)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1561)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1562)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (6,left)
 wait (5)
 set NPC direction (6,down)
 wait (5)
 set NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 set  NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 show text box (1563)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1564)
 wait (7)
 wait for key (use key)
 advance text box


 show text box (1565)
 wait (7)
 wait for key (use key)
 advance text box
 #Mila joins in on the fun!
 walk NPC (7,up,9)
 show text box (1566)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (9,left,3)
 set hero direction (2,right)
 set hero direction (3,down)
 wait for NPC (7)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1567)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 set  NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 show text box (1568)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1569)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1570)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 set NPC direction (6,left)
 wait (5)
 walk NPC (6,left,1)
 wait for NPC (6)
 set NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 set  NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 show text box (1571)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (1,left)
 walk NPC (8,right,4)
 walk NPC (6,right,1)
 wait for NPC (6)
 set NPC direction (6,down) 



 set NPC frame (7,1)
 wait (1)
 set  NPC frame (7,0)
 wait (1)
 set  NPC frame (7,1)
 wait (1)
 set  NPC frame (7,0)
 wait (1)
 show text box (1595)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 set  NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 show text box (1596)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 set  NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 show text box (1597)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (87)
 play song (song:Towards Odds Impassible)
 wait (5)
 Alter NPC (6,NPCstat:picture,156)
 Alter NPC (6,NPCstat:palette,82)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 set NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 set  NPC frame (6,1)
 wait (1)
 set  NPC frame (6,0)
 wait (1)
 show text box (1598)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 set hero frame (me,1)
 wait (1)
 set hero frame (me,0)
 wait (1)
 show text box (1599)
 wait (7)
 wait for key (use key)
 advance text box
 wait (4)
 set NPC direction (6,up)
 wait (4)
 show text box (1600)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (7, left,2)
 wait for NPC (7)
 walk NPC (7,up,4)
 wait for NPC (7)
 set NPC direction (7,right)
 set NPC frame (7,1)
 wait (1)
 set  NPC frame (7,0)
 wait (1)
 set  NPC frame (7,1)
 wait (1)
 set  NPC frame (7,0)
 wait (1)
 show text box (1601)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1602)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1603)
 wait (7)
 wait for key (use key)
 advance text box
 wait (4)
 set NPC direction (6,down)
 wait (4)

 show text box (1604)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1605)
 wait (7)
 wait for key (use key)
 advance text box

 show text box (1606)
 wait (7)
 wait for key (use key)
 advance text box
 wait (4)
 set NPC direction (6,up)
 wait (4)
 show text box (1607)
 wait (7)
 wait for key (use key)
 advance text box
 wait (4)
Alter NPC (6,NPCstat:move speed,2)
 tweak palette (0,0,10)
 play sound (sfx:wind,false,true)
 fade screen in
 Alter NPC (6,NPCstat:picture,145)
 Alter NPC (6,NPCstat:palette,3)
 suspend NPC walls
 wait (3)
 reset palette
 pan camera (up,4)
 walk NPC (6,up,1)
 set NPC direction (6,down)
 wait for NPC (6)
 walk NPC (6,up,1)
 walk NPC (6,right,1)
 set NPC direction (6,left)
 wait for NPC (6)
 walk NPC (6,up,1)
 set NPC direction (6,up)
 wait for NPC (6)
 walk NPC (6,up,1)
 walk NPC (6,right,1)
 set NPC direction (6,right)
 wait for NPC (6)
 Alter NPC (6,NPCstat:picture,157)
 Alter NPC (6,NPCstat:palette,3)
 set NPC direction (6,down)
 pan camera (right,4)
 wait (1)
 walk NPC (6,right,1)
 set NPC direction (6,left)
 wait for NPC (6)
 wait (1)
 walk NPC (6,right,1)
 set NPC direction (6,up)
 wait for NPC (6)
 wait (1)
 walk NPC (6,right,1)
 set NPC direction (6,right)
 wait for NPC (6)
 wait (1)
 Alter NPC (6,NPCstat:picture,29)
 Alter NPC (6,NPCstat:palette,60)
 walk NPC (6,right,1)
 set NPC direction (6,down)
 wait for NPC (6)
 wait (1)
 walk NPC (6,right,1)
 set NPC direction (6,left)
 wait for NPC (6)
 wait (1)
 walk NPC (6,right,1)
 set NPC direction (6,right)
 wait for NPC (6)
 wait (1)
 walk NPC (6,right,1)
 set NPC direction (6,up)
 wait for NPC (6)
 wait (8)
 fade screen in
 wait (8)
 pan camera (down,5)
 wait for camera
 pan camera (left,4)
 wait for camera
 set NPC frame (7,1)
 wait (1)
 set  NPC frame (7,0)
 wait (1)
 set  NPC frame (7,1)
 wait (1)
 set  NPC frame (7,0)
 wait (1)
 show text box (1608)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1609)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (7,down)
 set NPC frame (7,1)
 wait (1)
 set  NPC frame (7,0)
 wait (1)
 set  NPC frame (7,1)
 wait (1)
 set  NPC frame (7,0)
 wait (1)
 show text box (1610)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (8,1)
 wait (1)
 set  NPC frame (8,0)
 wait (1)
 set  NPC frame (8,1)
 wait (1)
 set  NPC frame (8,0)
 wait (1)
 show text box (1611)
 wait (7)
 wait for key (use key)
 advance text box
 wait (1)
 fade screen out
 wait (1)
 set caterpillar mode (off)
 resume caterpillar
 camera follows hero (me)
 set tag (tag:Dogeroend,on)
 wait (1)
 fade screen in
 resume player
 resume box advance
 resume random enemies
 resume obstruction
 resume NPC walls
 wait (1)



end

script,Dracula,begin
 suspend player
 suspend box advance
 walk hero to y (me,10)
 wait for hero (me)
 walk hero to x (me,10)
 wait for hero (me)
 focus camera (10,7,2)
 set caterpillar mode (on)
 set hero position (1, 10, 10)
 set hero position (2, 10, 10)
 set hero position (3, 10, 10)
 wait (1)
 suspend caterpillar 
 wait (1)
 walk hero (me,left,1)
 walk hero (3,right,1)
 wait for hero (me)
 walk hero (1,left,1)
 walk hero (2,right,1)
 walk hero (me,left,1)
 walk hero (3,right,1)
 wait for hero (me)
 walk hero (me,left,1)
 walk hero (3,right,1)
 wait for hero (me)
 wait for camera
 set hero direction (0,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 set NPC frame (2,1)
 wait (1)
 set  NPC frame (2,0)
 wait (1)
 set  NPC frame (2,1)
 wait (1)
 set  NPC frame (2,0)
 wait (1)
 show text box (1612)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 show text box (1613)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1614)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1615)
 wait (7)
 wait for key (use key)
 advance text box
 wait (7)
 show text box (1616)
 #WHAT IS A MAN?!
 suspend NPC walls
 suspend obstruction
 wait (2)
 set NPC position (3, 10, 5)
 wait (1)
 walk NPC (3,up,1)
 walk NPC (3,right,1)
 wait for NPC (3)
 walk NPC (3,down,1)
 walk NPC (3,right,1)
 wait for NPC (3)
 walk NPC (3,down,2)
 advance text box
 play sound (sfx:Ice Crash,false,true)
 Alter NPC (2,NPCstat:picture,159)
 set NPC direction (2,up)
 walk NPC (3,down,1)
 set NPC direction (3,left)
 wait for NPC (3)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1617)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1618)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (1,down,1)
 wait for NPC (1)
 show text box (1619)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (203)
 fight formation (204)
 fight formation (205)
 fight formation (206)
 show text box (1620)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (208)
 play sound (sfx:earthquake,false,true) 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(left,1,20),waitforcamera
 pancamera(right,2,20),waitforcamera
 pancamera(left,2,20),waitforcamera
 pancamera(right,1,20),waitforcamera 
 pan camera (up,1,20), pan camera (right,1,20), wait for camera
 pan camera (down,2,20), pan camera (left,2,20), wait for camera

 pan camera (up,2,20), pan camera (right,2,20), wait for camera
 pan camera (down,1,20), pan camera (left,1,20), wait for camera
 fade screen out (63,63,63)
 wait (1)

 set tag (tag:Dracula,on)
 wait (1)
 set hero position (me, 10, 10)
 resume caterpillar
 set caterpillar mode (off)
 camera follows hero (me)
 wait (4)
 fade screen in
 wait (4)

 tweak palette (10,0,0)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Acme)
 wait (10)
 reset palette
 fade screen in
 show text box (1622)
 wait (7)
 wait for key (use key)
 advance text box

 resume NPC walls
 resume obstruction
 resume player
 resume box advance
end 

script,Narvi,begin
 fight formation (198)
 wait (1)
 if (checktag(tag:Cure2)) 	then 	(
 wait (4)
 suspend player
 suspend box advance
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Care2)
 wait (10)
 reset palette
 fade screen in
 show text box (1623)
 wait (7)
 wait for key (use key)
 advance text box
 resume player
 resume random enemies
 resume obstruction
 resume box advance)
 else (wait (1))
end

script,Shayna,begin
 suspend player
 suspend box advance
 suspend NPCs
 swap by position (0, find hero (hero:Hilda))
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1625)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 show text box (1626)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1627)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1628)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (164)
 wait (4)

 tweak palette (10,0,0)
 update palette
 play sound (sfx:Ice Crash,false,true)
 teach spell ((find hero(hero:Hilda)),atk:Ice Age)
 wait (10)
 reset palette
 fade screen in
 show text box (1629)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 set  NPC frame (1,1)
 wait (1)
 set  NPC frame (1,0)
 wait (1)
 show text box (1630)
 wait (7)
 wait for key (use key)
 advance text box
 set tag (tag:Shayna,on)
 resume player
 resume box advance
 resume NPCs
 resume random enemies
 resume obstruction
end

script,Velius,begin
 fight formation (209)
 wait (1)
 if (checktag(tag:Fire2)) 	then 	(
 wait (4)
 suspend player
 suspend box advance
 tweak palette (10,0,0)
 update palette
 play sound (sfx:MediumExplosion8Bit,false,true)
 teach spell ((find hero(hero:Night)),atk:Sunder)
 wait (10)
 reset palette
 fade screen in
 show text box (1632)
 wait (7)
 wait for key (use key)
 advance text box
 resume player
 resume random enemies
 resume obstruction
 resume box advance)
 else (wait (1))
end


script,Delvire,begin
 fight formation (210)
 wait (1)
 if (checktag(tag:Flee)) 	then 	(
 wait (4)
 suspend player
 suspend box advance
 tweak palette (0,10,0)
 update palette
 play sound (sfx:Soft_Airy_Swish,false,true)
 teach spell ((find hero(hero:Bram)),atk:Flee)
 wait (10)
 reset palette
 fade screen in
 show text box (1634)
 wait (7)
 wait for key (use key)
 advance text box
 resume player
 resume random enemies
 resume obstruction
 resume box advance)
 else (wait (1))
end

script,Sasha,begin
 fight formation (211)
 wait (1)
 if (checktag(tag:Heal2)) 	then 	(
 wait (4)
 suspend player
 suspend box advance
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Nurse2)
 wait (10)
 reset palette
 fade screen in
 show text box (1633)
 wait (7)
 wait for key (use key)
 advance text box
 resume player
 resume random enemies
 resume obstruction
 resume box advance)
 else (wait (1))
 resume random enemies
 resume obstruction
end

script,Siva,begin
 fight formation (212)
 wait (1)
 if (checktag(tag:Bandage)) 	then 	(
 wait (4)
 suspend player
 suspend box advance
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 teach spell ((find hero(hero:Styrge)),atk:Bandage)
 wait (10)
 reset palette
 fade screen in
 show text box (1635)
 wait (7)
 wait for key (use key)
 advance text box
 resume player
 resume box advance)
 else (wait (1))
 resume random enemies
 resume obstruction
end

script,Alex,begin
 fight formation (213)
 wait (1)
 if (checktag(tag:Rush)) 	then 	(
 wait (4)
 suspend player
 suspend box advance
 tweak palette (10,0,0)
 update palette
 play sound (sfx:MediumExplosion8Bit,false,true)
 teach spell ((find hero(hero:Olaf)),atk:Rush)
 wait (10)
 reset palette
 fade screen in
 show text box (1636)
 wait (7)
 wait for key (use key)
 advance text box
 resume player
 resume box advance)
 else (wait (1))
 resume random enemies
 resume obstruction
end

script,Collies1,begin
 suspend player
 suspend box advance
 tweak palette (10,0,10)
 update palette
 swap by position (0, find hero (hero:Night))
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1638)
 wait (7)
 wait for key (use key)
 advance text box
 swap out hero (hero:Styrge)
 swap out hero (hero:Olaf)
 swap out hero (hero:Eric)
 wait (5)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,right)
 wait (3)
 show text box (1639)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set hero direction (me,down)
 wait (3)
 walk hero (me,left,2)
 wait for hero (me)
 wait (5)
 set hero direction (me,down)
 wait (5)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1640)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (214)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:Ice Crash,false,true)
 teach spell ((find hero(hero:Night)),atk:Winter)
 wait (3)
 reset palette
 update palette
 show text box (1637)
 wait (7)
 wait for key (use key)
 advance text box
 wait (1)
 swap in hero (hero:Styrge)
 swap in hero (hero:Olaf)
 swap in hero (hero:Eric)
 set caterpillar mode (on)
 set hero position (1, 7, 10)
 set hero position (2, 8, 10)
 set hero position (3, 8, 9)
 wait (1)
 suspend caterpillar 
 wait (1)
 walk hero (1,right,4)
 walk hero (2,right,4)
 walk hero (3,right,4)
 wait for hero (3)
 show text box (1641)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 set hero direction (me,left)
 wait (2)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1642)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1643)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1644)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 fade screen out
 wait (2)
 resume caterpillar
 reset palette
 set caterpillar mode (off)
 wait (1)
 swap by position (0, find hero (hero:Olaf))
 swap by position (1, find hero (hero:Styrge))
 swap by position (2, find hero (hero:Eric))
 swap by position (3, find hero (hero:Night))
 resume box advance
 wait (2)
 fade screen in
 wait (2)
 resume player
 resume random enemies
 resume obstruction
end

script,mindscrew,begin
 suspend player
 suspend box advance
 set caterpillar mode (on)
 resume caterpillar
 wait (1)
 fade screen out
 wait (2)
 swap by position (0, find hero (hero:Freki))
 swap by position (1, find hero (hero:Bram))
 swap by position (2, find hero (hero:Renard))
 use door (7)
 show textbox (1650)
 walk hero (me,down,1)
 wait for hero (me)
 walk hero (me,left,9)
 fade screen in
 wait for hero (me)
 wait (5)
 wait for key (usekey)
 advance textbox
 suspend caterpillar
 set hero direction (me,down)
 set hero direction (1,down)
 wait (3)
 set hero direction (me,right)
 set hero direction (1,right)
 wait (3)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1651)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set hero direction (1,up)
 wait (10)
 set hero direction (1,left)
 wait (5)
 set hero direction (1,right)
 wait (5)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1652)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1653)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1654)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (1,up,1)
 wait for hero (1)
 walk hero (1,left,1)
 wait for hero (1)
 wait (3)
 set hero direction (1,down)
 wait (3)
 set hero direction (me,right)
 set hero direction (1,right)
 wait (3)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1655)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1656)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1657)
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 set hero direction (2,down)
 wait (5)
 walk hero (2,down,1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1658)
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 set hero direction (2,left)
 wait (3)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1659)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (2,up,1)
 wait for hero (2)
 set hero direction (2,left)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1660)
 wait (7)
 wait for key (use key)
 advance text box
 wait (15)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1661)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1662)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (1,down)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1663)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1664)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 items menu
 wait (5)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1665)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1666)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (1,down)
 wait (2)
 set hero direction (0,up)
 set hero direction (1,left)
 wait (2)
 walk hero (1,left,4)
 set hero direction (0,left)
 wait for hero (1)
 wait (5)
#the laws of the universe mean nothing!
 play sound (sfx:Blizzard Loop,false,true)
 fade screen out (63,63,63)
 
 wait (65)
 set tag (tag:Riftfix,on)
 wait (5)
 fade screen in
 wait (5)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1667)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1668)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 fade screen out
 walk hero (me,up,1)
 wait for hero (me)
 walk hero (me,left,4)
 wait for hero (me)
 resume caterpillar
 reset palette
 set caterpillar mode (off)
 wait (1)
 resume box advance
 fade screen in
 resume player
 resume random enemies
 resume obstruction
end

script,Ericback,begin
 suspend player
 suspend box advance
 suspend random enemies
 set caterpillar mode (on)
 set hero position (1, 24, 33)
 set hero position (2, 24, 33)
 set hero position (3, 24, 33)
 wait (1)
 suspend caterpillar 
 pan camera (left,3,4)
 wait (1)
 walk hero (me,left,1)
 walk hero (1,down,1)
 walk hero (2,up,1)
 wait for hero (me)
 set hero direction (me,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left) 
 wait for camera
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 show text box (1775)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1776)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (2,down)
 wait (5)
 set NPC direction (2,right)
 wait (5)
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 show text box (1777)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1778)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 show text box (1779)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1780)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 show text box (1781)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1782)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (2,right,1)
 wait (4)
 show text box (1783)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1784)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 show text box (1785)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1786)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1787)
 wait (7)
 wait for key (use key)
 advance text box
suspend obstruction
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 show text box (1788)
 wait (7)
 wait for key (use key)
 advance text box
 pan camera (right,2,4)
 walk NPC (2,right,3)
 walk hero (3,left,1)
 walk hero (1,up,1)
 wait for hero (1)
 walk hero (1,left,1)
 walk hero (2,down,1)
 wait for hero (2)
 walk hero (2,left,1)
 wait for hero (2)
 camera follows hero (me)
 resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 wait (1)
 set caterpillar mode (off)
 set tag (tag:Ericback,on)
 wait (1)
end

script,misteroo,begin
 suspend player
 suspend box advance
 suspend random enemies
 walk hero (me,left,3)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 13, 6)
 set hero position (2, 13, 6)
 set hero position (3, 13, 6)
 wait (1)
 suspend caterpillar 
 pan camera (left,3,4)
 wait (1)
 walk hero (me,left,1)
 walk hero (1,down,1)
 walk hero (2,up,1)
 wait for hero (me)
 set hero direction (me,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left) 
 wait for camera
 wait (5)
 set NPC direction (4,down)
 wait (5)
 set NPC direction (4,right)
 wait (5)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1789)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1790)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1791)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1792)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (4,right,1)
 wait for NPC (4)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1793)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1794)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set NPC direction (4,down)
 wait (5)
 set NPC direction (4,left)
 wait (5)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1795)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (4,left,1)
 wait for NPC (4)
 wait (5)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1796)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1797)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (4,down)
 wait (3)
 set NPC direction (4,right)
 wait (3)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1798)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1799)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1800)
 wait (7)
 wait for key (use key)
 advance text box

 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1801)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (4,right,2)
 wait for NPC (4)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1802)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (1803)
 wait (7)
 wait for key (use key)
 advance text box
 pan camera (right,3,4)
 walk hero (1,up,1)
 walk hero (2,down,1)
 walk hero (me,right,1)
 wait for hero (me)
 wait (1)
 resume caterpillar
 wait (1)
 set caterpillar mode (off)
 wait for camera
 camera follows hero (me)
 wait (1)
 walk hero to x (me,22)
 wait for hero (me)

 set NPC position (4,14,15)
 wait (1)
 walk hero (me,down,7)
 walk NPC (4,right,7)
 wait for hero (me)
 set hero direction (me,left)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1804)
 wait (7)
 wait for key (use key)
 advance text box

 walk hero to y (me,6)
 wait for hero (me)
 walk hero to x (me,30)
 wait for hero (me)
 walk hero to y (me,14)
 wait for hero (me)
 walk hero (me,left,3)
 wait for hero (me)
 walk hero to y (me,23)
 walk NPC to y (4,23)
 wait for NPC (4)
 walk NPC to x (4,24)
 wait for hero (me)
 set hero direction (me,left)

 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1805)
 wait (7)
 wait for key (use key)
 advance text box

 walk hero to x (me,33)
 wait for hero (me)
 walk hero (me,up,2)
 wait for hero (me)
 walk hero to x (me,39)
 wait for hero (me)
 set hero direction (me,down)
 show text box (1806)
 wait (7)
 wait for key (use key)
 advance text box
 suspend obstruction


 set NPC position (4,29,33)

 walk hero (me,down,1)
 walk NPC (5,left,1)
 wait for hero (me)
 walk hero (me,down,1)
 walk NPC (6,right,1)
 wait for hero (me)
 walk hero (me,down,1)
 walk NPC (7,left,1)
 wait for hero (me)
 walk hero (me,down,1)
 walk NPC (8,right,1)
 wait for hero (me)
 walk hero (me,down,1)
 walk NPC (9,left,1)
 wait for hero (me)
 walk hero (me,down,1)
 walk NPC (10,right,1)
 wait for hero (me)
 walk hero (me,down,1)
 walk NPC (11,left,1)
 wait for hero (me)
 walk hero (me,down,1)
 walk NPC (12,right,1)
 wait for hero (me)
 walk hero (me,down,3)
 wait for hero (me)
 resume obstruction
 walk NPC (4,right,2)
 wait for NPC (4)
 walk hero (me,left,4)
 walk NPC (4,up,1)
 set NPC direction (4,right)
 walk NPC (4,right,2)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 35, 32)
 set hero position (2, 35, 32)
 set hero position (3, 35, 32)
 wait (1)
 suspend caterpillar 
 pan camera (left,1,2)
 walk hero (1,up,1)
 walk hero (2,down,1)
 walk hero (3,right,1)
 wait for hero (1)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,down)
 wait (1)
 set hero direction (3,left)
 wait (5)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1807)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1808)
 wait (7)
 wait for key (use key)
 advance text box

 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1809)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (4,down)
 wait (3)
 set NPC direction (4,left)
 wait (3)
 stop song
 tweak palette (-2,-2,-2)
 fade screen in
 wait (2)
 tweak palette (-2,-2,-2)
 fade screen in
 wait (2)
 tweak palette (-2,-2,-2)
 fade screen in
 wait (2)
 tweak palette (-2,-2,-2)
 fade screen in
 wait (2)
 set NPC direction (4,down)
 wait (5)
 set NPC direction (4,right)
 wait (5)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1810)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 set NPC frame (4,1)
 wait (1)
 set NPC frame (4,0)
 wait (1)
 show text box (1811)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1812)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction
 fight formation (224)
 set tag (tag:Billybeat,on)


 show text box (1813)
 set NPC position (15,29,33)
 walk NPC (15,right,2)
 wait for NPC (15)
 walk NPC (15,up,1)
 set NPC direction (15,right)
 walk NPC (15,right,2)
 wait for NPC (15)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1814)
 wait (7)
 wait for key (use key)
 advance text box

 walk hero (1,down,1)
 walk hero (2,up,1)
 walk hero (3,left,1)
 wait (2)
 wait (1)
 resume caterpillar
 wait (1)
 set caterpillar mode (off)
 wait (1)
 swap by position (0, find hero (hero:Eric)) 

 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1815)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1816)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,down)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1817)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,down)
 walk NPC (15,down,2)
 wait for NPC (15)
 wait (10)
 set NPC direction (15,right)
 wait (3)
 set NPC direction (15,up)
 wait (3)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1818)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (15,up,2)
 wait for NPC (15)
 set NPC direction (15,right)
 set hero direction (me,left)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1819)
 wait (7)
 wait for key (use key)
 advance text box
 wait (15)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1820)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1821)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1822)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1823)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,down)
 wait (5)
 walk hero (me,down,1)
 wait for hero (me)
 show text box (1824)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (15,down)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1825)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (15,down,1)
 wait for NPC (15)
 set hero direction (me,left)
 set NPC direction (15,right)
 wait (5)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1826)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1827)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out (63,63,63)
 wait (1)
 camera follows hero (me)

 set NPC position (15,0,0)
 wait (2)
 fade screen in
 wait (3)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1828)
 wait (7)
 wait for key (use key)
 advance text box
 resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 set caterpillar mode (off)
 wait (1)

end

script,fourfiends,begin
 suspend player
 suspend box advance
 walk hero (me,up,2)
 wait for hero (me)
 tweak palette (-5,-10,-5)
 fade screen in
 wait (5) 
 set NPC position (10,32,71)
 play sound (sfx:TornadoMagic,false,true)
 wait (2)
 reset palette
 fade screen in
 wait (5)
 show text box (1829)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (-5,-10,-10)
 fade screen in
 set NPC position (12,31,72)
 play sound (sfx:FlameMagic,false,true)
 set hero direction (me,left)
 wait (2)
 reset palette
 fade screen in
 wait (5)
 show text box (1830)
 wait (7)
 wait for key (use key)
 advance text box

 tweak palette (-10,-10,-5)
 fade screen in
 set NPC position (13,33,72)
 play sound (sfx:FreezeMagic,false,true)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 reset palette
 fade screen in
 wait (5)
 show text box (1831)
 wait (7)
 wait for key (use key)
 advance text box

 tweak palette (-10,-5,-10)
 fade screen in
 wait (5)
 set NPC position (11,32,73)
 play sound (sfx:ThunderMagic,false,true)
 wait (5)
 set hero direction (me,down)
 reset palette
 fade screen in
 wait (5)
 show text box (1832)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 show text box (1833)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1834)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1835)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1836)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1837)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1838)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1839)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1840)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1841)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1842)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1843)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1844)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1845)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1846)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 show text box (1847)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1848)
 wait (7)
 wait for key (use key)
 advance text box
 BossIntroduction

 fight formation (194)
#The four fiends are defeated, and vanish away forever!
 stop song
 wait (3)
 show text box (1849)
 wait for key (use key)
 advance text box
 tweak palette (-10,-5,-10)
 play sound (sfx:ThunderMagic,false,true)
 Alter NPC (11,NPCstat:picture,118)
 Alter NPC (11,NPCstat:palette,111)
 fade screen in
 wait (5)
 set NPC position (11,1,1)
 wait (3)
 reset palette
 fade screen in
 wait (5)

 show text box (1850)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (-10,-10,-5)
 play sound (sfx:FreezeMagic,false,true)
 Alter NPC (13,NPCstat:picture,145)
 Alter NPC (13,NPCstat:palette,3)
 fade screen in
 wait (5)
 set NPC position (13,1,1)
 wait (3)
 reset palette
 fade screen in

 show text box (1851)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (-5,-10,-10)
 play sound (sfx:FlameMagic,false,true)
 Alter NPC (12,NPCstat:picture,113)
 Alter NPC (12,NPCstat:palette,10)
 fade screen in
 wait (5)
 set NPC position (12,1,1)
 wait (3)
 reset palette
 fade screen in

 show text box (1852)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (-5,-10,-5)
 play sound (sfx:TornadoMagic,false,true)
 Alter NPC (10,NPCstat:picture,138)
 Alter NPC (10,NPCstat:palette,8)
 fade screen in
 wait (5) 
 set NPC position (10,1,1)
 wait (5)
 reset palette
 fade screen in
 wait (5)
 play song (song:Panopticon)
 resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 set caterpillar mode (off)
 wait (1)


end


script,firesmash,begin
 suspend player
 suspend box advance
 suspend random enemies
 focus camera (23,48,4)
 swap by position (0,find hero (hero:Kitt))
 wait for camera
 wait (10)
 walk hero to y (me,50)
 wait for hero (me)
 walk hero to x (me,22)
 wait for hero (me)
 walk hero (me,up,2)
 wait for hero (me)
 set hero direction (me,right)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1862)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (15,left)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1853)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,left,1)
 set hero direction (me,right)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1854)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1855)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set NPC direction (15,up)
 wait (5)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1856)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (15,right)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1857)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (15,down)
 wait (3)
 set NPC direction (15,left)
 wait (3)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1858)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 walk NPC (15,left,1)
 wait for NPC (15)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 set NPC frame (15,1)
 wait (1)
 set NPC frame (15,0)
 wait (1)
 show text box (1859)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:FlameMagic,false,true)
 teach spell ((find hero(hero:Kitt)),atk:Firesmash)
 wait (10)
 reset palette
 fade screen in
 show text box (1860)
 wait (7)
 wait for key (use key)
 advance text box



 walk NPC (15,down,8)
 wait (5)
 walk hero (me,right,1)
 wait for hero (me)
 set hero direction (me,down)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1861)
 wait (7)
 wait for key (use key)
 pan camera (left,1)
 wait for camera
 advance text box
 camera follows hero (me)
 set tag (tag:firesmash,on)
 resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 set caterpillar mode (off)
 wait (1)
end


script,icebrand,begin
 suspend player
 suspend box advance
 suspend random enemies
 focus camera (41,35,4)
 swap by position (0,find hero (hero:Kitt))
 walk hero to x (me,41)
 wait for hero (me)
 walk hero to y (me,35)
 wait for hero (me)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1863)
 wait (7)
 wait for key (use key)
 advance text box

 set NPC frame (24,1)
 wait (1)
 set NPC frame (24,0)
 wait (1)
 set NPC frame (24,1)
 wait (1)
 set NPC frame (24,0)
 wait (1)
 show text box (1864)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1865)
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 set NPC direction (24,right)
 wait (3)
 set NPC frame (24,1)
 wait (1)
 set NPC frame (24,0)
 wait (1)
 set NPC frame (24,1)
 wait (1)
 set NPC frame (24,0)
 wait (1)
 show text box (1866)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,left)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1867)
 wait (7)
 wait for key (use key)
 advance text box
 wait (15)
 set NPC frame (24,1)
 wait (1)
 set NPC frame (24,0)
 wait (1)
 set NPC frame (24,1)
 wait (1)
 set NPC frame (24,0)
 wait (1)
 show text box (1868)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (24,right,1)
 wait for NPC (24)
 show text box (1869)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:FreezeMagic,false,true)
 teach spell ((find hero(hero:Kitt)),atk:Icebrand)
 wait (10)
 reset palette
 fade screen in
 show text box (1870)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1871)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (24,down,2)
 wait for NPC (24)
 walk NPC (24,right,1)
 set hero direction (me,down)
 wait for NPC (24)
 wait (3)
 set NPC direction (24,up)
 set NPC frame (24,1)
 wait (1)
 set NPC frame (24,0)
 wait (1)
 set NPC frame (24,1)
 wait (1)
 set NPC frame (24,0)
 wait (1)
 show text box (1872)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (24,left)
 wait (3)
 walk NPC (24,down,6)
 wait for NPC (24)
 camera follows hero (me)
 set tag (tag:icebrand,on)
 resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 set caterpillar mode (off)
 wait (1)
end

script,boltslash,begin
 suspend player
 suspend box advance
 suspend random enemies
 swap by position (0,find hero (hero:Kitt))
 walk hero to y (me,3)
 wait for hero (me)
 walk hero to x (me,61)
 wait for hero (me)
 set hero direction (me,up)
 wait (3)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1874)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (9,left)
 wait (5)
 set NPC direction (9,down)
 wait (5)
 walk hero (me,left,1)
 walk NPC (9,left,1)
 set hero direction (me,up)
 set NPC direction (9,down)
 wait for hero (me)
 wait (3)
 walk hero (me,right,1)
 walk NPC (9,right,1)
 set hero direction (me,up)
 set NPC direction (9,down)
 wait for hero (me)
 wait (3)
 walk hero (me,left,1)
 walk NPC (9,left,1)
 set hero direction (me,up)
 set NPC direction (9,down)
 wait for hero (me)
 wait (3)
 walk hero (me,right,1)
 walk NPC (9,right,1)
 set hero direction (me,up)
 set NPC direction (9,down)
 wait for hero (me)
 wait (3)
 walk hero (me,left,1)
 walk NPC (9,left,1)
 set hero direction (me,up)
 set NPC direction (9,down)
 wait for hero (me)
 wait (3)
 walk hero (me,right,1)
 walk NPC (9,right,1)
 set hero direction (me,up)
 set NPC direction (9,down)
 wait for hero (me)
 wait (3)
 set NPC frame (9,1)
 wait (1)
 set NPC frame (9,0)
 wait (1)
 set NPC frame (9,1)
 wait (1)
 set NPC frame (9,0)
 wait (1)
 show text box (1875)
 wait (7)
 wait for key (use key)
 advance text box

walk hero (me,left,1)
 set hero direction (me,right)
 wait for hero (me)
 walk NPC (9,down,8)
 wait (8)
 walk hero (me,right,1)
 wait for hero (me)
 walk hero (me, up,1)
 wait for hero (me)
 wait for NPC (9)
 wait (1)
 walk NPC (9,up,6)
 wait for NPC (9)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set NPC frame (9,1)
 wait (1)
 set NPC frame (9,0)
 wait (1)
 set NPC frame (9,1)
 wait (1)
 set NPC frame (9,0)
 wait (1)
 show text box (1876)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:ThunderMagic,false,true)
 teach spell ((find hero(hero:Kitt)),atk:Boltslash)
 wait (10)
 reset palette
 fade screen in
 show text box (1877)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (9,down,6)
 wait for NPC (9)
 wait (5)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1878)
 wait (7)
 wait for key (use key)
 advance text box
 camera follows hero (me)
 set tag (tag:boltslash,on)
 resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 set caterpillar mode (off)
 wait (1)
end

script,utgard,begin
 suspend player
 suspend box advance
 swap by position (1,find hero (hero:Olaf))
 swap by position (2,find hero (hero:Bram))

 set NPC direction (0,left)
 wait (2)
 set NPC direction (0,down)
 wait (2)
 set NPC frame (0,1)
 wait (1)
 set NPC frame (0,0)
 wait (1)
 set NPC frame (0,1)
 wait (1)
 set NPC frame (0,0)
 wait (1)
 show text box (1881)
 wait (7)
 wait for key (use key)
 advance text box
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 8, 17)
 set hero position (2, 8, 17)
 set hero position (3, 8, 17)
 wait (1)
 suspend caterpillar 
 pan camera (up,2,4)
 wait (1)
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 wait for hero (me)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up) 
 wait for camera
 wait (5)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1882)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (0,down,1)
 wait for NPC (0)
 set NPC frame (0,1)
 wait (1)
 set NPC frame (0,0)
 wait (1)
 set NPC frame (0,1)
 wait (1)
 set NPC frame (0,0)
 wait (1)
 show text box (1883)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (1,up,1)
 wait for hero (me)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1884)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 set hero direction (me,left) 
 set hero direction (2,left)
  set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1885)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1886)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (0,1)
 wait (1)
 set NPC frame (0,0)
 wait (1)
 set NPC frame (0,1)
 wait (1)
 set NPC frame (0,0)
 wait (1)
 show text box (1887)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (2,up,1)
 wait for hero (2)
 walk hero (me,up,1)
 walk hero (1,up,1)
 walk hero (2,up,1)
 walk hero (3,up,1)
 wait for hero (me)
 pan camera (up,8,4)
 wait for camera 
 set NPC frame (0,1)
 wait (1)
 set NPC frame (0,0)
 wait (1)
 set NPC frame (0,1)
 wait (1)
 set NPC frame (0,0)
 wait (1)
 show text box (1888)
 wait (7)
 suspend obstruction
 wait for key (use key)
 advance text box 
 walk NPC (0,up,8)
 walk hero (me,up,8)
 walk hero (1,up,8)
 walk hero (2,up,8)
 walk hero (3,up,8)
 wait for hero (me)

 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 show text box (1889)
 wait (7)
 wait for key (use key)
 advance text box 
 set NPC frame (0,1)
 wait (1)
 set NPC frame (0,0)
 wait (1)
 set NPC frame (0,1)
 wait (1)
 set NPC frame (0,0)
 wait (1)
 show text box (1890)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 set NPC frame (2,1)
 wait (1)
 set NPC frame (2,0)
 wait (1)
 show text box (1891)
 wait (7)
 wait for key (use key)
 advance text box 
 show text box (1892)
 wait (7)
 wait for key (use key)
 advance text box 
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1893)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 play sound (sfx:Delvire,false,true)
 show text box (1894)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1895)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1896)
 wait (7)
 wait for key (use key)
 advance text box
 wait (1)
 walk hero (1,right,1)
 walk hero (2,left,1)
 walk hero (3,up,1)
 walk NPC (0,down,1)
 wait for NPC (0)
 wait (1)
 camera follows hero (me)
 set tag (tag:utgard,on)
  resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 set caterpillar mode (off)
 wait (1)
end

script,delvirearena,begin
 suspend player
 suspend box advance
 stop song
 wait (5)
 set NPC position (3,6,5)
 play sound (sfx:Delvire,false,true) 
 wait (3)
 set NPC direction (3,right)
 set hero direction (me,left)
 set NPC frame (3,1)
 wait (1)
 set NPC frame (3,0)
 wait (1)
 set NPC frame (3,1)
 wait (1)
 set NPC frame (3,0)
 wait (1)
 show text box (1903)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1904)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (3,1)
 wait (1)
 set NPC frame (3,0)
 wait (1)
 set NPC frame (3,1)
 wait (1)
 set NPC frame (3,0)
 wait (1)
 show text box (1905)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1906)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1907)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC position (3,10,5)
 play sound (sfx:Delvire,false,true) 
 wait (3)
 set NPC direction (3,down)
 set hero direction (me,up)
 set NPC frame (3,1)
 wait (1)
 set NPC frame (3,0)
 wait (1)
 set NPC frame (3,1)
 wait (1)
 set NPC frame (3,0)
 wait (1)
 show text box (1908)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1909)
 wait (7)
 wait for key (use key)
 advance text box
 camera follows hero (me)
 set tag (tag:DelvireBrag,on)
 resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 set caterpillar mode (off)
 wait (1)
end


script,arena,begin
 suspend player
 suspend box advance
 open menu (menu:UTGARD ARENA)
 wait (1)
 resume player
 resume box advance
end

script,arenaHorace,begin
 fight formation (230)
end

script,arenacomrade,begin
 fight formation (225)
end

script,slimesalad,begin
 fight formation (227)
end

script,lowteir,begin
 fight formation (231)
 set tag (tag:LOWTEIR,on)
end

script,midteir,begin
 fight formation (232)
 set tag (tag:MIDTEIR,on)
end

script,upperteir,begin
 fight formation (233)
 set tag (tag:UPPERTEIR,on)
end

script,highteir,begin
 fight formation (234)

 set tag (tag:HIGHTEIR,on)
end

script,quarterfinals,begin
 fight formation (235)
 if (checktag(tag:QUARTERFINALS) == off) then (
 suspend player
 suspend box advance
 fade screen out
 wait (2)
 set hero position (me,34,5)
 swap by position (0,find hero (hero:Olaf))
 wait (2)
 #Inara
 set NPC position (11,31,10)
 set NPC direction (11,right)
 #Olaf
 set NPC position (16,36,10)
 set NPC direction (16,left)
 #Frumpy
 set NPC position (20,38,9)
 set NPC direction (20,left)
 #Freki
 set NPC position (12,37,11)
 set NPC direction (12,left)
 wait (3)
 fade screen in
 wait (10)
 focus camera (34,10,2)
 wait for camera
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 show text box (1974)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1975)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 show text box (1976)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (20,1)
 wait (1)
 set NPC frame (20,0)
 wait (1)
 set NPC frame (20,1)
 wait (1)
 set NPC frame (20,0)
 wait (1)
 show text box (1977)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 show text box (1978)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 show text box (1979)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 show text box (1980)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (12,left,1)
 wait for NPC (12)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 show text box (1981)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (16,down)
 set NPC direction (12,up)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 show text box (1982)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (11,right,2)
 wait for NPC (11)
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 show text box (1983)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (12,left)
 set NPC direction (16,left)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 show text box (1984)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 show text box (1985)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (20,left,1)
 wait for NPC (20)
 set NPC frame (20,1)
 wait (1)
 set NPC frame (20,0)
 wait (1)
 set NPC frame (20,1)
 wait (1)
 set NPC frame (20,0)
 wait (1)
 show text box (1986)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (16,down)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 show text box (1987)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 show text box (1988)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (16,left)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 show text box (1989)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 show text box (1990)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (12,right,1)
 set NPC direction (12,left)
 wait for NPC (12)
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 set NPC frame (11,1)
 wait (1)
 set NPC frame (11,0)
 wait (1)
 show text box (1991)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (11,down,4)
 walk NPC (16,down,4)
 wait for NPC (11)
 set NPC direction (12,down)
 set NPC direction (20,down)
 walk NPC (11,down,4)
 walk NPC (16,down,4)
 wait for NPC (11)
 wait (5)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 show text box (1992)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (20,1)
 wait (1)
 set NPC frame (20,0)
 wait (1)
 set NPC frame (20,1)
 wait (1)
 set NPC frame (20,0)
 wait (1)
 show text box (1993)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (2)
 play sound (sfx:nuclear,false,true) 
 wait (40)
 camera follows hero (me)
 use door (9)
 fade screen in
  teach spell ((find hero(hero:Olaf)),atk:Infinity)
 show text box (1994)
 wait (7)
 wait for key (use key)
 advance text box 
 resume box advance
 resume player




 )
 set tag (tag:QUARTERFINALS,on)
end

script,semifinals,begin
 fight formation (236)
 set tag (tag:SEMIFINALS,on)
end

script,tunneler,begin
 suspend player
 suspend box advance
 suspend random enemys
 suspend caterpillar 

 play sound (sfx:earthquake,false,true) 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(left,1,20),waitforcamera
 pancamera(right,2,20),waitforcamera
 pancamera(left,2,20),waitforcamera
 pancamera(right,1,20),waitforcamera 
 pan camera (up,1,20), pan camera (right,1,20), wait for camera
 pan camera (down,2,20), pan camera (left,2,20), wait for camera

 pan camera (up,2,20), pan camera (right,2,20), wait for camera
 pan camera (down,1,20), pan camera (left,1,20), wait for camera
 camera follows hero
 swap by position (0,find hero (hero:Kitt))
 swap by position (1,find hero (hero:Bram))
 swap by position (2,find hero (hero:Frumpy))
 swap by position (3,find hero (hero:Night))

 set caterpillar mode (on)
 set hero position (1, 36, 16)
 set hero position (2, 36, 16)
 set hero position (3, 36, 16)
 wait (1)
 suspend caterpillar 
 wait (1)
 walk hero (me,up,1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 set hero direction (3,down)
 wait for hero (me)
 show text box (1913)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1914)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1915)
 wait (7)
 wait for key (use key)
 advance text box

 play sound (sfx:earthquake,false,true) 
 pancamera(up,1,20),waitforcamera
 pancamera(down,2,20),waitforcamera
 pancamera(up,2,20),waitforcamera
 pancamera(down,1,20),waitforcamera 
 pancamera(left,1,20),waitforcamera
 pancamera(right,2,20),waitforcamera
 pancamera(left,2,20),waitforcamera
 pancamera(right,1,20),waitforcamera 
 pan camera (up,1,20), pan camera (right,1,20), wait for camera
 pan camera (down,2,20), pan camera (left,2,20), wait for camera

 pan camera (up,2,20), pan camera (right,2,20), wait for camera
 pan camera (down,1,20), pan camera (left,1,20), wait for camera
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)  

 camera follows hero (me)

 show text box (1916)
 wait (7)
 wait for key (use key)
 advance text box

 BossIntroduction

 fight formation (237)

 set hero direction (me,down)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,up)

 show text box (1917)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1918)
 wait (7)
 wait for key (use key)
 advance text box

 show text box (1919)
 wait (7)
 wait for key (use key)
 advance text box
 play sound (sfx:StormMagic,false,true)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,down)
 wait (1)
 tweak palette (10,0,0)
 update palette
 teach spell ((find hero(hero:Kitt)),atk:Spinslash)
 wait (3)
 reset palette
 update palette
 show text box (1920)
 wait (7)
 wait for key (use key)
 advance text box
 wait (1)
 show text box (1921)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1922)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,down,1)
 walk hero (1,right,1)
 walk hero (2,left,1)
 wait for hero (me)
 resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 set caterpillar mode (off)
 wait (1)
end




script,crone,begin
 suspend player
 suspend box advance
 suspend NPCs
 wait (1)
 swap by position (0,find hero (hero:Night))
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1928)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 show text box (1929)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1930)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1931)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1932)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 show text box (1933)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (5)
 play sound (sfx:Mistress,false,true)
 wait (30)
 fade screen in
 wait (1)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:DrainMagic,false,true)
 teach spell ((find hero(hero:Night)),atk:Venomer)
 wait (3)
 reset palette
 update palette
 show text box (1934)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1935)
 wait (7)
 wait for key (use key)
 advance text box
 wait (1)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 show text box (1936)
 wait (7)
 wait for key (use key)
 advance text box
 set tag (tag:Crone,on)
 resume player
 resume box advance
 resume NPCs
end


script,TELEPORT,begin
 suspend player
 suspend box advance
 open menu (menu:Boundless Ocean)
 wait (1)
 resume player
 resume box advance
end

script,Tele0,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 use door (0)
 wait (1)
 fade screen in
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (1)
 resume player
end

script,Tele1,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 use door (1)
 wait (1)
 fade screen in
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (1)
 resume player
end

script,Tele2,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 use door (2)
 wait (1)
 fade screen in
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (1)
 resume player
end

script,Tele3,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 use door (3)
 wait (1)
 fade screen in
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (1)
 resume player
end

script,Tele4,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 use door (4)
 wait (1)
 fade screen in
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (1)
 resume player
end

script,Tele5,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 use door (5)
 wait (1)
 fade screen in
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (1)
 resume player
end

script,Tele6,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 use door (6)
 wait (1)
 fade screen in
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (1)
 resume player
end

script,Tele7,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 use door (7)
 wait (1)
 fade screen in
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (1)
 resume player
end

script,Tele8,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 use door (8)
 wait (1)
 fade screen in
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (1)
 resume player
end

script,Tele9,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 use door (9)
 wait (1)
 fade screen in
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (1)
 resume player
end

script,Tele10,begin
 suspend player
 play sound (sfx:ExtralongWarp,false,true)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (3)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 fade screen out
 wait (1)
 use door (10)
 wait (1)
 fade screen in
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (1)
 set hero direction (me,up)
 wait (1)
 set hero direction (me,right)
 wait (1)
 set hero direction (me,down)
 wait (1)
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (2)
 set hero direction (me,down)
 wait (2)
 set hero direction (me,left)
 wait (3)
 set hero direction (me,up)
 wait (3)
 set hero direction (me,right)
 wait (3)
 set hero direction (me,down)
 wait (1)
 resume player
end

script,Skadi1,begin
 suspend player
 suspend box advance
 suspend NPCs
 wait (1)
 swap by position (0,find hero (hero:Frumpy))
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1948)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1949)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1950)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1951)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1952)
 resume player
 resume box advance
 resume NPCs
end

script,Skadi2,begin
 suspend player
 suspend box advance
 suspend NPCs
 swap by position (0,find hero (hero:Frumpy))
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1955)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1956)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1957)
 wait (7)
 wait for key (use key)
 advance text box
 wait (1)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:EnemyDeath,false,true)
 wait (10)
 reset palette
 fade screen in
 show text box (1959)
 wait (7)
 wait for key (use key)
 advance text box
 teach spell ((find hero(hero:Frumpy)),atk:Force2)
 show text box (1958)
 wait (7)
 wait for key (use key)
 advance text box
 wait (4)
 fade screen out (63,63,63)
 wait (5)
 set tag (tag:Skadi2,on)
 wait (3)
 fade screen in
 wait (1)
 resume player
 resume box advance
 resume NPCs
end

script,olaf1,begin
 suspend player
 suspend box advance
 swap by position (0,find hero (hero:Olaf))
 swap by position (1,find hero (hero:Kitt))
 swap by position (2,find hero (hero:Frumpy))
 wait (1)
 set caterpillar mode (on)
 set hero position (1, 32, 36)
 set hero position (2, 32, 36)
 set hero position (3, 1, 1)
 wait (1)
 suspend caterpillar 
 wait (1)
 walk hero (1,left,1)
 walk hero (2,right,1)
 wait for hero (2)
 set hero direction (2,down)
 wait (2)
 set hero direction (2,left)
 wait (2)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1960)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (1,down)
 set hero direction (me,down)
 wait (3)
 set hero direction (1,right)
 set hero direction (me,right)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1961)
 wait (7)
 wait for key (use key)
 advance text box
 equip menu (find hero(hero:Olaf))
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1962)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1963)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1964)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1965)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1966)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (1967)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1968)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1969)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1970)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (1971)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 set hero direction (2,down)
 wait (10)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (1972)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1973)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (1,right,1)
 walk hero (2,left,1)
 wait for hero (1)
 resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 set caterpillar mode (off)
 wait (1)
end

script,Delvire2,begin
 suspend player
 swap by position (0,find hero (hero:Bram))
 suspend box advance
 suspend NPCs
 suspend obstruction
 wait (2)
 stop song
 greyscale palette
 update palette
 play sound (sfx:Ice Crash,false,true)
 wait (2)
 focus camera (15,33,4)
 wait (4)
 walk NPC (36,left,3) 
 wait for NPC (36)
 wait for camera
 set NPC direction (36,down)
 wait (5)
 play sound (sfx:Delvire,false,true)
 wait (20)
 walk NPC (36,down,7)
 focus camera (15,37,4)
 wait for NPC (36)
 walk NPC (36,right,2)
 wait for NPC (36)
 set NPC direction (36,down)
 play sound (sfx:Soft_Airy_Swish,false,true)
 camera follows hero (me)
 wait (3)
 walk NPC (36,up,1)
 set NPC direction (36,down)
 wait for NPC (36)
 reset palette
 wait (2)
 fade screen in
 wait (2)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1995)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1996)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 show text box (1997)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (1998)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 show text box (1999)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2000)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 show text box (2001)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (40,-10,-10)
 update palette
 wait (2)
 reset palette
 greyscale palette
 fade screen in
 wait (2)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 show text box (2002)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (36,down,1)
 wait for NPC (36)
 wait (10)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 show text box (2003)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2004)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 show text box (2005)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (36,right)
 wait (2)
 set NPC direction (36,up)
 wait (2)
 show text box (2006)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2007)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (36,right)
 wait (3)
 set NPC direction (36,down)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 show text box (2008)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (36,up,1)
 set NPC direction (36,down)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 show text box (2009)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 set NPC frame (36,1)
 wait (1)
 set NPC frame (36,0)
 wait (1)
 show text box (2010)
 wait (7)
 wait for key (use key)
 advance text box
 teach spell ((find hero(hero:Bram)),atk:Red Shift)
 walk NPC (36,right,10)
 wait for NPC (36)
 reset palette
 fade screen in
 wait (5)
 set tag (tag:Delvire2,on)
 set hero direction (me,left)
 wait (10)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (10)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,left)
 wait (10)
 set hero direction (me,up)
 wait (2)
 set hero direction (me,right)
 wait (10)
 set hero direction (me,down)
 resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 set caterpillar mode (off)
 wait (1)
end

script,fafnir,begin
 suspend player
 swap by position (0,find hero (hero:Hilda))
 suspend box advance
 suspend random enemies
 stop song
 walk hero (me,down,1)
 wait for hero (me)
 walk hero (me,right,3)
 wait for hero (me)
 walk hero (me,down,1)
 wait for hero (me)
 walk hero (me,right,2)
 wait for hero (me)
 set hero direction (me,down)
 tweak palette (0,-5,-5)
 fade screen in
 show text box (2011)
 wait (7)
 wait for key (use key)
 advance text box
 reset palette
 fade screen in
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2012)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2013)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (0,-5,-5)
 fade screen in
 show text box (2014)
 wait (7)
 wait for key (use key)
 advance text box
 reset palette
 fade screen in
 set hero direction (me,left)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2015)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (0,-5,-5)
 fade screen in
 show text box (2016)
 wait (7)
 wait for key (use key)
 advance text box
 reset palette
 fade screen in
 set hero direction (me,down)
 wait (3)
 set hero direction (me,right)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2017)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (0,-5,-5)
 fade screen in
 show text box (2018)
 wait (7)
 wait for key (use key)
 advance text box
 reset palette
 fade screen in
 set hero direction (me,down)
 boss introduction
 fight formation (238)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2019)
 wait (7)
 wait for key (use key)
 advance text box
 resume box advance
 resume random enemies
 resume player
end


script,Manafight,begin
 suspend player
 suspend box advance
 fade screen out
 wait (2)
 set hero position (me,34,5)
 swap by position (0,find hero (hero:Olaf))
 swap by position (1,find hero (hero:Hilda))
 swap by position (2,find hero (hero:Freki))
 swap by position (3,find hero (hero:Kitt))
 wait (2)
 #Managarm
 set NPC position (22,31,10)
 set NPC direction (22,right)
 #Olaf
 set NPC position (16,35,10)
 set NPC direction (16,left)
 #Frumpy
 set NPC position (20,33,6)
 set NPC direction (20,down)
 #Kitt
 set NPC position (13,38,9)
 set NPC direction (13,left)
 #Freki
 set NPC position (12,37,11)
 set NPC direction (12,left)
 #Hilda
 set NPC position (14,36,10)
 set NPC direction (14,left)
 wait (3)
 fade screen in
 wait (10)
 focus camera (34,10,2)
 wait for camera
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2020)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 show text box (2021)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2022)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 show text box (2023)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2024)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 show text box (2025)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (13,1)
 wait (1)
 set NPC frame (13,0)
 wait (1)
 set NPC frame (13,1)
 wait (1)
 set NPC frame (13,0)
 wait (1)
 show text box (2026)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2027)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2028)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (14,1)
 wait (1)
 set NPC frame (14,0)
 wait (1)
 set NPC frame (14,1)
 wait (1)
 set NPC frame (14,0)
 wait (1)
 show text box (2029)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2030)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (20,1)
 wait (1)
 set NPC frame (20,0)
 wait (1)
 set NPC frame (20,1)
 wait (1)
 set NPC frame (20,0)
 wait (1)
 show text box (2031)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 set NPC frame (12,1)
 wait (1)
 set NPC frame (12,0)
 wait (1)
 show text box (2032)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2033)
 wait (7)
 wait for key (use key)
 advance text box
 boss introduction
 fight formation (97)
 stop song
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 show text box (2034)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2035)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2036)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (22,down)
 wait (5)
 set NPC direction (22,left)
 wait (10)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2037)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2038)
 wait (7)
 wait for key (use key)
  set NPC direction (22,down)
 wait (5)
 set NPC direction (22,right)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2039)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2040)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 fade screen out
 wait (1)
 show text box (2041)
 wait (2)
 fade screen in
 wait (7)
 wait for key (use key)
 advance text box 
 show text box (2042)
 wait (7)
 wait for key (use key)
 fade screen out
 wait (1)
 advance text box
 wait (2)
 fade screen in
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2043)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2044)
 wait (7)
 wait for key (use key)
 advance text box

 wait (5)
 fade screen out
 wait (1)
 show text box (2045)
 wait (2)
 fade screen in
 wait (7)
 wait for key (use key)
 advance text box 
 show text box (2046)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2047)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2048)
 wait (7)
 set NPC direction (22,left)
 wait for key (use key)
 fade screen out
 wait (1)
 advance text box
 wait (2)
 fade screen in
 wait (5)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2049)
 wait (7)
 wait for key (use key)
 advance text box
  set NPC direction (22,down)
 wait (5)
 set NPC direction (22,right)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2050)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (22,right,4)
 wait for NPC (22)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2051)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 walk NPC (16,left,2)
 wait for NPC (16)
 wait (10)
 walk NPC (22,down,2)
 set NPC direction (16,down)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 show text box (2052)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2053)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (22,right)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2054)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 set NPC frame (16,1)
 wait (1)
 set NPC frame (16,0)
 wait (1)
 show text box (2055)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set NPC direction (22,up)
 wait (5)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 set NPC frame (22,1)
 wait (1)
 set NPC frame (22,0)
 wait (1)
 show text box (2056)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (1)
 camera follows hero (me)
 use door (9)
 advance text box 
 resume box advance
 resume player
 fade screen in
end

script,Cthulhu2,begin
 suspend player
 suspend box advance
 stop song
 fade screen out
 wait (1)
 show text box (2087)
 wait (2)
 fade screen in
 wait (7)
 wait for key (use key)
 fade screen out
 wait (1)
 advance text box
 wait (2)
 teleport to map (16,8,66)
 stop song
 wait (1)
 fade screen in
 play song (song:Vile)
 focus camera (8,71,4)
 wait for camera
 show text box (2075)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2076)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (11,down,1)
 show text box (2077)
 wait (7)
 wait for key (use key)
 advance text box

 tweak palette (-10,-5,-10)
 fade screen in
 wait (5)
 set NPC position (36,8,72)
 play sound (sfx:ThunderMagic,false,true)
 wait (5)
 set hero direction (me,down)
 reset palette
 fade screen in
 wait (5)
 show text box (2078)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2079)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2080)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (0,15,0)
 update palette
 wait (3)
 reset palette
 update palette
 wait (1)
 show text box (2081)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2082)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (11,left)
 wait (3)
 set NPC direction (11,up)
 show text box (2083)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (11,left)
 wait (3)
 set NPC direction (11,down)
 show text box (2084)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (-10,-5,-10)
 fade screen in
 wait (5)
 set NPC position (36,1,1)
 play sound (sfx:ThunderMagic,false,true)
 wait (5)
 set hero direction (me,down)
 reset palette
 fade screen in
 wait (5)
 walk NPC (11,down,1)
 show text box (2085)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2086)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (1)
 camera follows hero (me)
 wait (1)
 teleport to map (4,52,48)
 wait (1)
 fade screen in
 resume player
 resume box advance
end

Script,Collies2,begin
 suspend player
 suspend box advance
 suspend NPCs
 swap by position (0,find hero (hero:Styrge))
 swap by position (1,find hero (hero:Hilda))
 swap by position (2,find hero (hero:Eric))
 swap by position (3,find hero (hero:Frumpy))
 show text box (2112)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2113)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2114)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2115)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2116)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2117)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2118)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (1)
 show text box (2119) 
 wait (2)
 fade screen in
 wait (7)
 wait for key (usekey)
 advance textbox
 show text box (2120)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2121)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2122)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2123)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2124)
 wait (7)
 wait for key (use key)
 fade screen out
 wait (2)
 set caterpillar mode (on)
 advance text box
 wait (2)
 set hero direction (me,up)
 teleport to map (30,38,36)
 play song (song:Niffleheim02)
 suspend caterpillar
 wait (1)
 set hero position (1, 40, 35)
 set hero direction (1,left)
 set hero position (2, 35, 35)
 set hero direction (2,right)
 set hero position (3, 36, 37)
 set hero position (3,up)
 wait (2)
 fade screen in
 wait (2)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2125)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2126)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (2127)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (23,right)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2128)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2129)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2130)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (23,down)
 wait (5)
 set NPC direction (23,left)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2131)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2132)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2133)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2134)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 show text box (2135)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set NPC direction (23,up)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2136)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2137)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (2,right,1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2138)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (23,left)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2139)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 set hero frame (1,1)
 wait (1)
 set hero frame (1,0)
 wait (1)
 show text box (2140)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (23,down)
 wait (5)
 set NPC direction (23,right)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2141)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (2142)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (2)
 teleport to map (17,16,21)
 play song (song:Asgard)
 wait (1)
 suspend caterpillar
 wait (1)
 set hero position (1, 16, 21)
 set hero direction (1,left)
 set hero position (2, 17, 28)
 set hero direction (2,left)
 set hero position (3, 16, 21)
 set hero position (3,up)
 wait (2)
 fade screen in
 wait (2)
 focus camera (16,28,4)
 wait for camera
 wait (2)
 set hero position (me, 8, 27)
 set NPC position (23,7,27)
 set NPC direction (23,right)
 walk hero (me,right,6)
 wait for hero (me)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2143)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2144)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,right,1)
 wait for hero (me)
 walk hero (me,down,1)
 wait for hero (me)
 set hero direction (me,right)
 wait (5)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2145)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2146)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2147)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2148)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2149)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2150)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2151)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2152)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2153)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2154)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2155)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2156)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2157)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2158)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2159)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2160)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2161)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2162)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2163)
 wait (7)
 wait for key (use key)
 advance text box
 focus camera (11,28,4)
 wait (10)
 wait for camera
 walk NPC (23,right,4)
 wait for NPC (23)
 walk NPC (23,down,5)
 wait for NPC (23)

 fade screen out
 wait (2)
 camera follows hero (me)
 wait (2)
 tweak palette (-5,-5,0)
 teleport to map (30,37,30)
 play song (song:Jeremy Jacobs  Helheim's Ruin)
 wait (2)
 fade screen in
 focus camera (37,35,4)
 wait (10)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2164)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2165)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2166)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set NPC direction (23,left)
 wait (5)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2167)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (23,left,10)
 wait (20)
 fade screen out (63,63,63)
 wait (1)
 reset palette
 wait (1)
 set NPC position (24,38,35)
 set NPC direction (7,down)
 wait (4)
 tweak palette (-5,-5,0)
 set NPC position (23,1,2)
 wait (1)
 fade screen in
 wait (10)
 walk NPC (24,down,1)
 wait for NPC (24)
 set NPC direction (24,left)
 wait (5)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2168)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set NPC direction (24,down)
 wait (5)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 set NPC frame (23,1)
 wait (1)
 set NPC frame (23,0)
 wait (1)
 show text box (2169)
 wait (7)
 wait for key (use key)
 advance text box
 focus camera (37,30,4)
 wait for camera
 wait (1)
 camera follows hero (me)
 wait (2)
 fade screen out
 reset palette
 teleport to map (17,16,21)
 play song (song:Asgard)
 suspend caterpillar
 focus camera (16,21,4)
 wait for camera
 wait (1)
 set hero position (0, 15, 28)
 set hero direction (1,right)
 set hero position (1, 16, 21)
 set hero direction (1,left)
 set hero position (2, 17, 28)
 set hero direction (2,left)
 set hero position (3, 16, 21)
 set hero position (3,up)
 wait (2)
 fade screen in
 wait (2)
 focus camera (16,28,4)
 wait for camera
 wait (2)
 set NPC direction (23,right)

 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2170)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2171)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2172)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2173)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2174)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2175)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 set hero frame (2,1)
 wait (1)
 set hero frame (2,0)
 wait (1)
 show text box (2176)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2177)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2178)
 wait (7)
 wait for key (use key)
 advance text box 
 set hero position (3, 8, 27)
 wait (2)
 walk hero (3,right,7)
 show text box (2179)
 wait (7)
 wait for key (use key)
 wait for hero (3)
 advance text box
 wait (10)
 stop song
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (2180)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,down)
 set hero direction (3,down)
 wait (5)
 walk hero (3,right,1)
 wait for hero (3)
 set hero direction (3,down)
 wait (5)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (2181)
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 set hero direction (2,down)
 wait (3)
 play song (song:Towards Odds Impassible)
 resume NPCs
 wait (1)
 set NPC position (26,17,28)
 put hero (2,0,1)
 wait (5)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2182)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (2183)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2184)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2185)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set hero direction (me,right)
 wait (5)
 show text box (2186)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2187)
 wait (7)
 wait for key (use key)
 advance text box
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (2188)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (3,left,3)
 set hero direction (me,up)
 wait for hero (3)
 wait (3)
 set hero direction (3,down)
 wait (3)
 set hero direction (3,right)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 set hero frame (3,1)
 wait (1)
 set hero frame (3,0)
 wait (1)
 show text box (2189)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2190)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Ease)
 teach spell ((find hero(hero:Frumpy)),atk:Care3)
 teach spell ((find hero(hero:Eric)),atk:Idun Poem)
 wait (3)
 reset palette
 update palette
 show text box (2191)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2192)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2193)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 camera follows hero (me)
 resume caterpillar
 resume NPCs
 set hero direction (me,down)
 resume random enemies
 resume obstruction
 resume box advance
 resume player
 resume caterpillar
 set caterpillar mode (off)
 use door (5)
 wait (1)
 set tag (tag:Thule3,on)
 wait (2)
end 

script,Eikthymir,begin
 suspend player
 swap by position (0,find hero (hero:Hilda))
 suspend box advance
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2200)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2201)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2202)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2203)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2204)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2205)
 wait (7)
 wait for key (usekey)
 advance text box
 set tag (tag:BuckText,on)
 resume box advance
 resume player
end

script,lifemist,begin
 suspend player
 swap by position (0,find hero (hero:Hilda))
 suspend box advance
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 wait (3)
 reset palette
 fade screen in
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2210)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2211)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2212)
 wait (7)
 wait for key (usekey)
 advance text box
set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 set hero frame (0,1)
 wait (1)
 set hero frame (0,0)
 wait (1)
 show text box (2213)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2214)
 wait (7)
 wait for key (usekey)
 advance text box

 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 wait (3)
 reset palette
 fade screen in
 show text box (2215)
 wait (7)
 wait for key (usekey)
 advance text box
 teach spell ((find hero(hero:Hilda)),atk:Life Mist)
 set tag (tag:Thule5,on)
 resume box advance
 resume player
end

script,Cthulhu3,begin
 suspend player
 suspend box advance
 stop song
 fade screen out
 wait (1)
 show text box (2087)
 wait (2)
 fade screen in
 wait (7)
 wait for key (use key)
 fade screen out
 wait (1)
 advance text box
 wait (2)
 teleport to map (16,8,66)
 stop song
 wait (1)
 fade screen in
 play song (song:Vile)
 focus camera (8,71,4)
 wait for camera
 show text box (2226)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (9,up)
 show text box (2227)
 wait (7)
 wait for key (usekey)
 advance text box

 tweak palette (-10,-10,-10)
 fade screen in
 wait (5)
 set NPC position (39,8,72)
 play sound (sfx:StormMagic,false,true)
 wait (5)
 reset palette
 fade screen in
 wait (5)
 show text box (2228)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2229)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (3)
 walk NPC (11,down,2)
 wait for NPC (11)
 wait (3)
 show text box (2230)
 wait (7)
 wait for key (usekey)
 advance text box
 tweak palette (-10,-10,-10)
 fade screen in
 wait (5)
 play sound (sfx:TornadoMagic,false,true)
 Alter NPC (39,NPCstat:picture,157)
 Alter NPC (39,NPCstat:palette,3)
 wait (5)
 reset palette
 fade screen in
 wait (5)
 show text box (2231)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2232)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2233)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2234)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (3)
 set NPC direction (11,right)
 wait (10)
 walk NPC (11,right,1)
 wait (5)
 set NPC direction (11,down)
 wait (1)
 show text box (2235)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2236)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2237)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (11,left,1)
 wait for NPC (11)
 set NPC direction (11,down)
 show text box (2238)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2239)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2240)
 wait (7)
 wait for key (usekey)
 advance text box
 fade screen out
 wait (1)
 advance text box
 wait (2)
 stop song
 fade screen out
 wait (5)
 camera follows hero (me)
 set hero direction (me,up)
 wait (3)
 teleport to map (8,30,55)
 wait (1)
 fade screen in
 wait (1)
 resume player
 resume box advance
end

script,thisisademo,begin
 stop song
 teleport to map (16,8,66)
 stop song
 wait (1)
 fade screen in
 play song (song:Vile)
 focus camera (8,71,4)
 wait for camera
 show text box (2241)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2242)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2243)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2244)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2245)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2246)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2247)
 wait (7)
 wait for key (usekey)
 advance text box
 fade screen out
 wait (1)
 camera follows hero (me)
 teleport to map (28,7,57)
 wait (1)
 fade screen in
end