top of page

Headbutt Tree v2

4.12

Description Loading...

HMA Discord Link 2.png




How To

When editing a map, select the tile(s) that you want to use as Headbutt tree, then click on "Edit Block" above the blockset. In the window that appears, change "Behavior" to Unused_A6


Vanilla FireRed

Add this script in free space and note the offset; you can customize this script to your liking.

section0:
  checkattack Headbutt
  if.compare.goto varResult == 6 <section2>
  setanimation 0 0x800D
  bufferpartyPokemon buffer1 0x800D
  bufferattack buffer2 Headbutt
  msgbox.yesno <auto>
{
It's a moderately sized tree.
Would you like to use Headbutt?
}
  if.no.goto <section1>
  lockall
  msgbox.autoclose <auto>
{
[buffer1] used [buffer2]!
}
  doanimation 40
  waitstate
  waitsound
  sound se_m_vital_throw2
  setvar var4 5 #This controls how far the screen shakes vertically
  setvar var5 0 #This controls how far the screen shakes horizontally
  setvar var6 8 #This controls how long the overall animation lasts
  setvar var7 3 #This controls how long one screen shake lasts
  special ShakeScreen
  waitstate
  special RockSmashWildEncounter
  if.no.goto <section1>
  waitstate

section1:
  releaseall
  end

section2:
  msgbox.autoclose <auto>
{
There's a formidable tree that
looks like it can be headbutted!
}
  end

Add this routine in free space. At the bottom, replace "123456" with the noted offset of the script above. Note the offset of this routine.

    lsr   r5, r2, #24
    ldr   r0, =(0x020370D4)
    strh  r5, [r0, #0]
    mov   r0, r4
    lsl   r0, r0, #24
    lsr   r0, r0, #24
    cmp   r0, #166 @Unused_A6
    bne   back
    ldr   r0, script
    pop   {r4-r5}
    pop   {r1}
    bx    r1
back:
    mov   r0, r4
    ldr   r3, =(0x0806D201)
    bx    r3
script: .word 0x08123456

Go to 06D1F8, change 15 0E 05 48 05 80 20 1C to 00 4B 18 47 <offset+1> (type <, then type the noted offset+1, then type > and press Enter key).

HUBOL

Go to free space and add these bytes:

4F A8 4B 09 6B BD 43 09 5C A8 4B 09 62 A8 4B 09 69 A8 4B 09 6F A8 4B 09

Select the first byte (4F) and add this anchor:

scripts.text.orderstrings[ptr<>]6


Go to 14859EC, type <scripts.text.orderstrings>


Change 1483F10 from A4 to A6


Change 14BF948 from 4F A8 4B 09 55 A8 4B to 00 00 00 00 6B BD 43


To customize the Headbutt tree script, go to 143BD6B


Happy Hacking!

 


bottom of page