- 12
- Posts
- 3
- Years
- Seen Jul 19, 2022
Hello everyone 👌,
after successfully fixing the bug with the clerk in Oldale Town, I set my eyes on a rather unknown phenomenon.
When using Toxic on a Pokemon, the catch rate will not be enhanced, just like it would be with normal poisoning (link).
According to the article, this has even been fixed for FireRed and LeafGreen (and Emerald?), which should make it easier to understand what is going wrong.
I know that the status condition of a Pokemon is stored in a DWORD (link), seems like a waste since only the first 8 Bits are used anyway, but OK.
Edit: Hmm... now that I think of it, probably the other Bits are used for stuff like Curse and Leech Seed.
Toxic is Bit #7, while sleep uses #0 to #2 and the other conditions use #3 to #6.
My best guess is, that the routine which computes the catch rate does two ANDs:
* the first uses a mask to check if it has to multiply by 2 if sleep or freeze != 0
* the second uses another mask to check if it has to multiply by 1.5 if the other conditions != 0
and somehow the Bit-Mask for checking the second part does not include the Bit for Toxic... like I said just an assumption.
My big question is now, how do I find out where I even have to start to look at?
How do I determine the starting point of the script - can I found out about that with any of the common binary hacking tools?
I wouldn't have an issue crawling through some ASM, I just have to know where stuff begins and where it ends - even going so far as using the features provided in the emulator (using VBA-M atm) to see where the execution leads me.
Cheers
after successfully fixing the bug with the clerk in Oldale Town, I set my eyes on a rather unknown phenomenon.
When using Toxic on a Pokemon, the catch rate will not be enhanced, just like it would be with normal poisoning (link).
According to the article, this has even been fixed for FireRed and LeafGreen (and Emerald?), which should make it easier to understand what is going wrong.
I know that the status condition of a Pokemon is stored in a DWORD (link), seems like a waste since only the first 8 Bits are used anyway, but OK.
Edit: Hmm... now that I think of it, probably the other Bits are used for stuff like Curse and Leech Seed.
Toxic is Bit #7, while sleep uses #0 to #2 and the other conditions use #3 to #6.
My best guess is, that the routine which computes the catch rate does two ANDs:
* the first uses a mask to check if it has to multiply by 2 if sleep or freeze != 0
* the second uses another mask to check if it has to multiply by 1.5 if the other conditions != 0
and somehow the Bit-Mask for checking the second part does not include the Bit for Toxic... like I said just an assumption.
My big question is now, how do I find out where I even have to start to look at?
How do I determine the starting point of the script - can I found out about that with any of the common binary hacking tools?
I wouldn't have an issue crawling through some ASM, I just have to know where stuff begins and where it ends - even going so far as using the features provided in the emulator (using VBA-M atm) to see where the execution leads me.
Cheers
Last edited: