- 70
- Posts
- 10
- Years
- Seen Apr 30, 2025
You know how you can not only hex edit which types hit for super effective or not very effective correct?
Example: In a data table, you can find <00 05 05> which signifies Normal is not very effective against Rock which halfs the damage hence the <05> at the end of that entry.
Turns out editing the third value to something like 0f which means x 1.5 the damage, it doesn't register the attack as dealing "Super Effective" Damage.
Normally this wouldn't matter because the damage mod for type effectiveness would be what's on the table. That is until we run into a Shedinja, ergo a Wonder Guard Shendinja
This means changing each entry's third byte from 14 to anything else would make it so Shedinja won't be damaged by the attack.
I've traced the part of the battle_command script from the pokeemerald disassembly which determines whether an attack is registered as "super-effective" or not.
The part of the script is as follows:
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1 && TYPE_EFFECT_MULTIPLIER(i) == 20)
flags |= 1;
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE)
flags |= 1;
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1 && TYPE_EFFECT_MULTIPLIER(i) == 5)
flags |= 2;
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NOT_EFFECTIVE)
flags |= 2;
}
i += 3;
}
I need to know either the hexcode that corresponds to the operands/functions to this part of the script or more ideally the offset of the location where I can find and edit this part of the script in a Hex Editor seeing as I have no laptop to use a better method for this. Knowing both however would greatly help.
If anyone has anything that could help me edit this accordingly here...much appreciated.
Thanks in advance.
Example: In a data table, you can find <00 05 05> which signifies Normal is not very effective against Rock which halfs the damage hence the <05> at the end of that entry.
Turns out editing the third value to something like 0f which means x 1.5 the damage, it doesn't register the attack as dealing "Super Effective" Damage.
Normally this wouldn't matter because the damage mod for type effectiveness would be what's on the table. That is until we run into a Shedinja, ergo a Wonder Guard Shendinja
This means changing each entry's third byte from 14 to anything else would make it so Shedinja won't be damaged by the attack.
I've traced the part of the battle_command script from the pokeemerald disassembly which determines whether an attack is registered as "super-effective" or not.
The part of the script is as follows:
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1 && TYPE_EFFECT_MULTIPLIER(i) == 20)
flags |= 1;
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE)
flags |= 1;
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1 && TYPE_EFFECT_MULTIPLIER(i) == 5)
flags |= 2;
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NOT_EFFECTIVE)
flags |= 2;
}
i += 3;
}
I need to know either the hexcode that corresponds to the operands/functions to this part of the script or more ideally the offset of the location where I can find and edit this part of the script in a Hex Editor seeing as I have no laptop to use a better method for this. Knowing both however would greatly help.
If anyone has anything that could help me edit this accordingly here...much appreciated.
Thanks in advance.
Last edited: