The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Research & Development (https://www.pokecommunity.com/forumdisplay.php?f=195)
-   -   Code Ability Resource Thread (https://www.pokecommunity.com/showthread.php?t=343264)

pikachux2 September 29th, 2017 7:09 AM

Hey, can anyone explain to me if I need to, or why I don't need to, point Abilities in PGE to some specific offset? Does the game just check the string representation of the ability to see if the Pokémon has it? Or am I missing the part where I somehow point it to the index of the ability in PGE?

Skeli September 29th, 2017 8:24 AM

Quote:

Originally Posted by pikachux2 (Post 9764199)
Hey, can anyone explain to me if I need to, or why I don't need to, point Abilities in PGE to some specific offset? Does the game just check the string representation of the ability to see if the Pokémon has it? Or am I missing the part where I somehow point it to the index of the ability in PGE?

The ability names and descriptions and still stored in tables.

pikachux2 September 30th, 2017 3:07 AM

Quote:

Originally Posted by Skeli Unbound (Post 9764243)
The ability names and descriptions and still stored in tables.

Thanks, I understand that, but how is the actual effect of the ability called in battle? I can't find anyway to point the name of the ability to its corresponding effect. So the question is, do I have to?

BluRose September 30th, 2017 8:41 AM

Quote:

Originally Posted by pikachux2 (Post 9764853)
Thanks, I understand that, but how is the actual effect of the ability called in battle? I can't find anyway to point the name of the ability to its corresponding effect. So the question is, do I have to?

individual abilities are each checked for in the battle engine as indexes.

this next scene is a plausible way of it working

so like take levitate
let's say we have our latios with levitate
earthquake is used by opponent
game checks type of move used - returns ground
game checks latios for ability - returns levitate
compares it with levitate's index number
branches off to levitate's battle message printing and zero damage done
attack over

pikachux2 October 1st, 2017 12:05 AM

Quote:

Originally Posted by BluRose (Post 9765079)
individual abilities are each checked for in the battle engine as indexes.

this next scene is a plausible way of it working

so like take levitate
let's say we have our latios with levitate
earthquake is used by opponent
game checks type of move used - returns ground
game checks latios for ability - returns levitate
compares it with levitate's index number
branches off to levitate's battle message printing and zero damage done
attack over

thanks perfect

pikachux2 October 1st, 2017 5:29 PM

One more thing, this line of code I've found at the end of each ability script,
Spoiler:
#insert 01 49 08 47 00 00 xx xx xx 08 at 026192

I assume I'm supposed to change those x's to something meaningful like a pointer, is that the case?

Skeli October 1st, 2017 7:13 PM

Quote:

Originally Posted by pikachux2 (Post 9766138)
One more thing, this line of code I've found at the end of each ability script,
Spoiler:
#insert 01 49 08 47 00 00 xx xx xx 08 at 026192

I assume I'm supposed to change those x's to something meaningful like a pointer, is that the case?

Pointer to your asm routine +1.

pikachux2 October 2nd, 2017 11:47 AM

Quote:

Originally Posted by Skeli Unbound (Post 9766226)
Pointer to your asm routine +1.

Thanks again :)

YourFavoriteEgyptian April 7th, 2018 9:48 AM

Hey everyone, I'm new around here and would love to learn how write my own abilities. I've been reading up on ASM and battle scripts for the past couple days, but I am still not confident enough to begin to write anything of my own. I really want to implement a special type Fur Coat ability into my game. Could anyone supply me with the code and possibly explain how it works so that I can better learn how to do this myself?
Thanks in advance!

Lance Koijer 2.0 May 13th, 2018 9:15 AM

Hello guys the code of normalize and pixilate is still broken.

Quote:

Originally Posted by Petuuuhhh (Post 9875968)
Can anyone code Beast Boost?

Thank you!

I have replicated soul-heart already, the only problem when I was creating the ability is that the checking of the highest stat.. I'd tried to make an ASM that will compare each stats so whatver stat got the highest will increase. If someone can just make an ASM that will get the highest stat of a pokémon and store it somewhere, the ability would be possible.

Le pug July 7th, 2018 5:21 PM

Quote:

Originally Posted by MrDollSteak (Post 8729415)
Spoiler:
The byte changes actually re-insert the routine for you. The implementation was broken, so the byte changes make it reflect this new routine.



Fur Coat and Multiscale definitely work 100% as intended, no breaking at all.
I fixed No Guard, basically I put a ldr, instead of ldrb, for the bank check, it definitely works now.

Mold Breaker, Teravolt and Turboblaze

Spoiler:
Emerald (credits to KDS for the original Fire Red routines)
Spoiler:
Step 1
Spoiler:
Mold Breaker Table
Spoiler:
00 00 00 00 01 01 00 01 01 00 01 01 01 00 00 01
00 02 01 01 01 01 00 00 00 01 02 00 00 01 00 00
00 00 00 00 00 00 00 01 01 01 00 01 00 00 00 01
00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 01
00 00 00 00 00 00 00 00 01 01 00 01 00 00 01 01
00 00 01 00 00 00 01 01 01 00 00 00 00 00 00 00
00 00 00 00 00 00 00 02 00 00 00 00 00 00 01 00
01 00 00 00 00 01 00 00 00 00 00 01 00 00 00 01
00 00 00 00 00 00 00 01 01 01 00 00 00 01 00 01
00 00 01 00 01 00 00 00 00 00 00 00 00 01 01 00
00 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Insert this table if your ROM has the abilities in the same order that is mentioned in the OP (otherwise you will have to modify according to the format.
There are 256 entries in this table which equal to the maximum No. of abilities that can be accomodated in a GBA rom.

An entry for each ability takes one byte of space and there are entries for every ability. The entry is set to 00 if Mold Breaker does not negate the ability, 01 (or a non-zero value) if Mold Breaker is able to negate it and 02 if the the ability is negated to simulate the Gen V hazard effect.

For e.g, the first entry is for Ability ID 0x0 and does not need to be negated by mold breaker so its entry is set to 00. The second entry is for Stench (ID = 0x1) so set to 00. The 6th entry is set to 01 because MB negates Sturdy (ID = 0x5).

There are some abilities that do not work with this method and require special explicit checks and there entry is set to 00 to avoid wastage of time.
Spoiler:
1. Damp (it checks in the whole battle field rather than a single target, so the 'faintifnotdamp' battlescript command needs to be edited for this. I'm leaving this for now)

2. Lightning and Storm Drain (mold breaker should allow redirection of move).

3. Friend Guard, Aroma Veil, Sweet Veil, Flower Veil (the target's boosts are sometimes by virtue of its ally's ability).

Modify the table accordingly if there is a need to.

Step 2
1a. Replace x8TTTTTT in the routines with the offset of the Mold breaker table.
1b. Insert these routines with byte changes in the respective code comments.
Spoiler:
Routine 1 (Checks for user's Mold Breaker prior to move execution and then disables abilities that negate, also probably the best place to insert Stance Change)
Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global moldbreaker

AbilityBufferUser:
            push {r2-r4}
        ldr r0, .Bank
        ldrb r0, [r0]
        mov r1, #0x58
        ldr r2, .BattleData
        mul r0, r1
        add r0, r0, r2
        ldrb r0, [r0]
MoldBreakerCheck:
        cmp r0, #0x69
          beq MoldBreaker
            cmp r0, #0xA4
            beq MoldBreaker
            cmp r0, #0xA5
            bne Return
MoldBreaker:
AbilityBufferTarget:
            ldr r0, .Bank
        add r0, #0x1
            ldrb r4, [r0]
        mul r1, r4
        add r1, r1, r2
            ldrb r3, [r1]
LoadTable:
            ldr r0, .MoldBreakerTable
          add r2, r0, r3
            ldrb r0, [r2]
CheckIfAffected:
            cmp r0, #0x0
            beq Return
Affected:
            mov r0, #0xFF
            strb r0, [r1]
            ldr r0, .DisabledAbilityLoc
            add r0, r4
            strb r3, [r0]
Return:
            pop {r2-r4}
            bl Canceler
            lsl r0, r0, #0x18
            lsr r2, r0, #0x18
            cmp r2, #0x0
            beq Continue
            ldr r0, .Return
            bx r0
Continue:
            ldr r0, .Return2
            bx r0

Canceler:
            ldr r0, .Return3
            bx r0

.align 2

.Bank: .word 0x0202420B
.BattleData: .word 0x020240A4
.MoldBreakerTable: .word 0x08TTTTTT
.DisabledAbilityLoc: .word 0x0203E32C
.Return: .word 0x08046399
.Return2: .word 0x08046073
.Return3: .word 0x08041A6D

#insert 00 48 00 47 xx xx xx 08 at 046064



Routine II (Checks for user's Mold Breaker in target iterating moves like Earthquake and then disables abilities that negate damage)
Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global moldbreakermultipletargets

AbilityBufferUser:
            push {r1-r4}
        ldr r0, .Bank
        ldrb r0, [r0]
        mov r1, #0x58
        ldr r2, .BattleData
        mul r0, r1
        add r0, r0, r2
        ldrb r0, [r0]
MoldBreakerCheck:
        cmp r0, #0x69
          beq MoldBreaker
            cmp r0, #0xA4
            beq MoldBreaker
            cmp r0, #0xA5
            bne Return
MoldBreaker:
AbilityBufferTarget:
            ldr r0, .Bank
        add r0, #0x1
            ldrb r4, [r0]
        mul r1, r4
        add r1, r1, r2
            ldrb r3, [r1]
LoadTable:
            ldr r0, .MoldBreakerTable
          add r2, r0, r3
            ldrb r0, [r2]
CheckIfAffected:
            cmp r0, #0x0
            beq Return
Affected:
            mov r0, #0xFF
            strb r0, [r1]
            ldr r0, .DisabledAbilityLoc
            add r0, r4
            strb r3, [r0]
Return:
            pop {r1-r4}
            ldr r0, [r1]
        add r0, #0x1
        str r0, [r1]
        pop {r0}
        bx r0

.align 2

.Bank: .word 0x0202420B
.BattleData: .word 0x020240A4
.MoldBreakerTable: .word 0x08TTTTTT
.DisabledAbilityLoc: .word 0x0203E32C

#insert 00 48 00 47 xx xx xx 08 at 04AF78



Routine III (Generation V effect. Makes the foe affected by entry hazards even if it has an ability to negate the hazards effect (except Magic Guard))
Spoiler:
At 028308 insert a pointer to free space XX XX XX 08.

Battle Script at XX XX XX
Code:

09 0A E2 00 58 00 3A
2B 04 EC 2F 02 02
08 00 00 00
YY YY YY 08
2E 3A 43 02 02
05 F6


Battle Script at YY YY YY
Code:

4C 00
4D 00
4E 00
00 3A 10 54 01
F9 XX+1 XX XX 08
52 00 28 4E 8A 2D 08


Routine at XX XX XX
Code:

.text
.align 2
.thumb
.thumb_func
.global moldbreakermultipletargets

AbilityBufferUser:
            push {lr}
        ldr r0, .Bank
        ldrb r0, [r0]
        mov r1, #0x58
        ldr r2, .BattleData
        mul r0, r1
        add r0, r0, r2
        ldrb r0, [r0]
MoldBreakerCheck:
        cmp r0, #0x69
          beq MoldBreaker
            cmp r0, #0xA4
            beq MoldBreaker
            cmp r0, #0xA5
            bne Return
MoldBreaker:
AbilityBufferTarget:
            ldr r0, .Bank
        add r0, #0x1
            ldrb r4, [r0]
        mul r1, r4
        add r1, r1, r2
            ldrb r3, [r1]
LoadTable:
            ldr r0, .MoldBreakerTable
          add r2, r0, r3
            ldrb r0, [r2]
CheckIfAffected:
            cmp r0, #0x0
            beq Return
Affected:
            mov r0, #0xFF
            strb r0, [r1]
            ldr r0, .DisabledAbilityLoc
            add r0, r4
            strb r3, [r0]
Return:
        pop {r0}
        bx r0

.align 2

.Bank: .word 0x0202420B
.BattleData: .word 0x020240A4
.MoldBreakerTable: .word 0x08TTTTTT
.DisabledAbilityLoc: .word 0x0203E32C



Routine IV (Restores disabled abilities at the end of move execution)
Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global restoreabilities

EndTurn:
            ldr r0, .Outcome
        mov r1, #0x0
        strb r1, [r0]
        ldr r0, .Index
        strb r1, [r0]
RestoreAbilities:
        push {r2-r6}
        ldr r4, .Battlers
        ldrb r4, [r4]
        mov r3, #0x0
        ldr r5, .DisabledAbilityLoc
        ldr r6, .BattleData
Loop:
        ldrb r2, [r5, #0x0]
        cmp r2, #0x0
        beq EndLoop
        strb r2, [r6]
        strb r1, [r5]
EndLoop:
        add r3, r3, #0x1
        cmp r3, r4
        bge Exit
        add r5, r5, #0x1
        add r6, r6, #0x58
        b Loop
Exit:
        pop {r2-r6}
        ldr r1, .EndLoc
        mov r0, #0xB
        strb r0, [r1]
        pop {r0}
        bx r0

.align 2

.Outcome: .word 0x0202427C
.Index: .word 0x02024064
.Battlers: .word 0x0202406C
.DisabledAbilityLoc: .word 0x0203E32C
.BattleData: .word 0x020240A4
.EndLoc: .word 0x02024083

#insert 00 48 00 47 xx xx xx 08 at 04B67C



For anyone who uses this, just remember that you HAVE to place Mold Breaker in Ability slot #2 for whatever Pokemon you are editing or it WON'T work. (i.e. Pangoro would be Ability 1: Iron Fist Ability 2: Mold Breaker)

Xencleamas July 11th, 2018 2:21 AM

Quote:

Originally Posted by Le pug (Post 9898303)
For anyone who uses this, just remember that you HAVE to place Mold Breaker in Ability slot #2 for whatever Pokemon you are editing or it WON'T work. (i.e. Pangoro would be Ability 1: Iron Fist Ability 2: Mold Breaker)

Is the problem only for Pokemon with one ability (e.g. Treecko Ability#1: Overgrow; Ability #2: "???????")? Ppl could have duplicated the ability to the second slot (e.g. Treecko Ability#1: Overgrow; Ability #2: Overgrow).

jirachiwishmaker July 11th, 2018 7:20 PM

Quote:

Originally Posted by Lance Koijer 2.0 (Post 9876155)
Hello guys the code of normalize and pixilate is still broken.



I have replicated soul-heart already, the only problem when I was creating the ability is that the checking of the highest stat.. I'd tried to make an ASM that will compare each stats so whatver stat got the highest will increase. If someone can just make an ASM that will get the highest stat of a pokémon and store it somewhere, the ability would be possible.

How Pixilate is broken?

Le pug July 11th, 2018 7:28 PM

Quote:

Originally Posted by Xencleamas (Post 9899611)
Is the problem only for Pokemon with one ability (e.g. Treecko Ability#1: Overgrow; Ability #2: "???????")? Ppl could have duplicated the ability to the second slot (e.g. Treecko Ability#1: Overgrow; Ability #2: Overgrow).

For Mold Breaker, it specifically needs to be in Ability #2 IF you have another ability with it. If you have a pokemon with only one ability, it'll show just that ability and work with it. Including Mold Breaker.

Lance Koijer 2.0 July 11th, 2018 11:40 PM

Quote:

Originally Posted by jirachiwishmaker (Post 9899865)
How Pixilate is broken?

sorry. Wrong choice of word. What I mean is the issue still exists when you add new type-changing ability into the code, nothing happens

jirachiwishmaker July 12th, 2018 7:30 AM

Quote:

Originally Posted by Lance Koijer 2.0 (Post 9899934)
sorry. Wrong choice of word. What I mean is the issue still exists when you add new type-changing ability into the code, nothing happens

Oh, I see. I thought there are some bugs I didn't realized.

Lance Koijer 2.0 July 12th, 2018 12:05 PM

Quote:

Originally Posted by jirachiwishmaker (Post 9900075)
Oh, I see. I thought there are some bugs I didn't realized.

yeah, it was reported months or years ago but no one has successfully modified or shared the asm that works with newly added type-changing abilities.

Super Versekr Dark August 14th, 2018 9:09 AM

Quote:

Originally Posted by Xencleamas (Post 8711466)

Expanding Ability Names Data and Ability Descriptions Pointer Table


I think this should be here so I don't need to make a new thread with a very simple tutorial. Alright! I'm going to tell you how to expand Ability tables (the Names and the Descriptions). I'm using HxD here as a HEX Editor.

Legend:
  • Green bolded text are for Emerald.
  • Red bolded text are for FireRed.

Step 1: Ability Names

  • Go to a new free space names (example: 0x720000). Select 3328 (0xD00 in HEX) bytes. Fill the bytes with AE AE AE AE AE AE AE FF 00 00 00 00 00.
  • Go to 31B6DB or 24FC40. Select and copy 1014 (0x3F6 in HEX) bytes.
  • Go to the offset of your names data (which the example is 0x720000) and paste the data there.
  • Replace all DB B6 31 08 or 40 FC 24 08 with the "reversed hex in little indian of your new names data offset with 08 at the end" (example: 00 00 72 08)

Step 2: Ability Descriptions

  • Go to a new free space descriptions (example: 0x720D00). Select 1024 (0x400 in HEX) bytes. Fill the bytes with 98 AF 31 08 or C4 F3 24 08.
  • Go to 31BAD4 or 24FB08. Select and copy 312 (0x138 in HEX) bytes.
  • Go to the offset of your description table (which the example is 0x720D00) and paste the data there.
  • Replace all D4 BA 31 08 or 08 FB 24 08 with the "reversed hex in little indian of your new description data offset with 08 at the end" (example: 00 0D 72 08)

Then, change your .ini-s. Replace the old offsets in the .ini with your new data (they should be at where the Ability Names and Ability Descriptions are). Luckily, these don't have limiter stuff at all.

With the expanded data, the new data should be working. I have made this tutorial to have maximized the slots to 256 abilities (255 usable abilities plus one for the none "-----" slot). Now you have 178 new slots for Generation IV+ abilities. Noted that the game can only support up to 256 abilities. The rest of the tutorial on how to insert ability routines are on the first post of this thread since inserting ability routines are now complicated. I hope this post is to be linked up in the Extra Information of this thread so everyone can expand stuff too.

Table Ruby in:

Spoiler:
AbilityNames=1FA248
AbilityDescriptionTable=1FA110


Skill Link:

Spoiler:
Search for the pointer ED 72 1D 08 in your rom, and replace it with a pointer to free space XX XX XX 08.

Battle Script at XX XX XX
Code:

1E 01 (Numbre ability) YY YY YY 08
28 ED 72 1D 08


Battle Script at YY YY YY

Code:
00
01
72 6F 1D 08
00 00 02 03
8D 05
8E 2E
2E 8A 44 02 02 00
28
00 73 1D 08

AtecainCorp. August 25th, 2018 9:32 PM

How Later i can set that ability into right place?

AtecainCorp. August 25th, 2018 9:34 PM

I mean how set ability to current spot (Slot in Ability Index)

Umbrelava September 11th, 2018 11:05 AM

Quote:

Originally Posted by PufferJumps (Post 9504037)
False Swipe no longer works after I put Sturdy {D:}

To fix that, just do this:
Emerald: at 0x479E2, replace 65 28 with CE 29
Fire Red: at 0x1F1F2, replace 65 28 with CE 29

Super Versekr Dark November 1st, 2018 3:36 PM

Quote:

Originally Posted by MrDollSteak (Post 8599873)
To start off here are a few damage-calc related abilities as well as an update Sturdy effect!

These abilities require Doesnt's PSS Split, because of a few shifting bytes.

Sniper, Technician, Defeatist and the Slow Start Attack Drop
Spoiler:
Fire Red
Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global snipertechnicianandslowstartattackdrop

Main:
        cmp r4, #0x37
        bne Sniper
HustleBoost:
        lsr r0, r7, #0x1
        add r7, r0, r7
Sniper:
        cmp r4, #0x62
        bne Technician
CheckCrit:
        ldr r0, .CritLoc
        ldrb r0, [r0]
        cmp r0, #0x2
        bne Return
        b Boost
Technician:
        cmp r4, #066
        bne Defeatist
CheckBasePower:
        ldr r0, .BasePower
        ldrb r0, [r0]
        cmp r0, #0x3D
        bge Return
Boost:
        lsr r0, r7, #0x1
        add r7, r0, r7
        mov r2, r8
        lsr r0, r2, #0x1
        add r0, r0, r2
        mov r8, r0
Defeatist:
        cmp r4, #066
        bne SlowStart
CheckHP:
        ldrh r2, [r0, #0xC]
        lsr r2, r2, #0x1
        ldrh r0, [r0, #0x8]
        cmp r0, r2
        bgt Return
        mov r2, r8
        lsr r0, r2, #0x1
        mov r8, r0
        b AttackDrop
SlowStart:
        cmp r4, #0x71
        bne Return
CheckCounter:
        ldr r0, .SlowStartLoc
        ldr r2, [sp, #0xC]
        add r0, r0, r2
        ldrb r0, [r0]
        cmp r0, #0x0
        beq Return
AttackDrop:
        lsr r7, r7, #0x1
Return:
        ldr r0, .Return
        bx r0

.align 2
.CritLoc: .word 0x02023D71
.BasePower: .word 0x02024020
.SlowStartLoc: .word 0x0203C024
.Return: .word 0x0803F065

#Insert 00 48 00 47 xx xx xx 08 at 03F05C


.SlowStartLoc is a free ram location that you can use to have the counter for slow start.

It has come to my attention that Technician can apply some unwanted boosts to Revenge and a few other moves, so the code will be amended in the future.

Emerald
Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global damagecalchalve

Main:
        cmp r4, #0x37
        bne Sniper
HustleBoost:
        lsr r0, r7, #0x1
        add r7, r0, r7
Sniper:
        cmp r4, #0x62
        bne Technician
CheckCrit:
        ldr r0, .CritLoc
        ldrb r0, [r0]
        cmp r0, #0x2
        bne Return
        b Boost
Technician:
        cmp r4, #066
        bne Defeatist
CheckBasePower:
        ldr r0, .BasePower
        ldrb r0, [r0]
        cmp r0, #0x3D
        bge Return
Boost:
        lsr r0, r7, #0x1
        add r7, r0, r7
        mov r2, r8
        lsr r0, r2, #0x1
        add r0, r0, r2
        mov r8, r0
Defeatist:
        cmp r4, #066
        bne SlowStart
CheckHP:
        ldrh r2, [r0, #0xC]
        lsr r2, r2, #0x1
        ldrh r0, [r0, #0x8]
        cmp r0, r2
        bgt Return
        mov r2, r8
        lsr r0, r2, #0x1
        mov r8, r0
        b AttackDrop
SlowStart:
        cmp r4, #0x71
        bne Return
CheckCounter:
        ldr r0, .SlowStartLoc
        ldr r2, [sp, #0x10]
        add r0, r0, r2
        ldrb r0, [r0]
        cmp r0, #0x0
        beq Return
AttackDrop:
        lsr r7, r7, #0x1
Return:
        ldr r0, .Return
        bx r0

.align 2
.CritLoc: .word 0x02024211
.BasePower: .word 0x020244E0
.SlowStartLoc: .word 0x0203E324
.Return: .word 0x0806989B

#Insert 00 48 00 47 xx xx xx 08 at 069888


.SlowStartLoc is a free ram location that you can use to have the counter for slow start.

It has come to my attention that Technician can apply some unwanted boosts to Revenge and a few other moves, so the code will be amended in the future.

Toxic Boost and Flare Boost
Spoiler:
Fire Red
Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global statusboostabilities

Main:
          ldr r1, [sp, #0x24]
        ldrb r0, [r1]
        cmp r0, #0x8A
        beq ToxicBoost
        cmp r0, #0x8B
        beq FlareBoost
        cmp r0, #0x3E
        bne MarvelScaleCheck
GutsReturn:
        ldr r0, .Return
        bx r0
ToxicBoost:
        ldr r0, [r6, #0x4C]
CheckPoison:
        cmp r0, #0x8
        beq AttackBoost
        cmp r0, #0x80
        bne MarvelScaleCheck
AttackBoost:
        lsr r0, r7, #0x1
        add r7, r0, r7
        b MarvelScaleCheck
FlareBoost:
        ldr r0, [r6, #0x4C]
CheckBurn:
        cmp r0, #0x10
        bne MarvelScaleCheck
SpAtkBoost:
        mov r2, r8
        lsr r0, r2, #0x1
        add r2, r0, r2
        mov r8, r2
MarvelScaleCheck:
        ldr r0, .Return2
        bx r0

.align 2
.Return: .word 0x0803F0CD
.Return2: .word 0x0803F0E1

#insert 00 48 00 47 xx xx xx 08 at 03F0C4



Emerald
Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global statusboostabilities

Main:
        ldrb r0, [r1]
        cmp r0, #0x8A
        beq ToxicBoost
        cmp r0, #0x8B
        beq FlareBoost
        cmp r0, #0x3E
        bne MarvelScaleCheck
Guts:
CheckStatus:
        ldr r0, [r6, #0x4C]
        cmp r0, #0x0
        beq MarvelScaleCheck
GutsReturn:
        ldr r0, .Return
        bx r0
ToxicBoost:
        ldr r0, [r6, #0x4C]
CheckPoison:
        cmp r0, #0x8
        beq AttackBoost
        cmp r0, #0x80
        bne MarvelScaleCheck
AttackBoost:
        lsr r0, r7, #0x1
        add r7, r0, r7
        b MarvelScaleCheck
FlareBoost:
        ldr r0, [r6, #0x4C]
CheckBurn:
        cmp r0, #0x10
        bne MarvelScaleCheck
SpAtkBoost:
        mov r2, r8
        lsr r0, r2, #0x1
        add r2, r0, r2
        mov r8, r2
MarvelScaleCheck:
        ldr r0, .Return2
        bx r0

.align 2
.Return: .word 0x08069909
.Return2: .word 0x08069917

#insert 00 48 00 47 xx xx xx 08 at 0698FC



Multiscale and Fur Coat
Spoiler:
Fire Red
Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global multiscaleandfurcoat

Main:
        ldr r2, [sp, #0x28]
        ldrb r0, [r2]
        cmp r0, #0x3F
        bne Multiscale
        ldr r0, .Return
        bx r0
Multiscale:
        cmp r0, #0x89
        bne FurCoat
CheckHP:
        ldr r1, [sp, #0x4]
        ldrh r0, [r1, #0x28]
        ldrh r1, [r1, #0x2C]
        cmp r1, r0
        bne Return
HalveDamage:
        lsr r7, r7, #0x1
        mov r0, r8
        lsr r0, r0, #0x1
        mov r8, r0
FurCoat:
        ldrb r0, [r2]
        cmp r0, #0xAA
        bne Return
DefenseBoost:
        ldr r1, [sp, #0x14]
        mov r0, r1
        add r1, r0, r0
        str r1, [sp, #0x14]
Return:
        ldr r2, .Return2
        bx r2

.align 2
.Return: .word 0x0803F0E9
.Return2: .word 0x0803F103

#insert 00 48 00 47 xx xx xx 08 at 03F0E0



Emerald
Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global multiscaleandfurcoat

Main:
        ldrb r0, [r2]
        cmp r0, #0x3F
        bne Multiscale
        ldr r3, [sp, #0x4]
        ldr r0, .Return
        bx r0
Multiscale:
        cmp r0, #0x89
        bne FurCoat
CheckHP:
        ldr r1, [sp, #0x4]
        ldrh r0, [r1, #0x28]
        ldrh r1, [r1, #0x2C]
        cmp r1, r0
        bne Return
HalveDamage:
        lsr r7, r7, #0x1
        mov r0, r8
        lsr r0, r0, #0x1
        mov r8, r0
FurCoat:
        ldrb r0, [r2]
        cmp r0, #0xAA
        bne Return
DefenseBoost:
        ldr r1, [sp, #0x18]
        mov r0, r1
        add r1, r0, r0
        str r1, [sp, #0x18]
Return:
        ldr r2, .Return2
        bx r2

.align 2
.Return: .word 0x08069921
.Return2: .word 0x08069939

#insert 00 48 00 47 xx xx xx 08 at 069918



Sturdy
Spoiler:
Fire Red
Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global sturdyupdate

Sturdy:
        ldrb r0, [r3]
        mov r1, #0x58
        mul r0, r1
        add r0, r0, r2
        add r0, #0x20
        ldrb r1, [r0]
        cmp r1, #0x5
        bne FalseSwipeCheck
CheckHP:
        ldrh r1, [r0, #0xC]
        ldrh r0, [r0, #0x8]
        cmp r0, r1
        beq SturdySuccess
FalseSwipeCheck:
        ldr r0, .MoveLoc
        ldrh r1, [r0]
        lsl r0, r1, #0x1
        add r0, r0, r1
        ldr r2, .Return
        bx r2
SturdySuccess:
DisplayEndureMessage:
        mov r0, #0x56
        ldr r1, .Index
        ldrb r2, [r3]
        lsl r0, r2, #0x4
        add r0, r0, r1
        mov r1, #0x2
        strb r1, [r0]
Return:
        ldr r0, .Return2
        bx r0

.align 2

.MoveLoc: .word 0x02023D4A
.Return: .word 0x0801F1ED
.Index: .word 0x02023E8C
.Return2: .word 0x0801F217

#insert 01 48 00 47 00 00 xx xx xx 08 1A 4A at 01F1E2


It should be noted that this doesn't work fully with Multi-hit moves, in that they do not break Sturdy. I am planning on rewriting the entire Multi-hit system to make Parental Bond.

Emerald
Spoiler:
Code:

.text
.align 2
.thumb
.thumb_func
.global sturdyupdate

Sturdy:
        ldrb r0, [r3]
        mov r1, #0x58
        mul r0, r1
        add r0, r0, r2
        add r0, #0x20
        ldrb r1, [r0]
        cmp r1, #0x5
        bne FalseSwipeCheck
CheckHP:
        ldrh r1, [r0, #0xC]
        ldrh r0, [r0, #0x8]
        cmp r0, r1
        beq SturdySuccess
FalseSwipeCheck:
        ldr r0, .MoveLoc
        ldrh r1, [r0]
        lsl r0, r1, #0x1
        add r0, r0, r1
        ldr r2, .Return
        bx r2
SturdySuccess:
DisplayEndureMessage:
        mov r0, #0x56
        ldr r1, .Index
        ldrb r2, [r3]
        lsl r0, r2, #0x4
        add r0, r0, r1
        mov r1, #0x2
        strb r1, [r0]
Return:
        ldr r0, .Return2
        bx r0

.align 2

.MoveLoc: .word 0x020241EA
.Return: .word 0x080479DD
.Index: .word 0x0202433C
.Return2: .word 0x08047A07

#insert 01 48 00 47 00 00 xx xx xx 08 1A 4A at 0479D2


It should be noted that this doesn't work fully with Multi-hit moves, in that they do not break Sturdy. I am planning on rewriting the entire Multi-hit system to make Parental Bond.

Pokémon Ruby:

Sturdy:

Spoiler:
.text
.align 2
.thumb
.thumb_func
.global sturdyupdate

Sturdy:
ldrb r0, [r3]
mov r1, #0x58
mul r0, r1
add r0, r0, r2
add r0, #0x20
ldrb r1, [r0]
cmp r1, #0x5
bne FalseSwipeCheck
CheckHP:
ldrh r1, [r0, #0xC]
ldrh r0, [r0, #0x8]
cmp r0, r1
beq SturdySuccess
FalseSwipeCheck:
ldr r0, .MoveLoc
ldrh r1, [r0]
lsl r0, r1, #0x1
add r0, r0, r1
ldr r2, .Return
bx r2
SturdySuccess:
DisplayEndureMessage:
mov r0, #0x56
ldr r1, .Index
ldrb r2, [r3]
lsl r0, r2, #0x4
add r0, r0, r1
mov r1, #0x2
strb r1, [r0]
Return:
ldr r0, .Return2
bx r0

.align 2

.MoveLoc: .word 0x020223EE
.Return: .word 0x0802478D
.Index: .word 0x02022530
.Return2: .word 0x080247B7

#insert 01 48 00 47 00 00 xx xx xx 08 1A 4A at 024782 - 1D68E

https://i.imgur.com/7ycLi74.gif


Ruby: at 0x1D69E - replace 65 28 with CE 29

Super Versekr Dark November 1st, 2018 3:45 PM

Quote:

Originally Posted by Umbrelava (Post 9924686)
To fix that, just do this:
Emerald: at 0x479E2, replace 65 28 with CE 29
Fire Red: at 0x1F1F2, replace 65 28 with CE 29

Ruby: at 0x1D69E - replace 65 28 with CE 29

JonesTheTrainer November 1st, 2018 4:46 PM

Would anyone mind teach me how to use Pokemon Essentials

Delta231 November 5th, 2018 8:02 AM

Quote:

Originally Posted by Petuuuhhh (Post 9945017)
Where are Mega Launcher, Tough Claws, Adaptability, and Parental Bond?

If they are not in the OP then it means that no one has down it or the OP is outdated.


All times are GMT -8. The time now is 8:52 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.