jiangzhengwenjz
Usuario mítico
Hello everyone!
As I'm still a beginner in ROM hacking, I can't do much great work. (Actually this piece of code was written yesterday and now I decide to release it. )It hijacks the level loading routine so that the level of wild pokemon will be related to the highest level in your team.
Here's the formula:
1. Egg level is assumed to be 5 and if you changed it to 1 ,you can change the routine by yourself. Eggs won't influence the highest party level.
2. Basically the wild pokemon level will be in this range [highest level in your party - 2,highest level in your party]. For example, if the highest level in your team is 49, you will encounter pokemon whose level ranges from [47,49]. If the highest level is 2, the wild level will be 1 or 2. If the highest level is 1, the wild level will be 1.
3. There are 8 limiters by gym badges. (I assume that the player get the badges in the same order of the original game) That is to say, if you have a Lv 100 pokemon in your team but you only have the first 2 badges, you will encounter pokemon whose level range from [28,30]. The limiter is (number of badges + 1) * 10. However, if you have all the 8 badges, the limiter will be Absolutely Lv100. (I include this limit because otherwise some players may keep fighting wild pokemon to raise the levels of their pokemons)
This piece of code is not extensively tested so it may have some bugs though I haven't found them. I have basically tested it (From egg, limiter to normal Pokemon) and I've found no problem.
Firstly, compile and insert this routine into free space in your BPRE 1.0 ROM. (The offset must end in 0, 4, 8 or C or it will cause misalign problems)
Then put these codes at 0x828FC:
XX XX XX XX should be a pointer to the previous routine. (As the routine is in thumb mode, you should add 1 to the offset. For example, if you insert the routine at 0x800000, its pointer is 01 00 80 08)
Absolutely, you can all put 1 in Advance map's wild Pokemon editor's level slot because they have no use at all. In addition, you can easily port it to emerald or ruby by modifying the routine if you wish.
If there exist some fatal errors, feel free to delete this post.
As I'm still a beginner in ROM hacking, I can't do much great work. (Actually this piece of code was written yesterday and now I decide to release it. )It hijacks the level loading routine so that the level of wild pokemon will be related to the highest level in your team.
Here's the formula:
1. Egg level is assumed to be 5 and if you changed it to 1 ,you can change the routine by yourself. Eggs won't influence the highest party level.
2. Basically the wild pokemon level will be in this range [highest level in your party - 2,highest level in your party]. For example, if the highest level in your team is 49, you will encounter pokemon whose level ranges from [47,49]. If the highest level is 2, the wild level will be 1 or 2. If the highest level is 1, the wild level will be 1.
3. There are 8 limiters by gym badges. (I assume that the player get the badges in the same order of the original game) That is to say, if you have a Lv 100 pokemon in your team but you only have the first 2 badges, you will encounter pokemon whose level range from [28,30]. The limiter is (number of badges + 1) * 10. However, if you have all the 8 badges, the limiter will be Absolutely Lv100. (I include this limit because otherwise some players may keep fighting wild pokemon to raise the levels of their pokemons)
This piece of code is not extensively tested so it may have some bugs though I haven't found them. I have basically tested it (From egg, limiter to normal Pokemon) and I've found no problem.
Firstly, compile and insert this routine into free space in your BPRE 1.0 ROM. (The offset must end in 0, 4, 8 or C or it will cause misalign problems)
Código:
.thumb
.align 2
mainfunc:
ldr r4, =0x020242D8
mov r2, #0
mov r0, #0
loop:
ldrb r5, [r4]
cmp r5, #5
beq checkegg
checked:
cmp r5, r0
bgt change
nochange:
add r4, #0x64
add r2, #1
cmp r2, #6
bne loop
check:
cmp r0, #2
bls adjust
sub r5, r0, #2
checkflag:
push {r0-r2, r4-r7}
mov r0, #0x41
lsl r0, r0, #5
add r4, r0, #0
mov r3, #0
loop2:
ldr r2, =0x0806E6D1
bl viar2
cmp r0, #0
beq limiter
add r0, r4, #1
add r4, r0, #0
mov r1, #0x41
lsl r1, r1, #5
add r1, #8
cmp r0, r1
bls loop2
back:
pop {r0-r2, r4-r7}
cmp r3, #0
beq back2
cmp r0, r3
bgt adjust2
back2:
ldr r4, =0x0808290d
bx r4
change:
add r0, r5, #0
b nochange
adjust:
mov r5, #1
b back2
checkegg:
push {r0-r4, r6, r7}
mov r1, #0x2D
sub r4, #0x54
mov r0, r4
ldr r2, =0x0803FBE9
bl viar2
cmp r0, #1
beq egg
b share
egg:
add r5, r0, #0
share:
pop {r0-r4, r6, r7}
b checked
viar2:
bx r2
limiter:
mov r1, #0x41
lsl r1, r1, #5
sub r1, r4, r1
add r1, #1
mov r3, #0xa
mul r3, r1
b back
adjust2:
add r0, r3, #0
sub r5, r0, #2
b back2
Código:
00 4C 20 47 XX XX XX XX
Absolutely, you can all put 1 in Advance map's wild Pokemon editor's level slot because they have no use at all. In addition, you can easily port it to emerald or ruby by modifying the routine if you wish.
If there exist some fatal errors, feel free to delete this post.