+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Final Fantasy IV Advance: Weapon Offsets
Pages: [1]
Author Topic: Final Fantasy IV Advance: Weapon Offsets  (Read 2 times)
pkt_paladin
Guest
« on: August 17, 2007, 01:41:34 pm »

--Weapons:--

Messing around with the FF4 Advance ROM (US version), I managed to locate some of the offsets for each weapon in the game, though I'm not entirely clear on what each byte does. Here's how it works:

The data begins at the offset E5A1C, with the first weapon being the FireClaw. Here's the data:

00 00 50 00 00 00 00 00 00 00 80 04

Byte 1: 00: Battle power of weapon
Byte 2: 00: Unknown
Byte 3: 50: Accuracy bonus when equipped. *
Byte 4: 00: Unknown
Byte 5: 00: Unknown
Byte 6: 00: Strength Bonus**
Byte 7: 00: Agility Bonus**
Byte 8: 00: Stamina Bonus**
Byte 9: 00: Intellect Bonus**
Byte 10: 00: Spirit Bonus**
Byte 11 and 12: Who can equip modifier***

* = For accuracy, The hex value 32 (50 in decimal) doesn't change accuracy. Anything below it will lower accuracy by the difference between the two, so a hex value of 00, for example, will lower accuracy by 50, and a hex value of 10 will lower it by 30.
** = Adds anything that's 79 and below, but everything 80 and above is negative.

Here are the values for the Who can Equip Modifier:
Byte 11:
   01 - Dark Knight Cecil
   02 - Kain
   04 - Rosa
   08 - Rydia
   10 - Cid
   20 - Tellah
   40 - Edward
   80 - Yang
Byte 12:
   01 - Palom
   02 - Porom
   04 - Edge
   08 - FuSoYa
   10 - Paladin Cecil

Basically, you take the sum of these hexadecimals. So if you want Rydia and Yang to be able to equip something, you would put 88, because 08 + 80 = 88.

It seems that all of the data for the rest of the items is included, but the bytes that decide whether what is equipped is a weapon/shield/helmet is not included here, nor is what spell is cast when the item is used in battle. Sell price and sort order are also not included.

The order for the data follows the list given for Codebreaker codes. Look under the Equipment List in this FAQ: http://www.gamefaqs.com/portable/gbadvance/file/929937/41243 .

Any input would be greatly appreciated. Smiley




Edit #1: --Armors--:

For shields, helmets, armors, and gauntlets:

Byte 1: Defense bonus; total cannot exceed 255
Byte 2: Unknown
Byte 3: Evasion bonus; accepts values greater than 99%
Byte 4: Magic Defense bonus; total cannot exceed 255
Byte 5: Magic Evasion bonus; accepts values greater than 99%

Byte 6-12: Work exactly the same as weapons; see above.


Another note: The data that I've located does not include unequippable items. After the Cursed Ring, it skips directly to the Hands of the Gods. I have yet to locate item data.




Edit #2: --Level-Up Stats:--
Dark Knight Cecil: E7838-E8367
Kain: E7DD8-E8367
Child Rydia: E8378-E89A7
Tella: E89A8-E8EA7
Edward: EDEA8-E9497
Rosa: E9499-E9A27
Yang: E9A28-E9FD7
Palom (B.M.): E9FD8-EA577
Porom (W.M.): EA578-EAB17
Paladin Cecil: EAB18-EB147
Cid: EB149-EB647
Edge: EB649-EBAF7
FuSoYa: EBAF9-EBE17

There are 16 bytes for each level-up. Here's what each determines:
Bytes 1-3: Experience needed to achieve that level; 00 means it's for level 1
Byte 4: Seems to be 00 for every character
Byte 5: Strength for that level
Byte 6: Agility for that level
Byte 7: Stamina for that level
Byte 8: Intellect for that level
Byte 9: Spirit for that level
Byte 10-12: Unknown
Byte 13-14: Range of HP growth for that level
Byte 15-16: Range of MP growth for that level
« Last Edit: August 18, 2007, 11:19:44 am by pkt_paladin »
Kajitani-Eizan
Guest
« Reply #1 on: August 18, 2007, 01:11:41 am »

i would guess that some of those unknowns are element, strong vs. (type), and randomly cast spell upon attack?

(for example, icebrand is ice element (or just strong vs. fire monsters?), the sword of legend is strong vs. the dark elf?, and the lightbringer randomly casts holy.)
pkt_paladin
Guest
« Reply #2 on: August 18, 2007, 11:19:08 am »

Quote from: Kajitani-Eizan on August 18, 2007, 01:11:41 am
i would guess that some of those unknowns are element, strong vs. (type), and randomly cast spell upon attack?

(for example, icebrand is ice element (or just strong vs. fire monsters?), the sword of legend is strong vs. the dark elf?, and the lightbringer randomly casts holy.)

That was my thought as well, but all of the data remains 00 for that one value for every item in the game. My guess is that they made room in case they needed more than 255 possibilities offered with hexadecimals.

Concerning the use in battle, I found some of the other item data:
From ECBF8-EDE2C, there are 20 hex values for each item in the game:

From a random item: 02 00 00 00 E2 04 00 00 10 00 00 00 00 00 00 00 1A 00 8F 00
   Byte 1: Icon next to item.
      01 - Claw   02 - Rod   03 - Staff   04 - Dark Sword   05 - Broadsword   06 - Larger sword (Legend)
      07 - Spear   08 - Dagger   09 - Katana?   0A - Shuriken   0B - Boomerang   0C - Axe
      0D - Hammer   0E - Music Note   0F - Bow   10 - Arrow   11 - Holy Staff?   12 - Whip
      13 - Shield   14 - Helmet   15 - Armor   16 - Gauntlet   17 - White Magic   18 - Black Magic
      19 - Call Magic
   Byte 2-4: 00 00 00 for every item.
   Bytes 5-8: Price data for purchasing items in shops. The game automatically calculates sell price by dividing the buy price in half.
   Byte 9: Usage possibilities: This hexadecimal is split. Not sure what the first half does, but as for the second half, 0 means it can't be used in or out of battle, 1 means only in battle, 2 means only out of battle, and 3 means both
   Byte 10: Setting this to 80 or above makes the item not decrease from your inventory when used out of battle. The only item in the game with this value is the key item "Crystal" used in the final battle.
   Byte 11-12: Unused for all items, always 00 00
   Byte 13-14: These four digits describe the effect of the item in menus. Using a pair not already previously defined seems to crash the game. A9 72 gives the effect of an ether, 01 73 a potion, etc.
   Byte 15-16: 00 00 if not usable outside of battle, 05 08 always if it is usable outside of battle
   Byte 17-18: EFfect inside of battle.  This follows the standard magic list with a few adjustments (from http://www.gamefaqs.com/portable/gbadvance/file/929937/41243). It has 2 available bytes, but only 1 is ever used
      White magic, black magic, twin magic, and ninja techniques are normal
      Call magic is from 4D-5B
      5C-AF does nothing, and the item list follows.
   Byte 18: Always 00
   Byte 19: Targeting:    85 - One enemy by default
      20 - Self only      08 - All enemies only      02 - All party members only
      03 - Any enemy / party member or all enemies / party membersr
   Byte 20: Always 00


Also, have some Shop Data for fun.

The end marker for shops is FF 00. The first pair of hexadecimals (00 00) contains either 00 (weapons shop), 01 (armor shop), or 02 (items shop). Following is just a list of items sold in the shop, and the values for the items is directly from http://www.gamefaqs.com/portable/gbadvance/file/929937/41243 .

For example, the Baron Item shop is F0EED. Other shops can be found by searching for the items in the order that they appear in the shops. The items are entered in reverse order, however, so the requiem harp, for example, would be sold as 4401, even though it's listed as 0144.


EDIT #1: Spell Learning Data

EE7C0 - EE7D1: Paladin Cecil's White Magic
EE7D2 - EE80C: Rosa White Magic
EE80D - EE80E: C.Rydia Call Magic
EE80E - EE818: C.Rydia White Magic
EE819 - EE856: C.Rydia (Probably adult as well) Black Magic
EE857 - EE85C: Tellah White Magic
EE85D - EE863: Tellah Black Magic
EE864 - EE8A1: Palom Black Magic
EE8A2 - EE8DF: Porom's White Magic
EE8E0 - EE8EB: Edge's Ninja Magic
EE8EC - EE904: FuSoYa's White Magic
EE905 - EE91D: FuSoYa's Black Magic

Format: First will be the already-learned spells, then FF, then Level, Spell digit, 00. For example, 03 17 00 means at level 3, the character will learn Sight.

For example:

Cecil's data: FF 0E FF 03 17 00 08 0D 00 .... FF

Blocks are data between FF's
First block shows that Cecil knows Cure initially
Second block says he will learn Sight at level 3, Scan at level 8, etc.
« Last Edit: August 18, 2007, 12:57:15 pm by pkt_paladin »
JCE3000GT
Guest
« Reply #3 on: August 26, 2007, 02:11:35 pm »

Myself and a couple of people already compiled some info for FF4 GBA, you should add what you've found that isn't already there.

http://www.datacrystal.org/wiki/Final_Fantasy_4_Advance:ROM_map
Jigglysaint
Guest
« Reply #4 on: August 29, 2007, 02:27:47 pm »

Yeah, I found lots of that kind of data, including the weapon attribute data.  Oddly enough I never found out how to make certain weapons randomly cast magic.  I still want to see a hack where you learn all spells though items and not level ups.  I have the call item code bookmarked, so once I learn some ARM or THUMB, I could take a look and have fun with that.

I also have a table file of the letters that are used for the text.  Like in FF1, Dawn of Souls, each letter is 2 bytes.
Neil
Guest
« Reply #5 on: January 01, 2009, 09:50:30 pm »

-necrobump to save a thread from the great board prune of 2009-
Aerdan
Guest
« Reply #6 on: January 02, 2009, 02:44:13 am »

Data presented in this thread has been put into a text file and submitted.
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC