Final Fantasy Hacktics

Modding => Help! => Topic started by: Rfh on March 11, 2012, 09:14:21 am

Title: Is possible to do this?
Post by: Rfh on March 11, 2012, 09:14:21 am
Two or more units in a team cannot be charm at the same time.
Title: Re: Is posible to do this?
Post by: Xifanie on March 11, 2012, 03:05:59 pm
Well you would need to create an exception to cancel the addition of charm whenever it is present once...
I don't know much about ASM hacking formulas but that seems rather tough.
Title: Re: Is posible to do this?
Post by: Rfh on March 11, 2012, 03:49:52 pm
Well, if it is very difficult to do, leave it. I was hacking status effects on my game Final Fantasy The God's Tactics, and I need the state Dark/Evil Looking use CT, not to stay forever. Someone could do this?
Title: Re: Is posible to do this?
Post by: Pride on March 11, 2012, 04:35:33 pm
That also would be tough, Wall also as a CT and is unused. I would either recommend using that or sacrificing a used status with a CT such as Faith or learning how to ASM yourself
Title: Re: Is posible to do this?
Post by: Rfh on March 11, 2012, 05:39:39 pm
I want t create a status that freeze charge time with more CT than Stop. I chose Dark/Evil Looking because it turn dark the units. Is there a possibility to make Wall status has the visual effect of Dark / Evil Looking? Or is it too hard to do?
Title: Re: Is posible to do this?
Post by: Pride on March 11, 2012, 07:08:03 pm
Someone was researching some graphical data but I don't know if he ever found the palettes for status effects. There would be a lot of data to go through, in a lot of sections that I don't know. Is certainly possible, just have to find the right way to look for it.
Title: Re: Is posible to do this?
Post by: Rfh on March 11, 2012, 07:47:57 pm
and about the stop animation?  (the sprite don't move, like in the stop and dark/evil looking status
Title: Re: Is posible to do this?
Post by: Pride on March 11, 2012, 08:38:10 pm
Again, that's graphical data
Title: Re: Is posible to do this?
Post by: Rfh on March 15, 2012, 05:39:20 pm
At the end, did you find the graphic data of the status?
Title: Re: Is posible to do this?
Post by: Pride on March 15, 2012, 05:40:42 pm
No
Title: Re: Is posible to do this?
Post by: Rfh on March 18, 2012, 06:33:43 pm
I'm really inerested in it, if anyone knows how to do this, let me know, please.
Thanks.
Title: Re: Is posible to do this?
Post by: Xifanie on March 18, 2012, 06:59:01 pm
Learn to ASM hack (there are many tutorials covering the subject) then use your head to figure it out.
Title: Re: Is posible to do this?
Post by: Rfh on March 19, 2012, 07:54:51 am
Ok, I am going to try it again. I really want learn ASM mainly to change status, like convert Faith in MA up, and Innocent in MA down.   
Title: Re: Is posible to do this?
Post by: Rfh on March 29, 2012, 10:09:11 am
I understand the Pokeytax's ASM Tutorial: Part #0.
Now this is attempt to convert formula 51 Hit_(MA+X)% in to Hit_(X)%. Glain's Learning Segment #1 only explain how to edit the formula routine sought. Well, The Xifane guide tell how to find it, but t where does the breakpoint 0x8005fc08?
0x801938FA appears in R5, but when I put it as a Breakpoint, the game isn't freeze in any moment.
I'm confused... I do not understand how to find the routine of formulas... And about edit status? Is there any information to edit them?
Sorry to be Spanish makes it hard to read a difficult guide in English...
Title: Re: Is posible to do this?
Post by: Choto on March 29, 2012, 10:59:11 am
The wiki has lots of the routines documented with notes, so i suggest looking there first. This will help you because you can follow the notes and understand what the commands do:

This is what the formula actually does:
http://ffhacktics.com/wiki/51_Hit_%28MA%2BX%29%25

each Jal command jumps to another routine that does some calculation, then returns to the formula and continues. To find out what these routines are doing, look for the location that it jumps to in the Routine Locations page:
http://ffhacktics.com/wiki/Routine_Locations

once you find the routine it jumps to, you can look at how that routine is changing the data. If you see something like:

001865b8: 3c028019 lui r2,0x8019      
001865bc: 944238d0 lhu r2,0x38d0(r2)      Load YA

it means its loading whatever value is stored at 801938d0. To find out it is actually loading, look at the Data Locations.txt file i attached to this post. This file will tell you exactly what information is stored at what locations.

Now comes the tricky part. You'll have to write new code over the formula to accomplish what you want to do, because I don't think there's a routine that makes X into the hit% for the ability. What you want to do in non-program language is:

load abilities X value
store abilities X value as hit%
See if attack missed (I think this is the "total accuracy check" routine in the formula)
...continue rest of formula (you have to make sure you don't overwrite anything important)

Once you have an idea of what you want to do, you just have to write the code that does these things. I suggest keeping FDC's tutorial that explains the commands up while you do this so that you can use it as a guide.

If this all seems overwhelming, read it again later. ASM is hard to learn in one attempt, but if you keep re-reading things it will come with time.
Title: Re: Is posible to do this?
Post by: Rfh on March 30, 2012, 10:15:02 am
Thanks you very much Choto.

Well, my first hack is very simple. I removed Store MA and and store MA as X for all formulas that their accuaracy is Hit (MA+X)%. Therefore, the formula is Hit (1+X)%:


  <Patch name=" All formulas that their accuaracy is Hit (MA+X)% become Hit (1+X)%">
    <Description>Affect formulas 0B,0D,0E,12,29,2A,4D,4F,50,51 and 58</Description>
    <Location file="BATTLE_BIN" offset="11ED90">
      00
    </Location>
    <Location file="BATTLE_BIN" offset="11EDA0">
      0000
    </Location>
  </Patch>

Not sure why XA = 1, but I think it's really useful.


Title: Re: Is posible to do this?
Post by: Choto on March 30, 2012, 08:44:23 pm
Nice! did you test it/does it work?? I'm so proud ;_;
Title: Re: Is posible to do this?
Post by: Rfa on March 31, 2012, 05:34:37 pm
(I am Rfh)

Quote from: Choto on March 30, 2012, 08:44:23 pm
Nice! did you test it/does it work?? I'm so proud ;_;

Yes, it works. Well, I'm interested in convert Zodiac Compatability in to Good/Bad compat is +/- 12.5% and Best/Worst compat is +/- 25%. I can see the information here: http://ffhacktics.com/wiki/Compatibility, but I want to put the Dark/Evil Loocking graphics data in Wall status, but I haven´t got idea where I can find this information. Any idea? 
Title: Re: Is posible to do this?
Post by: Pickle Girl Fanboy on March 31, 2012, 06:29:16 pm
Your English is getting better.
Title: Re: Is posible to do this?
Post by: Choto on March 31, 2012, 09:24:36 pm
Quote from: Rfa on March 31, 2012, 05:34:37 pm
but I want to put the Dark/Evil Loocking graphics data in Wall status, but I haven´t got idea where I can find this information. Any idea?


As the other guys mentioned, this is graphical data... We don't know as much about graphical data so I can't really help ya there. Somebody else might know but i'm not sure.
Title: Re: Is posible to do this?
Post by: Rfh on April 01, 2012, 08:06:14 am
Finally, here is the  hack:
 
<Patch name=" Good/Bad compat is +/- 12.5% and Best/Worst compat is +/- 25%">
    <Description> Good/Bad compat is +/- 12.5% and Best/Worst compat is +/- 25%</Description>
    <Location file="BATTLE_BIN" offset="011DA9C">
      82
    </Location>
    <Location file="BATTLE_BIN" offset="011DAB8">
      42
    </Location>
    <Location file="BATTLE_BIN" offset="011DAD8">
      82
    </Location>
    <Location file="BATTLE_BIN" offset="011DAF0">
      42
    </Location>
  </Patch>

This hack I think that is created by PX_Timefordeath, I only find the hack in the FFT Arena RAM. (I have learned a lot of things doing this)

About the status Dark / Evil Looking, Is there the possibility of adding CT to this status?
Title: Re: Is posible to do this?
Post by: Xifanie on April 01, 2012, 08:18:48 am
You can theorically if you sacrifice one other status' CT counter.
Title: Re: Is posible to do this?
Post by: Rfh on April 01, 2012, 05:29:21 pm
I want to sacrifice Wall CT.
I find this in the byte in the Half-Word Wall CT in the end of a turn when a unit has the status wall.
0x0001 I think that is referred to Wall Status, but Wall is in 0x005B and cursed is in byte 0x0059, so I cannot change it simply.
So, how would I do this?
(I think I'm making a mess)
Title: Re: Is posible to do this?
Post by: Rfh on April 02, 2012, 04:12:03 pm
Well, I have no idea how to do this, What should I know to do this?
Title: Re: Is posible to do this?
Post by: Choto on April 02, 2012, 04:37:44 pm
You'd have to do a couple things

Basically you want to store whatever CT amount desired for the dark status into the wall status CT counter for the affected unit. So you need to find the routine that puts that CT in there initially when the status is applied. You'd also have to make sure that that CT isn't gonna get overwritten when Wall is applied, so to overwrite that would be convenient.

Then you also need to make it so when Status CT is lowered, if the Wall status CT = 0, then you remove the dark status.

So each status that can hold CT has a location that is written to to hold this CT amount, and is lowered each clocktick or turn or whatever. You'll find these locatiosn right after the status bytes (59,5A,etc.) in unit data. You're just gonna program it to use the dark status CT instead of Wall status CT.

I'm not sure if these routines can all be found on the wiki that you need to edit, but i think they may be up there. I also may be overlooking something but i'm not sure. Try setting a breakpoint on the Wall status CT when its applied, lowered, and removed to see where you need to change it to use dark status CT.
Title: Re: Is posible to do this?
Post by: Rfh on April 03, 2012, 08:40:52 am
I use breakpoint 0x80192530, (Wall CT) but the game only freezes when the status is finished, and I can see the previous image. In the wiki nothing appears on Wall CT, but appear this: http://ffhacktics.com/wiki/Status_CT_Setting I'm tired of searching, not knowing what to do ...
Title: Re: Is possible to do this?
Post by: Rfh on April 05, 2012, 02:34:12 pm
I have been unable to really learn mips assembly because my English level (besides I have only 14 years) I tried the guide that Glain  posting in his topic and I was stuck in Part 3.(Just the act of writing all this text in English is awkward for me)  I've been looking for guides in Spanish, but the only ones I've found using a very cultured language and involve knowing things in advance. If someone could sacrifice Wall CT the to put CT in cursed status ...would greatly appreciate it, really. I swear I will be the last ASM hack to ask in this forum. (The simple things I know to do them). In the future, when I know more things, I'll try again. I also get good marks in my secondary school, and I always have been the goal to study ''ingenieria en informática'' in english I think that is computer science engineering. Perhaps here, I will learn something about Mips Assembly.
Title: Re: Is possible to do this?
Post by: Rfh on April 06, 2012, 12:58:55 pm
Do not know if it will be easier ... Or at least make the duration of  dark status is 2 turns and ends when the second shift ends. (I prefer with CT)
Title: Re: Is possible to do this?
Post by: Rfh on April 08, 2012, 11:07:44 am
I am interested in 2 formulas hacks.
The first I got it done:

  <Patch name="Formula 0C Heal_F(MA*Y) become Heal_F(MA+Y)/2*MA)">
    <Description> Formula 0C Heal_F(MA*Y) become Heal F(MA+Y)/2*MA)</Description>
    <Location file="BATTLE_BIN" offset="121F00">
      3017060C
    </Location>
  </Patch>

But my other formula hack is to transform a formula in WP * PA # Hit_ (X +1). I could change Routine Location  ''2Truth/Formula 5E-5F Calculate damage'' load WP * PA, but affect all formulas that are based in # Hit_ (X +1).
Could there be any way to do that only affects one formula?
Title: Re: Is possible to do this?
Post by: Pride on April 08, 2012, 01:16:50 pm
Yes... But you'd have to write a new routine in some Kanji space.

[1e]
00189434: 27bdffe8 addiu r29,r29,0xffe8
00189438: afbf0010 sw r31,0x0010(r29)
0018943c: 0c06216e jal 0x001885b8    Magic Evade  <--- May want to change that to Physical Evade
00189440: 00000000 nop
00189444: 14400003 bne r2,r0,0x00189454
00189448: 00000000 nop
0018944c: 0c062269 jal 0x001889a4    Truth Formula <--- You'd have to write a new routine for this formula
00189450: 00000000 nop
00189454: 8fbf0010 lw r31,0x0010(r29)
00189458: 27bd0018 addiu r29,r29,0x0018
0018945c: 03e00008 jr r31
00189460: 00000000 nop
Title: Re: Is possible to do this?
Post by: Rfh on April 09, 2012, 01:12:37 pm
One question, where is the space kanji?
Title: Re: Is possible to do this?
Post by: Pride on April 09, 2012, 02:15:32 pm
http://ffhacktics.com/wiki/Allocated_space

You could probably just use Sentinal Blade or VincentCraven's space and that's the BATTLE.BIN offset, you need to add 0x67000 to get the RAM offset
Title: Re: Is possible to do this?
Post by: Rfh on April 10, 2012, 10:49:24 am
I have done, this, but the game freeze when I select a target with the formula:

<Patch name="Formula 5F become Dmg (PA*WP) # Hit_ (X +1)">
<Description>Formula 5F become Dmg (PA*WP) # Hit_ (X +1)</Description>
<Location file="BATTLE_BIN" offset="123AD0"> -- In the formula 5F
4421060C (jal 0x00188510) -- Physical Evade Calculation
</Location>
<Location file="BATTLE_BIN" offset="123AE0"> -- In the formula 5F
C747050C (jal 0x00151f1c) ''Truth Formula''  -- Jump to offset EAF1D (Kenji Space of VicentCraven)
</Location>
<Location file="BATTLE_BIN" offset="EAF1D"> -- In the Kanji space
(These hex is the same that routine ''2Truth/Formula 5E-5F Calculate damage'')
E8FFBD27
1000BFAF
3017060C (jal 0x00185cc0) ''Get XA and YA''  (I need to change it by 7617060C (jal 0x00185dd8) for Store WP and PA, but the game freezes in the both cases.
00000000
5922060C
00000000
1000BF8F
1800BD27
0800E003
00000000
</Location>
</Patch>

What is the wrong?

Other formula that I'm interested is convert formula 24 Dmg ((PA+Y)/2*MA) in to 24 Dmg ((PA+Y)*XX/YY/2*MA):
I change the routine location ''Store MA and PA + Y / 2''

<Patch name="Formula 24 Dmg ((PA+Y)/2*MA) become 24 Dmg ((PA+Y)*XX/YY/2*MA)">
<Description>Describe Your Patch Here</Description>
<Location file="BATTLE_BIN" offset="11ED48">
37006290
1980013C
CE3822A4
36006290
1980033C
FA386390
21104300
XXXX0200 (sll r2,r2,0x0X) For example, If I change to 0x02  the value is multiplied by 2, if you put 3 is multiplied by 4...
YYYY0200  (sra r2,r2,0x0Y) The same, but divided
1980013C
00000000
</Location>
</Patch>


This patch works, but I want to do something like ''Pride's Formula 2D becomes (PA + Y)*XX/ZZ*WP'' in that I can multiply that by 3 and divide by 3. How can I do this?
Title: Re: Is possible to do this?
Post by: Pride on April 10, 2012, 01:40:19 pm
The first one seems like it should work... Not sure off hand (or maybe I'm looking at it wrong since I'm tired)

And the second you need to use Mult and Div such as...


lui r2,0x8019
lw r3,0x2d94(r2) Load Attacker's Data
lbu r4,0x38fa(r2) Load Ability Y
lbu r2,0x0036(r3) Load Attacker's PA
lbu r3,0x0037(r3) Load Attacker's MA
add r4,r4,r2 PA + Y
ori r2,r0,0x0003 Set Numerator as x03
mult r3,r2 MA * 3
mflo r3 Move to r3
lui r2,0x8019
sh r4,0x38d0(r2) Store PA + Y as YA
ori r4,r0,0x0004 Set Denominator as x04
div r3,r4 MA * 3 / 4
mflo r3 Move to r3
jr r31 Return
sh r3,0x38ce(r2) Store MA * 3 / 4 as XA
Title: Re: Is possible to do this?
Post by: Rfh on May 09, 2012, 09:02:36 am
(- All this time been without internet...)

Thanks FFH members!, I have learned to create many types of formulas, is not very difficult!

But.. I want to do other types of hacks...

Change some  easy things like the regen recovery I had no problem... but basically I like to do 3 hacks...




1- I want that Shop Availabity is based on your Highest Party Level and the level for unlock each item is the value put in ''Enemy level'' in FFPatcher.

Glain helps me, and gave me some information.
I managed to do that the shop availabity load the value put in ''Enemy Level'' instead of ''Shop Availabity'' with this hack:


  <Patch name="Enemy Level'' instead of ''Shop Availabity">
    <Description>Enemy Level'' instead of ''Shop Availabity</Description>
    <Location file="WORLD_WORLD_BIN" offset="0451BC">
      BA2E2290
    </Location>
  </Patch>

But now I need to change that the game load the Highest level party instead of Story Progression, but do not really know how to do this...
Glain tell me: ''0x125128: Normally it calls routine 0xef1a8 here, which loads the value of a script variable (in this case, shop availability), but we would want to change it to load the highest party level. Data Locations says this is at 0x66308, so we should be able to just load it in, as that seems to be SCUS memory (almost at the very end of it)'' But I haven't understand what happens in this offset and in offset 0xef1a8.

2- Do not know if it will be possible at this time... Could it be possible to have a unit to equip more than one accessory? (you can use for example the headgear or hand slot to equip an accessory.) The only thing that I know is changing the length of each type of object by changing a few bytes that I discovered them thanks to a pokeytax hack.

3- I like to do that all units become immortal except undeads... but I dont't know what routine I need to edit. I think that I need to edit a ''branch is the unit is immortal''


Title: Re: Is possible to do this?
Post by: Choto on May 09, 2012, 05:28:54 pm
Excellent job Rfh! I'm glad you learned quite a bit about making hacks!

My last final is tomorrow, so friday i plan on finishing up a few FFH related things, and i'll look into what you posted and see if i can help.
Title: Re: Is possible to do this?
Post by: Glain on May 09, 2012, 11:09:45 pm
I suppose I didn't clarify that too well...

0x125128 is where the game loads in the current storyline shop availability, so that it can check that value against all the item values to figure out what should be available in the shops.

Right now, it's calling a routine at 0xef1a8, with r4=0x6f, that loads the variable into r2 (the routine return value register):

00125128: 0c03bc6a jal 0x000ef1a8
0012512c: 3404006f ori r4,r0,0x006f      # r2 = shop availability

You just need to replace those lines with something that will instead load the highest party level into r2, because that's what we want to compare against the item level values. The highest party level is in memory at 0x66308, so you're probably looking at:

lui r2,0x8006
lbu r2,0x6308(r2)

EDIT - Highest party level is probably a byte, not a word... changed lw to lbu.
Title: Re: Is possible to do this?
Post by: Rfh on May 13, 2012, 09:51:31 am
1: I don't know what I have to do... I think I have to learn even more things

2: I need to find the routine that makes that each slot of the unit equipment select the type of item and change this.

3: I do this:

<Patch name="death countdown only for undeads">
    <Description>death countdown only for undeads</Description>
    <Location file="SCUS_942_21" offset="4E37C">
5800E290
00000000
10004230
07004010
FF000234
5800E290
00000000
10004230
02004010



</Location>
<Location file="SCUS_942_21" offset="4DC8C">
58000292
00000000
10004230
07004010
FF000234
58000292
00000000
10004230
02004010

</Location>
  </Patch>

The only problem of this is that when a unit that isn't undead (a normal unit) die, the unit appear as a immortal unit, but after a turn, happens a graphic glitch on the unit, but otherwise the patch works perfectly. Maybe I need to edit something more...
I like that the undead revive is at 100% and retores all HP, but I don't really understand the routine in which it occurs. (0x 00183078 in RAM)
Title: Re: Is possible to do this?
Post by: Rfh on May 14, 2012, 05:27:38 pm
Thanks Choto for comment the routine!

The finish version of the hack (It haven't got the graphical glitch)


 
   <Patch name="death countdown only for undeads">
    <Description>death countdown only for undeads</Description>
    <Location file="SCUS_942_21" offset="4E37C">
5800E290
00000000
10004230
07004010
FF000234
5800E290
00000000
10004230
02004010



</Location>
<Location file="SCUS_942_21" offset="4DC8C">
58000292
00000000
10004230
07004010
FF000234
58000292
00000000
10004230
02004010

</Location>



<Location file="BATTLE_BIN" offset="11C128">
58000292
00000000
10004230
5F004010
21100000
58000292
00000000
10004230
5A004010


</Location>
  </Patch>
Title: Re: Is possible to do this?
Post by: Rfh on June 11, 2012, 11:46:45 am
I have 2 questions,

What is the meaning of ''Counter'' put in the comments of this routine?: http://ffhacktics.com/wiki/Status_CT_Setting
What is the value of r4 if r5=0x18 in this command?: addiu r4,r5,0xffe8  (0xffe8 + 0x18 = 0x10000)
Title: Re: Is possible to do this?
Post by: Glain on June 11, 2012, 04:27:32 pm
1. From what I can tell from looking at those routines briefly, "counter" is the index (number) of the status effect that is currently being checked (1=Crystal, 2=Dead, 3=Undead, etc... check Data Locations.txt). There are a total of 40 (0x28).

2. r4=0 is the result.
That statement is better read as: addiu r4,r5,-0x18 (r4 = r5 - 0x18).
As a general rule, if the immediate given to addiu is >= 0x8000, then it's actually a negative number: (0x10000 - immediate) * -1
Title: Re: Is possible to do this?
Post by: Rfh on June 16, 2012, 06:19:11 am
Ok Thanks.

I really oNly interested in two hacks,  the gear hack for my guide, and the CT Wall in to cused Status.

1 Glain, Have you comment the routine at 0x125028? I don´t undestand what is load really in r2 when load ''the variable shop current abailabity based in story progression''

2 I have a question, I was think about graphic data of status. Pride mencioned that someone find a lot of graphic data. Who is this ''someone'' and what he find? and anyone how is loaded this graphic data, and how in stored in an status?

In complement, I was think (not necesary) I was think in edit the mp hacks, in the way that: Units recover 10 mp when the unit turn start, and the mp recovery isn't showed. Now, I do this: Units start with 10 mp and recover 10 mp at the end of his turn. A way to do the mp recovery isn't displayed?
Title: Re: Is possible to do this?
Post by: Glain on June 16, 2012, 09:43:48 am
I don't have that routine commented. What I found is that when I went into a shop, the shop availability number was loaded from the two lines of code starting at 0x125028 in world.bin. As it stands, that code is currently:

jal 0x000ef1a8
ori r4,r0,0x006f

You can replace the shop availability with the highest party level by putting this code at 0x125028:

lui r2,0x8006
lbu r2,0x6308(r2)

Title: Re: Is possible to do this?
Post by: Rfh on June 21, 2012, 02:19:06 pm
More than 3 months waiting whis hack  :)
Yesterday was my last class day and today I am in my summer holidays! So I have much more time. Yesterday, I was with my friends but I cannot do nothing, but today, I find a routine thanks to Glain's LEDecoder, finding 0x005D in BATTLE.BIN. This is what i found:

00126910: 27bdffe8 addiu r29,r29,-0x0018
00126914: afbf0010 sw r31,0x0010(r29)
00126918: 000410c0 sll r2,r4,0x03
0012691c: 00441023 subu r2,r2,r4
00126920: 00021180 sll r2,r2,0x06
00126924: 3c048019 lui r4,0x8019
00126928: 248408cc addiu r4,r4,0x08cc
0012692c: 0c063681 jal 0x0018da04
00126930: 00442021 addu r4,r2,r4
00126934: 00002021 addu r4,r0,r0            r4=0 (counter)
00126938: 34090080 ori r9,r0,0x0080         r9=80
0012693c: 04810002 bgez r4,0x00126948       Branch if counter(r4) is = 0 or < 0
00126940: 00801021 addu r2,r4,r0            r2=r4 (counter)
00126944: 24820007 addiu r2,r4,0x0007       r2= r4 (counter) + 7
00126948: 000210c3 sra r2,r2,0x03           r2= r2(counter+7) / 8
0012694c: 24480003 addiu r8,r2,0x0003       r8= r2(counter+7/8) +3
00126950: 3c078019 lui r7,0x8019
00126954: 8ce72d98 lw r7,0x2d98(r7)         r7=  Target Data Pointer
00126958: 30830007 andi r3,r4,0x0007        counter and 0x07
0012695c: 00e82821 addu r5,r7,r8            counter+7/8 +3 + target data pointer
00126960: 90a201bb lbu r2,0x01bb(r5)        Load X set of unit status inflicted (depend of the counter)
00126964: 00693007 srav r6,r9,r3            r6= 80/2^(counter and 0x07)
00126968: 00461024 and r2,r2,r6             R2= X set of unit status inflicted and x status(depend of the counter) 
0012696c: 10400015 beq r2,r0,0x001269c4     Branch if not status inflicted
00126970: 00000000 nop
00126974: 90a2004e lbu r2,0x004e(r5)        Load X set of unit auto status
00126978: 00000000 nop
0012697c: 00461024 and r2,r2,r6             r2= X set of unit status inflicted and x status(depend of the counter)
00126980: 14400010 bne r2,r0,0x001269c4     Branch if the status is auto status (not CT)
00126984: 00e41821 addu r3,r7,r4            counter + target data pointer (depend of the counter)
00126988: 9062005d lbu r2,0x005d(r3)        Load X Status CT (depend of the counter)
0012698c: 00000000 nop
00126990: 2442ffff addiu r2,r2,-0x0001      CT - 1
00126994: a062005d sb r2,0x005d(r3)         Store new CT = Old CT -1
00126998: 304200ff andi r2,r2,0x00ff        R2= CT -1 and ff?
0012699c: 14400009 bne r2,r0,0x001269c4     Branch if CT != 0
001269a0: 00000000 nop
001269a4: 3c038019 lui r3,0x8019
001269a8: 8c632d90 lw r3,0x2d90(r3)         Load Target Current Action Data Pointer
001269ac: 00000000 nop
001269b0: 00681821 addu r3,r3,r8            r3= counter+7/8 +3 + Load Target Current Action Data Pointer
001269b4: 90620020 lbu r2,0x0020(r3)        Load X set of status removal (depend of the counter)
001269b8: 00000000 nop
001269bc: 00c21025 or r2,r6,r2              r2= set x status of the byte load before(depend of the counter) 
001269c0: a0620020 sb r2,0x0020(r3)         Store X status as a status removal
001269c4: 24840001 addiu r4,r4,0x0001       r4= counter + 1
001269c8: 2882000f slti r2,r4,0x000f     
001269cc: 1440ffdb bne r2,r0,0x0012693c     Branch if counter < 15
001269d0: 00000000 nop
001269d4: 0c0612c9 jal 0x00184b24          Status change routine?
001269d8: 00002021 addu r4,r0,r0           r4=0
001269dc: 10400005 beq r2,r0,0x001269f4   
001269e0: 34020008 ori r2,r0,0x0008        r2= 0x08 (Status Change Flag)
001269e4: 3c038019 lui r3,0x8019
001269e8: 8c632d90 lw r3,0x2d90(r3)        Load Target Current Action Data Pointer
001269ec: 00000000 nop
001269f0: a0620025 sb r2,0x0025(r3)        Store Action type = Status Change
001269f4: 8fbf0010 lw r31,0x0010(r29)
001269f8: 27bd0018 addiu r29,r29,0x0018
001269fc: 03e00008 jr r31
00126a00: 00000000 nop


Basicaly is where the las 16 Status CT is decrement, when activated, and how the CT removed the correspondent status. The routine does this using a counter, from 0 to 15, with each one does I said before. Creating an exception for Wall Status I writed this:

<Patch name="Cursed status use Wall CT">
<Description>Wall CT is always 0. Cursed CT is adjustable in ''Cursed CT'' in FFTPatcher</Description>
<Location file="SCUS_942_21" offset="4E3AC">
94980108
00000000
</Location>
<Location file="SCUS_942_21" offset="56a50">
1F000234
03004514
21100000
03770108
00000000
0E000234
05004510
21100000
E8FFA424
1000822C
ED760108
00000000
0400C010
21100000
6400E0A0
03770108
00000000
0680013C
C75E2190
00000000
6400E1A0
03770108
00000000

</Location>
<Location file="BATTLE_BIN" offset="12693c">
BC770508
00000000
00000000
00000000

</Location>
<Location file="BATTLE_BIN" offset="f6ef0">
07000234
07004410
21100000
02008104
21108000
07008224
C3100200
53360608
00000000
0E000534
01000834
1980073C
982DE78C
0700A330
2128E800
BB01A290
07306900
5A360608
00000000

</Location>
</Patch>

And... it works!
Only remains to do the Gear hack, I think I'm still silly
Title: Re: Is possible to do this?
Post by: Rfh on June 22, 2012, 11:48:53 am
And the waited too gear hack:

<Patch name="Shop Availabity is based on your the maximium unit level in the party and the level for unlock each item is the value put in ''Enemy level'' in FFPatcher.">
<Description>Shop Availabity is based on your the maximium unit level in the party and the level for unlock each item is the value put in ''Enemy level'' in FFPatcher</Description>
<Location file="WORLD_WORLD_BIN" offset="0451BC">
BA2E2290
</Location>
<Location file="WORLD_WORLD_BIN" offset="045128">
F2F8040C
00000000
</Location>
<Location file="WORLD_WORLD_BIN" offset="05e3c8">
0580023C
747F4224
16004290
00000000
4C940408
00000000
</Location>
</Patch>

Glain, after watching the routine that Calculate Highest Party Level, I see that the highest party level is always 99, but, I see that load the party level in r2, this work perfectaly. So ''Party Level'' is the maximium unit level in the party:

lui r2,0x8005
addiu r2,r2,0x7f74
lbu r2,0x0016(r2)
nop

I see too where is compared the shop availabity with the number of story progression, and I understand what I have to do.
Title: Re: Is possible to do this?
Post by: Glain on June 22, 2012, 06:22:49 pm
Isn't that (0x57f74 + 0x16) Ramza's level? That won't work if Ramza isn't the highest level unit in the party.

I think you need to call the Calculate Highest Party Level routine:

jal 0x05cdb0
nop
Title: Re: Is possible to do this?
Post by: Rfh on June 23, 2012, 11:10:59 am
It doesn't work, but the routine exist, because the ENTD flag in level ''party level'' load this.
One thing, Anyone can explain me why the damage isn't showed in formula 64?
Title: Re: Is possible to do this?
Post by: Glain on June 23, 2012, 09:49:55 pm
Does the Calculate Highest Party Level routine load the wrong number into r2?  I'm looking at the code and am not really understanding why it wouldn't work.  It also should always be in memory since it's an SCUS function.