Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#26 2013-07-21 05:43:10

AuroraLights493
New member
Registered: 2013-07-21
Post 1/1

Re: Shiny Pokemon in Gold

Hey!  You guys really seem to understand the game's code here, I've got a question that I'm fairly certain you will be able to answer.
In Gold, Silver, and Crystal, is it possible to run away from Shiny Pokemon?
I know that you cannot run away from the Red Gyarados, but I'm assuming that that is only because it is an event Pokemon that is part of the required storyline.
However, while playing my Crystal ROM, when I turn on the "All Pokemon Shiny" code, I cannot run away from ANY wild Shiny.  I've never tried this with a legitimate Shiny Pokemon in the 2nd Gen, and I've been too afraid to try. xD  Can someone answer this?

Offline

#27 2013-08-01 03:17:09

682/703

Re: Shiny Pokemon in Gold

AuroraLights493 wrote:

Hey!  You guys really seem to understand the game's code here, I've got a question that I'm fairly certain you will be able to answer.
In Gold, Silver, and Crystal, is it possible to run away from Shiny Pokemon?
I know that you cannot run away from the Red Gyarados, but I'm assuming that that is only because it is an event Pokemon that is part of the required storyline.
However, while playing my Crystal ROM, when I turn on the "All Pokemon Shiny" code, I cannot run away from ANY wild Shiny.  I've never tried this with a legitimate Shiny Pokemon in the 2nd Gen, and I've been too afraid to try. xD  Can someone answer this?

You can run away from shiny Pokémon encountered in the wild.

The script that triggers the Red Gyarados battle enables a special battle type:

cry GYARADOS
loadmovesprites
loadpokedata GYARADOS, 30   
writecode $3, $7
startbattle

The “writecode $3, $7” sets the “battle type” (3) to 7.

When any battle occurs, this battle type is checked, and if it’s equal to 7, the Pokémon is made shiny. So in any wild battle with a battle type of 7, the opposing Pokémon will be shiny. Most shininess Gameshark codes for GSC force this battle type.

Battle type 7 also makes it impossible to run. At F:5B83 in Crystal:

ld a, [BattleType]
cp $2
jp z, $59a2
cp $6
jp z, $59a2
cp $9
jp z, $598d
cp $b
jp z, $598d
cp $7
jp z, $598d
…

Reading the code pointed to by the jp reveals a textbox that prints “Can’t escape!” and cancels the Run command. So any Gameshark code that forces the battle type to 7 also makes it impossible to run.

“Regular” shiny Pokémon that you encounter in the wild are made shiny due to the randomness of the DVs. They are just a regular wild battle. Therefore, you can run from them. Likewise, a Gameshark code that forces shininess by editing the DVs directly (instead of changing the battle type) will still let you run from battle.

#28 2013-10-20 09:47:19

Airikita
Member
Registered: 2013-10-16
Post 17/41

Re: Shiny Pokemon in Gold

I removed all jr jumps except for the last one before the scf... that should increase probability perhaps? Maybe I should change the check from 0A to something more common???

Offline

#29 2013-12-19 20:01:12

Miksy91
Member
Registered: 2010-10-16
Post 2,029/2,339

Re: Shiny Pokemon in Gold

I took a closer look at the original shiny pokemon routine I programmed in DE, and what a mess it was! I had to recode the whole thing (turned out much smaller, more readable, editable and better in every way), and figured I might as well share the result to others to be seen.
These here are the notes I wrote down before implementing it in the game.


Shiny values:
Atk. = 6/7 or E/F
Def, Special, Speed =  C/D/E/F
Shiny ratio = 0.390625 % --> 1/256


02:5052
--------------
ld l, c
ld h, b
call Shinyness
jr c, notShiny
scf
ret

:notShiny
---------------
and a,a
ret


:Shinyness
-----------------
call Atk
call nc DefSpd
call nc Spec
call nc DefSpd
ret


:Atk
----------
ld a, (hl)
res 7, a
cp a, 60
ret

:DefSpd
-----------
ldi a, (hl)
and a, 0F
cp a, 0C
ret

:Spec
----------
ld a, (hl)
cp a, C0
ret

And that's the whole routine. Put it in use if you like. Credit not needed but always appreciated.

Last edited by Miksy91 (2013-12-19 20:08:58)

Offline

#30 2018-12-06 17:46:58

StarlitSunset
New member
Registered: 2018-12-06
Post 1/2

Re: Shiny Pokemon in Gold

Bumping this extremely helpful thread to ask a similar question. 
Say I want to make all dittos in pokegold shiny.  This should be based on stats, so should I be editing ditto.asm directly? 
I know it wouldn't have to do with battletype_shiny at all because that is called specifically for Red Gyrados, but is there an add-on
that I can create in Ditto's constants to always make its stats those that correspond with those needed for shininess?
Or, could I create a new battle constant where Ditto's DVs always come up to those that create a shiny?

Offline

Board footer

Powered by FluxBB