The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Research & Development (https://www.pokecommunity.com/forumdisplay.php?f=195)
-   -   Code Move Resource Thread (https://www.pokecommunity.com/showthread.php?t=300524)

BadgerLordZeus April 9th, 2015 12:13 PM

I made a Parabolic Charge animation for Fire Red. Its nothing fancy, but It'll do.

Spoiler:
02 24 7B 3E 08 02 05 01 00 01 00 00 00 06 00 12 0E 05 00 E3 27 00 E4 27 00 11 27 00 35 27 0A 00 0C 0C 08 03 41 E5 0A 08 02 04 00 00 14 00 00 00 02 00 19 CE 00 C0 04 0C 02 90 62 3E 08 02 00 04 1E 03 E1 EC 0A 08 05 00 04 0C 05 03 A1 EF 0A 08 05 00 19 D6 00 3F 05 03 F9 89 09 08 02 05 01 00 00 00 06 00 12 00 01 00 03 F9 A7 0B 08 05 05 04 00 00 00 10 00 10 00 00 00 04 04 03 F9 A7 0B 08 05 05 04 00 00 00 00 00 00 00 00 00 05 0B 00 0D 00 A3 27 00 2F 27 05 0B 02 0D 04 01 0E C9 56 1D 08 02 24 7B 3E 08 02 05 01 00 01 00 06 00 00 00 12 0E 05 0B 03 0D 08 08


EDIT: I've made a few more animations for Fire Red if anyone is interested.

Mystical Fire (I'm very happy with how this animation turned out)

Spoiler:
0E BB 59 1D 08 00 31 27 19 8A 00 3F 02 88 5C 3E 08 82 06 00 00 00 00 1E 00 1E 00 FF FF 00 00 04 01 02 88 5C 3E 08 82 06 00 00 00 00 1E 00 1E 00 00 00 01 00 04 01 02 88 5C 3E 08 82 06 00 00 00 00 1E 00 1E 00 FF FF FF FF 04 01 02 88 5C 3E 08 82 06 00 00 00 00 1E 00 1E 00 02 00 01 00 04 01 02 88 5C 3E 08 82 06 00 00 00 00 1E 00 1E 00 01 00 FF FF 04 01 02 88 5C 3E 08 82 06 00 00 00 00 1E 00 1E 00 FF FF 01 00 04 01 02 88 5C 3E 08 82 06 00 00 00 00 1E 00 1E 00 01 00 FE FF 04 01 02 88 5C 3E 08 82 06 00 00 00 00 1E 00 1E 00 03 00 01 00 05 0E C7 59 1D 08 08


Power-Up Punch (this one is pretty basic, overall)

Spoiler:
00 97 27 00 9F 27 02 08 7C 3E 08 83 04 00 00 00 00 01 00 01 00 02 10 67 3E 08 84 05 00 00 00 00 08 00 01 00 00 00 19 84 00 3F 03 F9 89 09 08 02 05 01 00 03 00 00 00 06 00 01 00 05 0B 02 0D 00 66 27 03 B5 84 0A 08 02 00 19 BA 00 C0 05 02 D0 3E 3E 08 02 00 1C BA 00 C0 04 02 05 08


And heres my take on a Dragon Rush animation. Since the 4th/5th gen animations are kind of generic, my one is also. Its just the slam animation with Blaze Burn/Hydro Cannon's "solarize" like effect.

Dragon Rush

Spoiler:
03 E9 A0 0B 08 02 03 01 01 01 01 01 01 05 00 48 27 00 97 27 0A 01 0C 0C 08 19 84 00 C0 02 9C 4E 3D 08 02 05 00 00 14 00 03 00 00 00 04 00 04 01 02 48 31 3E 08 02 02 00 00 00 00 04 03 19 86 00 3F 02 08 7C 3E 08 03 04 00 00 00 00 01 00 01 00 02 9C 4E 3D 08 02 05 01 00 F4 FF 0A 00 00 00 03 00 02 84 4E 3D 08 02 03 00 00 00 00 05 00 04 03 03 D1 8C 09 08 02 05 01 00 00 00 03 00 06 00 01 00 05 04 05 02 84 4E 3D 08 02 03 01 00 00 00 06 00 05 0B 01 0D 03 E9 A0 0B 08 02 03 01 01 01 01 01 01 05 0B 03 0D 08 08

kearnseyboy6 April 12th, 2015 2:11 AM

Quote:

Originally Posted by Chaos Rush (Post 8678790)
Payback (FireRed):
Spoiler:

Insert this ASM somewhere:
Code:

.text
.align 2
.thumb
.thumb_func
.global test

main:
push {lr}
ldr r0, .TargetBank
ldrb r0, [r0, #0x0]
ldr r1, .BattleStruct
mov r2, #0x58
mul r0, r2
add r5, r0, r1

OrderCheck:
ldr r0, .TargetBank
ldr r1, .UserBank
ldrb r4, [r0, #0x0] /*put target bank into R4*/
ldrb r5, [r1, #0x0] /*put user bank into R5*/
ldr r1, .TurnOrder /*put turn order offset into R1*/

Loop:
ldrb r2, [r1, #0x0]        /*put attacking PKMN into r2*/
cmp r2, r4                /*is the attacking PKMN the target?*/
beq SuperAttack        /*if so, prepare double damage*/
cmp r2, r5                /*is the attacking PKMN the user?*/
beq Attack                /*if so, attack*/
add r1, #0x1                /*move on to next attacking PKMN*/
b Loop

SuperAttack:
mov r1, #0x2
ldr r0, .DamageMultiplier
strb r1, [r0, #0x0]

Attack:
End:
pop {r0}
bx r0

.align 2

.UserBank: .word 0x02023D6B
.TargetBank: .word 0x02023D6C
.BattleStruct: .word 0x02023BE4
.BasePower: .word 0x02023F50
.TurnOrder: .word 0x02023bde
.DamageMultiplier: .word 0x02023FD2


Use this battle script:
Code:

#org @main
callasm 0x8(offset that you inserted the ASM + 1)
goto 0x81D6900


Payback animation (it's just Counter with the Dark BG):
Code:

14 00 17 00 97 27 00 9F 27 0A 03 0C 0C 08 03 7D 90 09 08 02 05 00 00 12 00 06 00 01 00 04 00 19 73 00 C0 05 02 9C 4E 3D 08 02 05 00 00 14 00 00 00 00 00 04 00 04 04 02 08 7C 3E 08 02 04 F1 FF 12 00 01 00 00 00 19 74 00 3F 04 01 03 F9 89 09 08 02 05 01 00 05 00 00 00 19 00 01 00 02 10 67 3E 08 03 05 F1 FF 12 00 08 00 01 00 00 00 04 03 02 08 7C 3E 08 02 04 00 00 FC FF 01 00 00 00 19 74 00 3F 04 01 02 10 67 3E 08 03 05 00 00 FC FF 08 00 01 00 00 00 04 03 02 08 7C 3E 08 02 04 0F 00 09 00 01 00 00 00 19 74 00 3F 04 01 02 10 67 3E 08 03 05 0F 00 09 00 08 00 01 00 00 00 04 05 02 84 4E 3D 08 02 03 00 00 00 00 05 00 05 0B 03 0D 0E C7 59 1D 08 08


Credit to DoesntKnowHowToPlay because I modified his Sucker Punch ASM for this.


Trump Card (FireRed):
Spoiler:
First, insert this ASM somewhere:
Code:

.text
.align 2
.thumb
.thumb_func
.global test

main:
push {lr}
ldr r0, .UserBank        /*get user slot*/
ldrb r0, [r0, #0x0]
ldr r1, .BattleData        /*load battle struct*/
mov r2, #0x58                /*separate into 4*/
mul r0, r2                /*get beginning of user stats*/
add r5, r0, r1                /*R5 should now have user's offset*/

GetWhichSlot:
mov r0, #0xBC                /*make sure this is your Trump Card move ID divided by 2*/
lsl r0, r0, #0x1        /*r0 should now have Trump Card ID*/
add r5, #0xC                /*check slot 1 move ID*/
ldrh r1, [r5]
cmp r0, r1
beq ver1
add r5, #0x2                /*check slot 2 move ID*/
ldrh r1, [r5]
cmp r0, r1
beq ver2
add r5, #0x2                /*check slot 3 move ID*/
ldrh r1, [r5]
cmp r0, r1
beq ver3
add r5, #0x2                /*check slot 4 move ID*/
ldrh r1, [r5]
cmp r0, r1
beq ver4

ver1:
add r5, #0x18
ldrb r0, [r5]                /*r0 should now have how much PP is left*/
b getPP

ver2:
add r5, #0x17
ldrb r0, [r5]                /*r0 should now have how much PP is left*/
b getPP

ver3:
add r5, #0x16
ldrb r0, [r5]                /*r0 should now have how much PP is left*/
b getPP

ver4:
add r5, #0x15
ldrb r0, [r5]                /*r0 should now have how much PP is left*/
b getPP

getPP:
cmp r0, #0x4
bgt FourOrMore
cmp r0, #0x4
beq FourOrMore
cmp r0, #0x3
beq Three
cmp r0, #0x2
beq Two
cmp r0, #0x1
beq One
cmp r0, #0x0
beq Zero

FourOrMore:
mov r0, #0x28
b StorePower

Three:
mov r0, #0x32
b StorePower

Two:
mov r0, #0x3C
b StorePower

One:
mov r0, #0x50
b StorePower

Zero:
mov r0, #0xC8
b StorePower

StorePower:
ldr r1, .BasePower
strb r0, [r1]

End:
pop {r0}
bx r0

.align 2
.BattleData:                .word 0x02023BE4
.UserBank:                .word 0x02023D6B
.BasePower:                .word 0x02023F50


If your Trump Card move ID isn't 0x178, then change the bolded line to your Trump Card move ID divided by 2.

The Battle Script ID has to be 17 (Swift/Feint Attack/attacks that never miss), otherwise it won't work properly. Replace the script with this:
Code:

#org @main
jumpifhalfword 0x0 0x2023D4A 0x178 @new
jumpifhalfword 0x1 0x2023D4A 0x39 0x81D6926
jumpifspecialstatusflag 0x0 0x40000 0x1 0x81D6926
orword 0x2023DD0 0x40000
setbyte 0x2023FD2 0x2

#org @new
attackcanceler
accuracycheck 0x81D695E 0x0
attackstring
ppreduce
callasm 0x8(offset of Trump Card ASM routine +1)
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2023FD8 0x0
cmd49 0x0 0x0
end




EDIT: Also here's my really lame Trump Card particle, for Trump Card I just used Swift's animation but with this particle instead:

My compiler doesn't recognise callasm. Which cmd do I need to update?

Actually my whole command.bsh is empty and everytime I redownload it is empty as well. Can someone please share it?

Xencleamas April 16th, 2015 9:17 AM

1 Attachment(s)

Rock Wrecker Animation (Emerald):


Code:

14 XX 17 03 61 76 11 08 05 04 00 F4 00 00 01 00 FF FF 00 AA 27 00 4A 27 00 97 27 0A 03 0C 0C 08 02 D8 72 59 08 02 04 04 00 01 00 0A 00 01 00 02 10 6C 59 08 02 05 14 00 20 00 D0 FF 32 00 02 00 02 10 6C 59 08 02 05 00 00 20 00 DA FF 19 00 05 00 02 10 6C 59 08 02 05 20 00 20 00 E4 FF 28 00 03 00 02 10 6C 59 08 02 05 EC FF 20 00 D0 FF 32 00 02 00 02 10 6C 59 08 02 05 14 00 20 00 E4 FF 3C 00 01 00 02 10 6C 59 08 02 05 00 00 20 00 E4 FF 1E 00 04 00 03 D1 52 0D 08 02 05 00 00 01 00 00 00 1E 00 01 00 19 AB 00 C0 04 0A 02 10 6C 59 08 02 05 0F 00 20 00 D0 FF 19 00 05 00 02 10 6C 59 08 02 05 F6 FF 20 00 D6 FF 1E 00 04 00 04 0A 02 10 6C 59 08 02 05 00 00 20 00 D6 FF 19 00 05 00 02 10 6C 59 08 02 05 E7 FF 20 00 D0 FF 1E 00 04 00 05 02 28 FE 57 08 02 02 04 00 06 00 04 03 19 B1 00 C0 02 98 6C 59 08 82 06 10 00 00 00 00 00 00 00 19 00 01 01 05 02 58 73 59 08 83 04 00 00 00 00 01 00 01 00 19 83 00 3F 02 1C 6B 59 08 82 06 00 00 00 00 14 00 18 00 0E 00 02 00 03 AD 51 0D 08 02 05 01 00 03 00 00 00 05 00 01 00 02 1C 6B 59 08 82 06 05 00 00 00 EC FF 18 00 0E 00 01 00 02 1C 6B 59 08 82 06 00 00 05 00 14 00 E8 FF 0E 00 02 00 02 1C 6B 59 08 82 06 FB FF 00 00 EC FF E8 FF 0E 00 02 00 05 02 58 FE 57 08 02 03 00 00 00 00 07 00 05 0B 03 0D 0E 15 7D 2D 08 08


The recharging stones part from the Ancient Power's animation then blast from the Rock Blast animation with an attack background like it was shown in D/P/Pt/HG/SS. The animation almost looks like from the games but I would make a particle of the Rock Wrecker soon.

But first, you need to have the attack backgrounds expanded. If you don't know how, read this thread: http://www.pokecommunity.com/showthread.php?t=281520. If you do, you need to have the image, palette, and tilemap inserted in game. To where you have inserted it, replace XX with that value (example: 1B is the background). The image, palette, and tilemap are in the zip in the attachment below. Credits to MrDollSteak for the Rock Wrecker background. Sorry to rip from your ROM Base since it is an open resource anyway. :3

kleenexfeu April 17th, 2015 6:32 AM

Here is Frost breath effect for Emerald :

1E 00 04 00 8A 2D 08 1E 00 4B 00 8A 2D 08 01 5E 8A 2D 08 00 00 00 02 03 2E 11 42 02 02 02 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 28 47 8A 2D 08

Thank's to pawell6, I've just changed some pointers

Quote:

Originally Posted by Edwearth (Post 8586395)
Hello, I ported some effects you made for Fire Red to Emerald.

Blizzard Updated :
Spoiler:

Code:

#dynamic 0xF00000
#freespacebyte 0xFF

#org @blizzard
setbyte 0x2024335 0x4
jumpifhalfword 0x0 weather 0x80 @notmiss
goto 0x82D8A00

#org @notmiss
attackcanceler
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2024488 0x0
cmd49 0x0 0x0
end




Charge Updated :
Spoiler:

Code:

#dynamic 0xF00000
#freespacebyte 0xFF

#org @charge
attackcanceler
attackstring
ppreduce
setcharge
attackanimation
waitanimation
printstring 0xA5
waitmessage 0x40
jumpifstat 0x1 0x0 0x5 0xC 0x82D8A4E
setbyte 0x202448E 0x15
statbuffchange 0x1 true 0x82D8A4E
jumpifbyte 0x0 0x2024337 0x2 0x82D8A4E
playstatchangeanimation 0x1 0x30 0x0
printfromtable 0x85CC89
waitmessage 0x40
goto 0x82D8A4E




Freeze Shock Ice Burn and Sky Attack :
Spoiler:

Code:

#dynamic 0xF00000
#freespacebyte 0xFF

#org @moveselect
jumpifhalfword 0x0 0x20241EA 0xXX @freejshock //replace XX with ID of freeze shock
jumpifhalfword 0x0 0x20241EA 0xYY @iceburn //replace YY with ID of ice burn
goto @skyattack

#org @skyattack
jumpifsecondarystatus 0x1 0x1000 0x82D9040
jumpifword 0x4 0x2024280 0x200 0x82D9040
setbyte 0x2024483 0x3
call @firstturnsk
goto 0x82D8A4E

#org @firstturnsk
attackcanceler
attackstring
waitmessage 0x40
ppreduce
attackanimation
waitanimation
orword 0x2024280 0x8000000
setbyte 0x2024335 0x4C
seteffecttarget
copyarray 0x2024337 0x2024483 0x1
setword 0x202C4D0 0x8CCCCCC
printstring 0x184
waitmessage 0x40
return

#org @freejshock
jumpifsecondarystatus 0x1 0x1000 @executefs
jumpifword 0x4 0x2024280 0x200 @executefs
setbyte 0x2024483 0x3
call @firstturnfs
goto 0x82D8A4E

#org @executefs
attackcanceler
setbyte 0x2024335 0xC
setbyte 0x202448C 0x1
clearstatus 0x1
orword 0x2024280 0x800
jumpiftype 0x0 0xD 0x82D8A4B
setbyte 0x2024335 0x5
goto 0x82D8A27

#org @firstturnfs
attackcanceler
attackstring
waitmessage 0x40
ppreduce
attackanimation
waitanimation
orword 0x2024280 0x8000000
setbyte 0x2024335 0x4C
seteffecttarget
copyarray 0x2024337 0x2024483 0x1
setword 0x202C4D0 0x8BBBBBB
printstring 0x184
waitmessage 0x40
return

#org @iceburn
jumpifsecondarystatus 0x1 0x1000 @executeib
jumpifword 0x4 0x2024280 0x200 @executeib
setbyte 0x2024483 0x3
call @firstturnib
goto 0x82D8A4E

#org @executeib
attackcanceler
setbyte 0x2024335 0xC
setbyte 0x202448C 0x1
clearstatus 0x1
orword 0x2024280 0x800
jumpiftype 0x0 0xA 0x82D8A4B
setbyte 0x2024335 0x3
goto 0x82D8A27

#org @firstturnib
attackcanceler
attackstring
waitmessage 0x40
ppreduce
attackanimation
waitanimation
orword 0x2024280 0x8000000
setbyte 0x2024335 0x4C
seteffecttarget
copyarray 0x2024337 0x2024483 0x1
setword 0x202C4D0 0x8AAAAAA
printstring 0x184
waitmessage 0x40
return

//Ice Burn AAAAAA -> FD 0F B4 E7 00 D6 D9 D7 D5 E1 D9 00 D7 E0 E3 D5 DF D9 D8 FE DD E2 00 D5 00 DA E6 D9 D9 EE DD E2 DB 00 D5 DD E6 AB
//Freeze Shock BBBBBB -> FD 0F B4 E7 00 D6 D9 D7 D5 E1 D9 00 D7 E0 E3 D5 DF D9 D8 FE DD E2 00 D5 00 DA E6 D9 D9 EE DD E2 DB 00 E0 DD DB DC E8 AB
//Sky Attack CCCCCC -> FD 0F B4 E7 00 D6 D9 D7 D5 E1 D9 00 D7 E0 E3 D5 DF D9 D8 FE DD E2 00 D5 00 DC D5 E6 E7 DC 00 E0 DD DB DC E8 AB


If you have a problem with this one, compile each sub-script with one FF octet between them.


Geomancy :
Spoiler:

Code:

#dynamic 0xF00000
#freespacebyte 0xFF

#org @geomancy
jumpifsecondarystatus 0x1 0x1000 @execute
jumpifword 0x4 0x2024280 0x200 @execute
setbyte 0x2024483 0x3
call @firstturn
goto 0x82D8A4E

#org @execute
attackcanceler
setbyte 0x2024335 0xC
setbyte 0x202448C 0x1
clearstatus 0x1
orword 0x2024280 0x800
goto @boost

#org @boost
attackstring
ppreduce
jumpifstat 0x1 0x3 0x4 0xC @spattack
jumpifstat 0x1 0x3 0x5 0xC @spattack
jumpifstat 0x1 0x0 0x3 0xC 0x82DA71D
goto @spattack

#org @spattack
attackanimation
waitanimation
setbyte 0x202448F 0x0
playstatchangeanimation 0x1 0x30 0x0
setbyte 0x202448E 0x24
statbuffchange 0x1 true @spdef
jumpifbyte 0x0 0x2024337 0x2 @spdef
printfromtable 0x85CC89C
waitmessage 0x40
goto @spdef

#org @spdef
setbyte 0x202448E 0x25
statbuffchange 0x1 true @speed
jumpifbyte 0x0 0x2024337 0x2 @speed
printfromtable 0x85CC89C
waitmessage 0x40
goto @speed

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

#org @firstturn
attackcanceler
attackstring
waitmessage 0x40
ppreduce
attackanimation
waitanimation
orword 0x2024280 0x8000000
setbyte 0x2024335 0x4C
seteffecttarget
copyarray 0x2024337 0x2024483 0x1
printstring 0xA5
waitmessage 0x40
return




Hex :
Spoiler:

Code:

#dynamic 0xF00000
#freespacebyte 0xFF

#org @hex
jumpifstatus 0x0 0x10 @doubledamage
jumpifstatus 0x0 0x8 @doubledamage
jumpifstatus 0x0 0x80 @doubledamage
jumpifstatus 0x0 0x40 @doubledamage
jumpifstatus 0x0 0x7 @doubledamage
goto 0x82D8A00

#org @doubledamage
setbyte damagemultiplier 0x2
goto 0x82D8A00




Venoshock :
Spoiler:

Code:

#dynamic 0xF00000
#freespacebyte 0xFF

#org @hex
jumpifstatus 0x0 0x8 @doubledamage
goto 0x82D8A00

#org @doubledamage
setbyte damagemultiplier 0x2
goto 0x82D8A00




Knock Off Updated :
Spoiler:

Code:

#dynamic 0xF00000
#freespacebyte 0xFF

#org @start
jumpifbyte 0x0 0x0202420C 0x0 @slot1
jumpifbyte 0x0 0x0202420C 0x1 @slot2
jumpifbyte 0x0 0x0202420C 0x2 @slot3
jumpifbyte 0x0 0x0202420C 0x3 @slot4
goto @doubledamage

#org @slot1
jumpifhalfword 0x1 0x020240C2 0x0 @tripledamage
goto @doubledamage

#org @slot2
jumpifhalfword 0x1 0x0202411A 0x0 @tripledamage
goto @doubledamage

#org @slot3
jumpifhalfword 0x1 0x02024172 0x0 @tripledamage
goto @doubledamage

#org @slot4
jumpifhalfword 0x1 0x020241CA 0x0 @tripledamage
goto @doubledamage

#org @tripledamage
setbyte damagemultiplier 0x3
goto 0x82DA390

#org @doubledamage
setbyte damagemultiplier 0x2
goto 0x82D8A00




Toxic Updated :
Spoiler:

Code:

#dynamic 0xF00000
#freespacebyte 0xFF

#org @Start
jumpiftype 0x1 0x3 @PerfectAcc
goto 0x82D8EF1

#org @PerfectAcc
attackcanceler
attackstring
ppreduce
accuracycheck 0x82D9F1C 0xFFFF
jumpifability 0x0 0x11 0x82D8F63
jumpifsecondarystatus 0x0 0x1000000 0x82D9F1C
jumpifstatus 0x0 0x8 0x82D8F52
jumpifstatus 0x0 0x80 0x82D8F52
jumpifstatus 0x0 0xFF 0x82D9F1C
jumpiftype 0x0 0x3 0x82D9F2E
jumpiftype 0x0 0x8 0x82D9F2E
jumpifhalverset 0x0 0x20 0x82DAD01
attackanimation
waitanimation
setbyte 0x2024335 0x6
seteffecttarget
resultmessage
waitmessage 0x40
goto 0x82D8A4E




I also made one effect by myself. (For Emerald too).

U-Turn :
Spoiler:

Code:

#dynamic 0xF00000

#org @start
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
jumpifword 0x4 0x2022FEC 0x40000 0x82D9F1C
jumpifcannotswitch 0x81 0x82D9F1C
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
faintpokemon 0x0 0x0 0x0
openpartyscreen 0x1 0x82D9F1C
cmde2 0x1
waitstate
cmd51 0x1 0x2
cmd58 0x1
switch1 0x1
switch2 0x1
cmd73 0x1
printstring 0x3
switch3 0x1 0x1
waitstate
cmd52 0x1
goto 0x82D8A4E




PS : I wanted to created an effect like Judgment, but I don't know if there is a function to set the attack's type. And I don't remember the function to check the held object. Also, is it possible to change the ratio of drained HP in the drain effect, in order to make Oblivion Wing ? Thanks.

Didn't test the other, but U-turn doesn't take in count Shadowtag ability. A jumpifability 0x0 0x17 should be enough I guess
And it fail if you have only one pokemon

EDIT : Nope, I still can switch in double battle. And the move completely fail in one vs one. It's a progress I guess..

mamamama April 21st, 2015 5:25 PM

Quote:

Originally Posted by KDS (Post 8503532)
4. Cure Primary Status Command

Tested your command out on Emerald and got some weird result. Since the final command on the Emerald Battle Command Table is F8, and I use F9 for callasm, I set cureprimarystatus as FA.

When I tried to attack a sleeping opponent with Wake-Up Slap, the game froze when the battle script reached cureprimary status.

I pretty much copy pasted all your stuff so it should be all right. I did not forget to put +1 at asm offsets either.

EDIT: Scald just completely glitches out before the attack-animation. This is unlikely to be due to the command though.

Trainer 781 April 22nd, 2015 2:33 AM

Quote:

Originally Posted by mamamama (Post 8718490)
Tested your command out on Emerald and got some weird result. Since the final command on the Emerald Battle Command Table is F8, and I use F9 for callasm, I set cureprimarystatus as FA.

When I tried to attack a sleeping opponent with Wake-Up Slap, the game froze when the battle script reached cureprimary status.

I pretty much copy pasted all your stuff so it should be all right. I did not forget to put +1 at asm offsets either.

EDIT: Scald just completely glitches out before the attack-animation. This is unlikely to be due to the command though.

Weird.
Shouldn't happen. I have tested this on emerald too and it is working fine. I recommend to cross-check everything.

mamamama April 22nd, 2015 9:14 AM

Quote:

Originally Posted by KDS (Post 8719063)
Weird.
Shouldn't happen. I have tested this on emerald too and it is working fine. I recommend to cross-check everything.

Got it to work. Sorry for bothering :) Was working with two roms and mixed them up.

Edit: Also, great job on this. Really appreciate it!

mamamama April 25th, 2015 1:27 AM

Quote:

Originally Posted by KDS (Post 8719063)
Psycho Shift

Quick question: I'm trying to get your Psycho Shift to work, but I just get "the move failed" every time. When I tried to complie the script, BSP wouldn't let me include "#include std.bsh" -- could that be the reason?

What does std.bsh do and would you know how I can get BSP to compile with it?

Trainer 781 April 25th, 2015 2:13 AM

Quote:

Originally Posted by mamamama (Post 8723256)
Quick question: I'm trying to get your Psycho Shift to work, but I just get "the move failed" every time. When I tried to complie the script, BSP wouldn't let me include "#include std.bsh" -- could that be the reason?

What does std.bsh do and would you know how I can get BSP to compile with it?

If you have probleMs with the include statement then remove it and replace every instance BANK_TARGET with 0x0 and BANK_USER with 0x1

kleenexfeu April 26th, 2015 7:10 AM

Made a routine that changes the attack into the user's primary type (Judgment...), here :

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

main:
push {lr}
ldr r0, .UserBank
ldr r1, .BattleData
ldrb r0, [r0]
mov r2, #0x58
mul r0, r2
add r1, #0x21
add r1, r0
ldrb r1, [r1]
ldr r0, .MemAddress
ldr r0, [r0]
add r0, #0x13
strb r1, [r0]
pop {r0}
bx r0

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


Just callasm this routine before the attackcanceler in battle script. Pm if there is bug/problem/other
I think it's not optimized but whatever, it works. I'll see if I can change it

Edited, thanks KDS

Trainer 781 April 28th, 2015 11:54 AM

Quote:

Originally Posted by kleenexfeu (Post 8724807)
Judgment

Only problem in 2 lines.
1. mul r2,r0 should be mul r0,r2 (this can spoil the results)
2. ldrh r0, [r1] is redundant not needed.

Also for anyone wanting this for FR:
Code:

.BattleData:.word 0x02023BE4
.UserBank:.word 0x02023D6B
.MemAddress:.word 0x02023fe8


Quote:

Originally Posted by Chaos Rush (Post 8684025)
Natural Gift for FireRed:

I actually got this and Judgement without the help of your second routine.
It is also displaying the correct outcome and the proper effectiveness sound is playing.
(I used Tackle and Move Effect ID 1 for this).

The problem lies with the placement of the 1st routine.
The battle script should be:
Code:

#org @main
callasm 0x8(offset of ASM ROUTINE 1+1)
attackcanceler
accuracycheck 0x81D695E 0x0
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
jumpifbyte 0x4 0x02023DCC 0x8 0x81D694E
removeitem 0x1
goto 0x81D6947


Move type changing routines should be placed before the attack canceler because it contains checks for abilities like Flash Fire, Water Absorb etc. The original battle script wouldn't account for this.
Also this might be the reason why the outcome might not be properly handled.
Judgment should a script like that of Weatherball i.e callasm then goto the regular attack routine.

Also the fail address pointer in the 1st routine should be (0x081D7DF2 - 0x5). Even though with the original value it is working. It might not be the case with other scripts.
While branching to custom scripts with callasm command, 0x5 must be subtracted from their offset, because callasm always adds 0x5 to the script pointer regardless of the branch.

mamamama May 2nd, 2015 11:57 AM

Did any1 find a way to make Bind etc. do 1/8 damage as opposed to 1/16? I know it's been found for Rough skin so I guess it would only require a byte change or two.

Trainer 781 May 9th, 2015 1:33 AM

Quote:

Originally Posted by kleenexfeu (Post 8741928)
[/spoiler]

Got a problem here. I put my routine before the attackcanceler as you adviced, water/volt absorb didn't work, but levitate did. Do I have to callasm (myroutine - 0x5 +1) or (myroutine - 0x5) or just (myroutine +1) as usual ? I didn't get what you said in your last post.

Hmm, I'll like into the volt absorb thingy if I have time.
Routine+1 is correct. (The -5 is for an alternate script. It is used if the routine specified in the callasm command can branch to more than one different battle scripts.)
Accuracy checker should be there in thd battle script. If you want infinite accuracy you can just set the move accuracy to zero using an editor.

kleenexfeu May 11th, 2015 2:33 AM

Quote:

Originally Posted by KDS (Post 8742958)
Hmm, I'll like into the volt absorb thingy if I have time.
Routine+1 is correct. (The -5 is for an alternate script. It is used if the routine specified in the callasm command can branch to more than one different battle scripts.)
Accuracy checker should be there in thd battle script. If you want infinite accuracy you can just set the move accuracy to zero using an editor.

Thank's, so that's what I did.

For the accuracy, I just followed the Jambo51's advice in his tutorial. Because set accuracy to zero make the move always miss, but set it to 255 will make it never miss. The problem is I don't like seeing accuracy = 255 in move description, it doesn't look legit at all.

Would be great to have a routine that make appear "---" instead of "255" but anyway. Would be cool if you find a way to fix absorb ability

Trainer 781 May 11th, 2015 9:08 AM

Quote:

Originally Posted by kleenexfeu (Post 8745854)
Thank's, so that's what I did.

For the accuracy, I just followed the Jambo51's advice in his tutorial. Because set accuracy to zero make the move always miss, but set it to 255 will make it never miss. The problem is I don't like seeing accuracy = 255 in move description, it doesn't look legit at all.

Would be great to have a routine that make appear "---" instead of "255" but anyway. Would be cool if you find a way to fix absorb ability

Actually it seems that the absorb abilities are called from the accuracy checker command. So you need to include the accuracy checker as well.
To set the move accuracy to display --- , you need to set the accuracy to 0.
Judgment has 100% accuracy according to bulbapedia not infinite.
Also, you can reduce Judgement's battle script to 2 lines only.
I.e 1. callasm offset
2. goto basic damage script

kleenexfeu May 13th, 2015 3:49 AM

Quote:

Originally Posted by KDS (Post 8285216)
Spoiler:
Found Jambo's callasm method (link here) in battle scripts by seeing Chaos Rush's roost effect post.

So made two effects using the callasm method and Tlachti's decimal damage manipulation ASM code, which is found here.

1. Knock Off (Better Alternative)
Code:

#dynamic 0x(YourOffset)
#freespacebyte 0xFF

#org @start
jumpifbyte 0x0 0x02023D6C 0x0 @slot1
jumpifbyte 0x0 0x02023D6C 0x1 @slot2
jumpifbyte 0x0 0x02023D6C 0x2 @slot3
jumpifbyte 0x0 0x02023D6C 0x3 @slot4

#org @slot1
jumpifhalfword 0x1 0x02023C12 0x0 @knock
goto 0x081D6926

#org @slot2
jumpifhalfword 0x1 0x02023C6A 0x0 @knock
goto 0x081D6926

#org @slot3
jumpifhalfword 0x1 0x02023CC2 0x0 @knock
goto 0x081D6926

#org @slot4
jumpifhalfword 0x1 0x02023D1A 0x0 @knock
goto 0x081D6926

#org @knock
setbyte 0x2023E85 0x36
attackcanceler
accuracycheck 0x81D695E 0x0
attackstring
ppreduce
callculatedamage
cmdF8  0x([Offset to 1.5x damage asm]+1)
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
seteffectwithchancetarget
faintpokemon 0x0 0x0 0x0
setbyte 0x2023FD8 0x0
cmd49 0x0 0x0
end


This knock off script is much better it as does not required base power change (set to 65), and better AI understanding (not perfect though) and also does not give techician mons a undesirable boost as mine first script does, but requires the ability to insert ASM and repointing tables.
--
2. Metal Burst
Code:

#dynamic 0x720000
#freespacebyte 0xFF

#org @start
jumpifhalfword B_== 0x2023D4A 0x44 0x81D7433
attackcanceler
counterdamagecalculator @specialpass
accuracycheck 0x81D695E 0x0
attackstring
ppreduce
damagecalc2
cmd69
cmdF8 0x([Offset to 0.75x damage asm]+1)
goto 0x81D6934

#org @specialpass
mirrorcoatdamagecalculator 0x81D7DF0
accuracycheck 0x81D695E 0x0
attackstring
ppreduce
damagecalc2
cmd69
cmdF8 0x([Offset to 0.75x damage asm]+1)
goto 0x81D6934


Understanding Doesnt's point on mapping new effects to similar old effects so that AI can use them in a better way, this script is meant to replace the original counter script (so change the counter's original pointer in the effect table to the inserted scripts's location). It branches to counter's effect if the move ID is of counter, otherwise it executes metal burst's effect. This also requires Jambo's callasm method.
--
The way of inserting these two codes is:
i.) First use Jambo's callasm method, if already done then skip this step.
ii.) Insert this in command.bsh by opening in notepad, if already done then skip this step also
Code:

#command cmdF8 0xF8 0x1 "Offset of routine" 0x4
#command cmd69 0x69 0x0
#command cmd98 0x98 0x1 "Byte" 0x1


iii). View Tlachtli's ASM routines and change 0x020241F0 to 0x02023d50 in the last line before compiling to make them working for FR.
iv) Then insert the compiled decimal multiplier ASM routines using an Hex Editor.
v) Then insert the battle scripts using BSP.
--
3. Soak (no callasm required):
Code:

#dynamic 0x720000
#freespacebyte 0xFF

#org @start
attackcanceler
accuracycheck 0x1D695E 0x0
attackstring
ppreduce
jumpifsecondarystatus 0x0 0x1000000 0x81D7DF2
attackanimation
waitanimation
jumpifbyte 0x0 0x02023D6C 0x0 @slot1
jumpifbyte 0x0 0x02023D6C 0x1 @slot2
jumpifbyte 0x0 0x02023D6C 0x2 @slot3
jumpifbyte 0x0 0x02023D6C 0x3 @slot4

#org @slot1
setbyte 0x2023C05 0xB
setbyte 0x2023C06 0xB
goto 0x81D694E

#org @slot2
setbyte 0x2023C5D 0xB
setbyte 0x2023C5E 0xB
goto 0x81D694E

#org @slot3
setbyte 0x2023CB5 0xB
setbyte 0x2023CB6 0xB
goto 0x81D694E

#org @slot4
setbyte 0x2023D0D 0xB
setbyte 0x2023C06 0xB
goto 0x81D694E



Here is the knock off effect for emerald

Spoiler:
#dynamic 0xYouroffset
#freespacebyte 0xFF

#org @start
jumpifbyte 0x0 0x0202420C 0x0 @slot1
jumpifbyte 0x0 0x0202420C 0x1 @slot2
jumpifbyte 0x0 0x0202420C 0x2 @slot3
jumpifbyte 0x0 0x0202420C 0x3 @slot4

#org @slot1
jumpifhalfword 0x1 0x020240C2 0x0 @knock
goto 0x082D8A26

#org @slot2
jumpifhalfword 0x1 0x0202411A 0x0 @knock
goto 0x082D8A26

#org @slot3
jumpifhalfword 0x1 0x02024172 0x0 @knock
goto 0x082D8A26

#org @slot4
jumpifhalfword 0x1 0x020241CA 0x0 @knock
goto 0x082D8A26

#org @knock
setbyte 0x2024335 0x36
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
callasm 0x8yourroutine+1
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

mamamama May 14th, 2015 5:31 AM

Quote:

Originally Posted by kleenexfeu (Post 8719846)
Changing type seems to work, but not Base power

You are using the wrong RAM pointer for Base power.

Instead of 020244E0, use 02024400.

I ported Chaos Rush's Natural gift to Emerald and used the same offsets as you do except for this Base power change, so I assume it should work for Judgement as well. When setting power in G3T/PGE, just set it as 0 and the routine will calculate it for you.

EDIT: Tried to change mine to 020244E0 and the Base Power no longer worked.

kleenexfeu May 14th, 2015 6:14 AM

Quote:

Originally Posted by mamamama (Post 8750184)
You are using the wrong RAM pointer for Base power.

Instead of 020244E0, use 02024400.

I ported Chaos Rush's Natural gift to Emerald and used the same offsets as you do except for this Base power change, so I assume it should work for Judgement as well. When setting power in G3T/PGE, just set it as 0 and the routine will calculate it for you.

EDIT: Tried to change mine to 020244E0 and the Base Power no longer worked.

Oh thanks to pointing me. But since then I made a new routine (few post above), far more simple than the chaos Rush one. And since a power of 100 is displayed for Judgment, it's much more approriated IMO. Though don't hesitate to post the good Natural Gift routine :)

mamamama May 14th, 2015 6:38 AM

Natural Gift for Emerald offsets collected:
(Follow Chaos Rush's post)

ASM 1

Spoiler:
Code:

.BattleData:        .word 0x02024084
.UserBank:        .word 0x0202420B
.BasePower: .word 0x02024400
.MemAddress:        .word 0x0202449C
.CurrentScript: .word 0x02024214
.FailScript: .word 0x082D9F15
.NaturalGiftTable:        .word 0x08(OFFSET OF NATURAL GIFT TABLE)




ASM 2

Spoiler:
Code:

.Outcome:        .word 0x0202427C
.TypeChart:        .word 0x08XXXXXX /*make sure you replace this with the offset of your own type chart*/
.BattleData:        .word 0x02024084
.TargetBank:        .word 0x0202420C
.MemAddress:        .word 0x0202449C




Fixed battle script for Volt Absorb etc.

Spoiler:
Code:

#org @main
callasm 0x8(offset of ASM ROUTINE 1+1)
attackcanceler
accuracycheck 0x82D8A5E 0x0
attackstring
ppreduce
calculatedamage
callasm 0x8(offset of ASM ROUTINE 2+1)
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
jumpifbyte 0x4 0x0202427C 0x8 0x82D8A4E
removeitem 0x1
goto 0x82D8A47




And the animation...
Spoiler:
Code:

02 74 72 59 08 02 05 01 00 01 00 00 00 0A 00 ED 33 05 03 D5 F7 10 08 02 00 19 F3 00 C0 04 10 19 F3 00 C0 05 00 97 27 0A 01 0C 0C 08 19 86 00 3F 02 58 73 59 08 02 04 00 00 00 00 01 00 02 00 03 AD 51 0D 08 02 05 01 00 03 00 00 00 06 00 01 00 05 0B 01 0D 02 74 72 59 08 02 05 01 00 01 00 0A 00 00 00 ED 33 05 0B 03 0D 08




---------------------------------------------------------
Play Nice, Emerald

Move Effect (Infinite Accuracy; Misses during Dig and Fly; Do not check the "affected by Protect" box; Attached to Growl's effect)

Spoiler:
Code:

#dynamic 0x(Offset)
#freespacebyte 0xFF

#org @pickmove
setbyte 0x202448E 0x91
jumpifhalfword 0x0 0x20241EA 0x(Movenumber) @PlayNice
goto 0x82D8D16

#org @PlayNice
attackcanceler
jumpifsecondarystatus BANK_TARGET 0x1000000 0x82D9F1A
attackstring
ppreduce
accuracycheck 0x82D9F1C 0xFFFF
statbuffchange 0x1 false 0x82D8D60
jumpifbyte 0x3 0x2024337 0x2 0x82D8D4E
jumpifbyte B_= 0x2024337 0x3 0x82D8D60
pause DELAY_HALFSECOND
goto 0x82D8D58




I use this Animation

Spoiler:
Code:

00 E8 27 1C D4 00 C0 0C 03 03 B9 5E 0D 08 05 05 00 00 0C 00 00 10 04 00 00 00 04 0F 02 A0 39 59 08 83 02 14 00 F8 FF 08




----------------------------------------

In Emerald, to update Minimize to its Gen VI effect, Change 0x2D9867 to 27

-----------------------------------------

kleenexfeu May 15th, 2015 10:25 PM

Quote:

Originally Posted by mamamama (Post 8750279)
In Emerald, to update Minimize to its Gen VI effect, Change 0x2D9867 to 27

Here you set the always hit flag, then the evasiness up won't be of any use. Or am I missing something ?

mamamama May 15th, 2015 11:31 PM

Quote:

Originally Posted by kleenexfeu (Post 8752720)
Here you set the always hit flag, then the evasiness up won't be of any use. Or am I missing something ?

It's not for Body Slam etc. always hit effects, it's simply to make minimize raise the stats two steps instead of one.

mamamama May 16th, 2015 5:18 AM

Quote:

Originally Posted by Chaos Rush (Post 8685897)
Me First

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?

kleenexfeu May 19th, 2015 8:09 AM

Quote:

Originally Posted by kleenexfeu (Post 8724807)
Made a routine that changes the attack into the user's primary type (Judgment...), here :

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

main:
push {lr}
ldr r0, .UserBank
ldr r1, .BattleData
ldrb r0, [r0]
mov r2, #0x58
mul r2, r0
add r1, #0x21
add r1, r0
ldrb r1, [r1]
ldr r0, .MemAddress
ldr r0, [r0]
add r0, #0x13
strb r1, [r0]
pop {r0}
bx r0

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


Just callasm this routine before the attackcanceler in battle script. Pm if there is bug/problem/other
I think it's not optimized but whatever, it works. I'll see if I can change it

Edited, thanks KDS

Quote:

Originally Posted by KDS (Post 8727582)
Spoiler:
Only problem in 2 lines.
1. mul r2,r0 should be mul r0,r2 (this can spoil the results)
2. ldrh r0, [r1] is redundant not needed.

Also for anyone wanting this for FR:
Code:

.BattleData:.word 0x02023BE4
.UserBank:.word 0x02023D6B
.MemAddress:.word 0x02023fe8




I actually got this and Judgement without the help of your second routine.
It is also displaying the correct outcome and the proper effectiveness sound is playing.
(I used Tackle and Move Effect ID 1 for this).

The problem lies with the placement of the 1st routine.
The battle script should be:
Code:

#org @main
callasm 0x8(offset of ASM ROUTINE 1+1)
attackcanceler
accuracycheck 0x81D695E 0x0
attackstring
ppreduce
calculatedamage
attackanimation
waitanimation
missmessage
cmd5c 0x0
waitstate
graphicalhpupdate 0x0
datahpupdate 0x0
critmessage
waitmessage 0x40
resultmessage
waitmessage 0x40
jumpifbyte 0x4 0x02023DCC 0x8 0x81D694E
removeitem 0x1
goto 0x81D6947


Move type changing routines should be placed before the attack canceler because it contains checks for abilities like Flash Fire, Water Absorb etc. The original battle script wouldn't account for this.
Also this might be the reason why the outcome might not be properly handled.
Judgment should a script like that of Weatherball i.e callasm then goto the regular attack routine.

Also the fail address pointer in the 1st routine should be (0x081D7DF2 - 0x5). Even though with the original value it is working. It might not be the case with other scripts.
While branching to custom scripts with callasm command, 0x5 must be subtracted from their offset, because callasm always adds 0x5 to the script pointer regardless of the branch.

That that the routine judgment won't work for a move that is not 0x0 type and you want to change to 0x0 type. Exemple : You have an fire (0xA) attack that uses this routine, and your primary type is normal(0x0), then the attack won't be changed to normal. This is because the MemAddress if by default 0, so set 0 at this place doesn't change anything. I don't know how to fix it atm but it's not a huge issue since every attack that are supposed to change type are normal by default. Just wanted to note

Trainer 781 May 19th, 2015 9:23 AM

Quote:

Originally Posted by kleenexfeu (Post 8757307)
That that the routine judgment won't work for a move that is not 0x0 type and you want to change to 0x0 type. Exemple : You have an fire (0xA) attack that uses this routine, and your primary type is normal(0x0), then the attack won't be changed to normal. This is because the MemAddress if by default 0, so set 0 at this place doesn't change anything. I don't know how to fix it atm but it's not a huge issue since every attack that are supposed to change type are normal by default. Just wanted to note

Yes this happens because the 'type effectiveness calculator' command first checks the content of the dynamic memory location allocated for the type. If its content is zero, then it starts retrieving the type from the move table.
So in a nutshell, the content of the loc is 0x0 if you use a normal type mon, and then it reads from the move table picking up the fire type changing it to fire.
And I don't see the point of changing this unless you are going for a truly wacky custom move.

kleenexfeu May 20th, 2015 9:21 PM

Update

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

Spoiler:

Emerald:
Spoiler:

Alter the Defense-boost abilities :
Spoiler:

Code:

.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:

Code:

.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:

Code:

.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 :
Code:

#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






All times are GMT -8. The time now is 8:46 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.