Advertiser Content

Development Move Resource Thread Page 11

Started by Spherical Ice April 22nd, 2013 10:29 PM
  • 164697 views
  • 425 replies

MrDollSteak

Formerly known as 11bayerf1

Age 24
Male
Hong Kong
Seen 4 Weeks Ago
Posted May 15th, 2019
846 posts
10.8 Years
PsyStrike effect for Emerald :

Spoiler:
.text
.align 2
.thumb
.thumb_func
.global swapdefsandboosts

main:
push {r0-r3, lr}
ldr r0, .TargetBank
ldr r1, .BattleData
ldrb r0, [r0]
mov r2, #0x58
mul r0, r2
add r1, #0x4
add r1, r0
ldrh r2, [r1]
ldrh r3, [r1, #0x6]
strh r3, [r1]
strh r2, [r1, #0x6]
ldr r0, .TargetBank
ldr r1, .BattleData
ldrb r0, [r0]
mov r2, #0x58
mul r0, r2
add r1, #0x1A
add r1, r0
ldrb r2, [r1]
ldrb r3, [r1, #0x3]
strb r3, [r1]
strb r2, [r1, #0x3]
pop {r0-r3, pc}
bx r0

.align 2
.BattleData:.word 0x02024084
.TargetBank:.word 0x0202420C


It swaps defense/defense special as well as the boost defense/def spe. Though it doesn't handle Fur coat/Marvel Scale. Other than that it's fine.
callasm this routine before AND after calculate damage.

With that Mewtwo will take down Blissey !

EDIT : A way to have a proper effect is to make the move physical, and rather than swaps the defense of the foe, you swap attacks/boosts of the user. This way ability the damage-reduced ability will be kept, so here is the second routine (which I advice to use) :

Spoiler:
.text
.align 2
.thumb
.thumb_func
.global swapdefsandboosts

main:
push {r0-r3, lr}
ldr r0, .UserBank
ldr r1, .BattleData
ldrb r0, [r0]
mov r2, #0x58
mul r0, r2
add r1, #0x2
add r1, r0
ldrh r2, [r1]
ldrh r3, [r1, #0x6]
strh r3, [r1]
strh r2, [r1, #0x6]
ldr r0, .UserBank
ldr r1, .BattleData
ldrb r0, [r0]
mov r2, #0x58
mul r0, r2
add r1, #0x19
add r1, r0
ldrb r2, [r1]
ldrb r3, [r1, #0x3]
strb r3, [r1]
strb r2, [r1, #0x3]
pop {r0-r3, pc}
bx r0

.align 2
.BattleData:.word 0x02024084
.UserBank:.word 0x0202420B


So here you have to set the move "Physical" and it'll work exactly as expected, you still have to callasm this routine before AND after calculate damage in BSP.
I believe this won't actually take into account other multipliers. For example if you have x2 sp. atk. it's not going to correctly apply the damage. Because you'll be swapping say 160 attack with 320 sp atk. Instead of using an the sp.atk stat of 640, it'll use 320, because it's now treated as the attack stat.

The best way to do it as far as I can tell would be to have a check in the damage calculation for the move effect, as opposed to a custom battle script, which means you can place it after different multipliers. I'd probably find where it actually loads the 'fully treated' Sp. Attack of the user and Sp. Defense of the opponent, and just load the Defense stat instead.

MrDollSteak

Formerly known as 11bayerf1

Age 24
Male
Hong Kong
Seen 4 Weeks Ago
Posted May 15th, 2019
846 posts
10.8 Years
Dark Void effect :

Spoiler:
#freespace 0xFF
#dynamic 0xYourOffset

#org @start
attackcanceler
attackstring
ppreduce
attackanimation
selectnexttarget
cmd25
jumpifsecondarystatus 0x0 0x1000000 @accuracycheck
jumpifstatus 0x0 0x7 @alreadysleep
jumpifcannotsleep @cannotsleep
jumpifstatus 0x0 0xFF @accuracycheck
accuracycheck @accuracycheck 0x0
jumpifhalverset 0x0 0x20 @something
waitanimation
setbyte 0x2024335 0x1
seteffecttarget
jumpwhiletargetvalid 0x8YourOffset + 0x5
goto 0x82D8A4E

#org @accuracycheck
pause 0x20
orbyte 0x202427C 0x20
resultmessage
waitmessage 0x40
jumpwhiletargetvalid 0x8YourOffset + 0x5
goto 0x82D8A4E

#org @alreadysleep
cmd76 0x1 0x17
pause 0x20
printstring 0x25
waitmessage 0x40
jumpwhiletargetvalid 0x8YourOffset + 0x5
goto 0x82D8A4E

#org @cannotsleep
pause 0x20
printfromtable 0x85CC896
waitmessage 0x40
jumpwhiletargetvalid 0x8YourOffset + 0x5
goto 0x82D8A4E

#org @something
pause 0x20
printstring 0x50
waitmessage 0x40
jumpwhiletargetvalid 0x8YourOffset + 0x5
end2


You branch the effect 1 to this script, you don't even have to select "both foes and parter", the script handles this.

I don't have an animation yet since I've never dealt with it. I'll try tu use luster purge, but with the color black instead of white, another font (the dark one should be right) and without the hits after-flash.

Any help would be appreciated.
The move doesn't put your partner to sleep. Only your two opponents.
Also shouldn't you include a move check at the start, otherwise every single sleep move is going to hit both foes.

destinedjagold

Oh Hai Thar~

Age 28
Male
Philippines
Seen 1 Week Ago
Posted May 6th, 2019
8,596 posts
12.3 Years
Yes and nope.

Everything works as it should afaik. It asleeps everyone (and check correctly safeguard/insomnia/already sleep etc) including parter. And yeah as I said you have to branch the effect 1 to this battlescript, but it's true that I wasn't accurate, I'll correct that.
Why? Dark Void only targets foes.

Dark Void
- Pokémon Hit in Battle: All opponent Pokémon in range
Source

Seen January 10th, 2017
Posted April 21st, 2016
180 posts
5.6 Years
Dark Void effect for Emerald
With damaging moves, it's enough to just set target as "both foes" in order to hit both opponents, while you have to make an entirely new script similar to that of earthquake if you want the move to also hit your ally.

Is this different with status moves? I've never really tried it out except for changing Poison Gas without testing. If it's the same, it should be enough to just use the original Hypnosis script and change the target to "both foes".

I don't have a save near a double battle to test with.
Male
Seen January 10th, 2019
Posted May 4th, 2017
216 posts
6.1 Years
With damaging moves, it's enough to just set target as "both foes" in order to hit both opponents, while you have to make an entirely new script similar to that of earthquake if you want the move to also hit your ally.

Is this different with status moves? I've never really tried it out except for changing Poison Gas without testing. If it's the same, it should be enough to just use the original Hypnosis script and change the target to "both foes".

I don't have a save near a double battle to test with.
I actually thought that dark void was supposed to asleep everyone so I made this script. But testing with just selecting "both foe" deserves indeed a try.

EDIT : Oh yeah.. you're right, I guess I can delete my previous posts lol
Age 24
Male
Seen 2 Weeks Ago
Posted 2 Weeks Ago
455 posts
6.2 Years
I actually thought that dark void was supposed to asleep everyone so I made this script. But testing with just selecting "both foe" deserves indeed a try.

EDIT : Oh yeah.. you're right, I guess I can delete my previous posts lol
IMO it should work, because 'target both foes' automatically re-runs the same battle script for differrent foes.

MrDollSteak

Formerly known as 11bayerf1

Age 24
Male
Hong Kong
Seen 4 Weeks Ago
Posted May 15th, 2019
846 posts
10.8 Years
I actually thought that dark void was supposed to asleep everyone so I made this script. But testing with just selecting "both foe" deserves indeed a try.

EDIT : Oh yeah.. you're right, I guess I can delete my previous posts lol
I've noticed that with quite a few moves and abilities you haven't actually looked into their effects on Bulbapedia or somewhere. I don't want to call you out or anything, but please make sure you check this so it doesn't clutter threads with stuff haha.
Age 24
Male
Seen 2 Weeks Ago
Posted 2 Weeks Ago
455 posts
6.2 Years
Freeze Dry
Spoiler:

Fire Red
Spoiler:

Routine I
.text
.align 2
.thumb
.thumb_func
.global freezedry1

Main:
  
  cmp r4, #0xB
  bne RegularChart
  ldr r1, .currMove
  ldrh r1, [r1]
  ldrh r0, .freezeDryIndex
  cmp r0, r1
  bne RegularChart
  mov r0, #0x14
  b Exit
  
RegularChart:
  add r0, r3, #0x2
  add r0, r0, r5
  ldrb r0, [r0, #0x0]
  str r2, [sp, #0x0]

Exit:
  ldr r1, =0x0801E979
  bx r1

.align 2
.currMove: .word 0x02023D4A
.freezeDryIndex: .hword 0x00B5

@1E970:  00 49 08 47 XX+1 XX XX 08
Routine II
.text
.align 2
.thumb
.thumb_func
.global freezedry2

Main:
  ldrb r0, [r0, #0x0]
  cmp r0, r4
  beq NextEntry
  cmp r4, #0xB
  bne RegularChart
  ldr r1, .currMove
  ldrb r1, [r1]
  ldrh r0, .freezeDryIndex
  cmp r0, r1
  bne RegularChart
  mov r0, #0x14
  ldr r1, =0x0801E9A1
  bx r1

RegularChart:  
  add r0, r3, #0x2
  ldr r1, =0x0801E99D
  bx r1

NextEntry:
  ldr r1, =0x0801E9A9
  bx r1

.align 2
.currMove: .word 0x02023D4A
.freezeDryIndex: .hword 0x00B5

@1E994:  00 49 08 47 XX+1 XX XX 08
Routine III
.text
.align 2
.thumb
.thumb_func
.global freezedryai1

Main:
  
  cmp r4, #0xB
  bne RegularChart
  ldr r1, .currMove
  ldrh r1, [r1]
  ldrh r0, .freezeDryIndex
  cmp r0, r1
  bne RegularChart
  mov r0, #0x14
  b Exit
  
RegularChart:
  mov r0, r8
  add r0, #0x2
  add r0, r0, r7
  ldrb r0, [r0]

Exit:
  ldr r1, =0x0801EEF9
  bx r1

.align 2
.currMove: .word 0x02023D4A
.freezeDryIndex: .hword 0x00B5

@1EEF0:  00 49 08 47 XX+1 XX XX 08
Routine IV
.text
.align 2
.thumb
.thumb_func
.global freezedryai2

Main:
  
  cmp r4, #0xB
  bne RegularChart
  ldr r1, .currMove
  ldrh r1, [r1]
  ldrh r0, .freezeDryIndex
  cmp r0, r1
  bne RegularChart
  mov r0, #0x14
  b Exit
  
RegularChart:
  mov r0, r8
  add r0, #0x2
  add r0, r0, r7
  ldrb r0, [r0]

Exit:
  ldr r1, =0x0801EF19
  bx r1

.align 2
.currMove: .word 0x02023D4A
.freezeDryIndex: .hword 0x00B5

@1EF10:  00 49 08 47 XX+1 XX XX 08


Emerald
Spoiler:

Routine I
.text
.align 2
.thumb
.thumb_func
.global freezedry1

Main:
  
  cmp r4, #0xB
  bne RegularChart
  ldr r1, .currMove
  ldrh r1, [r1]
  ldrh r0, .freezeDryIndex
  cmp r0, r1
  bne RegularChart
  mov r0, #0x14
  b Exit
  
RegularChart:
  add r0, r3, #0x2
  add r0, r0, r5
  ldrb r0, [r0, #0x0]
  str r2, [sp, #0x0]

Exit:
  ldr r1, =0x08047619
  bx r1

.align 2
.currMove: .word 0x020241EA
.freezeDryIndex: .hword 0x00B5

@47160:  00 49 08 47 XX+1 XX XX 08
Routine II
.text
.align 2
.thumb
.thumb_func
.global freezedry2

Main:
  ldrb r0, [r0, #0x0]
  cmp r0, r4
  beq NextEntry
  cmp r4, #0xB
  bne RegularChart
  ldr r1, .currMove
  ldrh r1, [r1]
  ldrh r0, .freezeDryIndex
  cmp r0, r1
  bne RegularChart
  mov r0, #0x14
  ldr r1, =0x08047191
  bx r1

RegularChart:  
  add r0, r3, #0x2
  ldr r1, =0x0804718D
  bx r1

NextEntry:
  ldr r1, =0x08047199
  bx r1

.align 2
.currMove: .word 0x020241EA
.freezeDryIndex: .hword 0x00B5

@47184:  00 49 08 47 XX+1 XX XX 08
Routine III
.text
.align 2
.thumb
.thumb_func
.global freezedryai1

Main:
  
  cmp r4, #0xB
  bne RegularChart
  ldr r1, .currMove
  ldrh r1, [r1]
  ldrh r0, .freezeDryIndex
  cmp r0, r1
  bne RegularChart
  mov r0, #0x14
  b Exit
  
RegularChart:
  mov r0, r8
  add r0, #0x2
  add r0, r0, r7
  ldrb r0, [r0]

Exit:
  ldr r1, =0x080476E9
  bx r1

.align 2
.currMove: .word 0x02024E1A
.freezeDryIndex: .hword 0x00B5

@476E0:  00 49 08 47 XX+1 XX XX 08
Routine IV
.text
.align 2
.thumb
.thumb_func
.global freezedryai2

Main:
  
  cmp r4, #0xB
  bne RegularChart
  ldr r1, .currMove
  ldrh r1, [r1]
  ldrh r0, .freezeDryIndex
  cmp r0, r1
  bne RegularChart
  mov r0, #0x14
  b Exit
  
RegularChart:
  mov r0, r8
  add r0, #0x2
  add r0, r0, r7
  ldrb r0, [r0]

Exit:
  ldr r1, =0x08047709
  bx r1

.align 2
.currMove: .word 0x02024E1A
.freezeDryIndex: .hword 0x00B5

@47700:  00 49 08 47 XX+1 XX XX 08


The routines hard code the move to be Super-Effective on Water type using the move ID. Replace 0x00B5 with the move ID of Freeze Dry (used Power Snow for testing purposes).
For the freezing chance, just set the move effect using a move editor.
The first 2 routines simulaty the freeze dry effect, while the last 2 routines make the AI smart in handling Freeze Dry.

destinedjagold

Oh Hai Thar~

Age 28
Male
Philippines
Seen 1 Week Ago
Posted May 6th, 2019
8,596 posts
12.3 Years
Effect: Fiery Dance / Charge Beam for Ruby...
2E 21 4D 02 02 D2 28 14 6F 1D 08 - this one is bugged. use the code below.
2E 21 4D 02 02 52 28 14 6F 1D 08
Effect: Dragon Tail / Circle Throw for Ruby...
00 01 72 6F 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 E3 00 5B 6F 1D 08 1E 00 15 08 94 1D 08 21 00 00 04 00 00 00 27 8F 1D 08 8F D6 83 1D 08 28 5B 6F 1D 08

Seen January 10th, 2017
Posted April 21st, 2016
180 posts
5.6 Years
For Emerald:

All credits to Chaos Rush as I've pretty much just edited his Gastro Acid (and his post).

Worry Seed:
First insert this string:
Spoiler:
FD 10 00 D5 07 E5 E9 DD E6 D9 D8 00 FE C3 E2 E7 E3 E1 E2 DD D5 AB FF 00

(it says, "[the target] acquired Insomnia!")

Next insert this ASM code:
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global test

main:
push {lr}
ldr r0, .TargetBank
ldr r1, .BattleData
ldrb r0, [r0]
mov r2, #0x58
mul r2, r0
add r1, #0x20
add r1, r2
mov r3, #0xF
ldrb r4, [r1]
cmp r3, r4
beq Abort
strb r3, [r1]
b End

Abort:
ldr r0, .CurrentScript
ldr r1, .FailScript
str r1, [r0]

End:
pop {r0}
bx r0

.align 2
.BattleData:	.word 0x02024084
.UserBank:	.word 0x0202420B
.TargetBank:	.word 0x0202420C
.BasePower: 	.word 0x02024400
.CurrentScript: .word 0x02024214
.FailScript: 	.word 0x082D9F1A


And finally, use this battle script:
Spoiler:
#org @main
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
callasm 0x8(offset of ASM routine + 1)
attackanimation
waitanimation
setword 0x203B200 0x8[offset of string]
printstring 0x184
waitmessage 0x40
goto 0x82D8A4E


Note that your setword command might be different from mine depending on whether you used KDS' or Hidoran's port.

String at A20000 (Sky Attack's)
FD 0F B4 E7 00 D6 D9 D7 D5 E1 D9 00 D7 E0 E3 D5 DF D9 D8 00 DD E2 00 D5 00 DC D5 E6 E7 DC 00 E0 DD DB DC E8 AB FF
Just a small nitpick:
A string that is more consistent with the official games would be:
 FD 0F 00 D6 D9 D7 D5 E1 D9 00 FE D7 E0 E3 D5 DF D9 D8 00 DD E2 00 D5 00 DC D5 E6 E7 DC 00 E0 DD DB DC E8 AB FF
I didn't check the other two but I can see that they use FD 0F B4 E7 instead of just FD 0F.
Seen January 10th, 2017
Posted April 21st, 2016
180 posts
5.6 Years
For Emerald:

Credits to KDS for his original script.

Soak:
First insert this string:
Spoiler:
FD 10 00 E8 E6 D5 E2 E7 DA E3 E6 E1 D9 D8 00 FE DD E2 E8 E3 00 E8 DC D9 00 D1 D5 E8 D9 E6 00 E8 ED E4 D9 AB

(it says, "[the target] transformed into the Water type!")

Next, insert this script:
Spoiler:
#org @Soak
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
jumpifsecondarystatus 0x0 0x1000000 0x82D9F1C
jumpiftype 0x0 0x0 @NotWater
jumpiftype 0x0 0x1 @NotWater
jumpiftype 0x0 0x2 @NotWater
jumpiftype 0x0 0x3 @NotWater
jumpiftype 0x0 0x4 @NotWater
jumpiftype 0x0 0x5 @NotWater
jumpiftype 0x0 0x6 @NotWater
jumpiftype 0x0 0x7 @NotWater
jumpiftype 0x0 0x8 @NotWater
jumpiftype 0x0 0x17 @NotWater
jumpiftype 0x0 0xA @NotWater
jumpiftype 0x0 0xC @NotWater
jumpiftype 0x0 0xD @NotWater
jumpiftype 0x0 0xE @NotWater
jumpiftype 0x0 0xF @NotWater
jumpiftype 0x0 0x10 @NotWater
jumpiftype 0x0 0x11 @NotWater
goto 0x82D9F1C

#org @NotWater
attackanimation
waitanimation
jumpifbyte 0x0 0x0202420C 0x0 @slot1
jumpifbyte 0x0 0x0202420C 0x1 @slot2
jumpifbyte 0x0 0x0202420C 0x2 @slot3
jumpifbyte 0x0 0x0202420C 0x3 @slot4

#org @slot1
setbyte 0x20240A5 0xB
setbyte 0x20240A6 0xB
goto @text

#org @slot2
setbyte 0x20240FD 0xB
setbyte 0x20240FE 0xB
goto @text

#org @slot3
setbyte 0x2024155 0xB
setbyte 0x2024156 0xB
goto @text

#org @slot4
setbyte 0x20241AD 0xB
setbyte 0x20241AE 0xB
goto @text

#org @text
setword 0x203B200 0x8[Offset of string]
printstring 0x184
waitmessage 0x40
goto 0x82D8A4E


Note: In the official gen VI games, if a Pokemon is already pure water, the animation will still play and the move will afterwards say "But it failed!". However, I felt that this was a bit inconsistent with the rest of the game so I decided not to play the animation if the move fails.

If you want it exactly like the official games, feel free to move attackanimation and waitanimation to above the 17 jumpiftype.

Speaking of the 17 jumpiftypes; that was the only way I could get the game to change Pokemon that are part water to pure water while still having the move fail if the Pokemon is already pure water.

Note 2: This script takes into account the fairy-type assuming you have put it as type 17 as per MrDS. tutorial.
Male
Seen January 10th, 2019
Posted May 4th, 2017
216 posts
6.1 Years
For Emerald:

Credits to KDS for his original script.

Soak:
First insert this string:
Spoiler:
FD 10 00 E8 E6 D5 E2 E7 DA E3 E6 E1 D9 D8 00 FE DD E2 E8 E3 00 E8 DC D9 00 D1 D5 E8 D9 E6 00 E8 ED E4 D9 AB

(it says, "[the target] transformed into the Water type!")

Next, insert this script:
Spoiler:
#org @Soak
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
jumpifsecondarystatus 0x0 0x1000000 0x82D9F1C
jumpiftype 0x0 0x0 @NotWater
jumpiftype 0x0 0x1 @NotWater
jumpiftype 0x0 0x2 @NotWater
jumpiftype 0x0 0x3 @NotWater
jumpiftype 0x0 0x4 @NotWater
jumpiftype 0x0 0x5 @NotWater
jumpiftype 0x0 0x6 @NotWater
jumpiftype 0x0 0x7 @NotWater
jumpiftype 0x0 0x8 @NotWater
jumpiftype 0x0 0x17 @NotWater
jumpiftype 0x0 0xA @NotWater
jumpiftype 0x0 0xC @NotWater
jumpiftype 0x0 0xD @NotWater
jumpiftype 0x0 0xE @NotWater
jumpiftype 0x0 0xF @NotWater
jumpiftype 0x0 0x10 @NotWater
jumpiftype 0x0 0x11 @NotWater
goto 0x82D9F1C

#org @NotWater
attackanimation
waitanimation
jumpifbyte 0x0 0x0202420C 0x0 @slot1
jumpifbyte 0x0 0x0202420C 0x1 @slot2
jumpifbyte 0x0 0x0202420C 0x2 @slot3
jumpifbyte 0x0 0x0202420C 0x3 @slot4

#org @slot1
setbyte 0x20240A5 0xB
setbyte 0x20240A6 0xB
goto @text

#org @slot2
setbyte 0x20240FD 0xB
setbyte 0x20240FE 0xB
goto @text

#org @slot3
setbyte 0x2024155 0xB
setbyte 0x2024156 0xB
goto @text

#org @slot4
setbyte 0x20241AD 0xB
setbyte 0x20241AE 0xB
goto @text

#org @text
setword 0x203B200 0x8[Offset of string]
printstring 0x184
waitmessage 0x40
goto 0x82D8A4E


Note: In the official gen VI games, if a Pokemon is already pure water, the animation will still play and the move will afterwards say "But it failed!". However, I felt that this was a bit inconsistent with the rest of the game so I decided not to play the animation if the move fails.

If you want it exactly like the official games, feel free to move attackanimation and waitanimation to above the 17 jumpiftype.

Speaking of the 17 jumpiftypes; that was the only way I could get the game to change Pokemon that are part water to pure water while still having the move fail if the Pokemon is already pure water.

Note 2: This script takes into account the fairy-type assuming you have put it as type 17 as per MrDS. tutorial.
To improve that, you could call an asm routine like:

Spoiler:

.text
.align 2
.thumb
.thumb_func

Start:
push {lr}
ldr r0, BankTarget
ldr r1, BattleData
mov r2, #0x58
ldrb r0, [r0]
mul r0, r2
add r0, r1
add r0, #0x21
ldrb r1, [r0]         /*Loads the first type into r1*/
ldrb r2, [r0, #1]       /*Loads the second type into r2*/
cmp r1, #0xB        /*compare if water type*/
beq Fail
cmp r2, #0xB        /*idem*/
beq Fail
ldr r0, BattleScript
ldr r1, CurrMove
str r0, [r1]
pop {pc}

.align 2
BattleData: .word 0x02024084
BankTarget: .word 0x0202420B
BattleScript: .word 0x08[AddressBattleScript]
CurrMove: .word 0x02024214
Fail: .word 0x082D9F1C (If I believe you)


I didn't tested but it should work
Male
Singapore
Seen June 26th, 2018
Posted June 18th, 2018
87 posts
5.6 Years
Some more animations for Emerald:
Assurance:
Spoiler:

14 00 17 00 9F 27 00 97 27 28 01 0C 0C 08 03 35 61 0D 08 05 04 08 00 05 00 00 00 00 00 04 06 02 28 FE 57 08 02 02 04 00 03 00 04 04 19 C1 00 3F 02 34 60 59 08 82 04 0A 00 F8 FF 0E 00 03 00 05 03 35 61 0D 08 05 04 08 00 05 00 00 00 01 00 19 86 00 3F 02 58 73 59 08 02 04 00 00 00 00 01 00 02 00 15 17 08

Bug Bite:
Spoiler:


00 97 27 00 9B 27 00 9F 27 00 4A 27 0A 01 0C 0C 08 19 A1 00 3F 02 80 70 59 08 02 06 00 00 E0 FF 00 00 00 00 33 03 0A 00 02 80 70 59 08 02 06 00 00 20 00 04 00 00 00 CD FC 0A 00 04 0A 02 58 73 59 08 03 04 00 00 00 00 01 00 01 00 02 98 5E 59 08 02 05 00 00 00 00 08 00 01 00 00 00 19 7B 00 3F 03 AD 51 0D 08 02 05 01 00 03 00 00 00 05 00 01 00 05 19 83 00 3F 02 1C 6B 59 08 02 06 00 00 00 00 14 00 18 00 0E 00 02 00 02 1C 6B 59 08 02 06 05 00 00 00 EC FF 18 00 0E 00 01 00 02 1C 6B 59 08 02 06 00 00 05 00 14 00 E8 FF 0E 00 02 00 02 1C 6B 59 08 02 06 FB FF 00 00 EC FF E8 FF 0E 00 02 00 02 1C 6B 59 08 02 06 00 00 FB FF 1E 00 12 00 08 00 02 00 02 1C 6B 59 08 02 06 00 00 00 00 1E 00 EE FF 08 00 02 00 02 1C 6B 59 08 02 06 00 00 00 00 E2 FF 12 00 08 00 02 00 02 1C 6B 59 08 02 06 00 00 00 00 E2 FF EE FF 08 00 02 00 03 AD 51 0D 08 02 05 01 00 00 00 03 00 07 00 01 00 05 0B 03 0D 08

Gunk Shot:
Spoiler:

00 A6 27 0A 03 28 01 0C 0C 08 03 AD 51 0D 08 05 05 00 00 00 00 02 00 2E 00 01 00 04 06 03 C9 76 10 08 05 01 64 00 1B 92 00 C0 3F 02 00 0E ZZ YY XX 08 0E ZZ YY XX 08 0E ZZ YY XX 08 03 AD 51 0D 08 05 05 01 00 03 00 00 00 2B 00 01 00 0E ZZ YY XX 08 0E ZZ YY XX 08 0E ZZ YY XX 08 0E ZZ YY XX 08 0E ZZ YY XX 08 0E ZZ YY XX 08 0E ZZ YY XX 08 0E ZZ YY XX 08 05 0B 03 0D 08
At offset XX YY ZZ:
02 ZZ2 YY2 XX2 08 03 04 0A 00 0A 00 00 00 10 00 04 02 02 ZZ2 YY2 XX2 08 03 04 0A 00 0A 00 00 00 10 00 04 02 0F
At offset XX2 YY2 ZZ2:
A6 27 A6 27 CC 49 52 08 64 61 59 08 00 00 00 00 A8 C6 2E 08 ED 75 10 08

Hammer Arm:
Spoiler:

00 9F 27 00 97 27 0A 03 28 01 0C 0C 08 19 87 00 3F 02 ZZ YY XX 08 02 08 F0 FF 00 00 00 00 00 00 0A 00 01 00 03 00 00 00 05 19 8B 00 3F 02 58 73 59 08 03 04 00 00 00 00 01 00 02 00 03 AD 51 0D 08 05 05 01 00 04 00 00 00 06 00 01 00 05 0B 03 0D 0E 31 CB 2C 08 08
At offset XX YY ZZ:
9F 27 9F 27 D4 49 52 08 54 5E 59 08 00 00 00 00 44 5F 59 08 79 D2 10 08

Icicle Crash:
Spoiler:

14 0F 17 00 16 28 00 97 27 0A 01 28 01 0C 0C 08 19 82 00 C0 02 74 6A 59 08 02 06 14 00 F8 FF F8 FF F8 FF 14 00 E0 FF 04 0F 02 74 6A 59 08 02 06 14 00 F8 FF 08 00 08 00 14 00 D8 FF 04 04 19 9F 00 3F 02 58 73 59 08 03 04 F8 FF F8 FF 01 00 02 00 03 D1 52 0D 08 02 05 01 00 03 00 00 00 02 00 01 00 04 09 02 74 6A 59 08 02 06 14 00 F8 FF 00 00 00 00 14 00 E0 FF 04 04 19 9F 00 3F 02 58 73 59 08 03 04 08 00 08 00 01 00 02 00 03 D1 52 0D 08 02 05 01 00 03 00 00 00 02 00 01 00 04 0E 19 9F 00 3F 02 58 73 59 08 03 04 00 00 00 00 01 00 02 00 03 D1 52 0D 08 02 05 01 00 03 00 00 00 02 00 01 00 05 0B 01 0D 05 15 17 08

Magnet Rise (the Splash animation admittedly looks ugly, but I have nothing better that can simulate the up-down movement of the sprite during the animation. If you can come up with something better, by all means post it.):
Spoiler:


00 A3 27 00 C8 27 19 98 00 C0 03 65 60 0D 08 05 05 F9 FF F9 FF 0B 00 00 00 00 00 05 04 1E 03 99 7B 0A 08 05 05 00 00 FF 4F 0C 00 05 00 01 00 04 04 03 65 60 0D 08 05 05 F9 FF F9 FF 0B 00 00 00 00 00 19 D9 00 C0 02 ZZ YY XX 08 02 02 1A 00 00 00 02 ZZ YY XX 08 02 02 1A 00 2A 00 02 ZZ YY XX 08 02 02 1A 00 54 00 02 ZZ YY XX 08 02 02 1A 00 7E 00 02 ZZ YY XX 08 02 02 1A 00 A8 00 02 ZZ YY XX 08 02 02 1A 00 D2 00 04 34 10 07 FF FF 19 AB 00 C0 0E C7 D6 2C 08 04 08 03 39 49 10 08 02 02 00 00 03 00 04 08 1C A7 00 C0 26 03 0E C7 D6 2C 08 04 08 0E C7 D6 2C 08 05 08 11 19 37 2D 08 45 37 2D 08 08 1C 98 00 C0 09 02 03 05 5A 11 08 02 06 02 00 02 00 02 00 00 00 0B 00 1F 00 03 D1 52 0D 08 02 05 00 00 01 00 00 00 20 00 01 00 05 08
At offset XX YY ZZ:
A3 27 A3 27 8C 4A 52 08 C8 21 59 08 00 00 00 00 00 3A 59 08 3D 67 10 08

Miracle Eye:
Spoiler:


0E D1 7C 2D 08 00 CD 27 00 CE 27 00 CF 27 0A 03 19 C4 00 3F 02 7C E0 5C 08 05 04 00 00 00 00 01 00 00 00 02 94 E0 5C 08 05 00 04 28 19 C0 00 3F 03 05 5A 11 08 02 06 01 00 01 00 02 00 00 00 0A 00 00 00 0E 08 F6 2C 08 05 0B 03 0E DD 7C 2D 08 08

Jaizu

Spanish Rom Hacker

Male
Spain
Seen 1 Day Ago
Posted March 7th, 2019
118 posts
9.7 Years
I got the Force Palm working for Emerald. Credits to mamamama for the animation, I just figured out how it works.
Animation
00 C0 27 00 9F 27 00 97 27 0A 03 28 01 0C 0C 08 19 87 00 3F 02 68 5E 59 08 02 08 F0 FF 00 00 00 00 00 00 0A 00 01 00 03 00 00 00 05 19 8B 00 3F 02 AA AA AA 08 03 04 00 00 00 00 01 00 02 00 03 AD 51 0D 08 05 05 01 00 04 00 00 00 06 00 01 00 05 0B 03 0D 08 FF
AA AA AA 08 is the pointer for this:
97 27 C0 27 94 4A 52 08 9C C6 2E 08 00 00 00 00 48 73 59 08 89 63 11 08 FF

Example with the last code in 9DDeC0:
00 C0 27 00 9F 27 00 97 27 0A 03 28 01 0C 0C 08 19 87 00 3F 02 68 5E 59 08 02 08 F0 FF 00 00 00 00 00 00 0A 00 01 00 03 00 00 00 05 19 8B 00 3F 02 C0 DE 9D 08 03 04 00 00 00 00 01 00 02 00 03 AD 51 0D 08 05 05 01 00 04 00 00 00 06 00 01 00 05 0B 03 0D 08 FF

MrDollSteak

Formerly known as 11bayerf1

Age 24
Male
Hong Kong
Seen 4 Weeks Ago
Posted May 15th, 2019
846 posts
10.8 Years
I haven't contributed here in awhile (sad I know) but I'm here to bring an updated Struggle, as well as a Head Smash 1/2 recoil effect.

To make Head Smash work just give it the same move effect as Take Down (NOT Double-Edge), as the check for the move is contained in the 1/4 recoil damage effect.

Struggle and Head Smash

Spoiler:
Fire Red
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global struggleheadsmash

FailSafe:
	ldr r1, .DamageLoc
	add r0, r1, #0x4
	ldrb r0, [r0]
	cmp r0, #0x0
	bge GetMoveID
	add r0, #0x3
GetMoveID:
	push {r0-r1}
	ldr r0, .MoveIndex
	ldrh r0, [r0]
StruggleCheck:
	cmp r0, #0xA5
	bne HeadSmashCheck
StruggleRecoil:
	pop {r0-r1}
	mov r0, #0x58
	ldr r4, .UserBank
	ldrb r4, [r4]
	mul r4, r0
	mov r0, r8
	add r0, r0, r4
	ldrh r0, [r0, #0x2C]
	asr r0, r0, #0x2
	b Return
HeadSmashCheck:
	ldr r1, .HeadSmashIndex
	cmp r0, r1
	bne NormalRecoil
HeadSmashRecoil:
	pop {r0-r1}
	asr r0, r0, #0x1
	b Return
NormalRecoil:
	pop {r0-r1}
	asr r0, r0, #0x2
Return:
	ldr r4, .Return
	bx r4

.align 2
.DamageLoc: .word 0x02023D50
.MoveIndex: .word 0x02023D4A
.UserBank: .word 0x02023D6B
.HeadSmashIndex: .word 0x000001C9
.Return: .word 0x08020AFB

#Insert 00 48 00 47 xx xx xx 08 at 08020AEC
1C9 refers to the move index of Head Smash as taken from Bulbapedia so just replace this with whatever index your Head Smash is.

Emerald
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global struggleheadsmash

FailSafe:
	ldr r1, .DamageLoc
	add r0, r1, #0x4
	ldrb r0, [r0]
	cmp r0, #0x0
	bge GetMoveID
	add r0, #0x3
GetMoveID:
	push {r0-r1}
	ldr r0, .MoveIndex
	ldrh r0, [r0]
StruggleCheck:
	cmp r0, #0xA5
	bne HeadSmashCheck
StruggleRecoil:
	pop {r0-r1}
	mov r0, #0x58
	ldr r4, .UserBank
	ldrb r4, [r4]
	mul r4, r0
	mov r0, r8
	add r0, r0, r4
	ldrh r0, [r0, #0x2C]
	asr r0, r0, #0x2
	b Return
HeadSmashCheck:
	ldr r1, .HeadSmashIndex
	cmp r0, r1
	bne NormalRecoil
HeadSmashRecoil:
	pop {r0-r1}
	asr r0, r0, #0x1
	b Return
NormalRecoil:
	pop {r0-r1}
	asr r0, r0, #0x2
Return:
	ldr r4, .Return
	bx r4

.align 2
.DamageLoc: .word 0x020241F0
.MoveIndex: .word 0x020241EA
.UserBank: .word 0x0202420B
.HeadSmashIndex: .word 0x000001C9
.Return: .word 0x0804939F

#Insert 00 48 00 47 xx xx xx 08 at 08049390
1C9 refers to the move index of Head Smash as taken from Bulbapedia so just replace this with whatever index your Head Smash is.

DizzyEgg

Age 22
Male
Poland
Seen 22 Hours Ago
Posted 3 Weeks Ago
784 posts
5.6 Years
I haven't contributed here in awhile (sad I know) but I'm here to bring an updated Struggle, as well as a Head Smash 1/2 recoil effect.

To make Head Smash work just give it the same move effect as Take Down (NOT Double-Edge), as the check for the move is contained in the 1/4 recoil damage effect.

Struggle and Head Smash

Spoiler:
Fire Red
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global struggleheadsmash

FailSafe:
    ldr r1, .DamageLoc
    add r0, r1, #0x4
    ldrb r0, #0x0
    cmp r0, #0x0
    bge GetMoveID
    add r0, #0x3
GetMoveID:
    push {r0-r1}
    ldr r0, .MoveIndex
    ldrb r0, [r0]
StruggleCheck:
    cmp r0, #0xA5
    bne HeadSmashCheck
StruggleRecoil:
    pop {r0-r1}
    mov r0, #0x58
    ldr r4, .UserBank
    ldrb r4, [r4]
    mul r4, r0
    mov r0, r8
    add r0, r0, r4
    ldrh r0, [r0, #0x2C]
    asr r0, r0, #0x2
    b Return
HeadSmashCheck:
    ldr r1, .HeadSmashIndex
    cmp r0, r1
    bne NormalRecoil
HeadSmashRecoil:
    pop {r0-r1}
    asr r0, r0, #0x1
    b Return
NormalRecoil:
    pop {r0-r1}
    asr r0, r0, #0x2
Return:
    ldr r4, .Return
    bx r4

.align 2
.DamageLoc: .word 0x02023D50
.MoveIndex: .word 0x02023D4A
.UserBank: .word 0x02023D6B
.HeadSmashIndex: .word 0x000001C9
.Return: .word 0x08020AFB

#Insert 00 48 00 47 xx xx xx 08 at 08020AEC
1C9 refers to the move index of Head Smash as taken from Bulbapedia so just replace this with whatever index your Head Smash is.

Emerald
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global struggleheadsmash

FailSafe:
    ldr r1, .DamageLoc
    add r0, r1, #0x4
    ldrb r0, #0x0
    cmp r0, #0x0
    bge GetMoveID
    add r0, #0x3
GetMoveID:
    push {r0-r1}
    ldr r0, .MoveIndex
    ldrb r0, [r0]
StruggleCheck:
    cmp r0, #0xA5
    bne HeadSmashCheck
StruggleRecoil:
    pop {r0-r1}
    mov r0, #0x58
    ldr r4, .UserBank
    ldrb r4, [r4]
    mul r4, r0
    mov r0, r8
    add r0, r0, r4
    ldrh r0, [r0, #0x2C]
    asr r0, r0, #0x2
    b Return
HeadSmashCheck:
    ldr r1, .HeadSmashIndex
    cmp r0, r1
    bne NormalRecoil
HeadSmashRecoil:
    pop {r0-r1}
    asr r0, r0, #0x1
    b Return
NormalRecoil:
    pop {r0-r1}
    asr r0, r0, #0x2
Return:
    ldr r4, .Return
    bx r4

.align 2
.DamageLoc: .word 0x020241F0
.MoveIndex: .word 0x020241EA
.UserBank: .word 0x0202420B
.HeadSmashIndex: .word 0x000001C9
.Return: .word 0x0804939F

#Insert 00 48 00 47 xx xx xx 08 at 08049390
1C9 refers to the move index of Head Smash as taken from Bulbapedia so just replace this with whatever index your Head Smash is.
There's an error at line 10. This expression is wrong: " ldrb r0, #0x0"
Seen 1 Week Ago
Posted 3 Weeks Ago
40 posts
4.6 Years
It's alright, all of us procrastinate to some extent. By the way since you have added a updated animations section, I might as well share my updated Mud Shot animation:
Spoiler:


00 13 28 0A 03 28 01 1C 90 00 C0 07 07 02 ZZ YY XX 08 82 05 00 00 00 00 00 00 00 00 14 00 04 02 02 ZZ YY XX 08 82 05 00 00 00 00 00 00 00 00 14 00 04 02 03 21 66 11 08 0A 05 04 00 01 00 00 00 09 00 B0 01 02 ZZ YY XX 08 82 05 00 00 00 00 00 00 00 00 14 00 04 02 03 D1 52 0D 08 02 05 01 00 02 00 00 00 15 00 01 00 02 ZZ YY XX 08 82 05 00 00 00 00 00 00 00 00 14 00 04 02 02 ZZ YY XX 08 82 05 00 00 00 00 00 00 00 00 14 00 04 02 02 ZZ YY XX 08 82 05 00 00 00 00 00 00 00 00 14 00 04 02 02 ZZ YY XX 08 82 05 00 00 00 00 00 00 00 00 14 00 04 02 02 ZZ YY XX 08 82 05 00 00 00 00 00 00 00 00 14 00 04 02 02 ZZ YY XX 08 82 05 00 00 00 00 00 00 00 00 14 00 04 02 02 ZZ YY XX 08 82 05 00 00 00 00 00 00 00 00 14 00 04 02 02 ZZ YY XX 08 82 05 00 00 00 00 00 00 00 00 14 00 05 03 21 66 11 08 0A 05 04 00 01 00 09 00 00 00 B0 01 05 0B 03 08
At offset XX YY ZZ:
13 28 13 28 D4 49 52 08 B4 6E 59 08 00 00 00 00 EC 6E 59 08 25 32 11 08
You'll also need to insert the custom sprite for it at slot 13 28 in the attack particles table and change the size (the bytes after the image pointer, before the index) to 00 0A.

Noob here, how did you get that background for the battle scene? It looks very nice. Any link to where/how I can do the same?

DizzyEgg

Age 22
Male
Poland
Seen 22 Hours Ago
Posted 3 Weeks Ago
784 posts
5.6 Years
Not sure if it is the right place to ask, but. Does anybody knows why the move "trick" doesn't work when used by the opponent in the games? Or why "thief" doesn't actually steals your item? Is it possible to fix that?
Age 18
Female
Seen 4 Days Ago
Posted February 5th, 2019
126 posts
5.3 Years
Not sure if it is the right place to ask, but. Does anybody knows why the move "trick" doesn't work when used by the opponent in the games? Or why "thief" doesn't actually steals your item? Is it possible to fix that?
That's intentional because the game designers didn't want opponents to actually take your items permanently, and they didn't think to restore the item after the battle. There isn't really any way to fix this (I think) because it was programmed into the Thief/Trick effects.

DizzyEgg

Age 22
Male
Poland
Seen 22 Hours Ago
Posted 3 Weeks Ago
784 posts
5.6 Years
Heavy Slam for Fire Red. The script is simple as for Doesnt's ASMs. Use the callasm command just after the pp reducer and before damagecalculator in the script:

The ASM:
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global heavyslam

main:
push {lr}
ldr r0, userBank
ldrb r0, [r0]
ldr r1, battleData
mov r2, #0x58
mul r0, r2
add r3, r0, r1
ldr r0, targetBank
ldrb r0, [r0]
mul r0, r2
add r4, r0, r1
ldrb r5, [r3, #0x0]
ldrb r6, [r4, #0x0]
ldr r1, dexData
mov r2, #0x24
mul r5, r2
add r0, r1, r5
ldrh r5, [r0, #0xE]
mul r6, r2
add r0, r1, r6
ldrh r6, [r0, #0xE]

label1:
ldr r1, floatstoneindex
mov r7, r3
add r7, #0x20
ldrb r7, [r7]
cmp r7, #0xXX
bne label2
lsr r5, #0x1

label2:
cmp r7, #0xYY
bne label3
lsl r5, #0x1

label3:
ldrh r7, [r3, #0x2e]
cmp r7, r1
bne label4
lsr r5, #0x1


label4:
mov r7, r4
add r7, #0x20
ldrb r7, [r7]
cmp r7, #0xXX
bne label5
lsr r6, #0x1

label5:
cmp r7, #0xYY
bne label6
lsl r6, #0x1

label6:
ldrh r7, [r4, #0x2e]
cmp r7, r1
bne label7
lsr r5, #0x1

label7:
mov r2, #0x5
mul r2, r6
cmp r5, r2
bgt set120
sub r2, r6
cmp r5, r2
bgt set100
sub r2, r6
cmp r5, r2
bgt set80
sub r2, r6
cmp r5, r2
bgt set60
mov r1, #0x28
b end

set60:
mov r1, #0x3C
b end

set80:
mov r1, #0x50
b end

set100:
mov r1, #0x64
b end

set120:
mov r1, #0x78

end:
ldr r2, basePower
strh r1, [r2, #0x0]
pop {r0}
bx r0

.align 2
floatstoneindex: .hword 0xZZZZ
targetBank: .word 0x02023D6C
userBank: .word 0x02023D6B
battleData: .word 0x02023BE4
basePower: .word 0x02023F50
dexData: .word 0x0844E850
NOTES
1. The bold section of the code is meant to accommodate the weight changes due to Light Metal, Heavy Metal abilities and the item Float Stone because the Weight is directly loaded from the Dex Data in the ROM (even lowkick does).

2. If your ROM don't have anyone of these things remove the bolded section. Otherwise, replace XX with the index of Light Metal, replace YY with the index of Heavy Metal, and replace ZZZZ with the index of Float Stone.

3. If you have expanded the no of pokemons then the value of dexData also needs to be changed to the new location.

4. If someone wants to port it to Emerald, in addition to changing the value of offsets also change the mov r2, #0x24 to mov r2, #0x20 after the ldr r1, dexData, this because in every GBA Rom except Emerald the dex entry for each poke takes 36 bytes, whereas in Emerald it takes 32 bytes.
I have a problem with this routine, it always sets the move power to 120 no matter the weight. I removed all bolded lines and changed the value of dexData.

DizzyEgg

Age 22
Male
Poland
Seen 22 Hours Ago
Posted 3 Weeks Ago
784 posts
5.6 Years
There is some bug in this routine. The emerald one is accurate. Port the emerald one back to FR.
Hm. You're right. Could you tell me what's the location of dexMapper in FR? I have troubles finding it myself
Advertiser Content