Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Reload this Page Development: Move Resource Thread

Notices
For all updates, view the main page.

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.



Reply
 
Thread Tools
  #251    
Old May 20th, 2015 (09:21 PM). Edited May 20th, 2015 by kleenexfeu.
kleenexfeu kleenexfeu is offline
 
Join Date: Aug 2013
Gender: Male
Posts: 108
PsyStrike effect for Emerald :

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

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

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


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

With that Mewtwo will take down Blissey !

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

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

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

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


So here you have to set the move "Physical" and it'll work exactly as expected, you still have to callasm this routine before AND after calculate damage in BSP.

EDIT : as mentioned below there's still things to fix, I'll look into that
Reply With Quote
  #252    
Old May 20th, 2015 (10:15 PM).
MrDollSteak's Avatar
MrDollSteak MrDollSteak is online now
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 20
Gender: Male
Posts: 537
Quote originally posted by kleenexfeu:
PsyStrike effect for Emerald :

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

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

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


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

With that Mewtwo will take down Blissey !

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

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

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

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


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

The best way to do it as far as I can tell would be to have a check in the damage calculation for the move effect, as opposed to a custom battle script, which means you can place it after different multipliers. I'd probably find where it actually loads the 'fully treated' Sp. Attack of the user and Sp. Defense of the opponent, and just load the Defense stat instead.
__________________
Reply With Quote
  #253    
Old May 25th, 2015 (10:14 PM). Edited May 26th, 2015 by destinedjagold.
destinedjagold's Avatar
destinedjagold destinedjagold is online now
Oh Hai Thar~ 'ω'
Silver Tier
 
Join Date: May 2007
Location: Philippines
Gender: Male
Nature: Careful
Posts: 7,195
Effect: Confide for Ruby...
Code:
2E 1E 60 01 02 94 28 27 72 1D 08
Effect: Acid Spray for Ruby...
Code:
2E 21 4D 02 02 B2 28 14 6F 1D 08
__________________


3DS FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote
  #254    
Old May 26th, 2015 (04:26 PM).
MrDollSteak's Avatar
MrDollSteak MrDollSteak is online now
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 20
Gender: Male
Posts: 537
Quote originally posted by kleenexfeu:
Dark Void effect :

Spoiler:
Code:
#freespace 0xFF
#dynamic 0xYourOffset

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

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

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

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

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


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

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

Any help would be appreciated.
The move doesn't put your partner to sleep. Only your two opponents.
Also shouldn't you include a move check at the start, otherwise every single sleep move is going to hit both foes.
__________________
Reply With Quote
  #255    
Old May 26th, 2015 (05:20 PM).
destinedjagold's Avatar
destinedjagold destinedjagold is online now
Oh Hai Thar~ 'ω'
Silver Tier
 
Join Date: May 2007
Location: Philippines
Gender: Male
Nature: Careful
Posts: 7,195
Quote originally posted by kleenexfeu:
Yes and nope.

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

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


3DS FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote
  #256    
Old May 26th, 2015 (09:24 PM).
mamamama mamamama is offline
 
Join Date: Feb 2014
Posts: 166
Quote originally posted by kleenexfeu:
Dark Void effect for Emerald
With damaging moves, it's enough to just set target as "both foes" in order to hit both opponents, while you have to make an entirely new script similar to that of earthquake if you want the move to also hit your ally.

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

I don't have a save near a double battle to test with.
Reply With Quote
  #257    
Old May 26th, 2015 (09:27 PM).
kleenexfeu kleenexfeu is offline
 
Join Date: Aug 2013
Gender: Male
Posts: 108
Quote originally posted by mamamama:
With damaging moves, it's enough to just set target as "both foes" in order to hit both opponents, while you have to make an entirely new script similar to that of earthquake if you want the move to also hit your ally.

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

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

EDIT : Oh yeah.. you're right, I guess I can delete my previous posts lol
Reply With Quote
  #258    
Old May 26th, 2015 (09:35 PM).
KDS's Avatar
KDS KDS is offline
 
Join Date: Jul 2013
Age: 20
Gender: Male
Posts: 188
Quote originally posted by kleenexfeu:
I actually thought that dark void was supposed to asleep everyone so I made this script. But testing with just selecting "both foe" deserves indeed a try.

EDIT : Oh yeah.. you're right, I guess I can delete my previous posts lol
IMO it should work, because 'target both foes' automatically re-runs the same battle script for differrent foes.
Reply With Quote
  #259    
Old May 26th, 2015 (11:10 PM).
MrDollSteak's Avatar
MrDollSteak MrDollSteak is online now
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 20
Gender: Male
Posts: 537
Quote originally posted by kleenexfeu:
I actually thought that dark void was supposed to asleep everyone so I made this script. But testing with just selecting "both foe" deserves indeed a try.

EDIT : Oh yeah.. you're right, I guess I can delete my previous posts lol
I've noticed that with quite a few moves and abilities you haven't actually looked into their effects on Bulbapedia or somewhere. I don't want to call you out or anything, but please make sure you check this so it doesn't clutter threads with stuff haha.
__________________
Reply With Quote
  #260    
Old May 27th, 2015 (04:10 AM). Edited May 27th, 2015 by KDS.
KDS's Avatar
KDS KDS is offline
 
Join Date: Jul 2013
Age: 20
Gender: Male
Posts: 188
Freeze Dry
Spoiler:

Fire Red
Spoiler:

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

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

Exit:
  ldr r1, =0x0801E979
  bx r1

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

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

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

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

NextEntry:
  ldr r1, =0x0801E9A9
  bx r1

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

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

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

Exit:
  ldr r1, =0x0801EEF9
  bx r1

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

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

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

Exit:
  ldr r1, =0x0801EF19
  bx r1

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

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


Emerald
Spoiler:

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

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

Exit:
  ldr r1, =0x08047619
  bx r1

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

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

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

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

NextEntry:
  ldr r1, =0x08047199
  bx r1

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

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

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

Exit:
  ldr r1, =0x080476E9
  bx r1

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

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

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

Exit:
  ldr r1, =0x08047709
  bx r1

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

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


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

Reply With Quote
  #261    
Old 2 Weeks Ago (09:28 PM).
destinedjagold's Avatar
destinedjagold destinedjagold is online now
Oh Hai Thar~ 'ω'
Silver Tier
 
Join Date: May 2007
Location: Philippines
Gender: Male
Nature: Careful
Posts: 7,195
Effect: Fiery Dance / Charge Beam for Ruby...
Code:
2E 21 4D 02 02 D2 28 14 6F 1D 08
Effect: Dragon Tail / Circle Throw for Ruby...
Code:
00 01 72 6F 1D 08 00 00 02 03 04 05 06 07 09 0A 0E 5C 00 3A 0B 00 0C 00 0D 12 40 00 0F 12 40 00 E3 00 5B 6F 1D 08 1E 00 15 08 94 1D 08 21 00 00 04 00 00 00 27 8F 1D 08 8F D6 83 1D 08 28 5B 6F 1D 08
__________________


3DS FC: 0061-1111-6462
TSV: 1364(X), 0790(OR)

Reply With Quote
  #262    
Old 2 Weeks Ago (04:28 AM). Edited 2 Weeks Ago by mamamama.
mamamama mamamama is offline
 
Join Date: Feb 2014
Posts: 166
For Emerald:

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

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

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

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

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

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

End:
pop {r0}
bx r0

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


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


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

Quote originally posted by KDS:
String at A20000 (Sky Attack's)
Code:
FD 0F B4 E7 00 D6 D9 D7 D5 E1 D9 00 D7 E0 E3 D5 DF D9 D8 00 DD E2 00 D5 00 DC D5 E6 E7 DC 00 E0 DD DB DC E8 AB FF
Just a small nitpick:
A string that is more consistent with the official games would be:
Code:
 FD 0F 00 D6 D9 D7 D5 E1 D9 00 FE D7 E0 E3 D5 DF D9 D8 00 DD E2 00 D5 00 DC D5 E6 E7 DC 00 E0 DD DB DC E8 AB FF
I didn't check the other two but I can see that they use FD 0F B4 E7 instead of just FD 0F.
Reply With Quote
  #263    
Old 2 Weeks Ago (06:18 AM).
KDS's Avatar
KDS KDS is offline
 
Join Date: Jul 2013
Age: 20
Gender: Male
Posts: 188
Quote originally posted by mamamama:
""
Well thanks, i'll change it ASAP.
Reply With Quote
  #264    
Old 2 Weeks Ago (09:11 AM). Edited 2 Weeks Ago by mamamama.
mamamama mamamama is offline
 
Join Date: Feb 2014
Posts: 166
For Emerald:

Credits to KDS for his original script.

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

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

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

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

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

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

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

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

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


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

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

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

Note 2: This script takes into account the fairy-type assuming you have put it as type 17 as per MrDS. tutorial.
Reply With Quote
  #265    
Old 2 Weeks Ago (12:46 PM).
kleenexfeu kleenexfeu is offline
 
Join Date: Aug 2013
Gender: Male
Posts: 108
Quote originally posted by mamamama:
For Emerald:

Credits to KDS for his original script.

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

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

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

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

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

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

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

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

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


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

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

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

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

Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func

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

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


I didn't tested but it should work
Reply With Quote
  #266    
Old 4 Days Ago (12:02 AM). Edited 1 Day Ago by Artemis64.
Artemis64 Artemis64 is offline
 
Join Date: Mar 2014
Location: Singapore
Gender: Male
Nature: Hasty
Posts: 72
Some more animations for Emerald:
Assurance:
Spoiler:

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

Bug Bite:
Spoiler:


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

Gunk Shot:
Spoiler:

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

Hammer Arm:
Spoiler:

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

Icicle Crash:
Spoiler:

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

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


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

Miracle Eye:
Spoiler:


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

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are UTC -8. The time now is 09:24 PM.