Here are some various things that I've found out.
CPU controlled characters are enhanced according to the action grid in the following way.
Upper and lower row: +1 Agi
Left corners: +1 Str
Right corners: +1 Con
Left middle: +2 Str
Right middle: +2 Con
Left column: -1 Con
Right column: -1 Str
Hit rate = Agility / 4 + weapon's hit rate
Attack = Strength + weapon's strength
Evade rate = Agility / 4 + armour's evade rate
Magic evade = Wisdom / 4 + armour's magic evade
Defense = Constitution + armour's defense
Magic defense = Wisdom + armour's magic defense
Critical rate = Weapon skill*3 + weapon's crit rate, halved for fist, sword, axe and spear
Recovery time after action = (100 - Agility) / 2 + 50 frames.
The game has a 5 frame cycle where it does the following:
Frame 1: Animate enemy 1 or NPC 1, 2, 3, sort sprites
Frame 2: Check if level 8 spell has ended, animate enemy 2 or NPC 4, 5, 6
Frame 3: Animate enemy 3 or NPC 7, 8, 9, process various buttons
Frame 4: Run game script, animate players, animate the man's weapon
Frame 5: Perform tinting, animate the woman's and the sprite's weapon
Player attack action is taken from D10480[F*40+D10000[A*144+B*16+C*4+D*2+E]], and enemy attack action is taken from D105C0[G*32+H*16+D10240[A*144+B*16+C*4+D*2+E]], where:
A = 0:Less than 16 pixels away, 1:Less than 32 pixels away, 2:Less than 48 pixels away, 3:48 or more pixels away
B = Charge level
C = 0:Nothing, 1:Hurt or opening chest, 2:Hurt badly, 3:Sleeping
D = Floating
E = 1 every other frame
F = Weapon type
G = Enemy type
H = Current weapon (each enemy can have 2)
These are the physical damage formulas. In these formulas, "Random" means a random number between 0 and 1. Force, attack power and defense power can't be greater than 999.
Mana Sword Power = Total weapon experience/100+Total weapon levels/8 (when the man is using the sword with Mana Magic)
Slow lowers hit rate by 1/16.
Hit rate is halved when recovering after action.
Mini lowers target's defense by 3/4.
Monster types have no effect on damage dealt, despite what the game claims. (To make monster types work correctly, one has to use the codes C050CCB9, C04A5E9D, C04A5FA0)
Your shadows can't use mana seed power, but the enemies never get any mana seeds anyway. You keep your seed power even when they are broken.
A character can't be hit if he or the attacker has no HP left, or if he has a barrel.
Attack succeeds if hit rate is greater than (1+Random)*Evade/2.
Force = Attack*(1+(Charge level+Mana Sword Power)/4). If the attacker is small, force is always 1.
If hit rate is greater than Random*101, Power = (Mana power squared+Force)*(1+Random/16), otherwise Power = Hit rate*Force/100.
If evade rate is greater than Random*100, DefPower = Defense+Random*Defense/16, otherwise DefPower = Evade*Defense/80
Critical hits are possible when fully recovered, or with moon energy. These double the attack power.
If target is sleeping, the critical rate doubles. The woman's rate is then increased by 5 and the man and sprite's hit rates are increased by 10. If the result is then greater than Random*256, the hit will be critical.
If the attacker is recovering, Power becomes (1-Frames left/((99-Agility)/2+80))*(Power/2).
Damage equals Power - DefPower. The target is woken up. Status is only inflicted if damage was done and target is not protected against anything it would be inflicted with.
If attack misses, defense animation will not occur if target is hurt, slow, tangled, asleep, frozen, petrified, stopped, barreled, burning or dead. One of 3 random animations will be executed.
Hurt animation will not occur if target is tangled, asleep, frozen, petrified, stopped, barreled, burning or dead. If damage exceeds 1/4 of the character's max HP, another animation will be executed and badly hurt status will be set. Hurt status lasts for (Damage/8)*5 frames, but not more than 30.
Healing animation will not occur if target is tangled, asleep, frozen, petrified, stopped, barreled, burning or dead.
When a boss is killed, all status effects except mini and dead are removed from all players.
The weapon experience for an enemy will be halved if your level is greater than the enemy's level. The other living party members will receive half the weapon experience that the killer gets.
These are the magical damage formulas.
If the character's magic skill is 8, the spell will only be at level 7 unless magic experience is greater than Random*128+1, although the game will call it level 8.
If magic evade rate is greater than Random*101, DefPower = MagicDef+Random*MagicDef/16, otherwise DefPower = MagicEva*MagicDef/80
Accuracy is equal to wisdom for the woman's spells, and intelligence for the sprite's spells
Hit rate = Accuracy/4 + spell's hit rate
Force = (Accuracy+Spell's strength)*(1+Spell level/2).
If hit rate is greater than Random*101, Power = (Mana power squared+Force)*(1+Random/16), otherwise Power = Hit rate*Force/100.
If target is strong against the spell, attack power is halved, and if it's weak against the spell, attack power is doubled. Everyone is weak against any spell that has positive effects. The power is then divided by the number of targets.
Damage equals Power - DefPower, but not less than 1.
Timers are decremented every 20 frames.
Spells that enhance a weapon increase the force by 1/(10-Spell level/Number of targets) of it's original value. The number of uses is equal to (Spell level/Number of targets+1)*4. The element has no effect on damage dealt.
Weapon effects accumulate if another weapon enhancing spell is cast before the time runs out.
If you change your weapon, the spell will stop working.
Mana magic and spells that enhance stats last for a time equal to Power/4 units.
Spells that cause a status effect last for a time equal to Power/4 - MagicDef units, but not less than 20.
Remedy level 8 and above level 4 against single target remove all status effects except barrel and dead. Remedy below level 4 or below level 8 against multiple targets remove Power/4 units from the time left. Dispel magic works in the same way.
Magic absorb absorbs (Power - DefPower)/10, but not less than 1. Ghosts are immune and your MP will be aborbed by them instead.
Evil enemies are immune against Absorb, and they will use your magic evade rate and magic defense to calculate defense power when absorbing your HP. They are also immune to Moon Saber.
The number of uses for Moon Energy is Spell level/Number of targets+1.
The number of uses for Wall is Spell level/Number of targets+2. Mana Magic and Dispel Magic can't be reflected. The target of a reflected spell must be less than 240 pixels in total in both directions from the original target. If a reflected spell was directed at multiple targets, it will not be thrown at the remaining targets once it has been reflected.
The damage formula for Evil Gate is (CurrentHP+MaxHP)/(2*(10-Spell level/Number of targets) to normal enemies and 1 to bosses.
Lucid Barrier creates a shield with HP equal to the spell's power, but not more than the character's max HP. The defense is equal to the character's defense divided by 2 times the number of targets, and is subtracted from the attack power.
Lunar magic causes one of the following effects:
Energy party: All characters are healed
Raring to go: Defense, evade, hit, and attack up
Burned out: Defense, evade, hit, and attack down
All are confused: All characters are confused
Kupo kupo po: All characters are moogled
World's bigger: All allies are shrunk
Enemy wimps out: All enemies are transformed
Knocked senseless: All characters go to sleep
MP recovered: Attacker's MP is recovered (can't happen)
Characters have an equal probability of being transformed into Rabite, Mushboom, Lullabud, Kid Goblin, Green Drop, Water Thug, Pebbler or Pumpkin Bomb.
Magic gives only half the experience when used in towns. You can only upgrade the magic to a level equal to the number of mana seeds you have.
You can't pick up chests if you're moogled or small. If you try to pick up a chest while using a barrel, you'll lose the barrel.
Dropped chests contain the following traps depending on the enemy's level.
Level 1-10: Punch glove, Poison needle or Bomb
Level 11-15: Bomb
Level 16-25: Riot gas
Level 26-30: Stone trap
Level 31-36: Mimic box
Level 36-99: Doom Trap or Shadow Zero (1/8 of the time)
Riot gas causes mini, moogle or sleep at random.
Punch glove and Bomb cause damage equal to your level + Random*8.
Doom trap sets your HP to 1 or kills you (1/8 of the time).
Shadow zero will, 1/8 of the time do a funny animation where he trips over and gets stuck in the lid.
Traps are escaped if your agility is high enough. Otherwise, the trap is triggered half of the time. The Analyze spell will disarm a trap if the spell's level is high enough. If a chest contains an energy orb that you can't have, you'll only get a candy.
Some armors are supposed to subtract 2 points from your strength, agility, constitution or intelligence. Instead, they add 5 points. If an armor protects you against elements, you will be weak against the opposite elements. The same is true of enemies and their elements.
Incompatible status effects:
Petrify removes slow, tangled, sleep, freeze, stop, barrel and burning, and halves HP every time status changes
Freeze removes slow, tangled, sleep, stop, barrel, poison and burning
Sleep removes slow, tangled and barrel
Tangled removes slow, tangled and barrel
Moogle removes stop, barrel, transform, poison and burning
Freeze, petrify and mini remove transform
Transform removes slow, tangled, confuse, stop, barrel, poison and burning
Tangled, sleep, freeze, petrify, stop, poison, burning remove barrel
Burning removes stop, barrel and poison
Freeze, petrify, transform and moogle remove poison
The wall bug works by casting a spell on a player character and then killing the character by casting a spell that gets reflected from an enemy. This gives the others the experience that the first has (mod 65536). One way to accomplish this is to cast wall on everyone twice. This gurarrantees that every player will have been hit with a spell, and that you can cast at least 6 spells at the enemies before casting wall again. To optimize weapon leveling, the character that casts Wall should at most be at the same level as the killed character, and should have a weak weapon equipped.
Here's a whip bug that I found. Stand on the jump tile with the character that has the whip. Then equip the whip on another character and swing at a pole with it. You will jump and possibly get stuck or go to a spot where you're not supposed to be. Another, already known bug involves charging the whip to level 5 and swinging in a wrong direction which will make you jump in that direction.
When you hit a boss, you will set the bit corresponding to the boss character index at 7E0000+(E05A+elevation difference)&FFFF, due to a bug. The hit will not register if the bit is already set.
The games contains 2 RNGs. Sometimes it uses one and other times it uses the other. The first RNG consists of 8 parallel 55 bit LFSRs with polynomial x^24 + 1. The other is a 15 byte LFSR with polynomial x^14 + 1.
CPU controlled characters behave in a way best described by the following pseudocode. Moogled characters will retreat if near enemies.
Stand still for 5 frames
Stand still for 5 frames
If set to guard and keep away
Repeat
While target exists
If target within 16 pixels for fist, 32 pixels for others
Look aggressively directly for 5 frames
Attack
If using fist, backflip
Charge
While target within 48 pixels
Aim
If target within 16 pixels for fist
Look aggressively directly for 5 frames
Attack
If using fist, backflip
Charge
First and fourth time
If character has moved, run directly, otherwise diagonally, for 10 frames
Second and third time
If character has moved, run directly, otherwise diagonally, for 5 frames
After four times, start over
If target wasn't within 48 pixels
If target within 64 pixels
If recovered
Look aggressively directly for 5 frames
Otherwise
Face directly for 5 frames
Otherwise
Aim
Using fist, sword, axe
If character has moved, walk aggressively directly, otherwise diagonally, for 10 frames
Otherwise
If character has moved, walk aggressively straight, otherwise diagonally, for 10 frames
Otherwise
Repeat
Aim
If enemy found
Aim
While target exists
Aim
If target within 64 pixels
If recovered and charged to max
Using fist, sword, axe
Generate random number A from 0 to 15
Set to attack
Run to enemy
Using fist, within 64 pixels when A less than 2, 48 pixels when A less than 6 or 32 pixels otherwise
Using sword or axe, within 64 pixels when A less than 3, 48 pixels when A less than 8 or 32 pixels otherwise
Set to guard
Do while target not within 32 pixels
Aim
If character has moved, walk aggressively directly, otherwise diagonally, for 10 frames
Look aggressively directly for 5 frames
Attack
If using fist, backflip
Charge
Otherwise
If target within 64 pixels directly vertically or horizontally
Look aggressively straight for 5 frames
Attack
Charge
Otherwise
Walk aggressively in random diagonal direction
Otherwise
If target within 64 pixels and not using fist, sword, axe
Look aggressively straight for 5 frames
Otherwise
Do while target within 48 pixels
Aim
If target within 32 pixels
Using fist, sword, axe
Look aggressively directly for 5 frames
Using other weapons
Look aggressively straight for 5 frames
Attack
If using fist, backflip
Attack
Charge
Set to approach
If character has moved, retreat directly, otherwise diagonally for 10 frames
Set to keep away
First and fourth time
If character has moved, retreat directly, otherwise diagonally for 10 frames
Second and third time
If character has moved, retreat directly, otherwise diagonally for 5 frames
After four times, start over
If recovered, move on
Otherwise
If recovered
Set to approach
Do while target not within 64 pixels
Aim
If character has moved, walk aggressively directly, otherwise diagonally, for 10 frames
Set to keep away
Run to within 64 pixels of enemy
Otherwise
Stand still for 5 frames
Running to enemy:
Repeat until target is within specified distance, 4 times max
Aim
First and fourth time
If character has moved, run directly, otherwise diagonally, for 10 frames
Second and third time
If character has moved, run directly, otherwise diagonally, for 5 frames
Aiming:
Wait until there is an enemy on screen and the character is not far from a leader. Check for enemy within 16, 32, 48 or 64 pixels, target it, charge and look at it in a threatening way for 5 frames. If none is found, stop and move on.
When using the Target command, it functions like approach and attack except that it doesn't aim (which takes 5 frames). It ends when the target is off screen and starts with normal procedures.
When CPU controlled characters are not fighting, they follow the first player. The character after the player walks until he is within 32 pixels and the third character walks until he is within 64 pixels but if you're moving straight, they try to line up with you. If they crash into the wall for 6 frames, they will try to turn in another direction. When moving straight they will alternate between directions and they will turn if there's an opening 4 blocks away. When moving diagonally they will just reverse the vertical direction. Characters will stop fighting if no character is hurt, tangled, sleeping, frozen, petrified, stopped, barreled, burning or dead and a player is running.
Some memory addresses:
7e002b Easter egg counter
7e003a Offset to talking NPC
7e003e BG3 H scroll
7e0040 BG3 V scroll
7e0042 Buttons held (3 words)
7e0048 In text
7e004f Script timer
7e0056 Update cycle counter
7e005c Boss flag
7e009c Room width
7e009d Room height
7e00a8 BG1 H Scroll in room
7e00aa BG1 V scroll in room
7e00ac BG2 H scroll in room
7e00ae BG2 V scroll in room
7e00b0 BG1 H scroll
7e00b2 BG1 V scroll
7e00b4 BG2 H scroll
7e00b6 BG2 V scroll
7e00c0 Room width in pixels
7e00c2 Room height in pixels
7e00cc Buttons pressed (3 bytes)
7e00d0 Script state (will be 83 when waiting for button press)
7e00d1 Script address
7e00d4 Offset to talking player
7e00d6 Script return address
7e00d9 Currently controlled characters (3 bytes)
7e00dc Room number
7e00e8 Transition state
7e00ed In enemy screen
7e00ee Button configuration (3 bytes)
7e00f4 Frame counter
7e0108 Outside room
7e011f Allowed items
7e0306 8x55 bit LFSR state
7e033d 8x55 bit LFSR offset
7e033e 8x55 bit LFSR tap offset
7e03f0 15 byte LFSR offset
7e03f1 15 byte LFSR state
7e0fc0 Boss subpixel gravity
7e0fc2 Boss gravity
7ec800 Room NPc table
7ecc00 Player names
7ecc24 Hats
7ecc30 Vests
7ecc3c Bracelets
7ecc48 Items
7ecc54 Weapons
7ecc6a Money
7ecc6d Button configuration x 3
7ecc73 Action grid quadrant x 3
7ecc76 Mana sword power
7ecc77 Man's old weapon when using Mana sword
7ecc78 Woman's mana magic timer
7ecc79 Sprite's mana magic timer
7ecc7a Action grid configuration x 3
7ecc7d Auto charge configuration x 3
7ecf00 Sword picked up
7ecf01 1=Pass through everything, 2=Players have no shadows, 4=Talker has no shadow
7ecf02 1=Mana fortress revived, 2=Grand palace risen
7ecf03 On jump tile
7ecf04 1=Woman left at Gaia's navel, 2=Rescued woman, 3=Found rocks in forest
7ecf05 1=Talked to elder in dwarf village
7ecf09 1=Got chest in Potos, 2=Said goodbye
7ecf0a Ghost present at bridge, Luka dialogue
7ecf0b 0=Beginning, 1=Fighting Mantis Ant, 2=Nothing, 3=Fighting Santa Claus, 4=In training centre
7ecf0c 1=Man present
7ecf0d 1=Woman present, 8=Woman imprisoned
7ecf0e 1=Sprite present, 8=Sprite imprisoned
7ecf0f Not enough money or item won't fit
7ecf10 1=Removed sword, 2=Discovered that you can cut through bushes, 3=Saw rabite, 5=Talked to elder, 6=Hole appeared, 7=Defeated Mantis Ant, 9=Jema left, A=Talked to people, B=Banished
7ecf11 1=Mission will be full of danger, 2=Dyluck gone, 3=Jema wants you to go, 8=Introduced to Luka, 9=Jema should watch out, A=Man is scared, C=Dyluck is alive, E=Recovered seed
7ecf12 1=Talked to Luka, 3=Talked to Elman, 4=Woman going to find Dyluck 5=Dad asked the king, 6=Tiger defeated, 7=Phanna at ruins, 8=Phanna inside ruins, 9=Ruins clear, A=Pandora guards moved
7ecf13 1=Marriage being arranged, 2=Met woman, 3=Woman hates dad, 5=Jema at ruins, 6=King has headache, 7=Jema at underground palace
7ecf14 1=Talked to Watts, 2=Forged sword, 5=Defeated Tropicallo, 6=Met sprite, 7=Got axe
7ecf15 1=Rabite man on stage, 2=Sprite child on stage, 3=Gave money, 4=Show ended, 5=Got money back, 6=Sprite joined
7ecf16 Joined woman
7ecf17 1=Rescued soldier, 2=Talked to soldier, 3=Children are pesky, 4=Dyluck gone, 5=Tiger appeared, 6=Tiger defeated, 7=Talked to Elinee
7ecf18 1=Found underground palace, 2=Underground palace opened, 3=Found gnome, 4=Gnome gone, 5=Boss appeared, 6=Boss defeated, 7=Got earth seed, 8=Jema gone
7ecf1a 1=Phanna in ruins, 2=Man said watch out, 3=Phanna appeared, 4=Dyluck appeared, 5=Hole appeared, 6=Defeated evil wall, 7=Dyluck and Phanna gone, 8=Talked to Jema
7ecf1b 1=Water seed stolen, 2=Talked to gang, 3=Robot appeared, 4=Defeated robot, 5=Recovered seed
7ecf1e 1=Recovered water palace seed, 5=Evil wall defeated, 7=Jabberwocky defeated, 8=Talked to cannon brother
7ecf20 1=Landed in upper land, 2=Talked to moogle, 3=Defeated pebblers, 4=Broke crystal orb
7ecf21 1=Sprite remembers everything, 2=Passage opened, 3=Defeated boss, 4=Found Sylphid, 5=Got Sylphid, D=Empire sent monsters
7ecf22 1=Sprite is back, 2=Defeated boss
7ecf24 4=Earth orb destroyed, 5=Defeated boss, 7=Found Flammie, 8=Flammie in barn, A=Talked about Flammie controls, F=Got Flammie
7ecf25 Tonpoles defeated in Ice Palace
7ecf26 1=Talked to Rudoplh, 2=Defeated Boreal Face, 3=Ice palace, 4=Santa room, 5=Rudolph appeared, 6=Got fire seed
7ecf28 1=Found in desert, 2=Talked to Sergo, 3=Planned to break out, 4=Broke out of room, 5=Found sprite, 6=Sprite joined, 7=Rats ate food, 8=Meria in room, 9=Woman joined, A=People disagreeing
7ecf29 1=Have sea hare's tail, 2=Kakkara restored
7ecf2c 1=Blew fire out
7ecf2d 1=Heard distant noise, 2=Door appeared, 5=Found Dyluck
7ecf2e 1=Rescued by girl, 2=Met girl again
7ecf2f Number of times you watched the show
7ecf30 1=Person moved, 2=Heard about password, 3=Heard about key, 4=Got key
7ecf32 1=Met Krissie, 2=Found Dyluck, 3=Talked to Krissie again
7ecf34 1=Met emperor, 2=Trapped, 3=Met boss
7ecf36 1=Landed in desert, 2=Found ship
7ecf3a 2=Examined Phanna, 3=Cured Phanna
7ecf3b 1=Been to Moon Palace, 2=Entered
7ecf3c 1=Heard about spy, 2=Taken away, 3=Removed people, 4=Beat spy, 5=Got sword's orb, 6=Heard about Joch
7ecf3f Sage Joch (0=away, 1=inside, 4=passage opened, 6=completed)
7ecf41 1=Continent surfaced, 2=Talked to Jema, 3=Fortress revived, 4=Talked to Jema again
7ecf47 1=After fighting robot, 2=Fighting robot, 3=Found shortcut
7ecf4d Phanna apologized
7ecf50 1=Recovered water seed
7ecf54 1=Heard about whip, upper land counter
7ecf56 4=In Tonpole room, 5=Defeated Tonpoles
7ecf57 Smoke from cannon activated
7ecf58 Gave money to sprite
7ecf59 Talked to Jema after Ruins beaten
7ecf5a Password digits entered
7ecf5b Talked to Luka after seed taken
7ecf5c Got Midge Mallet
7ecf70 Man dead
7ecf71 Woman dead
7ecf72 Sprite dead
7ecf7f Mana sword revived once
7ecf90 Mana seeds x 8 (0=don't have, 1=normal, 2=broken)
7ecf98 Spell type used on orb x 8
7ecfb0 Weapon level x 8
7ecfb8 Energy orb x 8
7ecfc0 Maximum energy orb x 8
7ecfd0 50 GP chests x 7
7ecfd7 Found magic rope
7ecfd8 1=Defeated elinee, 2=Got 50GP
7ecfd9 1=Defeated elinee, 2=Got whip, 3=Dyluck is alive
7ecfda 1000 GP chests x 5
7ecfdf 50 GP chests x 17
7ecfe8 Orbs destroyed in Grand Palace x 8
7ecff5 Show boy's position when in the menu
7ecff6 Jumps to C7D000 and crashes
7ecff7 Snow amount
7ecff8 No message border
7ecff9 Current inn's price
7ecffa Current shop
7ecffb Enemy's seeds (but they forgot to set it)
7ecffc Your seeds
7ecffd Place name, high nibble
7ecffe Place name, low nibble
7ecfff Stops bosses
7ee000 Man variables
7ee200 Woman variables
7ee400 Sprite variables
7ee600 Enemy and NPC variables
Room character entry structure (16 bytes):
0 State (0=Not present, 1=Not loaded, 81=Loaded)
2 Pointer to loaded character
7 Flags (40=Always loaded, 80=Stands still)
8 Story variable
9 Story variable range
A X tile (these are updated when the character is unloaded to make room for another character)
B Y tile
C Direction
D Type
E Trigger type and script
Character structure (512 bytes):
000 Present
002 X position
004 Y position
006 X speed
007 Y speed
008 Z speed
00A Action timer
00B Floor
00E Display flags
010 Direction
011 Action
012 Animation timer
013 Second direction
016 Animation pointer
018 Animation start
01A Charge counter
01B Charge level
01C 20=Manual attack, 40=Performing other action, 80=CPU attack
01D Buttons pressed
01F Charge timer
020 X on screen
022 Y on screen
026 Frame number
02A Frame table
02C Controlling player
02D Crash timer
02E 0=Turn south or east, 1=Turn up or north
030 Previous direction
031 Previous action
034 Index in room
039 Shake counter
03E Script
040 Animation override frame
041 Animation override
042 Busy flag
043 Set if from room data
044 NPC flags
045 Z position
04E Characters near
04F Magic palette
050 X distance from man
051 Y distance from man
052 Direction of man
053 X distance from woman
054 Y distance from woman
055 Direction of woman
056 X distance from sprite
057 Y distance from sprite
058 Direction of sprite
059 Characters attacking this character
05A Characters attacked by this character
05D Animation nested
05E Animation return address
060 Overlay
061 Number active
062 AI timer
063 Bit0=Running, High nibble=Recover wait counter
064 AI waits until action done
065 Animation table for current weapon
067 AI moving
068 Current weapon type
069 Weapon palette
06A Weapon data
06C Number info
075 Animation table 1
077 Animation table 2
07F Equip weapon sound
082 Gfx transfer size
083 Gfx Source bank
084 Gfx transfer size 2
085 Automatic charge
089 Size
08C Saved player (when stopped, burning, petrified, frozen)
0C0 Weapon rectangle
0C8 Exclusion rectangle
0CC Hit rectangle
0F8 Palette offset
0FA Weapon palette offset
0FC Spell animation pointer
100 Palette variables
104 Weapon palette variables
10A Spell character is hit by
10B Level of spell character is hit by
110 Spell variables
140 Script action
141 Script parameter 1
142 Script parameter 2
143 Script parameter 3
144 Script address
146 Script variables (4x4 bits)
148 Saved X on screen
14A Saved Y on screen
14C 1=Autocharging, 2=All characters healthy and leader running
14F Script stack depth
150 Script stack
170 Casted spell
171 Casted spell level
172 Current magic targets
175 Number color
176 Number of targets for spell
177 Magic type
178 Magic targets
17B Displayed number
17D Experience needed for next level
180 Type
Chests
181 FF=Opened
182 FF=Runs away
183 FF=Trap not triggered
184 FF=Trap disarmed
Crystal orbs
181 Spell that it was hit by
181 Level
182 Current HP
184 Max HP
186 Current MP
187 Max MP
188 Strength
189 Agility
18A Constitution
18B Intelligence
18C Wisdom
18D Experience
190 Status (2=Died or lost more than 1/4 of max HP, 4=Slow, 8=Tangled, 10=Sleep, 20=Freeze, 40=Petrify, 80=Confuse, 100=Stop, 200=Mini, 400=Barrel, 800=Transformed, 1000=Moogle, 2000=Poison, 4000=Burning, 8000=Dead)
192 Monster type (1=Human, 2=Plant/fish, 4=Insect, 8=Animal/bird, 10=Lizard, 20=Evil/Zombie, 40=Ghost, 80=Dragon)
193 Element
194 Monster type that your weapon is supposed to be effective against
195 Weapon element
196 Critical rate
197 Hit rate
198 Attack
199 Status inflicted by weapon
19B Attack level
19C Current weapon level
19D Enhanced weapon uses left
19E Previous status
1A0 Things weapons are effective against that will make character weak
1A1 Magic character is weak against
1A2 Things weapons are effective against that will make character strong
1A3 Magic character is strong against
1A4 Evade rate
1A5 Defense
1A7 Magic evade rate
1A8 Magic defense
1AA Status character is immune against
1AC Target
1AD Magic target
1AE Weapon enhancement level in low nybble, moon energy counter in high nybble
1AF Sound played
1B0 Stat enhancements (1=Defense up, 2=Defense down, 4=Evade up, 8=Evade down, 16=Hit up, 32=Hit down, 64=Attack up, 128=Attack down)
1B1 Status 2 (1=Falling asleep, 2=Can't be thrown, 4=Remedy cast, 8=Hit with spell while dead, 10=Shield, 20=On jump tile, 40=Reflect, 80=Chest)
1B2 Slow, tangled, sleep, freeze, petrify timer
1B3 Silence, stop timer
1B4 Hurt timer
1B5 Transform, moogle timer
1B6 Poison, burning timer
1B7 Attack timer
1B8 Reflect uses left
1B9 Main timer
1BA Hit rate timer
1BB Evade rate timer
1BC Defense timer
1BD Shield energy
1BF Shield defense
1C0 Weapon levels (only 1 for enemy)
1C4 Magic levels
Players
1C8 Spells learned
Enemies
1C8 Money
1CA Death type in bits 1-4 (0: Splash, 2: Feathers, 4: Ghost, 6: Splat, 8: Dust, A: Blow up, C: Skeleton)
1CE Chest rate, 0-64, bit 7: runs away from player
1CF Chest trap type+1, 0=Random
Chests
1C8 Trap type
1C9 Energy orb type
1CA Original enemy type
1D0 Weapon experience
1E0 Head armor
1E1 Body armor
1E2 Hand armor
1E3 Weapon
1E4 Weapon type
1E5 Hurt action
1E6 Mana power
1E7 Original character
1E8 Weapon 1
1E9 Weapon 2
1EC Last attacker
1ED Recover counter
1EE Previous status
1F0 Attacker
1F1 HP Damage
1F3 HP Heal
1F5 MP Damage
1F6 MP Heal
1F7 Status inflict rate
1FA Update flags
1FB Character flags (1=Shadow, 2=Frozen, 4=Opening chest, 8=Interrupted, 10=Inanimate, 20=NPC, 40=Boss, 80=Player)
1FC Pause timer
1FD Enemy black magic strength
1FE Enemy white magic strength
Some boss variables (instead of the usual character fields):
018 Palette offsets x 4
01E Size
029 X subpixel position
02B X position
02D Wait time
030 Y subpixel position
032 Y position
03A X subpixel speed
03C X speed
03E Y subpixel speed
040 Y speed
04C Attack state table
04E Crash flags
064 Z subpixel position
066 Z position
070 State (8=Invisible)
072 Death script
076 Mode table
07A Mode
080 Spell flag
082 Timer flag
08E Main procedure
090 Procedure 2
098 Flags (1=Follow screen, 8=BG graphics, 10=Pass through player, 20=H flip, 40=V flip, 800=Active)
09A Animation
09C Animation offset
09E Animation timer
0A5 Y delta
0A9 Target
0AB Direction
0AD Timer
0C4 Z subpixel speed
0C6 Z speed[/code]