Jump to content

Attacks with Custom Type Effectiveness?


Recommended Posts

We know pk3DS is able to edit moves. It also is able to edit the type chart. But the latter requires cro editing, which renders the hacks unusable without the right custom firmware. Looking for an alternative, I came upon an idea.

Is it possible to add special type-effectiveness for attacks?

Surely, You know what I mean. Freeze-Dry is an Ice attack, yet it's super-effective on Water-types, ignoring the chart. Flying Press is a Fighting attack, yet it has an added Flying-type effectiveness, resulting in a completely different offensive capabilities. Would it be possible - and if so, how - to modify the effectiveness of other moves? Say I want to modify the type chart, but I can't afford cro editing - changing all the attacks in this way, while tedious, would accomplish the exact same thing.

Has anybody looked into this? Does anyone know if it's doable?

Link to comment
Share on other sites

  • 7 years later...

I suspect that it is a hard-coded special handling. It should be the same file (battle.cro) as the type chart if the move id is in the special handled move list. That is, you might be able to get other moves to be super effective against water but that’s probably the best you can do without disassembling the code or the scripting language. This could be very hard as one has to first pin down the script location for the special handling and then understand what each byte is doing as a script. I used to figure it out in emerald but that’s almost a miracle and very luck-dependent. I wasn’t able to figure anything out on later versions beyond the special-handled move Id list layer.

Link to comment
Share on other sites

I have confirmed in Ultra Moon that the move is a hard-coded special handled move that forces a move to be super effective against water type, by the following steps:

1. Open Battle.cro in hex editor, and search for the following pattern: "36 02 00 00 00 00 00 00 31 02"

2. There should be a "3D 02" (Move Id for Freeze-Dry) that comes next, change it to "28 02" (Move Id for Fiery Dance)

3. Save the file and rebuild the rom.

4. Visually confirm that the move "Fiery Dance" is super-effective against Water Type in the game.

 

The special handled move list begins with "A0 00 00 00 00 00 00 00 25 01 00 00 00 00 00 00 72 00 00 00 00 00 00 00 8A 00 ...." in Ultra Moon (Notice the list might be different in other versions) and the "3D 02" is the 279th entry. If we can find out where the script location is for the first move "A0 00" (Conversion), then we might use offset calculation to find out where the script for Freeze-Dry is.

 

Also the list seems to consist of 343 entries so if anyone found anything that looks like an array of code that consists of 343-ish number of entries, please share the result so we can continue the research together.

Edited by cr001
Link to comment
Share on other sites

I have done a scripted search in Battle.cro to see if there is any relative address referring to the starting of the special handled move ID list, but found nothing (Obviously the absolute address reference search failed too). Did also do some manual inspection of nearby byte structures but nothing seems interesting (i.e. like a 343-item pointer table). Pretty much stuck at this point.

One thing I still believe in is that the actual handling code of the special moves is still in Battle.cro, not some other file like exefs code.bin. The reason I believe this way is that the move ID list is in the code section of the cro file and not the data section.

 

Here's my Python script for searching relative address, if anyone is interested in taking my idea and making some improvements:

--------------------------------------------

with open("battle.cro", mode="rb") as file:
    byte = file.read(1)
    count = -2
    previous = []
    while byte != b"": 
        if len(previous) >= 2:
            addr = bytearray(b'')
            addr.extend(bytearray(previous[len(previous) - 2]))
            addr.extend(bytearray(previous[len(previous) - 1]))
            addr.extend(bytearray(byte))
            
            # 0x105df0 == 1072624d, the starting addr of special handled moves for Ultra Moon
            addr_rel = 1072624 - count;
            if (addr_rel >= 0):
                addr.extend(bytearray(b'\x00'))
            else:
                addr.extend(bytearray(b'\xff'))
            addr_int = int.from_bytes(addr, 'little', signed=True)
            if (abs(addr_int - addr_rel) < 8):
                print(str(hex(count)) + ", Addr: " + str(addr) + ", RelAddrDiff: " + str(abs(addr_int - addr_rel)))
            
        previous.append(byte)
        if len(previous) > 2:
            previous.pop(0)
        byte = file.read(1)
        count += 1

--------------------------------------------

 

I am going to stop messing around with this at this point as I have actually spent a lot of time trying to solve the "Pinpointing Special Move Handlers Code" problem several years ago without success. Maybe someone else with better hacking knowledge can figure it out, I would be very grateful too (To be honest, I am even willing to pay 100 dollars (via Paypal) to whoever figure this out), as well as other questioners preseumably.

Edited by cr001
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...