diff options
-rw-r--r-- | Infinite-TM-usage.md | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/Infinite-TM-usage.md b/Infinite-TM-usage.md index dc52af1..afacb97 100644 --- a/Infinite-TM-usage.md +++ b/Infinite-TM-usage.md @@ -1,4 +1,4 @@ -Credit to paccy for this tutorial in the Simple Modifications Pokecommunity thread. The tutorial was modified by ExpoSeed. +Credit to paccy for this tutorial in the Simple Modifications Pokecommunity thread. The tutorial was modified by ExpoSeed and surskitty. This tutorial will make all TMs infinitely reusable, unholdable by Pokemon, unsellable to shops, and also removes the number from appearing in the Bag. @@ -106,7 +106,37 @@ Now to add the code that prevents the rebuying. Edit the `Task_BuyMenu` function else { ``` -And that's it! + +This prevents rebuying from shops, but there's still the Mauville Game Corner. Let's go to [data/maps/MauvilleCity_GameCorner/scripts.inc](../blob/master/data/maps/MauvilleCity_GameCorner/scripts.inc). + +First, let's replace the `MauvilleCity_GameCorner_EventScript_NoRoomForTM` function with `MauvilleCity_GameCorner_EventScript_YouAlreadyHaveThis`. The bag will no longer be full, so let's instead use the same string we used for the shops. +```diff + goto MauvilleCity_GameCorner_EventScript_ReturnToChooseTMPrize + end + +-MauvilleCity_GameCorner_EventScript_NoRoomForTM:: +- call Common_EventScript_BagIsFull ++MauvilleCity_GameCorner_EventScript_YouAlreadyHaveThis:: ++ msgbox gText_YouAlreadyHaveThis, MSGBOX_DEFAULT + goto MauvilleCity_GameCorner_EventScript_ReturnToChooseTMPrize + end +``` + +Next, we need to replace all of the checks to see if there is room with checks for if you have the item. These currently use `checkitemspace`. We can replace them with `checkitem` and exiting the function if the result is true. +```diff + compare VAR_TEMP_2, TM13_COINS + goto_if_lt MauvilleCity_GameCorner_EventScript_NotEnoughCoinsForTM +- checkitemspace ITEM_TM13, 1 +- compare VAR_RESULT, FALSE +- goto_if_eq MauvilleCity_GameCorner_EventScript_NoRoomForTM ++ checkitem ITEM_TM13, 1 ++ compare VAR_RESULT, TRUE ++ goto_if_eq MauvilleCity_GameCorner_EventScript_YouAlreadyHaveThis + removecoins TM13_COINS + additem ITEM_TM13 + updatecoinsbox 1, 1``` + +Repeat for each TM, and that's it!   |