The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

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
  #126    
Old 1 Week Ago, 08:24 PM
MrDollSteak's Avatar
MrDollSteak
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 19
Gender: Male
Quote:
Originally Posted by Tlachtli View Post
That's just an arbitrary, unused halfword I recycle as a temp variable in my ASMs and battle scripts. I can't say I'm 100% certain it's safe, but I watched it over the course of several battles and never saw it get used/changed by anything. Any halfword (or in this case, just a byte) that doesn't get used during battle and is cleared afterword will work fine.

In this case, I'm using it as a flag to check if the move's initial animation has already been played. If it cycles through all the targets and never sets the flag (because it never found a valid target and thus played the animation) then it knows to print the "But it failed" message.
Awesome! Thanks Tlachtli. I'm using 02023D60 in this case, as theres nothing specific that it does.

Also I've edited my original post, since I've added Shell Smash to Dragon Dance's BS. As mamamama rightly said +Atk and +Speed is closer to Shell Smash's effect than +Spatk could have been. Anyway here are the new moves! All for Fire Red.

Flower Shield

Spoiler:
Replace effect 11 with this battle script.
Flower Shield doesn't yet have an index in my rombase so just give it one.
Credits to Tlachtli for his original Emerald battle script.
Code:
#dynamic 0x800000
#freespacebyte 0xFF

#org @Effect11
setbyte 0x2023FDE 0x12
jumpifhalfword B_= 0x2023D4A 0x??? @FlowerShield
goto 0x1D6B9E

#org @FlowerShield
setbyte 0x02023D60 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_= 0x02023D60 0x1 @SelfNoAnimation
attackanimation
waitanimation
setbyte 0x02023D60 0x1
goto @SelfNoAnimation

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

#org @NextTarget
cmd25

#org @Call
jumpifarrayequal 0x2023D6B 0x2023D6C 0x1 @NextTarget
call @TargetBuff
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid @NextTarget
jumpifbyte B_= 0x02023D60 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_= 0x02023D60 0x1 @NoAnimation
attackanimation
waitanimation
setbyte 0x02023D60 0x1
goto @NoAnimation

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

#org @Return
return

#org @NoBuffs
pause 0x20
orbyte 0x2023DCC 0x20
resultmessage
waitmessage 0x40
end


Work Up and Growth and Rototiller

Spoiler:
Replace effect 13 with this battle script.
Growth is updated to its Gen V effect.
Work Up has an index of 19E in my rombase, and Rototiller is 0x1DF so just make note of that.
Rototiller works in the same way that Flower Shield does, so thanks to Tlachtli for the original notes on how to do this.
Code:
#include abilities.bsh
#dynamic 0x800000
#freespacebyte 0xFF

#org @pickmove
jumpifhalfword 0x0 0x2023D4A 0x4A @growth
jumpifhalfword 0x0 0x2023D4A 0x19E @workup
jumpifhalfword 0x0 0x2023D4A 0x1DF @rototiller
goto 0x1D6B8D

#org @growth
jumpifabilitypresent ABILITY_CLOUDNINE @workup
jumpifabilitypresent ABILITY_AIRLOCK @workup
jumpifhalfword B_& 0x2023F1C 0x60 @sunlight

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

#org @attack2
attackanimation
waitanimation
setbyte 0x2023FDF 0x0
playstatchangeanimation 0x0 0x12 0x0
setbyte 0x2023FDE 0x21
statbuffchange 0x1 true @spatk2
jumpifbyte 0x0 0x2023E87 0x2 @spatk2
printfromtable 0x83FE57C
waitmessage 0x40

#org @spatk2
setbyte 0x2023FDE 0x24
statbuffchange 0x1 true 0x81D85E2
jumpifbyte 0x0 0x2023E87 0x2 0x81D85E2
printfromtable 0x83FE57C
waitmessage 0x40
goto 0x1D694E

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

#org @attack
attackanimation
waitanimation
setbyte 0x2023FDF 0x0
playstatchangeanimation 0x0 0x12 0x0
setbyte 0x2023FDE 0x11
statbuffchange 0x1 true @spatk
jumpifbyte 0x0 0x2023E87 0x2 @spatk
printfromtable 0x83FE57C
waitmessage 0x40

#org @spatk
setbyte 0x2023FDE 0x14
statbuffchange 0x1 true 0x81D85E2
jumpifbyte 0x0 0x2023E87 0x2 0x81D85E2
printfromtable 0x83FE57C
waitmessage 0x40
goto 0x1D694E

#org @rototiller
setbyte 0x2023D60 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_= 0x2023D60 0x1 @selfnoanimation
attackanimation
waitanimation
setbyte 0x2023D60 0x1

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

#org @selfnoanimation2
setbyte 0x2023FDE 0x14
statbuffchange 0x80 true @next
jumpifbyte B_>= 0x2023E87 0x2 @next
printfromtable 0x83FE57C
waitmessage 0x40

#org @next
cmd25

#org @call
jumpifarrayequal 0x2023D6B 0x2023D6C 0x1 @next
call @target
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid @next
jumpifbyte B_= 0x2023D60 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_= 0x02023D60 0x1 @noanimation
attackanimation
waitanimation
setbyte 0x02023D60 0x1

#org @noanimation
cmd47
playstatchangeanimation 0x0 0x12 0x0
setbyte 0x2023FDE 0x11
statbuffchange 0x0 false @noanimation2
jumpifbyte B_>= 0x2023E87 0x2 @noanimation2
printfromtable 0x83FE57C
waitmessage 0x40

#org @noanimation2
setbyte 0x2023FDE 0x14
statbuffchange 0x0 false @return
jumpifbyte B_>= 0x2023E87 0x2 @return
printfromtable 0x83FE57C
waitmessage 0x40

#org @return
return

#org @nobuffs
pause 0x20
orbyte 0x2023DCC 0x20
resultmessage
waitmessage 0x40
end


Cotton Guard

Spoiler:
Replace effect 51 with this battle script.
You'll need Jambo's battle message hack and set word command.
0x1B7 is the index for Cotton Guard so just change that.
It successfully raises Defense by 3 stages and displays the message 'drastically rose' not Sharply rose.
Though if you are already at +4 or +5 it will jump to the equivalent +2 or +1 battle script.
Code:
#dynamic 0x800000
#freespacebyte 0xFF

#org @pickmove
jumpifhalfword 0x0 0x2023D4A 0x1B7 @cottonguard
goto 0x1D7103

#org @cottonguard
jumpifstat BANK_USER B_>= 0x2 0xA 0x1D7103
jumpifstat BANK_USER B_>= 0x2 0xB 0x1D6B82
attackcanceler
attackstring
ppreduce
setbyte 0x2023FDE 0x22
statbuffchange 0x1 true 0x81D6BCC
jumpifbyte 0x0 0x2023E87 0x2 0x81D6BC4

#org @singleboost
attackanimation
waitanimation
cmd47
playanimation BANK_USER 0x1 0x2023FD4
setbyte 0x2023FDE 0x12
statbuffchange 0x1 true 0x81D6BCC
jumpifbyte 0x0 0x2023E87 0x2 0x81D6BC4

#org @end
setword 0x203C020 0x8CCCCCC
printstring 0x184
waitmessage DELAY_1SECOND
goto 0x81D694E
At CCCCCC place this hex:
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


Tail Glow

Spoiler:
Replace effect 53 with this battle script.
You'll need Jambo's battle message hack and set word command.
It updates Tail Glow to its Gen V+ usage.
It successfully raises Defense by 3 stages and displays the message 'drastically rose' not Sharply rose.
Though if you are already at +4 or +5 it will jump to the equivalent +2 or +1 battle script.
Code:
#dynamic 0x800000
#freespacebyte 0xFF

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

#org @tailglow
jumpifstat BANK_USER B_>= 0x4 0xA 0x1D7119
jumpifstat BANK_USER B_>= 0x4 0xB 0x1D6B8D
attackcanceler
attackstring
ppreduce
setbyte 0x2023FDE 0x24
statbuffchange 0x1 true 0x81D6BCC
jumpifbyte 0x0 0x2023E87 0x2 0x81D6BC4

#org @singleboost
attackanimation
waitanimation
cmd47
playanimation BANK_USER 0x1 0x2023FD4
setbyte 0x2023FDE 0x14
statbuffchange 0x1 true 0x81D6BCC
jumpifbyte 0x0 0x2023E87 0x2 0x81D6BC4

#org @end
setword 0x203C020 0x8DDDDDD
printstring 0x184
waitmessage DELAY_1SECOND
goto 0x81D694E
At DDDDDD place this hex:
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


Charge

Spoiler:
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.
Code:
#dynamic 0x800000
#freespacebyte 0xFF

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

#org @spdefboost
setbyte 0x2023FDE 0x15
statbuffchange 0x1 true 0x81D6BCC
jumpifbyte B_!= 0x2023E87 0x2 0x81D6BCC
goto 0x81D6BBC
__________________

Last edited by MrDollSteak; 1 Week Ago at 02:23 AM. Reason: Added Cotton Guard and Tail Glow
Reply With Quote
  #127    
Old 1 Week Ago, 12:13 AM
mamamama
 
Join Date: Feb 2014
Quote:
Originally Posted by MrDollSteak View Post
Awesome! Thanks Tlachtli. I'm using 02023D60 in this case, as theres nothing specific that it does.

Also I've edited my original post, since I've added Shell Smash to Dragon Dance's BS. As mamamama rightly said +Atk and +Speed is closer to Shell Smash's effect than +Spatk could have been. Anyway here are the new moves! All for Fire Red.[/CODE][/SPOILER]
I noticed that you use playtstatsanimation 0x0 0xA 0x0 on moves such as Quiver Dance, Coil and Shell Smash. Is there a reason it's always that combination?

I was under the impression you had to add the stats you are raising/lowering together so that the correct colour changes when just one stats is raising.

For example. Dragon Dance has Speed (0x8) and Attack (0x2) so if you add them together you get 0xA and thus one colour is correctly used if the other is already at +6. This would place Coil at 0x46 etc.
Reply With Quote
  #128    
Old 1 Week Ago, 12:18 AM
MrDollSteak's Avatar
MrDollSteak
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 19
Gender: Male
Quote:
Originally Posted by mamamama View Post
I noticed that you use playtstatsanimation 0x0 0xA 0x0 on moves such as Quiver Dance, Coil and Shell Smash. Is there a reason it's always that combination?

I was under the impression you had to add the stats you are raising/lowering together so that the correct colour changes when just one stats is raising.

For example. Dragon Dance has Speed (0x8) and Attack (0x2) so if you add them together you get 0xA and thus one colour is correctly used if the other is already at +6. This would place Coil at 0x46 etc.
Oh that may be the case to be honest I just assumed it was 0xA for every multi-stat raising move. Let me look at Calm Mind to see if it also uses 0xA.

EDIT: I've gone through and fixed all of them. Thanks mamamama. Also I've tested them all in my rombase and they all work perfectly now.
EDIT2: My BSP has been compiling incorrectly in areas, for some reason the B_>= command isn't compiling to 0x3 as it should but to 0x0. I'm just going to change some move effects to show this.
__________________

Last edited by MrDollSteak; 1 Week Ago at 02:05 AM. Reason: Phrasing
Reply With Quote
  #129    
Old 1 Week Ago, 02:36 AM
mamamama
 
Join Date: Feb 2014
Quote:
Originally Posted by MrDollSteak View Post
Oh that may be the case to be honest I just assumed it was 0xA for every multi-stat raising move. Let me look at Calm Mind to see if it also uses 0xA.
If you use a Pokemon with Dragon Dance + Shell Smash against a Zigzagoon with only Fake Tears, start with 2 Dragon Dances, and then go for a Shell Smash you will notice that neither of the defenses will lower when the regular defense should be going down.

I made this script a few weeks ago and cleaned it up a bit using yours as template. This is Quiver Dance and Shell Smash combined with Dragon Dance. I use Dragon Dance because I want the AI to recognize to use it when it wants to outspeed an opponent that is faster. I don't think the AI will act much differently if you choose to combine QDance with Calm Mind (My QDance is pretty much identical to yours).

I've tested this with all kinds of combinations and it should work. Note that this is for Emerald but should be easy to translate using the offsets in Mr. Ds's code. I made this based on the original Dragon Dance and Curse scripts combined.

Spoiler:
Code:
#dynamic 0x[Offset]
#freespacebyte 0xFF

#include moves.bsh

#org @start
jumpifhalfword 0x0 0x20241EA 0x[Attack# in Hex] @QDance
jumpifhalfword 0x0 0x20241EA 0x[Attack# in Hex] @ShellSmash
goto 0x82DA731

#org @QDance
attackcanceler
attackstring
ppreduce
jumpifstat 0x1 0x3 0x5 0xC @SpAtt
jumpifstat 0x1 0x3 0x4 0xC @SpAtt
jumpifstat 0x1 0x0 0x3 0xC 0x82DA71D

#org @SpAtt
attackanimation
waitanimation
setbyte 0x202448F 0x0
playstatchangeanimation 0x0 0x38 0x0
setbyte 0x202448E 0x14
statbuffchange 0x41 TRUE @SpDef
jumpifbyte 0x0 0x2024337 0x2 @SpDef
printfromtable 0x85CC89C
waitmessage 0x40

#org @SpDef
setbyte 0x202448E 0x15
statbuffchange 0x41 TRUE @Speed
jumpifbyte 0x0 0x2024337 0x2 @Speed
printfromtable 0x85CC89C
waitmessage 0x40

#org @Speed
setbyte 0x202448E 0x13
statbuffchange 0x41 TRUE 0x82DA790
jumpifbyte 0x0 0x2024337 0x2 0x82DA790
printfromtable 0x85CC89C
waitmessage 0x40
goto 0x82D8A4E

#org @ShellSmash
attackcanceler
attackstring
ppreduce
jumpifstat 0x1 0x2 0x2 0x0 @DropDef
jumpifstat 0x1 0x2 0x5 0x0 @DropDef
jumpifstat 0x1 0x1 0x1 0xC @DropDef
jumpifstat 0x1 0x1 0x4 0xC @DropDef
jumpifstat 0x1 0x0 0x3 0xC 0x82DA71D

#org @DropDef
attackanimation
waitanimation
playstatchangeanimation 0x0 0x24 0x1
setbyte 0x202448E 0x92
statbuffchange 0x41 TRUE @DropSpDef
jumpifbyte 0x0 0x2024337 0x2 @DropSpDef
printfromtable 0x85CC8A8
waitmessage 0x40

#org @DropSpDef
setbyte 0x202448E 0x95
statbuffchange 0x41 TRUE @2Att
jumpifbyte 0x0 0x2024337 0x2 @2Att
printfromtable 0x85CC8A8
waitmessage 0x40

#org @2Att
setbyte 0x202448F 0x0
playstatchangeanimation 0x0 0x1A 0x0
setbyte 0x202448E 0x21
statbuffchange 0x41 TRUE @2SpAtt
jumpifbyte 0x0 0x2024337 0x2 @2SpAtt
printfromtable 0x85CC89C
waitmessage 0x40

#org @2SpAtt
setbyte 0x202448E 0x24
statbuffchange 0x41 TRUE @2Speed
jumpifbyte 0x0 0x2024337 0x2 @2Speed
printfromtable 0x85CC89C
waitmessage 0x40

#org @2Speed
setbyte 0x202448E 0x23
statbuffchange 0x41 TRUE 0x82DA790
jumpifbyte 0x0 0x2024337 0x2 0x82DA790
printfromtable 0x85CC89C
waitmessage 0x40
goto 0x82D8A4E

Last edited by mamamama; 1 Week Ago at 03:04 AM.
Reply With Quote
  #130    
Old 1 Week Ago, 02:47 AM
MrDollSteak's Avatar
MrDollSteak
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 19
Gender: Male
Quote:
Originally Posted by mamamama View Post
If you use a Pokemon with Dragon Dance + Shell Smash against a Zigzagoon with only Fake Tears, start with 2 Dragon Dances, and then go for a Shell Smash you will notice that neither of the defenses will lower when the regular defense should be going down.
The problem with that has been fixed, it was because BSP wasn't compiling the 0x3 byte in the jump properly.

Also here is an animation for Shift Gear using a custom particle.

Code:
00 3D 28 0A 03 28 01 0C 0C 08 19 B4 00 3F 02 XX XX XX 08 02 05 D6 FF E7 FF 00 00 00 00 0F 00 04 0C 02 YY YY YY 08 02 07 07 00 05 00 01 00 00 00 0A 00 00 00 00 00 19 74 00 3F 05 0B 03 0D 08 FF
At offset XXXXXX put
XX 28 XX 28 38 CA 3A 08 F0 1C 23 08 00 00 00 00 24 7A 3E 08 55 8C 0B 08

At offset YYYYYY put
XX 28 XX 28 58 CB 3A 08 F0 1C 23 08 00 00 00 00 F8 7B 3E 08 61 A5 0B 08

Then insert the attached particle particle wherever you want and change the index from XX 28 to your value in the particle table.
Attached Images
File Type: png Shift Gear.png‎ (292 Bytes, 79 views) (Save to Dropbox)
__________________

Last edited by MrDollSteak; 1 Week Ago at 03:38 AM.
Reply With Quote
  #131    
Old 1 Week Ago, 03:43 AM
KDS
 
Join Date: Jul 2013
Age: 19
Gender: Male
The updated Hi Jump Kick for Fire Red if anyone didn't notice.
http://www.pokecommunity.com/showpos...17&postcount=2
Reply With Quote
  #132    
Old 6 Days Ago, 02:40 AM
BugMania's Avatar
BugMania
The Bug Master
 
Join Date: Jun 2013
Gender: Male
Nature: Quiet
Quote:
Originally Posted by MrDollSteak View Post
Awesome! Thanks Tlachtli. I'm using 02023D60 in this case, as theres nothing specific that it does.

Also I've edited my original post, since I've added Shell Smash to Dragon Dance's BS. As mamamama rightly said +Atk and +Speed is closer to Shell Smash's effect than +Spatk could have been. Anyway here are the new moves! All for Fire Red.

Flower Shield

Spoiler:
Replace effect 11 with this battle script.
Flower Shield doesn't yet have an index in my rombase so just give it one.
Credits to Tlachtli for his original Emerald battle script.
Code:
#dynamic 0x800000
#freespacebyte 0xFF

#org @Effect11
setbyte 0x2023FDE 0x12
jumpifhalfword B_= 0x2023D4A 0x??? @FlowerShield
goto 0x1D6B9E

#org @FlowerShield
setbyte 0x02023D60 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_= 0x02023D60 0x1 @SelfNoAnimation
attackanimation
waitanimation
setbyte 0x02023D60 0x1
goto @SelfNoAnimation

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

#org @NextTarget
cmd25

#org @Call
jumpifarrayequal 0x2023D6B 0x2023D6C 0x1 @NextTarget
call @TargetBuff
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid @NextTarget
jumpifbyte B_= 0x02023D60 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_= 0x02023D60 0x1 @NoAnimation
attackanimation
waitanimation
setbyte 0x02023D60 0x1
goto @NoAnimation

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

#org @Return
return

#org @NoBuffs
pause 0x20
orbyte 0x2023DCC 0x20
resultmessage
waitmessage 0x40
end


Work Up and Growth and Rototiller

Spoiler:
Replace effect 13 with this battle script.
Growth is updated to its Gen V effect.
Work Up has an index of 19E in my rombase, and Rototiller is 0x1DF so just make note of that.
Rototiller works in the same way that Flower Shield does, so thanks to Tlachtli for the original notes on how to do this.
Code:
#include abilities.bsh
#dynamic 0x800000
#freespacebyte 0xFF

#org @pickmove
jumpifhalfword 0x0 0x2023D4A 0x4A @growth
jumpifhalfword 0x0 0x2023D4A 0x19E @workup
jumpifhalfword 0x0 0x2023D4A 0x1DF @rototiller
goto 0x1D6B8D

#org @growth
jumpifabilitypresent ABILITY_CLOUDNINE @workup
jumpifabilitypresent ABILITY_AIRLOCK @workup
jumpifhalfword B_& 0x2023F1C 0x60 @sunlight

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

#org @attack2
attackanimation
waitanimation
setbyte 0x2023FDF 0x0
playstatchangeanimation 0x0 0x12 0x0
setbyte 0x2023FDE 0x21
statbuffchange 0x1 true @spatk2
jumpifbyte 0x0 0x2023E87 0x2 @spatk2
printfromtable 0x83FE57C
waitmessage 0x40

#org @spatk2
setbyte 0x2023FDE 0x24
statbuffchange 0x1 true 0x81D85E2
jumpifbyte 0x0 0x2023E87 0x2 0x81D85E2
printfromtable 0x83FE57C
waitmessage 0x40
goto 0x1D694E

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

#org @attack
attackanimation
waitanimation
setbyte 0x2023FDF 0x0
playstatchangeanimation 0x0 0x12 0x0
setbyte 0x2023FDE 0x11
statbuffchange 0x1 true @spatk
jumpifbyte 0x0 0x2023E87 0x2 @spatk
printfromtable 0x83FE57C
waitmessage 0x40

#org @spatk
setbyte 0x2023FDE 0x14
statbuffchange 0x1 true 0x81D85E2
jumpifbyte 0x0 0x2023E87 0x2 0x81D85E2
printfromtable 0x83FE57C
waitmessage 0x40
goto 0x1D694E

#org @rototiller
setbyte 0x2023D60 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_= 0x2023D60 0x1 @selfnoanimation
attackanimation
waitanimation
setbyte 0x2023D60 0x1

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

#org @selfnoanimation2
setbyte 0x2023FDE 0x14
statbuffchange 0x80 true @next
jumpifbyte B_>= 0x2023E87 0x2 @next
printfromtable 0x83FE57C
waitmessage 0x40

#org @next
cmd25

#org @call
jumpifarrayequal 0x2023D6B 0x2023D6C 0x1 @next
call @target
setbyte 0x2023FD8 0x0
cmd49 0x2 0x10
jumpwhiletargetvalid @next
jumpifbyte B_= 0x2023D60 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_= 0x02023D60 0x1 @noanimation
attackanimation
waitanimation
setbyte 0x02023D60 0x1

#org @noanimation
cmd47
playstatchangeanimation 0x0 0x12 0x0
setbyte 0x2023FDE 0x11
statbuffchange 0x0 false @noanimation2
jumpifbyte B_>= 0x2023E87 0x2 @noanimation2
printfromtable 0x83FE57C
waitmessage 0x40

#org @noanimation2
setbyte 0x2023FDE 0x14
statbuffchange 0x0 false @return
jumpifbyte B_>= 0x2023E87 0x2 @return
printfromtable 0x83FE57C
waitmessage 0x40

#org @return
return

#org @nobuffs
pause 0x20
orbyte 0x2023DCC 0x20
resultmessage
waitmessage 0x40
end


Cotton Guard

Spoiler:
Replace effect 51 with this battle script.
You'll need Jambo's battle message hack and set word command.
0x1B7 is the index for Cotton Guard so just change that.
It successfully raises Defense by 3 stages and displays the message 'drastically rose' not Sharply rose.
Though if you are already at +4 or +5 it will jump to the equivalent +2 or +1 battle script.
Code:
#dynamic 0x800000
#freespacebyte 0xFF

#org @pickmove
jumpifhalfword 0x0 0x2023D4A 0x1B7 @cottonguard
goto 0x1D7103

#org @cottonguard
jumpifstat BANK_USER B_>= 0x2 0xA 0x1D7103
jumpifstat BANK_USER B_>= 0x2 0xB 0x1D6B82
attackcanceler
attackstring
ppreduce
setbyte 0x2023FDE 0x22
statbuffchange 0x1 true 0x81D6BCC
jumpifbyte 0x0 0x2023E87 0x2 0x81D6BC4

#org @singleboost
attackanimation
waitanimation
cmd47
playanimation BANK_USER 0x1 0x2023FD4
setbyte 0x2023FDE 0x12
statbuffchange 0x1 true 0x81D6BCC
jumpifbyte 0x0 0x2023E87 0x2 0x81D6BC4

#org @end
setword 0x203C020 0x8CCCCCC
printstring 0x184
waitmessage DELAY_1SECOND
goto 0x81D694E
At CCCCCC place this hex:
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


Tail Glow

Spoiler:
Replace effect 53 with this battle script.
You'll need Jambo's battle message hack and set word command.
It updates Tail Glow to its Gen V+ usage.
It successfully raises Defense by 3 stages and displays the message 'drastically rose' not Sharply rose.
Though if you are already at +4 or +5 it will jump to the equivalent +2 or +1 battle script.
Code:
#dynamic 0x800000
#freespacebyte 0xFF

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

#org @tailglow
jumpifstat BANK_USER B_>= 0x4 0xA 0x1D7119
jumpifstat BANK_USER B_>= 0x4 0xB 0x1D6B8D
attackcanceler
attackstring
ppreduce
setbyte 0x2023FDE 0x24
statbuffchange 0x1 true 0x81D6BCC
jumpifbyte 0x0 0x2023E87 0x2 0x81D6BC4

#org @singleboost
attackanimation
waitanimation
cmd47
playanimation BANK_USER 0x1 0x2023FD4
setbyte 0x2023FDE 0x14
statbuffchange 0x1 true 0x81D6BCC
jumpifbyte 0x0 0x2023E87 0x2 0x81D6BC4

#org @end
setword 0x203C020 0x8DDDDDD
printstring 0x184
waitmessage DELAY_1SECOND
goto 0x81D694E
At DDDDDD place this hex:
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


Charge

Spoiler:
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.
Code:
#dynamic 0x800000
#freespacebyte 0xFF

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

#org @spdefboost
setbyte 0x2023FDE 0x15
statbuffchange 0x1 true 0x81D6BCC
jumpifbyte B_!= 0x2023E87 0x2 0x81D6BCC
goto 0x81D6BBC
Thank you very much! I still do not have time to test, but if you really found the hex for new messages, I'm relieved! My routine had problems when there were battles with link...

Glad that you are now working with asm and hex!

When I have time, I'll show you how I make an effect run in a end of turn, without using pauses! Also, things like the "toxic spikes!"
__________________
Bug BuZZzzz!!!!!!

See my works here:
http://www.youtube.com/channel/UClRveHlFanD5yygtMLsedgg
Reply With Quote
  #133    
Old 6 Days Ago, 08:37 AM
KDS
 
Join Date: Jul 2013
Age: 19
Gender: Male
Clubbed Sky Attack (also updated it's message), Freeze Shock (updated it's effect so that electric mons can't be paralysed by it), Ice Burn together due to similar effect. This also requires the battle string loader ASM:

Replace Sky Attack's effect with this one:
Code:
#dynamic 0x[YourOffset]
#freespacebyte 0xFF

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


#org @skyattack
jumpifsecondarystatus 0x1 0x1000 0x81D6F29
jumpifword 0x4 0x2023DD0 0x200 0x81D6F29
setbyte 0x2023FD3 0x3
call @firstturnsk
goto 0x81D694E

#org @firstturnsk
attackcanceler
attackstring
waitmessage 0x40
ppreduce
attackanimation
waitanimation
orword 0x2023DD0 0x8000000
setbyte 0x2023E85 0x4C
seteffecttarget
copyarray 0x2023E87 0x2023FD3 0x1
setword 0x203C020 0x8A20000
printstring 0x184
waitmessage 0x40
return


#org @freejshock
jumpifsecondarystatus 0x1 0x1000 @executefs
jumpifword 0x4 0x2023DD0 0x200 @executefs
setbyte 0x2023FD3 0x3
call @firstturnfs
goto 0x81D694E

#org @executefs
attackcanceler
setbyte 0x2023E85 0xC
setbyte 0x2023FDC 0x1
clearstatus 0x1
orword 0x2023DD0 0x800
jumpiftype 0x0 0xD 0x81D6927
setbyte 0x2023E85 0x5
goto 0x81D6927

#org @firstturnfs
attackcanceler
attackstring
waitmessage 0x40
ppreduce
attackanimation
waitanimation
orword 0x2023DD0 0x8000000
setbyte 0x2023E85 0x4C
seteffecttarget
copyarray 0x2023E87 0x2023FD3 0x1
setword 0x203C020 0x8A00000
printstring 0x184
waitmessage 0x40
return


#org @iceburn
jumpifsecondarystatus 0x1 0x1000 @executeib
jumpifword 0x4 0x2023DD0 0x200 @executeib
setbyte 0x2023FD3 0x3
call @firstturnib
goto 0x81D694E

#org @executeib
attackcanceler
setbyte 0x2023E85 0xC
setbyte 0x2023FDC 0x1
clearstatus 0x1
orword 0x2023DD0 0x800
setbyte 0x2023E85 0x3
goto 0x81D6927

#org @firstturnib
attackcanceler
attackstring
waitmessage 0x40
ppreduce
attackanimation
waitanimation
orword 0x2023DD0 0x8000000
setbyte 0x2023E85 0x4C
seteffecttarget
copyarray 0x2023E87 0x2023FD3 0x1
setword 0x203C020 0x8A10000
printstring 0x184
waitmessage 0x40
return
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
String at A00000 (Freeze Shock'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 DA E6 D9 D9 EE DD E2 DB 00 E0 DD DB DC E8 AB FF
String at A10000 (Ice Burn'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 DA E6 D9 D9 EE DD E2 DB 00 D5 DD E6 AB FF
Reply With Quote
  #134    
Old 3 Days Ago, 03:02 AM
KDS
 
Join Date: Jul 2013
Age: 19
Gender: Male
Heavy Slam for Fire Red. The script is simple as for Doesnt's ASMs. Use the callasm command just after the pp reducer and before damagecalculator in the script:

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

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

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

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

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


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

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

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

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

set60:
mov r1, #0x3C
b end

set80:
mov r1, #0x50
b end

set100:
mov r1, #0x64
b end

set120:
mov r1, #0x78

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

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

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

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

4. If someone wants to port it to Emerald, in addition to changing the value of offsets also change the mov r2, #0x24 to mov r2, #0x20 after the ldr r1, dexData, this because in every GBA Rom except Emerald the dex entry for each poke takes 36 bytes, whereas in Emerald it takes 32 bytes.

Last edited by KDS; 2 Days Ago at 07:33 AM.
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 02:43 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 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 - 2014 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.