Item data structure (Generation III): Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
mNo edit summary
(23 intermediate revisions by 17 users not shown)
Line 2: Line 2:


<!-- In the Japanese version, the name field is only 10 bytes long, so the structure is 40 bytes long. -->
<!-- In the Japanese version, the name field is only 10 bytes long, so the structure is 40 bytes long. -->
 
{| class="roundy" style="float:right; width:auto; text-align:center; margin: 0 0 0.5em 0.5em; background: #ccf; border: 3px solid blue;"
{| {{bluetable|float: right;}}
|-
|- style="background: #ccf;"
! Offset
! Offset
! Field
! Field
! Size
! Size
|-
|- style="background:#F8F8FF"
! 0
! 0
| Name
| Name
| 14 bytes
| 14 bytes
|-
|- style="background:#F8F8FF"
! 14
! 14
| [[List of items by index number (GBA)|Index number]]
| [[List of items by index number (Generation III)|Index number]]
| 2 bytes
| 2 bytes
|-
|- style="background:#F8F8FF"
! 16
! 16
| Price
| Price
| 2 bytes
| 2 bytes
|-
|- style="background:#F8F8FF"
! 18
! 18
| Special value 1
| Hold effect
| 1 byte
| 1 byte
|-
|- style="background:#F8F8FF"
! 19
! 19
| Special value 2
| Parameter
| 1 byte
| 1 byte
|-
|- style="background:#F8F8FF"
! 20
! 20
| Description pointer
| Description pointer
| 4 bytes
| 4 bytes
|-
|- style="background:#F8F8FF"
! 24
! 24
| Mystery value
| Mystery value
| 2 bytes
| 2 bytes
|-
|- style="background:#F8F8FF"
! 26
! 26
| Pocket
| Pocket
| 1 byte
| 1 byte
|-
|- style="background:#F8F8FF"
! 27
! 27
| Type
| Type
| 1 byte
| 1 byte
|-
|- style="background:#F8F8FF"
! 28
! 28
| Pointer to field usage code
| Pointer to field usage code
| 4 bytes
| 4 bytes
|-
|- style="background:#F8F8FF"
! 32
! 32
| Battle usage
| Battle usage
| 4 bytes
| 4 bytes
|-
|- style="background:#F8F8FF"
! 36
! 36
| Pointer to battle usage code
| Pointer to battle usage code
| 4 bytes
| 4 bytes
|-
|- style="background:#F8F8FF"
! 40
! 40
| Extra parameter
| Extra parameter
Line 63: Line 62:


==Pocket==
==Pocket==
This determines which pocket of the [[bag]] the item should be stored in.
This determines which pocket of the [[Bag]] the item should be stored in. This does not prevent the item from being in another pocket, though. The game uses it to see where it should place the item upon collection.


{| {{bluetable}}
For FireRed and LeafGreen
|- style="background: #ccf;"
{| class="roundy" style="width:auto; text-align:center; background: #ccf; border: 3px solid blue;"
|-
! Number
! Number
! Item type
! Pocket
|-
|- style="background:#F8F8FF"
! 1
! 1
| Main pocket
| Items pocket
|-
|- style="background:#F8F8FF"
! 2
! 2
| [[Poké Ball]]
| Key items pocket
|-
|- style="background:#F8F8FF"
! 3
! 3
| [[Berries]]
| [[Poké Ball]]s pocket
|-
|- style="background:#F8F8FF"
! 4
! 4
| {{Berries}} pocket
|- style="background:#F8F8FF"
! 5
| [[TM]]s and [[HM]]s
| [[TM]]s and [[HM]]s
|-
|}
 
 
For Emerald, Ruby and Sapphire
{| class="roundy" style="width:auto; text-align:center; background: #ccf; border: 3px solid blue;"
|-
! Number
! Pocket
|- style="background:#F8F8FF"
! 1
| Items pocket
|- style="background:#F8F8FF"
! 2
| [[Poké Ball]]s pocket
|- style="background:#F8F8FF"
! 3
| [[TM]]s and [[HM]]s
|- style="background:#F8F8FF"
! 4
| {{Berries}} pocket
|- style="background:#F8F8FF"
! 5
! 5
| Key items
| Key items pocket
|- style="background:#F8F8FF"
|}
|}


Line 89: Line 113:
For items other than [[Poké Ball]]s, the type determines how the item can be used. With Poké Balls, the type indicates the Poké Ball type, and is one less than the index number.
For items other than [[Poké Ball]]s, the type determines how the item can be used. With Poké Balls, the type indicates the Poké Ball type, and is one less than the index number.


{| {{bluetable}}
{| class="roundy" style="width:auto; text-align:center; background: #ccf; border: 3px solid blue;"
|- style="background: #ccf;"
|-
! Type
! Type
! Description
! Description
|-
|- style="background:#F8F8FF"
! 0
! 0
| [[Mail]]
| [[Mail]]
|-
|- style="background:#F8F8FF"
! 1
! 1
| Items which can be used out-of-battle.
| Items which can be used out-of-battle.
|-
|- style="background:#F8F8FF"
! 2
! 2
| Items which must be used in a certain location; key items of this type can be assigned to <sc>select</sc>.
| Items which must be used in a certain location; key items of this type can be assigned to <sc>select</sc>.
|-
|- style="background:#F8F8FF"
! 3
! 3
| Only the [[Pokéblock]] case is of this type.
| Only the [[Pokéblock]] case is of this type.
|-
|- style="background:#F8F8FF"
! 4
! 4
| Items which cannot be used out-of-battle.
| Items which cannot be used out-of-battle.
|}
|}
== Parameter ==
A parameter used by different kind of items. It is used to represent the number of steps repels and flute effects last. HP and PP recovering items have this value as their number of HP/PP recovered, but the actual number of HP/PP restored is stored in a different table.


==Mystery values==
==Mystery values==
Line 114: Line 141:
* 0 for normal items.
* 0 for normal items.
* 1 for HMs and ''most'' key items.
* 1 for HMs and ''most'' key items.
* 2 for some plot-related key items: Devon Goods, Letter, Red Orb, Blue Orb and Oak's Parcel.
* 2 for some plot-related key items: Blue Orb, Devon Goods, Letter, Oak's Parcel and Red Orb.


Mystery value 2 is:
Mystery value 2 is:
* 0 for most items.
* 0 for most items.
* 1 for many key items: Mach Bike, Itemfinder, Old Rod, Good Rod, Super Rod, Acro Bike, Pokéblock Case, Bicycle, Town Map, VS Seeker, Fame Checker, TM Case, Berry Pouch, Teachy TV, Tri-Pass, Rainbow Pass, Tea, Mysticticket, Auroraticket, Powder Jar, Ruby, Sapphire, Magma Emblem and Old Sea Map.
* 1 for many key items: Acro Bike, AuroraTicket, Berry Pouch, Bicycle, Fame Checker, Good Rod, Itemfinder, Mach Bike, Magma Emblem, MysticTicket, Old Rod, Old Sea Map, Pokéblock Case, Powder Jar, Rainbow Pass, Ruby, Sapphire, Super Rod, TM Case, Tea, Teachy TV, Town Map, Tri-Pass and VS Seeker.


==Battle usage==
==Battle usage==
Line 129: Line 156:
Extra parameter is used to distinguish Poké Balls and Mails, as opposed to just using the item index.
Extra parameter is used to distinguish Poké Balls and Mails, as opposed to just using the item index.


[[Category:Structures]]
==Offsets==
These are for US Versions:
* Ruby: 0x083C5564
* Sapphire: 0x083C55BC
* Emerald: 0x085839A0
* FireRed: 0x083DB028
* LeafGreen: 0x083DAE64
 
==Fingerprint==
 
For Ruby/Sapphire:
<pre>
AC AC AC AC AC AC AC AC FF 00 00 00 00 00 00 00 00 00 00 00 DA 55 3C 08 00 00 01 04 11 A7 0C 08 00 00 00 00 00 00 00 00 00 00 00 00  // ????????
C7 BB CD CE BF CC 00 BC BB C6 C6 FF 00 00 01 00 00 00 00 00 A0 20 3C 08 00 00 02 00 00 00 00 00 02 00 00 00 65 A2 0C 08 00 00 00 00  // MASTER BALL
CF C6 CE CC BB 00 BC BB C6 C6 FF 00 00 00 02 00 B0 04 00 00 D3 20 3C 08 00 00 02 01 00 00 00 00 02 00 00 00 65 A2 0C 08 01 00 00 00  // ULTRA BALL
C1 CC BF BB CE 00 BC BB C6 C6 FF 00 00 00 03 00 58 02 00 00 0D 21 3C 08 00 00 02 02 00 00 00 00 02 00 00 00 65 A2 0C 08 02 00 00 00  // GREAT BALL
CA C9 C5 1B 00 BC BB C6 C6 FF 00 00 00 00 04 00 C8 00 00 00 44 21 3C 08 00 00 02 03 00 00 00 00 02 00 00 00 65 A2 0C 08 03 00 00 00  // POKE BALL
CD BB C0 BB CC C3 00 BC BB C6 C6 FF 00 00 05 00 00 00 00 00 6B 21 3C 08 00 00 02 04 00 00 00 00 02 00 00 00 65 A2 0C 08 04 00 00 00  // SAFARI BALL
C8 BF CE 00 BC BB C6 C6 FF 00 00 00 00 00 06 00 E8 03 00 00 A0 21 3C 08 00 00 02 05 00 00 00 00 02 00 00 00 65 A2 0C 08 05 00 00 00  // NET BALL
BE C3 D0 BF 00 BC BB C6 C6 FF 00 00 00 00 07 00 E8 03 00 00 D7 21 3C 08 00 00 02 06 00 00 00 00 02 00 00 00 65 A2 0C 08 06 00 00 00  // DIVE BALL
C8 BF CD CE 00 BC BB C6 C6 FF 00 00 00 00 08 00 E8 03 00 00 0F 22 3C 08 00 00 02 07 00 00 00 00 02 00 00 00 65 A2 0C 08 07 00 00 00  // NEST BALL
...
</pre>
 
{{data structure}}<br>
{{Project Games notice|data structure}}

Revision as of 19:16, 10 June 2019

Item data is stored in a 44-byte structure in the US version of the GBA games.

Offset Field Size
0 Name 14 bytes
14 Index number 2 bytes
16 Price 2 bytes
18 Hold effect 1 byte
19 Parameter 1 byte
20 Description pointer 4 bytes
24 Mystery value 2 bytes
26 Pocket 1 byte
27 Type 1 byte
28 Pointer to field usage code 4 bytes
32 Battle usage 4 bytes
36 Pointer to battle usage code 4 bytes
40 Extra parameter 4 bytes

Pocket

This determines which pocket of the Bag the item should be stored in. This does not prevent the item from being in another pocket, though. The game uses it to see where it should place the item upon collection.

For FireRed and LeafGreen

Number Pocket
1 Items pocket
2 Key items pocket
3 Poké Balls pocket
4 Berries pocket
5 TMs and HMs


For Emerald, Ruby and Sapphire

Number Pocket
1 Items pocket
2 Poké Balls pocket
3 TMs and HMs
4 Berries pocket
5 Key items pocket

Type

For items other than Poké Balls, the type determines how the item can be used. With Poké Balls, the type indicates the Poké Ball type, and is one less than the index number.

Type Description
0 Mail
1 Items which can be used out-of-battle.
2 Items which must be used in a certain location; key items of this type can be assigned to select.
3 Only the Pokéblock case is of this type.
4 Items which cannot be used out-of-battle.

Parameter

A parameter used by different kind of items. It is used to represent the number of steps repels and flute effects last. HP and PP recovering items have this value as their number of HP/PP recovered, but the actual number of HP/PP restored is stored in a different table.

Mystery values

Mystery value 1 is:

  • 0 for normal items.
  • 1 for HMs and most key items.
  • 2 for some plot-related key items: Blue Orb, Devon Goods, Letter, Oak's Parcel and Red Orb.

Mystery value 2 is:

  • 0 for most items.
  • 1 for many key items: Acro Bike, AuroraTicket, Berry Pouch, Bicycle, Fame Checker, Good Rod, Itemfinder, Mach Bike, Magma Emblem, MysticTicket, Old Rod, Old Sea Map, Pokéblock Case, Powder Jar, Rainbow Pass, Ruby, Sapphire, Super Rod, TM Case, Tea, Teachy TV, Town Map, Tri-Pass and VS Seeker.

Battle usage

Battle usage can be:

  • 0 if the item can't be used in battle at all.
  • 1 if the item's effect is seen during battle but on a subscreen, such as healing items.
  • 2 if the item's effect is seen in battle such as Poké Balls.

Extra parameter

Extra parameter is used to distinguish Poké Balls and Mails, as opposed to just using the item index.

Offsets

These are for US Versions:

  • Ruby: 0x083C5564
  • Sapphire: 0x083C55BC
  • Emerald: 0x085839A0
  • FireRed: 0x083DB028
  • LeafGreen: 0x083DAE64

Fingerprint

For Ruby/Sapphire:

AC AC AC AC AC AC AC AC FF 00 00 00 00 00 00 00 00 00 00 00 DA 55 3C 08 00 00 01 04 11 A7 0C 08 00 00 00 00 00 00 00 00 00 00 00 00  // ????????
C7 BB CD CE BF CC 00 BC BB C6 C6 FF 00 00 01 00 00 00 00 00 A0 20 3C 08 00 00 02 00 00 00 00 00 02 00 00 00 65 A2 0C 08 00 00 00 00  // MASTER BALL
CF C6 CE CC BB 00 BC BB C6 C6 FF 00 00 00 02 00 B0 04 00 00 D3 20 3C 08 00 00 02 01 00 00 00 00 02 00 00 00 65 A2 0C 08 01 00 00 00  // ULTRA BALL
C1 CC BF BB CE 00 BC BB C6 C6 FF 00 00 00 03 00 58 02 00 00 0D 21 3C 08 00 00 02 02 00 00 00 00 02 00 00 00 65 A2 0C 08 02 00 00 00  // GREAT BALL
CA C9 C5 1B 00 BC BB C6 C6 FF 00 00 00 00 04 00 C8 00 00 00 44 21 3C 08 00 00 02 03 00 00 00 00 02 00 00 00 65 A2 0C 08 03 00 00 00  // POKE BALL
CD BB C0 BB CC C3 00 BC BB C6 C6 FF 00 00 05 00 00 00 00 00 6B 21 3C 08 00 00 02 04 00 00 00 00 02 00 00 00 65 A2 0C 08 04 00 00 00  // SAFARI BALL
C8 BF CE 00 BC BB C6 C6 FF 00 00 00 00 00 06 00 E8 03 00 00 A0 21 3C 08 00 00 02 05 00 00 00 00 02 00 00 00 65 A2 0C 08 05 00 00 00  // NET BALL
BE C3 D0 BF 00 BC BB C6 C6 FF 00 00 00 00 07 00 E8 03 00 00 D7 21 3C 08 00 00 02 06 00 00 00 00 02 00 00 00 65 A2 0C 08 06 00 00 00  // DIVE BALL
C8 BF CD CE 00 BC BB C6 C6 FF 00 00 00 00 08 00 E8 03 00 00 0F 22 3C 08 00 00 02 07 00 00 00 00 02 00 00 00 65 A2 0C 08 07 00 00 00  // NEST BALL
...


Data structure in the Pokémon games
Generation I Pokémon speciesPokémonPoké MartCharacter encodingSave
Generation II Pokémon speciesPokémonTrainerCharacter encoding (Korean) • Save
Generation III Pokémon species (Pokémon evolutionPokédexType chart)
Pokémon (substructures) • MoveContestContest moveItem
Trainer TowerBattle FrontierCharacter encodingSave
Generation IV Pokémon species (Pokémon evolutionLearnsets)
PokémonSaveCharacter encoding
Generation V-present Character encoding
TCG GB and GB2 Character encoding


Project Games logo.png This data structure article is part of Project Games, a Bulbapedia project that aims to write comprehensive articles on the Pokémon games.