- 252
- Posts
- 12
- Years
- Seen Jul 6, 2019
So I made a battle script for Acrobatics (my very first one), and it works! Here's the code.
(This is for Emerald by the way.)
ASM at 0xAAAAAA:
Battle Script:
Credits to Tlachtli, for the Emerald offsets.
Also, thanks to ipatix, for helping me when I was having a bug with this.
(This is for Emerald by the way.)
ASM at 0xAAAAAA:
Code:
.text
.align 2
.thumb
.thumb_func
CheckItem:
push {r0-r4}
ldr r1, BattleData
ldr r0, CurPokeIndex
ldrb r0, [r0]
mov r2, #0x58
mul r2, r0
add r1, #0x2E
add r1, r2
ldrh r0, [r1]
cmp r0, #0x0
beq PowerUp
b End
PowerUp:
ldr r3, Multiplier
mov r4, #0x2
strb r4, [r3]
b End
End:
pop {r0-r4}
bx lr
.align 2
BattleData: .word 0x02024084
CurPokeIndex: .word 0x0202420B
Multiplier: .word 0x02024482
Battle Script:
Code:
#dynamic 0x800000
#freespace 0xFF
#org @start
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
callasm 0x8AAAAAA+1
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
goto 0x82D8A47
Credits to Tlachtli, for the Emerald offsets.
Also, thanks to ipatix, for helping me when I was having a bug with this.
Last edited: