Lance32497
LanceKoijer of Pokemon_Addicts
- 792
- Posts
- 10
- Years
- Criscanto town-Ginoa Region xD
- Seen Aug 14, 2017
A routine that changes the pokemon nature/Ability through script
.text
.align 2
.thumb
.thumb_func
.global calltheexecutioner
@flagcheck:
@ mov r0, #0x__ /*flag/4*/
@ lsl r0, r0, #0x2
@ ldr r3, decryptflag
@ bl jump2
@ cmp r0, #0x0
@ beq end
main:
ldr r3, deletefaintedpokemon
bl jump
end:
add sp, #0x4
pop {r4, r5, pc}
jump:
push {r0-r5, lr}
jump2:
mov pc, r3
.align 2
decryptflag: .word 0x0806E6D0
deletefaintedpokemon: .word 0x________+0xA@+0xE /*offset of FBI's routine*/
/*remove the last @ if you're using a flag check in FBI's routine.
Remove all other @s if using a flag check in this routine.*/
/*Insert anywhere. Then, at 080A04F2, type C0 46 00 4B 9F 46 XX XX XX XX,
where XXXXXXXX is an inverted pointer to this routine.*/
No problem.sooo funny story...
I kept getting errors when I tried to test if the pokemon menu item would appear. every time I gave the user a pokemon it would go all rainbow and freeze up... test after test after test... failure... turns out... I was using a text "'player' got the 'buffered name' from oak" and i forgot to buffer the name lol
anyway. it works perfectly thanks so much ;)
[RUN AWAY]
Once I finish porting other abilities I'll make a brand new post for the
Emerald version of this.
So here's something you don't see here everyday: a port to EM!
FBI's battle mode hacks are looking awesome, and it'd be a cardinal sin if EM didn't have these features.
So here, have the Battle Routine by Move. (and the deletePokemon routine)
[ROUTINES]
A routine that changes the pokemon nature/Ability through script
Although I do not know ASM, I use Ur hack "Trainer Capture toggle by Pokeball". The ball depending system works right but when I captured trainers' Pokemon the Pokemon changed into bad egg.
Another question: What should be the reversed hex pointer? If the original pointer is 0x123456, then the reversed pointer plus one should be 573412 or 754321?
If I mistake 754321 for 573412, that may be the reason why bad egg occurs.
Forgive my terrible English.
Like promised, here's a routine to let Pokémon die from poison in the overworld:
[routine]
.text
.align 2
.thumb
.thumb_func
main:
push {r4, lr}
ldr r4, =(0x8044EC8 +1)@gen random number
bl linker
lsl r0, r0, #0x10
lsr r0, r0, #0x10
ldr r1, =(0x20370B8) @convert to int between 0x0 to [var 0x8000] exclusive
ldrh r1, [r1]
ldr r4, =(0x81E4684 +1)
bl linker
ldr r1, =(0x20370D0) @store in last result
strh r0, [r1]
pop {r4, pc}
linker:
bx r4
.align 2
A pokemon is shiny iff 0<= C < 8, where C is defined by:
A = TrainerID XOR SecretID
B = PID[1st half] XOR PID[2nd half]
C = A XOR B
ldr r4, =(0x8743210 +1)
.text
.align 2
.thumb
.thumb_func
main:
ldr r0, =(0x20370BC) @0x8002 is shiny flag
ldrb r0, [r0]
cmp r0, #0xFF
bne noCrash
push {r4-r7}
ldr r0, =(0x20370BC) @set back to 0x0 because users tend to be retarded
mov r1, #0x0
strb r1, [r0]
bl generatePID
mov r4, r0
@c = A xor B; 0<= C <8; use random to determine C
ldr r0, =(0x20370B8)
mov r1, #0x8
strb r1, [r0]
[B][COLOR="Orange"] ldr r4, =(OFFSET OF RANDOM)[/COLOR][/B]
bl linker
mov r3, r0
@(TID xor SID)
ldr r0, =(0x300500C)
ldr r0, [r0]
mov r1, #0xA
add r1, r1, r0@TID
ldrh r1,[r1]
mov r2, #0xC
add r0, r0, r2 @SID
ldrh r0, [r0]
eor r0, r0, r1 @(TID XOR SID) = A
eor r3, r3, r0 @(C XOR A) = B
@B = (PID[half-word] xor PID2[half-word])
lsl r4, r4, #0x10
lsr r4, r4, #0x10
eor r3, r3, r4 @(PID[half-word] XOR B) = PID2
@concatinate r4 + r3
lsl r3, #0x10
orr r3,r3, r4 @PID for shiny
pop {r4-r7}
str r3, [SP, #0x14]
b end
noCrash:
bl generatePID
mov r4, r0
b old
generatePID:
push {r4, lr}
ldr r4, =(0x8044EC8 +1)
bl linker
mov r4, r0
ldr r3, =(0x8044EC8 +1)
bl linkerThree
lsl r4, r4, #0x10
lsr r4, r4, #0x10
lsl r0, r0, #0x10
orr r4, r0
mov r0, r4
pop {r4, pc}
old:
str r4, [SP, #0x14]
end:
ldr r0, =(0x803DB14 +1)
bx r0
linker:
bx r4
linkerThree:
bx r3
.align 2
00 48 00 47 XX XX XX 08
00 00 02 E0
setvar 0x8002 0xFF 'This line makes it so the next Pokemon you encounter, or are given is a shiny Pokemon with a properly generated PID. I've made it so the code sets 0xFF back to 0x0 so you don't have to disable it after. There's only an enable switch :)
Did you put in functionality for more than 1 pokemon.
like the shinyizer you can set it for a whole trainers belt (where some are shiny and others are not)
ive got an item I use in some hacks called shiny spray, it gives you a 50% chance of seeing a shiny pokemon for the next 3 battles (guaranteed to see 1 shiny). so in order to utilize your "better" IV seed, your routine would need to be able to read (and apply) more than 1 poke in the future.
compare 0x4011 0x2 'charges on item
if == jump @guaranteed
random 0x2
compare LASTRESULT 0x0
if == jump @set
jump @used
#org @guaranteed
compare 0x4012 0x1 'atleast one guaranteed shiny
if == jump @end
jump @set
#org @set
setvar 0x8002 0xFF 'set shiny
setvar 0x4012 0x1 'guarenteed flag
addvar 0x4011 0x1 'increment charges
jump @used
#org @end
msgbox @outOfCharges 'out of spray charges
callstd MSG_NORMAL
release
end
#org @used
msgbox @applied 'The spray is applied
callstd MSG_NORMAL
release
end
How about an ability to add overworld Pokemon abilities, such as rock smash, surf, fly, sweet scent, etc. For custom made moves such as "Future Sight" in the celebi movie where it's used to find time warps, but not limited to just this move, but to any move one would choose to have a custom script activated for it. (I feel like this may have already been implemented but can't find where at, though I know you can do it FBI Agent :D )
I believe abilities as BS related. What you would need for something like this, is probably a bitmap showing which species of Pokemon "passively" have levitate. Though, sadly, because it is battle script related, I'm not going to be fulfilling this. Hopefully someone else jumps on and lends you a hand :)I have had an idea for some time about creating a system where the levitate ability is not an ability but rather a toggle-able byte on each pokemon. For instance, one could feasibly create a Hydreigon with the ability intimidate that also has the benefits of levitate, (by virtue of the hack). It's always bothered me that I had to choose between giving pokemon that weren't flying-type like venomoth the ability levitate or a real ability.
Hi, I'll look into this. If I end up needing to adjust the PID, it may end up a little much :xA suggestion.
Hey how about implementing an Ability Capsule from Gen VI which helps you to toggle between the primary and secondary abilities of a mon in the overworld.
How about an ability to add overworld Pokemon abilities, such as rock smash, surf, fly, sweet scent, etc. For custom made moves such as "Future Sight" in the celebi movie where it's used to find time warps, but not limited to just this move, but to any move one would choose to have a custom script activated for it. (I feel like this may have already been implemented but can't find where at, though I know you can do it FBI Agent :D )
Here:Errrr... Which one of the byte changes is about the bad egg?
To insert:
insert the following bytes at the following offsets:
0x2D496: E0 E0
0x40B36: 00 00 00 00 00
That sounds like a cool addition, though I don't know how to make the number appear onto the HP bar. Maybe someone with graphical knowledge will jump in and help you on this one.To be able to see the enemy's hp in battle
Thanks.This is done with a script that checks if a pokemon knows a move. In ultra violet version I used earthquake to clear some rocks...
The only issue is its not usable from the start menu (like fly or flash) u use it by 'talking' to the target (like surf cut or rocksmash). It would require asm to make them show in the pokemon menu.
2 has already been done... id put it here but its not my work. Just search the forum for it. Real simple to insert.2: xp on catching pokemon
5: everytime you re-enter a route, all the trainer battles are reset(eg when you step in front of them they will challenge you again
Thanks in advance!
Spoiler:Reset game after loss of a battle
So, wanting to do something similar to older Final Fantasy games, in which the game goes back to the title screen after your party falls, I dove into knizz's IDB and used a lot of trial and error to create this little feature. Let it be my first contribution to ASM hacking.
Use the following ASM:
Code:.text .align 2 .thumb .thumb_func main: SWI 0; .align 2
Compiled for your pleasure:
Code:00 DF 00 00
at offsets 0x7F5B6 and 0x7F5D0 to reset the game after displaying the "...player scurried <home/PC>" text.
Credits to FBI for the ASM, shinyquagsire for explaining what this is to me in layman's terms, as well as an improvement, and to knizz for his amazing IDB that helped me find these offsets.
This can be useful for nuzlocke hackers that wish to implement a Savegame delete function when a battle is lost, by simply making a different function, namely, a delete savefile function, and putting a pointer at those offsets instead of my reset code. It can also be useful as a way to create a "GAME OVER" screen of sorts (Just edit the text as necessary). I put those offsets as is because there's enough room for either a very small ASM routine, or a pointer to a location for a different routine in case you want to do more things.
Also, the reason there's two pointers for this is because there's two different cases I have to handle: One for heading back home after losing, and one for heading to the Pokémon Center. That should cover virtually all cases of loss, but I might have missed a few. If I did, let me know, and I'll find and edit in the additional offsets to modify.
Type 5F F1 53 FC 00 DF at 0807F5B6 and F1 E7 at 0807F5D0.
Overworld abilities can be added by scripting. Try decompiling the script on a cut tree and you'll see what I mean :)