
; Copyright 1999-2000 (c) Synthetic Reality Co.
; http://www.synthetic-reality.com
; All Rights Reserved
;
; This is an example Well of Souls Script File
;
; The format is not very forgiving, and the documentation is what you see here, so my
; very best of luck to you getting it to work!
;
; For a more detailed bit of documentation, please visit the web site at http://www.synthetic-reality.com/wosDev0.htm
; and check out the QUEST DICTIONARY.
;
; Comment lines must BEGIN with a semi-colon
; Most non-comment lines start with a KEYWORD, which might have some ARGUMENTS
; Some keywords announce the beginning of a new section.  A plus sign marks
; the beginning of a section, a minus sign marks the end, as in:
;
; +SECTIONNAME
; <obj#1>
; <obj#2>
; -SECTIONNAME
;
; Sections can appear in any order, but here are the current section names:
;
;  CREDITS			// documentation of the world's authors
;  STORY			// Background story which scrolls by at start
;  TERRAINS			// your names for the terrain possibilities (water, lava, etc)
;  MAPS				// descriptions (file names) of the available maps
;  TOKENS			// tokens which keep track of player achievements
;  ELEMENTS			// your definitions of the 8 elements
;  HANDS			// your definition of the 'right-hand-weapons' classes
;  ITEMS			// stuff (equipment, potions, bonus items, etc.)
;  SPELLS			// spells that can be cast, and their effects and appearance
;  MONSTERS			// Monsters you can encounter, their skills and appearance
;  GROUPS			// monster groupings (which are found together in which combo)
;  LEVELS			// Hero experience level switch points and names
;  SCENES			// scripted dialog to advance plot
;  EQUIP			// Names of the non-hand Equipment items, in case your world needs them
;  THEMES			// Ambient background sound themes for your world
;
; The #include "filename" command lets you break everything up into pieces, so you will
; see that many of the above sections are actually presented in separate files, such
; as "items.txt", "spells.txt", "levels.txt" etc.  This file ("quest.txt") then uses
; "#include" to make it appear as it the other file's contents were actually part of
; quest.txt itself.
;
; Note to players:  Don't read this until you have finished playing the world, as this
; cannot possibly enhance your experience and will no doubt rob you of small pleasures.
;
;
;
;
;----------------
; CREDITS section
; This is the script file for the world 'Evergreen'
; Here is where you should make an effort to compliment anyone who
; contributed to your world.  These credits are not yet automatically
; shown, but will be someday...

+CREDITS
Castle Adventure

by Daniel Troyer (Dynasty)
-CREDITS


;
;--------------
; STORY Section
; This has the 'back story' which scrolls by at the very beginning.  Most people will
; skip over this.  
; a line of text beginning with | will be centered, otherwise text is left-justified.
; Each line of text will be its own paragraph, which will word-wrap nicely (we hope)
; within paragraphs.
; don't be TOO long-winded here or people will get irritated.
; note that leading spaces in a paragraph are significant and would cause the first line
; to be indented.
;
; Special commands, one per line, control text which follows
;
; :C red,green,blue			set text color (as in ":C 255,0,0" for bright red)
; :S size					set text size  (200 is 'normal')
; :F fontName				set text font name  (use ":F  " to restore default font
;
; Note: There is a long pause just after the world is selected and before the scrolling back-story
; appears.  Normally the screen would just be black at this time.  However, you can add a file to
; your world's ART folder called "splash.jpg"
;
; If "worlds\myworldname\art\splash.jpg" exists, then that image will be displayed statickly during
; the lengthy map-loading delay.  You can't control how long the splash will be seen, however.  It
; will be seen longer on slower computers.

+STORY
:S 200
:C 255,255,0
|Castle Adventure
:S 75
:C 255,255,255
|by Daniel Troyer (Dynasty)
:S 100
:C 204,153,0
Suddenly ........ you awaken. You gasp, as if you have just walked out of a daze and you struggle to keep the pieces of your memory together. But you struggle in vain, for it quickly fades as if sand slipping through your fingertips, until you come to realize that you don't even remember your own name. 
Looking around in bewilderment, you find yourself in the center of what appears to be a castle courtyard. To the south is a massive iron door, to the north, a large archway.
You head to the iron door, trying to search for an opening, but upon looking closer, you discover it has three massive locks, all of which requiring a different key. Your only clue is a message etched into the stone of the castle wall reading, "Seek the Scepter." 
In order to find the keys and escape the castle, you must journey onward into its depths, and perhaps recover your memory as well....
-STORY

;---------------------
; TERRAINS Section
; Up to 10 terrains (0-9) may be defined and then 'painted' onto maps.  Characters must
; possess the correct equipment to cross certain terrains.  Terrain 0 is always cross-able
; by all characters.
;
;	arg0	the terrain ID  0-9
;   arg1	the name of the terrain (keep it short, it shows up on the terrain editor palette)
;	arg2	the damage inflicted on a character when walking on this terrain (negative heals)
;			NOTE: terrain damage not yet implemented.
;
+TERRAINS
;	arg0		arg1			arg2
;
	0,		"No Hindrance",		0
	1,		"Lava",			10
	2,		"Electricity",		10
	3,		"Fairy",		0
	4,		"Hidden",		0
	5,		"Clouds",		0
	6,		"Vampyr",		0
	7,		"Mirror",		0
	8,		"Healing",		-10
	9,		"Impassable",		0
-TERRAINS



;---------------------
; EQUIP names section
;
; This section is completely optional.  You only need it if you want to have different
; names for the standard equipment classes.
;
;  arg 0 	the equip ID (must be one of the following numbers):
;
;  				0	// "Helmet"
;  				1	// "Armor"
;  				10	// "Boots"
;  				11	// "Shield"
;  				12	// "Ring"
;  				13	// "Amulet
;
;  arg1		the name for that class of item.  (Keep it short as it gets used in a lot of cramped places.)
;

+EQUIP
;	arg0		arg1
;	ID		Name

  	0,		"Helmet"
 	1,		"Armor"
 	10,		"Boots"
 	11,		"Shield"
 	12,		"Ring"
 	13,		"Amulet
-EQUIP



;--------------------
; THEMES section
;
; This section allows you to extend the sound themes available within your scenes.	A sound theme
; consists of a single looped sound (played over and over for as long as the theme is in progress)
; and one or more one-shot sounds (played at random intervals).
;
; arg0 ID (1-255)	(note that these override the built-in themes, so avoid using the low numbered
;					themes if you want to keep the built-in themes available
;
; arg1 name			this is just your friendly name for the theme
;
; arg2 loopSound	The name of the .wav file to be looped.  Do not include the .wav extension here, as
;					it is assumed.  The sound effect file is expected to be in your world's SFX folder, and
;					if not found there, the WoS/SFX folder is checked next.  This sound is optional, but
;					if you leave it out, don't forget to leave the comma where it would have been.
;
; argN oneshots		One or more single-shot sounds may be defined.  These are defined with the format
;					"seconds=sound" as in: "10=splash" meaning: play the splash sound about every 10 seconds
;					on average, but randomly.  You should adjust the seconds field until you get the sound
;					you like.  You will need to adjust the timing, volume, and number of single-shots until
;					you get a sound you like.

+THEMES
;	arg0	arg1		arg2			arg3 - N
;	ID		name		loopSound		seconds=sound
;
;	note: reserve first 20 for the hard-coded themes (also note that 0 means 'silence')
;
	20,		cavedrip,	campfire1,		10=drip1,10=bird1,10=splash1
;
-THEMES

;--------------------
; MAPS section
;
; Each map in the world (world, city, cave, etc.) needs an entry in this table
; Map 0 is always the main world map.
;
; As of release A77, you may now have 1000 maps (0-999)
;
;  Each map needs the following arguments:
;
;	arg0	the map ID (0-999)  0 is main world map  Link points are via map numbers
;
;	arg1	the image file name of the map (a JPG usually, but RLE BMP is OK)
;
;	arg2	the OBL file name for the map (which places link point objects on that map
;			Note: if a terrain file exists, it must share the same name, so do NOT
;			put an extension on the file name.  "iceland" would indicate both
;			"iceland.OBL" and "iceland.TER" (and possibly other files as development
;			continues.  The OBL and TER files are created when you use the map editor.
;			You are primarily responsible for generating the image file (JPG).
;			This is also the root name of the MIDI music file played when wandering
;			That map. (music files should be in the world or root MIDI folder)
;
;	arg3	The map name.  This appears briefly as the user changes maps.
;
;   arg4	The Map FLAGS. This is a number, containing several flags, which controls
;			specific behaviours of players while on a map.  Add together the values
;			of each flag you want and then set the map flags to that value.  For example,
;			if you want both flag 2 and flag 4, then set the map flags to "6"
;
;		As of release A77, you can use hexadecimal values for the map flags (start the number with 0x)
;               If you don't know what this means, just add the decimal values together for the combo you want
;
;           	The flag values are:
;
;		DECIMAL		HEX		MEANING, WHEN INCLUDED
;
;		1		0x00000001	// enables pet vs pet battles (but protects players from pets)
;		2		0x00000002	// enables pets to be used against other players or pets (if pkers or no safehaven)
;		4		0x00000004	// enables "no protection from PKer"
;		8		0x00000008	// enables "no PKing allowed here at all"
;		16		0x00000010	// enables "LADDER" reporting. (PK kills on this map are reported to ladder server)
;		32		0x00000020	// enables "show all link names." 
;							// Normally link names are hidden until after first use of link.
;		64		0x00000040	// disables "Shadows" under heroes (and monsters) on map and in scenes of that map.
;		128		0x00000080	// disables the use of pets (cannot summon them) on this map.
;		256		0x00000100	// disables eavesdropping to and from players on this map.  
;							// (you can still whisper, shout, etc.)
;		512		0x00000200	// designates the map a GUILD HALL map.  (not sure what this means yet...)
;		1024	0x00000400	// Prevents Humans from being able to damage monsters or pets
;		2048	0x00000800	// NO_REWARD.  After a fight, no GP, XP or items are found to reward the survivors
;							// Pets still get rewarded, coz I am a big softy
;		4096	0x00001000	// NO_HEAL.  Heal spells and items provide only 1HP of sustenance.
;		8192	0x00002000	// NO_TICKETS.  Tickets won't work here
;		16384	0x00004000	// NO_MINI_MAP. upper right minimap is uninformative here
;		32768	0x00008000	// NO_STUN.  the non-buff disease spells will not work here 
;							// (stun, sleep, paralyze, etc.)
;		65536	0x00010000	// NO_BUFF.	the buff/debuff disease spells will not work here.
;		131072	0x00020000	// NO_PKREZ. PKers cannot use resurrection spells on others
;       262144	0x00040000	// MAP_FLAG_HIDE_LINKS. don't show white link boxes on minimap until visited
;	    524288  0x00080000	// MAP_FLAG_NO_WAYPOINTS disable automatic waypoint calculations (good for mazes)
;
;	arg5	The map Sound Theme 0 (none) - 255 (see THEME table for making your own themes)
;			If you provide this argument, it picks a sound theme which will be played while the player is walking
;			on the map (not inside a scene of that map, though you might want a common theme.)  Note that you 
;			cannot have multiple themes on one map.

;
; FOR EXAMPLE:
;
;	arg0	arg1				arg2				arg3						arg4			arg5
;	ID		image file			OBL/TER/MID	root	Map Name (seen by player)	Map FLAGS		Map Theme
;
;	0,		wormCave.jpg,		wormCave,			"Wyrm Cavern",				0,			0
;	5,		town2.jpg,			westin,				"Westin",					0,			3
;	6,		town3.jpg,			stonetree,			"Stonetree",				0,			0

+MAPS

;
; The actual map definitions are in this file, which is created by the New World Wizard:
;
#include maps.txt

-MAPS


;--------------------
; Tokens are used by the script engine to keep track of what the player has accomplished.
; Each token is just a number, in the range 1-4095
;
; When you design your quest, assign a token to each major phase of the quest.  For
; example, at the start of the game, the player has no tokens.  But after you have
; told them the nature of a puzzle, you would give the player the token which
; represents that puzzle.  That way, when the player returns to the same scene, the
; script engine sees that he already has the token and hence doesn't repeat the
; explanation (but perhaps gives a short recap reminder instead).  Once the player
; has completed the quest (killed the dragon, etc.) you give him a different token.
; If the player already has the final token for a quest, then the script engine
; can simply skip the whole thing, or just deliver a 'thank you' message.
;
; This example uses the least significant digit to identify the tokens (up to 10) 
; which belong to a single quest, and the higher digits as a 'quest #' (for
; example, token 47 would be token #7 of quest #4).  This is completely arbitrary
; and you are allowed to use token numbers in any order you like.
;
; For example, let's pretend there is a minor quest which requires killing a dragon.
; The tokens might be:
;
;  token 1  - the king has told me to kill the dragon
;  token 2  - I have killed the dragon
;  token 3  - I have returned to the king and gotten my reward
;
; Then the script file for the king's throne room might look like this:
;
;  IF T1  @alreadyToldHim
;    'Hello young man, please kill the dragon for me
;    GIVE T1
;  END
;
;@alreadyToldHim
;  IF T3  @alreadyRewardedHim
;    'Thank you for killing the dragon, here is some gold
;    GIVE G100
;    'And here is my silver ring of dependability
;    GIVE I43
;    GIVE T3
;  END
;
;@alreadyRewardedHim
;  'Hey, I already GAVE you the ring of dependability!  Get out of here!
;  END
;
;------------------------------------------------------------------------------------
; You don't have to have a token defined in this section to use it in the script,
; But you will probably find it easier to keep track of things if you do.  Also,
; I use the decriptions you give here to create a 'log book' the player can read
; to review what they have done so far.
;
; You may find it easiest to write the outline of your quests in this section first,
; and not flesh out the actual scenes until the entire structure of the world has
; been defined.

+TOKENS
	1,"Accepted the Priest's aid"
	2,"Received a Pet"
	3,"Jei has informed you of the Fairy Queen"
	4,"Met the Fairy Queen's guards"
	5,"Defeated the Spider and aquired the Magic Wand"
	6,"Used the Magic Wand to get frighten the Fairy Queen's guards"
	7,"Defeated the Dragon and aquired the Harp"
	8,"Recieved the Golden Chalice from the Fairy Queen"
	9,"Aquired Sanctified Water from the Fountain"
	10,"Defeated the Shade and aquired the Holy Cross"
	11,"Repeled the Vampire"
	12,"Defeated the Cerberus and found the First Key"
	13,"Defeated the Golem and found the Second Key"
	14,"Defeated the Snake and aquired the Lantern"
	15,"Met Jei"
	16,"Jei has informed you of the Necklace"
	17,"Defeated your Doppelganger and aquired the Necklace"
	18,"Defeated the Bat and aquired the Glasses"
	19,"Found the Book of Keys"
	20,"Read about Dynasty's Lairs"
	21,"Found the Key to the Dungeons"
	22,"Defeated the Necromancer and found the Third Key"
	23,"Vanquished Death"
	24,"Escaped the Castle"
	25,"Discovered you have a Sister"
	26,"Jei has informed you about The Void"
	27,"Vanquished The Void"
	28,"Witnessed Jei's Death"
	29,"Told Diana about Jei"
	30,"You have received the Ring of Dynasty from Jei"
	31,"Defeated 100 souls and learned the spell Stun"
	66,"Discovered Dynasty's first Lair"
	67,"Discovered Dynasty's second Lair"
	68,"Defeated Dynasty"
-TOKENS


;---------------------
; ELEMENTS Section
; 
; Every world has exactly 8 'elements' which you must define (or terrible things will happen..
; woe is you!)  The 8 elements form a circle which describes their effectiveness against
; each other.  The opposing element is most effective against an element.
;
; Visualize the IDs like this (many thanks to Janne Jaula for this):
;
;         0
;      7  |  1
;       \ | /
;    6 ---+--- 2
;       / | \
;      5  |  3
;         4
;
; With ID 0 at the NORTH position.  This must be your 'healing' spell. and will apply healing
; equally to all characters, independent of their element affinities.
;
; The rest of the elements wield pain according to their position on the chart with element 1, 
; for example, delivering the most damage to element 5, somewhat less to 4 and 6, and a little to 7 and 3
; while hardly any to 0 1 and 2.
;
; It is likely that element 4 (the opposite of 0) will also be singled out for some special
; effect in the future... the element table is new :-)
;
;	arg0	the element ID  0-7
;   arg1	the name of the Element (keep it short, it shows up on the element affinity chart)
;									(also if the first letter could be unique, it would help)
;
; Note: you can actually use element IDs from 8-255 as well, with Spells and Monsters.  But you cannot
; name those elements (they all show up as "chaos" elements)
;
+ELEMENTS
;	arg0	arg1				
;
	0,		"Hope"		
	1,		"Ice"		
	2,		"Body"		
	3,		"Earth"		
	4,		"Doom"		
	5,		"Fire"		
	6,		"Soul"		
	7,		"Air"		
-ELEMENTS

;-----------------------
; HANDS section
;
; Similar to elements, the 'hand' classes represent the different styles of
; weapons which can be held in the 'right-hand.' The EQUIP screen allows the
; player to train themselves in these 8 categories.  Only after they reach
; level 5 in a category are they able to wield weapons of
; that category.  
;
;	arg0	The ID of the 'hand' which strangely enough is numbered 0-7 even though
;			elsewhere it is referred to as 1-8, so I expect to needlessly confuse
;			you about this.
;	arg1	The name of the weapon class.  
;	arg2	The 'range' of the weapons class.  This should be a number in the range
;			0-100 which represents the distance at which EQUIP attacks WILL NOT MISS. A
;			small range circle will be drawn at your feet when you have the EQUIP
;			list selected and it is your turn to fight.
;   arg3    The sound effect to be played when this hand attacks, unless the equipped item
;			has its own sound effect.  If neither the hand nor the weapon has a specified
;			sound effect, one is selected at random each time you load the world.
;
; 	arg0	arg1
;	ID		Name

+HANDS
;  
; arg0		arg1		            arg2		arg3
;  ID		Name		            Range		SoundFX
;
	0,		"Blade",	    		40,		    "sword1.wav"
	1,		"Staff",            70,			"staff.wav"
	2,		"Bow",		        100,		"sword8.wav"
	3,		"Music",	            50,			"chirp4.wav"
	4,		"Fist",		        30,			"fist.wav"
	5,		"Darts",		        80,			"dart.wav"
	6,		"Book",		        60,			"chant6.wav"
	7,		"Relic",         	90,			"crow1.wav"
-HANDS


+ITEMS

; The actual item definitions, and documentation, are in this file:
#include items.txt

-ITEMS


+SPELLS

; actual spell definitions, and documentation, are in this file:
#include spells.txt

-SPELLS


+MONSTERS

; actual monster definitions, and documentation, are in this file:
#include monsters.txt

-MONSTERS


+GROUPS

; actual groups, and documentation, are in this file
#include groups.txt

-GROUPS


+LEVELS

; actual character classes, levels, and documentation are in this file
#include levels.txt

-LEVELS



;-------------------
; Individual Scenes (each needs a unique scene number)
;
; Reserved Scene numbers are:
;
;   0	Well of Souls (primary well for your main map)
;   1   General CAMP scene (inherits jpeg, theme from closest link)
;   2   General FIGHT scene (inherits jpeg, theme, and monster level from closest link)

; For a more detailed bit of documentation, please visit the web site at http://www.synthetic-reality.com/wosDev0.htm
; and check out the QUEST DICTIONARY.

; Scene Command Overview
;
; A scene consists of a series of scene commands.  The first command of a scene must be the
; "SCENE" command which assigns it a unique id number and some initial settings.  The final
; command must be an "END" command which terminates the scene (otherwise, the first command
; of the following scene would be executed and that would probably be a bad thing)
;
; For example:
;
;	SCENE	<scene number><jpg><type><title>
;     a command
;     another command
;     and the command after that
;	END		<end of scene, personal magic and item use may begin>
;
; While a scene is executing, the player cannot do normal fighting actions, nor use
; items or spells in general.  Link points on the map can be bound to specific scene
; (by ID number) and that starts execution of the scene.  After the first "END" command
; is executed, the scene is over, but the player is left in the scene viewing it in its
; final state.  At that point the player may use items, magic, and possibly fight other
; players.
;
; Please see example scenes in this file for a more intuitive understanding of how scenes
; work.
;
; The following is a list of available scene commands and their usage
;
;-----------
;	THEME	<sound Theme> (if no number given, then use theme from link point)
;			0:			// stop ambient sounds
;			1:			// near a bubbling brook
;			2:			// rain storm
;			3:			// windy aerie
;			4:			// light wind
;			5:			// waterFall
;			6:			// campfire
;			7:			// Raging Fire
;			8:			// Birds
;
; This command turns on and off the background ambient sound effects in the scene. (the initial
; theme can be started automatically as part of the SCENE command)
;			
;-----------
;	MUSIC	<midi file>
;
; This command changes the currently-playing background MIDI music file.  The game  looks first
; in the current world's MIDI folder for a file of the name given.  If not found, it looks in the
; root WoS\MIDI folder for the file.
;
; To turn music off, try to play a file whose name does not exist.
;
;-----------
;	SOUND	<WAV file>
;			as in:  SOUND "mySound.wav"
;
; This command causes the WAV file in the current world's SFX folder to be played (one time)
;
;-----------
;	BKGND	<JPEG file>
;			as in:  BKGND "myBackground"
;
; This command causes the scene's background jpeg to switch. Note that the background
; specified in the SCENE command will be shown first, so if you need to avoid a flash
; of the default background before you determine (via tokens) which background is
; appropriate, be sure to set the default background to something like all black, or 
; whatever works for your world.
;
; New to A76 - WIDE SCENES.  In either the SCENE command or the BKGND command, you can now specify
; an optional WIDTH and HORIZON setting.  For example, if you said the jpeg name was "cave.300.25" that
; would mean "use the file cave.jpg for the background, but it is actually 3x normal width, and the horizon is
; at 25% from the top"  This would limit characters from walking above the bottom 75% of the screen (use 0
; for unrestricted motion).  Since the background was 300% of normal, it could not all be seen at the same
; time.. you would have to walk a long time to cross it all.  And you won't be able to see everyone in the
; scene at the same time.  Hence there is the concept of the CAMERA which attempts to focus the display on
; the most important thing happening.  These rules are complicated and vary with fighting and chatting.
;
;-----------
;	WEATHER	<Weather ID#>
;			as in:  WEATHER 9
;
; This command causes the scene's weather to change
;
;-----------
;	FX	<FX ID #>
;			as in:  FX 2
;
; This command causes the scene's FX to change
;
;-----------
; @labelName
;
; Starting a line of a scene with an @ symbol makes that line a 'label.'  Several commands
; allow you to jump to a labeled line of a scene in an effort to loop, or perform different
; actions based upon the player's circumstances.
;
; Note: the label must be on a line by itself - do not place other scene commands on the same
; line

;-----------
;	GOTO	<labelName>
;
; This command immediately jumps to the specified label and then executes the script command
; on the following line.  Be careful about unintentionally creating infinite loops. Spaces are
; not allowed in label names.  Just use letters and numbers with a single @ in front
;
; For example:
;
;     SCENE <arguments not shown>
;       command1
;       command2
;     @thisIsALabel
;       command3
;       command4
;       GOTO @thisIsALabel
;     END 
;
; This scene will execute commands 1 and 2, then repeat infintely executing commands 3 and 4
;
;-----------
;  GOTO EXIT
;
; This command causes the players to be booted from the scene and back to the map, as if the
; scene host pressed their (camp) EXIT button.
;
;-----------
;  GOTO SCENE <scene number>
;
; This command lets you jump the player from the current scene into a new scene (which then starts
; at its beginning.)
;
; However, when you exit the scene, you will be at your original location (the place where you
; dropped into the original scene). This command never changes your current map.
;
; Jumping to a non-existent scene number may not fail gracefully.
;
;-----------
;  GOTO LINK <map number>, <link number>, <dropin code>
;
; This command actually moves the character to a position just above the specified link on the specified map.
; For example:
;
;     GOTO LINK 0,0
;
; On evergreen, this would take you on top of the gateway link on the main map.
;
; The third argument (dropin code), if present and non-zero, causes the player to drop 'into' the link
; after arriving.  What happens after that is a function of the link in question (might do nothing, might
; go into a scene, might link to a whole different map)
;
; So:
;
;     GOTO LINK 0,0,1
;
; On evergreen, this would move the player to just above the gateway link on the main map, and then drop the
; player INTO the gateway (scene).  When the player exited that scene, they would be on the main map just
; above the gateway.
;
;-----------
;	IF		<id list>   <label>
;			Tnn+Snn-Inn+Gnn+WIN-LOSE+ALIVE-DEAD+YES-NO
;           Token, Spell, Item, Gold, Won last fight, lost last fight, still alive, dead, answered YES or NO to recent ASK
;           all tokens measured against scene SERVER only
;			all specified terms must be TRUE (or FALSE if preceded by minus sign)
;
; This command checks to see if the condition given is TRUE and if so, it jumps to the specified
; label.  Otherwise it just continues with the next scene command.
;
; The condition is specified as a list of IDs separated by plus and minus signs.  The IDs each start
; with a unique letter possibly followed by a number.  For example "I34" means "Item 34" It is TRUE 
; if the player hosting the scene has item 34 in his or her pocket.  "T12" means "Token 12" and
; usually you will check the presence of tokens to decide which path to take through your scene.
;
; If you need two conditions to both be true in order to jump to the label, then list both IDs and
; separate them by a plus sign.  If you use a minus sign in front of an ID, then it is true if
; the player does NOT have that ID.  For example "T12+I15-S22" means: "If the player has Token 12
; AND item 15, BUT NOT spell 22, then the condition is true and the jump to label will occur"
;
; For example:
;
;     SCENE <arguments not shown>
;       command1
;     @label1
;       command2
;       IF  T3-T4+T5, @label2
;       GOTO label1
;     @label2
;       command3
;     END
;
; In this case, the scene starts by executing command1, and then gets stuck in a loop, executing
; command2 over and over until the condition is true, allowing it to jump to label2 and execute
; command3 then leave.  
;
; The condition we are looking for is "Player has token3 and token 5, but NOT token 4" (and
; again, only the player who is hosting the scene is checked. tokens and items in the possession
; of other players in the scene are not important)
;
; The condition IDs supported are:
;
;     ALIVE		player is alive
;	  Cn		true if player is of character class 'n'
;     DEAD		player is dead
;	  Enn		Player is EQUIPPED with item nn (not just in possession of one)
;     Fnn		true if player is on a map with this 'map flag' set. (nn = 1, 2, 4, 8, 16, 32, etc.)
;     Gnn		Player has at least nn gold pieces
;     GS		True if scene host is a 'golden soul'
;     Hnn		true if this CHARACTER is nn hours old (or older)
;     Inn		player has item nn (from ITEMS table)
;     LOSE		player lost last fight in this scene
;     KBn		player has been killed at least once, by monster ID = n
;     KBn.x     player has been killed at least x times by monster ID = n
;     KMn		player has killed at least one monster 'n' (monster ID = n)
;     KMn.x     player has killed at least 'x' monsters of type 'n'
;     M0		true if player is a CHEATER character  (m-zero)
;	  M2		true if player character has played in a modified world before.
;	  M4		true if player has ever turned off the "avoid modified quest files" option.
;     NO		player answered NO to last ASK scene command
;	  P0    	true if player is a PLAYER KILLER (p-zero)
;     Pnn     	true if player is a PLAYER KILLER *and* has killed other players at least nn times.
;     Qword		player answered 'word' to last ASK scene command (use ^ if your word has spaces.. "Qbutter^fly" matches "butter fly")
;	  Rnn		Random Number (nn = 00-99, represents percent chance of TRUE)
;     Snn		player has spell nn (from SPELLS table)
;	  Tnn		player has token nn (from TOKENS table)
;     Vnn  		true if player's level is greater than or equal to nn
;     WIN		Player won last fight in this scene (after FIGHT scene command)
;     XP		true if the COUNTDOWN TIMER has EXPIRED (use the COUNTDOWN opcode to start the timer)
;     YES		player answered YES to last ASK scene command
;	  #nn		true if player is currently on map nn (as defined in MAPS table)
;
;
;-----------
;   ACTOR	<ID #><character name><skin><pose><x,y>
;
; This command creates an ACTOR in the scene. Actors can walk around and deliver
; scripted lines of text.  Each actor in the scene needs a unique ID number (unique
; to that scene, not to ALL scenes :-)
;
; You give the character a name, the name of a skin file with its image in it, and the
; pose (offset within that file).  These 'villager' skin files are stored in the world's
; MONSTER folder and are long filmstrips with many different villagers in a single
; file.  You also give the actor an initial position to be standing on the screen.
;
; X and Y vary from zero to 100 which relate to the max size of the window (so x=100 is
; always the far right edge of the screen, no matter what size the window has been stretched
; to.)  Using values sufficiently outside the range will start the actor 'off screen' so that
; a subsequent 'MOVE' command can have them appear to walk in from off stage.
;
; You usually define an ACTOR or two right at the start of the scene, but you can use
; the command at any time, in case you have an actor which is only present if certain
; conditions have been met.
;
; For example:
;
;    SCENE <arguments not shown>
;       ACTOR 1, "Old Carl", "joshVillagers", 3, 20, 80
;       IF -T12, @noYoungCarl
;       ACTOR 2, "Young Carl", "joshVillagers", 15, 50, 80
;    @noYoungCarl
;    END
;
; Here the scene starts by creating "Old Carl" as actor #1 standing at the lower left of
; the screen.  Then if the player does NOT have token 12 ("-T12") it jumps to the label
; and skips the creation of "Young Carl" who otherwise would be standing in the lower
; center of the screen.
;
;-----------
;   MOVE	<ID #>, <x>, <y> {,<optional mode>}
;
; This command tells a previously declared ACTOR to move to a new x, y position on the
; screen.  This is a real time action and it may take them awhile to amble on over.  You
; might need a WAIT command if you want the next scene command to not take place until after
; they get there.
;
; The optional <mode> value controls the nature of the motion.  If you don't specify it, it will
; use mode 0 (normal walking).  mode '1' will cause the actor to instantly teleport to the new x,y
; location (A good way to get a character offscreen in a hurry).  As of version A74, modes 2, 3, 4, and 5
; will make the actor move varying amounts of more_quickly.
;
; For example:
;
;    ...
;    MOVE  1, 50,50              <-- actor '1' walks leisurely to center of screen
;    MOVE  2, 0,0, 1             <-- actor '2' teleports instantly to upper left of screen
;
;-----------
;   POSE	<pose>	{, pose2, pose3}	(change pose of current actor)
;
; When you created the ACTOR, you specified both an image file name, and an offset (pose) to
; a particular image of that file's filmstrip.  If you have several images of the same
; character in that file, this command lets you flip between them for whatever reason you
; like.  For example, I use it to 'morph' the evil witch into her true self.
;
; The pose you specify will be held until you specify a different one.  HOWEVER, as of
; version A30, you can specify two additional poses (3 in all, pose1, pose2, and pose3).
;
; If you specify the additional poses then the actor will cycle between pose1 and pose2
; for approximately equal (but random) amounts of time, with occasional brief displays
; of pose3.  For example, pose1 and pose2 might be a frog looking in different directions,
; while pose3 shows his tongue flitting out.  You cannot currently control the timing,
; so for critical animations, just use a sequence of POSE commands with appropriate WAIT
; commands.  The advantage of the multi-pose POSE command is that the animation continues
; even after the script END command, and requires no special scripting.
;
;-----------
;	SELECT	<ID #>		(select actor # as the current speaker)
;
; Some commands work on the 'current actor' as opposed to calling one out by name.  This
; command lets you select the current actor by ID number.
;
;-----------
;	' line of speech by character (additional lines require 'more' click by reader)
;
; This was the first way of making an actor speak.  I seldom use it anymore, but let's
; pretend it is important anyway.  For example:
;
;   SCENE ...
;      ACTOR 1, "Billy", ...
;      ACTOR 2, "Sally", ...
;      SELECT 1
;      ' Hello, my name is Billy
;      SELECT 2
;      ' Hello, my name is Sally
;   END
;
; This is pretty clumsy, and if all you are doing is speaking, it is more efficient to use
; the "N:" form instead, as in:
;
;   SCENE ...
;      ACTOR 1, "Billy", ...
;      ACTOR 2, "Sally", ...
;      1: Hello, my name is Billy
;      2: Hello, my name is Sally
;   END
;
; Each line of text you put in creates a speech bubble over the head of the actor who said it.
; Only one actor can have a speech bubble up at a time, so the script will automatically pause
; before executing the next speech line until the previous bubble disappears.  Bubbles disappear
; after a brief timeout, or can be cleared by right-clicking in them.
;
; The percent sign symbol (%) is used as a special character.  The number following it lets you
; stick in real-time information about the current players.
;
;		%0 - speaking character's name
;		%1 - server player name (player hosting the scene)
;		%2 - client name (each client sees his or her own name)
;		%3 - a random insult name "stupid maggoty rat-face"
;		%4 - name of the last person to type in chat
;		%5 - name of last person who typed YOUR NAME at start of chat line
;   	%C  - class name of scene host ("magic-user")
;       %Cn - class name of class n (starting at 1) from world level tables.
;		%En - item number of equipped item in slot n (n=10 for HELMET..) use n=0 to get 'equipped right hand' item ID
;		%In - name of ITEM n
;		%K0 - Total number of monsters killed by scene host
;	%Kn - Number of monster ID n killed by scene host
;       %L  - level name of scene host ("emperor")
;       %Ln - level name for level n of scene host's class
;       %L-1 - level number of scene host ("99")
;		%Mn - name of MONSTER n
;		%Rn - Random number from 1 to n (n from 1 to 30,000) 
;		%Sn - name of SPELL n
;		%Tn - token name n
;       %% - inserts a single visible percent sign
;
; For example:
;
;      1: Hello, my name is %0.  Your name is %2. Your host's name is %1
;      2: I, %0, think you are a %3!
;      1: I am 99%% sure you are also a %3!
;
;-----------
;   N:  (shorthand SELECT N followed by ' --  N is 0 to 9 only)
;       as in:
;       2: Actor 2 said this
;		1: Actor 1 said this
;
; As described more fully above.
;
; As of A57, you can now use "actor 'H'" to mean "put words in the mouth of the scene host (an
; actual player, not an actor!)
;
;       1: Hello, foolish human
;		1: Repeat after me
;		1: Owa
;       H: Owa     <-- appears to have been typed by scene host
;       1: tana
;       H: tana
;		1: siam
;       H: siam
;       1: Ok, altogether real fast now
;		H: Ok, Owa tana siam..
;       H: Owatanasiam...
;       H: O wat an ass i am
;       H: Hey!!!!
;       1: Hee hee hee
;
; As of A61, you can now use "Actor 'N'" to mean "add some narration to the scene.
;
;       N: And then the sun set on joy.
;
; Narration appears in the chat window, and as a scrolling line of large text in the
; main scene window (but does NOT appear in a chat bubble).
;
;-----------
;   WAIT	<seconds>  (use decimal point for sub-seconds)
;
; This command lets you put in a little pause before the next command is executed.  As in:
;
;   SCENE ...
;       ACTOR 1, "Dave", joshVillagers, 1, 20, 80
;		MOVE 1, 80, 80
;		WAIT  3.5
;       1: I should be there about now
;   END
;
; This creates 'Dave" on the lower left of the screen and then starts him walking to the
; lower right.  3.5 seconds after starting his walk (whether he has finished it or not)
; his speech bubble pops up.
;
;-----------
;	FIGHT	<fight scene - no arguments means 'standard random fight appropriate to vicinity'>
;		FIGHT 1,2,2,4  (fight 4 monsters total, two of type 2)
;
; This command plays out a monster fight within the scripted scene itself.  The next 
; scene command is not executed until the results of the fight are known (all heroes dead
; or all monsters dead).  At that point the WIN and LOSE "IF" conditionals will work.
;
; You can call out a particular collection of monsters via their IDs from the MONSTERS table,
; or you can have monsters selected randomly from the current map area monster group.
;
; For example:
;
;     SCENE ...
;         ACTOR 1, "Zor", evilPeople, 1, 50, 50
;         1: Prepare to die, %2, you %3!
;         FIGHT 23,12,12
;         IF WON, @youWon
;         1: I knew you would lose, you %3!
;         END
;     @youWon
;         1: Big deal, you won, so what, who cares.
;     END
;
; So here we create 'Zor' in the top center of the screen and he insults us.  Then 3 monsters
; appear as in a regular fight scene (with Zor still standing there watching us).  We get one
; monster #23, and two monster #12s (as defined in the MONSTERS table)
;
; After the fight, if the player wins, we jump to label '@youWon' and graciously concede defeat.
; Otherwise we execute the line following the IF and brag a little, then END the scene.
;
; Note that this scene now has two END commands in it.  That's OK.  The first one we execute ends
; the scene.
;
; Stupid FIGHT tricks:
;
;  Use the opcode FIGHT2 for exactly the same effect, except the scene host is also 'stuck in the
;  fight (similar to a PK Attack) until they stand still without fighting for 20 seconds or so
;  (this is about as close to a forced fight to the death as the game gets)
;
; Mercenaries
;
;  If you call out a monster by ID, but add a minus sign, as in:
;  
;    FIGHT  1, 2, 3, -4
;
;  Then that monster will fight on your side (in this case monster ID 4 is the helper against 3 evil monsters)
;
; Mixed Stuff to The Max
;
;  If you include a '*' as one of the monster IDs, it means "also use monsters from the map", so:
;
;     FIGHT  *, 1, 2, 3
;
;  Means you will have a fight with monsters 1, 2, and 3 PLUS whatever a normal fight at this location might
;  have had.
;
; Scene 2 is the FIGHT SCENE
;
;   I hope I am not lying when I say that the FIGHT command in SCENE 2 is what controls all standard map
;   monster fights.  (the kind you get drawn into when hunting or walking the map).  So anything clever you
;   do in that scene will affect all monster fights.  So, you could check what map you were on, what tokens
;   the player had, their spiritual alignment (maybe) etc, and then populate the fight accordingly.
;   This was my intention, in any case, though I never had the courage to try anything radical.
;
;-----------
;	GIVE	<id#> 
;
; This command gives the specified object to all current members of the scene (um, even 
; dead ones I think).  Objects are specified the same as in the "IF" command conditionals
; with a letter followed by a number.  Unlike the IF command, however, you can only give
; one thing per line. (no plus and minus signs please)
;
; Objects you can give include:
;
;		Tn	token N
;		Gn	N pieces of gold
;		In	item N
;       Sn  spell N
;       Hn  n health points (up to max)
;       Mn  n magic points (up to max)
;       <given to all members of scene>
;
; For example
;
;     SCENE ...
;         ACTOR 1, "King", joshRoyalty, 3, 50, 50
;         IF T10, @killedDragon
;         1: I see you have not yet killed the dragon, begone!
;         END
;     @killedDragon
;         1: Hey, you killed the dragon, accept this gold from me, please!
;         GIVE G100
;     END
;
; So, when we visit this scene, the king checks our pocket for token 10 (which we
; presumably get after killing the dragon in some other scene) and if we don't have
; it, the scene ends with a 'hint'
;
; Otherwise, we jump to the label and the king rewards us with 100 gold pieces (generous
; guy, huh?)
;
; Note that this is a bad scene since once we kill the dragon the king will give us another
; 100 GP every time we visit the scene.  Most quests should have another token which means
; "I already gave you your reward" and the scene would check both tokens so we only got
; our reward once.
;
;-----------
;	TAKE	<ID>		<this is evil!>
;		<taken from all members of scene>
;
; Same as the GIVE command, but in reverse.  Very evil.
;
;-----------
;   ASK		<seconds> - waits a while for scene server to type something ("yes" or "no" flags set in response)
;
; This command is used when you want to ask the player a question and actually read his or
; her answer and do something based on the response.  The actual question is asked using the
; normal speech bubble stuff.  You just follow that command with an ASK command as in this
; example:
;
;     SCENE ...
;        ACTOR 1, "King", ...
;        1: Say, %1, does this coat make me look fat?
;		 ASK	20
;        IF  YES, @saidYes
;        1: You really think so?  Thanks!
;        END
;     @saidYes
;        1: Off with your head!  Guards, take %1 to the dungeon and relieve HIM of a few pounds!		
;     END
;
; Here the king poses a question.  The "ASK 20" pauses the script for up to 20 seconds (or
; until the host player types a line of chat).
;
; If a line of chat is entered before the timeout, and it starts with something resembling
; a yes, then the "YES" condition will be true and the "IF" command will jump to the label
; where the king is unhappy with us.  Otherwise (nothing was typed, or what was typed did
; not look like a yes) the king is happy enough and the scene ends.
;
; The "Qword" conditional lets you scan the host player's response for particular words or
; letter sequences ("yes" would be found inside of "yesterday" for example), so you could have
; complicated processing like:
;
;     ...
;     1: What is your favorite color?
;     ASK  30
;     IF Qblue, @wasBlue
;     IF Qred, @wasRed
;     IF Qorange, @wasOrange
;     ...
;
; Note that "Qwords" cannot include spaces, so you cannot have "QI don't know" which would be cool
; for the Monty Python fans.
;
; Oooooh, if I was a good little  programmer, this might work:
;
;      IF QI+Qdon't+@know, @heDontKnow
;
; Of course, that would also trigger on the player response: "Don't you know I like red?" since it 
; checks for the presence of the "Qword" anywhere in the response.  I *think* case is not 
; important (I'm using standard c library "strstr()" for anyone who is interested)
;
;-----------
;	OFFER	<item>{,<item>} - displays a SHOP button which, when pressed, offers the specified items for sale
;
; Normally a scene does not have a SHOP button until you execute an OFFER command.  The OFFER
; command comes in two flavors, differing in the way you specify the list of items available
; in the store.
;
; The OFFER command takes a simple item list and is best used for specialty stores offering
; a limited number of items, as in:
;
;     SCENE ...
;        ACTOR 1, "Shopkeeper", ...
;        1: I have only these items. Buy them or leave!
;        OFFER  4, 12, 103, 11, 22, 7, 15
;     END
;
; Only those seven items will appear when the player presses the SHOP button.  Item numbers
; match to entries in the ITEMS table
;
;-----------
;	OFFER2	<minLevel>,<maxLevel>{,itemClass} - displays a SHOP which offers all defined items between the two levels (with non-zero prices)
;			note: only the first 50 or so qualifying items will make it, so don't try for one store to sell EVERYTHING
;			the optional third argument limits it to items of the specified class.
;
; This newer form of the OFFER command is good for shops which provide a large number of items
; of a particular class.  For example, all boots between level 5 and 10 would be:
;
;      OFFER2 5, 10, 20
;
; Where the class number (20 for boots) is set in the ITEMS table 'class' column.
;
; You can have your store sell several classes  of items at the same time, by including the correct
; three numbers for each class: <minLevel>,<maxLevel>,<itemClass>
;
; As in:
;
;      OFFER2 5,10,20,  5,10,21,  1,10,22
;
; This would offer all class 20 items between levels 5 and 10, all class 21 items between levels
; 5 and 10, and all class 22 items between levels 1 and 10.  (the level limits are inclusive)
;
;-----------
;   GAME  <game number>
;
; Similar to the OFFER button (and you cannot use both OFFER and GAME in the same scene), this
; results in a GAME button appearing for the player.
;
; Pressing that button brings up a mini-game for the  player to enjoy while in the scene.
;
;   GAME 1	- The slobber slots machine.
;	GAME 2	- The Monster Racer
;	GAME 3	- The Search for Pi at Home
;	GAME 4	- Blackjack 
;   GAME 5  - Pokegatchi Training Center (same as 'train pet' on Equip Screen)
;   GAME 6  - Asteroids
;   GAME 7  - Stock Market Game
;   GAME 8  - Tetris
;
; These are all, so far, solo games (since WoS itself is the multiplayer game), but you can
; enjoy them in the presence of other players.
;
;-----------
;   COUNTDOWN <seconds>
;
; This command starts a COUNTDOWN timer (displayed on the main screen) which counts down to zero.
; When it hits zero, it disappears.  Cool huh?
;
; To make it useful, you need a scene which tests it with the 'X' conditional, as in:
;
;	IF  XP, @youAreTooLate
;  	1: You made it before the countdown finished!
;	END

; @youAreTooLate
;  	1: Could you possibly have walked any more slowly?
;
; You can turn the counter off prematurely by setting it to zero ("COUNTDOWN 0")
; The countdown automatically terminates if you leave the game, or change characters.
;
;----------------------------------------------
; The SCENE opcode has the following arguments:
;
;	SCENE		arg1		arg2		arg3		arg4		arg5		arg6
;				scnNum		scn.jpg		Style		Name		Effects		Weather
;
;	scnNum - every scene must have a unique scene number.  Link points on maps can
;			call out specific scene numbers.  In addition to that several scene numbers
;			are special:
;				0	Is always the intial well of souls (where you incarnate)
;				1	The standard 'camp' scene (links can override details)
;				2	The standard 'fight' scene (links can override details)
;				it is advised that you treat scene numbers 0 through 9 as 'reserved' to 
;				avoid conflicts with later developments
;
;	scn.jpg	- The background JPG file (from the SCENES folder of the world) to be used
;			as the background image of the scene.  Do not include the .JPG extension
;
;	Style	-	To Be Defined
;				WELL, FIGHT, SCENE, CUT
;				Just go with the flow on this one for now.  I might make it more important
;				later.  For now, here is the special meaning:
;					WELL - it is the primary Well scene.
;					FIGHT - it is the standard fight scene
;					SCENE - it is a scripted quest scene <-- use this normally
;					CUT	- it is a normal scene, but "heroes" are invisible (only actors appear).
;
;	Name	- The name of the scene (seen on title bar while in the scene)
;
;	Effects	-	Special effects applied to the background JPG.  These effects last for the
;				duration of the scene (except when temporarily modified by a spell during
;				a particular magical attack)
;				0	No effects
;				1	Underwater ripple (as though viewer is under water)
;				2	Lake ripple (as though the bottom 30% of the scene is a lake reflecting)
;				3	Video (every other line is black, giving a 'coarse video' quality
;				4	Jitter (random vertical jitter)
;				5	EarthQuake
;
;	Weather	-	Special effect (on top of all players) showin weather
;				0	no weather
;				1	rain
;				2   medium rain
;				3   heavy rain
;				7   light snow
;				8   medium snow
;				9   heavy snow
;
;-----------------
; PARTY <conditions>
;
; The PARTY command causes each client in the scene to evaluate the conditions (same as IF command conditions)
; and to leave the party if their conditions do not evaluate to TRUE.  Hence it defines what a legal party
; member should look like, and boots non-compliant clients from the party (but not from the scene)
;
; Generally this is intended to sever party members who do not deserve to follow the scene host to a new link, as
; in:
;
;    PARTY T23+T12
;    GOTO LINK 3, 4
;
; In this case, only clients who have tokens 23 and 12 will be allowed to stay in the party, and so when the 
; the party leader/scene host leaps to link (3,4) only those remaining party members go along.  The rest would,
; after the GOTO, be left sitting on the map when the scene expired.  I think.  I hope.  We'll see.
;
; Please note that unlike the IF command, these conditions are evaluated BY THE CLIENT (not by the scene server). 
;
; Another form of this command is EJECT
;
; The EJECT command is identical to PARTY only the people are also removed from the scene.  Remember
; the condion specifies the people who get to STAY in the scene and party.
;
;-----------------------
;  SET <cookieName>, <string>
;
; This command lets you store the string value into a 'cookie' of the specified name.  The cookie in question is
; only set for the scene host and is saved in their character's file.
;
; Later on, you can recover a cookie value by enclosing its name, like this:  #<cookieName>
;
; cookie names must not include spaces or punctuation marks.  Just letters and numbers.
;
; For example
;
;  SET favoriteColor, "blue"
;  1: Hello, %1, I see your favorite color is #<favoriteColor>
;
; The player will see:
;
;  "Hello, Bill, I see your favorite color is blue"
;
; The expansion of cookies is done BEFORE the evaluation of arguments, hence cookies called out inside of quoted
; strings will work... for example:
;
;  SET itemID, "15"
;  GIVE I#<itemID>
;
; In this case, the GIVE command will first be translated by substituting for the cookie, resulting in:
;
; GIVE I15
;
; Do not 'nest' cookies.  If you need to do something really weird, break it up into several steps.
;
; For more information about cookies, and a list of the current "Stock Cookies", please see the Quest Dictionary
; at http://www.synthetic-reality.com/wosquest.htm
;
;---------------------------
;
; ADD cookieName, <string>
;
; The string is evaluated as a number, the named cookie's contents are evaluated as a number, and the
; results are added together numerically and the sum is stored as the new value of the cookie.
;
; Math is performed as 'signed 32 bit integers' so watch out for underflow and overflow situations.  
;
; SET A, "15"
; ADD A, "22"
; 1: Jeepers, the sum is #<A>
;
; Should print: "Jeepers, the sum is 37"
;
; See SUB, MUL, and DIV commands for similar mathematical operations.
;
;-------------
; SUB cookieName, <string>
;
;  subtracts <string> value from cookie
;
;-------------
; MUL cookieName, <string>
;
; multiplies <string> value times cookie
;
;------------
; DIV cookieName, <string>
;
; Divides cookie by <string> (unless <string> evaluates to zero, then nothing happens)
; Note that 2/3 is 0, not 0.66666 since these are integer math operations.
;
;------------
; MODULUS cookieName, <string>
; MOD cookieName, <string>     <-- short form also accepted.
;
; Performs a modulus operation on the cookie.  (If you prefer, you can think of this as a
; 'remainder' function.
;
; You may not get the result you expect if cookie has a negative value to begin with.
; If <string> evaluates to 0, nothing happens.
;
;-----------------------------
; COMPARE  A,B  (with associated IFx commands)
;
;Fairly simple and brain damaged, I document by example:
;
;       COMPARE  A,B
;       IF=  @theyAreEqual
;       IF>  @AbiggerThanB
;       IF<  @AlessThanB
;
; The COMPARE command subtracts B from A and saves the result in a special place which doesn't get munged 
; until the next time you use the COMPARE command.
;
; The three IFx commands test that special result and jump to the label if the result was as indicated. 
; So your IFx command doesn't HAVE to immediately follow the COMPARE command, though I suspect it generally will.
;
; Arguments A and B are interpreted as signed decimal numbers.  For now you are stuck with constants and cookies.  
; So, you can do:
;
;        COMPARE  #<cookie>, "2"
;        COMPARE  #<cookie1>, #<cookie2>
;


+SCENES
;--------------
; SCENE 0 must be primary Well of Souls scene
;
SCENE 0	incarnate, WELL, "Well", 2, 4
	
	MUSIC won.mid
	SOUND  "moon.wav"
	THEME	2
	ACTOR	1,	"Death", (CA)Death3, 2, 40, 60
	SEL		1
	POSE	32,32,32
	WAIT	1.0
	' Give up now... there are worse fates then death.
	MOVE	1,	40, 60
	' No one has ever escaped the Castle... but if you want to die trying...
	MOVE	1,	30, 70
	' When you are ready, select your soul and then incarnate into the castle.
	MOVE	1,	30, 75
	' Notice the buttons along the bottom of your screen.  Point to a button to see its name.
	' Press the NEW button to create a new character, and select its skin and abilities.
	MOVE	1,	25, 70
	' Press the RESTORE button to select an old character, and resume its struggle.
	MOVE	1,	35, 65
	' Press the INCARNATE button to enter the castle again.
	MOVE	1,	30, 70
	' Press the MAP button to see what other characters are in the castle.
	MOVE	1,	30, 77
	' Press the HAUNT button to spy invisibly over another player.
	MOVE	1,	28, 70
	' Be ready to die...
	MOVE    1,	30, 77
	END

;--------------
; Primary CAMP scene
;
SCENE 1
	THEME
;	MUSIC   (no music in camp scene, just theme)

; Check is this is a PK Attack (uses CAMP scene, not FIGHT scene, oddly enough)
	
@camp
	COMPARE #<num.isPKAttack>, 1
	IF= @pk
	COMPARE #<num.isPKAttack>, 2
	IF= @pk	

; Not a PK Attack, check if it is in Macguyver castle

;	COMPARE #<num.mapNum>, 2
;	IF=	@inCastle

; Not Macguyver castle, so we're done.  It's just a regular camp with no special stuff

	END

;
; It *is* a PK Attack, so we set up some special rules to make it 'honorable'
;
@pk
	; Set map flags: 32768 (no nasty spells) + 8192 (no tickets) + 4096 (no Heal)
	FLAGS	45056

	; Lock the room
	LOCK 1

	; Announce to the players that this is a special place
	N: PK Attack! 
	N: No Healing, Stunning, or Tickets!

	; we have to END or they can't fight
	END

@eventPkAttackDone

	; maybe someday this event will work, and we can unlock the camp as soon as 
	; only one side is left standing

	LOCK 0
	FLAGS 0
	END


; We *are* in macguyver castle, so we have the little lock icon in the upper right,
; and can manually lock/unlock the camp.. to discusss our secret plans!
;
@inCastle
	; we get a little lock icon while in macguyver castle camps.
	SET sceneLock, 0
	ACTOR	9, "Lock", danNoFloat, 6, 95, 10
END

; The scene host has clicked on the little lock icon

@eventActorClick9
	COMPARE #<sceneLock>, 0
	IF= @lockScene
	LOCK 0
	SET sceneLock, 0
	SEL 9
	POSE	6
	END
@lockScene
	LOCK 1
	SET sceneLock, 1
	SEL 9
	POSE	5 
	END

;--------------
; Primary FIGHT scene
;
SCENE 2
	THEME
	MUSIC  battle.mid
	FIGHT
	IF DEAD @dead
	IF WIN  @won
	END

@dead 
	MUSIC  dead.mid
	END
	
@won
	MUSIC  won.mid
	SOUND  "castle.wav"
	THEME 7
	END


;--------------
SCENE 3 church, SCENE, "church", 0, 0
	THEME	0
	ACTOR	1,	"Priest", (CA)Priest, 5, 25, 90
	POSE	1, 2, 1
	SEL		1
	MOVE	1,	15, 80
	MUSIC	church.mid
	IF T1, @continue
	1: Hello... A certain friend told me to help you.
	1: Warrior or Wizard, Rouge or Ranger, you will need all the help you can get to escape the castle...
	1: Do seek my aid?
	ASK 30
	IF -YES, @saidNo
	1: Be healed.
	1: I have some items that can help you. Click on shop button if you wish to see them.
	GIVE T1
	GOTO @continue
	END

@saidNo
	1: If thats your decision, then I pity you. You won't survive a day.
	MOVE	1, -30, 80
	END

@continue
	IF ALIVE, @alive
	1: Be healed.
	WAIT    1.0
	SOUND	"thunder.wav"
	WAIT	1.0

@alive
	MOVE	1,	10, 75
	GIVE	L1
	GIVE	H99999
	GIVE	M99999

@shop
	OFFER2	0,10
	1: Blessings upon you.
	1: Come when you need to be healed.
	GIVE I99
	END

;--------------
SCENE 4 exit, SCENE, "Castle Exit"
	IF T23, @hasT23
	IF T12, @check1
	N: The door is locked... You need three keys to open it.
	END

@check1
	IF T13, @check2
	N: The door is locked... You need two more keys to open it.
	END

@check2
	IF T22, @act
	N: The door is locked... You need one more key to open it.
	END

@act
	N: You hear a *Clank* as the three keys slide into place and the massive iron door swings open...
	WAIT 2
	ACTOR   1, "Death", (CA)Death, 1, 30, 65
	1: Well done, you made it this far. 
	WAIT 3
	1: I am truly impressed...
	WAIT 2
	1: But don't think I'll let you leave so easily...
	WAIT 5
	GOTO SCENE 5
	END

@hasT23
	GOTO LINK 9,0
	END

;---------
SCENE 5 exit, SCENE, "Death"
	MUSIC death1.mid
	FIGHT2 71
	IF WIN @won1
	IF DEAD @dead
	END

@won1
	ACTOR   1, "Death", (CA)Death, 1, 30, 65
	1: Hmmmm... 
	WAIT 3
	1 You're better than I expected... 
	WAIT 3
	1: But you've not won yet...
	WAIT 3
	1: See my true power!
	WAIT 2
	MOVE 1, 0,0, 1
	ACTOR   2, "Death", (CA)Death2, 1, 30, 65
	WAIT 2
	H: (Gasp)
	WAIT 2
	2: Prepare to meet your doom....
	MOVE 2, 0,0, 1
	MUSIC death2.mid
	FIGHT2 72
	IF WIN @won2
	IF DEAD @dead
	END

@won2
	N: You've defeated Death! Congrats!
	WAIT 2
	ACTOR   1, "Death", (CA)Death2, 1, 30, 65
 	1: ...........
	WAIT 3
	1: I have not been bested in combat in over a century!
	WAIT 3
	1: Thus, you have earned the right to leave.... 
	WAIT 5
	1: Be gone!
	WAIT 2
	GIVE T23
	GIVE T24
	GOTO LINK 9,0
	END

@dead
	ACTOR   1, "Death", (CA)Death2, 1, 30, 65
	1: You've died...
	WAIT 3
	1: A pity, I thought you'd last longer...
	WAIT 3
	1: Come back again, when you're more.... alive.... 
	WAIT 5
	GOTO LINK 6,4,1
	END

;---------
SCENE 6 lava_room, SCENE, "Cerberus"
	MUSIC boss2.mid
	IF T12, @hasT12
	FIGHT2 49
	IF WIN @heWon
	END

@heWon
	GIVE T12
	GIVE I702
	N: You got the Mirror Boots and the First Key from the Cerberus.
	END

@hasT12
	N: The Cerberus is defeated.
	END

;---------
SCENE 7 gear_room, SCENE, "Golem"
	MUSIC boss2.mid
	IF T13, @hasT13
	FIGHT 52
	FIGHT 52, 52
	FIGHT 52, 52, 52
	FIGHT 52, 52, 52, 52, 56
	FIGHT 52, 52, 52, 52, 52, 56, 56
	FIGHT 52, 52, 52, 52, 52, 52, 56, 56, 56
	FIGHT2 52, 52, 52, 52, 52, 52, 56, 56, 56, 62
	IF WIN @heWon
	END

@heWon
	GIVE T13
	GIVE I700
	N: You got the Crypt Boots and the Second Key from the Iron Golem. 
	END

@hasT13
	N: The Iron Golem is defeated.
	END 
	
;---------
SCENE 8 throne_room2, SCENE, "Necromancer"
	MUSIC boss2.mid
	IF T22, @hasT22 
	FIGHT2 87, 87, 124, 124, 94
	IF WIN @heWon
	END

@heWon
	GIVE T22
	N: You got the Scepter and the Third Key from the Necromancer.
	END

@hasT22
	N: The Necromancer is defeated.	
	END

;---------
SCENE 9 fountain2, SCENE, "Spirit"
	MUSIC spirit.mid
	ACTOR   1, "Spirit", (CA)TheSpirit, 1, 30, 65
	IF T2, @hasT2
	EJECT C4
	IF C4, @act
	WAIT 2
	1: Only Bards can receive my help.....
	END

@act
	ACTOR   1, "Spirit", (CA)TheSpirit, 1, 30, 65
	WAIT 2
	1: Ah, I see you are a Bard.
	WAIT 1
	1: You must have heard that I sometimes help ones such as yourself.
	WAIT 1
	H: Yes. 
	WAIT 1
	H: I came that I might seek a boon of you and receive a pet. 
	WAIT 1
	1: I see that you speak sooth. Thus, I will grant your request. 
	WAIT 2
	GOTO @pet1
	END

@pet1
	ACTOR   1, "Spirit", (CA)TheSpirit, 1, 30, 65
	WAIT 1
	1: Do you wish to have an Ice Hawk?
	ASK 30
	IF -YES, @pet2
	1: Remember... the ability to tame beasts is your most powerful weapon. Use it wisley...
	WAIT 2
	EJECT C4
	HOST_GIVE I1000
	HOST_GIVE T2
	END
	
@pet2
	ACTOR   1, "Spirit", (CA)TheSpirit, 1, 30, 65
	1: Then what of a Wyvern?
	ASK 30
	IF -YES, @pet3
	1: Remember... the ability to tame beasts is your most powerful weapon. Use it wisley... 
	WAIT 2
	EJECT C4
	HOST_GIVE I1001
	HOST_GIVE T2
	END

@pet3
	ACTOR   1, "Spirit", (CA)TheSpirit, 1, 30, 65
	1: Then you must want a Flaming Lobster.
	ASK 30
	IF -YES, @pet1
	1: Remember... the ability to tame beasts is your most powerful weapon. Use it wisley...  
	WAIT 2
	EJECT C4
	HOST_GIVE I1002
	HOST_GIVE T2
	END

@hasT2
	ACTOR   1, "Spirit", (CA)TheSpirit, 1, 30, 65
	WAIT 2
	1: I have done what I can for you.
	WAIT 2
	1: Go now, and finish your quest.
	END

;---------
SCENE 10 hydra, SCENE, "Lantern"
	IF T14, @hasT14
	N: Bloooooooddddddddd.....
	MUSIC boss1.mid
	FIGHT 123
	IF WIN @heWon
	END

@heWon
	GIVE T14
	N: You got the Lantern from the Hydra.
	END

@hasT14
	N: The Hydra is defeated.
	END

;---------
SCENE 11 stairs2, SCENE, "Darkness"
	IF T14, @T14enter
	N: It's too dark to go down there!
	END

@T14enter
	IF T17, @T17enter
	N: The Lantern shines brightly and you can now see your way down the stairs.
	WAIT 3
	N: As you start to go down the steps the room suddenely starts filling with water!
	WAIT 3
	N: You rush back up the steps just in time to not be swept away!
	WAIT 3
	N: When back at the top of the stairs again the water recedes and drains into the floor below.
	END

@T17enter
	N: You are now protected by the necklace and can travel down the stairwell without fear.
	GOTO LINK 6,0
	END

;---------
SCENE 12 stairs2, SCENE, "Darkness"
	IF T14, @T14enter
	N: It's too dark to go down there!
	END

@T14enter
	IF T17, @T17enter
	N: The Lantern shines brighty and you can now see your way down the stairs.
	WAIT 3
	N: As you start to go down the steps the room suddenly starts filling with water! 
	WAIT 3
	N: You rush back up the steps just in time to not be swept away!
	WAIT 3
	N: When back at the top of the stairs again the water receads and drains into the floor below.
	END

@T17enter
	N: You are now protected by the necklace and can travel down the stairwell without fear!
	GOTO LINK 6,1
	END

;---------
SCENE 13 spider, SCENE, "Wand"
	IF T5, @hasT5
	N: Foooooooddddddddd.....
	MUSIC boss1.mid
	FIGHT 124
	IF WIN @heWon
	END

@heWon
	GIVE T5
	N: You got the Magic Wand from the Giant Spider.
	END

@hasT5
	N: The Giant Spider is defeated.
	END

;----------
SCENE 14 throne_room3, SCENE, "Cross"
	IF T10, @has T10
	N: Bloooooooddddddddd.....
	MUSIC boss1.mid
	FIGHT 125
	IF WIN @heWon
	END

@heWon
	GIVE T10
	N: You got the Holy Cross from the Shade.
	END

@hasT10
	N: The Shade is defeated.
	END

;---------
SCENE 15 bedroom, SCENE, "Harp"
	IF T7, @hasT7
	N: Fooooooooddddddddd.....
	MUSIC boss1.mid
	FIGHT 126
	IF WIN @heWon
	END

@heWon
	GIVE T7
	N: You got the Harp from the Dragon.
	END

@hasT7
	N: The Dragon is defeated.
	END

;---------
SCENE 16 statue, SCENE, "Necklace"
	IF T16, @hasT16
	N: No one's here...
	END

@hasT16
	IF T17, @hasT17
	ACTOR   1, "Doppelganger", mirror, 1, 30, 65
	1: So, YoU wOuLd SeEk To BrAvE mY dUeNgEoN!?
	WAIT 2
	1: HahaHAHAha.....
	WAIT 2
	1: FoOl!!
	WAIT 2
	H: Who are you?
	H: Show yourself!
	WAIT 2
	1: If YoU iNsIsT... 
	WAIT 2
	MOVE 1, 0,0, 1
	MUSIC boss1.mid
	FIGHT 95
	IF WIN @heWon
	END

@heWon
	ACTOR   1, "Doppelganger", mirror, 1, 30, 65
	1: GoOd... VeRy GoOd...
	1: TaKe ThIs... YoU'lL nEeD iT...
	WAIT 2
	H: Wait! Who are you?
	WAIT 2
	1: HaHAhahaHahaaaaa...
	WAIT 2
	GIVE T17
	N: You got the Necklace from the Doppelganger.
	END

@hasT17
	MUSIC  won.mid
	N: The Doppelganger has been defeated.
	WAIT 3
	SOUND  "BEG.wav"
	WAIT 3
	N: Or has it....
	END

;---------
SCENE 17 fairy, SCENE, "Fairy"
	IF T8, @hasT8
	ACTOR   1, "Fairy Queen", (CA)Angel, 1, 30, 65
	ACTOR   2, "Fairy1", (CA)Angel2, 1, 50, 95
	ACTOR   3, "Fairy2", (CA)Angel2, 1, 60, 70
	1: So it's you again.
	1: My girls say you are a demon!
	2: He is!
	3: It's true!
	1: Are you?
	ASK 30
	IF -YES, @SaidNo
	1: Then begone you feind!
	WAIT 2
	GOTO EXIT
	END

@SaidNo
	ACTOR   1, "Fairy Queen", (CA)Angel, 1, 30, 65
	ACTOR   2, "Fairy1", (CA)Angel2, 1, 50, 95
	ACTOR   3, "Fairy2", (CA)Angel2, 1, 60, 70
	1: Then you must prove yourself!
	1: You must do something that no demon could ever do. 
	WAIT 3
	1: I'm waiting..
	WAIT 2
	IF T7, @hasT7
	END

@hasT7
	ACTOR   1, "Fairy Queen", (CA)Angel, 1, 30, 65
	ACTOR   2, "Fairy1", (CA)Angel2, 1, 50, 95
	ACTOR   3, "Fairy2", (CA)Angel2, 1, 60, 70
	WAIT 4
	N: Think to yourself a minute, then you pull out the harp and begin to play it.  
	WAIT 2
	MUSIC ahad_chastity.mid
	WAIT 10
	1: Oh my! What beautiful music!
	WAIT 5
	1: It's been ages since I've heard such a song!
	WAIT 5
	H: I'm glad you enjoyed it. 
	H: You can have this harp if you'd like.
	1: Thank you. (smiles)
	1: I accept your lovley harp.
	WAIT 2
	1: You have truley proven yourself, I am sorry for ever doubting you.
	2: Yeah, we're sorry. 
	3: Sorry... 
	WAIT 5
	1: To make up for it, I'll give you this chalice.
	1: It is of fine craftsmanship, made of the purest of gold. 
	1: You may find some use for it yet. (winks)   
	GIVE T8
	N: You have received the Golden Chalice from the fairy queen.
	END

@hasT8
	MUSIC ahad_chastity.mid
	ACTOR   1, "Fairy Queen", (CA)Angel, 1, 30, 65
	ACTOR   2, "Fairy1", (CA)Angel2, 1, 50, 95
	ACTOR   3, "Fairy2", (CA)Angel2, 1, 60, 70
	1: Hello again.
	2: Hi!
	3: Hello!
	1: Thanks for the harp. (wink)
	END
	
;---------
SCENE 18 throne_room, SCENE, "Jei"
	IF T16, @hasT3
	IF T15, @hasT15
	ACTOR   1, "Jei", (CA)Jei, 4, 30, 75
	1: So it's true... someone has wandered into the castle... and with no memory either...
	WAIT 2
	H: Who are you? What's you name?
	1: Among those who do not know me, I am named Jei.
	H: Then how are you named among those who do?
	1: Ah, but those who know me have no need of my name.
	H: Stop playing games and answer me. 
	H: Do you know how to get out of this castle? 
	WAIT 3
	1: Possibly, possibly...
	H: Well are you going to tell me?
	WAIT 3
	1: Maybe... or maybe not....
	H: Stop being so cryptic and give me a straight answer dammit!
	1: Perhaps I will....
	1: But lets see what you're made of first.
	GIVE T15
	MUSIC boss1.mid
	FIGHT 118
	IF WIN @heWon
	IF DEAD @heDead
	END

@heWon
	ACTOR   1, "Jei", (CA)Jei, 4, 30, 75
	1: Well done, you've humbled my demon, so I'll give some advice.
	1: Go to the forth floor and speak with the fairy queen.
	1: Though you'll have to find some way to get past her consorts.
	1: Until we meet again... 
	GIVE T3
	WAIT 2
	MOVE	1,	0, 0, 1
	END

@heDead
	ACTOR   1, "Jei", (CA)Jei, 4, 30, 75
	1: It appears I have over estimated your abilitys.
	1: Come back when you're more...... alive...
	END

@hasT15
	ACTOR   1, "Jei", (CA)Jei, 4, 30, 75
	1: Back for more I see....
	1: Prepare yourself!
	MUSIC boss1.mid
	FIGHT 118
	IF WIN @heWon
	IF DEAD @heDead
	END

@hasT16
	N: There's no one here...
	END

;---------
SCENE 19 library, SCENE, "Library"
	MUSIC won.mid
	SOUND  "guardian.wav"
	THEME	7
	ACTOR   1, "Librarian", (CA)Librarian, 21, 25, 90
	1: Welcome, I can offer you items to aid you in your quest.
	SEL   1
	OFFER2 31,50
	IF T66, @hasT66
	END

@hasT66
	GIVE I98
	END

;---------
SCENE 20 guild_hall, SCENE, "Hall of Memories"
	ACTOR   1, "Ghost", mirror, 1, 30, 65
	1: Welcome to the Hall of Memories.
	1: I can help you forget past memories you wish to relive.
	1: Be warned though, once forgotten, a series of memory must be rexpirenced in full.
	WAIT 3
	IF -T3-T4-T5-T6-T7-T8-T9-T10-T11-T12, @Q2
	1: Shall I erase your memory of your quest for the First Key?
	ASK	30.0
	IF -YES, @Q2
; Cerberus
	TAKE T3
	TAKE T4
	TAKE T5
	TAKE T6
	TAKE T7
	TAKE T8
	TAKE T9
	TAKE T10
	TAKE T11
	TAKE T12
@Q2
	IF -T13, @Q3
	1: Shall I erase your memory of your quest for the Second Key?
	ASK	30.0
	IF -YES, @Q3
; Golem
	TAKE T13
@Q3
	IF -T14-T15-T16-T17-T18-T19-T21-T22, @Q4
	1: Shall I erase your memory of your quest for the Third Key?
	ASK	30.0
	IF -YES, @Q4
; Necromancer
	TAKE T14
	TAKE T15
	TAKE T16
	TAKE T17
	TAKE T18
	TAKE T19
	TAKE T21
	TAKE T22
@Q4
	IF -T23-T24, @Q5
	1: Shall I erase your memory of your battle with Death?
	ASK	30.0
	IF -YES, @Q5
; Death
	TAKE T23
	TAKE T24
@Q5
	IF -T25-T26-T27-T28-T29, @Q6
	1: Shall I erase your memory of your quest to defeat The Void?
	ASK	30.0
	IF -YES, @Q6
; The Void
	TAKE T25
	TAKE T26
	TAKE T27
	TAKE T28
	TAKE T29
@Q6
	IF -T68, @End
	1: Shall I erase your memory of your battle with Dynasty?
	ASK	30.0
	IF -YES, @End
; Dynasty
    	TAKE T68
@End
	1: I see no memories to take from you.
	1: Please return if you so desire.
	END

;---------
SCENE 21 revival, SCENE, "Revival"
	SEL   1
	OFFER2 11,30
	WAIT 1
	SOUND	"thunder.wav"
	WAIT 1
	GIVE L1
	GIVE H99999
	GIVE M99999
	END

;---------
SCENE 22 shop, SCENE, "Stones"
	OFFER 196, 197, 198, 199, 200
	MUSIC won.mid
	SOUND  "town4.wav"
	THEME	7
	END

;---------
SCENE 23 shop, SCENE, "Armor"
	OFFER 4195, 3181, 4205, 3191, 4204, 3190, 4194, 3180
	MUSIC won.mid
	SOUND  "town3.wav"
	THEME	7
	END

;---------
SCENE 24 shop, SCENE, "Weapons"
	OFFER 4196, 3182, 4203, 3189, 4202, 3188, 4201, 3187, 4200, 3186, 4199, 3185, 4198, 3184, 4197, 3183
	MUSIC won.mid
	SOUND  "town.wav"
	THEME	7
	END

;---------
SCENE 25 shop, SCENE, "Jewelry"
	OFFER 4207, 3193, 4206, 3192
	MUSIC won.mid
	SOUND  "town2.wav"
	THEME	7
	END

;---------
SCENE 26 church, SCENE, "Town Well"
	MUSIC	church.mid
	ACTOR   1, "Priest", (CA)Priest, 5, 25, 90
	POSE	3, 4, 3
	SEL	1
	1: Welcome home %1.
	1: Rest and be healed.
	GIVE   L1
	GIVE H99999
	GIVE M99999
	END

;---------
SCENE 27 home, SCENE, "Home"
	IF T29, @hasT29
	IF T27, @hasT27
	IF T25, @hasT25
	ACTOR   1, "Diana", (CA)Diana, 32, 25, 90	
	1: %1, you're home!
	1: I was so worried. You were gone for days!
	1: Everybody from the town has been out searching for you!
	1: I... I thought you'd be gone forever.... just like father... 
	WAIT 3
	1: What happened?
	H: ... %1, ... that is my name?
	1: (puzzled) What do you mean?
	H: Who are you?
	1: I-it's Diana....
	1: Your sister!
	1: Oh... what's happened to you...?
	H: Look, I'm sorry, but been through quite an ordeal escaping from that damn castle and also I've seem to have lost my memory as well.
	1: How did you end up trapped in the castle?
	1: You were just supposed to be getting firewood...
	H: I don't know. I just don't know.
	H: Look. You say you are my sister, but I just don't know who you are, or who I am for that matter. 
	H: I just don't know what to do.....
	WAIT 5
	1: Well, if you've truley lost your memory, then I might know of someone that can help you.
	1: There's a legand speaking of an old hermit living in a cabin to the west of the castle.
	1: He supposedly is a great seer and dreamsmith. 
	1: If anyone can help you out, perhaps he can.
	H: Very well, I'll try seeking him out.
	H: Thank you.
	WAIT 2
	1: Good luck.....
	GIVE T25
	END

@hasT25
	N: There's no one here.
	END

@hasT27
	ACTOR   1, "Diana", (CA)Diana, 32, 25, 90
	1: Your back..... but, is your memory back too?
	H: Yes, it is, I.... I remember everything.  
	H: And ..... I've learned something new.
	1: Then sit. You must tell me all that has happened.
	H: Well, it's a long story. One that envolves a friend.
	1: I have the time. (grins)
	H: It all began ..........
	GIVE T29
	WAIT 2
	GOTO SCENE 48
	END

@hasT29
	ACTOR   1, "Diana", (CA)Diana, 32, 25, 90
	MUSIC Jeremy_East.mid
	1: Hello %1. (smiles)
	END

;---------
SCENE 28 town_square, SCENE, "Town Square"
	MUSIC won2.mid
	GAME 8
	IF T66, @hasT66
	ACTOR   1, "Dynasty", (CA)Dynasty, 1, 20, 80
	WAIT 8
	1: Hello there. I'm Dynasty, Castle Adventure's creator. 
	1: This will be my credits section for the game where I'll be talking about how I went about creating the world.
	1: But first, let me give you my thanks for taking the time to play it.
	1: I do appreciate that you have made it this far into the game and I hope you deign to continue till the end. 
	1: And I know that not many people at all will ever play this world, espicially since Well of Souls is a dying if not already dead game.
	1: For I had hoped to finish my world back when Well of Souls was still widley played, but alas, I didn't really have the drive and It ended up taking me years of off and on work going bit by bit.
	1: But after about a decade...
	WAIT 1
	1: (laughs)
	WAIT 1
	1: ...I've finally finished it. 
	1: So I hope you enjoy.
	WAIT 3
	1: Ok, now on to the acknowledgements.
	WAIT 1
	1: First off, I need to thank Kevin Bales, who made the original Castle Adventure game back in 1984. 
	1: I first played his game on an Apple Macintosh back when I was just a kid, and loved it. 
	1: As a Rouge-like game, it was so badass that it didn't even have graphics. Instead it used ASCII characters to simulate graphics and was also in black and white.
	WAIT 1
	1: Like I said, badass.
	WAIT 1
	1: You can even play the original game though use of the Item I have appropriated into my world as you have undoubtedly discovered.    
	1: Anyways, this game is what most of the maps and quests in the game are based off of.
	WAIT 1
	1: Another game that deserves credit is the CastleVania series by Konami.
	1: As another game that I grew up with in my youth, I incorporated various things from it into my world.
	1: Almost all of the monsters are from the Circle of the Moon and about half of the midi is from various CastleVania games.
	WAIT 3
	1: As for about everything else, such as the Scene Art, Object map, Game Buttons, etc...
	1: I either made the art myself or found it online from various sites.
	WAIT 3
	1: So that's it.
	1: Hope you've enjoyed my ranting. (smiles)
	WAIT 1
	1: Maybe I'll see you later on.
	WAIT 1
	1: Until then...
	MOVE  1, 0,70
	WAIT 1
	MOVE 1, 0,0, 1
	END
	
@hasT66
	GIVE I97
	ACTOR   1, "Dynasty", (CA)Dynasty, 1, 20, 80
	WAIT 8
	1: Hello there. I'm Dynasty, Castle Adventure's creator. 
	1: This will be my credits section for the game where I'll be talking about how I went about creating the world.
	1: But first, let me give you my thanks for taking the time to play it.
	1: I do appreciate that you have made it this far into the game and I hope you deign to continue till the end. 
	1: And I know that not many people at all will ever play this world, espicially since Well of Souls is a dying if not already dead game.
	1: For I had hoped to finish my world back when Well of Souls was still widley played, but alas, I didn't really have the drive and It ended up taking me years of off and on work going bit by bit.
	1: But after about a decade...
	WAIT 1
	1: (laughs)
	WAIT 1
	1: ...I've finally finished it. 
	1: So I hope you enjoy.
	WAIT 3
	1: Ok, now on to the acknowledgements.
	WAIT 1
	1: First off, I need to thank Kevin Bales, who made the original Castle Adventure game back in 1984. 
	1: I first played his game on an Apple Macintosh back when I was just a kid, and loved it. 
	1: As a Rouge-like game, it was so badass that it didn't even have graphics. Instead it used ASCII characters to simulate graphics and was also in black and white.
	WAIT 1
	1: Like I said, badass.
	WAIT 1
	1: You can even play the original game though use of the Item I have appropriated into my world as you have undoubtedly discovered.    
	1: Anyways, this game is what most of the maps and quests in the game are based off of.
	WAIT 1
	1: Another game that deserves credit is the CastleVania series by Konami.
	1: As another game that I grew up with in my youth, I incorporated various things from it into my world.
	1: Almost all of the monsters are from the Circle of the Moon and about half of the midi is from various CastleVania games.
	WAIT 3
	1: As for about everything else, such as the Scene Art, Object map, Game Buttons, etc...
	1: I either made the art myself or found it online from various sites.
	WAIT 3
	1: So that's it.
	1: Hope you've enjoyed my ranting. (smiles)
	WAIT 1
	1: Maybe I'll see you later on.
	WAIT 1
	1: Until then...
	MOVE  1, 0,70
	WAIT 1
	MOVE 1, 0,0, 1
	END

;---------
SCENE 29 cabin, SCENE, "Cabin"
	IF T28, @hasT28
	IF T26, @hasT26
	IF T25, @hasT25
	N: There's no one here....
	END

@hasT25
	ACTOR   1, "Jei", (CA)Jei, 4, 25, 90
	H: Jei!? 
	H: Then you've escaped the Castle as well.
	1: Yes, quite some time ago actually.
	H: What? Then what have you been doing there? And why are you in this cabin?
	H: I was told a great seer resided here, and could help me regain my memory.
	1: That may have been true, ..... once.
	1: That's his corpse there. (Points to the skeleton)
	1: But this is not important right now.
	H: Then my hopes have been for naught.....
	1: Oh, but that is not so.
	1: There is still...  another way .... that you can retreive your memory.
	H: How?
	1: Legand says, that if you enter the castle, you are stripped of your memory and must find your way back out.
	1: If you can succeed, your memory will be restored and you receive the ultimate selftruth.
	1: Now for most, this never happens, as they suscume to the demons that reside within the castle itself, as well as from within their own souls.
	1: But as for you, and a mere handful of others, you have indeed succeeded. 
	H: Then why am I still missing my memory? 
	1: That is because you have not passed the final test.
	1: You have indeed defeated the demons of the castle, but as for the ones within you, they has not yet been vanquished...
	1: You must face your own inner demon; your "evil side", that which embodies all of your hidden vices, your sinful desires, your hateful lusts.....
	1: It must be confronted.... and defeated....
	H: But how? 
	H: How can I confront my own self?
	H: Is such a thing even possible?
	1: Oh, but it is. 
	1: There is a hidden place.... which resides within the old cemetery. 
	1: Go to it.  
	1: It is there where you shall find you answers.
	1: And it is there, where I will be awaiting you.....
	WAIT 2
	MOVE  1, 0,70
	WAIT 1
	MOVE 1, 0,0, 1 
	H: Jei! Wait!
	GIVE T26
	END

@hasT26
	IF T27, @hasT27
	N: There's no one here...
	END

@hasT27
	ACTOR   1, "Jei", (CA)Jei, 4, 30, 75 
	MUSIC won.mid
	WAIT 3
	H: Well, we beat him.
	1: Yes..... it appears so...
	WAIT 2
	H: Jei, your chest! You're bleeding.
	WAIT 1
	MUSIC won.mid
	SOUND  "farwell.wav"
	THEME	7
	1: Dont worry... it looks worse than it is....
	WAIT 2
	1: Uhggggphh (coughs up bloods) .....
	WAIT 3
	1: Well.... maybe not..... heh...
	WAIT 5
	H: Jei....
	WAIT 5
	1: Don't cry for me now... 
	1: Instead... just listen...
	WAIT 5
	1: I, like yourself, was also a victim of the castle.
	WAIT 1
	1: And I too was able to escape..... but I never could defeat my own personal demons.
	WAIT 1
	1: Thus, I was doomed to live my life out without my memory.
	WAIT 5
	1: But now, thanks in part to you, I have finally found myself again, after waiting what seems an eternity.
	WAIT 1
	H: And I... thanks to your help.
	WAIT 2
	1: Yes.
	WAIT 1
	1: But now that I have finally found myself again... it seems I must go. 
	WAIT 3
	H: You still haven't told me yet you know....
	WAIT 2
	1: Told you what...
	WAIT 2
	H: What your name is, your real one...
	WAIT 5
	1: That... is of no importance now. 
	H: But..
	1: I tell you, it no longer matters.
	WAIT 2
	1: What does matter, is what you have accomplished here. 
	WAIT 2
	1: You have faced your fears, and have put them to rest.
	WAIT 2
	1: You discovered that if you beleive in yourself, if you truley believe, then nothing can stand in your way.
	WAIT 2
	1: This, is the selftruth you have come to see.
	WAIT 5
	1: Farewell... %1.  
	WAIT 2
	1: ..................
	WAIT 1
	N: Jei has died...
	WAIT 5
	H: Farewell........... Jei.
	GIVE T28
	WAIT 3
	MOVE 1, 50,10
	MOVE 1, 0,0, 1 
	END

@hasT28
	MUSIC won.mid
	SOUND  "farwell.wav"
	THEME	7
	N: Jei has departed from this relm.
	END

;---------
SCENE 30 cemetery_gate, SCENE, "Graveyard"
	IF T26, @hasT26
	N: You feel an ominous pressance... 
	END

@hasT26
	WAIT 5
	GOTO LINK 12,0
	END

;---------
SCENE 31 prison, SCENE, "Prison"
	MUSIC dead.mid
	END
 
;---------
SCENE 32 lair, SCENE, "Tickets"
	MUSIC Cant_Touch_This.mid
	IF T66, @hasT66
	IF T24, @tickets
	N: You can't have anything from here until you've escaped the castle.
	END

@tickets
	ACTOR   1, "Dynasty", (CA)Dynasty, 1, 20, 80
	1: Well done, you've discovered "one" of my lairs. 
	1: So here's some items to help you get around the castle.
	N: You've received some tickets!
	WAIT 2
	1: Until we meet again.....
	MOVE 1, 0,0, 1
	GIVE T66
	GIVE I96
	GIVE I97
	GIVE I98
	GIVE I99
	GIVE I100
	END

@hasT66
	GIVE I96
	N: There's no one here...
	END

;---------
SCENE 33 great_hall, SCENE, "Tower"
	IF T66, @hasT66
	IF T16, @hasT16
	IF T3, @hasT3
	N: There's no one here...
	END
	
@hasT66
	GIVE I100
	N: There's no one here...
	END

@hasT3
	ACTOR   1, "Jei", (CA)Jei, 4, 30, 75
	1: Well well well, we meet agian.
	WAIT 1
	1: I see you haven't "escaped" yet.
	1: So, I guess I'll help you out... 
	WAIT 2
	1: Again. 
	WAIT 1
	1: But only if you can prove yourself once more.
	WAIT 2
	1: Battle another one of my demons and I'll give you some more advice.
	1: But I've got to warn you, this one's a little tougher than the last one...
	WAIT 2
	1: Ok. Alot tougher... (grins)
	WAIT 1
	1: I hope you're ready....
	WAIT 2
	MUSIC boss1.mid
	FIGHT 119
	IF WIN, @heWon
	IF DEAD, @heDead
	END

@heWon
	ACTOR   1, "Jei", (CA)Jei, 4, 30, 75
	1: That's twice you've beaten me now.
	1: You've grown quite strong.
	WAIT 2
	1: Very well, here is my advice...
	WAIT 3
	1: Don't go into the basement unprotected.
	1: You'll need a special necklace.
	1: If memory serves, then it's on the second floor.
	1: But watch out for its gaurdian, he might be more than you can handle....
	GIVE T16
	END

@heDead
	ACTOR   1, "Jei", (CA)Jei, 4, 30, 75
	1: I'd say I told you so, but then again.... (laughs)
	WAIT 2
	1: Come back and try again when you're ready.
	1: I'll be waiting...
	END

@hasT16
	N: There's no one here...
	END

;---------
SCENE 34 vault, SCENE, "Vault"
	IF T31, @hasT31
	IF P100, @reward
	ACTOR   1, "Blood Hunter", (CA)Hunter, 11, 25, 90
	1: Come back when you've got more blood on your hands.....
	END

@reward
	ACTOR   1, "Blood Hunter", (CA)Hunter, 11, 25, 90
	1: Hm?
	1: Looks like you've killed at least 100 people...
	WAIT 2
	1: Here's a special gift for spilling so much blood. 
	1: Shaaaaaaaaaaaaaaaaaahahahahahhh....
	GIVE T31
	GIVE I5001
	N: You've received the Ring of Dynasty!
	END

@hasT31
	N: There's no one here...
	END

;---------
SCENE 35 crypt_entrance, SCENE, "Tomb"
	N: You wave the Scepter and the grave stone disappers leaving a trapdoor in its place
	WAIT 3
	N: You open the trap door and decend down a set of stairs into the tomb....
	WAIT 3
	GOTO LINK 11,0
	END

;---------
SCENE 36 crypt, SCENE, "The Void"
	IF T27, @hasT27
	ACTOR   1, "The Void", mirror, 1, 30, 65
	ACTOR   2, "Jei", (CA)Jei, 4, 80, 65
	1: So, YoU'vE fInAlLy MaDe It....
	H: You again!
	1: AnD yOu ToO jEi, It'S bEeN a WhIlE.....
	2: Not long enough...
	H: What have you done with my memory?!
	1: DoN't WoRrY, yOu CaN hAvE iT bAcK.
	1: AlL yOu HaVe To Do Is DeFeAt Me.
	1: HaHAhaHaha.....
	2: Then defeat you we shall.
	WAIT 3
	MOVE 1, 0,0, 1
	MOVE 2, 0,0, 1
	MUSIC boss3.mid
	FIGHT 129, -128
	IF WIN, @heWon
	IF DEAD, @heDead
	END
	
@heDead
	ACTOR   1, "The Void", mirror, 1, 30, 65
	ACTOR   2, "Jei", (CA)Jei, 4, 80, 65
	1: YoU'vE lOsT..... aNd AfTeR cOmInG sO fAr......
	1: A pItY...
	1: HaHAhaHahaaaaa......
	GOTO LINK 0,0
	END

@heWon	
	ACTOR   1, "The Void", mirror, 1, 30, 65
	1: ImPoSsIbLe......
	1: To HaVe BeEn DeFeAtEd By ThE lIkEs Of YoU.....
	H: But you have been defeated!
	H: Now return what is ours!
	1: VeRy WeLl, YoU'vE pRoVeN yOuR vAlLoR.
	1: TaKe BaCk YoUr DaMnEd MeMoRiEs.......
	WAIT 3
	N: Your memories rush back to you into you faster than you can contemplate.
	WAIT 3
	N: Events past, cherished moments, dreams long forgotten...
	WAIT 3
	N: Every thought you every had comes back to you in the blink of an eye.
	WAIT 3
	N: You finally know who you are!
	WAIT 3
	N: Your name is %1!!!!!!!
	WAIT 3
	GIVE T27
	GOTO LINK 9,1,1
	END

@hasT27
	N: The Demon is gone.
	END

;---------
SCENE 37 lair2, SCENE, "NOWHERE"
	MUSIC canttouchthis.mid
	IF T67, @hasT67
	IF T66, @act
	N: ??? .....
	END
	
@act
	ACTOR   1, "Dynasty", (CA)Dynasty, 1, 20, 80
	1: Incredible... you've discovered my "second" lair.
	WAIT 1
	1: Here, take this, it's a companion to keep you company.
	WAIT 2
	GIVE I1003
	GIVE T67
	N: You've received a Ghost Bat!
	WAIT 5
	1: Find my final lair, and you shall earn the right to face me in battle.
	WAIT 1
	1: But be wary. 
	1: While the rewards may be great, the price for failure.....unfathomable.
	1: Until then...
	WAIT 3
	MOVE 1, 0,0, 1
	END   
	  
@hasT67
	N: There's no one here...
	END

;---------
SCENE 38 lair3, SCENE, "Dynasty"
	IF T68, @hasT68
	IF T67, @act
	N: NOWHERE ......
	END

@act
	ACTOR   1, "Dynasty", (CA)Dynasty, 1, 20, 80
	1: So, you've come, as I knew you would.
	1: I Hope the place wasn't too hard to find. (smiles)
	WAIT 2
	1: Well, do you still wish to challenge me?
	ASK 30
	IF -YES, @SaidNo
	1: Then prepare yourself!
	WAIT 2
	MOVE 1, 0,0, 1
	MUSIC duel.mid
	FIGHT2 130
	IF WIN, @heWon
	IF DEAD, @heDead
	END

@SaidNo
	ACTOR   1, "Dynasty", (CA)Dynasty, 1, 20, 80
	1: Very well, but you know where I'm at if you change your mind.
	END

@heWon
	ACTOR   1, "Dynasty", (CA)Dynasty, 1, 20, 80
	1: Outstanding, you truly are worthy.
	1: Take this amulet, you've earned it.
	GIVE T68
	GIVE I5000
	WAIT 2
	N: You've received Dynasty's Amulet!
	WAIT 2
	1: I have no more to offer you, farewell.
	WAIT 2
	MOVE 1, 0,0, 1
	END

@heDead
	ACTOR   1, "Dynasty", (CA)Dynasty, 1, 20, 80
	TAKE I3180
	TAKE I3181
	TAKE I3182
	TAKE I3183
	TAKE I3184
	TAKE I3185
	TAKE I3186
	TAKE I3187
	TAKE I3188
	TAKE I3189
	TAKE I3190
	TAKE I3191
	TAKE I3192
	TAKE I3193
	TAKE I4194
	TAKE I4195
	TAKE I4196
	TAKE I4197
	TAKE I4198
	TAKE I4199
	TAKE I4200
	TAKE I4201
	TAKE I4202
	TAKE I4203
	TAKE I4204
	TAKE I4205
	TAKE I4206
	TAKE I4207
	1: I warned you of the price of failure...
	WAIT 2
	N:  All of your level 99 equipment is gone! Oh noes!
	WAIT 2
	1: HahaHAHAha....
	END

@hasT68
	N: Dynasty has left...
	END

;---------
SCENE 39 fairy2, SCENE, "Faries"
	IF T6, @hasT6
	IF T4, @hasT4
	IF T3, @hasT3
	N: You feel a presence, but it quickly fades...
	END

@hasT3
	ACTOR   1, "Fairy1", (CA)Angel2, 1, 30, 65
	ACTOR   2, "Fairy2", (CA)Angel2, 1, 60, 65
	1: Oh? Who is this?
	2: Yes. Who are you and what do you want?
	H: Me? I'm... uh.... 
	1: Well? We asked you who you were!
	2: Why don't you answer?
	H: Well, you see...
	1: He must be trying to hide something.
	2: You're right! I bet he's a demon in disguise!
	H: No, I'm just...
	1: I think you might be on to something!
	2: Quickley! Let us banish him!
	GIVE T4
	WAIT 2
	N: The faries cast a spell and you are swept away. 
	WAIT 1
	GOTO EXIT
	END

@hasT4
	ACTOR   1, "Fairy1", (CA)Angel2, 1, 30, 65
	ACTOR   2, "Fairy2", (CA)Angel2, 1, 60, 65
	1: You again?
	2: Haven't you learned your lesson?
	WAIT 2
	IF T5, @hasT5
	N: The faries cast a spell and you are swept away again. 
	WAIT 2
	GOTO EXIT
	END

@hasT5
	ACTOR   1, "Fairy1", (CA)Angel2, 1, 30, 65
	ACTOR   2, "Fairy2", (CA)Angel2, 1, 60, 65
	N: As the faries prepare to banish you, this time you wave the magic wand you got from the Spider.
	MUSIC summon2.mid
	WAIT 3
	1: Oh no! He has great magics!
	2: It's terriable!
	1: Horriable!
	2: We must warn the queen!
	WAIT 5
	MOVE 1, 0,0, 1
	MOVE 2, 0,0, 1
	N: In their rush, one of the faries droped some boots.
	GIVE I705
	GIVE T6
	END

@hasT6
	N: The faries have left.
	END

;---------
SCENE 40 vampire, SCENE, "Vampire"
	ACTOR   1, "Vampire", (CA)Vampire, 1, 15, 85
	IF T11, @hasT11
	IF T10+T9, @hasboth
	IF T9, @hasT9
	IF T10, @hasT10
	1: ............
	WAIT 5
	1: ..................
	WAIT 5
	1: .......................... 
	WAIT 5
	END

@hasT9
	ACTOR   1, "Vampire", (CA)Vampire, 1, 15, 85
	N: You throw the water from the chalice on the vampire.
	WAIT 3
	1: !
	WAIT 2
	1: .........................
	END 


@hasT10
	ACTOR   1, "Vampire", (CA)Vampire, 1, 15, 85
	N: You hold up the cross tolds the vampire.
	WAIT 3
	1: !
	WAIT 2
	1: .........................
	END 

@hasboth
	ACTOR   1, "Vampire", (CA)Vampire, 1, 15, 85
	N: You throw the water from the chalice on the vampire and hold up the holy cross. 
	WAIT 5
	1: !!
	WAIT 2
	1: !!!!!!!
	WAIT 3
	N: The Vampire flees.
	WAIT 2
	MOVE 1, 0,0, 1
	WAIT 2
	N: In his hurry, the vampire has left his boots behind.
	GIVE I701
	GIVE T11
	END

@hasT11
	ACTOR   1, "Vampire", (CA)Vampire, 0, 0, 1
	N: The vampire has fled.
	END

;---------
SCENE 41 fountain, SCENE, "Fountain"
	MUSIC won.mid
	THEME 2
	IF T9, @hasT9
	IF T8, @hasT8
	N: You see a large fountain made of granite in the center of the castle garden.
	WAIT 5
	N: From within, water pours out of it into a catch basin.  
	END

@hasT8
	THEME 2
	N: You take the chalice given to you by the fairy queen and fill it with the water from the fountain.
	WAIT 5
	N: In an instant, there is an eerie poof, as the water within it magicaly begins to sparkle.
	GIVE T9
	END

@hasT9
	THEME 2
	N: You can hear the water flowing out of the fountain.
	END

;---------
SCENE 42 candle, SCENE, "Glasses"
	IF T18, @hasT18
	N: Bloooooooddddddddd.....
	MUSIC boss1.mid
	FIGHT 127
	IF WIN @heWon
	END

@heWon
	GIVE T18
	GIVE I101
	N: You got the Glasses from the Ghost Bat.
	END

@hasT18
	N: The Ghost Bat is defeated.
	END

;---------
SCENE 43 library2, SCENE, "Book"
	IF T20, @hasT20
	IF T19, @hasT19
	IF E101, @GlassesOn
	N: You approach the library and start to walk around, browsing the shelves.   
	WAIT 5
	N: Walking up and down them, you can see that there are hundreds of thousands of books to choose from.
	WAIT 5
	N: Various titles cross your eyes as you look around aimlessly.
	WAIT 5
	GOTO @names1
	END
		
@names1
	N: Black Magic 101 .... 
	WAIT 5
	N: Tormad's Journey ....
	WAIT 5
	N: Etrigan's Domain ....
	WAIT 5
	N: The Black Company ....
	WAIT 5
	N: Kai's Cantrips ....
	WAIT 5
	N: The Cronicles of Thomas Covenant ....  
	WAIT 5
	N: Words of Binding ....
	WAIT 5
	N: The Prophesy of Sai ....
	WAIT 5
	N: Maps of Midgard ....
	WAIT 5
	N: The Seven Wards ....
	WAIT 5
	GOTO @names1
	END

@GlassesOn
	N: You put on the glasses and blink in fanacination.
	WAIT 5
	N: Apparently, by looking through them, everything around you seems to become dull and fade out of perspective.
	WAIT 5
	N: Everything that is, except a certain book, which now glows brightly...
	WAIT 5
	N: After making your way towards this book, you pick it up and read its title: "The Book Of Magical Keys"
	WAIT 5
	N: You decide to take the book and place it in your inventory, planing to refference it later.
	GIVE T19
	END

@hasT19
	N: Various titles cross your eyes as you look around aimlessly.
	WAIT 5
	GOTO @names2
	END
		
@names2
	N: Black Magic 101 .... 
	WAIT 5
	N: Tormad's Journey ....
	WAIT 5
	N: Etrigan's Domain ....
	WAIT 5
	N: The Black Company ....
	WAIT 5
	N: Kai's Cantrips ....
	WAIT 5
	N: The Cronicles of Thomas Covenant ....  
	WAIT 5
	N: Words of Binding ....
	WAIT 5
	N: The Prophesy of Sai ....
	WAIT 5
	N: Maps of Midgard ....
	WAIT 5
	N: The Seven Wards ....
	WAIT 3
	IF E101, @secretbook
	WAIT 2
	GOTO @names2
	END

@secretbook
	N: After looking around some more, you decide to put the glasses on once again.
	WAIT 5
	N: As before, everything starts to become dull and blurry.
	WAIT 5
	N: You are about to take the glasses off, but suddenly, as you are crossing a section between the shelves, you notice a very faint light that you didn't see before. 
	WAIT 5
	N: This one is much farther away than the previous one, and it takes you a quite a while to reach it.
	WAIT 5
	N: But reach it you do, and you find it to be another book, one that was almost hidden away behind many others.
	WAIT 5
	N: Pulling it out, you blow a thick lair of dust off as you attempt to make out it's title.
	WAIT 5
	N: The ink is badley faded, and cover severly worn, but you are at least able to make out one single word: "Dynasty" 
	WAIT 5
	N: Opening it, you see that most of the ink on its pages has faded due to age or is missing alltogether. Though you are able to read one certain section of the book.
	WAIT 5
	N: It goes on to talk about how their are several hidden lairs within the castle, each holding a secret treasure. 
	WAIT 5
	N: But as you continue down the page, the text begins to fade once again and becomes impossible to read.
	WAIT 5
	H: Secret lairs.... hmm.......
	GIVE T20
	WAIT 5
	END 

@hasT20
	N: Various titles cross your eyes as you look around aimlessly.
	WAIT 2
	GOTO @names3
	END
		
@names3
	N: Black Magic 101 .... 
	WAIT 5
	N: Tormad's Journey ....
	WAIT 5
	N: Etrigan's Domain ....
	WAIT 5
	N: The Black Company ....
	WAIT 5
	N: Kai's Cantrips ....
	WAIT 5
	N: The Cronicles of Thomas Covenant ....  
	WAIT 5
	N: Words of Binding ....
	WAIT 5
	N: The Prophesy of Sai ....
	WAIT 5
	N: Maps of Midgard ....
	WAIT 5
	N: The Seven Wards ....
	WAIT 5
	GOTO @names3
	END

;---------
SCENE 44 key, SCENE, "Key"
	IF T21, @hasT21
	IF T19, @hasbook
	N: You find yourself looking at a huge pile of keys stacked upon the rooms desk.
	WAIT 5
	H: What could they all be for?   
	END

@hasbook
	N: You open "The Book Of Magical Keys" and refference its many pages until you come across the section that refers to the dungeon's doors.
	WAIT 5
	N: It shows you a picture of the approtiate key, and you search through the massive pile to find it.
	WAIT 5
	N: After some time, you finally find the right key. It is very old and jaded, but is still in one piece.
	GIVE T21
	END

@hasT21
	N: You stare at the massive pile and think to yourself...
	WAIT 5
	H: I wonder what the rest of these keys unlock?
	END

;---------
SCENE 45 door, SCENE, "Dungeon Door A"
	IF T21, @hasT21
	N: The door is locked and you don't have the proper key to open it.
	END

@hasT21
	WAIT 5
	N: You use the Jaded Key and the door opens for you. 
	GIVE T109
	WAIT 3
	GOTO LINK 6,7
	END

;---------
SCENE 46 door, SCENE, "Dungeon Door B"
	IF T21, @hasT21
	N: The door is locked and you don't have the proper key to open it.
	END

@hasT21
	WAIT 5
	N: You use the Jaded Key and the door opens for you. 
	GIVE T109
	WAIT 3
	GOTO LINK 6,8
	END

;---------
SCENE 47 entrance, SCENE, "Castle Entrance"
	WAIT 5
	GOTO LINK 0,7
	END

;---------
SCENE 48 end, SCENE, "The End"
	MUSIC won.mid
	SOUND  "end.wav"
	THEME	7
	WAIT 9.5
	ACTOR   1, "Jei", (CA)Jei, 4, 40, 45
	WAIT 5
	MOVE	1,	50, 64
	WAIT 5
	MOVE	1,	60, 77
	WAIT 5
	MOVE	1,	70, 91	
	WAIT 10
	MOVE	1,	78, 97
	GIVE 5001
	GIVE T30
	WAIT 13
	MOVE	1,	70, 91
	WAIT 5
	MOVE	1,	60, 77
 	WAIT 5
	MOVE	1,	50, 64
	WAIT 5
	MOVE    1,  	40, 45
	WAIT 10
	MOVE	1,	0, 0, 1
	END

;---------
; Here is the last line of the SCENES section of the quest file.
-SCENES


; CASTLE ADVENTURE GAME --> http://www.benshoof.org/blog/castle-adventure/

