@Agro
Edit: Omg yes it works, ahahahahah
Okay, so change the bytes at 16CF4 from whatever they were to 01 F0 4C FF (This makes heals based off Res)
And the bytes at 2A672 from whatever they were to EE F7 8D FA (This makes offensive staves base their accuracy off of Res)
And the bytes at 184C0 from whatever they were to FD F7 2C FE 18 21 (This makes Mag/2 ranges, encoded in the 0xC byte of item data as 0x10, to have range based on Res(+equip’s bonus). You might want to apply a display patch so it doesn’t display “Mag/2”)
That’s it. Just tell it to branch to a different subroutine(one that fetches Res+bonus, not Str+bonus, bonus being from equipped weapon). I’ve tested it both with and without aureola equipped and it does make a difference and go off of boosted res. The routine I call is the one I note at the very bottom of this post. I’m leaving all my thoughts here for documentation. It does document how to fetch boosted other stats as well.
Edit3: Now analyzing how “Mag/2” ranges are calculated. Used a break on read to find the instructions at 08016f7a are suspicious.
If the second range nibble is NOT zero(most weapons) then it branches at 08016FE82. However, Mag/2 ranges are coded as 0x10, so it doesn’t branch,
It seems to assign 0x63 to r6 in the case of Mag/2… Uh, after it loops the inventory(I assume it’s getting the ranges it can target?) It jumps to 08016FB0… there it checks r6 against 0x63.
@the branch command from 80184B8 to 8016764 - I think this is finding equipped item? For staff ranges O.o(Edit: Oh, to grab the stat bonuses)?
I… think I found it? I suspect the bl at 80184C0(to 801707C) grabs the str bonus(if so, the corrisponding res routine starts at 801611C), and then line 80184C6 explicitly grabs str/mag.
Furthermore, the value is ASR’d five lines below(suggesting a division by two), and is compared against 4(is that a harcamp on minimum physic range?)
For now I’m trying to change 080184C0 to bl #0x801611C and 080184C4 to mov r1, #0x18
YAAAAAAAAAY it worked I gave Eliwood 20(+5 from aureola) Res and his range increased to… 12 spaces! Success!!!
Edit2: Now working on the offensive staves
08028BD0 r5 is hit?
Actual hit calculated before 0802C7A4.
Routine to lead edited Resistance it at 08018B90? Okay so changing the function all at 0802A672 from a call to 8018AD0 to 8018B90…
Yes this appears to work. The bytes to change added up top
Notes:
To make heal/mend/fortify/physic run off of res, change the 4 bytes at 016CF4 from whatever they are(some bl command) into 18 21 40 56. I tested it and it doesn’t crash… immediately. I think it should work since r0-r3 are meant to be clobbered anyway.
The explanation is that it calls some branch routine that the game uses in other loops to fetch effective str/mag. Messing with that gave things negative bonuses.
–speaking of, this short-term hack doesn’t account for bonus res(I don’t believe) so…
It works well enough though when you aren’t equipping aureolas though…
–notes as I decipher their str-getting thing for how to grab res bonuses. At the end of the two branches, r1 appears to have the bonus… Though it’s returned from the second branch as r0…
080161C2 appears to be a check for a weapon. Either it’s finding the equipped item or only items default to giving stat bonuses… I think 0x8016764 is used to determine the equipped weapon… (Ugh I was looking for that code a long time ago to implement my modified steal) (Also I think this is the routine to change if you’re looking for non-equipped item buffs). Loads stat bonuses at 08016080(Routine starts at 0801606C, was called at 08018AE0). Then takes the strength only. So I have to write (or find!) a mirroring code for res. The get stat bonus codes seem to be arranged logically; right in order. So scrolling down to the one that grabs res… It appears to be at 0801611C
… the corresponding routine appears to be at 0x08018B90…