The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Battle Preventing a wild Pokemon from being caught [gen 3] (https://www.pokecommunity.com/showthread.php?t=417630)

Sapphire Jester January 28th, 2019 2:54 PM

Preventing a wild Pokemon from being caught [gen 3]
 
You know how in Black 2 and White 2 you are unable to capture the wild fused Kyurem? I want to do something like that in my hack, where you have to battle a legendary Pokemon but aren't allowed to catch them. Has someone figured out a way to do so? All I could think of is setting the catch rate to zero but that would still allow the player to (uselessly) throw Pokeballs.

ghoulslash January 28th, 2019 2:59 PM

Quote:

Originally Posted by Sapphire Jester (Post 9973307)
You know how in Black 2 and White 2 you are unable to capture the wild fused Kyurem? I want to do something like that in my hack, where you have to battle a legendary Pokemon but aren't allowed to catch them. Has someone figured out a way to do so? All I could think of is setting the catch rate to zero but that would still allow the player to (uselessly) throw Pokeballs.

Here is a routine I wrote for dream ball/sport ball that prevents you from using the pokeball if you aren't in the correct map. You could easily add in a wild pokemon species check to prevent use against a pokemon as well. Do you know assembly language at all?

EDIT: this is for FR. I'm not sure what the hook would be for emerald currently.

Spoiler:

Code:

.text
.align 2
.thumb
.thumb_func
.global prevent_pokeball_usage
/*
00 49 08 47 (xx+1) xx xx 08 at a1e1c

*/

.equ Offset, 0x08xxxxxx                @where you will insert

main:
        push {r0, r4, lr}
        ldr r0, =(0x0203ad30)
        ldrh r0, [r0]
        cmp r0, #0xx                @ item ID of dream ball
        beq DreamBall
        cmp r0, #0xZZ                @ item ID of sport ball
        bne usable

SportBall:
        ldr r0, =(0x03005008)
        ldr r0, [r0]
        ldrb r1, [r0, #0x4]
        ldrb r0, [r0, #0x5]
        cmp r0, #0xYY        @ national forest bank num
        bne prevent
        cmp r0, #0xYY        @ map num
        bne prevent
        b usable

DreamBall:
        ldr r0, =(0x03005008)
        ldr r0, [r0]
        ldrb r1, [r0, #0x4]
        ldrb r0, [r0, #0x5]
        cmp r1, #0xYY                @ bank number for entree foreset
        bne prevent
        cmp r0, #0xYY                @ map number for entree forest
        bne prevent

usable:
        pop {r0}
        mov r4, r0
        bl GetInfo
        ldr r1, =(0x080a1e26 +1)
        bx r1

prevent:
        pop {r0}
        mov r1, #0x2
        ldr r2, =(Offset+prevent_string)        @ or just put in offset
        ldr r3, =(0x0810a1f8 +1)
        bl BagPrint
        pop {r4, pc}

BagPrint:
        ldr r4, =(0x08108e70 +1)
        bx r4

GetInfo:
        ldr r3, =(0x08040f6c +1)
        bx r3

prevent_string:
.byte [string], 0xff



Sapphire Jester January 28th, 2019 3:09 PM

Wow, I didn't expect such a quick response. Thank you very much.

Truthfully I don't know assembly language, though if that's what's needed to add this feature then I'll have to learn it. I'm still in the planning stages of figuring out everything I want to do with my hack, still teaching myself the basics. I'll be sure to remember this code once I do get to the point that I can use it.

ghoulslash January 28th, 2019 4:54 PM

Quote:

Originally Posted by Sapphire Jester (Post 9973311)
Wow, I didn't expect such a quick response. Thank you very much.

Truthfully I don't know assembly language, though if that's what's needed to add this feature then I'll have to learn it. I'm still in the planning stages of figuring out everything I want to do with my hack, still teaching myself the basics. I'll be sure to remember this code once I do get to the point that I can use it.

No problem! Let me know if you need any help configuring the function to accomodate your request.

If you want to learn a new coding language going forward, it might help to understand assembly, but all of the dissasembly projects are done in C, so that would be more beneficial.

Good luck with your hack!

Noodlewhiz January 28th, 2019 7:59 PM

You could also use this routine made by Squeetz: https://pastebin.com/fH4z4PCS
It allows you to toggle the capturability of Pokemon by setting a flag.

Just A Remixer April 5th, 2019 7:12 PM

Well at least there is one of these for FR. Honestly, Fire Red gets to much attention, which is a good thing, and a BAD thing


All times are GMT -8. The time now is 9:13 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.