Male
Seen January 10th, 2019
Posted May 4th, 2017
216 posts
6.3 Years
Update

It is now 100% working, Psystrike/Psyshock and Secret Sword effect :

Spoiler:

Emerald:
Spoiler:

Alter the Defense-boost abilities :
Spoiler:

.text
.align 2
.thumb
.thumb_func
.global multiscaleandfurcoat
 
Main:
CheckTwistMoves:
	ldr r0, CurrentMove
	ldrh r0, [r0]
	ldr r3, PStrike
	cmp r0, r3
	beq Swap
	ldr r3, PShock
	cmp r0, r3
	beq swap
	ldr r3, SSword
	cmp r0, r3
	bne Continue
Swap:
	ldr r0, [sp, #0x18]
	ldr r3, [sp, #0x1C]
	str r0, [sp, #0x1C]
	str r3, [sp, #0x18]
Continue:
	ldrb r0, [r2]
	cmp r0, #0x3F
	bne Multiscale
	ldr r3, [sp, #0x4]
	ldr r0, [r3, #0x4C]
	cmp r0, #0
	beq Return
	ldr r1, [sp, #0x18]
	lsr r0, r1, #1
	add r1, r1, r0
	str r1, [sp, #0x18]
Multiscale:
	cmp r0, #0x89 /*Index number MultiScale*/
	bne FurCoat
CheckHP:
	ldr r1, [sp, #0x4]
	ldrh r0, [r1, #0x28]
	ldrh r1, [r1, #0x2C]
	cmp r1, r0
	bne Return
HalveDamage:
	lsr r7, r7, #0x1
	mov r0, r8
	lsr r0, r0, #0x1
	mov r8, r0
FurCoat:
	ldrb r0, [r2]
	cmp r0, #0xAA /*Index number Fur Coat*/
	bne Return
DefenseBoost:
	ldr r1, [sp, #0x18]
	mov r0, r1
	add r1, r0, r0
	str r1, [sp, #0x18]
Return:
	ldr r0, CurrentMove
	ldrh r0, [r0]
	ldr r3, PStrike
	cmp r0, r3
	beq SwapAgain
	ldr r3, PShock
	cmp r0, r3
	beq SwapAgain
	ldr r3, SSword
	cmp r0, r3
	bne Continue
SwapAgain:
	ldr r0, [sp, #0x18]
	ldr r3, [sp, #0x1C]
	str r0, [sp, #0x1C]
	str r3, [sp, #0x18]
End:
	ldr r2, Back
	bx r2

.align 2
Back: .word 0x08069938+1
CurrentMove: .word 0x020241EA
PStrike: .word 0x21C
PShock: .word 0x1D9
SSword: .word 0x224 /*Replace with the index number of your moves*/

/*00 48 00 47 xx+1 xx xx 08 at 08069918*/

Now we alter some part of the calculate damage function:
Spoiler:

.thumb

Start:
mov r8, r3
ldr r0, CurrentMove
ldrh r1, [r0]
ldr r0, PStrike
cmp r1, r0
beq Swap
ldr r0, PShock
cmp r1, r0
beq Swap
ldr r0, SSword
cmp r1, r0
beq Swap

Classic:
ldr r0, [sp, #4]
ldrh r0, [r0, #0xA]
str r0, [sp, #0x1C]

Back:
ldr r0, Return
mov pc, r0

Swap:
ldr r0, [sp, #4]
ldrh r0, [r0, #0xA]
str r0, [sp, #0x18]
str r2, [sp, #0x1C]
ldrh r0, [sp, #0xC]
mov r1, #3
and r1, r0
cmp r1, #0
beq Back
cmp r1, #3
beq Back
cmp r1, #2
beq Subst
add r0, #1
b Store

Subst:
sub r0, #1

Store:
strh r1, [sp, #0xC]
b Back

.align 2
PStrike: .word 0x21C
PShock: .word 0x1D9
SSword: .word 0x224 /*Index number of those moves*/
Return: .word 0x08069614+1
CurrentMove: .word 0x020241EA

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

Finally the ASM for the custom BSP :
Spoiler:

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

main:
push {r0-r3, lr}
ldr r0, BankTarget
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}

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

/*Call asm that routine+1 before AND after the "calculatedamage" command in BSP*/
Your Battle Script would look like :
#org @start
jumpifhalfword 0x1 0x20241EA 0x39 @BS
jumpifspecialstatusflag 0x0 0x40000 0x1 @BS
orword 0x2024280 0x40000
setbyte 0x2024482 0x2

#org @BS
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
callasm 0x8A233F1
calculatedamage
callasm 0x8A233F1
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