Well basically I created a ''final attack'' does great damage and ranged weapon. Does anyone think of something it is not affected by Dual Wield? (To avoid excessive damage) I've been thinking about this for a long time.
I have done this:
<Patch name="Two Swords depend of Weapon Strike instead of Weapon Range">
<Description>Two Swords depend of Weapon Strike instead of Weapon Range</Description>
<Location file="BATTLE_BIN" offset="116660">
04
</Location>
</Patch>
But, I would like to depend on another flag exactly.
Anyone can explain me what is loaded here?
lui r2,0x8019
lbu r2,-0x0814(r2)
I don't understand what is loaded when immediate is negative.
What exactly does this hack do? Can you give a mathematical example?
It makes a skill fire twice if the skill has Weapon Strike flagged instead of Weapon Ranged flagged, FDC, and he is asking if there is a different, hopefully empty flag he could use for this role instead, likely because unflagging Weapon Strike makes your animations derpy as fuck and 99.9% of people like their games to not look derpy as fuck.
Yes, I want load another set of flags. In all ways, here is my explanation:
I see this in the routine ''Determining Multi Hit Formulas'':
Before of this, the routine determine if Two Swords work on the ability, Determining if skillset is Jump, Throw, or if the ability ID is lower than 0x170(potion).
0017d654: 3c028019 lui r2,0x8019 r2= 80190000
0017d658: 9042f7ec lbu r2,-0x0814(r2) I don't know, and this is this is what I asked, maybe load in r2 a byte at 0x80190000-0x0814= 0x8018F7EC? This location doesn't appear in Data Locations.txt, but it would have to load flags 1 of ability data.
0017d65c: 00000000 nop
0017d660: 30420020 andi r2,r2,0x0020 r2= r2 And 0x20 (0x20= Weapon Range)
0017d664: 10400023 beq r2,r0,0x0017d6f4 Branch to end of the routine (Two swords no effect) if ranged weapon isn't check (Branch if r2=0)
0017d668: 00000000 nop
Well, in the hack I only change andi r2,r2,0x0020 by:
andi r2,r2,0x0004, (0x04 = Weapon Strike)
Your guess is correct. You always add the offset to the base; when the offset is negative, the base decreases.
0x80190000 - 0x0814 = 0x8018f7ec
That appears to be the correct memory address.
Doing some digging, I found this code in the same routine, a little bit up from the example you posted. I've done a bit of commenting:
0017d5a8: 000310c0 sll r2,r3,0x03 # Ability ID * 8
0017d5ac: 00431023 subu r2,r2,r3 # Ability ID * 7
0017d5b0: 00021040 sll r2,r2,0x01 # Ability ID * 14
0017d5b4: 3c038006 lui r3,0x8006
0017d5b8: 2463fbf0 addiu r3,r3,0xfbf0 # 0x6fbf0 (Start of Ability Data 2)
0017d5bc: 00431021 addu r2,r2,r3 # 0x6fbf0 + (Ability ID * 14)
0017d5c0: 90430003 lbu r3,0x0003(r2) # Load Flags 1 for this ability
0017d5c4: 3c018019 lui r1,0x8019
0017d5c8: a023f7ec sb r3,-0x0814(r1) # Save it at 0x8018f7ec
That would explain how Flags 1 gets loaded into memory at 0x8018f7ec.
Thanks a lot, Glain. Now I only change lbu r3,0x0003(r2) by lbu r3,0x0004(r2) for load Flags 2:
<Patch name="Two Swords depend of the flag under hit allies instead of Weapon Range">
<Description>Two Swords depend of the flag under hit allies instead of Weapon Range</Description>
<Location file="BATTLE_BIN" offset="1165C0">
04
</Location>
</Patch>