#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)
define script (149,Delvire3,none)
define script (150,DelvireBoat,none)
define script (151,Gisli,none)
define script (152,hatistory1,none)
define script (153,hatistory2,none)
define script (154,hatistory3,none)
define script (155,hatistory4,none)
define script (156,hatistory5,none)
define script (157,hatistory6,none)
define script (158,arenamu,none)
define script (159,hatifight1,none)
define script (160,hatifight2,none)
define script (161,god,none)
define script (162,Rachel2,none)
define script (163,skadi3,none)
define script (164,narvi2,none)
define script (165,cow,none)
define script (166,hissu,none)
define script (167,slayjotun,none)
define script (168,timtim,none)
define script (169,delvirefinal,none)
define script (170,weakstrike,none)
define script (171,manslay,none)
define script (172,darkrage,none)
define script (173,itsatrap,none)
define script (174,seethegate,none)
define script (175,intohelheim,none)

define script (176,vikitron,none)
define script (177,funkout,none)
define script (178,scoreboard,none)
define script (179,funkatronbest,none)
define script (180,funkatrongreat,none)
define script (181,funkatrongood,none)
define script (182,funkatronokay,none)
define script (183,funkatronpoor,none)
define script (184,funkatronbad,none)
define script (185,funkatronawful,none)

define script (186,OmegaWEAPON,none)
define script (187,OmegaWEAPONfinal,none)

define script (188,Enherdesert,none)
define script (189,HildaValia,none)
define script (190,Linnorm,none)
define script (191,TripCut,none)



global variable, begin
 1,timer
 2,steve
 3,tyron
 4,boosh
 5,score
 6,keytimer
10,highscore
end


script,run,begin 
 show no value
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:㎜hotoheal))
if (checktag(tag:Siphon1)) 	then 	(write spell((find hero(hero:Renard)),1,1,atk:㏎iphon))
if (checktag(tag:Lifedrain1)) 	then 	(write spell((find hero(hero:Renard)),1,2,atk:﹩ifedrain))
if (checktag(tag:Crush1)) 	then 	(write spell((find hero(hero:Renard)),1,3,atk:$rush))
if (checktag(tag:Maim1)) 	then 	(write spell((find hero(hero:Renard)),1,4,atk:﹪aim))
if (checktag(tag:Dissolve1)) 	then 	(write spell((find hero(hero:Renard)),1,5,atk:¥issolve))
if (checktag(tag:Greenfire1)) 	then 	(write spell((find hero(hero:Renard)),1,6,atk:£reenfire))
if (checktag(tag:Purplhaze1)) 	then 	(write spell((find hero(hero:Renard)),1,7,atk:㎜urplhaze))
if (checktag(tag:Icewave1)) 	then 	(write spell((find hero(hero:Renard)),1,8,atk:@cewave))
if (checktag(tag:Explode1)) 	then 	(write spell((find hero(hero:Renard)),1,9,atk:〒xplode))
if (checktag(tag:Barrier1)) 	then 	(write spell((find hero(hero:Renard)),1,10,atk:﹨arrier))
if (checktag(tag:Supernova1)) 	then 	(write spell((find hero(hero:Renard)),1,12,atk:㏎upernova))

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
#This part will only play if this game is the Alectormancy release candidate
 thisisademo
#It'll be altered, removed outright, or even changed for YGGDRASIL, whenever that is
 suspend player
 suspend box advance
 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, 10)
 set hero z (1, 10)
 set hero z (2, 10)
 set hero z (3, 10)
 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)
 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, 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)
 set hero z (0, 10)
 set hero z (1, 10)
 set hero z (2, 10)
 set hero z (3, 10)

 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
 wait (1)
 set hero z (0, 0)
 set hero z (1, 0)
 set hero z (2, 0)
 set hero z (3, 0)
 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)
 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, 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)
 set hero z (0, 10)
 set hero z (1, 10)
 set hero z (2, 10)
 set hero z (3, 10)

 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, 0)
 set hero z (1, 0)
 set hero z (2, 0)
 set hero z (3, 0)
 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)
 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, 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)
pan camera (down,1)
 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)
 camera follows 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,49,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
 suspend obstruction
 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)

 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,26,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,36,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
 teach spell ((find hero(hero:Night)),atk:Drainer)

 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:窿atana)
 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:咎lash 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)
 teach spell ((find hero(hero:Eric)),atk:Rally)
 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)
 teach spell ((find hero(hero:Styrge)),atk:Mechbane)
 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)
 camera follows hero (me)
 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
 set tag (tag:nightback,on)
 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:杷ce 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:咄iresmash)
 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:呼cebrand)
 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:咕oltslash)
 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:咎pinslash)
 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:林ife 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)
 play song (song:Vile)
 suspend player
 suspend box advance
 wait (1)
 fade screen in
 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

script,Delvire3,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 (31,22,4)
 wait (4)
 walk NPC (0,right,2) 
 wait for NPC (0)
 wait for camera
 set NPC direction (0,down)
 wait (5)
 play sound (sfx:Delvire,false,true)
 show text box (2248)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (20)
 walk NPC (0,down,1)
 show text box (2249)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2250)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (5)
 set NPC direction (0,left)
 wait (5)
 show text box (2251)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (5)
 set NPC direction (0,down)
 wait (5)
 show text box (2252)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (10)
 show text box (2253)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2254)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2255)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (0,left)
 wait (3)
 walk NPC (0,up,1)
 wait (15)
 show text box (2256)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (0,left,10)
 show text box (2257)
 wait (7)
 wait for key (usekey)
 advance text box
 wait for NPC (0)
 wait (5)
 walk NPC (0,right,10)
 wait for NPC (0)
 walk NPC (0,down,2)
 wait for NPC (0)
 wait (2)
 play sound (sfx:Soft_Airy_Swish,false,true) 
 wait (2)
 walk NPC (0,up,2)
 wait for NPC (0)
 walk NPC (0,left,10)
 wait for NPC (0)
 pan camera (down,3,4)
 wait for camera
 camera follows hero (me)
 set tag (tag:Delvireironwood,on)
 reset palette
 fade screen in
 resume player
 play song (get ambient music)
 resume box advance
 resume NPCs
 resume obstruction
 wait (2)
end

script,DelvireBoat,begin
 suspend player
 swap by position (0,find hero (hero:Bram))
 suspend box advance
 suspend NPCs
 suspend obstruction
 wait (2)
 show text box (2265)
 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 (2266)
 wait (7)
 wait for key (usekey)
 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 (2267)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (me,down)
 pan camera (down,3)
 wait for camera
 wait (15)
 pan camera (up,3)
 wait for camera
 camera follows hero (me)
 wait (15)
 show text box (2268)
 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 (2269)
 wait (7)
 wait for key (usekey)
 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 (2270)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2271)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (2)
 stop song
 greyscale palette
 update palette
 play sound (sfx:Ice Crash,false,true)
 wait (2)
 walk hero (me,down,1)
 set hero direction (me,up)
 walk NPC (2,down,1)
 wait for NPC (2)
 set NPC position (2,27,22)
 set NPC direction (2,right)
 play sound (sfx:KirbyStyleLaser,false,true)
 wait (4)
 set NPC position (2,27,24)
 set NPC direction (2,down)
 play sound (sfx:KirbyStyleLaser,false,true)
 wait (4)
 set NPC direction (2,right)
 set NPC position (2,29,24)
 play sound (sfx:KirbyStyleLaser,false,true)
 wait (4)
 set NPC position (2,31,24)
 play sound (sfx:KirbyStyleLaser,false,true)
 wait (4)
 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 (2272)
 wait (7)
 wait for key (usekey)
 advance text box
 reset palette
 tweak palette (0,10,0)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 wait (3)
 reset palette
 fade screen in
 show text box (2275)
 wait (7)
 wait for key (usekey)
 advance text box
 teach spell ((find hero(hero:Bram)),atk:Hasten)
 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 (2273)
 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 (2274)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (2,up)
 wait (4)
 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 (2276)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2277)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (2,down)
 wait (5)
 walk NPC (2, right,4)
 wait for NPC (2)
 set tag (tag:Delvireboatscene,on)
 reset palette
 fade screen in
 resume player
 play song (get ambient music)
 resume box advance
 resume NPCs
 resume obstruction
 wait (2)
end

script,Gisli,begin
 suspend player
 swap by position (0,find hero (hero:Olaf))
 suspend box advance
 suspend NPCs
 suspend obstruction
 wait (2)
 show text box (2281)
 wait (7)
 wait for key (usekey)
 advance text box
 fade screen out
 wait (5)
 focus camera (8,27,20)
 wait for camera
 fade screen in
 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 (2284)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (8,right)
 wait (4)
 set NPC direction (8,down)
 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 (2285)
 wait (7)
 wait for key (usekey)
 advance text box
 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 (2286)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (9,down)
 wait (4)
 walk NPC (9,left,1)
 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 (2287)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (0,down)
 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 (2288)
 wait (7)
 wait for key (usekey)
 advance text box
 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 (2289)
 wait (7)
 wait for key (usekey)
 advance text box
 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 (2290)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (8,down,1)
 wait for NPC (8)
 set NPC direction (8,right)
 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 (2291)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (7,down)
 set NPC direction (0,down)
 wait (4)
 set NPC direction (0,left)
 set NPC direction (7,right)
 show text box (2292)
 wait (7)
 wait for key (usekey)
 advance text box
 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 (2293)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (7,down)
 wait (4)
 set NPC direction (7,left)
 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 (2294)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (10,right)
 show text box (2295)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC frame (7,0)
 wait (1)
 set NPC frame (7,1)
 wait (1)
 set NPC frame (7,0)
 wait (1)
 show text box (2296)
 wait (7)
 wait for key (usekey)
 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 (2297)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC frame (7,0)
 wait (1)
 set NPC frame (7,1)
 wait (1)
 set NPC frame (7,0)
 wait (1)
 show text box (2298)
 wait (7)
 wait for key (usekey)
 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 (2299)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC frame (7,0)
 wait (1)
 set NPC frame (7,1)
 wait (1)
 set NPC frame (7,0)
 wait (1)
 show text box (2300)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (0,down)
 wait (4)
 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 (2302)
 wait (7)
 wait for key (usekey)
 advance text box
 tweak palette (10,0,0)
 update palette
 play sound (sfx:Crush8Bit,false,true)
 wait (3)
 reset palette
 fade screen in
 show text box (2301)
 wait (7)
 wait for key (usekey)
 advance text box
 teach spell ((find hero(hero:Olaf)),atk:Charge)
 fade screen out
 wait (5)
 camera follows hero (me)
 use door (7)
 set tag (tag:Gisli,on)
 reset palette
 fade screen in
 resume player
 play song (get ambient music)
 resume box advance
 resume NPCs
 resume obstruction
 wait (2)
end

script,hatistory1,begin
 suspend player
 suspend box advance
 suspend NPCs
 suspend obstruction
 wait (2)
 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 (2304)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (3)
 set NPC direction (1,left)
 wait (3)
 set NPC direction (1,up)
 wait (3)
 show text box (2305)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2306)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (3)
 set NPC direction (1,left)
 wait (3)
 set NPC direction (1,down)
 wait (3)
 show text box (2307)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (1,down,6)
 wait (10)
 show text box (2333)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2334)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (2)
 wait for NPC (1)
 set NPC position (1,9,27)
 set NPC direction (1,right)
 resume player
 resume box advance
 resume NPCs
 resume obstruction
end

script,hatistory2,begin
 suspend player
 suspend box advance
 suspend NPCs
 suspend obstruction
 wait (2)
 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 (2308)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (10)
 show text box (2309)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (1,right,1)
 wait for NPC (1)
 wait (5)
 show text box (2310)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2311)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (1,right,8)
 wait (10)
 set hero direction (me,right)
 wait (5)
 show text box (2335)
 wait (7)
 wait for key (usekey)
 advance text box
 wait for NPC (1)
 set NPC position (1,35,15)
 set NPC direction (1,right)
 resume player
 resume box advance
 resume NPCs
 resume obstruction
end

script,hatistory3,begin
 suspend player
 suspend box advance
 suspend NPCs
 set hero direction (me,right)
 suspend obstruction
 wait (2)
 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 (2336)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2312)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2313)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2314)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (1,down)
 show text box (2315)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (1,right,8)
 wait (4)
 show text box (2331)
 wait (7)
 wait for key (usekey)
 advance text box
 wait for NPC (1)
 set NPC position (1,50,29)
 set NPC direction (1,down)
 resume player
 resume box advance
 resume NPCs
 resume obstruction
end

script,hatistory4,begin
 suspend player
 suspend box advance
 suspend NPCs
 walk hero to X (me,49) 
 wait for hero (me)
 walk hero to y (me,28)
 wait for hero (me)
 walk hero (me,down,1)
 wait for hero (me)
 suspend obstruction
 wait (2)
 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 (2316)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2317)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2318)
 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 (2337)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (1,left)
 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 (2338)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (1,down)
 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 (2327)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2328)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2329)
 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 (2330)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (1,down,8)
 wait (10)
 show text box (2331)
 wait (7)
 wait for key (usekey)
 advance text box
 wait for NPC (1)
 resume player
 set NPC position (1,44,45)
 set NPC direction (1,down)
 resume box advance
 resume NPCs
 resume obstruction
end

script,hatistory5,begin
 suspend player
 suspend box advance
 suspend NPCs
 walk hero (me,down,1)
 wait for hero (me)
 walk hero to x (me,45)
 wait for hero (me)
 walk hero to y (me,45)
 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 (2319)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2320)
 wait (7)
 wait for key (usekey)
 advance text box
 focus camera (50,50,2)
 show text box (2321)
 wait (7)
 wait for key (usekey)
 advance text box
 wait for camera 
 show text box (2322)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2323)
 wait (7)
 wait for key (usekey)
 advance text box
 focus camera (45,45,2)
 wait for camera
 set hero direction (me,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 text box (2324)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (1,right)
 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 (2325)
 wait (7)
 wait for key (usekey)
 advance text box
 set npc direction (1,down)
 show text box (2326)
 wait (7)
 wait for key (usekey)
 advance text box 
 walk NPC (1,left,8)
 wait (5)
 show text box (2349)
 wait (7)
 wait for key (usekey)
 advance text box
 wait for NPC (1)
 set NPC position (1,12,41)
 set NPC direction (1,down)
 camera follows hero (me)
 resume player
 resume box advance
 resume NPCs
 resume obstruction
end

script,hatistory6,begin
 suspend player
 suspend box advance
 suspend NPCs
 walk hero to y (me,43)
 wait for hero (me)
 walk hero to x (me,12)
 wait for hero (me)
 set hero direction (me,up)
 set NPC direction (1,down)
 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 (2350)
 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 (2339)
 wait (7)
 wait for key (usekey)
 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 (2340)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2341)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,up,1)
 wait for hero (me)
 show text box (2342)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (5)
 set NPC direction (1,right)
 wait (5)
 show text box (2343)
 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 (2344)
 wait (7)
 wait for key (usekey)
 advance text box 
 walk hero (me,down,1)
 set hero direction (me,up)
 walk NPC (1,down,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 (2345)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2346)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (5)
 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 (2347)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (1)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:StormMagic,false,true)
 teach spell ((find hero(hero:Night)),atk:Hater)
 wait (10)
 reset palette
 fade screen in
 show text box (2348)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 fade screen out (63,63,63)
 wait (4)
 use door (2)
 resume player
 resume box advance
 resume NPCs
 resume obstruction
end

script,arenamu,begin
 fight formation (287)
end

script,hatifight1,begin
 suspend player
 suspend box advance
 suspend NPCs
 fade screen out
 stop song
 focus camera (27,14,20)
 set hero position (me,2,2)
 wait for camera 
 wait (2)
 set tag (tag:wargsfight,on)
 wait (2)
 fade screen in
 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 (2363)
 wait (7)
 wait for key (usekey)
 advance text box

 set NPC frame (10,1)
 wait (1)
 set NPC frame (10,0)
 wait (1)
 set NPC frame (10,1)
 wait (1)
 set NPC frame (10,0)
 wait (1)
 show text box (2364)
 wait (7)
 wait for key (usekey)
 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 (2365)
 wait (7)
 wait for key (usekey)
 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 (2366)
 wait (7)
 wait for key (usekey)
 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 (2367)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2368)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2369)
 wait (7)
 wait for key (usekey)
 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 (2370)
 wait (7)
 wait for key (usekey)
 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 (2371)
 wait (7)
 wait for key (usekey)
 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 (2372)
 wait (7)
 wait for key (usekey)
 advance text box
 resume box advance
 end

script,hatifight2,begin
 suspend player
 suspend box advance
 suspend NPCs
 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 (2380)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (10,right,1)
 show text box (2381)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (15,left,1)
 show text box (2382)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (10)
 set NPC direction (15,down)
 wait (3)
 set NPC direction (15,right)
 wait (10)
 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 (2383)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (15,down)
 wait (2)
 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 (2384)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (11,right,1)

 show text box (2385)
 wait (7)
 wait for key (usekey)
 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 (2386)
 wait (7)
 wait for key (usekey)
 advance text box
 walk NPC (16,left,1)
 show text box (2387)
 wait (7)
 wait for key (usekey)
 advance text box
 bossintroduction

 fight formation (6)
 show text box (2388)
 wait (7)
 wait for key (usekey)
 advance text box

 hatifinal

end

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

 show text box (2390)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2391)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2392)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2393)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2394)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2395)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2396)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (2)
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Beam Attack,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Believe)

 wait (3)
 reset palette
 update palette
 show text box (2397)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2398)
 wait (7)
 wait for key (usekey)
 advance text box
 resume player
 resume box advance
 resume NPCs
end

script,Rachel2,begin
 suspend player
 suspend box advance
 suspend NPCs
 swap by position (0,find hero (hero:Frumpy))
 show text box (2403)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2404)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2405)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2406)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2407)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2408)
 wait (7)
 wait for key (usekey)
 advance text box

 wait (2)
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Care4)

 wait (3)
 reset palette
 update palette
 show text box (2409)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2410)
 wait (7)
 wait for key (usekey)
 advance text box
 resume player
 resume box advance
 resume NPCs
end

script,skadi3,begin
 suspend player
 suspend box advance
 suspend NPCs
 swap by position (0,find hero (hero:Frumpy))
 show text box (2418)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2419)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2420)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2421)
 wait (7)
 wait for key (usekey)
 advance text box

 wait (2)
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Nurse3)

 wait (3)
 reset palette
 update palette
 show text box (2422)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2423)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2424)
 wait (7)
 wait for key (usekey)
 advance text box
 resume player
 resume box advance
 resume NPCs
end

script,narvi2,begin
 suspend player
 suspend box advance
 suspend NPCs
 swap by position (0,find hero (hero:Frumpy))
 show text box (2427)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2428)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2429)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2430)
 wait (7)
 wait for key (usekey)
 advance text box

 show text box (2431)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2432)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2433)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2434)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2435)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2436)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2437)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2438)
 wait (7)
 wait for key (usekey)
 advance text box

 wait (2)
 tweak palette (0,0,10)
 update palette
 play sound (sfx:Heal8Bit,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Raise)

 wait (3)
 reset palette
 update palette
 show text box (2439)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2440)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2441)
 wait (7)
 wait for key (usekey)
 advance text box

 resume player
 resume box advance
 resume NPCs
end

script,cow,begin
 suspend player
 suspend box advance
 suspend NPCs
 swap by position (0,find hero (hero:Hilda))
 swap by position (1,find hero (hero:Olaf))
 show text box (2443)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero to x (me,54)
 wait for hero (me)
 walk hero to y (me,51)
 wait for hero (me)
 set caterpillar mode (on)
 set hero position (1, 54, 51)
 set hero position (2, 54, 51)
 set hero position (3, 54, 51)
 wait (1)
 suspend caterpillar 

 wait (1)
 walk hero (me,left,1)
 walk hero (1,up,1)
 walk hero (2,down,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) 
 show text box (2444)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2445)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2446)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2447)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2448)
 wait (7)
 wait for key (usekey)
 advance text box

 BossIntroduction
 fight formation (288)
 set tag (tag:cowfight,on)

 show text box (2449)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (me,right)
 show text box (2450)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2451)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (me,left)
 set hero direction (me,right)
 walk hero (1,left,1)
 wait for hero (1)

 show text box (2452)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2453)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2454)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (10)
 show text box (2455)
 wait (7)
 wait for key (usekey)
 advance text box
 wait(20)
 show text box (2456)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2457)
 wait (7)
 wait for key (usekey)
 advance text box
 walk hero (2,left,1)
 wait for hero (2)
 walk hero (me,right,1)
 walk hero (1,down,1)
 walk hero (2,up,1)
 walk hero (3,left,1)
 wait for hero (me)
 camera follows hero (me)
 wait (1)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:StormMagic,false,true)
 wait (5)
 reset palette
 update palette
 show text box (2458)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 resume NPCs
 resume player
 resume box advance
 resume caterpillar
 set caterpillar mode (off)
end

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

 fade screen out
 wait (5)
 put hero (me,0,0)
 focus camera (12,10,0)
  set NPC position (10,11,11)
 set NPC direction (10,right)
  set NPC position (11,10,9)
 set NPC direction (11,right)
  set NPC position (12,12,9)
 set NPC direction (12,down)
  set NPC position (13,8,9)
 set NPC direction (13,up)
  set NPC position (14,13,10)
 set NPC direction (14,left)
  set NPC position (15,14,7)
 set NPC direction (15,down)
 wait (5)
 fade screen in
 show text box (2459)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2460)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2461)
 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
 wait (5)
 set NPC direction (10,down)
 set NPC direction (11,down)
 set NPC direction (12,down)
 set NPC direction (13,down)
 set NPC direction (14,down)
 wait (5)
 show text box (2462)
 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
 wait (5)
 fade screen out (63,63,63)
 wait (2)
 show text box (2463)
 set tag (tag:Annoy Midgardsorm,on)
 wait (2)
 fade screen in
 wait (30)
 fade screen out (63,63,63)
 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)
 wait (2)
 advance text box
 wait (2)
 fade screen in
 show text box (2464)
 walk NPC (14,left,2)
 set NPC direction (14,right)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (10,right,1)
 wait for NPC (10)
 show text box (2465)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (401)
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 show text box (402)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (403)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (13,right,1)
 show text box (404)
 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
 wait (5)

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

 bossintroduction
 fight formation (5)
 set tag (tag:beatsnake,on)

 set hero position (me,12,10)
  camera follows hero (me)
 resume NPCs
 resume player
 resume box advance
 resume caterpillar
 set caterpillar mode (off)
end

script,slayjotun,begin
 suspend player
 suspend box advance
 swap by position (0, find hero (hero:Styrge))
 show text box (2469)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2470)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2471)
 wait (7)
 wait for key (use key)
 advance text box
 walk hero (me,down,1)
 wait for hero (me)
 walk NPC (6,left,1)
 wait for NPC (6)
 set NPC direction (6,right)
 walk hero to x (me,26)
 wait for hero (me)
 walk hero to y (me,1)
 wait for hero (me)
 wait (2)
 walk hero (me,up,2)
 wait for hero (me)
 wait (5)
 walk NPC (7,down,1)
 wait for NPC (7)
 wait (2)

 boss introduction
 fight formation (292)

 set tag (tag:jotunslain,on)

 tweak palette (10,0,0)
 update palette
 play sound (sfx:Crush8Bit,false,true)
 wait (3)
 reset palette
 fade screen in
 show text box (2472)
 wait (7)
 wait for key (usekey)
 advance text box
 teach spell ((find hero(hero:Styrge)),atk:GiantDoom)
 wait (5)

 resume box advance
 resume player
end

script,timtim,begin
 suspend player
 suspend box advance
 swap by position (0, find hero (hero:Night))
  show text box (2474)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2475)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2476)
 wait (7)
 wait for key (usekey)
 advance text box
 tweak palette (0,10,0)
 update palette
 play sound (sfx:Crush8Bit,false,true)
 wait (3)
 reset palette
 fade screen in
 show text box (2477)
 wait (7)
 wait for key (usekey)
 set tag (tag:timtim1,on)
 advance text box
 teach spell ((find hero(hero:Night)),atk:Hinder)
 wait (5)
 show text box (2478)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2479)
 wait (7)
 wait for key (usekey)
 advance text box
 resume player
 resume box advance
end




script,delvirefinal,begin
 suspend player
 suspend box advance
 fade screen out
 wait (2)
 set hero position (me,34,5)
 swap by position (0,find hero (hero:Bram))
 swap out hero (hero:Freki)
 swap out hero (hero:Kitt)
 swap out hero (hero:Styrge)
 swap out hero (hero:Hilda)
 swap out hero (hero:Olaf)
 swap out hero (hero:Eric)
 swap out hero (hero:Frumpy)
 swap out hero (hero:Night)
 swap out hero (hero:Renard)
 swap out hero (hero:Xephes)
 swap out hero (hero:Dragon)
 wait (2)
 #Delvire
 set NPC position (23,31,10)
 set NPC direction (23,right)
 focus camera (34,10,2)
 wait for camera
 #Bram
 set NPC position (17,37,10)
 set NPC direction (17,left)

 wait (3)
 fade screen in
 wait (10)

 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2484)
 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 (2485)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2486)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (23,down)
 wait (3)
 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 (2487)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2488)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (17,left,1)
 wait for NPC (17)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2489)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (23,down)
 wait (3)
 set NPC direction (23,right)
 show text box (2490)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (23,right,1)
 show text box (2491)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2492)
 wait (7)
 wait for key (use key)
 advance text box

 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2493)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (23,down)
 wait (3)
 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 (2494)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2495)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (23,down)
 wait (3)
 set NPC direction (23,right)
 show text box (2496)
 wait (7)
 wait for key (use key)
 advance text box

 BossIntroduction 
 fight formation (261)
  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 (2497)
 wait (7)
 wait for key (use key)
 advance text box
 wait (7)
  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 (2498)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2499)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (23,down)
 wait (2)
 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 (2500)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (2)
 show text box (2501)
 wait (2)
 fade screen in
 wait (7)
 wait for key (use key)
 advance text box
  show text box (2502)
 wait (7)
 wait for key (use key)
 advance text box
  show text box (2503)
 wait (7)
 wait for key (use key)
 fade screen out
 wait (2)
 advance text box
 wait (2)
 set NPC direction (23,right)
 fade screen in
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2504)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (23,right,1)
  show text box (2505)
 wait (7)
 wait for key (use key)
 advance text box
  show text box (2506)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (17,down)
 wait (3)
 set NPC direction (17,right)
 wait (10)
 stop song
 show text box (2507)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 set NPC direction (17,down)
 walk NPC (17,down,2)
 wait for NPC (17)
 set NPC direction (23,down)
  show text box (2508)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
  show text box (2509)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (17,left)
 wait (3)
 set NPC direction (17,up)
 wait (3)
  show text box (2510)
 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 (2511)
 wait (7)
 wait for key (use key)
 advance text box
 wait (1)
 tweak palette (0,10,0)
 update palette
 play sound (sfx:Heal8bit,false,true)
 teach spell ((find hero(hero:Bram)),atk:Flux Time)
 wait (10)
 reset palette
 fade screen in
 show text box (2512)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (2)
 resume box advance
 resume NPCs
 resume obstruction
 camera follows hero (me)
 wait (2)
 use door (9)
 wait (2)
 fade screen in
 resume player
end



script,weakstrike,begin
 suspend player
 suspend box advance
 swap by position (0,find hero (hero:Kitt))
 show text box (2535)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2536)
 wait (7)
 wait for key (use key)
 advance text box

 wait (1)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:StormMagic,false,true)
 teach spell ((find hero(hero:Kitt)),atk:坪eaksmash)
 wait (10)
 reset palette
 fade screen in
 show text box (2537)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2538)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2539)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2540)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2541)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 resume player
 resume box advance
end

script,manslay,begin
 suspend player
 suspend box advance
 swap by position (0,find hero (hero:Styrge))
 show text box (2542)
 wait (7)
 wait for key (use key)
 advance text box

 wait (1)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:StormMagic,false,true)
 teach spell ((find hero(hero:Styrge)),atk:ManSlayer)
 wait (10)
 reset palette
 fade screen in
 show text box (2543)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2544)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2545)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2546)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2547)
 wait (7)
 wait for key (use key)
 advance text box
 wait (15)
 show text box (2548)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2549)
 wait (7)
 wait for key (use key)
 advance text box
 resume player
 resume box advance
end

script,darkrage,begin
 suspend player
 suspend box advance
 swap by position (0,find hero (hero:Olaf))
 show text box (2550)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2551)
 wait (7)
 wait for key (use key)
 advance text box
 wait (1)
 tweak palette (10,0,0)
 update palette
 play sound (sfx:Roar,false,true)
 teach spell ((find hero(hero:Olaf)),atk:Dark Rage)
 wait (10)
 reset palette
 fade screen in
 show text box (2552)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2553)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2554)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2555)
 wait (7)
 wait for key (use key)
 advance text box
 resume box advance
 resume player
 end

script,itsatrap,begin
 suspend player
 suspend box advance
 suspend npcs
 stop song
 tweak palette (-5,5,-5)
 fade screen in
 wait (2)
 tweak palette (-5,5,-5)
 fade screen in
 wait (2)
 tweak palette (-5,5,-5)
 fade screen in
 wait (2)
 tweak palette (-5,5,-5)
 fade screen in
 wait (2)
 tweak palette (-5,5,-5)
 fade screen in
 wait (2)
 tweak palette (-5,5,-5)
 fade screen in
 wait (2)
 tweak palette (-5,5,-5)
 fade screen in
 wait (2)
 fade screen out
 wait (2)
 reset palette
 wait (2)
 swap by position (0, find hero (hero:Kitt))
 swap out hero (hero:Bram)
 swap out hero (hero:Frumpy)
 swap out hero (hero:Styrge)
 swap out hero (hero:Hilda)
 swap out hero (hero:Olaf)
 swap out hero (hero:Night)
 swap out hero (hero:Eric)
 set hero position (me,80,17)
 wait (2)
 fade screen in
 wait (2)
 focus camera (80,24,2)
 wait for camera
 walk NPC (47,down,1)
 wait for NPC (47)
 tweak palette (63,63,63)
 update palette
 play sound (sfx:Metal_Hit,false,true)
 wait (1)
 reset palette
 update palette
 wait (2)
 walk NPC (47,up,1)
 set NPC direction (47,down)
 wait for NPC (47)
 wait (2)
 walk NPC (47,down,1)
 wait for NPC (47)
 tweak palette (63,63,63)
 update palette
 play sound (sfx:Metal_Hit,false,true)
 wait (1)
 reset palette
 update palette
 wait (2)
 walk NPC (47,up,1)
 set NPC direction (47,down)
 wait for NPC (47)
 wait (2)
 walk NPC (47,down,1)
 wait for NPC (47)
 tweak palette (63,63,63)
 update palette
 play sound (sfx:Metal_Hit,false,true)
 wait (1)
 reset palette
 update palette
 wait (2)




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

 show text box (2565)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2566)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2567)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (50,down)
 walk NPC (52,down,2)
 walk NPC (48,right,1)
 walk NPC (43,up,6)
 walk NPC (44,up,6)
 walk NPC (45,up,6)
 walk NPC (46,up,6)
 wait for NPC (43)
 walk NPC (43,left,2)
 walk NPC (44,up,1)
 walk NPC (45,right,1)
 walk NPC (46,left,1)
 wait for NPC (46)
 set NPC direction (43,down)
 set NPC direction (45,up)
 set NPC direction (46,up)
 wait (2)
 set NPC direction (43,right)
 wait (2)
 show text box (2568)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (48,1)
 wait (1)
 set NPC frame (48,0)
 wait (1)
 set NPC frame (48,1)
 wait (1)
 set NPC frame (48,0)
 wait (1)
 show text box (2569)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (44,left)
 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 show text box (2570)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (47,1)
 wait (1)
 set NPC frame (47,0)
 wait (1)
 set NPC frame (47,1)
 wait (1)
 set NPC frame (47,0)
 wait (1)
 show text box (2571)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (44,up)
 wait (3)
 show text box (2572)
 wait (7)
 wait for key (use key)
 advance text box

 set NPC frame (47,1)
 wait (1)
 set NPC frame (47,0)
 wait (1)
 set NPC frame (47,1)
 wait (1)
 set NPC frame (47,0)
 wait (1)
 show text box (2573)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (46,up,1)
 wait for NPC (46)
 show text box (2574)
 wait (7)
 wait for key (use key)
 advance text box

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

 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 show text box (2576)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (44,right)
 wait (2)
 set NPC direction (44,down)
 wait (2)
 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 show text box (2577)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2578)
 wait (7)
 wait for key (use key)
 advance text box

 set NPC frame (54,1)
 wait (1)
 set NPC frame (54,0)
 wait (1)
 set NPC frame (54,1)
 wait (1)
 set NPC frame (54,0)
 wait (1)
 show text box (2579)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 set NPC direction (44,right)
 wait (2)
 show text box (2580)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 set NPC direction (44,left)
 wait (2)
 set NPC direction (44,up)
 wait (2)
 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 show text box (2581)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2582)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 show text box (2583)
 wait (7)
 wait for key (use key)
 advance text box

 show text box (2584)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 show text box (2585)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 show text box (2586)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 set nPC direction (44,left)
 wait (2)
 set NPC direction (44,down)
 wait (2)

 show text box (2587)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (44,down,11)
 wait (10)
 walk NPC (43,right,2)
 walk NPC (46, right,1)
 wait for NPC (46)
 walk NPC (46,down,11)
 wait for NPC (43)
 walk NPC (43,down,11)
 wait for NPC (43)
 stop song
 wait (10)
 show text box (2588)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set NPC direction (45,left)
 wait (5)
 show text box (2589)
 wait (7)
 wait for key (use key)
 advance text box

 set NPC frame (47,1)
 wait (1)
 set NPC frame (47,0)
 wait (1)
 set NPC frame (47,1)
 wait (1)
 set NPC frame (47,0)
 wait (1)
 show text box (2590)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (45,up)
 wait (2)
 walk NPC (45,up,2)
 wait for NPC (45)
 wait (5)
 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 set NPC frame (44,1)
 wait (1)
 set NPC frame (44,0)
 wait (1)
 show text box (2591)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC frame (47,1)
 wait (1)
 set NPC frame (47,0)
 wait (1)
 set NPC frame (47,1)
 wait (1)
 set NPC frame (47,0)
 wait (1)
 show text box (2592)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out 
 wait (1)
 show text box (2593)
 wait (1)
 fade screen in
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2594)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2595)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2596)
 wait (7)
 wait for key (use key)
 fade screen out 
 wait (1)
 advance text box
 wait (2)
 fade screen in
 wait (2)
 set NPC frame (47,1)
 wait (1)
 set NPC frame (47,0)
 wait (1)
 set NPC frame (47,1)
 wait (1)
 set NPC frame (47,0)
 wait (1)
 show text box (2597)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (45,up,3)
 wait for NPC (45)
 set NPC direction (45,right)
 wait (2)
  set NPC frame (45,1)
 wait (1)
 set NPC frame (45,0)
 wait (1)
 set NPC frame (45,1)
 wait (1)
 set NPC frame (45,0)
 wait (1)
 set NPC direction (42,left)
 set NPC direction (,left)
 wait (1)
 set NPC direction (,up)
 wait (1)
 set NPC direction (,right)
 wait (1)
 set tag (tag:gatedown,on)
 wait (5) 
 set NPC direction (45,up)
 show text box (2598)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2599)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 walk NPC (45,left,1)
 wait for NPC (45)
 set NPC direction (45,down)
 wait (2)
 show text box (2600)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (45,left)
 wait (2)
 set NPC direction (45,up)
 wait (2)
  show text box (2601)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2602)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (10,0,0)
 update palette
 play sound (sfx:EnemyDeath,false,true)
 teach spell ((find hero(hero:Kitt)),atk:咆Pstrike)
 wait (10)
 reset palette
 fade screen in
 show text box (2605)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 walk NPC (45,down,1)
 set NPC direction (45)
 wait for NPC (45)
 set NPC direction (45)
 wait (2)
 walk NPC (45,down,11)
 wait for NPC (45)
 show text box (2603)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2604)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (2)
 set tag (tag:trapped,on)
 
 set hero position (me,80,24)
 camera follows hero (me)
 wait (2)
 fade screen in
 resume box advance
 resume player
 resume NPCs

end

 script,seethegate,begin
 suspend player
 suspend box advance
 focus camera (14,9,4)
 wait for camera
 wait (25)
 focus camera (14,25,4)
 wait for camera
 show text box (2625)
 wait (7)
 wait for key (use key)
 advance text box
 camera follows hero (me)
 resume player
 resume box advance
end


script,intohelheim,begin
 suspend player
 suspend obstruction

 wait (2)
 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)
 wait (2)
 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)
 wait (2)
 set NPC direction (2,left)
 set NPC direction (3,left)
 set NPC direction (4,left)
 set NPC direction (5,left)
 set NPC direction (6,left)
 set NPC direction (7,left)
 set NPC direction (8,left)
 set NPC direction (9,left)
 set NPC direction (10,left)
 set NPC direction (11,left)
 set NPC direction (12,left)
 set NPC direction (13,left)
 wait (15)


 play sound (sfx:earthquake,false,true)
 walk NPC (2,left,2)
 walk NPC (3,left,2)
 walk NPC (4,left,2)
 walk NPC (5,left,2)
 walk NPC (6,left,2)
 walk NPC (7,left,2)

 walk NPC (8,right,2)
 set NPC direction (8,left)
 walk NPC (9,right,2)
 set NPC direction (9,left)
 walk NPC (10,right,2)
 set NPC direction (10,left)
 walk NPC (11,right,2)
 set NPC direction (11,left)
 walk NPC (12,right,2)
 set NPC direction (12,left)
 walk NPC (13,right,2)
 set NPC direction (13,left)

 wait for NPC (13)
 wait (20)
 fade screen out
 wait (2)
 use door (2)
 resume obstruction
 resume player
end
























plotscript, vikitron, begin
suspend player
 suspend box advance
	resume NPCs
suspend obstruction
import globals (5)
 fade screen out
 wait (1)
showtextbox (2635)
 fade screen in
 wait (20)
 fade screen out
 advance textbox
 wait (1)
teleport to map (37,11,9)
 wait (1)


timer:=0
score:=0
keytimer:=0
 fade screen in
wait (16)
write map block (11,2,14)
 play sound (sfx:Soft_Airy_Swish,false,true) 
wait(10)
create npc (3,11,2)
wait(5)
walk npc (3,south,3)
wait(15)
create npc (1,11,2)
wait(5)
walk npc (1,south,3)
walk npc (3,west,2)
wait(20)
create npc (2,11,2)
set NPC direction (3, south)
wait(5)
write map block (11,2,7)
 play sound (sfx:Soft_Airy_Swish,false,true) 
walk npc (2,south,1)
wait(15)
walk npc (2,east,2)
wait(15)
set NPC direction (2, north)
 play sound (sfx:Pingdadingdingding,false,true) 
wait(15)
play sound (0,false,false)
wait(10)
walk npc (2,south,2)
wait(40)
variable(tilex,tiley)
for (tilex,0,22,1) do,begin
for (tiley,0,2,1) do, begin
write map block (tilex,tiley,8)
end,end
write map block (10,0,9,2),write map block (10,1,25,2),write map block (10,2,41,2)
write map block (11,0,10,2),write map block (11,2,42,2)
write map block (12,0,11,2),write map block (12,1,27,2),write map block (12,2,43,2)


write map block (10,0,0,0),write map block (10,1,0,0),write map block (10,2,0,0)
write map block (11,0,0,0),write map block (11,1,0,0),write map block (11,2,0,0)
write map block (12,0,0,0),write map block (12,1,0,0),write map block (12,2,0,0)


write map block (4,1,13,0),write map block (5,1,13,0),write map block (6,1,13,0),write map block (7,1,13,0),write map block (8,1,13,0),write map block (9,1,13,0),write map block (13,1,13,0),write map block (14,1,13,0),write map block (15,1,13,0),write map block (16,1,13,0),write map block (17,1,13,0),write map block (18,1,13,0),write map block (19,1,13,0),

write map block (4,1,29,2),write map block (5,1,30,2),write map block (6,1,12,2),write map block (7,1,12,2),write map block (8,1,12,2),write map block (9,1,12,2),write map block (13,1,12,2),write map block (14,1,12,2),write map block (15,1,12,2),write map block (16,1,12,2),write map block (17,1,12,2),write map block (18,1,12,2),write map block (19,1,12,2),


play song (56)

tyron:=NPC reference (1,0)
boosh:=NPC reference (2,0)
steve:=NPC reference (3,0)

funkout
end
#-------------------------------------------------------------------------




#game loop
#-------------------------------------------------------------------------
plotscript, funkout, begin
variable(keyz,rand,kill)
while (1==1) do,begin
show value (score)

if (timer<<2550) then (keytimer:=1+keytimer)

if (timer<<2550>>1300) then (keytimer:=1+keytimer)

rand:=random(6,9)
if (keytimer>>20) then (create npc (rand,22,1,west),keytimer:=0)


kill:=npc at spot (4,1)
if (get NPC ID (kill)>>0) then (score:=score--3,create npc (10,4,1,west), play sound (sfx:Cancel8Bit,false,true),wait (1) )
destroy npc (kill)
DESTROY NPC (11)
DESTROY NPC (10)

keyz:=npc at pixel (220,30)
if (key is pressed (key:up),and,not (key is pressed (key:right)),and,not (key is pressed (key:down)),and,not (key is pressed (key:left))) then , begin
if (get NPC ID (keyz)==6) then (score:=score+10,change npc id(keyz,11), play sound (sfx:Bloop,false,true) )
end
if (key is pressed (key:right),and,not (key is pressed (key:up)),and,not (key is pressed (key:down)),and,not (key is pressed (key:left))) then , begin
if (get NPC ID (keyz)==7) then (score:=score+10,change npc id(keyz,11), play sound (sfx:Bloop,false,true) )
end
if (key is pressed (key:down),and,not (key is pressed (key:up)),and,not (key is pressed (key:right)),and,not (key is pressed (key:left))) then , begin
if (get NPC ID (keyz)==8) then (score:=score+10,change npc id(keyz,11), play sound (sfx:Bloop,false,true) )
end
if (key is pressed (key:left),and,not (key is pressed (key:up)),and,not (key is pressed (key:right)),and,not (key is pressed (key:down))) then , begin
if (get NPC ID (keyz)==9) then (score:=score+10,change npc id(keyz,11), play sound (sfx:Bloop,false,true) )
end









if (timer==0,or,timer==130,or,timer==390,or,timer==640,or,timer==785,or,timer==1725,or,timer==925,or,timer==1140,or,timer==2385,or,timer==1460,or,timer==2005,or,timer==2274) then , begin

(put npc (3,180,100),put npc (1,220,100),put npc (2,260,100))
set NPC direction (1, south),set NPC direction (2, south),set NPC direction (3, south)

end








if (timer==5,or,timer==15,or,timer==25,or,timer==35,or,timer==45,or,timer==55,or,timer==65,or,timer==75,or,timer==85,or,timer==95,or,timer==105,or,timer==115,or,timer==125) then , begin
put npc (3,180,95),put npc (1,220,100),put npc (2,260,95)
end

if (timer==10,or,timer==20,or,timer==30,or,timer==40,or,timer==50,or,timer==60,or,timer==70,or,timer==80,or,timer==90,or,timer==100,or,timer==110,or,timer==120) then , begin
put npc (3,180,100),put npc (1,220,95),put npc (2,260,100)
end

if (timer==140,or,timer==160,or,timer==180,or,timer==200,or,timer==220,or,timer==240,or,timer==260,or,timer==280,or,timer==300,or,timer==320,or,timer==340,or,timer==360,or,timer==380) then , begin
set NPC direction (1, west),set NPC direction (2, west),set NPC direction (3, west)
end


if (timer==150,or,timer==170,or,timer==190,or,timer==210,or,timer==230,or,timer==250,or,timer==270,or,timer==290,or,timer==310,or,timer==330,or,timer==350,or,timer==370) then , begin
set NPC direction (1, east),set NPC direction (2, east),set NPC direction (3, east)
end

if (timer==400,or,timer==420,or,timer==440,or,timer==460,or,timer==480,or,timer==500,or,timer==520,or,timer==540,or,timer==560,or,timer==580,or,timer==600,or,timer==620) then , begin
set NPC direction (1, north),set NPC direction (2, north),set NPC direction (3, north)
end

if (timer==410,or,timer==430,or,timer==450,or,timer==470,or,timer==490,or,timer==510,or,timer==530,or,timer==550,or,timer==570,or,timer==590,or,timer==610,or,timer==630) then , begin
set NPC direction (1, south),set NPC direction (2, south),set NPC direction (3, south)
end


if (timer==655,or,timer==665,or,timer==675,or,timer==685,or,timer==695,or,timer==705,or,timer==715,or,timer==725,or,timer==735,or,timer==745,or,timer==755,or,timer==765,or,timer==775,or,timer==2275,or,timer==2285,or,timer==2295,or,timer==2305,or,timer==2315,or,timer==2325,or,timer==2335,or,timer==2345,or,timer==2355,or,timer==2365,or,timer==2375) then,begin
set NPC direction (1, west),set NPC direction (3, west)
put npc (1,220,95)
end


if (timer==660,or,timer==670,or,timer==680,or,timer==690,or,timer==700,or,timer==710,or,timer==720,or,timer==730,or,timer==740,or,timer==750,or,timer==760,or,timer==770,or,timer==780,or,timer==2280,or,timer==2290,or,timer==2300,or,timer==2310,or,timer==2320,or,timer==2330,or,timer==2340,or,timer==2350,or,timer==2360,or,timer==2370,or,timer==2380) then,begin
set NPC direction (1, west),set NPC direction (3, west)
put npc (1,220,100)
end


if (timer==795,or,timer==805,or,timer==815,or,timer==825,or,timer==835,or,timer==845,or,timer==855,or,timer==865,or,timer==876,or,timer==885,or,timer==895,or,timer==905,or,timer==915) then,begin
set NPC direction (1,east),set NPC direction (2,east)
put npc (1,220,95)
end

if (timer==800,or,timer==810,or,timer==820,or,timer==830,or,timer==840,or,timer==850,or,timer==860,or,timer==870,or,timer==880,or,timer==890,or,timer==900,or,timer==910,or,timer==920) then,begin
set NPC direction (1,east),set NPC direction (2,east)
put npc (1,220,100)
end

if (timer==930,or,timer==990,or,timer==1050,or,timer==1110,or,timer==1430) then,begin
set NPC direction (3,east)
end

if (timer==940,or,timer==1000,or,timer==1060,or,timer==1120,or,timer==1440) then,begin
set NPC direction (1,east)
end

if (timer==950,or,timer==1010,or,timer==1070,or,timer==1130,or,timer==1450) then,begin
set NPC direction (2,east)
end

if (timer==960,or,timer==1020,or,timer==1080,or,timer==1400) then,begin
set NPC direction (3,west)
end

if (timer==970,or,timer==1030,or,timer==1090,or,timer==1410) then,begin
set NPC direction (1,west)
end

if (timer==980,or,timer==1040,or,timer==1100,or,timer==1420) then,begin
set NPC direction (2,west)
end








if (timer==1160,or,timer==1220,or,timer==1280,or,timer==1340) then,begin
set NPC direction (3,north)
end

if (timer==1170,or,timer==1230,or,timer==1290,or,timer==1350) then,begin
set NPC direction (1,north)
end

if (timer==1180,or,timer==1240,or,timer==1300,or,timer==1360) then,begin
set NPC direction (2,north)
end

if (timer==1190,or,timer==1250,or,timer==1310,or,timer==1370) then,begin
set NPC direction (3,south)
end

if (timer==1200,or,timer==1260,or,timer==1320,or,timer==1380) then,begin
set NPC direction (1,south)
end

if (timer==1210,or,timer==1270,or,timer==1330,or,timer==1390) then,begin
set NPC direction (2,south)
end





if (timer==1460,or,timer==1470,or,timer==1480,or,timer==1490,or,timer==1500,or,timer==1510,or,timer==1520,or,timer==1530,or,timer==1540,or,timer==1550,or,timer==1560,or,timer==1570,or,timer==1580,or,timer==1590,or,timer==1600,or,timer==1610,or,timer==1620) then,begin
set NPC direction (2,south),set NPC direction (3,south),set NPC direction (1,north)
end

if (timer==1465,or,timer==1475,or,timer==1485,or,timer==1495,or,timer==1505,or,timer==1515,or,timer==1525,or,timer==1535,or,timer==1545,or,timer==1555,or,timer==1565,or,timer==1575,or,timer==1585,or,timer==1595,or,timer==1605,or,timer==1615,or,timer==1625) then,begin
set NPC direction (2,north),set NPC direction (3,north),set NPC direction (1,south)
end



if (timer==1630,or,timer==1640,or,timer==1650,or,timer==1660,or,timer==1670,or,timer==1680,or,timer==1690,or,timer==1700,or,timer==1710,or,timer==1720) then,begin
set NPC direction (2,west),set NPC direction (3,west),set NPC direction (1,east)
end

if (timer==1635,or,timer==1645,or,timer==1655,or,timer==1665,or,timer==1675,or,timer==1685,or,timer==1695,or,timer==1705,or,timer==1715) then,begin
set NPC direction (2,east),set NPC direction (3,east),set NPC direction (1,west)
end




if (timer==1730,or,timer==1740,or,timer==1760,or,timer==1770,or,timer==1790
,or,timer==1800,or,timer==1810,or,timer==1830,or,timer==1840) then,begin
set NPC direction (3,east),set NPC direction (1,east)
put npc (3,180,100)
end

if (timer==1735,or,timer==1765,or,timer==1795,or,timer==1805,or,timer==1835) then,begin
set NPC direction (3,east),set NPC direction (1,east)
put npc (3,180,95)
end


if (timer==1745,or,timer==1755,or,timer==1775,or,timer==1785,or,timer==1815,or,timer==1825,or,timer==1845,or,timer==1855) then,begin
set NPC direction (2,west),set NPC direction (1,west)
put npc (2,260,100)
end


if (timer==1750,or,timer==1780,or,timer==1820,or,timer==1850) then,begin
set NPC direction (2,west),set NPC direction (1,west)
put npc (2,260,95)
end




if (timer==1860,or,timer==1875,or,timer==1885,or,timer==1895,or,timer==1905,or,timer==1915,or,timer==1925,or,timer==1935,or,timer==1945,or,timer==1955,or,timer==1965,or,timer==1975,or,timer==1985,or,timer==1995) then,begin
set NPC direction (2,west),set NPC direction (1,north),set NPC direction (3,east)
put npc (2,260,95),put npc (3,180,95)
end

if (timer==1870,or,timer==1880,or,timer==1890,or,timer==1900,or,timer==1910,or,timer==1920,or,timer==1930,or,timer==1940,or,timer==1950,or,timer==1960,or,timer==1970,or,timer==1980,or,timer==1990,or,timer==2000) then,begin
set NPC direction (2,west),set NPC direction (1,north),set NPC direction (3,east)
put npc (2,260,100),put npc (3,180,100)
end











if (timer==2020,or,timer==2030,or,timer==2040,or,timer==2050,or,timer==2060,or,timer==2070,or,timer==2080,or,timer==2090,or,timer==2100,or,timer==2110,or,timer==2120,or,timer==2130,or,timer==2140,or,timer==2150,or,timer==2160,or,timer==2170,or,timer==2180,or,timer==2190,or,timer==2200,or,timer==2210,or,timer==2220,or,timer==2230,or,timer==2240,or,timer==2250,or,timer==2260,or,timer==2270) then , begin
put npc (3,180,95),put npc (1,220,100),put npc (2,260,95)
end

if (timer==2015,or,timer==2025,or,timer==2035,or,timer==2045,or,timer==2055,or,timer==2065,or,timer==2075,or,timer==2085,or,timer==2095,or,timer==2105,or,timer==2115,or,timer==2125,or,timer==2135,or,timer==2145,or,timer==2155,or,timer==2165,or,timer==2175,or,timer==2185,or,timer==2195,or,timer==2205,or,timer==2215,or,timer==2225,or,timer==2235,or,timer==2245,or,timer==2255,or,timer==2265) then , begin
put npc (3,180,100),put npc (1,220,95),put npc (2,260,100)
end



if (timer==2390) then (change NPC ID (tyron,4))


if (timer==2390,or,timer==2394,or,timer==2398,or,timer==2402,or,timer==2406,or,timer==2410,or,timer==2414,or,timer==2418,or,timer==2422,or,timer==2426,or,timer==2430,or,timer==2434,or,timer==2438,or,timer==2442,or,timer==2446,or,timer==2450,or,timer==2454,or,timer==2458,or,timer==2462,or,timer==2466,or,timer==2470,or,timer==2474,or,timer==2478,or,timer==2482,or,timer==2486,or,timer==2490,or,timer==2494,or,timer==2498,or,timer==2502,or,timer==2506,or,timer==2510,or,timer==2514,or,timer==2518,or,timer==2522,or,timer==2526,or,timer==2530,or,timer==2534,or,timer==2538,or,timer==2542,or,timer==2546,or,timer==2550,or,timer==2554,or,timer==2558,or,timer==2562,or,timer==2566,or,timer==2570,or,timer==2574,or,timer==2578,or,timer==2582,or,timer==2586,or,timer==2590,or,timer==2594,or,timer==2598,or,timer==2602,or,timer==2606,or,timer==2610,or,timer==2614,or,timer==2618,or,timer==2622,or,timer==2626) then,begin
set NPC direction (2,east),set NPC direction (4,down)
put npc (4,253,100)
end



if (timer==2392,or,timer==2396,or,timer==2400,or,timer==2404,or,timer==2408,or,timer==2412,or,timer==2416,or,timer==2420,or,timer==2424,or,timer==2428,or,timer==2432,or,timer==2436,or,timer==2440,or,timer==2444,or,timer==2448,or,timer==2452,or,timer==2456,or,timer==2460,or,timer==2464,or,timer==2468,or,timer==2472,or,timer==24760,or,timer==2480,or,timer==2484,or,timer==2488,or,timer==2492,or,timer==2496,or,timer==2500,or,timer==2504,or,timer==2508,or,timer==2512,or,timer==2516,or,timer==2520,or,timer==2524,or,timer==2528,or,timer==2532,or,timer==2536,or,timer==2540,or,timer==2544,or,timer==2548,or,timer==2552,or,timer==2556,or,timer==2560,or,timer==2564,or,timer==2568,or,timer==2572,or,timer==2576,or,timer==2580,or,timer==2584,or,timer==2588,or,timer==2592,or,timer==2596,or,timer==2600,or,timer==2604,or,timer==2608,or,timer==2612,or,timer==2616,or,timer==2620,or,timer==2624,or,timer==2628) then,begin
set NPC direction (2,east),set NPC direction (4,up)
put npc (4,238,100)
end





if (timer==2450) then (change NPC ID (boosh,5), play sound (sfx:Wilhelm,false,true) )
if (timer==2520) then (set NPC direction (3,east), set NPC direction (5,down))
if (timer==2550) then (walk npc (3,west,10))










timer:=1+timer


#2620.8 song ends
if (timer>>2621) then (scoreboard)
wait(1)
show no value
#-V cleanup

#-^ cleanup
end,end
#-------------------------------------------------------------------------



#end of game
#-------------------------------------------------------------------------
plotscript, scoreboard, begin
stop song
show no value
if (score>>highscore) then (highscore:=score)
export globals (5,1,1)
save in slot (5)
 fade screen out
 show no value
 wait (2)
Show text box (2634)
 wait (1)
 fade screen in
 wait (10)
 fade screen out
 advance text box
timer:= 0
 show no value
teleport to map (33,41,15)
 wait (1)
 fade screen in
 wait (2)
 if (score>=1000) then (funkatronbest)
 if (score<=999, and , score >=800) then (funkatrongreat)
 if (score<=799, and , score >=600) then (funkatrongood)
 if (score<=599, and , score >=400) then (funkatronokay)
 if (score<=399, and , score >=200) then (funkatronpoor)
 if (score<=199, and , score >=1) then (funkatronbad)
 if (score <= -300) then (funkatronawful)


show no value
resume player
resume box advance
resume obstruction

end
#-------------------------------------------------------------------------

script,funkatronbest,begin
 if (checktag (tag:RagnaROCK)) then ( 
 show text box (2638)
 wait (7)
 wait for key (use key)
 advance text box) else 
( 


 tweak palette (10,0,0), update palette, play sound (sfx:EnemyDeath,false,true), teach spell ((find hero(hero:Eric)),atk:RagnaROCK), wait (10), reset palette, fade screen in, show text box (2636), wait (7), wait for key (use key), advance text box, show text box (2637), wait (7), wait for key (use key), advance text box

)
show no value
end

script,funkatrongreat,begin
 show text box (2639)
 wait (7)
 wait for key (use key)
 advance text box
show no value
end

script,funkatrongood,begin
 show text box (2640)
 wait (7)
 wait for key (use key)
 advance text box
show no value
end

script,funkatronokay,begin
 show text box (2641)
 wait (7)
 wait for key (use key)
 advance text box
show no value
end

script,funkatronpoor,begin
 show text box (2642)
 wait (7)
 wait for key (use key)
 advance text box
show no value
end

script,funkatronbad,begin
 show text box (2644)
 wait (7)
 wait for key (use key)
 advance text box
show no value
end

script,funkatronawful,begin
 show text box (2643)
 wait (7)
 wait for key (use key)
 advance text box
show no value
end





script,OmegaWEAPON,begin
 suspend player
 suspend box advance
 swap by position (0,find hero (hero:Night))
 swap by position (1,find hero (hero:Renard))
 swap by position (2,find hero (hero:Freki))
 swap by position (3,find hero (hero:Frumpy)) 
 set caterpillar mode (on)
 set hero position (1,14,12)
 set hero position (2,14,12)
 set hero position (3,14,12)
 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 (2645)
 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 (2646)
 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 (2647)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 greyscale palette

 teleport to map (62,14,18)
 focus camera (14,12,4)
 wait for camera
 wait (5)
 fade screen in

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

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

 show text box (2650)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (63,63,63)
 update palette
 wait (1)
 reset palette
 wait (1)
 greyscale palette
 update palette
 show text box (2666)
 wait (7)
 wait for key (use key)
 advance text box

 walk NPC (14,right,2)
 wait for NPC (14)
 set NPC direction (14,down)
 show text box (2651)
 wait (7)
 wait for key (use key)
 advance text box

 walk NPC (16,down,1)
 set NPC direction (16,up)
 walk NPC (17,down,1)
 set NPC direction (17,up)
 walk NPC (15,down,1)
 set NPC direction (15,up)
 wait for NPC (15)
 show text box (2667)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (14,down,2)
 show text box (2668)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2669)
 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 (2652)
 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 (2653)
 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 (2654)
 wait (7)
 wait for key (use key)
 advance text box

 show text box (2655)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out (63,63,63)
 wait (40)
 greyscale palette
 fade screen in
 create npc (18,14,13,down)
 set NPC direction (15,down)
 set NPC direction (16,right)
 set NPC direction (17,left)
 show text box (2656)
 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 (2657)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (15,right)
 wait (2)
 set NPC direction (15,up)
 wait (2)
 show text box (2658)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (14,left)
 show text box (2670)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2671)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (14,up)
 show text box (2672)
 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 (2659)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2660)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2661)
 wait (7)
 wait for key (use key)
 advance text box

set NPC direction (14,left)
 wait (2)
 set NPC direction (14,down)
 show text box (2673)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2674)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (15,up,1)
 show text box (2675)
 wait (7)
 wait for key (use key)
 advance text box











 wait (2)
 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)
 wait (2)
 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)
 wait (2)
 set NPC direction (2,left)
 set NPC direction (3,left)
 set NPC direction (4,left)
 set NPC direction (5,left)
 set NPC direction (6,left)
 set NPC direction (7,left)
 set NPC direction (8,left)
 set NPC direction (9,left)
 set NPC direction (10,left)
 set NPC direction (11,left)
 set NPC direction (12,left)
 set NPC direction (13,left)
 wait (15)

 fade screen out
 reset palette
 wait (1)

 teleport to map (9,14,18)

 camera follows hero
 set hero position (me,14,12)
 set hero position (1,13,13)
 set hero position (2,14,13)
 set hero position (3,15,13)

 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 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 (2662)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,left)
 wait (2)
 set Hero direction (me,down)
 wait (2)
 show text box (2663)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,left)
 wait (2)
 set hero direction (me,up)
 show text box (2664)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2665)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (63,63,63)
 update palette
 wait (1)
 reset palette
 wait (1)
 update palette
 show text box (2676)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (2,left)
 wait (2)
 set hero direction (1,left)
 set hero direction (2,right)
 set hero direction (3,down)
 wait (5)
 tweak palette (63,63,63)
 update palette
 wait (1)
 reset palette
 wait (1)
 update palette
 wait (2)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 wait (1)
 tweak palette (63,63,63)
 update palette
 create npc (14,14,11,down)
 wait (1)
 reset palette
 wait (1)
 update palette

 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)

 show text box (2678)
 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 (2679)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 focus camera (14,13,4)
 wait for camera
 show text box (2680)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 walk hero (me,left,1)
 walk hero (1,down,1)
 walk hero (2,up,1)
 wait for hero (2)

 set hero direction (1,up)
 set hero direction (me,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 text box (2681)
 wait (7)
 wait for key (use key)
 advance text box
 wait (2)
 set NPC direction (14,left)
 wait (2)
 set NPC direction (14,up)
 wait (3)

 show text box (2682)
 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 (2683)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)

 show text box (2684)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (14,left,10)
 wait (10)
 set hero direction (me,left)
 set hero direction (1,left)
 set hero direction (2,left)
 set hero direction (3,left)
 wait for NPC (14)

 set NPC position (14,14,20)
 wait (2)
 walk NPC (14,up,6)
 wait (10)
  set hero direction (me,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 wait for NPC (14)
 walk hero (2,right,1)
walk hero (3,down,1)
 set hero direction (me,down)
 set hero direction (1,down)
 set hero direction (2,down)
 set hero direction (3,down)
 walk NPC (14,up,3)
 set hero direction (me,right)
 set hero direction (1,right)
 set hero direction (2,left)
 set hero direction (3,left)
 wait for NPC (14)
 set hero direction (me,up)
 set hero direction (1,up)
 set hero direction (2,up)
 set hero direction (3,up)
 show text box (2685)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (14,left)
 wait (2)
 set NPC direction (14,down)
 wait (2)
 show text box (2690)
 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 (2686)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2687)
 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 (2688)
 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 (2689)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 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 (2694)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2695)
 wait (7)
 wait for key (use key)
 advance text box


 boss introduction
 fight formation (311)
 
 tweak palette (10,0,0)
 update palette
 play sound (sfx:earthquake,false,true)
 teach spell ((find hero(hero:Night)),atk:Meteor)
 wait (3)
 reset palette
 update palette
 show text box (2691)
 wait (7)
 wait for key (use key)
 advance text box
 tweak palette (0,0,10)
 update palette
 play sound (sfx:laser gun,false,true)
 teach spell ((find hero(hero:Frumpy)),atk:Miracle)
 wait (3)
 reset palette
 update palette
 show text box (2692)
 wait (7)
 wait for key (usekey)
 advance text box

 tweak palette (0,10,0)
 update palette
 play sound (sfx:Death,false,true)
 teach spell ((find hero(hero:Bram)),atk:TimeStop)
 wait (10)
 reset palette
 fade screen in
 show text box (2768)
 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 (2693)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (14,left)
 wait (2)
 set NPC direction (14,up)
 wait (2)
 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 (2696)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2697)
 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 (2698)
 wait (7)
 wait for key (use key)
 advance text box
 set NPC direction (14,left)
 wait (2)
 set NPC direction (14,down)
 wait (2)
 show text box (2699)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (14,down,1)
 wait for NPC (14)
 show text box (2700)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out (63,63,63)
 wait (5)
 set tag (tag:defeatsery,on)
 wait (5)
 fade screen in
 show text box (2701)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (5)
 set hero position (me,14,13)
 camera follows hero (me)
 resume NPCs
 resume player
 resume box advance
 resume caterpillar
 set caterpillar mode (off)
 wait (2)
 fade screen in
end

script,OmegaWEAPONfinal,begin
 suspend player
 suspend box advance
 walk NPC (18,up,1)
 wait for NPC (18)
 wait (3)
 set NPC direction (18,left)
 wait (3)
 set NPC direction (18,down)
 wait (3)
 tweak palette (63,63,63)
 play sound (sfx:SmallExplosion8bit,false,true) 
 update palette
 wait (1)
 reset palette
 update palette
 wait (10)
 tweak palette (63,63,63)
 play sound (sfx:SmallExplosion8bit,false,true) 
 update palette
 wait (1)
 reset palette
 update palette
 wait (10)
 tweak palette (63,63,63)
 play sound (sfx:MediumExplosion8bit,false,true) 
 update palette
 set tag (tag:OMEGA,on)
 wait (1)
 reset palette
 update palette
 wait (10)
 boss introduction
 fight formation (69)
 wait (5)
 show text box (2730)
 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 (2707)
 wait (7)
 wait for key (use key)
 advance text box
  show text box (2708)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2709)
 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 (2710)
 wait (7)
 wait for key (use key)
 advance text box
  show text box (2711)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2712)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 stop song
 show text box (2713)
 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 (2714)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2715)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out
 wait (2)
 show text box (2716)
 wait (7)
 fade screen in
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2717)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2718)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2719)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2720)
 wait (7)
 wait for key (use key)
 fade screen out
 advance text box
 wait (3)
 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 (2721)
 wait (7)
 wait for key (use key)
 advance text box
show text box (2722)
 wait (7)
 wait for key (use key)
 advance text box
show text box (2723)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (me,left)
 wait (5)
 set hero direction (me,down)
 wait (5)
show text box (2724)
 wait (7)
 wait for key (use key)
 advance text box
show text box (2725)
 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 (2726)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2727)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2728)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2729)
 wait (7)
 wait for key (use key)
 advance text box
 wait (3)
 show text box (2731)
 wait (7)
 wait for key (use key)
 advance text box
 resume box advance
 resume player
end


Script, Enherdesert,begin
 suspend player
 suspend box advance
 fade screen out
 stop song
 wait (5)
 set hero position (me,9,7)
 wait (5)
 fade screen in
 focus camera (9,12,2)
 walk NPC (18,down,1), wait for NPC (18)
 show text box (2799)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2800)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (18,right)
 show text box (2801)
 wait (7)
 wait for key (usekey)
 advance text box

 set NPC frame (19,1)
 wait (1)
 set NPC frame (19,0)
 wait (1)
 set NPC frame (19,1)
 wait (1)
 set NPC frame (19,0)
 wait (1)
 show text box (2802)
 wait (7)
 wait for key (usekey)
 advance text box
 play sound (sfx:Fart,false,true) 


#16 Tri 17 Kyle 18 Dog 19 HM


 set NPC frame (18,1)
 wait (1)
 set NPC frame (18,0)
 wait (1)
 set NPC frame (18,1)
 wait (1)
 set NPC frame (18,0)
 wait (1)
 show text box (2803)
 wait (7)
 wait for key (usekey)
 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 (2804)
 wait (7)
 wait for key (usekey)
 advance text box
walk NPC (18,right,1), wait for NPC (18)
 show text box (2805)
 wait (7)
 wait for key (usekey)
 advance text box
	wait (10)
 show text box (2806)
 wait (7)
 wait for key (usekey)
 advance text box

 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2807)
 wait (7)
 wait for key (usekey)
 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 (2808)
 wait (7)
 wait for key (usekey)
 advance text box
 set hero direction (17,right)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2809)
 wait (7)
 wait for key (usekey)
 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 (2810)
 wait (7)
 wait for key (usekey)
 advance text box

 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2811)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (17,down)
 show text box (2812)
 wait (7)
 wait for key (usekey)
 advance text box
 show text box (2813)
 wait (7)
 wait for key (usekey)
 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 (2814)
 wait (7)
 wait for key (usekey)
 advance text box
set NPC direction (17,right)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2815)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC frame (18,1)
 wait (1)
 set NPC frame (18,0)
 wait (1)
 set NPC frame (18,1)
 wait (1)
 set NPC frame (18,0)
 wait (1)
 show text box (2816)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (17,down), wait (5), set NPC direction (17,left)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2817)
 wait (7)
 wait for key (usekey)
 advance text box

 set NPC direction (19,right)
 set NPC frame (19,1)
 wait (1)
 set NPC frame (19,0)
 wait (1)
 set NPC frame (19,1)
 wait (1)
 set NPC frame (19,0)
 wait (1)
 show text box (2818)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2819)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC frame (18,1)
 wait (1)
 set NPC frame (18,0)
 wait (1)
 set NPC frame (18,1)
 wait (1)
 set NPC frame (18,0)
 wait (1)
 show text box (2820)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC direction (17,down), wait (5), set NPC direction (17,right)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2821)
 wait (7)
 wait for key (usekey)
 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 (2822)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2823)
 wait (7)
 wait for key (usekey)
 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 (2824)
 wait (7)
 wait for key (usekey)
 advance text box
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2825)
 wait (7)
 wait for key (usekey)
 advance text box
 wait (5), set NPC direction (17,down), wait (5)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 set NPC frame (17,1)
 wait (1)
 set NPC frame (17,0)
 wait (1)
 show text box (2826)
 wait (7)
 wait for key (usekey)
 advance text box

 set tag (tag:EINSAND,on)

 fade screen out
 wait (5)
 play song (get ambient music)
 set hero position (me,10,52)
 camera follows hero (me)
 resume NPCs
 resume player
 resume box advance
 resume caterpillar
 set caterpillar mode (off)
 wait (2)
 fade screen in
end

script,HildaValia,begin
 suspend player
 suspend box advance
 swap by position (0,find hero (hero:Hilda))
 swap by position (1,find hero (hero:Olaf))

 set caterpillar mode (on)
 set hero position (1, 94, 5)
 set hero position (2, 6, 9)
 set hero position (3, 6, 9)
 wait (1)
 suspend caterpillar
 walk hero (1,left,1)
 wait for hero (1), set hero direction (1,down)
focus camera (91,8,4)
 wait for camera
 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 (2827)
 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 (2828)
 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 (2829)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2830)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (1,right)
 show text box (2831)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2832)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2833)
 wait (7)
 wait for key (use key)
 advance text box
 set hero direction (1,down), set hero direction (0,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 (2834)
 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 (2835)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2836)
 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 (2837)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2838)
 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 (2839)
 wait (7)
 wait for key (use key)
 advance text box
 wait (4)
 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 (2840)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 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 (2841)
 wait (7)
 wait for key (use key)
 advance text box
 wait (10)
 show text box (2842)
 wait (7)
 wait for key (use key)
 advance text box
 wait (5)
 set hero direction (1,right), set hero direction (0,left)
 wait (15)
 set hero direction (1,down), set hero direction (0,down)
 bossintroduction
 fight formation (313)

 tweak palette (0,10,0)
 update palette
 play sound (sfx:Death,false,true)
 teach spell ((find hero(hero:Hilda)),atk:杼aliant)
 wait (10)
 reset palette
 fade screen in
 show text box (2843)
 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 (2844)
 wait (7)
 wait for key (use key)
 advance text box

walk hero (1,right,1)
 wait for hero (1)




focus camera (94,5,4)
 wait for camera
 camera follows hero (me)
 wait (1)
resume caterpillar
 set caterpillar mode (off)
 wait (1)
 resume box advance
 resume player

end 

script,Linnorm,begin
 suspend player
 suspend box advance
 play sound (sfx:Roar,false,true)
 wait (4)
 bossintroduction
 fight formation (314)


 set tag (tag:LINNORM,on)

 swap by position (0,find hero (hero:Styrge))

 tweak palette (0,10,0)
 update palette
 play sound (sfx:TornadoMagic,false,true)
 teach spell ((find hero(hero:Styrge)),atk:Drakedoom)
 wait (10)
 reset palette
 fade screen in
 show text box (2845)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2846)
 wait (7)
 wait for key (use key)
 advance text box
 resume player
 resume box advance
end

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

 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 (2851)
 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 (2852)
 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 (2853)
 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 (2854)
 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 (2855)
 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 (2856)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2857)
 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 (2858)
 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 (2859)
 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 (2860)
 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 (2861)
 wait (7)
 wait for key (use key)
 advance text box
 walk NPC (24,left,1)
 walk hero (me,left,1), wait for hero (me)
 walk NPC (24,right,2)
 walk hero (me,right,2), wait for hero (me)
 walk NPC (24,left,1), set NPC direction (24,right)
 walk hero (me,left,1), wait for hero (me)
 


 tweak palette (10,0,0)
 update palette
 play sound (sfx:Slash8Bit,false,true)
 teach spell ((find hero(hero:Kitt)),atk:固ripleCut)
 wait (10)
 reset palette
 fade screen in
 show text box (2862)
 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 (2863)
 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 (2864)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2865)
 wait (7)
 wait for key (use key)
 advance text box
 show text box (2866)
 wait (7)
 wait for key (use key)
 advance text box
 fade screen out (63,63,63)
 wait (5)
 set tag (tag:Threecut,on)
 wait (5)
 fade screen in
 resume player
 resume box advance
end