Function Offsets 059C: Picks dance and dance move 0634: Picks command for confused monsetr 082D: Clear Love Token effects 0836: Clear Charm effects 0B83: Modify Damage, Heal Undead, and Elemental modification 0C9E: Damage modification 0D3D: Multiply damage by $E8 / 256 0D4A: Atlas armlet / Earring 0D87: Figure damage if based on HP 0E38: Atma Weapon damage modification 0F9A: Load item data into memory 123B: True Knight and Love Token 1323: Deal HP Damage 1350: Deal MP Damage 1390: Target takes lethal damage 13A7: Returns Damage Healed - Damage Taken 13D3: Combat Code 15C8: Desperation attacks 188D: Throw 1897: Item Magic 1E45: Load variable X into $EE 1E57: Set only bit #X in A 220D: Determine if attack hits 22EC: Determine if L.X spells hit 239C: Check if hit if Stamina involved 2B69: Magic Damage Calculation 2B9D: Physical Damage Calculation 2E3A: Determine if back, pincer, or side attack 317B: Combat Action Code 33B1: Combat Function 36D6: Learn Lore if casted 370B: Damage incrementer function 3792: Sketch chance 37B6: Damage dealt by GP Rain 37DC: Picks a random esper (not Odin or Raiden) 3852: Kill target (Y holds which target to kill) 387E: Call special effect code 4391: Set New Status After Attack 4406: Set status when attack hits 4490: Remove Vanish / Freeze 44FF: Clear set and clear status bytes 4781: Multiplication Function (low byte of A * high byte of A) 4792: Division Function (16-bit A / 8-bit X) 47B7: Multiplication Function 2 (A = $E8 * 16-bit A / 256, $E8 = $E8 * 16-bit A (3 bytes)) 47D6: Multiply A (8-bit) by 1.5 4A9E: Clears all statuses 4B53: Random Number Generator 1 (0 or 1, carry clear or set) 4B5A: Random Number Generator 2 (0 to 255) 4B65: Random Number Generator 3 (0 to Accumulator - 1) 4C5B: Counter attacks (retort, interceptor, black belt) 500B: Regen and poison damage 51F0: Return X = bit number of highest bit set in A 51F9: Return in Y bit number of highest bit set in A (* 2) 520E: Sets X to number of bits set in A (8-bit or 16-bit) 522A: Randomly picks a bit set in A 5FEF: Checks for uncursing Cursed Shield 604B: Learn new spell 6235: Add XP for battle to character Special Effect Code: # Effect Address Pointer table used $01 Random Steal : 3E8B (42E1) $02 Atma Weapon : 4044 (42E1) $03 Kill with 'X' : 3D43 (3DCD) $04 x2 Damage vs. Humans : 38F2 (3DCD) $05 Drain HP : 3F73 (42E1) $06 Drain MP : 3F6E (42E1) $07 Attack with MP : 3F22 (42E1) $08 Sniper/Hawkeye effect : 38FE (3DCD) $09 Dice : 4158 (42E1) $0A Valiant Knife : 3F89 (42E1) $0B Wind Attack : 3F9F (42E1) $0C Recover HP : 3F7E (42E1) $0D Slice (Scimitar) : 388D (3DCD) $0E Breaks (Ogre Nix) : 3ECA (42E1) $0F Attacks with more MP : 3F50 (42E1) $10 Scan : 3C5B (3DCD) $11 Golem : 3F65 (42E1) $12 Metamorph : 3A3C (3DCD) $13 Palidor : 3934 (3DCD) $13 Palidor : 41F6 (42E1) $14 Has no effect (no code called) $15 Mantra : 4263 (42E1) $16 Spiraler : 4234 (42E1) $17 Tapir : 3C2A (3DCD) $18 Warp : 404E (42E1) $19 Exploder : 3C4C (3DCD) $19 Exploder : 3F1C (42E1) $1A Blow Fish : 40FE (42E1) $1B Pearl Wind : 3F54 (42E1) $1C L? Pearl : 40A1 (42E1) $1C L? Pearl : 3C90 (3DCD) $1D Reflect??? : 42B7 (42E1) $1E Step Mine : 3EA0 (42E1) $1F Dischord : 3978 (3DCD) $20 Pep Up : 3CB8 (3DCD) $21 Rippler : 3C04 (3DCD) $22 Stone : 3922 (3DCD) $23 X-Zone, Odin, etc. : 3C8C (3DCD) $24 Has no effect (no code called) $25 Quake, etc. : 3B6B (3DCD) $26 Wall change : 3989 (3DCD) $27 Escape : 396C (3DCD) $27 Escape : 40BB (42E1) $28 Mind Blast : 3BB0 (3DCD) $28 Mind Blast : 413C (42E1) $29 N. Cross, etc. : 414D (42E1) $2A Flare Star : 410F (42E1) $2B R. Polarity : 3980 (3DCD) $2C Launcher : 4037 (42E1) $2D Love Token : 3D37 (3DCD) $2E Seize : 3CCE (3DCD) $2F Targetting : 3DA8 (3DCD) $30 Suplex : 3C6E (3DCD) $30 Suplex : 428B (42E1) $31 Forcefield : 40DA (42E1) $32 Quadra Slam, Cleave : 40F1 (42E1) $33 Bababreath : 3966 (3DCD) $33 Bababreath : 4061 (42E1) $34 Charm : 3C91 (3DCD) $35 Doom : 3D49 (3DCD) $36 Empower : 421B (42E1) $37 Overcast : 3D1E (3DCD) $38 Sneeze : 396C (3DCD) $39 Engulf : 395E (3DCD) $3A Zinger : 3D27 (3DCD) $3B Evil Toot : 3BCB (3DCD) $3C Has no effect (no code called) (Retort) $3D Revenge : 41E6 (42E1) $3E Phantasm : 3D7C (3DCD) $3F Stunner : 3D85 (3DCD) $40 Fallen One : 3DB0 (3DCD) $41 1/2 Damage : 4285 (42E1) $42 1/4 Damage : 4280 (42E1) $43 Quick : 42CA (42E1) $44 Discard : 3CFD (3DCD) $44 Discard : 424B (42E1) $45 Has no effect (no code called) $46 Has no effect (no code called) $47 Has no effect (no code called) $48 Has no effect (no code called) $49 Magicite : 3FAD (42E1) $4A Superball : 3DB8 (3DCD) $4A Superball : 402C (42E1) $4B ?? Removes from combat: 396C (3DCD) $4B ?? : 40C8 (42E1) $4C ?? : 3D17 (3DCD) $4C Clears concerns MP : 4136 (42E1) $4D Same effect as warp : 404E (42E1) $4E Has no effect (no code called) $4F Has no effect (no code called) $50 Possess : 3B98 (3DCD) $50 Misses a lot : 4095 (42E1) $51 GP Rain : 3FB7 (42E1) $52 Steal : 399E (3DCD) $53 Control : 3AC5 (3DCD) $54 Leap : 3B71 (3DCD) $55 Sketch : 3B29 (3DCD) $56 Debilitator : 3A8D (3DCD) $57 Air Anchor : 3C78 (3DCD) Tool Effect Code: Noiseblaster : $2B2A Chainsaw : $2B30 Debilitator : $2B53 Drill : $2B4D Air Anchor : $2B57 Flash : $2B5D 2B1A : Tool effect code pointer table 3DC5 : Morph Chance (8 bytes) 3DCD : Start of special effects pointer table 1 (Called for each target Y = target) 42E1 : Start of special effects pointer table 2 (Called once for attacker Y = attacker) D01A : Pointer to monster formation size templates D034 : Monster formation size templates C0FD00 : Random Number Table $BE : Index into random number table $11E0 : Battle Formation $11E2 : Combat Background $1860 : Gold (3 bytes) $1866 : Steps (3 Bytes) $1CF6 : Time Morph will last $1CF7 : Known Swdtechs $1D28 : Known Blitzes $1D29 : Known Lores $1D2C : Known Rages $1D4C : Known dances (one bit for each dance) $1DD5 : Battles fought with the cursed shield $1DDD : Monster formations beaten (to fight on veldt) (64 bytes) $1EBA : Rare Items owned (3 bytes, 1 bit for each item) $1EDE : Which characters are in party (2 bytes, 1 bit for each character) $201F : Type of battle (0 = normal, 1 = back, 2 = pincer, 3 = side) $2020 : How many SwdTechs are known $2F45 : If > 0 then characters are trying to run $2F50 : Monster Facing (1 bit for each monster, 1 = right, 0 = left) $2F51 : Character Facing (as above) $257E : Known Rages (256 bytes, $FF = not known) $2F4B : Bit 1 = formation not added to veldt list if set, Bit 2 = no preemptive attack if set $3000 : Which character is Terra (#$FF if not in party) $3001 : Which character is Locke (#$FF if not in party) $3002 : Which character is Cyan (#$FF if not in party) $3003 : Which character is Shadow (#$FF if not in party) $3004 : Which character is Edgar (#$FF if not in party) $3005 : Which character is Sabin (#$FF if not in party) $3006 : Which character is Celes (#$FF if not in party) $3007 : Which character is Strago (#$FF if not in party) $3008 : Which character is Relm (#$FF if not in party) $3009 : Which character is Setzer (#$FF if not in party) $300A : Which character is Mog (#$FF if not in party) $300B : Which character is Gau (#$FF if not in party) $300C : Which character is Gogo (#$FF if not in party) $300D : Which character is Umaro (#$FF if not in party) $33F8 : Which target has used Zinger $33F9 : Which target has been possessed by Zinger $33FA : Which monster is Doom Gaze (FF if Doom Gaze not in battle) $3A36 : HP Golem will block (2 bytes) $3A39 : Which characters have escaped $3A3C : Which targets are invincible (like Guardian) (2 bytes) $3A3E : Time counter in battle (2 bytes) $3A44 : Time counter in battle (2 bytes) (Goes up 1 for every 16 $3A3E goes up) $3A56 : Which targets have died this combat (2 bytes, if bit = 1 then died) $3A6D : Bit 0 = 2x preemptive attack rate if set, bit 1 = no back or pincer if set $3A6E : Method used to end combat? $3A73 : Which monsters are in template $3A76 : Number of live character in party (while in combat) $3A77 : Number of monsters left $3A80 : How many Blitzes are known $3A84 : Lores to be learned at end of combat (3 bytes) $3A87 : Number of known lores) $3A8A : Which characters are engulfed $3A8F : Bit 0 = 0 if active battle $3A91 : Lower byte of time counter (in $3A3E) $3A9B : Which tools are owned $3DAC : Unique monster variables (1 for each monster) $3EB0 : Variables (36 bytes) $3EBE : Doom Gaze's HP (2 bytes) $3EC8 : Which elements have been nullified by Forcefield $3ECA : # of types of monsters active in combat $3ED4 : Battle formation (2 bytes) $3F20 : Last attack (for use by Mimic) $3F22 : Last targets (for use by Mimic) $3F24 : Last attack (second attack w/ Gem Box) (for use by Mimic) $3F26 : Last targets (second attack w/ Gem Box) (for use by Mimic) $3F30 : Morph time counter (2 bytes) $3F32 : Amount Morph time counter is reduced each frame $3F44 : Monster formation data (15 bytes) Character data (37 bytes) 1 block for each 14 characters $1F00 : ??? (2 bytes) $1F02 : Name (6 bytes) $1F08 : Level $1F09 : Current HP $1F0B : Max HP $1F0D : Current MP $1F0F : Max MP $1F11 : XP (3 bytes) $1F14 : ??? (2 bytes) $1F16 : Commands (4 bytes) $1F1A : Vigor $1F1B : Speed $1F1C : Stamina $1F1D : Magic Power $1F1E : Esper equipped $1F1F : Right hand $1F20 : Left hand $1F21 : Helmet $1F22 : Armor $1F23 : Relic 1 $1F24 : Relic 2 Regarding attack: $A2 : Targets Cast on $A3 : Targets Cast on $A4 : Targets Hit (bit 0 to 3 = characters) $A5 : Targets Hit (bit 0 to 5 = monsters) $B1 : If bit 2 = 1, can't run, bit 7 = 1, disable preemptive attacks $B2 : If bit 1 = 1, no critical & ignore true knight $B3 : If bit 1 = 0, always critical, bit 4 = 1, no damage increment if ignore defense, bit 5 = 1, ignore row, bit 6 = 0, gauntlet, bit 7 = 0, ignore vanish $B5 : Command $B6 : Spell / Battle Animation $B7 : Something to do with determining battle animations $B8 : Targets (2 bytes) $BA : if bit 1 = 0, no critical, bit 3 = 1, target only dead allies, bit 6 = 1, randomize target, bit 7 = 1, abort on allies $BB : Targetting byte $BC : Damage incrementer (50% extra damage damage times value of $BC) $F4 : Status to clear (4 bytes) (not always used for this) $F8 : Status (4 bytes) (not always used for this) $FC : Status to set (4 bytes) (not always used for this) $FE : Bit 6 = Dog Block, Bit 5 = Golem, Bit 3 = Blizzard Orb $11A0 : Targeting Byte (Bit 0 = Cursor Moveable, 1 = One Side Only, 2 = Autoselect both parties, 3 = Autoselect one party 4 = Auto Confirm, 5 = Manual Party Select, 6 = Cursor Start on Enemy, 7 = Randomize selection) $11A1 : Element (Bit 0 = Fire, 1 = Ice, 2 = Bolt, 3 = Poison, 4 = Wind, 5 = Pearl, 6 = Earth, 7 = Water) $11A2 : Special Byte 1 ( Bit 0 = Physical Damage, 1 = Miss if Death Prot., 2 = Target only dead allies, 3 = Cures undead, 4 = Randomize target, 5 = Ignore defense, 6 = No Split Damage, 7 = Abort on Allies) $11A3 : Damage Type (Bit 0 = Use outside battle, 1 = Not reflectable, 2 = Learn if cast 3 = Enable Runic, 4 = ???, 5 = Retarget if target dead, 6 = Caster dies, 7 = Concerns MP) $11A4 : Special Byte 2 (Bit 0 = Heal, 1 = Redirection, 2 = Lift status, 3 = Toggle status, 4 = Stamina can block, 5 = Can't be dodged, 6 = Hits mult. of hit rate, 7 = Damage based on HP) $11A5 : MP cost of spell $11A6 : Battle Power or Spell Power $11A7 : Special Byte 3 (Bit 0 = Miss if no status set or clear, 1 = Text if hits) $11A8 : Hit Rate $11A9 : Special effect of attack $11AA : Status set by attack 1 (Bit 0 = Blind, 1 = Zombie, 2 = Poison, 3 = M-Tek, 4 = Invisible, 5 = Imp, 6 = Stone, 7 = Death) $11AB : Status set by attack 2 (Bit 0 = Count, 1 = Weak, 2 = Image, 3 = Mute, 4 = Berserk, 5 = Confuse, 6 = Seizure, 7 = Sleep) $11AC : Status set by attack 3 (Bit 0 = Dance, 1 = Regen, 2 = Slow, 3 = Haste, 4 = Stop, 5 = Shell, 6 = Safe, 7 = Wall) $11AD : Status set by attack 4 (Bit 0 = Rage, 1 = Freeze, 2 = Life 3, 3 = Morph, 4 = Spell, 5 = Hide, 6 = Dog Block, 7 = Float) $11AE : Vigor * 2 or Magic Power $11AF : Level $11B0 : Maximum Damage $11B4 : Spell randomly cast by weapon $3400 : Spell number $3401 : Text to display $3402 : # of extra turns from Quick $3404 : Target who gets extra turns from Quick $3405 : # of attacks? $3414 : ? (if 0 then damage modification is skipped) $3A2A : Final Damage $3A2C : Command read from command script (4 bytes) $3A48 : Miss target if not 0 $3A54 : Characters hit in back by attack $3A55 : Monsters hit in back by attack $3A5A : Which targets are missed by attack $3A70 : # of attacks? $3A74 : Which characters are alive and present in battle (bit 0 = character 1, 1 = character 2, etc.) $3A7A : Command $3A7B : Attack $3A82 : Target protected by Golem $3A83 : Target protected by Dog Block $3A89 : Spell randomly cast by weapon $3EC9 : # of targets Accessed by X = attacker, Accessed by Y = target : $1FF9 : Which monster is it $2001 : Monster # $2022 : ATB Counter (for displaying gauge) $3018 : Holds $01 for character 1, $02 for character 2, $04 for character 3, $08 for character 4 $3019 : Holds $01 for monster 1, $02 for monster 2, etc. $3205 : 0 = bit set, Bit 2 = Air Anchor effect $3219 : ATB Counter $322D : Monster's special attack $3254 : Index to find command script for regular attacks $3268 : Index to find command script for special (counter) attacks $32B8 : Which target you control (-1 for none) $32B9 : Which target controls you (-1 for none) $32E0 : Attacker for this attack $32E1 : Dance being used $32F5 : Which target is targetted by targetting attack $3308 : Common item to steal $3309 : Rare item to steal $331C : Blocked status byte 1 (Bit = 0 = set) $331D : Blocked status byte 2 $3330 : Blocked status byte 3 $3331 : Blocked status byte 4 $3344 : Esper equipped $3358 : Which target you have seized (Seize) (Bit 7 = ??) $3359 : Which target has seized you (Seize) $336C : Which target you take damage for (Love Token) $336D : Which target takes damage for you (Love Token) $3394 : Which target you charmed (Charm) $3395 : Which target charmed you (Charm) $33D0 : Damage taken $33E4 : Damage Healed $33A8 : Which Rage is being used $3AA1 : Special Properties (bit 1 = Defend, 2 = prot. from death, 4 = seized? 5 = Row [0 = back row], 6 = controlled?, 7 = ran away?) $3AF1 : Time until Stop wears off $3B05 : Countdown counter $3B18 : Level $3B19 : Speed $3B2C : Vigor $3B40 : Stamina $3B41 : Magic Power (* 1.5 for monsters?) $3B54 : Evade (255 - Evade * 2) + 1 $3B55 : MBlock (255 - Mblock * 2) + 1 $3B68 : Battle Power $3B7C : Hit Rate $3BA4 : Right hand weapon (bit 1 = Can use Swdtech, 5 = Full damage from back row, 6 = Can use 2-handed, 7 = Can use Runic) $3BA5 : Left hand Weapon (as $3BA4) $3BB8 : Defense $3BB9 : Magic Defense $3BCC : Absorbed elements $3BCD : Nullified elements $3BE0 : Weak elements $3BE1 : Resisted elements $3BF4 : HP $3C08 : MP $3C1C : Max HP $3C30 : Max MP $3C44 : Relic effects 1 (Bit 0 = Atlas Armlet, 1 = Double Earrings, 2 = Fight => Jump, 3 = Magic> X-Magic, 4 = Sketch => Control, 5 = Slot => GP Rain, 6 = Steal => Capture, 7 = Jump Continuously) $3C45 : Relic effects 2 (Bit 0 = Sneak Ring, 1 = Earring, 2 = Increase sketch chance, 3 = Increase Control chance, 4 = Sniper Sight, 5 = Gold Hairpin, 6 = Economizer, 7 = Hyper Wrist) $3C58 : Bit 0 = Offering, 1 = Black Belt, 2 = Beads, 3 = Gauntlet, 4 = Genji Glove 5 = Merit Award, 6 = True Knight $3C59 : Bit 0 = Shell when low HP, 1 = Safe when low HP, 2 = Reflect when low HP, 3 = Exp. Egg, 4 = x2 Gold, 7 = Relic Ring $3C80 : Special Byte 2 (Bit 0 = Wait atk., 1 = Atk First, 2 = Make Suplex miss, 3 = Can't run, 4 = No scan, 5 = No Sketch, 6 = Special event, 7 = Can't Control) $3C94 : Morph Chance & Morph Package $3C95 : Special Byte 3 (Bit 0 = Dies at 0 MP, 1 = ???, 2 = No name, 3 = ??? 4 = Human, 5 = ???, 6 = Auto critical if Imp, 7 = Undead) $3CA8 : Weapon in right hand $3CA9 : Weapon in left hand $3CD0 : Relic Slot 1 $3CD1 : Relic Slot 2 $3CE4 : Shield/Weapon miss animations $3CF9 : Time until Sleep wears off $3D34 : Spell randomly cast by weapon $3D48 : Which command you were attacked with this attack $3D49 : Which spell (or attack) you were attacked with this attack $3D5C : Which item was used on you for this attack $3D5D : Which element(s) you were attacked with this attack $3D84 : XP $3D98 : Gold monster gives $3DC0 : Counter for how long monster has been alive (2 bytes) $3DD4 : Status to set byte 1 $3DD5 : Status to set byte 2 $3DE8 : Status to set byte 3 $3DE9 : Status to set byte 4 $3DFC : Status to clear byte 1 $3DFD : Status to clear byte 2 $3E10 : Status to clear byte 3 $3E11 : Status to clear byte 4 $3E24 : Damage increment for poison $3E4C : bit 0 = retort, 1 = enemy runic (speck), 2 = runic $3E60 : Status after attack byte 1 $3E61 : Status after attack byte 2 $3E74 : Status after attack byte 3 $3E75 : Status after attack byte 4 $3ED8 : Which character it is $3EE4 : Status byte 1 $3EE5 : Status byte 2 $3EF8 : Status byte 3 $3EF9 : Status byte 4 $3F0C : Time until Wall wears off $3F0D : Time until Freeze wears off Commands: 00 Fight 01 Item 02 Magic 03 Morph 04 Revert 05 Steal 06 Capture 07 Swdtech 08 Throw 09 Tools 0A Blitz 0B Runic 0C Lore 0D Sketch 0E Control 0F Slot 10 Rage 11 Leap 12 Mimic 13 Dance 14 Row 15 Def. 16 Jump 17 X-Magic 18 GP Rain 19 Summon 1A Health 1B Shock 1C Possess 1D Magitek