The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > Fan Games > Binary ROM Hacking > Binary Hack Research & Development
Reload this Page Code Ability Resource Thread

Notices
For all updates, view the main page.

Binary Hack Research & Development Got a well-founded knack with your binary Pokémon hacks? Love reverse-engineering them? For the traditional Pokémon ROM hacker, this is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

Ad Content
Reply
 
Thread Tools
  #351   Link to this post, but load the entire thread.  
Old September 29th, 2017 (7:09 AM).
pikachux2's Avatar
pikachux2 pikachux2 is offline
Never Evolve
 
Join Date: Mar 2010
Location: USA
Gender: Male
Nature: Jolly
Posts: 115
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?
Reply With Quote
  #352   Link to this post, but load the entire thread.  
Old September 29th, 2017 (8:24 AM).
Skeli's Avatar
Skeli Skeli is offline
Lord of the Rings
 
Join Date: Apr 2014
Location: Canada
Age: 24
Gender: Male
Nature: Adamant
Posts: 300
Quote:
Originally Posted by pikachux2 View Post
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.
__________________
Pokemon Unbound

Reply With Quote
  #353   Link to this post, but load the entire thread.  
Old September 30th, 2017 (3:07 AM).
pikachux2's Avatar
pikachux2 pikachux2 is offline
Never Evolve
 
Join Date: Mar 2010
Location: USA
Gender: Male
Nature: Jolly
Posts: 115
Quote:
Originally Posted by Skeli Unbound View Post
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?
Reply With Quote
  #354   Link to this post, but load the entire thread.  
Old September 30th, 2017 (8:41 AM).
BluRose BluRose is offline
blu rass
 
Join Date: Apr 2014
Location: michigan tech
Age: 22
Gender: Male
Nature: Timid
Posts: 812
Quote:
Originally Posted by pikachux2 View Post
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
__________________
heyo check out my github:

BluRosie
highlights:
battle engine for heartgold
various feature branches in heart gold (fairy type, odd egg, mud slopes)

i'm a big part of the development team of pokemon firegold! all the code that i develop for that hack is also on my github

also on discord: BluRose#0412
Reply With Quote
  #355   Link to this post, but load the entire thread.  
Old October 1st, 2017 (12:05 AM).
pikachux2's Avatar
pikachux2 pikachux2 is offline
Never Evolve
 
Join Date: Mar 2010
Location: USA
Gender: Male
Nature: Jolly
Posts: 115
Quote:
Originally Posted by BluRose View Post
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
Reply With Quote
  #356   Link to this post, but load the entire thread.  
Old October 1st, 2017 (5:29 PM).
pikachux2's Avatar
pikachux2 pikachux2 is offline
Never Evolve
 
Join Date: Mar 2010
Location: USA
Gender: Male
Nature: Jolly
Posts: 115
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?
Reply With Quote
  #357   Link to this post, but load the entire thread.  
Old October 1st, 2017 (7:13 PM). Edited October 1st, 2017 by Skeli.
Skeli's Avatar
Skeli Skeli is offline
Lord of the Rings
 
Join Date: Apr 2014
Location: Canada
Age: 24
Gender: Male
Nature: Adamant
Posts: 300
Quote:
Originally Posted by pikachux2 View Post
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.
__________________
Pokemon Unbound

Reply With Quote
  #358   Link to this post, but load the entire thread.  
Old October 2nd, 2017 (11:47 AM).
pikachux2's Avatar
pikachux2 pikachux2 is offline
Never Evolve
 
Join Date: Mar 2010
Location: USA
Gender: Male
Nature: Jolly
Posts: 115
Quote:
Originally Posted by Skeli Unbound View Post
Pointer to your asm routine +1.
Thanks again :)
Reply With Quote
  #359   Link to this post, but load the entire thread.  
Old April 7th, 2018 (9:48 AM).
YourFavoriteEgyptian YourFavoriteEgyptian is offline
 
Join Date: May 2013
Gender: Male
Posts: 16
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!
Reply With Quote
  #360   Link to this post, but load the entire thread.  
Old May 13th, 2018 (9:15 AM). Edited May 16th, 2018 by Lance Koijer 2.0.
Lance Koijer 2.0 Lance Koijer 2.0 is offline
Lance Koijer
 
Join Date: Apr 2018
Location: Criscanto Town
Gender: Male
Nature: Adamant
Posts: 104
Hello guys the code of normalize and pixilate is still broken.

Quote:
Originally Posted by Petuuuhhh View Post
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.
Reply With Quote
  #361   Link to this post, but load the entire thread.  
Old July 7th, 2018 (5:21 PM). Edited July 7th, 2018 by Le pug.
Le pug's Avatar
Le pug Le pug is offline
Creator of Pokémon: Discovery / Fat Kid
 
Join Date: Aug 2013
Location: Le bed
Age: 30
Gender: Male
Nature: Bold
Posts: 870
Quote:
Originally Posted by MrDollSteak View Post
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)
__________________
Retired. Thank you guys for a wonderful five years.
Reply With Quote
  #362   Link to this post, but load the entire thread.  
Old July 11th, 2018 (2:21 AM).
Xencleamas's Avatar
Xencleamas Xencleamas is offline
Suddenly lurking in the shadows...
 
Join Date: Feb 2014
Gender: Male
Nature: Adamant
Posts: 456
Quote:
Originally Posted by Le pug View Post
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).
__________________
Reply With Quote
  #363   Link to this post, but load the entire thread.  
Old July 11th, 2018 (7:20 PM).
jirachiwishmaker's Avatar
jirachiwishmaker jirachiwishmaker is offline
 
Join Date: Jul 2007
Location: Forina
Gender: Male
Nature: Lonely
Posts: 116
Quote:
Originally Posted by Lance Koijer 2.0 View Post
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?
Reply With Quote
  #364   Link to this post, but load the entire thread.  
Old July 11th, 2018 (7:28 PM).
Le pug's Avatar
Le pug Le pug is offline
Creator of Pokémon: Discovery / Fat Kid
 
Join Date: Aug 2013
Location: Le bed
Age: 30
Gender: Male
Nature: Bold
Posts: 870
Quote:
Originally Posted by Xencleamas View Post
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.
__________________
Retired. Thank you guys for a wonderful five years.
Reply With Quote
  #365   Link to this post, but load the entire thread.  
Old July 11th, 2018 (11:40 PM).
Lance Koijer 2.0 Lance Koijer 2.0 is offline
Lance Koijer
 
Join Date: Apr 2018
Location: Criscanto Town
Gender: Male
Nature: Adamant
Posts: 104
Quote:
Originally Posted by jirachiwishmaker View Post
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
Reply With Quote
  #366   Link to this post, but load the entire thread.  
Old July 12th, 2018 (7:30 AM). Edited July 12th, 2018 by jirachiwishmaker.
jirachiwishmaker's Avatar
jirachiwishmaker jirachiwishmaker is offline
 
Join Date: Jul 2007
Location: Forina
Gender: Male
Nature: Lonely
Posts: 116
Quote:
Originally Posted by Lance Koijer 2.0 View Post
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.
Reply With Quote
  #367   Link to this post, but load the entire thread.  
Old July 12th, 2018 (12:05 PM).
Lance Koijer 2.0 Lance Koijer 2.0 is offline
Lance Koijer
 
Join Date: Apr 2018
Location: Criscanto Town
Gender: Male
Nature: Adamant
Posts: 104
Quote:
Originally Posted by jirachiwishmaker View Post
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.
Reply With Quote
  #368   Link to this post, but load the entire thread.  
Old August 14th, 2018 (9:09 AM). Edited June 19th, 2020 by Super Versekr Dark.
Super Versekr Dark Super Versekr Dark is offline
 
Join Date: Jan 2017
Gender: Male
Posts: 79
Quote:
Originally Posted by Xencleamas View Post

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
Reply With Quote
  #369   Link to this post, but load the entire thread.  
Old August 25th, 2018 (9:32 PM).
AtecainCorp.'s Avatar
AtecainCorp. AtecainCorp. is offline
Rejishan awake...
 
Join Date: Jun 2008
Location: Takoabe Town (Region Thonsu)
Age: 30
Gender: Male
Nature: Hardy
Posts: 1,354
How Later i can set that ability into right place?
__________________
- My new Project comming Soon
Reply With Quote
  #370   Link to this post, but load the entire thread.  
Old August 25th, 2018 (9:34 PM).
AtecainCorp.'s Avatar
AtecainCorp. AtecainCorp. is offline
Rejishan awake...
 
Join Date: Jun 2008
Location: Takoabe Town (Region Thonsu)
Age: 30
Gender: Male
Nature: Hardy
Posts: 1,354
I mean how set ability to current spot (Slot in Ability Index)
__________________
- My new Project comming Soon
Reply With Quote
  #371   Link to this post, but load the entire thread.  
Old September 11th, 2018 (11:05 AM).
Umbrelava's Avatar
Umbrelava Umbrelava is offline
 
Join Date: Dec 2007
Posts: 1
Quote:
Originally Posted by PufferJumps View Post
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
Reply With Quote
  #372   Link to this post, but load the entire thread.  
Old November 1st, 2018 (3:36 PM). Edited November 1st, 2018 by Super Versekr Dark.
Super Versekr Dark Super Versekr Dark is offline
 
Join Date: Jan 2017
Gender: Male
Posts: 79
Quote:
Originally Posted by MrDollSteak View Post
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



Ruby: at 0x1D69E - replace 65 28 with CE 29
Reply With Quote
  #373   Link to this post, but load the entire thread.  
Old November 1st, 2018 (3:45 PM).
Super Versekr Dark Super Versekr Dark is offline
 
Join Date: Jan 2017
Gender: Male
Posts: 79
Quote:
Originally Posted by Umbrelava View Post
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
Reply With Quote
  #374   Link to this post, but load the entire thread.  
Old November 1st, 2018 (4:46 PM). Edited November 1st, 2018 by JonesTheTrainer.
JonesTheTrainer's Avatar
JonesTheTrainer JonesTheTrainer is offline
 
Join Date: Jun 2018
Gender: Male
Nature: Lonely
Posts: 23
Would anyone mind teach me how to use Pokemon Essentials
Reply With Quote
  #375   Link to this post, but load the entire thread.  
Old November 5th, 2018 (8:02 AM).
Delta231's Avatar
Delta231 Delta231 is offline
A noob
 
Join Date: May 2016
Location: India
Gender: Male
Nature: Bold
Posts: 682
Quote:
Originally Posted by Petuuuhhh View Post
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.
__________________
HGSS OWs in FR Style
Fire Red NSE Bookmarks


A supporter of


Reply With Quote
Reply

Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account
Ad Content
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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