Uploaded March 2015 | Updated September 2026, 2 weeks ago
The Pokemon Red/Blue/Yellow second AI layer encourages the use of stat up and down moves such as Growl and Swords Dance during the opponent's second turn, despite it'd make the most sense to encourage them in the first turn instead in order to maximize their potential. This is achieved by incrementing a certain address (ccd5) and encouraging stat modifying moves only during the turn that address contains exactly 1. ccd5 is cleared whenever an opponent's Pokemon faints, meaning it applies to every Pokemon's second turn.
Note that while there is another AI layer (layer 3), that discourages not very effective or ineffective moves, it only weighs them against other damaging moves, meaning that if there is no neutral or super-effective move to use, ineffective moves won't be discouraged. That's why the Cubone in the video kept using Bone Club.
Note that the AI layers 2 and 3 are not shared by every trainer class. Only the layer 1 is, with the exception of Youngster and Cue Ball (AI layer 1 discourages status moves when the player is already statused).
The Pokemon Red/Blue/Yellow second AI layer encourages the use of stat up and down moves such as Growl and Swords Dance during the opponent's second turn, despite it'd make the most sense to encourage them in the first turn instead in order to maximize their potential. This is achieved by incrementing a certain address (ccd5) and encouraging stat modifying moves only during the turn that address contains exactly 1. ccd5 is cleared whenever an opponent's Pokemon faints, meaning it applies to every Pokemon's second turn.
Note that while there is another AI layer (layer 3), that discourages not very effective or ineffective moves, it only weighs them against other damaging moves, meaning that if there is no neutral or super-effective move to use, ineffective moves won't be discouraged. That's why the Cubone in the video kept using Bone Club.
Note that the AI layers 2 and 3 are not shared by every trainer class. Only the layer 1 is, with the exception of Youngster and Cue Ball (AI layer 1 discourages status moves when the player is already statused).
![Pokemon G/S - Get (almost) infinite Items: Coin Case arbitrary code execution
Do you want infinite Rare Candies to level up your team? Or maybe you want infinite PP UPs instead? Perhaps some good vitamins? And what about infinte Leftovers for your Snorlax army?
After you perform this trick, youll get 249 stacks of all the items you have in your bag. (Note: this does not include Key Items, TMs, or Balls, only the Items Pocket).
If you want more information about how the Coin Case glitch works, read this videos description: https://www.youtube.com/watch?v=NADKp7PI2XY
This is what youll need and what youll have to do to perform this trick:
1. Pokemon:
- A Quagsire holding HP Up with Sleep Talk as the first move. Put it the fourth position of your party.
- An untrained, low level Pokemon. Put it the third position of your party. The Pidgeys or Rattatas in Route 29 are some of the best ones. Make sure that the Pokemons Special stat is not 8 and that its HP stat is not 16. Make sure the Pokemon is female as well to further increase the chances of succeding. A Pokemon that meets these three requirements will work around two thirds of the times. If it didnt work (the game froze or reset etc.), catch another Pokemon and try again.
2. Items:
2.1. Bag:
- At least one instance of each item you want to copy 249 times
2.2. PC (these items must be deposited in the PC in the following order):
- [Any Item] x[Any Amount]
- [Any Item] x30
- Lovely Mail x22
- TM22 (SolarBeam) x01
- [Any Item] x[Any Amount]
- Full Heal x20
- Escape Rope x62
- HM07 (Waterfall) x1
- [Any Item] x[Any Amount]
- Potion x19
- Poke Ball x3
- Poke Doll x32
- HM01 (Cut) x01
- [Any Item] x[Any Amount]
- Full Heal x18
- Flower Mail x46
- HM03 (Surf) x1
- X Speed x1
- Repel x51
- TM06 x1
- [Any Item] x[Any Amount]
- TM41 x[Any Amount]
3. Additional Information:
Most items are easy to obtain. TM22 is found in Route 27. Lovely Mail can be bought in Celadon Dept. Store, while Poke Doll, Flower Mail and TM41 can be bought in Goldenrod Dept. Store.
Notice that there are two stacks of Full Heal. How to deposit them then? Easy. The first time (Full Heal x20), deposit 99 Full Heals instead. When you are done with depositing every item, withdraw from that stack a total of 79 Full Heals, so that there are 20 left.
ASM / HEX / ITEM list: http://pastebin.com/CHTHdaQb
4. Steps:
- Set up the items you want to clone in your bag (remember: Items Pocket only).
- Arrange the Pokemon in your party and the items in your PC as explained before.
- Enter Prof. Elms Lab.
- Leave Prof. Elms Lab and move four steps to the right
- Open the Pokedex and open Machops page (so that you hear its cry). Bellsprout, Machoke and Omanyte should work too.
- Exit the Pokedex and open the bag.
- Switch the pockets in the bag at least once. Then use the Coin Case (if the pocket that opened is the Items Pocket, like in the video, youll need to switch pockets at least once regardless, to reach the Key Items Pocket).
- Next time you open the Items Pocket youll see 249 amounts of each item!
5. Check out my other Coin Case Arbitrary Code Execution videos! (because, why not?)
- Turn Pokemon into shiny: https://www.youtube.com/watch?v=NADKp7PI2XY
- Get level 100 Pokemon with perfect DVs and EVs: https://www.youtube.com/watch?v=JEOOCpNTx88
- Turn Coin Case into a memory editor: https://www.youtube.com/watch?v=ffZjCabeNr4 Pokemon G/S - Get (almost) infinite Items: Coin Case arbitrary code execution](https://i.ytimg.com/vi/tp49YQyJOp0/mqdefault.jpg)









