icyred21023
Usuario de plata
I have made a new Shiny Odds Routine for Emerald
It works with PID Rerolls instead of changing the games Shiny Check Mechanics. You can use a Shiny Charm with that routine as well. You can replace the routines here with these instead if you like.
Here's the link: https://whackahack.com/foro/threads/e-pid-rerolls-complete-shiny-odds-editing.68276/
_____________
With these routines you can have a flag set that changes the Shiny Odds.
Also you can pick you're Shiny Rate without the flag set. For example in the game I put this in, the regular odds are 1/255, which increase to 1/100 once you get the Shiny Charm. I'll try to be as thorough in my guide. I'm very new to writing ASM and im sure I couldve made these routines simpler but regardless here we go.
There are 4 routines needed to do this. The reason is because there are 4 different Shiny Checks in the game we must hook our routine to.
These routines are set for 1/255 odds WITHOUT the Charm, and 1/100 odds WITHOUT the Charm. This can be changed! The values to be changed will be color coded. The RED values are for editing the Shiny Charm Odds . The GREEN values are for the Regular Shiny Odds , without the charm.
The Shiny Charm Odds are only activated when a FLAG is set. The Flag can be changed and will be YELLOW. I used Flag 2A0, which is unused.
All Changes Must be made throughout ALL ROUTINES.
Okay, here's the 1st routine . This is the main one that affects shiny palette in battle.
.THUMB
.ALIGN 2
POP {R0}
EOR R0, R1
AND R3, R2
EOR R0, R3
CMP R3, #0
BEQ POKEDEX
PUSH {R0-R7}
LDR R0, = 0x 02A0 @This is the flag that will trigger the new Shiny Rate for the Charm.
BL CHECK_FLAG
CMP R0, #0
BEQ NO_CHARM
POP {R0-R7}
LSR R0, R0, #0x2 @This takes the Pokemon's generated Shiny Value (0-65535) and divides by 4. Changing the odds down to about 1/2000
CMP R0, #0x A4 @This value is the denominator of above. Vanilla has this byte at 07. Only one byte is allowed. Change if wanted. Formula = 164(A4) / 16383 = 1 / 100
BLS SHINY
NOT_SHINY:
LDR R2, = 0x0806E770+1
BX R2
NO_CHARM:
POP {R0-R7}
CMP R0, #0x FE @This value gives STANDARD Shiny rate without Charm Flag . Value of FE Gives 1/255 total odds. Vanilla is 07 Formula is 65535/( FE )
BLS SHINY
B NOT_SHINY
POKEDEX:
CMP R0, #0x FE @Match value in NOCHARM above IF changed.
IHB NOT_SHINY
SHINY:
LDR R2, = 0x0806E780+1
BX R2
CHECK_FLAG:
LDR R2, = 0x0809D790+1
BX R2
.ALIGN 2
POP {R0}
EOR R0, R1
AND R3, R2
EOR R0, R3
CMP R3, #0
BEQ POKEDEX
PUSH {R0-R7}
LDR R0, = 0x 02A0 @This is the flag that will trigger the new Shiny Rate for the Charm.
BL CHECK_FLAG
CMP R0, #0
BEQ NO_CHARM
POP {R0-R7}
LSR R0, R0, #0x2 @This takes the Pokemon's generated Shiny Value (0-65535) and divides by 4. Changing the odds down to about 1/2000
CMP R0, #0x A4 @This value is the denominator of above. Vanilla has this byte at 07. Only one byte is allowed. Change if wanted. Formula = 164(A4) / 16383 = 1 / 100
BLS SHINY
NOT_SHINY:
LDR R2, = 0x0806E770+1
BX R2
NO_CHARM:
POP {R0-R7}
CMP R0, #0x FE @This value gives STANDARD Shiny rate without Charm Flag . Value of FE Gives 1/255 total odds. Vanilla is 07 Formula is 65535/( FE )
BLS SHINY
B NOT_SHINY
POKEDEX:
CMP R0, #0x FE @Match value in NOCHARM above IF changed.
IHB NOT_SHINY
SHINY:
LDR R2, = 0x0806E780+1
BX R2
CHECK_FLAG:
LDR R2, = 0x0809D790+1
BX R2
Código:
01BC484013405840002B0FD0FFB40A48
00F010F8002805D0FFBC8008A42807D9
064A1047FFBCFE2802D9F9E7FE28F7D8
034A1047034A1047A002000071E70608
81E7060891D70908
Replace the XX's with the pointer made from the offset you put the Routine.
2nd Routine , this one is for the Summary screen to properly show as Shiny.
.THUMB
.ALIGN 2
POP {R0}
LSR R1, R2, #0X10
EOR R0, R1
AND R2, R3
EOR R0, R2
PUSH {R0-R7}
LDR R0, = 0x02A0 @Match value from Main Routine if changed.
BL CHECK_FLAG
CMP R0, #0
BEQ NO_CHARM
POP {R0-R7}
LSR R0, R0, #0x2
CMP R0, #0xA4 @Match value from Main Routine if changed.
NOT_SHINY:
LDR R1, = 0x0806E7E6+1
BX R1
CHECK_FLAG:
LDR R2, = 0x0809D790+1
BX R2
NO_CHARM:
POP {R0-R7}
CMP R0, #0xFE @Match value from Main Routine if changed.
BLS SHINY
B NOT_SHINY
SHINY:
LDR R1, = 0x0806E7F4+1
BX R1
.ALIGN 2
POP {R0}
LSR R1, R2, #0X10
EOR R0, R1
AND R2, R3
EOR R0, R2
PUSH {R0-R7}
LDR R0, = 0x02A0 @Match value from Main Routine if changed.
BL CHECK_FLAG
CMP R0, #0
BEQ NO_CHARM
POP {R0-R7}
LSR R0, R0, #0x2
CMP R0, #0xA4 @Match value from Main Routine if changed.
NOT_SHINY:
LDR R1, = 0x0806E7E6+1
BX R1
CHECK_FLAG:
LDR R2, = 0x0809D790+1
BX R2
NO_CHARM:
POP {R0-R7}
CMP R0, #0xFE @Match value from Main Routine if changed.
BLS SHINY
B NOT_SHINY
SHINY:
LDR R1, = 0x0806E7F4+1
BX R1
Enriquecido (Código BB):
01BC110C48401A405040FFB4094800F0
08F8002807D0FFBC8008A42807D90649
0847064A1047FFBCFE2800D9F7E70449
08470000A0020000E7E70608 91D70908
F5E70608
Make sure you put new pointer from this routine.
3rd routine is for the Summary Screen as well but for the Shiny Frame the Sprite sits in.
.THUMB
.ALIGN 2
POP {R0}
EOR R2, R0
AND R1, R3
EOR R2, R1
PUSH {R0-R7}
LDR R0, = 0x02A0 @Match value from Main Routine if changed.
BL CHECK_FLAG
CMP R0, #0
BEQ NO_CHARM
POP {R0-R7}
LSR R2, R2, #0x2
CMP R2, #0xA4 @Match value from Main Routine if changed.
BLS SHINY
NOT_SHINY:
LDR R1, = 0x0806EBEA+1
BX R1
CHECK_FLAG:
LDR R2, = 0x0809D790+1
BX R2
NO_CHARM:
POP {R0-R7}
CMP R2, #0xFE @Match value from Main Routine if changed.
BLS SHINY
B NOT_SHINY
SHINY:
LDR R1, = 0x0806EBE8+1
BX R1
.ALIGN 2
POP {R0}
EOR R2, R0
AND R1, R3
EOR R2, R1
PUSH {R0-R7}
LDR R0, = 0x02A0 @Match value from Main Routine if changed.
BL CHECK_FLAG
CMP R0, #0
BEQ NO_CHARM
POP {R0-R7}
LSR R2, R2, #0x2
CMP R2, #0xA4 @Match value from Main Routine if changed.
BLS SHINY
NOT_SHINY:
LDR R1, = 0x0806EBEA+1
BX R1
CHECK_FLAG:
LDR R2, = 0x0809D790+1
BX R2
NO_CHARM:
POP {R0-R7}
CMP R2, #0xFE @Match value from Main Routine if changed.
BLS SHINY
B NOT_SHINY
SHINY:
LDR R1, = 0x0806EBE8+1
BX R1
Código:
01BC424019404A40FFB4094800F008F8
002807D0FFBC9208A42A07D905490847
054A1047FFBCFE2A00D9F7E703490847
A0020000EBEB060891D70908E9EB0608
4th and LAST Routine. This one is for the Sparkle Effect that appears when Pokemon is sent into battle.
.THUMB
.ALIGN 2
POP {R0}
LSR R1, R4, #0x10
EOR R0, R1
AND R4, R7
EOR R0, R4
PUSH {R0-R7}
LDR R0, = 0x02A0 @Match value in Main Routine if changed.
BL CHECK_FLAG
CMP R0, #0
BEQ NO_CHARM
POP {R0-R7}
LSR R0, R0, #0x2
CMP R0, #0xA4 @Match value in Main Routine if changed.
BLS SHINY
NOT_SHINY:
LDR R0, = 0x08172F4E+1
BX R0
CHECK_FLAG:
LDR R2, = 0x0809D790+1
BX R2
NO_CHARM:
POP {R0-R7}
CMP R0, #0xFE @Match value in Main Routine if changed.
BLS SHINY
B NOT_SHINY
SHINY:
LDR R0, = 0x08172F4A+1
BX R0
.ALIGN 2
POP {R0}
LSR R1, R4, #0x10
EOR R0, R1
AND R4, R7
EOR R0, R4
PUSH {R0-R7}
LDR R0, = 0x02A0 @Match value in Main Routine if changed.
BL CHECK_FLAG
CMP R0, #0
BEQ NO_CHARM
POP {R0-R7}
LSR R0, R0, #0x2
CMP R0, #0xA4 @Match value in Main Routine if changed.
BLS SHINY
NOT_SHINY:
LDR R0, = 0x08172F4E+1
BX R0
CHECK_FLAG:
LDR R2, = 0x0809D790+1
BX R2
NO_CHARM:
POP {R0-R7}
CMP R0, #0xFE @Match value in Main Routine if changed.
BLS SHINY
B NOT_SHINY
SHINY:
LDR R0, = 0x08172F4A+1
BX R0
Código:
01BC210C48403C406040FFB4094800F0
08F8002807D0FFBC8008A42807D90648
0047064A1047FFBCFE2800D9F7E70448
00470000A00200004F2F170891D70908
4B2F1708
To hook goto offset 0x172F3E and overwrite with 01 B4 00 48 00 47 XX +1 XX XX XX
Next is to add in the Shiny Charm Item. I will post more detailed instructions soon, but for now I attached a sprite I made, which can be imported on UNLZ. This sprite was made from the Gold Teeth sprite, which was listed somewhere around 2300. Once on Gold Teeth in UNLZ, click import, select the Sprite below, and then hit Write to Rom. Make sure Abort if Bigger is on, and also to Import the Palette as well. It should overwrite fine.
After this I used LSA to change name and description of Gold Teeth.
Once all that's done, all that's left to do is write a script in XSE to give the item, and set the flag in routine, 2A0 if you didn't change.
Adjuntos
-
1,1 KB Visitas: 132
Última edición: