Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HGSS Repel Chain Research
- Adapted from: https://ds-pokemon-hacking.github.io/docs/generation-iv/guides/pt-reusable_repel/
- PLATINUM
- Script File: 211
- Script Entry: 33
- Text Archive: 213
- MultiStandardText Text Archive: 361
- HGSS
- Script File: 3
- Script Entry: 23
- Text Archive: 40
- MultiStandardText Text Archive: 191
- ----------------------------------------------------------------------------------------------------
- -----------------------------------------Script File Edits------------------------------------------
- -----------------------------------------------DSPRE------------------------------------------------
- Script File 3
- --------------------------------------------------SCRIPTS--------------------------------------------------
- Script 23:
- PlayFanfare 1500
- LockAll
- CheckItem 79 1 0x800C
- CompareVarValue 0x800C 1
- JumpIf EQUAL Function#177
- CheckItem 76 1 0x800C
- CompareVarValue 0x800C 1
- JumpIf EQUAL Function#177
- CheckItem 77 1 0x800C
- CompareVarValue 0x800C 1
- JumpIf EQUAL Function#177
- Message 65
- WaitAB
- CloseMessage
- ReleaseAll
- End
- -------------------------------------------------FUNCTIONS---------------------------------------------------
- Function 177:
- Message 66
- YesNoBox 0x800C
- CompareVarValue 0x800C 0
- JumpIf EQUAL Function#178
- CloseMessage
- ReleaseAll
- End
- Function 178:
- CloseMessage
- MultiStandardText 1 1 0 1 0x800C
- CheckItem 79 1 0x8000
- CompareVarValue 0x8000 1
- CallIf EQUAL Function#179
- CheckItem 76 1 0x8000
- CompareVarValue 0x8000 1
- CallIf EQUAL Function#180
- CheckItem 77 1 0x8000
- CompareVarValue 0x8000 1
- CallIf EQUAL Function#181
- ShowMulti
- CompareVarValue 0x800C 0
- JumpIf EQUAL Function#182
- CompareVarValue 0x800C 1
- JumpIf EQUAL Function#183
- CompareVarValue 0x800C 2
- JumpIf EQUAL Function#184
- ReleaseAll
- End
- Function 179:
- AddMultiOption 30 0
- Return
- Function 180:
- AddMultiOption 31 1
- Return
- Function 181:
- AddMultiOption 32 2
- Return
- Function 182:
- AdrsValueSet 0x020FCB60 100
- DummyNationalDexCheck
- TakeItem 79 1 0x8000
- TextPlayerName 0
- TextItem 1 79
- Message 67
- WaitButton
- CloseMessage
- ReleaseAll
- Return
- Function 183:
- AdrsValueSet 0x020FCB60 150
- DummyNationalDexCheck
- TakeItem 76 1 0x8000
- TextPlayerName 0
- TextItem 1 76
- Message 67
- WaitButton
- CloseMessage
- ReleaseAll
- Return
- Function 184:
- AdrsValueSet 0x020FCB60 250
- DummyNationalDexCheck
- TakeItem 77 1 0x8000
- TextPlayerName 0
- TextItem 1 77
- Message 67
- WaitButton
- CloseMessage
- ReleaseAll
- Return
- ----------------------------------------------------------------------------------------------------
- --------------------------------------Text Archive Additions----------------------------------------
- ----------------------------------------------------------------------------------------------------
- [Text Archive 40]
- 66: Repel’s effect wore off...\nWould you like to use another one?
- 67: \v0103ぁ\x0000\x0000 used the\n\v0108ぁ\x0001\x0000.\rWild Pokémon will be repelled.
- [Text Archive 191]
- 30: Repel
- 31: Super Repel
- 32: Max Repel
- ------------------------------------------Hex Edit Setup--------------------------------------------
- ---------------------------------------------ARM9.bin-----------------------------------------------
- --------------------------(You Can Disregard This if you're only modding)---------------------------
- OUR Step Count Holding Address - FCB60
- Full Address in ram - 020FCB60 | ENDIAN - 60 CB 0F 02
- Gets written to by script and read for "DummyNationalDexCheck" code
- ----------------------------------------------------------------------------------------------------
- REPEL DYNAMIC OFFSET POINTER - Found via guesswork, the platinum tutorial, and cheatengine(find counter, find what writes, etc)
- Full Address in ram - 02111880 | ENDIAN - 80 18 11 02
- This address has the pointer that leads to the address that has the active repel counter, on a given boot
- Must add 6919 to get final repel counter address
- ----------------------------------------------------------------------------------------------------
- ------------------------------------------Hex Edit Actual-------------------------------------------
- ---------------------------------------------ARM9.bin-----------------------------------------------
- DummyTextTrap has unused variables/arguments which interfere, I guess, so use DummyNationalDexCheck instead
- DummyNationalDexCheck pointer location: FB0DC
- OG HEX: 75 3D 04 02
- REPOINT TO: FCB21
- NEW HEX(use AdrsValueSet for compat.): 21 CB 0F 02
- --------------------------------------------------
- DummyNationalDexCheck Pointed Offset: FCB21
- BUT replace the hex starting from FCB20 with CTRL+B
- REPLACE FROM OFFSET FCB20 OG HEX:
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- REPLACE FROM OFFSET FCB20 NEW HEX:
- 03 48 01 68 03 48 09 18 03 48 02 78 0A 70 70 47 80 18 11 02 19 69 00 00 60 CB 0F 02
- New Code asm for posterity(OFFSET 020FCB20):
- ldr r0, =0x02111880
- ldr r1, [r0]
- ldr r0, =0x6919
- add r1, r1, r0
- ldr r0, =0x020FCB60
- ldrb r2, [r0]
- strb r2, [r1]
- bx lr
Advertisement
Add Comment
Please, Sign In to add comment