L!no
GBA Developer
Hola a todos!
Hoy les traigo una nueva rutina.
en pokemon rubi/zafiro cada 10 pokeballs te daban una premier ball,pero en pokemon FR este sistema se perdio.
Asi que vamos a arreglarlo!
Que necesitamos?
Como lo hacemos?
Primero,compilamos un texto en un script (a esta altura creo q ya saben como) y guardamos el offset.
Luego insertamos esta rutina en un espacio libre.
Donde XXXXXX es el offset de nuestro script.
Ahora naveguen hasta 3DF0B4 y pongan el pointer de donde insertaron su rutina +1 (con un 08 al final)
Creditos
Hoy les traigo una nueva rutina.
en pokemon rubi/zafiro cada 10 pokeballs te daban una premier ball,pero en pokemon FR este sistema se perdio.
Asi que vamos a arreglarlo!
Que necesitamos?
- Un editor de scripts.
- HxD.
- THUMB.
- FR (?
Como lo hacemos?
Primero,compilamos un texto en un script (a esta altura creo q ya saben como) y guardamos el offset.
Luego insertamos esta rutina en un espacio libre.
Código:
.thumb
main:
push {r4-r7, lr}
lsl r0, r0, #0x18
lsr r5, r0, #0x18
lsl r0, r5, #2
add r0, r0, r5
lsl r0, r0, #3
ldr r1, taskspriv
add r4, r0, r1
mov r0, #4
ldr r7, rboxid_tilemap_update
bl linkr7
ldrh r0, [r4, #0xA] @ItemID
ldrh r1, [r4, #2] @Amount
mov r6, r1
lsl r6, r6, #0x10
add r6, r0
ldr r7, bag_add_item
bl linkr7
lsl r0, r0, #0x18
lsr r0, r0, #0x18
cmp r0, #1
bne fullbag
ldr r1, hereyouare
ldr r2, sub_809BF0C
mov r0, r5
bl displaymsg
mov r0, r5
mov r0, r6
lsl r0, #0x10
lsr r0, #0x10
cmp r0, #0x4 [MENTION=30079]Pok[/MENTION]eball ID
beq boughtball
next:
ldrh r0, [r4, #0xA]
ldrh r1, [r4, #2]
mov r2, #1
ldr r7, sub_809C09C
bl linkr7
b end
boughtball:
lsr r6, #0x10
mov r1, r6
cmp r1, #0x9 @if player bought over 9 pokeballs, attempt to add premierball
bhi tryadding
b next
tryadding:
mov r0, #0xC @premier ball ID
mov r1, #0x1 @amount of premier balls
ldr r7, bag_add_item
bl linkr7
lsl r0, r0, #0x18
lsr r0, r0, #0x18
cmp r0, #1
bne next @if no room for premier ball, skip to next
ldr r1, message
ldr r2, sub_809BF0C
mov r0, r5
bl displaymsg
b next
fullbag:
ldr r1, bagisfull
ldr r2, sub_809BF98
mov r0, r5
bl displaymsg
end:
pop {r4-r7}
pop {r0}
bx r0
displaymsg:
ldr r7, displayadress
linkr7:
bx r7
.align 2
taskspriv: .word 0x03005098
rboxid_tilemap_update: .word 0x08003FA0 +1
bag_add_item: .word 0x0809A084 +1
sub_809BF98: .word 0x0809BF98 +1
sub_809BF0C: .word 0x0809BF0C +1
sub_809C09C: .word 0x0809C09C +1
displayadress: .word 0x0813F75C +1
bagisfull: .word 0x08416861
hereyouare: .word 0x084167E7
message: .word 0x08[COLOR="Red"]XXXXXX[/COLOR]
Ahora naveguen hasta 3DF0B4 y pongan el pointer de donde insertaron su rutina +1 (con un 08 al final)
Creditos
- squeetz
Última edición: