HUBOL ‐ Motley of Changes - haven1433/HexManiacAdvance GitHub Wiki
Click here for HUBOL's main page. HUBOL is short for "Haven's Unofficial Build of Leon's dynamic Pokémon expansion."
This page contains a variety of smaller tutorials that involve quick byte changes or something similar for HUBOL ROM hacks.
Credits: YeahPotato
Go to address 14C8306
and change 03
to 06
. Then, go to 1453A8A
and change 8D E7
to 00 00
. Now, all wild, egg, and gift Pokémon will generate with Perfect IVs.
Credits: Defa
- Go to
14427A4
→ change0A
(level 10) for 0 badges' obedience level. - Go to
1442822
→ change1E
(level 30) for 2 badges' obedience level. - Go to
144281A
→ change32
(level 50) for 4 badges' obedience level. - Go to
144281E
→ change46
(level 70) for 6 badges' obedience level.
Apply obedience levels to Pokémon owned by the player:
- Go to
1442574
→ change50 D0
to00 00
.
Credits: Invis and Yak Attack
Add this to your .toml
file:
[[NamedAnchors]]
Name = '''graphics.gSpecificTilesetFades'''
Address = 0x14BE604
Format = '''[tilesetPointer<[isCompressed. isSecondary. unused: tileset<> pal<`ucp4:0123456789ABCDEF`> blockset<> animation<> attributes<>]1> paletteNumToFade. unused. index1. unused. color1:|t|red::.|green::.|blue::. index2. unused. color2:|t|red::.|green::.|blue::. index3. unused. color3:|t|red::.|green::.|blue::. tilesetPalFadeEnd: index4. unused. color4:|t|red::.|green::.|blue::. index5. unused. color5:|t|red::.|green::.|blue::. index6. unused. color6:|t|red::.|green::.|blue::. index7. unused. color7:|t|red::.|green::.|blue::. index8. unused. color8:|t|red::.|green::.|blue::. index9. unused. color9:|t|red::.|green::.|blue::. index10. unused. color10:|t|red::.|green::.|blue::. index11. unused. color11:|t|red::.|green::.|blue::. index12. unused. color12:|t|red::.|green::.|blue::. index13. unused. color13:|t|red::.|green::.|blue::. index14. unused. color14:|t|red::.|green::.|blue::. index15. unused. color15:|t|red::.|green::.|blue::. index16. unused. color16:|t|red::.|green::.|blue::. index17. unused. color17:]3'''
Insert the following routine into free space, and then place a pointer at address 070478: <offset+1>
. It supports up to 768 entries by default, but it's a u32 - change it to 3*2^x (between 1 and 24) to get between 6 and 16777216 window lighting entries! You have to expand the table to 768, or else it will read garbage data.
Routine Code (click me)
1463CF8:
push {r4-r7, lr}
ldr r3, [pc, <1464014>] @ = 0x02037AB8
ldrb r2, [r3, #8]
sub sp, #76
str r3, [sp, #32]
cmp r2, #127
bls <1463D08>
b <1463F9C>
1463D08:
mov r3, #160
ldr r4, [pc, <1464018>] @ = 0x040000D4
ldr r0, [pc, <146401C>] @ = 0x020375F8
ldr r1, [pc, <1464020>] @ = 0x040000D8
lsl r3, r3, #19
str r0, [r4, #0]
ldr r2, [pc, <1464024>] @ = 0x80000200
str r3, [r1, #0]
ldr r3, [pc, <1464028>] @ = 0x040000DC
ldr r5, [pc, <146402C>] @ = 0x02036DFC
str r2, [r3, #0]
ldr r2, [r3, #0]
ldrb r2, [r5, #23]
str r4, [sp, #52]
str r0, [sp, #40]
str r1, [sp, #56]
str r3, [sp, #44]
cmp r2, #9
bhi <1463D3A>
mov r3, #1
lsl r3, r2
ldr r2, [pc, <1464030>] @ = 785
tst r3, r2
beq <1463D3A>
b <146400A>
1463D3A:
ldr r0, [pc, <1464034>] @ = 0x08079E0D
ldr r3, [pc, <1464038>] @ = 0x08077651
bl <146431E>
sub r4, r0, #0
bne <1463D50>
ldr r3, [pc, <146403C>] @ = 0x0203E043
ldrb r3, [r3, #0]
cmp r3, #0
bne <1463D50>
b <1463F7C>
1463D50:
ldr r3, [pc, <1464040>] @ = 0x03005EA0
mov r1, #10
ldrb r0, [r3, #7]
ldrb r7, [r3, #6]
bl <1400426>
mov r2, #6
lsl r6, r7, #0
mul r6, r2
lsl r0, r0, #24
lsr r0, r0, #24
ldr r3, [pc, <1464044>] @ = 0x094BE6E8
add r6, r6, r0
lsl r6, r6, #2
add r2, r3, r6
ldrb r2, [r2, #2]
str r2, [sp, #12]
mov r2, #1
ldrh r3, [r6, r3]
str r3, [sp, #28]
ldr r3, [sp, #32]
ldrb r3, [r3, #7]
str r2, [sp, #8]
cmp r3, #127
bhi <1463D90>
ldr r2, [pc, <1464048>] @ = 0x02037F34
ldr r3, [pc, <146404C>] @ = 1734
ldrb r3, [r2, r3]
sub r3, r3, #1
neg r2, r3
adc r2, r3
str r2, [sp, #8]
1463D90:
sub r3, r4, #1
sbc r4, r3
mov r3, #128
ldr r2, [pc, <1464050>] @ = 0xFFFF17FF
lsl r3, r3, #4
neg r4, r4
and r4, r3
mov r12, r2
lsl r3, r4, #0
add r3, r12
str r3, [sp, #16]
ldr r3, [pc, <1464054>] @ = 0x0203E049
ldrb r2, [r3, #0]
str r3, [sp, #60]
ldr r3, [sp, #12]
str r2, [sp, #36]
cmp r3, r2
bne <1463DC0>
ldr r3, [pc, <1464058>] @ = 0x0203E04A
ldr r2, [sp, #28]
ldrh r3, [r3, #0]
cmp r3, r2
bne <1463DC0>
b <1463ED6>
1463DC0:
ldr r3, [sp, #8]
cmp r3, #0
bne <1463DCE>
ldr r0, [r5, #0]
ldr r3, [pc, <146405C>] @ = 0x08059AD9
bl <146431E>
1463DCE:
mov r4, #0
ldr r6, [pc, <1464060>] @ = 0x0203C757
strb r4, [r6, #0]
bl <1463CE0>
cmp r0, r4
bne <1463DDE>
b <1463FEA>
1463DDE:
ldr r3, [pc, <146402C>] @ = 0x02036DFC
ldr r1, [r3, #0]
ldr r3, [pc, <1464064>] @ = <graphics.gSpecificTilesetFades>
ldr r0, [r1, #16]
ldr r2, [r3, r4]
cmp r0, r2
bne <1463DEE>
b <1463FA0>
1463DEE:
ldr r1, [r1, #20]
cmp r1, r2
bne <1463DF6>
b <1463FA0>
1463DF6:
add r4, r4, #76
mov r3, #228
lsl r3, #8 @ Supports up to 256 entries by default, but it's a u32 - change to 3^x (between 1 and 24) to get between 6 and 16777216 (lol) entries
cmp r4, r3
bne <1463DDE>
mov r3, #1
1463DFE:
strb r3, [r6, #0]
mov r3, #0
str r3, [sp, #20]
1463E04:
ldr r3, [sp, #20]
ldr r2, [sp, #16]
lsl r3, r3, #20
lsl r2, r2, #31
bpl <1463E7E>
ldr r2, [sp, #28]
str r2, [sp, #64]
ldr r2, [sp, #20]
lsl r4, r2, #5
ldr r2, [pc, <1464068>] @ = 0x020371F8
1463E18:
add r4, r4, r2
ldr r2, [pc, <146406C>] @ = 0x0203B830
lsr r3, r3, #16
add r2, r3, r2
str r2, [sp, #24]
ldr r2, [pc, <1464070>] @ = 0x0203B840
add r3, r3, r2
str r3, [sp, #48]
1463E28:
ldrh r5, [r4, #0]
cmp r5, #0
beq <1463E70>
ldr r3, [sp, #24]
ldrb r3, [r3, #0]
cmp r3, #0
bne <1463E70>
ldrb r6, [r4, #0]
ldrb r7, [r4, #1]
lsl r6, r6, #27
lsl r5, r5, #22
lsl r7, r7, #25
lsr r6, r6, #27
lsr r5, r5, #27
lsr r7, r7, #27
lsl r3, r5, #0
str r7, [sp, #0]
lsl r2, r6, #0
ldr r1, [sp, #12]
add r0, sp, #64
bl <1463AE8>
ldr r3, [sp, #8]
strh r0, [r4, #0]
cmp r3, #0
bne <1463E70>
lsl r3, r5, #0
str r7, [sp, #0]
lsl r2, r6, #0
ldr r1, [sp, #12]
add r0, sp, #64
bl <1463AE8>
mov r3, #128
lsl r3, r3, #3
strh r0, [r4, r3]
1463E70:
ldr r3, [sp, #24]
ldr r2, [sp, #48]
add r3, r3, #1
add r4, r4, #2
str r3, [sp, #24]
cmp r3, r2
bne <1463E28>
1463E7E:
ldr r3, [sp, #16]
lsr r3, r3, #1
str r3, [sp, #16]
ldr r3, [sp, #20]
add r3, r3, #1
str r3, [sp, #20]
cmp r3, #16
bne <1463E04>
mov r2, r13
ldr r3, [sp, #60]
ldrb r2, [r2, #12]
strb r2, [r3, #0]
mov r2, r13
ldr r3, [pc, <1464058>] @ = 0x0203E04A
ldrh r2, [r2, #28]
strh r2, [r3, #0]
ldr r3, [sp, #8]
cmp r3, #0
bne <1463EB8>
lsl r4, r3, #0
1463EA6:
lsl r0, r4, #0
add r4, r4, #1
ldr r3, [pc, <1464074>] @ = 0x0807AB75
lsl r4, r4, #24
bl <146431E>
lsr r4, r4, #24
cmp r4, #13
bne <1463EA6>
1463EB8:
ldr r3, [sp, #36]
cmp r3, #255
bne <1463ED6>
ldr r3, [sp, #52]
ldr r2, [sp, #40]
str r2, [r3, #0]
mov r3, #160
ldr r2, [sp, #56]
lsl r3, r3, #19
str r3, [r2, #0]
ldr r3, [pc, <1464078>] @ = 0x80000100
ldr r2, [sp, #44]
str r3, [r2, #0]
ldr r3, [sp, #44]
ldr r3, [r3, #0]
1463ED6:
ldr r3, [sp, #12]
cmp r3, #0
beq <1463F7C>
mov r4, #128
ldr r7, [pc, <146407C>] @ = 0x0000FFFF
lsl r4, r4, #1
1463EE2:
mov r5, #1
tst r7, r5
beq <1463F6C>
lsl r0, r4, #0
bl <1466BFC>
cmp r0, #0
beq <1463F6C>
cmp r0, #5
beq <1463F6C>
mov r1, #0
ldr r3, [sp, #28]
ldr r2, [pc, <1464080>] @ = 0x0203C756
str r3, [sp, #68]
ldrb r2, [r2, #0]
lsr r3, r4, #4
str r1, [sp, #8]
cmp r2, r1
beq <1463F14>
ldr r2, [pc, <1464084>] @ = 0x030030F0
ldr r1, [pc, <1464088>] @ = 1081
ldrb r2, [r2, r1]
lsr r2, r5
bic r5, r2
str r5, [sp, #8]
1463F14:
mov r6, #0
ldr r2, [pc, <146406C>] @ = 0x0203B830
lsl r3, r3, #4
add r3, r3, r2
str r3, [sp, #16]
1463F1E:
add r5, r4, r6
lsl r5, r5, #16
ldr r3, [pc, <146401C>] @ = 0x020375F8
lsr r5, r5, #16
lsl r5, r5, #1
add r1, r5, r3
ldrh r3, [r1, #0]
cmp r3, #0
beq <1463F66>
ldr r2, [sp, #16]
ldrb r2, [r2, r6]
cmp r2, #0
bne <1463F66>
ldr r2, [sp, #8]
cmp r2, #0
beq <1463F44>
ldr r2, [pc, <146408C>] @ = 0x00007FFF
cmp r3, r2
beq <1463F66>
1463F44:
ldrh r3, [r1, #0]
ldrb r2, [r1, #0]
ldrb r1, [r1, #1]
lsl r1, r1, #25
lsr r1, r1, #27
lsl r3, r3, #22
lsl r2, r2, #27
lsr r3, r3, #27
str r1, [sp, #0]
lsr r2, r2, #27
ldr r1, [sp, #12]
add r0, sp, #68
bl <1463AE8>
mov r3, #160
lsl r3, r3, #19
strh r0, [r5, r3]
1463F66:
add r6, r6, #1
cmp r6, #16
bne <1463F1E>
1463F6C:
mov r3, #128
add r4, r4, #16
lsl r4, r4, #16
lsr r7, r7, #1
lsr r4, r4, #16
lsl r3, r3, #2
cmp r4, r3
bne <1463EE2>
1463F7C:
mov r2, #0
ldr r3, [pc, <1464090>] @ = 0x02037AC8
str r2, [r3, #0]
ldr r3, [sp, #32]
ldrb r3, [r3, #9]
add r2, r2, #3
and r3, r2
cmp r3, #2
bne <1463F9C>
ldr r3, [sp, #32]
ldrb r3, [r3, #7]
cmp r3, #127
bls <1463F9C>
ldr r3, [pc, <1464094>] @ = 0x0807141D
bl <146431E>
1463F9C:
add sp, #76
pop {r4-r7, pc}
1463FA0:
add r3, r3, r4
ldrb r5, [r3, #4]
cmp r5, #11
beq <1463FDC>
1463FA8:
ldr r3, [pc, <146406C>] @ = 0x0203B830
mov r12, r3
ldr r3, [pc, <1464064>] @ = <graphics.gSpecificTilesetFades>
lsl r2, r5, #4
add r3, r3, #6
add r12, r2
add r3, r3, r4
1463FB6:
ldrb r0, [r3, #0]
cmp r0, #255
bne <1463FBE>
b <1463DF6>
1463FBE:
ldr r7, [pc, <1464068>] @ = 0x020371F8
add r1, r0, r2
ldrh r5, [r3, #2]
lsl r1, r1, #1
strh r5, [r1, r7]
ldr r7, [sp, #8]
cmp r7, #0
bne <1463FD2>
ldr r7, [sp, #40]
strh r5, [r1, r7]
1463FD2:
mov r1, #1
mov r5, r12
add r3, r3, #4
strb r1, [r5, r0]
b <1463FB6>
1463FDC:
ldr r0, [pc, <1464098>] @ = 0x0809BBC1
ldr r3, [pc, <1464038>] @ = 0x08077651
bl <146431E>
cmp r0, #0
beq <1463FA8>
b <1463DF6>
1463FEA:
ldr r3, [sp, #8]
cmp r3, #0
bne <1463FF8>
ldr r0, [r5, #0]
ldr r3, [pc, <146405C>] @ = 0x08059AD9
bl <146431E>
1463FF8:
mov r2, #128
ldr r3, [pc, <146409C>] @ = 0x081E5ED9
lsl r2, r2, #2
mov r1, #0
ldr r0, [pc, <146406C>] @ = 0x0203B830
bl <146431E>
mov r3, #0
b <1463DFE>
146400A:
mov r2, #0
ldr r3, [pc, <1464054>] @ = 0x0203E049
strb r2, [r3, #0]
b <1463F7C>
1464014:
.word 0x02037AB8
1464018:
.word 0x040000D4
146401C:
.word 0x020375F8
1464020:
.word 0x040000D8
1464024:
.word 0x80000200
1464028:
.word 0x040000DC
146402C:
.word 0x02036DFC
1464030:
.word 0x00000311
1464034:
.word 0x08079E0D
1464038:
.word 0x08077651
146403C:
.word 0x0203E043
1464040:
.word 0x03005EA0
1464044:
.word 0x094BE6E8
1464048:
.word 0x02037F34
146404C:
.word 0x000006C6
1464050:
.word 0xFFFF17FF
1464054:
.word 0x0203E049
1464058:
.word 0x0203E04A
146405C:
.word 0x08059AD9
1464060:
.word 0x0203C757
1464064:
.word <graphics.gSpecificTilesetFades>
1464068:
.word 0x020371F8
146406C:
.word 0x0203B830
1464070:
.word 0x0203B840
1464074:
.word 0x0807AB75
1464078:
.word 0x80000100
146407C:
.word 0x0000FFFF
1464080:
.word 0x0203C756
1464084:
.word 0x030030F0
1464088:
.word 0x00000439
146408C:
.word 0x00007FFF
1464090:
.word 0x02037AC8
1464094:
.word 0x0807141D
1464098:
.word 0x0809BBC1
146409C:
.word 0x081E5ED9
Credits: Defa and Invis
By default, the palettes for Brendan and May backsprites are wrong in the CFRU. This .hma
file will fix them so you can use them for the player character or in tag battles; plus, it also allows you to expand the back sprites table to let you add more Trainer backsprites.
If you get an error window when applying the patch, select "Ignore" to apply it: it will still work.
After applying the patch, in the Goto Menu, you will find clearformat
. Go there, and then right click on the byte and select Clear Format.
Whenever you add one new back sprite, you have to change the parameters (on the left) "sprite" under graphics.trainers.palettes.back
and "c" under graphics.trainers.sprites.back.enter
to the index of the new back sprite, as shown in the screenshot.

Attached here is the .hma
script from the Discord server.
Credits: Defa
To disable the passive damage from Hail, go to address 1474E14
, and change 00 21
to 08 E0
.
Credits: Defa and YeahPotato
Add this routine to free space, and note the offset.
ldrh r2, [r3, #0]
mov r3, #192
lsl r3, r3, #1 @384, WEATHER_HAIL_ANY
tst r2, r3
beq checksandstorm
ldr r3, [sp, #24]
mov r1, #15 @TYPE_ICE
cmp r3, #0
beq skip1
ldr r0, [r6, #8]
ldr r3, =0x09490F71 @IsMonOfType
bl linker
b skip2
skip1:
ldr r0, [sp, #20]
ldr r3, =0x094508C5 @IsOfType
bl linker
skip2:
cmp r0, #0
beq back
mov r3, #15
ldr r0, [r6, #36]
lsl r2, r0, #0
mul r2, r3
mov r1, #10
lsl r0, r2, #0
ldr r3, =0x09400427 @__aeabi_uidiv
bl linker
str r0, [r6, #36]
back:
ldr r3, =0x0945EB6D @back to Stat Buffs - Attacker
linker:
bx r3
checksandstorm:
mov r3, #24
tst r2, r3
beq back
ldr r3, =0x0945EB45 @back after hook
bx r3
Go to 145EB3C
, and change 1A 88 18 23 1A 42 13 D0
to 00 4A 10 47 <offset+1>
.
Credits: Invis
It's basically a similar version to YeahPotato's Headbutt tree script from #other-resources. It's suggested to set the encounter rate for this to 100. Use a signpost event set to "Facing Any" for this. The palette codes for the colours used in the tree: 2BBD, 2B39, 2693, 2A10, 21AC, 196B, 2CC6, 1909.
Code (click me)
section0:
lockall
checkitem Honey 1
if.no.goto <section1>
msgbox.yesno <auto>
{
Do you want to put some honey on
this tree to attract Pokemon?
}
if.no.goto <section2>
removeitem Honey 1
msgbox.default <auto>
{
[player] puts some honey on
the tree.
}
closeonkeypress
special RockSmashWildEncounter
releaseall
end
section1:
msgbox.default <auto>
{
This tree looks like a good place to
attract wild Pokemon with honey.
}
releaseall
end
section2:
closeonkeypress
releaseall
end
Invis.Honey.Tree.Asset.mov
Credits: Shiny Miner
Tutorial Battles need to be defined a specific way:
.equ VAR_PRE_BATTLE_MUGSHOT_STYLE, 0x503A
.equ VAR_PRE_BATTLE_MUGSHOT_SPRITE, 0x503B
.global Mugshot_script
Mugshot_script:
msgbox BattleMe 0x6
setvar 0x8000 0xfefe
setvar VAR_PRE_BATTLE_MUGSHOT_STYLE 0x2
setvar VAR_PRE_BATTLE_MUGSHOT_SPRITE 0x0
trainerbattle3 0x3 0x146 0x100 LossMessage
end
Changes: You need to use the trainerbattle 03
macro, and the var 0x8000 should be set to 0xFEFE
.
This is the script invis made (You can use as a test):
section0: # BFAAC0
lock
faceplayer
setvar 0x8000 0xFEFE
trainerbattle 03 Franklin 0x100 auto
release
end
Note: This doesn't work for trainerbattle 09
.

Credits: Defa, Sylinuser, and YeahPotato
The CFRU includes a table of Pokémon who will be generated with X number of guaranteed 31 IVs in random stats. This table can be modified and expanded.
1. Go to 14C8306
. Paste ^data.pokemon.perfect.IV[species:data.pokemon.names]!FEFE
.
2. Change the 03
byte at 1453AA2
to anything from 00
-06
to modify the number of perfect IVs generated by this table.
Credits: Invis and j4de_IDK
The script for this behaviour can be found at the following address: 0x143B853
.
Create your Rock Climb tile and set the Behaviour to Unused_A5
just like in the screenshot. It should be mentioned that you (obviously) need HM08 Rock Climb and a certain badge if you didn't remove its requirement.
Credits: Invis
The CFRU adds 4 extra pedometers (step counters) next to a permanent one, one of them being very large with a max of almost 4.3 million steps. Two of them have a 65,535 count, and there are 2 small ones, each with a max count of 255. The permanent one does not have to be activated, but the other 4 have to be.
In the example script and video, Invis presents the 1st pedometer, which is the permanent one.
The permanent one needs no activation.
You have to either setflag 0x920
for the 1st, 0x921
for the 2nd, 0x922
for the 3rd. or 0x923
for the 4th pedometer to activate them.
The setvar 0x8004
can either be 0 for permanent or 1,2,3,4 for the others in the example script to be read via scripts.
Example Script:
section0:
lock
faceplayer
setvar 0x8004 0
special2 varResult 0x8A
buffernumber buffer1 0x800D
msgbox.default auto
{
You have taken [buffer1] steps!
}
release
end