Advertiser Content

Development Move Resource Thread Page 12

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

DizzyEgg

Age 22
Male
Poland
Seen 1 Day Ago
Posted 1 Week Ago
789 posts
5.8 Years
Compare the Pokemon expansion tutorial for FR and Emerald. You will be able to find it.
Found it.

Some new effects:
3. Final Gambit:
Spoiler:

Script:
#org @main
attackcanceler
accuracycheck 0x81D695E 0x0
attackstring
ppreduce
cmd6
bicbyte 0x2023DCC 0x6
callasm 0x08750051
cmd69
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
faintpokemon 0x0 0x0 0x8000000
jumpifbyte 0x0 0x02023DCC 0x8 0x81D694E
setuserhptozero
graphicalhpupdate 0x1
datahpupdate 0x1
faintpokemon 0x1 0x0 0x8000000
goto 0x81D694E
ASM at 0x8750050:
.text
.align 2
.thumb
.thumb_func
.global finalgambit

main:
push {lr}
ldr r0, userBank
ldrb r0, [r0]
ldr r1, battleData
mov r2, #0x58
mul r0, r2
add r2, r0, r1
add r2, #0x28
ldrb r0, [r2]
ldr r2, damage
strb r0, [r2]
pop {r0}
bx r0

.align 2
userBank: .word 0x02023D6C
battleData: .word 0x02023BE4
damage: .word 0x02023D50
You made a typo there. Instead of userBank(...6B) you gave the offset for targetbank(...6C). And that means this move will always deal damage equal to target's current HP.

DizzyEgg

Age 22
Male
Poland
Seen 1 Day Ago
Posted 1 Week Ago
789 posts
5.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
    ldrb r0, [r0] /tht
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
    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.
Fire Red routine, line 17(emerald one too). Please change ldrb to ldrh because now it won't work if Head Smash's index is higher than 0xFF.

Exodrake

The Manliest Chick that Ever Manlied

Age 26
Female
Seen November 30th, 2016
Posted July 24th, 2016
164 posts
6.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, [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.
Light of Ruin also has the 50% recoil effect, and alas I don't know how to modify this code to affix the effect to multiple moves instead of just one. This should be addressed.

I'M A WITCH THAT'S HOW

Xencleamas

Suddenly lurking in the shadows...

Male
Asgard
Seen January 21st, 2019
Posted August 7th, 2018
460 posts
5.8 Years

Attack Order, Defend Order, and Heal Order




Alright! Since I've gotten into move animations nowadays, I've come up Vespiquen's signature moves: Attack Order, Defend Order, and Heal Order. They are all animations by the way. Their effects will be explained later.

But first, here's the particle to be used in those moves:


I used Twister's sheet to redraw the bees which I got its original particle from DPPt. Wherever you have inserted the particle, take note of its index number.

Attack Order:
Spoiler:
FireRed:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 E5 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 02 08 7C 3E 08 83 04 E0 FF F0 FF 01 00 03 00 19 84 00 3F 03 D1 8C 09 08 02 05 01 00 03 00 00 00 0C 00 01 00 03 D1 8C 09 08 02 05 03 00 03 00 00 00 0C 00 01 00 04 04 02 50 7C 3E 08 83 02 01 00 03 00 19 84 00 3F 04 04 02 50 7C 3E 08 83 02 01 00 03 00 19 84 00 3F 04 04 02 08 7C 3E 08 83 04 20 00 14 00 01 00 03 00 19 84 00 3F 05 0B 03 0D 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 D0 C9 3A 08 00 2C 3E 08 00 00 00 00 FC 1C 23 08 11 2D 0A 08

Emerald:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 EC 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 02 58 73 59 08 83 04 E0 FF F0 FF 01 00 03 00 19 8B 00 3F 03 85 54 0D 08 02 05 01 00 03 00 00 00 0C 00 01 00 03 85 54 0D 08 02 05 03 00 03 00 00 00 0C 00 01 00 04 04 02 A0 73 59 08 83 02 01 00 03 00 19 8B 00 3F 04 04 02 A0 73 59 08 83 02 01 00 03 00 19 8B 00 3F 04 04 02 58 73 59 08 83 04 20 00 14 00 01 00 03 00 19 8B 00 3F 05 0B 03 0D 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 0C 49 52 08 88 23 59 08 00 00 00 00 A8 C6 2E 08 69 F2 0F 08



Defend Order:
Spoiler:
FireRed:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 E5 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 00 C8 27 05 0B 02 0D 04 01 0E 27 B2 1C 08 05 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 D0 C9 3A 08 00 2C 3E 08 00 00 00 00 FC 1C 23 08 11 2D 0A 08

Emerald:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 EC 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 00 C8 27 05 0B 02 0D 04 01 0E 87 D6 2C 08 05 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 0C 49 52 08 88 23 59 08 00 00 00 00 A8 C6 2E 08 69 F2 0F 08



Heal Order:
Spoiler:
FireRed:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 E5 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 00 2F 27 05 0B 02 0D 04 01 0E C9 56 1D 08 05 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 D0 C9 3A 08 00 2C 3E 08 00 00 00 00 FC 1C 23 08 11 2D 0A 08

Emerald:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 EC 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 00 2F 27 05 0B 02 0D 04 01 0E DF 79 2D 08 05 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 0C 49 52 08 88 23 59 08 00 00 00 00 A8 C6 2E 08 69 F2 0F 08



Overall, they are created from Twister's animation. I'd plan on Recover but misdirection of the bees on the particles might occur. Anyway, these are the best ones. Attack Order is plainly Twister's animation. Defend Order is combined Twister's animation with Endure's animation. Heal Order is combined Twister's animation with the healing animation. Use Slash's effect for Attack Order's effect. Use Cosmic Power's effect for Defend Order. And, use Recover's effect for Healing Order. Tada! You now have the three Order moves!

I will come up with Ruby soon since the one I've downloaded isn't organized.

Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)
Male
California
Seen September 28th, 2015
Posted September 4th, 2015
16 posts
5.1 Years

Attack Order, Defend Order, and Heal Order


Alright! Since I've gotten into move animations nowadays, I've come up Vespiquen's signature moves: Attack Order, Defend Order, and Heal Order. They are all animations by the way. Their effects will be explained later.
Really good looking animations for one of my all time favorite pokes! Great work
Though I'm far from a pro, I try can help you on your ROM with scripting, ASM, mapping WHATEVER.

Just ask

Spherical Ice

Age 21
Bristol, UK
Seen 7 Hours Ago
Posted September 24th, 2019
5,254 posts
12 Years
Apologies for leaving this un-updated for so long! It should now be up-to-date with the thread, and I promise I'll be better with keeping it updated, haha. Notify me if I've added something incorrectly!
Male
Seen January 10th, 2019
Posted May 4th, 2017
216 posts
6.3 Years
Spoiler:
I've worked out how to have the Gen IV Roost effect in Emerald. This is how it is achieved:
1. First, in the battle script for Recover, it checks if the move ID is Roost (by having Recover's script, the AI can use Roost properly). If the move ID is Roost, then it branches to a near identical script that also calls a custom routine
2. The custom routine checks if the attacking Pokémon has Flying type in either of its slots and then changes it to the ??? type (0x9). If it's a pure Flying type, then it will become a pure ??? type.
3. Another custom routine is run at the end of every turn that checks for any ???-type Pokémon, and changes it back to Flying.

Here's how to implement it:
1. First, you need Jambo51's callasm routine for Battle Script Pro. It is found right here. Despite Jambo writing the routine for FireRed, it works for Emerald too. However, you need to change the "scriptlocation" offset to 0x02024214. Also this is very important, but unlike FireRed, your new command is not going to be 0xF8! Your new command will be 0xF9. It appears that Emerald has an extra battle command, most likely due to the Battle Frontier.

2. Now to get BSP to recognize our new command, open up the folder where BSP is located, and then there should be another folder called "Data". Then you should see a file called, "commands.bsh". Open it up with Notepad, and put this in:

This might be confusing, but DO NOT change anything in the quotation marks! That's just there to show minor info in BSP's command list. I repeat, DO NOT CHANGE A SINGLE THING IN THAT QUOTE!!! Also note that if you were using FireRed, your command would be 0xF8, not 0xF9.

3. Now, put in this routine somewhere:
.text
.align 2
.thumb
.thumb_func

/*What this routine does is check if the attacking PKMN
is Flying-type. It then changes its Flying-type to
the ???-type.*/

GetPkmnType1:
push {r0-r5}
ldr r1, .BattleData
ldr r0, .CurPokeIndex
ldrb r0, [r0]
mov r2, #0x58
mul r2, r0
add r1, #0x21
add r1, r2
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
mov r3, #0x2
cmp r0, r3
beq ChangeType1
cmp r2, r3
beq ChangeType2
b End

ChangeType1:
mov r4, #0x9
strb r4, [r1]
cmp r2, r3
beq ChangeType2
b End

ChangeType2:
mov r4, #0x9
strb r4, [r1, #0x1]
b End

End:
pop {r0-r5}
bx lr

.align 2
.BattleData:        .word 0x02024084
.CurPokeIndex:        .word 0x0202420B
4. Now open up BSP, and open up Recover's battle script. Replace it with this:

A couple things to note: At the top, we have "jumpifhalfword 0x0 0x20241EA 0x163 @RoostHandle".
Replace 0x163 with your move ID for Roost.

Towards the bottom, at "#org @changetype", you see "callasm 0x(offset of your routine +1)". Obviously, put in the offset of the routine we added earlier, but add 0x1 to the offset.

So far, we have made it so that every time a Flying-type Pokémon uses Roost, it will turn into a ???-type. (If it was part-Flying, it would become part-???, and if it was pure-Flying, it would become pure-???).

5. Now we're going to insert another routine. This second routine will be called at the end of every turn and simply checks to see if there are any ???-type Pokémon, and then changes them back to Flying types.
.text
.align 2
.thumb
.thumb_func

HandlePoke1:
push {r0-r5}
mov r3, #0x9
ldr r1, .Poke1Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke1ChangeType1
cmp r2, r3
beq Poke1ChangeType2
b HandlePoke2

Poke1ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke1ChangeType2
b HandlePoke2

Poke1ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b HandlePoke2

HandlePoke2:
ldr r1, .Poke2Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke2ChangeType1
cmp r2, r3
beq Poke2ChangeType2
b HandlePoke3

Poke2ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke2ChangeType2
b HandlePoke3

Poke2ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b HandlePoke3

HandlePoke3:
ldr r1, .Poke3Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke3ChangeType1
cmp r2, r3
beq Poke3ChangeType2
b HandlePoke4

Poke3ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke3ChangeType2
b HandlePoke4

Poke3ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b HandlePoke4

HandlePoke4:
ldr r1, .Poke4Type
ldrb r0, [r1]
ldrb r2, [r1, #0x1]
cmp r0, r3
beq Poke4ChangeType1
cmp r2, r3
beq Poke4ChangeType2
b End

Poke4ChangeType1:
mov r4, #0x2
strb r4, [r1]
cmp r2, r3
beq Poke4ChangeType2
b End

Poke4ChangeType2:
mov r4, #0x2
strb r4, [r1, #0x1]
b End

End:
pop {r0-r5}
ldr r0, .ReturnAddress
bx r0


.align 2
.Poke1Type: .word 0x020240A5
.Poke2Type: .word 0x020240FD
.Poke3Type: .word 0x02024155
.Poke4Type: .word 0x020241AD
.ReturnAddress:	.word 0x080405B1
6. At 0x402A0, change the bytes there to point to where you inserted the second routine (the one right above). DO NOT ADD +1 TO THE OFFSET. I REPEAT, DO NOT ADD +1. This is because the code that is executed before this appears to already account for that.

And now we have a fully working Roost with Generation IV's effect, and the AI can use it properly too, since we're using Recover's battle script slot, but the battle script is designed so that Recover will still function separately from Roost.

A couple things to note, this routine replicates the Generation IV effect of Roost where if the user was pure-Flying, it would become ??? type upon using Roost. In Generation V+, a pure-Flying type using Roost would become Normal-type.. If anyone wants to mod my routine to have the Generation V effect, feel free to do so.

Credits:
Chaos Rush
DoesntKnowHowToPlay - for the idea of the method to achieve this
Shiny Quagsire - for suggesting to me that Emerald might have more battle commands than FireRed due to the Battle Frontier
Tchlatli - I looked at his custom Protean code to figure out how to correctly calculate the type offset of the attacking Pokémon
JPAN - his documentation on FireRed battle-related RAM offsets helped me find the Emerald offsets

To verify that it's working properly, here are some useful RAM offsets:
02024084 - Battle Data (check out this post to see how its structured.)

020240A5 - Your(1) Type 1
020240A6 - Your(1) Type 2

020240FD - Opponent(1) Type 1
020240FE - Opponent(1) Type 2

02024155 - Your(2) Type 1
02024156 - Your(2) Type 2

020241AD - Opponent(2) Type 1
020241AE - Opponent(2) Type 2
Something has to be changed here. The second routine to revert ???-type to flying doesn't handle the fact that a ???-type could exist outside of the roost effect.
Indeed it prevent us to use the 9th type or to update roost to gen V effect. (flying types become normal upon using roost, as Chaos Rush stated).

To correct this, we can check 0x02024260 (In emerald, don't know for FR) the moves used by the poke. an Half word is used for each attack used the precedent turn.
First half word for the first banked pokemon, second HW for 2nd poke, etc

I'm too lazy right know to update this, so I'll do it later, I just wanted to point that flaw

Exodrake

The Manliest Chick that Ever Manlied

Age 26
Female
Seen November 30th, 2016
Posted July 24th, 2016
164 posts
6.6 Years
Something has to be changed here. The second routine to revert ???-type to flying doesn't handle the fact that a ???-type could exist outside of the roost effect.
Indeed it prevent us to use the 9th type or to update roost to gen V effect. (flying types become normal upon using roost, as Chaos Rush stated).

To correct this, we can check 0x02024260 (In emerald, don't know for FR) the moves used by the poke. an Half word is used for each attack used the precedent turn.
First half word for the first banked pokemon, second HW for 2nd poke, etc

I'm too lazy right know to update this, so I'll do it later, I just wanted to point that flaw
This is a problem I have (using MrDollSteak's rombase). I want to have ???-type monsters, but because of this routine, they turn into Flying-types.

I'M A WITCH THAT'S HOW
Seen January 10th, 2017
Posted April 21st, 2016
180 posts
5.8 Years
Something has to be changed here. The second routine to revert ???-type to flying doesn't handle the fact that a ???-type could exist outside of the roost effect.
Indeed it prevent us to use the 9th type or to update roost to gen V effect. (flying types become normal upon using roost, as Chaos Rush stated).

To correct this, we can check 0x02024260 (In emerald, don't know for FR) the moves used by the poke. an Half word is used for each attack used the precedent turn.
First half word for the first banked pokemon, second HW for 2nd poke, etc

I'm too lazy right know to update this, so I'll do it later, I just wanted to point that flaw
I've just changed it to type #14, which is one of the contest types. It does not make it consistent with Gen V in which the Pokemon turns into Normal type, but it does make the ??? usable for anyone who wants to use it.

MrDollSteak

Formerly known as 11bayerf1

Age 24
Male
Hong Kong
Seen 17 Hours Ago
Posted 17 Hours Ago
848 posts
11 Years
This is a problem I have (using MrDollSteak's rombase). I want to have ???-type monsters, but because of this routine, they turn into Flying-types.
What's the point of having ???- type monsters when you can extend types so easily?
Male
Seen January 10th, 2019
Posted May 4th, 2017
216 posts
6.3 Years
I've just changed it to type #14, which is one of the contest types. It does not make it consistent with Gen V in which the Pokemon turns into Normal type, but it does make the ??? usable for anyone who wants to use it.
Doing this will save me time. We just have to edit the type chart to make the contest/whatever type having the same resistance than the normal type

Exodrake

The Manliest Chick that Ever Manlied

Age 26
Female
Seen November 30th, 2016
Posted July 24th, 2016
164 posts
6.6 Years
What's the point of having ???- type monsters when you can extend types so easily?
Yeah this is true, stupid me for not thinking of this before XD Thanks for that d'oh moment, I'll just program a second ??? type which isn't affected by the routine so scumbag mons with fully unresisted STAB and no weaknesses can be a thing!

I'M A WITCH THAT'S HOW

Tervaxx

Male
Barcelona
Seen August 23rd, 2019
Posted October 20th, 2015
11 posts
4.5 Years
Hi everyone ^^, this is a discovering I made a few days ago, and I'm here to share it with you. This is about how to create Defensive Moves' Effects that raise/lower 2 or more stats. This is only for Ruby, as the effect's codes are different for other Pokemon editions.

Before starting, if you don't know how to add Moves or Effects, you shoud take a look into those 2 tutorials:

[Tutorial] [Ruby] Adding New Moves by destinedjagold
[Tutorial] Adding New Moves and Creating New Move Effects by itman

Let's see. We want to create a Work Up effect, a move that raises in 1 the user's Attack and Special Attack stats. There are only 4 moves that raise 2 stats (as far as I know). They're the following ones: Bulk Up (Attack + Defense), Cosmic Power (Defense + Sp. Defense), Calm Mind (Sp. Attack + Sp. Defense) and Dragon Dance (Attack + Speed).

For example, this is the Bulk Up effect on Ruby:

00 02 03 20 01 03 01 0C 18 8B 1D 08 20 01 00 02 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 06 00 2E 1E 60 01 02 11 89 41 43 8B 1D 08 29 00 23 4D 02 02 02 43 8B 1D 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 12 89 41 62 8B 1D 08 29 00 23 4D 02 02 02 62 8B 1D 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08
I wrote as GG (effects' bytes), XX, YY, ZZ (pointers) and ?? (effects' color byte) the things that need to be changed:

00 02 03 20 01 03 GG 0C XX XX XX 08 20 01 00 GG 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 ?? 00 2E 1E 60 01 02 GG 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 GG 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08
Anything else that isn't changed is in common with other moves of that kind.

I've done a list about those defensive effects on Ruby (they're on hexadecimal):
Spoiler:
Raises User's Attack = 11
Raises User's Defense = 12
Raises User's Speed = 13
Raises User's Sp. Attack = 14
Raises User's Sp. Defense = 15
Raises User's Accuracy = 16
Raises User's Evasion = 17
Sharply Raises User's Attack = 21
Sharply Raises User's Defense = 22
Sharply Raises User's Speed = 23
Sharply Raises User's Sp. Attack = 24
Sharply Raises User's Sp. Defense = 25
Sharply Raises User's Accuracy = 26
Sharply Raises User's Evasion = 27
Lowers Foe's Attack = 91
Lowers Foe's Defense = 92
Lowers Foe's Speed = 93
Lowers Foe's Sp. Attack = 94
Lowers Foe's Sp. Defense = 95
Lowers Foe's Accuracy = 96
Lowers Foe's Evasion = 97
Sharply Lowers Foe's Attack = A1
Sharply Lowers Foe's Defense = A2
Sharply Lowers Foe's Speed = A3
Sharply Lowers Foe's Sp. Attack = A4
Sharply Lowers Foe's Sp. Defense = A5
Sharply Lowers Foe's Accuracy = A6
Sharply Lowers Foe's Evasion = A7


The 2 first GG, I don't know why, but they start with 0 and end with the last number of the effect. The first GG is 01 (starts with 0 and ends with 1, that would be the last number of 11, the effect that raises user's Attack), and the second one, 02 (Defense). The third and fourth GG are the effects (11 and 12 respectively). We only need to change those values, being the first GG 01, the second one 04, the third one 11 and the fourth one 14, so it seems more a Work Up effect. It would look like this:

00 02 03 20 01 03 01 0C XX XX XX 08 20 01 00 04 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 ?? 00 2E 1E 60 01 02 11 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 14 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08
The first pointer (XX) leads to the start of the following bytes: 09 0A 2E DC. That means, in the Bulk Up effect, the pointer 18 8B 1D 08 leads to the Offset 1D8B18, that's where the bytes 09 0A 2E DC start. For example, my XX XX XX have the following pointer: 53 F4 6F 08, and this leads to the bytes 09 0A 2E DC located at the Offset 6FF453. You have to do the same, depending on where you did insert the effect, because the pointers are different for everyone unless you insert them on the same spots I did.

The next pointers (YY) are the same, but they lead to the bytes 2E 1E 60 01 02 14 89. That's the second effect (the one that raises Sp. Attack), not the first one (Attack)! In Bulk Up the pointer is 43 8B 1D 08, that leads to 1D8B43, that's where the bytes 2E 1E 60 01 02 12 89 are, and that would be the effect that raises Defense! My pointers are 7E F4 6F 08.

Finally, ZZ. Those lead to the bytes 28 62 6F 1D 08, the last 5 bytes of the effect. Bulk Up has 62 8B 1D 08 as the pointer. In my Work Up effect, it would be 9D F4 6F 08.

The ?? byte is the one that changes the color's effect. In Bulk Up that value is 06. It does that when it only raises Attack, it's red, when it only raises Defense, it's green, and when it raises both, it's gray. I don't know what value it should have for a perfect Work Up effect, but I use 09. That one makes all the colors to be gray, no matter what it raises.

This one is my Work Up effect:

00 02 03 20 01 03 01 0C 53 F4 6F 08 20 01 00 04 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 09 00 2E 1E 60 01 02 11 89 41 7E F4 6F 08 29 00 23 4D 02 02 02 7E F4 6F 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 14 89 41 9D F4 6F 08 29 00 23 4D 02 02 02 9D F4 6F 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08
You only have to change the things I mentioned, put that effect to a move with PGE or G3T (I use G3T) and check it in a battle.


And if we want to do an effect that raises more than 2 stats like Quiver Dance or Coil? That's easy. I'll keep explaining with Calm Mind's effect, which raises Sp. Attack and Sp. Defense stats, and we'll do a Quiver Dance effect, which does the same but also raises Speed by 1.

This is Calm Mind's effect in Ruby:

00 02 03 20 01 03 04 0C 7C 8B 1D 08 20 01 00 05 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 30 00 2E 1E 60 01 02 14 89 41 A7 8B 1D 08 29 00 23 4D 02 02 02 A7 8B 1D 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 15 89 41 C6 8B 1D 08 29 00 23 4D 02 02 02 C6 8B 1D 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08
I will mark the pointers again:

00 02 03 20 01 03 GG 0C XX XX XX 08 20 01 00 GG 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 30 00 2E 1E 60 01 02 GG 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 GG 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08
To add an extra effect, copy this and paste it at the end of the 08 and before the 20: 20 01 03 GG 0C XX XX XX 08. It would look like this:

00 02 03 20 01 03 GG 0C XX XX XX 08 20 01 03 GG 0C XX XX XX 08 20 01 00 GG 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 30 00 2E 1E 60 01 02 GG 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 GG 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08
You have to copy this too, and paste it before the second efect starts: 2E 1E 60 01 02 GG 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00. I've changed the YY YY YY to SS SS SS, because the pointers will be different. It will look like this:

00 02 03 20 01 03 GG 0C XX XX XX 08 20 01 03 GG 0C XX XX XX 08 20 01 00 GG 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 30 00 2E 1E 60 01 02 GG 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 GG 89 41 SS SS SS 08 29 00 23 4D 02 02 02 SS SS SS 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 GG 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08
Now the code has 3 effects, we only have to change the values to get the Quiver Dance effect. We change the first 3 GG for 04, 05 y 03, and the last 3 GG for 14, 15 y 13, so it raises Sp. Attack, Sp. Defense and Speed. Then, the pointers. The XX keeps leading to 09 0A 2E DC, but YY now leads to the 2E 1E 60 before the SS, the SS leads to the 2E 1E 60 before the ZZ, and the ZZ keeps leading to 28 62 6F 1D 08.

That's my Quiver Dance effect:

00 02 03 20 01 03 04 0C 8F F6 6F 08 20 01 03 05 0C 8F F6 6F 08 20 01 00 03 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 09 00 2E 1E 60 01 02 14 89 41 BA F6 6F 08 29 00 23 4D 02 02 02 BA F6 6F 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 15 89 41 D9 F6 6F 08 29 00 23 4D 02 02 02 D9 F6 6F 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 13 89 41 F8 F6 6F 08 29 00 23 4D 02 02 02 F8 F6 6F 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08
Same as before, you put that effect to a move and check it in battle. Now I'll leave here some moves I've done by myself, you only need to put your pointers in the marks, so you can do your own Defensive moves ^^. Keep in mind that my ?? byte will always be 09, unless I know how to change it.

Spoiler:
-Work Up
00 02 03 20 01 03 01 0C XX XX XX 08 20 01 00 04 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 09 00 2E 1E 60 01 02 11 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 14 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08

-Coil
00 02 03 20 01 03 01 0C XX XX XX 08 20 01 03 02 0C XX XX XX 08 20 01 00 06 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 09 00 2E 1E 60 01 02 11 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 12 89 41 SS SS SS 08 29 00 23 4D 02 02 02 SS SS SS 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 16 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08

-Quiver Dance
00 02 03 20 01 03 04 0C XX XX XX 08 20 01 03 05 0C XX XX XX 08 20 01 00 03 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 09 00 2E 1E 60 01 02 14 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 15 89 41 SS SS SS 08 29 00 23 4D 02 02 02 SS SS SS 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 13 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08

-Hone Claws
00 02 03 20 01 03 01 0C XX XX XX 08 20 01 00 06 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 09 00 2E 1E 60 01 02 11 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 16 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08

-Tail Glow > First raises 2 levels the Sp. Attack, and then raises 1 level the Sp. Attack.
00 02 03 20 01 03 04 0C XX XX XX 08 20 01 00 04 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 09 00 2E 1E 60 01 02 24 89 41 3F F8 6F 08 29 00 23 4D 02 02 02 3F F8 6F 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 14 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08

-Cotton Guard > First raises 2 levels the Defense, and then raises 1 level the Defense.
00 02 03 20 01 03 02 0C XX XX XX 08 20 01 00 02 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 09 00 2E 1E 60 01 02 22 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 12 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08


Below there's a list of effects I've done too, but they don't work completely well. I'll tell the problems they have. I haven't realized how to fix them yet... Stockpile has the same color effect as Cosmic Power (Charge also does, but that one's not correct as it only raises Sp. Defense, not Defense). Shell Smash has 5 effects, so I've put its pointers as XX, YY, SS, MM, LL and ZZ.
Spoiler:
-Stockpile > [It's able to raise Defense and Sp. Defens up to 6 levels, and when energy is released, they don't disappear. It wastes 2 PP. It shows the animation 2 times]
00 02 03 85 09 0A 13 5E 15 40 08 12 40 00 00 02 03 20 01 03 02 0C XX XX XX 08 20 01 00 05 0C CB 8B 1D 08 00 00 2E DC 60 01 02 00 48 01 24 00 2E 1E 60 01 02 12 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 15 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08

-Charge > [It wastes 2 PP. When Sp. Defense is at its maximum level, it shows the color's effect, but the message doesn't show up]
00 02 03 CB 09 0A 10 A5 00 12 40 00 00 02 03 20 01 03 02 0C XX XX XX 08 20 01 00 05 0C CB 8B 1D 08 00 00 2E DC 60 01 02 00 48 01 24 00 2E 1E 60 01 02 15 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08

-Growth > [It doesn't raise 2 levels the Attack and the Sp. Attack when Sunny Day is on. It works like Work Up]
00 02 03 20 01 03 01 0C XX XX XX 08 20 01 00 04 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 09 00 2E 1E 60 01 02 11 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 14 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08

-Geomancy > [It works like Quiver Dance, raises 1 level Sp. Attack, Sp. Defense and Speed in one turn]
00 02 03 20 01 03 04 0C XX XX XX 08 20 01 03 05 0C XX XX XX 08 20 01 00 03 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 09 00 2E 1E 60 01 02 14 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 15 89 41 SS SS SS 08 29 00 23 4D 02 02 02 SS SS SS 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 13 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08

-Shell Smash > [Pokemon with Clear Body don't get their Defenses lowered]
00 02 03 20 01 03 01 0C XX XX XX 08 20 01 03 04 0C XX XX XX 08 20 01 03 03 0C XX XX XX 08 20 01 03 02 0C XX XX XX 08 20 01 00 05 0C CB 8B 1D 08 09 0A 2E DC 60 01 02 00 48 01 09 00 2E 1E 60 01 02 21 89 41 YY YY YY 08 29 00 23 4D 02 02 02 YY YY YY 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 24 89 41 SS SS SS 08 29 00 23 4D 02 02 02 SS SS SS 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 23 89 41 MM MM MM 08 29 00 23 4D 02 02 02 MM MM MM 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 92 89 41 LL LL LL 08 29 00 23 4D 02 02 02 LL LL LL 08 13 70 15 40 08 12 40 00 2E 1E 60 01 02 95 89 41 ZZ ZZ ZZ 08 29 00 23 4D 02 02 02 ZZ ZZ ZZ 08 13 70 15 40 08 12 40 00 28 62 6F 1D 08


That's all, probably you'll have a lot of doubts because I'm not that good explaining things xD. It seems complicated, but it isn't. You can leave here your doubts and I'll try to answer them.

C me

Creator of Pokemon League Of Legends

Age 22
Male
Seen February 2nd, 2019
Posted September 9th, 2018
683 posts
5.9 Years
I've noticed Dragon Tail has an effect for FireRed and Ruby but not for Emerald, so I ported one.

Emerald Dragon Tail effect

Spoiler:

#org 0xXXXXXX
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
forcerandomswitch 0x8YYYYYY

#org 0x2D8A5E
attackstring
pause 0x20
missmessage
resultmessage
waitmessage 0x40
goto 0x82D8A4E

#org 0x2D8A4E
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

#org 0xYYYYYY
pause 0x20
orbyte 0x202427C 0x20
resultmessage
waitmessage 0x40
goto 0x82D8A4E

#org 0x2D8A4E
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end


Only bugs are that it says 'But it failed' if you use it against a trainer with one Pokemon (or 2 for a double battle) but it still does damage. It says nothing if used on a wild, just does damage and ends the battle.
Check out my hack: Pokemon League of Legends.
Join the subreddit: https://www.reddit.com/r/PokemonLoL/
If you would like to give me money for no reason you can do so here

Xencleamas

Suddenly lurking in the shadows...

Male
Asgard
Seen January 21st, 2019
Posted August 7th, 2018
460 posts
5.8 Years
I've noticed Dragon Tail has an effect for FireRed and Ruby but not for Emerald, so I ported one.

Emerald Dragon Tail effect

Spoiler:

#org @start
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
forcerandomswitch @snippet1

#org @snippet1
pause 0x20
orbyte 0x202427C 0x20
resultmessage
waitmessage 0x40
goto 0x82D8A4E


Only bugs are that it says 'But it failed' if you use it against a trainer with one Pokemon (or 2 for a double battle) but it still does damage. It says nothing if used on a wild, just does damage and ends the battle.
Why don't you just use "@stuff", something like those in common scripting if you know what I mean. The changes are bolded. I also remove some lines because they already exist in the ROM.

Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)

~SAGE

Peruvian Rom Hacker

Age 24
Male
Italia
Seen March 18th, 2019
Posted March 16th, 2019
39 posts
5.4 Years

Attack Order, Defend Order, and Heal Order




Alright! Since I've gotten into move animations nowadays, I've come up Vespiquen's signature moves: Attack Order, Defend Order, and Heal Order. They are all animations by the way. Their effects will be explained later.

But first, here's the particle to be used in those moves:


I used Twister's sheet to redraw the bees which I got its original particle from DPPt. Wherever you have inserted the particle, take note of its index number.

Attack Order:
Spoiler:
FireRed:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 E5 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 02 08 7C 3E 08 83 04 E0 FF F0 FF 01 00 03 00 19 84 00 3F 03 D1 8C 09 08 02 05 01 00 03 00 00 00 0C 00 01 00 03 D1 8C 09 08 02 05 03 00 03 00 00 00 0C 00 01 00 04 04 02 50 7C 3E 08 83 02 01 00 03 00 19 84 00 3F 04 04 02 50 7C 3E 08 83 02 01 00 03 00 19 84 00 3F 04 04 02 08 7C 3E 08 83 04 20 00 14 00 01 00 03 00 19 84 00 3F 05 0B 03 0D 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 D0 C9 3A 08 00 2C 3E 08 00 00 00 00 FC 1C 23 08 11 2D 0A 08

Emerald:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 EC 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 02 58 73 59 08 83 04 E0 FF F0 FF 01 00 03 00 19 8B 00 3F 03 85 54 0D 08 02 05 01 00 03 00 00 00 0C 00 01 00 03 85 54 0D 08 02 05 03 00 03 00 00 00 0C 00 01 00 04 04 02 A0 73 59 08 83 02 01 00 03 00 19 8B 00 3F 04 04 02 A0 73 59 08 83 02 01 00 03 00 19 8B 00 3F 04 04 02 58 73 59 08 83 04 20 00 14 00 01 00 03 00 19 8B 00 3F 05 0B 03 0D 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 0C 49 52 08 88 23 59 08 00 00 00 00 A8 C6 2E 08 69 F2 0F 08



Defend Order:
Spoiler:
FireRed:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 E5 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 00 C8 27 05 0B 02 0D 04 01 0E 27 B2 1C 08 05 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 D0 C9 3A 08 00 2C 3E 08 00 00 00 00 FC 1C 23 08 11 2D 0A 08

Emerald:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 EC 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 00 C8 27 05 0B 02 0D 04 01 0E 87 D6 2C 08 05 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 0C 49 52 08 88 23 59 08 00 00 00 00 A8 C6 2E 08 69 F2 0F 08



Heal Order:
Spoiler:
FireRed:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 E5 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 00 2F 27 05 0B 02 0D 04 01 0E C9 56 1D 08 05 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 D0 C9 3A 08 00 2C 3E 08 00 00 00 00 FC 1C 23 08 11 2D 0A 08

Emerald:
Spoiler:
00 YY 28 00 97 27 00 4A 27 0A 03 28 01 19 EC 00 3F 02 XX XX XX 08 82 05 78 00 46 00 05 00 46 00 1E 00 04 01 02 XX XX XX 08 82 05 73 00 37 00 06 00 3C 00 19 00 04 01 02 XX XX XX 08 82 05 73 00 3C 00 07 00 3C 00 1E 00 02 XX XX XX 08 82 05 73 00 37 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 64 00 32 00 04 00 32 00 1A 00 04 01 02 XX XX XX 08 82 05 69 00 19 00 08 00 3C 00 14 00 04 01 02 XX XX XX 08 82 05 73 00 28 00 0A 00 30 00 1E 00 04 03 02 XX XX XX 08 82 05 78 00 1E 00 06 00 2D 00 19 00 02 XX XX XX 08 82 05 73 00 23 00 0A 00 3C 00 1E 00 04 03 02 XX XX XX 08 82 05 69 00 14 00 08 00 28 00 00 00 04 03 02 XX XX XX 08 82 05 14 00 FF 00 0F 00 20 00 00 00 02 XX XX XX 08 82 05 6E 00 0A 00 08 00 20 00 14 00 05 00 2F 27 05 0B 02 0D 04 01 0E DF 79 2D 08 05 08

*YY is the particle index of the bees.

*Insert at XX XX XX:
YY 28 YY 28 0C 49 52 08 88 23 59 08 00 00 00 00 A8 C6 2E 08 69 F2 0F 08



Overall, they are created from Twister's animation. I'd plan on Recover but misdirection of the bees on the particles might occur. Anyway, these are the best ones. Attack Order is plainly Twister's animation. Defend Order is combined Twister's animation with Endure's animation. Heal Order is combined Twister's animation with the healing animation. Use Slash's effect for Attack Order's effect. Use Cosmic Power's effect for Defend Order. And, use Recover's effect for Healing Order. Tada! You now have the three Order moves!

I will come up with Ruby soon since the one I've downloaded isn't organized.
Great! Really cool! i've been seraching for this! :D
this movements are my bug type favorite moves.

I have a doubt, How i know which is the particle index?

Xencleamas

Suddenly lurking in the shadows...

Male
Asgard
Seen January 21st, 2019
Posted August 7th, 2018
460 posts
5.8 Years
Great! Really cool! i've been seraching for this! :D
this movements are my bug type favorite moves.

I have a doubt, How i know which is the particle index?
Hope this tutorial will able to help you: http://www.pokecommunity.com/showthread.php?t=308062

Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)
Male
Seen January 10th, 2019
Posted May 4th, 2017
216 posts
6.3 Years
This one wasn't really hard, but there was a ton of bugs to fix, and for the first time, I'm not the only one to be guilty.
For the first time either, I do correct KDS routine, in this post
Freeze Dry
I hope it'll be useful because I literally spent 5 hours to fix those annoying bugs ._.

Anyway, here is Thousand Arrows + corrected Freeze Dry :
Spoiler:

Emerald :
Spoiler:

CheckFlag routine, note the address you assemble it (we'll call that address LL LL LL):
Spoiler:

.thumb

push {lr}
ldr r0, BankTarget
ldrb r0, [r0]
ldr r1, Flags
mov r2, #4
mul r0, r2
add r0, r1
ldr r2, [r0]
ldr r0, ArrowFlag
and r2, r0
pop {pc}

.align 2
ArrowFlag: .word 0x800000
BankTarget: .word 0x0202420C
Flags: .word 0x020242AC

Damage modulation routines Here you can find Freeze dry :
Spoiler:

Spoiler:

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

Main:
  
cmp r0, #0xB
beq Freeze
cmp r0, #0x2
bne RegularChart
ldr r1, currMove
ldrh r1, [r1]
ldr r0, ThousandArrows
cmp r0, r1
beq Touched
push {r0-r2}
ldr r0, CheckFlag
bl Jump
cmp r2, #0
beq PopRegular
pop {r0-r2}

Touched:
mov r0, #0xA
b Exit

PopRegular:
pop {r0-r2}
b RegularChart

Freeze:
ldr r1, currMove
ldrh r1, [r1]
ldr 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, =0x08047169
bx r1

Jump:
mov pc, r0

.align 2
currMove: .word 0x020241EA
freezeDryIndex: .word 0x23D /*Index Freeze Dry*/
ThousandArrows: .word 0x266 /*Index Thousand Arrows*/
CheckFlag: .word 0x08LLLLLL+1

/*47160:  00 49 08 47 XX+1 XX XX 08*/

Spoiler:

.text
.align 2
.thumb
.thumb_func
.global freezedry2

Main:
   ldrb r0, [r0, #0x0]
  cmp r0, r4
  beq NextEntry
  cmp r1, #0xB
beq Freeze
cmp r1, #0x2
bne RegularChart
ldr r1, currMove
ldrh r1, [r1]
ldr r0, ThousandArrows
cmp r0, r1
beq Touched
push {r0-r2}
ldr r0, CheckFlag
bl Jump
cmp r2, #0
beq PopRegular
pop {r0-r2}

Touched:
mov r0, #0xA
b Exit

PopRegular:
pop {r0-r2}
b RegularChart

Freeze:
  ldr r1, currMove
  ldrh r1, [r1]
  ldr r0, freezeDryIndex
  cmp r0, r1
  bne RegularChart
  mov r0, #0x14
Exit:
  ldr r1, =0x08047190+1
  bx r1

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

NextEntry:
  ldr r1, =0x08047199
  bx r1

Jump:
mov pc, r0

.align 2
currMove: .word 0x020241EA
freezeDryIndex: .word 0x23D
ThousandArrows: .word 0x266
CheckFlag: .word 0x08LLLLLL+1

@47184:  00 4A 10 47 XX+1 XX XX 08

Spoiler:

.text
.align 2
.thumb
.thumb_func
.global freezedryai1

Main:
  
  cmp r0, #0xB
  beq Freeze
cmp r0, #0x2
bne RegularChart
ldr r1, currMove
ldrh r1, [r1]
ldr r0, ThousandArrows
cmp r0, r1
beq Touched
push {r0-r2}
ldr r0, CheckFlag
bl Jump
cmp r2, #0
beq PopRegular
pop {r0-r2}

Touched:
mov r0, #0xA
b Exit

PopRegular:
pop {r0-r2}
b RegularChart

Freeze:
  ldr r1, currMove
  ldrh r1, [r1]
  ldr 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

Jump:
mov pc, r0

.align 2
currMove: .word 0x02024E1A
freezeDryIndex: .word 0x23D
ThousandArrows: .word 0x266
CheckFlag: .word 0x08A442F0+1

@476E0:  00 49 08 47 XX+1 XX XX 08

Spoiler:

.text
.align 2
.thumb
.thumb_func
.global freezedryai2

Main:
  
  cmp r0, #0xB
  beq Freeze
cmp r0, #0x2
bne RegularChart
ldr r1, currMove
ldrh r1, [r1]
ldr r0, ThousandArrows
cmp r0, r1
beq Touched
push {r0-r2}
ldr r0, CheckFlag
bl Jump
cmp r2, #0
beq PopRegular
pop {r0-r2}

Touched:
mov r0, #0xA
b Exit

PopRegular:
pop {r0-r2}
b RegularChart

Freeze:
  ldr r1, currMove
  ldrh r1, [r1]
  ldr 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

Jump:
mov pc, r0

.align 2
currMove: .word 0x02024E1A
freezeDryIndex: .word 0x23D
ThousandArrows: .word 0x266
CheckFlag: .word 0x08A442F0+1

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


Next, insert that battlescript somewhere (we'll call its address KK KK KK):
Spoiler:

#org 0xA446F0
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
setword 0x203E320 0x8XXXXXX
printstring 0x184
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x8000000
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

At XX XX XX :
CE DC D9 00 E3 E4 E4 E3 E7 DD E2 DB 00 FD 0E FE DA D9 E0 E0 00 E7 E8 E6 D5 DD DB DC E8 00 D8 E3 EB E2 AB

"The opposing buffer fell straight down" or something like that, copied from showdown.

Next this ASM routine, unoptimized but rn I don't care, too lazy (PP PP PP address) :
Spoiler:

push {lr}
ldr r0, BankTarget
ldrb r3, [r0]
ldrb r0, [r0]
mov r1, #0x58
ldr r2, BattleData
mul r0, r1
add r0, r2
ldr r1, [r0]
ldr r2, SubStat
and r1, r2
cmp r1, #0
bne Return
mov r1, r3
ldr r2, StatutFlags
mov r3, #4
mul r1, r3
add r1, r2
ldr r2, [r1]
mov r3, #0x40
and r3, r2
cmp r3, #0
bne KnockFly
mov r3, #0

CheckType:
sub r0, #0x30
ldrb r1, [r0]
cmp r1, #0x1A	/*Index number of levitate*/
beq BuffTarget
ldrb r1, [r0, #1]
cmp r1, #2	/*Flying type*/
beq BuffTarget
ldrb r1, [r0, #2]
bne Return

BuffTarget:
ldr r0, BankTarget
ldrb r0, [r0]
ldr r2, StatutFlags
mov r1, #4
mul r0, r1
add r0, r2
ldr r1, [r0]
ldr r2, ArrowStatut
add r1, r2
str r1, [r0]
cmp r3, #0
bne DisplayString
pop {pc}

KnockFly:
sub r2, #0x40
str r2, [r1]
ldr r0, BankTarget
ldrb r0, [r0]
mov r1, #0x58
mul r0, r1
ldr r2, BattleData
add r0, r2
ldr r3, [r0]
ldr r2, MultiAttack
sub r3, r2
str r3, [r0]
mov r3, #1
b CheckType

DisplayString:
ldr r0, CurrentBS
ldr r1, ArrowScript
str r1, [r0]

Return:
pop {pc}

.align 2
BattleData: .word 0x020240D4
BankTarget: .word 0x0202420C
StatutFlags: .word 0x020242AC
SubStat: .word 0x1000000
MultiAttack: .word 0x1000
CurrentBS: .word 0x02024214
ArrowStatut: .word 0x800000
ArrowScript: .word 0x08KKKKKK

Another battlescript ! (UU UU UU)
Spoiler:

#org 0xUUUUUU
attackcanceler
callasm 0x8PPPPPP+1
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x8000000
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end

Finally, give Thousand wave the same effect than Sky Uppercut, and replace Sky Uppercut's script by :
Spoiler:

orword 0x2024280 0x10000
jumpifhalfword 0x0 0x20241EA 0x266 0x8UUUUUU
goto 0x82D8A00

Replace 0x266 with the Index of Thousand Arrows

Handle Levitate :
Spoiler:

First, the bl routine (ZZ ZZ ZZ) :
Spoiler:

.thumb

push {lr}
cmp r3, #1
bne ChecktheFlags
ldr r0, CurrentMove
ldrh r1, [r0]
ldr r2, ThousandIndex
cmp r1, r2
bne ChecktheFlags

Pos:
mov r3, #1

Return:
pop {pc}

ChecktheFlags:
ldr r0, Flags
ldr r1, Bank
ldrb r1, [r1]
mov r2, #4
mul r1, r2
add r1, r0
ldr r2, [r1]
ldr r1, ArrowStatut
and r1, r2
cmp r1, #0
bne Pos
mov r3, #0
b Return

.align 2
CurrentMove: .word 0x020241EA
ThousandIndex: .word 0x266
Flags: .word 0x020242AC
ArrowStatut: .word 0x800000
Bank: .word 0x0202420C

The Actual routines that handle Levitate :
Spoiler:

Spoiler:

.thumb

push {r0-r3}
mov r3, #1
ldr r0, blflag
bl Jump
cmp r3, #1
bne Classic
pop {r0-r3}
ldr r1, Touched

Back:
mov pc, r1

Classic:
pop {r0-r3}
mov r0, #0x58
mul r0, r1
add r0, r0, r5
add r0, #0x20
ldr r1, Untouched
b Back


Jump:
mov pc, r0

.align 2
blflag: .word 0x08ZZZZZZ+1
Touched: .word 0x08047128+1
Untouched: .word 0x080470BC+1

/* 00 48 00 47 xx+1 xx xx 08 at 080470B4*/

Spoiler:

.thumb

push {r0-r3}
mov r3, #1
ldr r0, blflag
bl Jump
cmp r3, #1
bne Classic
pop {r0-r3}
ldr r1, Touched

Back:
mov pc, r1

Classic:
pop {r0-r3}
ldrb r1, [r3]
mov r0, #0x58
mul r0, r1
add r0, r0, r2
ldr r1, Untouched
b Back


Jump:
mov pc, r0

.align 2
blflag: .word 0x08ZZZZZZ+1
Touched: .word 0x0804733C+1
Untouched: .word 0x08047304+1

/* 00 48 00 47 xx+1 xx xx 08 at 080472FC*/

Spoiler:

.thumb

push {r0-r3}
mov r3, #1
ldr r0, blflag
bl Jump
cmp r3, #1
bne Classic
pop {r0-r3}
ldr r1, Touched

Back:
mov pc, r1

Classic:
pop {r0-r3}
mov r0, #0x58
mov r2, r9
mul r2, r0
mov r0, r2
ldr r1, Untouched
b Back

Jump:
mov pc, r0

.align 2
blflag: .word 0x08ZZZZZZ+1
Touched: .word 0x08047690+1
Untouched: .word 0x08047664+1

/* 00 48 00 47 xx+1 xx xx 08 at 0804765C*/



Notes :
Spoiler:

-I'll handle arena trap later.
-I used an unused (afaik) Statut (special) flag to set the Arrow statut. If you don't know what I'm talking about, look at this post. Also if the bit I used is not free, please let me know.


Xencleamas

Suddenly lurking in the shadows...

Male
Asgard
Seen January 21st, 2019
Posted August 7th, 2018
460 posts
5.8 Years
Here are some Battle Scripts I've ported on Emerald from FireRed.

Close Combat
Spoiler:
Battle Script
Spoiler:
#dynamic 0x9C0B20
#freespacebyte 0xFF

#org @start
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
faintpokemon 0x0 0x0 0x9C0B200
callasm 0x8AAAAAA + 1

Routine at AAAAAA
Spoiler:
.text
.align 2
.thumb
.thumb_func

Main:
ldr r1, .BattleData
ldr r0, .UserBank
ldrb r0, [r0]
mov r2, #0x58
mul r2, r0
add r1, #0x1a
add r1, r2
ldrb r0, [r1]
ldrb r2, [r1, #0x3]
mov r3, #0x0
cmp r0, r3
beq DefIsZero
cmp r2, r3
beq SpDefIsZero
ldr r4, .LowerBothBS
b End

DefIsZero:
cmp r2, r3
beq BothBS
ldr r4, .LowerSpDefBS
b End

SpDefIsZero:
ldr r4, .LowerDefBS
b End

BothBS:
ldr r4, .EndBS

End:
ldr r5, .ActiveBSPointer
str r4, [r5, #0x0]
bx lr

.align 2
.align 2
.BattleData: .word 0x02024084
.UserBank: .word 0x0202420B
.ActiveBSPointer: .word 0x02024214
.LowerSpDefBS: .word 0x08BBBBBB
.LowerDefBS: .word 0x08CCCCCC
.LowerBothBS: .word 0x08DDDDDD
.EndBS: .word 0x082D8A4E

Battle Script at BBBBBB: Lowers Defense
Spoiler:
#dynamic 0x9C0B20
#freespacebyte 0xFF

#org @start
setbyte 0x202448F 0x0
playstatchangeanimation 0x1 0x4 0x1
setbyte 0x202448E 0x92
statbuffchange 0x80 true @end
jumpifbyte 0x0 statchange 0x2 @end
printfromtable 0x85CC8A8
waitmessage 0x40

#org @end
goto 0x82D8A4E

Battle Script at CCCCCC: Lowers Special Defense
Spoiler:
#dynamic 0x9C0B20
#freespacebyte 0xFF

#org @start
setbyte 0x202448F 0x0
playstatchangeanimation 0x1 0x20 0x1
setbyte 0x202448E 0x95
statbuffchange 0x80 true @end
jumpifbyte 0x0 statchange 0x2 @end
printfromtable 0x85CC8A8
waitmessage 0x40

#org @end
goto 0x82D8A4E

Battle Script at DDDDD: Lowers Both Defense and Special Defense
Spoiler:
#dynamic 0x9C0B20
#freespacebyte 0xFF

#org @start
setbyte 0x202448F 0x0
playstatchangeanimation 0x1 0x24 0x1
setbyte 0x202448E 0x92
statbuffchange 0x80 true @end
jumpifbyte 0x0 statchange 0x2 @end
printfromtable 0x85CC8A8
waitmessage 0x40
setbyte 0x202448E 0x95
statbuffchange 0x80 true @end
jumpifbyte 0x0 statchange 0x2 @end
printfromtable 0x85CC8A8
waitmessage 0x40

#org @end
goto 0x82D8A4E


Hone Claws
Spoiler:
#dynamic 0x9C0B20
#freespacebyte 0xFF

#org @pickmove
jumpifhalfword 0x0 0x20241EA 0x1D4 @honeclaws
goto 0x2D8C7A

#org @honeclaws
attackcanceler
attackstring
ppreduce
jumpifstat BANK_USER 0x3 0x1 0xC @attack
jumpifstat BANK_USER B_= 0x6 0xC 0x82DA71D

#org @attack
attackanimation
waitanimation
setbyte 0x202448F 0x0
playstatchangeanimation 0x0 0x42 0x0
setbyte 0x202448E 0x11
statbuffchange 0x1 true @accuracy
jumpifbyte 0x0 0x2024337 0x2 @accuracy
printfromtable 0x85CC89C
waitmessage 0x40

#org @accuracy
setbyte 0x202448E 0x16
statbuffchange 0x1 true 0x82DA718
jumpifbyte 0x0 0x2024337 0x2 0x82DA718
printfromtable 0x85CC89C
waitmessage 0x40
goto 0x2D8A4E
0x1D4 is the index number of Hone Claws. Change it if you are using a different index number of your Hone Claws move.


Flame Charge
Spoiler:
#dynamic 0x9C0B20
#freespacebyte 0xFF

#org @pickmove
jumpifhalfword 0x0 0x20241EA 0x1E8 @speedboost
goto 0x82D9392

#org @speedboost
setbyte 0x2024335 0xD1
goto 0x82D8A00
0x1E8 is the index number of Flame Charge. Change it if you are using a different index number of your Flame Charge move.


Coil
Spoiler:
#dynamic 0x9C0B20
#freespacebyte 0xFF

#org @pickmove
jumpifhalfword 0x0 0x20241EA 0x1E9 @coil
goto 0x2DA655

#org @coil
attackcanceler
attackstring
ppreduce
jumpifstat BANK_USER 0x3 0x1 0xC @attack
jumpifstat BANK_USER 0x3 0x2 0xC @attack
jumpifstat BANK_USER B_= 0x6 0xC 0x82DA71D

#org @attack
attackanimation
waitanimation
setbyte 0x202448F 0x0
playstatchangeanimation 0x0 0x46 0x0
setbyte 0x202448E 0x11
statbuffchange 0x1 true @defense
jumpifbyte 0x0 0x2024337 0x2 @defense
printfromtable 0x85CC89C
waitmessage 0x40

#org @defense
setbyte 0x202448E 0x12
statbuffchange 0x1 true @accuracy
jumpifbyte 0x0 0x2024337 0x2 @accuracy
printfromtable 0x85CC89C
waitmessage 0x40

#org @accuracy
setbyte 0x202448E 0x16
statbuffchange 0x1 true 0x82DA718
jumpifbyte 0x0 0x2024337 0x2 0x82DA718
printfromtable 0x85CC89C
waitmessage 0x40
goto 0x2D8A4E
0x1E9 is the index number of Coil. Change it if you are using a different index number of your Coil move.


Shift Gear and Shell Smash
Spoiler:
#dynamic 0x9C0B20
#freespacebyte 0xFF

#org @pickmove
jumpifhalfword 0x0 0x20241EA 0x1FC @shiftgear
jumpifhalfword 0x0 0x20241EA 0x1F8 @shellsmash
goto 0x2DA655

#org @shiftgear
attackcanceler
attackstring
ppreduce
jumpifstat BANK_USER 0x3 0x1 0xC @attack
jumpifstat BANK_USER B_= 0x3 0xC 0x82DA71D

#org @attack
attackanimation
waitanimation
setbyte 0x202448F 0x0
playstatchangeanimation 0x0 0xA 0x0
setbyte 0x202448E 0x11
statbuffchange 0x1 true @speed
jumpifbyte 0x0 0x2024337 0x2 @speed
printfromtable 0x85CC89C
waitmessage 0x40

#org @speed
setbyte 0x202448E 0x23
statbuffchange 0x1 true 0x82DA718
jumpifbyte 0x0 0x2024337 0x2 0x82DA718
printfromtable 0x85CC89C
waitmessage 0x40
goto 0x2D8A4E

#org @shellsmash
attackcanceler
attackstring
ppreduce
jumpifstat BANK_USER 0x2 0x2 0x0 @dropdefense
jumpifstat BANK_USER B_= 0x5 0x0 @boost

#org @dropdefense
attackanimation
waitanimation
setbyte 0x202448F 0x0
playstatchangeanimation 0x1 0x24 0x9
setbyte 0x202448E 0x92
statbuffchange 0x81 true @dropspdefense
jumpifbyte 0x0 0x2024337 0x2 @dropspdefense
printfromtable 0x85CC89C
waitmessage 0x40

#org @dropspdefense
setbyte 0x202448E 0x95
statbuffchange 0x81 true @boost
jumpifbyte 0x0 0x2024337 0x2 @boost
printfromtable 0x85CC89C
waitmessage 0x40

#org @boost
jumpifstat BANK_USER 0x3 0x1 0xC @sharpattack
jumpifstat BANK_USER 0x3 0x4 0xC @sharpattack
jumpifstat BANK_USER B_= 0x3 0xC 0x82DA71D

#org @sharpattack
setbyte 0x202448F 0x0
playstatchangeanimation 0x0 0x1A 0x0
setbyte 0x202448E 0x21
statbuffchange 0x1 true @sharpspattack
jumpifbyte 0x0 0x2024337 0x2 @sharpspattack
printfromtable 0x85CC89C
waitmessage 0x40

#org @sharpspattack
setbyte 0x202448E 0x24
statbuffchange 0x1 true @sharpspeed
jumpifbyte 0x0 0x2024337 0x2 @sharpspeed
printfromtable 0x85CC89C
waitmessage 0x40

#org @sharpspeed
setbyte 0x202448E 0x23
statbuffchange 0x1 true 0x82DA718
jumpifbyte 0x0 0x2024337 0x2 0x82DA718
printfromtable 0x85CC89C
waitmessage 0x40
goto 0x2D8A4E
0x1FC and 0x1F8 are the index numbers of Shift Gear and Shell Smash respectively. Change them if you are using a different index numbers of your Shift Gear and Shell Smash moves.


Growth/Work Up/Rototiller
Spoiler:
#include abilities.bsh
#dynamic 0x9C0B20
#freespacebyte 0xFF

#org @pickmove
jumpifhalfword 0x0 0x20241EA 0x4A @growth
jumpifhalfword 0x0 0x20241EA 0x20E @workup
jumpifhalfword 0x0 0x20241EA 0x233 @rototiller
goto 0x1D6B8D

#org @growth
jumpifabilitypresent ABILITY_CLOUDNINE @workup
jumpifabilitypresent ABILITY_AIRLOCK @workup
jumpifabilitypresent ABILITY_DELTASTREAM @workup
jumpifhalfword B_& 0x20243CC 0x60 @sunlight
goto @workup

#org @sunlight
attackcanceler
attackstring
ppreduce
jumpifstat BANK_USER 0x3 0x1 0xC @attack2
jumpifstat BANK_USER B_= 0x4 0xC 0x82DA71D

#org @attack2
attackanimation
waitanimation
setbyte 0x202448F 0x0
playstatchangeanimation 0x0 0x12 0x0
setbyte 0x202448E 0x21
statbuffchange 0x1 true @spatk2
jumpifbyte 0x0 0x2024337 0x2 @spatk2
printfromtable 0x85CC89C
waitmessage 0x40

#org @spatk2
setbyte 0x202448E 0x24
statbuffchange 0x1 true 0x82DA718
jumpifbyte 0x0 0x2024337 0x2 0x82DA718
printfromtable 0x85CC89C
waitmessage 0x40
goto 0x2D8A4E

#org @workup
attackcanceler
attackstring
ppreduce
jumpifstat BANK_USER 0x3 0x1 0xC @attack
jumpifstat BANK_USER B_= 0x4 0xC 0x82DA71D

#org @attack
attackanimation
waitanimation
setbyte 0x202448F 0x0
playstatchangeanimation 0x0 0x12 0x0
setbyte 0x202448E 0x11
statbuffchange 0x1 true @spatk
jumpifbyte 0x0 0x2024337 0x2 @spatk
printfromtable 0x85CC89C
waitmessage 0x40

#org @spatk
setbyte 0x202448E 0x14
statbuffchange 0x1 true 0x82DA718
jumpifbyte 0x0 0x2024337 0x2 0x82DA718
printfromtable 0x85CC89C
waitmessage 0x40
goto 0x2D8A4E

#org @rototiller
setbyte 0x2024200 0x0
attackcanceler
attackstring
ppreduce
cmd25
jumpiftype 0x1 0xC @selfgrass
goto @call

#org @selfgrass
jumpifsecondarystatus 0x1 0x1000000 @next
jumpifstat 0x1 B_>= 0x1 0xC @next
jumpifstat 0x1 B_>= 0x4 0xC @next
jumpifbyte B_= 0x2024200 0x1 @selfnoanimation
attackanimation
waitanimation
setbyte 0x2024200 0x1

#org @selfnoanimation
cmd47
playstatchangeanimation 0x1 0x12 0x0
setbyte 0x202448E 0x11
statbuffchange 0x80 true @selfnoanimation2
jumpifbyte B_>= 0x2024337 0x2 @selfnoanimation2
printfromtable 0x85CC89C
waitmessage 0x40

#org @selfnoanimation2
setbyte 0x202448E 0x14
statbuffchange 0x80 true @next
jumpifbyte B_>= 0x2024337 0x2 @next
printfromtable 0x85CC89C
waitmessage 0x40

#org @next
cmd25

#org @call
jumpifarrayequal 0x202420B 0x202420C 0x1 @next
call @target
setbyte 0x2024488 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid @next
jumpifbyte B_= 0x2024200 0x0 @nobuffs
end

#org @target
jumpiftype 0x0 0xC @grass
goto @return

#org @grass
jumpifsecondarystatus 0x0 0x1000000 @return
jumpifstat 0x0 B_>= 0x1 0xC @return
jumpifstat 0x0 B_>= 0x4 0xC @return
jumpifbyte B_= 0x02024200 0x1 @noanimation
attackanimation
waitanimation
setbyte 0x02024200 0x1

#org @noanimation
cmd47
playstatchangeanimation 0x0 0x12 0x0
setbyte 0x202448E 0x11
statbuffchange 0x0 false @noanimation2
jumpifbyte B_>= 0x2024337 0x2 @noanimation2
printfromtable 0x85CC89C
waitmessage 0x40

#org @noanimation2
setbyte 0x202448E 0x14
statbuffchange 0x0 false @return
jumpifbyte B_>= 0x2024337 0x2 @return
printfromtable 0x85CC89C
waitmessage 0x40

#org @return
return

#org @nobuffs
pause 0x20
orbyte 0x202427C 0x20
resultmessage
waitmessage 0x40
end
0x20E and 0x233 are the index numbers of Work Up and Rototiller respectively. Change them if you are using a different index numbers of your Work Up and Rototiller moves. If you do not have Delta Stream listed on abilities.bsh, just replace ABILITY_DELTASTREAM with 0xC0, it's index number.


Credits to Spherical Ice for his original Close Combat routine for FireRed, and also to mamamama for his offsets for Emerald. mamamama's post did not cover the changes in scripts so, I made changes on the scripts and fully working. Credits to MrDollSteak for the rest of the moves here.

Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)

Dragonflye

Author of Pokémon Sovereign of the Skies

Age 24
Male
Seen 1 Week Ago
Posted October 9th, 2018
85 posts
9.9 Years
I've translated this to Emerald and it's almost working.

I copied your ASM and used the following offsets:

Userbank 0202420B
Targetbank 0202420C
BattleStruct 02024084
TurnOrder 0202407E
MonsMoved 02024082
MovesUsed 02024274
CurrentScript 02024214
FailScript 82D9F15
CurrentAttack 020241EA

MoveTable: Using my own, triple checked and it's correct

BasePower 02024400
EffectTable: 82D86A8 (Using original one)

Copy pasted you script and added +1 on each ASM. Changed Setbytes to 0x202448C and 0x202448D.

Everything seems to be correct, Me First correctly fails if the opponent uses a status move and it copies the attack of the opponent, but it can't perform the move effect. When I tried copying Mega Drain for example the move just fails, when I copy Tackle the game throws a Pokeball (similar glitch that happens when a move effect is wrong). Is there something wrong with the Move Effect Table offset or some slip-up in the ASM? Did anyone use Chaos Rush's code in Fire Red and get it to work?
Yes, i have se same Problem with Fire Red. If I use Me Fist my Pokémon steals the move vom target und show the text but the target become not demage instead of rain beginn...



Xencleamas

Suddenly lurking in the shadows...

Male
Asgard
Seen January 21st, 2019
Posted August 7th, 2018
460 posts
5.8 Years
Here are more Emerald implementations from FireRed.

Flower Shield
Spoiler:
#dynamic 0x800000
#freespacebyte 0xFF

#org @Effect11
setbyte 0x202448E 0x12
jumpifhalfword B_= 0x20241EA 0x243 @FlowerShield
goto 0x2D8CA1

#org @FlowerShield
setbyte 0x02024200 0x0
attackcanceler
attackstring
ppreduce
cmd25
jumpiftype 0x1 0xC @SelfGrass
goto @Call

#org @SelfGrass
jumpifsecondarystatus 0x1 0x1000000 @NextTarget
jumpifstat 0x1 B_>= 0x2 0xC @NextTarget
jumpifbyte B_= 0x02024200 0x1 @SelfNoAnimation
attackanimation
waitanimation
setbyte 0x02024200 0x1
goto @SelfNoAnimation

#org @SelfNoAnimation
cmd47
playstatchangeanimation 0x1 0x4 0x0
statbuffchange 0x80 true @NextTarget
jumpifbyte B_>= 0x2024337  0x2 @NextTarget
printfromtable 0x85CC89C
waitmessage 0x40

#org @NextTarget
cmd25

#org @Call
jumpifarrayequal 0x202420B 0x202420C 0x1 @NextTarget
call @TargetBuff
setbyte 0x2024488 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid @NextTarget
jumpifbyte B_= 0x02024200 0x0 @NoBuffs
end

#org @TargetBuff
jumpiftype 0x0 0xC @Grass
goto @Return

#org @Grass
jumpifsecondarystatus 0x0 0x1000000 @Return
jumpifstat 0x0 B_>= 0x2 0xC @Return
jumpifbyte B_= 0x02024200 0x1 @NoAnimation
attackanimation
waitanimation
setbyte 0x02024200 0x1
goto @NoAnimation

#org @NoAnimation
cmd47
playstatchangeanimation 0x0 0x4 0x0
statbuffchange 0x0 false @Return
jumpifbyte B_>= 0x2024337 0x2 @Return
printfromtable 0x85CC89C
waitmessage 0x40

#org @Return
return

#org @NoBuffs
pause 0x20
orbyte 0x202427C 0x20
resultmessage
waitmessage 0x40
end
Replace effect 11 with this battle script. 0x243 is the index number of Flower Shield. Change it if you are using another different index number of your Flower Shield move.


Cotton Guard
Spoiler:
This requires Setword and Battle String Loader hack implemented.
#dynamic 0x800000
#freespacebyte 0xFF

#org @pickmove
jumpifhalfword 0x0 0x20241EA 0x21A @cottonguard
goto 0x2D921D

#org @cottonguard
jumpifstat BANK_USER B_>= 0x2 0xA 0x2D921D
jumpifstat BANK_USER B_>= 0x2 0xB 0x2D8C85
attackcanceler
attackstring
ppreduce
setbyte 0x202448E 0x22
statbuffchange 0x1 true 0x82D8CCF
jumpifbyte 0x0 0x2023E87 0x2 0x82D8CC7

#org @singleboost
attackanimation
waitanimation
cmd47
playanimation BANK_USER 0x1 0x2024484
setbyte 0x202448E 0x12
statbuffchange 0x1 true 0x82D8CCF
jumpifbyte 0x0 0x2024337 0x2 0x82D8CCF

#org @end
setword 0x203E320 0x8CCCCCC
printstring 0x184
waitmessage DELAY_1SECOND
goto 0x82D8A4E
String at CCCCCC:
FD 0F B4 E7 00 BE D9 DA D9 E2 E7 D9 FE D8 E6 D5 E7 E8 DD D7 D5 E0 E0 ED 00 E6 E3 E7 D9 AB
Replace effect 51 with this battle script. 0x21A is the index number of Cotton Guard. Change it if you are using another different index number of your Cotton Guard move.


Tail Glow
Spoiler:
This requires Setword and Battle String Loader hack implemented.
#dynamic 0x800000
#freespacebyte 0xFF

#org @pickmove
jumpifhalfword 0x0 0x20241EA 0x126 @tailglow
goto 0x1D7119

#org @tailglow
jumpifstat BANK_USER B_>= 0x4 0xA 0x2D9233
jumpifstat BANK_USER B_>= 0x4 0xB 0x2D8C90
attackcanceler
attackstring
ppreduce
setbyte 0x202448E 0x24
statbuffchange 0x1 true 0x82D8CCF
jumpifbyte 0x0 0x2024337 0x2 0x82D8CC7

#org @singleboost
attackanimation
waitanimation
cmd47
playanimation BANK_USER 0x1 0x2024484
setbyte 0x2023FDE 0x14
statbuffchange 0x1 true 0x82D8CCF
jumpifbyte 0x0 0x2023E87 0x2 0x82D8CC7

#org @end
setword 0x203E320 0x8DDDDDD
printstring 0x184
waitmessage DELAY_1SECOND
goto 0x82D8A4E
String at CCCCCC:
FD 0F B4 E7 00 CD E4 AD 00 BB E8 DF FE D8 E6 D5 E7 E8 DD D7 D5 E0 E0 ED 00 E6 E3 E7 D9 AB
Replace effect 53 with this battle script. 0x126 is the index number of Tail Glow.


Charge
Spoiler:
#dynamic 0x800000
#freespacebyte 0xFF

#org @charge
attackcanceler
attackstring
ppreduce
setcharge
attackanimation
waitanimation
printstring 0xA5
waitmessage DELAY_1SECOND

#org @spdefboost
setbyte 0x202448E 0x15
statbuffchange 0x1 true 0x82D8CCF
jumpifbyte B_!= 0x2023E87 0x2 0x82D8CCF
goto 0x82D8CBF
Replace effect 174 with this battle script. It's Charge but now with a permanent Sp. Def boost that's added after the charge effect to match the message style of Gen V.


Assurance
Spoiler:
This requires Callasm command implemented.

Battle Script:
#dynamic 0x800000
#freespacebyte 0xFF

#org @start
callasm 0x8AABBCC +1
Routine at AABBCC:
.text
.align 2
.thumb
.thumb_func

Main:
ldr r1, .PhysDamage
ldr r0, .TargetBank
ldrb r0, [r0]
mov r2, #0x10
mul r2, r0
add r1, r2
ldrb r0, [r1]
ldrb r2, [r1, #0x2]
mov r3, #0x0
cmp r0, r3
bne DoubleDamage
cmp r2, r3
bne DoubleDamage
b End

DoubleDamage:
ldr r3, .DamageMultiplier
mov r0, #0x2
strb r0, [r3, #0x0]

End:
ldr r4, .ReturnBS
ldr r5, .ActiveBSPointer
str r4, [r5, #0x0]
bx lr

.align 2
.PhysDamage:		.word 0x02024340
.TargetBank:		.word 0x0202420C
.ActiveBSPointer:	.word 0x02024214
.DamageMultiplier:	.word 0x02024482
.ReturnBS:		.word 0x082D8A26


Crush Grip
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global crushgrip

main:
push {lr}
ldr r0, targetBank
ldrb r0, [r0]
ldr r1, battleData
mov r2, #0x58
mul r0, r2
add r3, r0, r1
ldrh r0, [r3, #0x28]
mov r2, #0x78
mul r0, r2
ldrh r1, [r3, #0x2c]
bl divide
mov r1, #0x1
add r1, r0
ldr r2, basePower
strb r1, [r2]
pop {r0}
bx r0

divide:
ldr r2, divider
bx r2

.align 2
targetBank: .word 0x0202420C
battleData: .word 0x02024084
divider: .word 0x082E7541
basePower: .word 0x02024400
Just use the callasm statement after the announcement of attack and before the damage calculation.


Topsy-Turvy
Spoiler:
This requires Callasm, Setword, and Battle String Loader hack implemented.
Battle Script:
#org @main
attackcanceler
attackstring
ppreduce
callasm 0x8DDDDDD+1
attackanimation
waitanimation
setword 0x203E320 0x8CCCCCC
printstring 0x184
waitmessage 0x40
goto 0x82D8A4E
Routine at DDDDDD:
.text
.align 2
.thumb
.thumb_func
.global topsyturvy

main:
push {lr}
ldr r0, targetBank
ldrb r0, [r0]
ldr r1, battleData
mov r2, #0x58
mul r0, r2
add r2, r0, r1
add r2, #0x19
mov r0, #0x0
mov r1, #0x6
loop: 
add r3, r2, r0
ldrb r4, [r3]
cmp r4, #0x6
beq loopend
cmp r4, #0x6
bgt greater
sub r5, r1, r4
lsl r5, #0x1
add r4, r5
strb r4, [r3]
b loopend

greater:
sub r5, r4, #0x6
lsl r5, #0x1
sub r4, r5
strb r4, [r3]

loopend:
add r0, #0x1
cmp r0, #0x7
blt loop
pop {r0}
bx r0

.align 2
targetBank: .word 0x0202420C
battleData: .word 0x02024084
String at CCCCCC:
FD 10 B4 E7 00 E7 E8 D5 E8 E7 00 D7 DC D5 E2 DB D9 E7 00 EB D9 E6 D9 FE E6 D9 EA D9 E6 E7 D9 D8 AB FF


Final Gambit
Spoiler:
This requires Callasm command installed.
Battle Script:
#org @main
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
cmd6
bicbyte 0x202426C 0x6
callasm 0x08AAAAAA+1
cmd69
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
faintpokemon 0x0 0x0 0x8000000
jumpifbyte 0x0 0x202426C 0x8 0x82D8A4E
setuserhptozero
graphicalhpupdate 0x1
datahpupdate 0x1
faintpokemon 0x1 0x0 0x8000000
goto 0x82D8A4E
Routine at AAAAAA:
Spoiler:
.text
.align 2
.thumb
.thumb_func
.global finalgambit

main:
push {lr}
ldr r0, userBank
ldrb r0, [r0]
ldr r1, battleData
mov r2, #0x58
mul r0, r2
add r2, r0, r1
add r2, #0x28
ldrb r0, [r2]
ldr r2, damage
strb r0, [r2]
pop {r0}
bx r0

.align 2
userBank: .word 0x0202420B
battleData: .word 0x02024084
damage: .word 0x020241F0


Credits Spherical Ice for Assurance, KDS for Crush Grip, Topsy-Turvy and Final Gambit, and MrDollSteak for the rest I've modified originally all of these are for FireRed.

I've edited my implementation into Emerald of Work Up and Growth on my previous post. It finally includes Rototiller as if I've used MrDollSteak's script than Tlachtli's anymore.

And one more thing, I've found a "setword" command being already existed in BSP. I just dunno if this is exactly what we are mostly using to call a free RAM location and a string. However, the existing setword command doesn't have its index number display but it gets the same description. But, I assure it isn't (if Jambo also made the command so why the callasm isn't included in the unmodified BSP). I think we should stop using "setword" on "setword 0x203E320 0x89CDCDC" and use "loadstring" or something else or whatever might anyone want unless we can modify the program to replace "setword" into something else."

Xencleamas Untitled Pokémon Fan Game (Coming Soon!) Untitled Region (Coming Soon!)
Advertiser Content