Appendix A:

Map Special Instruction List

ALLOW SPELL [0-255] [0-255]
Usage: Display Code
Description: Spell can be cast on this space and if it is, set a state bit
Arument 1: Spell Number
Arument 2: State bit to set if spell is cast

AMBIENT LIGHT [DEFAULT|0|1|2|3|4] [FALSE|TRUE]
Usage: Motion Code
Description: Set the ambient light for the map to given value, or reset to the map default
Arument 1: Amount of Light
Arument 2: Disable torches and light spells

ANIMATE [0-255] [0-255] [0-255]
Usage: Motion Code
Description: Animate through a sequence of walls.
Arument 1: Starting Wall Number
Arument 2: Ending Wall Number
Arument 3: Time Between Frames

ANIMATE LIST [0-255] [0-255] [0-255] [0-255]
Usage: Motion Code
Description: Animate through a list of walls (0 means skip slot).
Arument 1: First Wall Number
Arument 2: Second Wall Number
Arument 3: Third Wall Number
Arument 4: Time Between Frames

AUTO MAP [ON|OFF|LOSE_MAP]
Usage: Motion Code
Description: Set the auto map to be either on or off
Arument 1: Set auto map to ON/OFF/LOSE_MAP

BREAK
Usage: Motion/Display Code
Description: End execution of the script at this line

BUILDING [GUILD|TEMPLE|SHOP|INN|CUSTOM|EMPTY] [0-255] [0-255] [0-255]
Usage: Motion Code
Description: Special building type - use EMPTY only if you want other options otherwise, just set empty building bit
Arument 1: Building Type
Arument 2: Builing Index Number
Arument 3: Cost index (10 is normal price)
Arument 4: Inventory mask - only for shop (255 includes all item types, 248 includes all but potion/jewlery/fruit)

CHECK ATTRIB [LEVEL|STRENGTH|INTEL|DEXT|STAMINA|FIRE|MAGIC] [0-255] [0-255]
Usage: Motion/Display Code
Description: Check to see if at least one party member has at least attrib_val in a specific attribute, continue if they do, otherwise go to line
Arument 1: Attribute To Check
Arument 2: Minimum Attribute Value Required
Arument 3: Line Number To Jump To On Minimum Attribute Not Met

CHECK BLOCK [0-255]
Usage: Motion Code
Description: Check to see if the wall you are about to move onto is blocking and if it is continue, else jump to line
Arument 1: Line number to jump to on not BLOCKING

CHECK CHAR [0-255] [0-255] [NONE|A|B|C|D|E|F|G|H]
Usage: Motion/Display Code
Description: Check to see if a specific character is in party, and if so, set his position to variable name, otherwise goto line_num
Arument 1: Character Number
Arument 2: Line Number To Jump To If Character Not In Party
Arument 3: Variable to set to position of character if he is in party

CHECK CHAR CLASS [0-255] [0-255] [NONE|A|B|C|D|E|F|G|H]
Usage: Motion/Display Code
Description: Check to see if a specific class of character is in party, and if so, set first such char position to var name, else goto line_num
Arument 1: Character Class Number
Arument 2: Line Number To Jump To If Character Not In Party
Arument 3: Variable to set to position of first such character in party

CHECK DIRECTION [NORTH|SOUTH|WEST|EAST] [0-255]
Usage: Motion/Display Code
Description: Check if the direction the party is facing
Arument 1: Direction
Arument 2: Line Number To Jump To If Comparison is False

CHECK GOLD [0-65535] [NONE|A|B|C|D|E|F|G|H] [0-255]
Usage: Motion/Display Code
Description: Check to see if the pary has at least amount gold and continue to the next line if they do, otherwise, go to line
Arument 1: Amount of Gold To Check For
Arument 2: Variable Name
Arument 3: Line Number To Jump To If They Didn't Have That Much Gold

CHECK INVENTORY [NONE|A|B|C|D|E|F|G|H] [0-255]
Usage: Motion Code
Description: Check to see if party has room in inventorySets variable to num free inventory slots
Arument 1: Variable to set to num free inventory slots among party
Arument 2: Line Number To Jump To If no inventory room In Party

CHECK LIGHT [<=|>=|==|!=] [0|1|2|3|4] [0-255]
Usage: Motion/Display Code
Description: Check the current light, jump to line if comparison FALSE
Arument 1: Operator
Arument 2: Amount of Light
Arument 3: Line number to jump to if comparison is FALSE

CHECK NUM CHARS [<=|>=|==|!=] [0-255] [0-255]
Usage: Motion/Display Code
Description: Check if the number of characters in your party is <,>,= Number If NumChars Op Amount is false, jump to line
Arument 1: Operator
Arument 2: Number of characters for comparison
Arument 3: Line Number To Jump To If Comparison is False

CHECK OBJECT [0-9999] [EQIP|UNEQ|EITH] [ANY|ALL] [0-255]
Usage: Motion/Display Code
Description: Check to see if the pary has an object and continue to the next line if they do, otherwise, go to line
Arument 1: Object Number
Arument 2: Type: EQIP = Equipped, UNEQ = Unequipped, EITH = Either
Arument 3: Party Members: ANY = any one has, ALL = all characters have
Arument 4: Line Number To Jump To On Object Not Found

COMMENT [0-255] [0-255]
Usage: Motion/Display Code
Description: Add a comment to the script
Arument 1: SpecialNum
Arument 2: CommentNum

COUNT OBJECT [0-255] [IDEN|UNID|EITH] [EQIP|UNEQ|EITH] [0-255]
Usage: Motion Code
Description: Count the number of objects of a certain object class and assign the count to variable A
Arument 1: Object Class Mask 255 = all tiems, 1=misc, 2=jewelry, 4=potions 8=fruit, 16=armor, 32=spell, 64=weapon, 128=torch
Arument 2: Identified / Unidentified / Either
Arument 3: Type: EQIP = Equipped, UNEQ = Unequipped, EITH = Either
Arument 4: Body position (or Misc mask) 255 = all, 1=helmet, 2=shield, 4=armor, 8=ring, 16=neclace, 32=gauntlet, 64=bracers

CYCLE CHK [A|B|C|D|E|F|G|H] [<=|>=|==|!=] [0-255] [0-255]
Usage: Motion/Display Code
Description: Check the value of a cycle, continue if the comparison is TRUE, else jump to line
Arument 1: Cycle Number
Arument 2: Operation
Arument 3: Value
Arument 4: Line number to jump to on FALSE

CYCLE START [A|B|C|D|E|F|G|H] [0-255] [UP|DOWN] [PING|WRAP]
Usage: Motion Code
Description: Set a cycle to range from 0 to Max, moving up or down, and either ping back and forth, or wrap back to the bottom/top
Arument 1: Cycle Number
Arument 2: Max Value
Arument 3: Start Moving
Arument 4: Cycle Type

DAY OF MONTH [1-30] [1-30] [0-255]
Usage: Motion/Display Code
Description: Check day of month in range and jump to line if not in range
Arument 1: Min Day Number
Arument 2: Max Day Number
Arument 3: Line number to jump to on not in range

DAY OF WEEK [SUN|MON|TUE|WED|THR|FRI|SAT] [SUN|MON|TUE|WED|THR|FRI|SAT] [0-255]
Usage: Motion/Display Code
Description: Check day of week in range and jump to line if not in range
Arument 1: Min Day Number
Arument 2: Max Day Number
Arument 3: Line number to jump to on not in range

DISPLAY WALL [0-255]
Usage: Display Code
Description: Display a given wall rather than what is given in the map
Arument 1: Wall Number To Display

END
Usage: Description: Built in Command, always ends a script

FULL IMAGE [0-255] [0-9999]
Usage: Motion Code
Description: Encounter a special thing, switch to full screen showing tile and displaying text and click 'ok' to continue
Arument 1: Graphic Tile Number
Arument 2: Text Message Number

FULL TEXT [0-9999]
Usage: Motion Code
Description: Display text message on a full screen
Arument 1: Text Message Number

GIVE GOLD [0-65535] [NONE|A|B|C|D|E|F|G|H]
Usage: Motion Code
Description: Give some gold constant plus (optional) variable
Arument 1: Amount of Gold To Give
Arument 2: Variable Name

GIVE OBJECT [0-9999] [0-255]
Usage: Motion Code
Description: Give a specific object to the party, continue if success, go to line on failure (becuase inventory full)
Arument 1: Object Number
Arument 2: Line Number To Jump To On Failure To Give Object (Full Inventory)

GOLD TRAP [0-255] [UNAVOIDABLE|AVOIDABLE]
Usage: Motion Code
Description: Steals gold from party
Arument 1: 10 X Amount Of Gold
Arument 2: Type of Trap

IDENTIFY INVENTORY [0-255] [0-255]
Usage: Motion Code
Description: Identify an group of objects that the party has - Usually used with CNT OBJ instruction
Arument 1: Object Class Mask 255 = all tiems, 1=misc, 2=jewelry, 4=potions 8=fruit, 16=armor, 32=spell, 64=weapon, 128=torch
Arument 2: Body position (or Misc mask) 255 = all, 1=helmet, 2=shield, 4=armor, 8=ring, 16=neclace, 32=gauntlet, 64=bracers

IDENTIFY OBJECT [0-9999]
Usage: Motion Code
Description: Identify an object number
Arument 1: Object Number

JOIN PARTY [0-255] [0-255]
Usage: Motion Code
Description: Have character join the party, continue to next instruction on success, goto line on failure
Arument 1: Character Number
Arument 2: Line Number To Jump To On Failure To Join

JUMP [0-255]
Usage: Motion/Display Code
Description: Jump to a line
Arument 1: Line Number To Jump To

JUMP IF CLEAR [0-255] [0-255]
Usage: Motion/Display Code
Description: Check to see if a given state is clear and jump to line if it is otherwise continue to the next line
Arument 1: State Number To Check
Arument 2: Line Number To Jump To

JUMP IF SET [0-255] [0-255]
Usage: Motion/Display Code
Description: Check to see if a given state is set and jump to line if it is otherwise continue to the next line
Arument 1: State Number To Check
Arument 2: Line Number To Jump To

MAP EXIT [1-255] [1-255] [0-255] [NORTH|SOUTH|WEST|EAST|NONE]
Usage: Motion Code
Description: Move the player to a new map at a new location
Arument 1: Destination X Coordinate
Arument 2: Destination Y Coordinate
Arument 3: Destination Map Number (255 = to this map)
Arument 4: Face Direction

MAP SQUARE [0-9999]
Usage: Display Code
Description: Display a different map square in overhead map
Arument 1: Map square number

MENU DISPLAY [0-255] [0-9999]
Usage: Motion Code
Description: Display a menu items that was created by previously calling MenuItemAdd, jump to the line for the item selected
Arument 1: Graphic Tile Number
Arument 2: Text Message Number

MENU ITEM ADD [0-9999] [0-255]
Usage: Motion Code
Description: Add a menu item to the menu that will be displayed, jump to line number if this items is selected
Arument 1: Text Message Number
Arument 2: Line Number To Jump To

MESSAGE [0-255] [0-9999]
Usage: Motion Code
Description: Encounter a special thing, switch to 'Quarter' screen showing tile and displaying text and click 'ok' to continue
Arument 1: Graphic Tile Number
Arument 2: Text Message Number

MONSTER [0-255] [1-15] [0-255]
Usage: Motion Code
Description: Encounter a specific monster, execution continues to the next line if the monster is killed, otherwise, go to line
Arument 1: Monster Number
Arument 2: Number of monsters in the group
Arument 3: Line Number To Jump To If Monster NOT Killed (0=more monster groups)

MONSTER DENSITY [0-255]
Usage: Motion Code
Description: Set the monster density for the map to given value 255 = return to default map value
Arument 1: Monster Density Value - 255 = set to default

MOON PHASE [NONE|1/4^|HALF^|3/4^|FULL|3/4v|HALFv|1/4v] [NONE|1/4^|HALF^|3/4^|FULL|3/4v|HALFv|1/4v] [0-255]
Usage: Motion/Display Code
Description: Check phase of moon in range and jump to line if not in range
Arument 1: Min Phase
Arument 2: Max Phase
Arument 3: Line number to jump to on not in range

MOVE ALLOW
Usage: Display Code
Description: Allow the character to move onto this square (that would otherwise be blocked

MOVE BLOCK
Usage: Display Code
Description: Prevent the character from moving onto this square that would otherwise not be blocked

NUM QUESTION [0-255] [0-9999] [A|B|C|D|E|F|G|H]
Usage: Motion Code
Description: Present a question - prompt for numeric value, and assign it to a variable
Arument 1: Graphic Tile Number
Arument 2: Text Message Number
Arument 3: Variable Name

POPUP TEXT [0-9999]
Usage: Motion Code
Description: Show text message (Not for Quarter view) substitue @c, @o, @g for last touched character, object, and/or gold
Arument 1: Text Message Number

PORTAL ENTER [0-31] [0-255]
Usage: Motion/Display Code
Description: Portal can be cast on this space / Check to see if portal was cast on this space
Arument 1: Portal Number
Arument 2: Line Number To Jump To On Portal NOT Cast

PORTAL RETURN [0-31] [AUTO|CODE] [0-255]
Usage: Motion/Display Code
Description: Portal that was cast at PORTAL ENTER can be returned through here / Check to see if portal has been cast
Arument 1: Portal Number
Arument 2: Auto return, or fall through to other code
Arument 3: Line Number To Jump To On Portal NOT Cast

QUESTION [0-255] [0-9999] [0-255]
Usage: Motion Code
Description: Present a yes/no question - goto line on 'no', continue to next instruction on 'yes'
Arument 1: Graphic Tile Number
Arument 2: Text Message Number
Arument 3: Line Number To Jump To On NO Answer

REDRAW [0-255]
Usage: Motion Code
Description: Redraw the 3D view (if in 3D mode) and optionally delay after
Arument 1: Time to delay after redraw

REGEN [0-255] [UNAVOIDABLE|AVOIDABLE] [HP|SP|BOTH]
Usage: Motion Code
Description: Regenerate HP or SP or both
Arument 1: Amount Of Points to Regen Per trigger
Arument 2: Type of Trap
Arument 3: Type of points to regenerate

RERUN CODE
Usage: Motion Code
Description: Re-run the special code for the square you are standing on after you attempt to move onto a blocking square with this instruction

SET CHAR [FIRST|RANDOM]
Usage: Motion Code
Description: Set the @c character number to either the first or a random character in the party
Arument 1: Character Number

SET LAST [CHAR|OBJT|GOLD] [0-65535]
Usage: Motion Code
Description: Set the values that will be substitued for @c=CHAR @o=OBJT @g=GOLD
Arument 1: Type of variable to set
Arument 2: Value

SOUND [NOW|QUEUE|ANIMATE] [CLICK|POISON CLOUD|RUMBLE|EXPLOSION|DOOR TICK|FANFARE1|FANFARE2|TELEPORT1|TELEPORT2|ARROW|KEY|SOUND1]
Usage: Motion Code
Description: Play a sound
Arument 1: When to Play NOW = now, QUEUE = end of special codeANIMATE = with each frame of the next animate instruction
Arument 2: Sound Type To Play

STATE CLEAR [0-255]
Usage: Motion Code
Description: Clear a given state
Arument 1: State Number To Clear

STATE SET [0-255]
Usage: Motion Code
Description: Set a given state
Arument 1: State Number To Set

STATE TOGGLE [0-255]
Usage: Motion Code
Description: Toggle a given state
Arument 1: State Number To Toggle

SWAP OBJECT [0-9999] [0-9999] [FST|ALL] [0-255]
Usage: Motion Code
Description: Check to see if the party has an object and replace it and continue to the next line if they do, otherwise, go to line
Arument 1: Object Number To Take
Arument 2: Object Number To Give
Arument 3: Swap first matching object, or all matching objects
Arument 4: Line Number To Jump To If Party Did Not Have The Object

TAKE GOLD [0-65535] [NONE|A|B|C|D|E|F|G|H] [0-255]
Usage: Motion Code
Description: Take a specific amount of gold, continue if the party had it, otherwise go to line
Arument 1: Amount of Gold To Take
Arument 2: Variable Name
Arument 3: Line Number To Jump To If They Didn't Have That Much Gold

TAKE OBJECT [0-9999] [0-255]
Usage: Motion Code
Description: Check to see if the party has an object and take it and contine to the next line if they do, otherwise, go to line
Arument 1: Object Number To Take
Arument 2: Line Number To Jump To If Party Did Not Have The Object

TEXT QUESTION [0-255] [0-9999] [0-9999] [0-255]
Usage: Motion Code
Description: Present a question - goto line on wrong answer, continue to next instruction on right answer
Arument 1: Graphic Tile Number
Arument 2: Text Message Number
Arument 3: Text Number Answer
Arument 4: Line Number To Jump To On Incorrect Answer

TIME CHK [7:30P|9:00P|10:30P|MDNGHT|1:30A|3:00A|4:30A|6:00A|7:30A|9:00A|10:30A|NOON|1:30P|3:00P|4:30P|6:00P] [7:30P|9:00P|10:30P|MDNGHT|1:30A|3:00A|4:30A|6:00A|7:30A|9:00A|10:30A|NOON|1:30P|3:00P|4:30P|6:00P] [0-255]
Usage: Motion/Display Code
Description: Check time of day in range and jump to line if not in range
Arument 1: MinTime
Arument 2: MaxTime
Arument 3: Line number to jump to on not in range

TIMER CHK [A|B|C|D|E|F|G|H] [<=|>=|==|!=] [0-255] [0-255]
Usage: Motion/Display Code
Description: Check the value of a timer, continue if timer compares TRUE else jump to line
Arument 1: Timer Number
Arument 2: Operation
Arument 3: Value to compare to
Arument 4: Line number to jump to if compare is FALSE

TIMER START [A|B|C|D|E|F|G|H] [0-255]
Usage: Motion Code
Description: Start a timer on a countdown
Arument 1: Timer Number
Arument 2: Starting Value

TOGGLE CHK [A|B|C|D|E|F|G|H] [0-255]
Usage: Motion/Display Code
Description: Check the value of a toggle, continue if toggle is on, else jump to line
Arument 1: Toggle Number
Arument 2: Line number to jump to on toggle not on

TOGGLE START [A|B|C|D|E|F|G|H] [OFF|ON] [0-255] [0-255]
Usage: Motion Code
Description: Set a toggle to starting value, keep on after n steps, keep off after n steps
Arument 1: Toggle Number
Arument 2: Starting Value
Arument 3: Switch to ON after n steps
Arument 4: Switch to OFF after n steps

TONE [0-65535] [0-255] [0-64]
Usage: Motion Code
Description: Play a tone immediately
Arument 1: FREQUENCY
Arument 2: Duration
Arument 3: Amplitude

TRAP MAGIC [0-255] [UNAVOIDABLE|AVOIDABLE] [0-255]
Usage: Motion Code
Description: Cast spell (cannot be a combat-only spell). If spell requires char target optional. If AVOIDABLE set, the levitate spell avoids the trap
Arument 1: Spell Number To Cast
Arument 2: Type of Trap
Arument 3: Character target number (required for some spells) - use 255 to choose a random character from the party.

TRAP PHYS [0-255] [UNAVOIDABLE|AVOIDABLE]
Usage: Motion Code
Description: Give damage to a random character
Arument 1: Amount Of Damage
Arument 2: Type of Trap

TRAP PHYS ALL [0-255] [UNAVOIDABLE|AVOIDABLE]
Usage: Motion Code
Description: Give damage to all players
Arument 1: Amount Of Damage
Arument 2: Type of Trap

TRAP SPIN [NORTH|SOUTH|WEST|EAST|REVERSE|LEFT|RIGHT|RANDOM] [UNAVOIDABLE|AVOIDABLE]
Usage: Motion Code
Description: Spin the player
Arument 1: Face Player Direction
Arument 2: Type of Trap

TRAP WARN [0-9999]
Usage: Display Code
Description: Warn group if they look at this square and have a warn spell cast
Arument 1: Text number, or 0 for default

TREASURE [0-255] [0-9999] [0-255]
Usage: Motion Code
Description: Give a treasure interface, continue on chest successfully openedjump to line on failure to open
Arument 1: Graphic Tile Number
Arument 2: Text Message Number
Arument 3: Line number to jump to on not opened

VAR CHECK [A|B|C|D|E|F|G|H] [<=|>=|==|!=] [0-65535] [0-255]
Usage: Motion/Display Code
Description: Check the value of a variable jump to line on comparison FALSE
Arument 1: Variable Name
Arument 2: Operation
Arument 3: Value
Arument 4: Line number to jump to on FALSE

VAR COMP [A|B|C|D|E|F|G|H] [<=|>=|==|!=] [A|B|C|D|E|F|G|H] [0-255]
Usage: Motion/Display Code
Description: Compare the value of two variables jump to line on comparison FALSE
Arument 1: Variable Name
Arument 2: Operation
Arument 3: Variable Name
Arument 4: Line number to jump to on FALSE

VAR EXP [A =|B =|C =|D =|E =|F =|G =|H =] [A|B|C|D|E|F|G|H] [+|-|*|/|NONE] [A|B|C|D|E|F|G|H]
Usage: Motion Code
Description: Operate on variables, if Operation is none, second variable name is ignored
Arument 1: Variable Name
Arument 2: Variable Name
Arument 3: Operation
Arument 4: Variable Name

VAR SET [A|B|C|D|E|F|G|H] [=|+=|-=|RAND|*=|/=] [0-65535]
Usage: Motion Code
Description: Set or change the value of a variable
Arument 1: Variable Name
Arument 2: Operation
Arument 3: Value