• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best places on the 'net to talk Pokémon and more! Community members will not see the bottom screen advertisements.
  • Want to share your adventures playing Pokémon?
    Check out our new Travel Journals forum for sharing playthroughs of ROM Hacks, Fan Games, and other Pokémon content!
  • IMPORTANT: Following a takedown request, the following hacks have been delisted from PokéCommunity:

    • Pokémon Glazed
    • Pokémon: Giratina Strikes Back
    • Pokémon Flora Sky
    • Pokémon Stranded
    The downloads and discussion threads for these hacks will no longer be accessible, and staff will be unable to return questions regarding accessing this content.

Research: Hold Item Effects

416
Posts
11
Years
  • Age 34
  • Seen Feb 10, 2024
When I was working on my new Item Editor tool I did research into what the bytes in the Items data were... there were some pretty good lists that explain alot but there were still some unknown bytes.
I figured out a little info and wanted to share it, I will post my more complete list here but this thread is only about one byte in particular:

Spoiler:


The bolded bytes above were previously unidentified (or still are).

This thread in only to talk about the first bolded byte, byte #18, it is now identified as the Hold Effect byte.

Byte #19 is also important in conjunction with Hold Effect byte, byte #19 is the Value byte.

I can only surmise that there is a table somewhere with pointers to THUMB scripts that actually handle the hold effects... but without knowing more about that I cannot go further than to figure out what each number placed in a the Hold Effect slot can do... so I did.

Spoiler:


So lets look at what the (Takes Value) means. It basically means we(hackers) can change how awesome these hold effects are. For instance, the Oran Berrys Hold Effect is 0x01 Heals HP... Hold Effect 0x01 Takes Value, and its Value byte is 0x0A or 10... Oran Berry Heals 10 HP... How do we make the Oran Berry heal 100 HP, put 0x64 in its Value byte.

Lets do a really fun one...
Focus Band has a Hold Effect of 0x27 he holding POKéMON may endure an attack, leaving just 1 HP. Hold Effect 0x27 Takes Values, and its Value Byte is again 0x0A, 10... this time its not an amount, its a percentage, the pokemon has a 10% chance of not dying... Lets try changing that to 100, put a 0x64 there... now your pokemon will NEVER die when holding this item... cool huh...

one more note on Value bytes, say you have a chancy and you wanna heal all its 401 HP... well 0xFF (the largest value) is only 255, but that really just means, all... the game interprets 0xFF as all, so if you need to heal all PP, HP, or whatever, 0xFF will work, even if the poke needs more than 255.

All you crazy ASM mongers can take this info, find the table, and figure out if there are any other bytes in the table (above 0x42)... then figure out how to write new effects, or stop berries from being used up... or whatever... I would appreciate any info to be posted here, maybe I will be able to incorporate it into my tool (have a checkbox for if item is used up or not)...

Hope it was informative.
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
I've done a little bit of work into adding new items, and you're right.

There are actual 4 unknown/misc bytes though. The first one as you've identified is usually the index that is checked when handling the ASM for hold-item effects. The second byte is often also used as you said, to calculate the percentage or damage of the secondary effects.

Though there isn't one specific table for every hold item sadly. Rather, item checks are scattered, similarly to abilities, around the different routines that handle battles.

I've found quite a lot that boost stats eg. Deepseascale, Deepseatooth, Quick Powder, Choice Band etc. within the damage calc routine. So this is a good place to add branches and checks for new items that raise Attack, Defense, Sp. Atk, Sp. Def (such as the Assault Vest).

Locations of some item checks to get you started:

Spoiler:


I think this is also probably the place to post my Assault vest implementation. I've got it in my rombase and given it to Spherical Ice for Gaia too, but I haven't actually posted it up anywhere on PC before. Just give your item a mystery byte of 0x46 and you're good to go. Alternatively you can just edit all the mentions of 0x46 to an index of your choosing.

Assault Vest:


Spoiler:
 
Last edited:

Touched

Resident ASMAGICIAN
625
Posts
9
Years
  • Age 122
  • Seen Feb 1, 2018
Just adding onto what MrDollSteak said. The function that loads the "held item effect byte" is located here: 0809A924. There are 27 references to this function, which means that there are 27 possible places to hook into or whatever. Many effects are actually checked twice, presumably that's just if the item has multiple effects. Battle and other routines seemingly just check whether to add the effect, rather than there being a table. If you want to add your own effect, it might just make more sense to hook into the battle function you're trying to alter. For example, the critical hit calculator checks the held items here: 0801E438.

However, there is a jump table at 0801CA64 and pointed to by 0801CA60 with a limiter at 0801CA4E that contains 27 cases. This is the berry effect check, and this is basically using a table.
 
79
Posts
9
Years
  • Age 33
  • Seen Apr 1, 2023
How would I be able to implement an eviolite, or one thay doesn't require the pokemon to be able to evolve? Would it just be combining metal powder with the deepseascale and then bypassing the check so the game thinks its a clampearl/ditto thats holding the item?
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
How would I be able to implement an eviolite, or one thay doesn't require the pokemon to be able to evolve? Would it just be combining metal powder with the deepseascale and then bypassing the check so the game thinks its a clampearl/ditto thats holding the item?

Making the eviolite is quite easy actually.

All you'd need to do is branch to free space from the original check, load the relevant values over the branch location, then check for the original item ie. deepseascale or metal powder and then return to the original routine if it is correct. Then you'd check for the eviolite byte, and if it's not, then branch to the next item check.

Under the actual eviolite code, to check if a pokemon has an evolution you'd want to do the following.
Load the evo table (0x8259754) into one register. Load the user's pokemon's index number into another register, then mov #0x28 into a third register.
Multiply the index number by #0x28, then add that to the register containing 259754, then load the contents of that register into the same register, and compare that to 0x0. If it is NOT 0x0 (has some form of evolution) it will give a successful boost.

EDIT: I've made the code now!
The index I've used 0x47 is just for my rombase, feel free to change that to whatever you want.

Eviolite
Spoiler:
 
Last edited:

kearnseyboy6

Aussie's Toughest Mudder
300
Posts
15
Years
  • Seen Jun 22, 2019
Do you think this might work for forms? Like giratina or Arceus?
 

InfiniteZero

I never change my Avatar. D=
61
Posts
17
Years
  • Age 33
  • Seen Oct 18, 2016
Has anyone discovered or even have a clue on how would one go about making entirely new 'personal'-based item effects e.g Thick Club, Light Ball? Where would the check be located that indicates that the specific Pokemon is eligible to receive that stat boost so that it can be changed to another Pokemon? Like perhaps for example, making it so Seaking could use DeepSeaScale instead of Clamperl?
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Has anyone discovered or even have a clue on how would one go about making entirely new 'personal'-based item effects e.g Thick Club, Light Ball? Where would the check be located that indicates that the specific Pokemon is eligible to receive that stat boost so that it can be changed to another Pokemon? Like perhaps for example, making it so Seaking could use DeepSeaScale instead of Clamperl?

Very easily. If you look at my Assault Vest / Eviolite code for the Sp. Def boost you'll notice this section before it branches back to the original routine:

Code:
        ldr r3, [sp, #0x4]
	ldrh r1, [r3]

What this does is load the Pokemon's index number into r1.

This doesn't necessarily work anywhere in the rom, but it does in the immediate item check sections that I've detailed earlier, because of the way the registers are stacked.

Ultimately it's as simple as adding new checks to cmp r1 against the index of the Pokemon you want to get the boost, then upon a successful check branching to the original routine which had the stat boost.
 
416
Posts
11
Years
  • Age 34
  • Seen Feb 10, 2024
Very easily. If you look at my Assault Vest / Eviolite code for the Sp. Def boost you'll notice this section before it branches back to the original routine:

Code:
        ldr r3, [sp, #0x4]
	ldrh r1, [r3]

What this does is load the Pokemon's index number into r1.

This doesn't necessarily work anywhere in the rom, but it does in the immediate item check sections that I've detailed earlier, because of the way the registers are stacked.

Ultimately it's as simple as adding new checks to cmp r1 against the index of the Pokemon you want to get the boost, then upon a successful check branching to the original routine which had the stat boost.

It sounds to me like you should be writing tutorials on how to ASM lol
 
24
Posts
11
Years
  • Seen Dec 21, 2016
Would there be any way to combine one of the power-a-certain-type effects AND make it used so we can have the type-boosting gems? Sounds like it shouldn't be hard to do do that since the power-a-certain-type effect takes values.
 
22
Posts
11
Years
  • Seen Jun 14, 2020
Is there a way to change the Defense/SpDef boosts in Eviolite and Assault Vest codes? They're branched to the Metal Powder and Deep Sea Scale which give a 2x boost as opposed to the actual 1.5 they give in the games.
 
56
Posts
5
Years
  • Age 28
  • Seen Nov 17, 2023
does anyone know if the held item effect byte value is loaded from a table somewhere? I am looking to replace a few bytes (for example byte 41, because cubone is not in my hack) with something like boosting fairy-type moves.
 
Last edited:
239
Posts
8
Years
  • Age 31
  • Seen Nov 12, 2023
does anyone know if the held item effect byte value is loaded from a table somewhere? I am looking to replace a few bytes (for example byte 41, because cubone is not in my hack) with something like boosting fairy-type moves.

Unfortunately not. The item effects are checked throughout damage calculation and similar functions. So you would need some assembly/C function to include an item ID check.
 
56
Posts
5
Years
  • Age 28
  • Seen Nov 17, 2023
Unfortunately not. The item effects are checked throughout damage calculation and similar functions. So you would need some assembly/C function to include an item ID check.

I meant is there a pointer (probably in a table of pointers) somewhere in the rom that points to the routine used by the thick club item? If that is how it works, I could change it to point to a another routine so that the thick club (byte 41), would have another effect.
 
Last edited:
56
Posts
5
Years
  • Age 28
  • Seen Nov 17, 2023
If there was, that'd be really easy to figure out. Do you know what a reverse pointer is?

...yes. the problem is I don't know the offset for the routine itself, so how would I even know the reverse pointer that i'm looking for? That's why I'm asking the question, to see if anyone knows the location of any of these routines or to the table of pointers, if one exists.
 
56
Posts
5
Years
  • Age 28
  • Seen Nov 17, 2023
Find the table for the bytes by changing an item with the 0 byte to the 1 byte using G3T and then comparing the old file with the changed file in a hex editor

That wouldn't help me, that would just change the 16th byte of the item. It wouldn't change any pointers since the held item effect is determined by the 16th byte and not an actual pointer to a routine. There's probably a table somewhere that points to all of the held item routines, and the 16th byte of each held item determines which pointer to use from the table.
 
Back
Top