Binary Hack Research & DevelopmentGot a well-founded knack with your binary Pokémon hacks? Love reverse-engineering them? For the traditional Pokémon ROM hacker, this is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
The routines assume that the Held Item Effect Bytes of the Power Items are in a particular order (same as that of Stat EVs in Pokemon Party Data Structure) and are consecutive.
For example, if Power Weight has Held Item Effect Byte 68, then Power Bracer will have 69, Power Belt 6A, Power Anklet 6B, Power Lens 6C and Power Band 6D.
So in the routines, you only need to specify the Held Item Effect Byte for Power Weight by replacing KK. The routine will automatically recognize other Power items.
Also I have not coded the Speed Drop, I might do it later and update the OP.
If you want to code the Speed Drop yourself, you can make a hook around the Macho Brace check for Speed Drop.
Fire Red:-
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
add r4, r0, #0x0 /*EV of a particular stat before checking pokerus and applying EV enhancers*/
push {r2} /*Store pokerus factor*/
mov r0, r8 /*Load pokemon slot no*/
mov r1, #0xC
mov r2, #0x0
bl Decrypter /* Load pokemon's item */
lsl r0, r0, #0x10
lsr r0, r0, #0x10
bl GetItemEffect /* Get Held Item's Effect Byte*/
lsl r0, r0, #0x18
lsr r0, r0, #0x18
mov r3, #0xKK
add r1, r6, r3 /* Load Power Item's Effect Byte*/
pop {r2}
cmp r1, r0 /*Match items*/
bne NoPowerItem /*No Power Item or No Match for that particular stat*/
add r4, r4, #0x4 /* Add Bonus 4+ EV */
mul r4, r2 /*Use pokerus multiplier*/
ldr r3, =0x080439D9
bx r3
NoPowerItem:
mul r4, r2
mov r0, r8
mov r1, #0xC
ldr r3, =0x08043981
bx r3
Decrypter:
ldr r3, =0x0803FBE9
bx r3
GetItemEffect:
ldr r1, =0x0809A925
bx r1
/*At 43978:00 49 08 47 XX+1 XX XX 08*/
Emerald:-
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
add r4, r0, #0x0 /*EV of a particular stat before checking pokerus and applying EV enhancers*/
push {r2} /*Store pokerus factor*/
mov r0, r8 /*Load pokemon slot no*/
mov r1, #0xC
mov r2, #0x0
bl Decrypter /* Load pokemon's item */
lsl r0, r0, #0x10
lsr r0, r0, #0x10
bl GetItemEffect /* Get Held Item's Effect Byte*/
lsl r0, r0, #0x18
lsr r0, r0, #0x18
mov r3, #0xKK
add r1, r6, r3 /* Load Power Item's Effect Byte*/
pop {r2} /*Restore Pokerus Muliplier*/
cmp r1, r0 /*Match items*/
bne NoPowerItem /*No Power Item or No Match for that particular stat*/
add r4, r4, #0x4 /* Add B Bonus 4+ EV */
mul r4, r2 /*Use pokerus multiplier*/
ldr r3, =0x0806DC25
bx r3
NoPowerItem:
mul r4, r2
mov r0, r8
mov r1, #0xC
ldr r3, =0x0806DBCD
bx r3
Decrypter:
ldr r3, =0x0806A519
bx r3
GetItemEffect:
ldr r1, =0x080D74DD
bx r1
/*At 6DBC4:00 49 08 47 XX+1 XX XX 08*/
KDS to make it easier, what you should do is have the same effect as the Macho Brace, and make the individual EV enhancing items use the secondary byte as 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 etc.
That way you don't need to code the extra speed drop for each individual effect.
#602Link to this post, but load the entire thread.
June 7th, 2015 (4:36 AM).
Edited June 8th, 2015 by Trainer 781.
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by MrDollSteak
KDS to make it easier, what you should do is have the same effect as the Macho Brace, and make the individual EV enhancing items use the secondary byte as 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 etc.
That way you don't need to code the extra speed drop for each individual effect.
Hmm, this looks a great idea. Might need to add some bit of extra code for this.
Nice work there KDS! Your are truly an ASM Lord! Haha! Anyway, can you also implement this idea as well:
Quote:
Originally Posted by leyn09
Is there a possibility to make sitrus berry work like on the later generations (increases 25% hp). If there is anyone knows how, please help me. Thanks!:D
#604Link to this post, but load the entire thread.
June 8th, 2015 (10:35 PM).
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by Sky High
Nice work there KDS! Your are truly an ASM Lord! Haha! Anyway, can you also implement this idea as well:
Thanks! My domain on ASM is only limited to Battle Mechanics though and I'm still learning new things.
Oran Berry would require some effort and some knowledge of regular scripting (which I haven't touched yet). I suppose it would require three routines:
1. One for pinch berry activation.
2. Second, when you use an Oran Berry on your Pokemon while battling.
3. Third, when you use an Oran Berry on your Pokemon in the Overworld.
I'd like to say that this thread has been really helpful for me as my ASM skills are far worse than sub-par and, also, the Chain-Fishing one in particular is really cool to me. (◕‿◕✿)
I'd also like to request something for Fire Red BPRE v1.0 (adding to the infinite list of requests...):
Stance Change.
Basically, where a Pokémon uses an offensive move and changes its form to a more offensive Pokémon (or, rather, just a different index-number Pokémon entirely). However, when it uses a certain move (or just a status move would be fine, too), it reverts back to the old form.
EDIT: Oh, and it would also have to revert to the other form outside of battle.
What I was thinking was two separate abilities in order to accomplish this, but if one is possible, then that's great too!
Thanks in advance!
God I sound so rude I am so sorry
EDIT: Also, should I go to DaniilS with this? I noticed that he had his own thread for form(e)s...
EDIT EDIT: Okay, I just noticed something while I was trying to get the Male-only and Female-only evolution methods working on Burmy.
But ALL of the Pokémon generated by your routine are Male unless if they have more of an 82 percent chance of being female, in which case they are, and the Pokémon already caught turn into females. This is also shown in you post showcasing it, as the Tyranitar are also all Male.
Just wanted to say this, haha...
You need the random number routine and the shiny generator routine I made. The three of them work in conjunction to make this effect happen. I know it works, because my test ROM is only shinies :x
Can someone post links to those required routines? I've been driving myself up a wall searching for them to no avail.
Controling what breeds with what and what hatches from the result can be done with a Pokemon editor iirc.
Few simple questions on breeding, egg groups and all that. You said it's all doable via a Pokémon Editor. What I want, actually is that Charizard evolutionary line breeds only with its line and/or Ditto. No Dragon/Monster egg groups. Will I have to make an egg group for each evolutionary family?
Also, how can I make Ditto breeds with himself too, not only all other Pokémon? And genderless Pokémon, like Magnemite? How can I make them breed?
Finally, for Nidorans and Volbeat/Illumise, I wanna make the male breed with the female, but not breedable with Ditto. How can I do it?
Quote:
Originally Posted by FBI agent
Status update:
Today I've been working on breeding stat passing, particularly nature. I found that a Pokemon's nature in the gen iii games are determined rather randomly. It's done by PID % 25, = nature. In later games, you'll notice that nature is determined in otherways than PID. It's quite bad that FR uses this system because that means that the Pokemon's nature is going to be randomized quite well. I can't really modify the PID to match a certain nature because the PID is used to determine Pokemon IVs and all that good stuff, not to mention the checksum which turns a Pokemon into a badegg. What this means is that I would have to keep generating a new Pokemon UNTIL the PID generated from the game matches qualities of the PID I want. The process is rather complicated and I'm frankly debating whether or not it's worth the work. Honestly, does anyone actually breed farm in ROM hacks?
Here, I just want to know if I can make all Pokémon to be Docile as default or if I can change all natures' data, so all natures behave like Docile. Is either of these possible?
Thanks in advance!
Disabling "Gain money
" after defeating a trainer", it's useful for those who want to have a battle frontier
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.
You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.
Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
#611Link to this post, but load the entire thread.
June 17th, 2015 (2:57 AM).
Edited June 19th, 2015 by Trainer 781.
Trainer 781
Guest
Posts: n/a
Life Orb Recoil
Spoiler:
This only includes the Life Orb Recoil not the Life Orb Boost.
Credits to MrDollsteak for the Sheer Force Routine which I ripped from his Rombase.
Life Orb recoil is disabled for Volt Switch and U-turn in order to prevent damage to switched ally. (Special callasm in Battle Scripts of these Moves should be made in order to process Life Orb Recoil for them. Preferably before switching happens).
If you don't have Sheer Force, Magic Guard, U-turn or Volt Switch remove the bolded lines.
Replace KK with Held Effect Item Byte of Life Orb.
Bug/Oddity: It can trigger multiple times for multi-hit moves like Life Orb and multiple target moves like Earthquake in doubles. Fixed
A routine that copies the player's current pokemon in party (EVs IVs, moves, Abilities, held items, etc.) and pastes it on a trainerbattle (user gets to choose which trainer).
So, like a Battle With yourself. Would be cool as a final Battle or something.
Is this possible? Would be awesome if anyone made this.
Can somebody post the code for the updated lightning rod/storm drain and sap sipper? I want to try modifying them to make my own abilities based on the same idea.
This only includes the Life Orb Recoil not the Life Orb Boost.
Credits to MrDollsteak for the Sheer Force Routine which I ripped from his Rombase.
Life Orb recoil is disabled for Volt Switch and U-turn in order to prevent damage to switched ally. (Special callasm in Battle Scripts of these Moves should be made in order to process Life Orb Recoil for them).
If you don't have Sheer Force, Magic Guard, U-turn or Volt Switch remove the bolded lines.
Replace KK with Held Effect Item Byte of Life Orb.
Bug/Oddity: It can trigger multiple times for multi-hit moves like Life Orb and multiple target moves like Earthquake in doubles. Fixed
39 20 FA 20 C0 03 02 SS SS SS 08 10 84 01 12 40 00 35 D0 3D 02 02 00 01 00 00 0B 01 0C 01 19 01 00 00 00 00 00 3C
String at SSSSSS:
Code:
FD 0F 00 E0 E3 E7 E8 00 E7 E3 E1 D9 00 E3 DA 00 DD E8 E7 00 C2 CA AB FF
I've noticed that this also prevents Sheer Force Pokemon getting any healing from the Shell Bell. This doesn't happen in the games I don't think. I'd probably do the Sheer Force Check after determining whether it has Shell Bell.
Great work! I'll have to link this post when I write up the rest of my Sheer Force routines on the Ability Resource Thread.
Quote:
Can somebody post the code for the updated lightning rod/storm drain and sap sipper? I want to try modifying them to make my own abilities based on the same idea.
These will be posted on the Ability Resource Thread eventually.
This only includes the Life Orb Recoil not the Life Orb Boost.
Credits to MrDollsteak for the Sheer Force Routine which I ripped from his Rombase.
Life Orb recoil is disabled for Volt Switch and U-turn in order to prevent damage to switched ally. (Special callasm in Battle Scripts of these Moves should be made in order to process Life Orb Recoil for them).
If you don't have Sheer Force, Magic Guard, U-turn or Volt Switch remove the bolded lines.
Replace KK with Held Effect Item Byte of Life Orb.
Bug/Oddity: It can trigger multiple times for multi-hit moves like Life Orb and multiple target moves like Earthquake in doubles. Fixed
#617Link to this post, but load the entire thread.
June 19th, 2015 (9:20 PM).
Edited June 19th, 2015 by Trainer 781.
Trainer 781
Guest
Posts: n/a
Quote:
Originally Posted by MrDollSteak
I've noticed that this also prevents Sheer Force Pokemon getting any healing from the Shell Bell. This doesn't happen in the games I don't think. I'd probably do the Sheer Force Check after determining whether it has Sheer Force. Otherwise great work! I'll have to link this post when I write up the rest of my Sheer Force routines on the Ability Resource Thread.
Thanks.
Well it does prevent according to Bulbapedia.
Also, I have already done the Sheer Force Check after checking the ability (literally copy pasted line-to-line your Sheer Force implementation xD).
Quote:
Originally Posted by kleenexfeu
Spoiler:
Well done on that KDS ! Thanks
Typo in the check Volt Switch/U-turn : bew exit instead of beq I'll fix it, aha
Something else troubles me though. In that part :
EffectCheck:
mov r1, r8
cmp r1, #0x3E
beq ShellBell
cmp r1, #0xKK
bne Exit
Shouldn't you check King's Rock effect too ? There's cmp r1, #0x1E in the original routine. You can. But there is no need, since the Battle Script for King Rock utilizes 'setbyte 0x2023E85' along with 'seteffecttargetwithchance' command which MrDS's Sheer Force implementation already handles. Choose whatever that looks more efficient to you.
Something else, I tried to port it to Emerald and failed. I think this is the part of the "end" command battle that causes problem.
I saw there's a difference beetwin Emerald and Fire Red Mold breaker routines regarding the part of the end command, so I tried to change a little bit that part of your routine but didn't managed to make it work.
Is there something obviously wrong ? You have to insert the Routine at YYYYYY the same way as done in Fire Red. This involves, replacing the pointer to the 'end command' in the command table with the offset of this routine.
The 'EndCommand' label of Routine at YYYYYY should be this
Code:
EndCommand:
ldr r1, =0x0804B666+1 @The pointer to the old 'end' command
bx r1
Also in Emerald, you don't have to worry about whether Mold Breaker is there or not. The Pointer in the EndCommand label won't change unlike Fire Red.
Your routine was creating stack imbalance because it was not pushing and popping equal no of registers.
Responses in Bold.
Also, I might post a mini-documentation about the Battle Script Command 'cmd49' in the Quick R&D thread to provide insight of things that are happening at the End of a Move Execution.
And it will also help to create things like Weakness Policy, Rocky Helmet, Absorb Bulb etc.
Since I will be very busy doing College and Intern Projects, I don't have time to work on these for now. It would be better if some-one with free time will be able to work on these items.
May I ask on how to incorporate the life orb recoil and boost?
The bunch of code you see here is ASM routine. If you don't know what is ASM, type on google or in this forum "ASM" and you'll see a lot of good tutorials.
The bunch of code you see here is ASM routine. If you don't know what is ASM, type on google or in this forum "ASM" and you'll see a lot of good tutorials.
For the rest, read the instruction put together with the routine.
If you still have problem (and you actually tried to make it work), you can PM me
Hope it'll help
Oh sorry, my question was quite misleading. I know how to insert ASM. hehe. I was asking if the life orb will work if I just separately insert your LO boost and KDS' LO recoil? Or I should change a byte (the held item effect,maybe?) in your asm routine. Thanks!
Oh sorry, my question was quite misleading. I know how to insert ASM. hehe. I was asking if the life orb will work if I just separately insert your LO boost and KDS' LO recoil? Or I should change a byte (the held item effect,maybe?) in your asm routine. Thanks!
Oh ok. So yeah, they work seperatly, I edited my routine, the first "cmp 0x43" actually compare to held item effect of your life orb. I advice using an unused item effect.
Note that the boost power I post is only for Emerald though
Oh ok. So yeah, they work seperatly, I edited my routine, the first "cmp 0x43" actually compare to held item effect of your life orb. I advice using an unused item effect.
Note that the boost power I post is only for Emerald though
Thanks! Oh, will the FR ver. be available soon? :D
Hi FBI, first of all thanks for your work! You've been really helpful.
My question regards your battle routine http://www.pokecommunity.com/showthread.php?p=8527650#8527650 .
I've been trying it without success in my Ruby rom hack hoping it would work just like in Fire Red.
Is there any way to remove the whiteout after losing a battle in a Ruby hack rom?
I tried getting it to delete the save file and to return to the titlescreen afterwards, but I couldn't get a brief flash of the pokécenter to disappear. I might fix it later, but as for now, here's a much more simple version using SoftReset:
Code:
Type 5F F1 53 FC 00 DF at 0807F5B6 and F1 E7 at 0807F5D0.
Can its effectivity be toggled using flags?
Also, Is there any way how to disable the usage of bag during battle? Thanks!