The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other Rock smash items? (https://www.pokecommunity.com/showthread.php?t=430549)

DSieg February 5th, 2020 9:08 AM

Rock smash items?
 
Hi all.

I've been working on some data for Fire Red these last days.
I am stuck on something and couldn't find any answer at all.

If I remember right, you can get some items when breaking rocks with Rock Smash. Does it apply to this game?
And if it does, is there any way to change that data?

Thanks.

DrFuji February 5th, 2020 3:59 PM

According to Bulbapedia, you can only get items from Rock Smash in HG/SS and Gen VI. You'll need to rewrite Rock Smash's script and add a part where the you can randomly get an item. I had some time I quickly wrote one up for you.

Spoiler:
#dynamic 0x800000

#org @start
special 0x187
compare 0x800D 0x2
if 0x1 goto @ErrorChecker
lockall
checkflag 0x825
if 0x0 goto @Can'tSmash
checkattack 0xF9
compare 0x800D 0x6
if 0x1 goto @Can'tSmash
setanimation 0x0 0x800D
bufferpartypokemon 0x0 0x800D
bufferattack 0x1 0xF9
msgbox @BreakRock? 0x5
compare 0x800D 0x0
if 0x1 goto @No
msgbox @UseRockSmash 0x4
closeonkeypress
doanimation 0x25
waitstate
goto @Continue

#org @ErrorChecker
release
end

#org @Can'tSmash
msgbox @RuggedRock 0x3
end

#org @No
closeonkeypress
releaseall
end

#org @Continue
applymovement 0x800F @RockAnimation
waitmovement 0x0
hidesprite 0x800F
random 0x5 // Change this to change the chance of getting an item (Currently 20%)
compare 0x800D 0x0
if 0x1 call @Item
special 0xAB
compare 0x800D 0x0
if 0x1 goto @ReleaseAll
waitstate
releaseall
end

#org @Item
random 0x5 // Change this if you want to increase/ decrease the number of items
copyvar 0x8004 0x800D
compare 0x8004 0x0
if 0x1 call @Everstone
compare 0x8004 0x1
if 0x1 call @HardRock
compare 0x8004 0x2
if 0x1 call @HeartScale
compare 0x8004 0x3
if 0x1 call @Pearl
compare 0x8004 0x4
if 0x1 call @Revive
return

#org @Everstone
giveitem 0xC3 0x1 0x1
return

#org @HardRock
giveitem 0xCC 0x1 0x1
return

#org @HeartScale
giveitem 0x6F 0x1 0x1
return

#org @Pearl
giveitem 0x6A 0x1 0x1
return

#org @Revive
giveitem 0x18 0x1 0x1
return

#org @ReleaseAll
releaseall
end

#org @BreakRock?
= This rock appears to be breakable.\nWould you like to use ROCK SMASH?

#org @UseRockSmash
= [buffer1] used [buffer2]!

#org @RuggedRock
= It's a rugged rock, but a POKéMON\nmay be able to smash it.

#org @RockAnimation
#raw 0x68
#raw 0xFE


I've indicated what lines to edit if you want to change the likely hood of getting items/ which one you can find.

DSieg February 5th, 2020 8:12 PM

I really thought there would be items in earlier Gens but nope...
Thanks a lot for the script!


All times are GMT -8. The time now is 9:12 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.