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
  #326   Link to this post, but load the entire thread.  
Old January 7th, 2017 (8:15 AM).
Trainer 781
Guest
 
Posts: n/a
Quote:
Originally Posted by Chaotix View Post
All 0s anywhere near it. That section isn't having anything stored there at all while doing anything in the game.

Instead it seems to be loading from 0x202298C. Can advance frame by frame until it loads the Rival message then manually replace the contents with the bytes for the string and it prints "WO's Moxie Raised its attack!"

I have no idea why it isn't using 0x203C020..

Edit: while viewing the memory in VBA at 0x2023D74 it seems to have a pointer to what is currently happening in battle, when it lands on the FA in the Moxie script it jumps to the next byte after SS SS SS 08. Is it skipping the 20 C0 03 02 then?
If set word is not working then you can try:
2E 20 C0 03 02 SS
2E 21 C0 03 02 SS
2E 22 C0 03 02 SS
2E 23 C0 03 02 08

instead of
FA 20 C0 03 02 SS SS 08
Reply With Quote
  #327   Link to this post, but load the entire thread.  
Old January 7th, 2017 (8:43 AM).
Chaotix Chaotix is offline
Love to test
 
Join Date: Feb 2007
Nature: Adamant
Posts: 59
Quote:
Originally Posted by KDS View Post
If set word is not working then you can try:
2E 20 C0 03 02 SS
2E 21 C0 03 02 SS
2E 22 C0 03 02 SS
2E 23 C0 03 02 08

instead of
FA 20 C0 03 02 SS SS 08
Yup, that worked just fine. Still, I wish it would work the way it's supposed to but I can't figure out what could have gone wrong with the Setword command.
I used the compiled asm you posted on page 3 when someone else was having trouble with it; couldn't find it posted anywhere else other than there.

Was there anything else that needed to be changed other than inserting the compiled asm in free space and adding a pointer to it in the battle script commands table?
Reply With Quote
  #328   Link to this post, but load the entire thread.  
Old January 7th, 2017 (8:53 AM).
Trainer 781
Guest
 
Posts: n/a
Quote:
Originally Posted by Chaotix View Post
Yup, that worked just fine. Still, I wish it would work the way it's supposed to but I can't figure out what could have gone wrong with the Setword command.
I used the compiled asm you posted on page 3 when someone else was having trouble with it; couldn't find it posted anywhere else other than there.

Was there anything else that needed to be changed other than inserting the compiled asm in free space and adding a pointer to it in the battle script commands table?
I don't think so. I think the hex dump I uploaded might not be correct. You can try ripping setword from MrDS' rombase.
Reply With Quote
  #329   Link to this post, but load the entire thread.  
Old January 7th, 2017 (9:06 AM).
Chaotix Chaotix is offline
Love to test
 
Join Date: Feb 2007
Nature: Adamant
Posts: 59
Quote:
Originally Posted by KDS View Post
I don't think so. I think the hex dump I uploaded might not be correct. You can try ripping setword from MrDS' rombase.
The one in MrDS is literally the exact same as what you posted, but I tried it anyway and it worked... I don't even... Thanks for all the help KDS, hope it wasn't too much of a bother. Gonna do it from scratch one more time to be sure but it will probably work.
Reply With Quote
  #330   Link to this post, but load the entire thread.  
Old January 18th, 2017 (11:19 PM).
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
I rewrote Mr. DS's Multiscale and Fur Coat code, to incorporate Shadow Shield and Fluffy as well. Thanks to KDS for helping me out with this. Replace the bolded code with the proper ability IDs.
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, #0xMULTISCALE
	beq CheckHP
ShadowShield:
	cmp r0, #0xSHADOWSHIELD
	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, #0xFURCOAT
	bne Fluffy
DefenseBoost:
	ldr r1, [sp, #0x14]
	mov r0, r1
	add r1, r0, r0
	str r1, [sp, #0x14]
	b Return
Fluffy:
	ldrb r0, [r2]
	cmp r0, #0xFLUFFY
	bne Return
CheckFireType:
	mov r2, r9
	cmp r2, #0xA
	bne DefenseBoost
DoubleDamage:
	lsl r7, r7, #0x1
	mov r0, r8
	lsl r0, r0, #0x1
	mov r8, r0
	b DefenseBoost
Return:
	ldr r2, .Return2
	bx r2

.align 2
.Return: .word 0x0803F0E9
.Return2: .word 0x0803F103
insert 00 48 00 47 xx+1 xx xx 08 at 03F0E0
__________________
Pokemon Unbound

Reply With Quote
  #331   Link to this post, but load the entire thread.  
Old January 30th, 2017 (8:56 PM).
ThatNihha ThatNihha is offline
Banned
 
Join Date: Jan 2017
Posts: 6
Quote:
Originally Posted by KDS View Post
.
Can you post your routine for Imposter that you have in your Emerald base so it can be ported to Firered? Please?
Reply With Quote
  #332   Link to this post, but load the entire thread.  
Old February 3rd, 2017 (9:59 AM).
Trainer 781
Guest
 
Posts: n/a
Quote:
Originally Posted by ThatNihha View Post
Can you post your routine for Imposter that you have in your Emerald base so it can be ported to Firered? Please?
Well, it isn't in asm. It is in C and cannot be extracted out separately becoz it is linked with other parts of the engine code.
Reply With Quote
  #333   Link to this post, but load the entire thread.  
Old February 4th, 2017 (11:29 AM).
DavyChan DavyChan is offline
 
Join Date: Oct 2016
Gender: Male
Posts: 29
Can someone explain what any of this is... this is why I don't mess with this stuff. I'm not a computer geek, I don't understand what this stuff is :(
Reply With Quote
  #334   Link to this post, but load the entire thread.  
Old February 4th, 2017 (12:17 PM).
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 DavyChan View Post
Can someone explain what any of this is... this is why I don't mess with this stuff. I'm not a computer geek, I don't understand what this stuff is :(
basically the lot of this is assembly, a very basic computer coding language. what is done when adding abilities is editing the battle engine (the code that makes battles what you see on the screen and otherwise) to branch off from the original code so we can insert our code, which has our desired effects covered in it; halving the power will branch off from the damage calulator, halving defense would also do so, an ability to make hail start would branch off at the battle's first steps, etc.
__________________
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
  #335   Link to this post, but load the entire thread.  
Old February 9th, 2017 (12:03 PM).
Aiolia.leo's Avatar
Aiolia.leo Aiolia.leo is offline
 
Join Date: Feb 2013
Location: Ecruteak City
Gender: Other
Nature: Lonely
Posts: 38
So, related to Desolate Land, Deltra Stream and Primordial Sea, I see that Drought, Air Lock and Drizzle makes almost the "same" effect. So is it possible to make it work like those? How do I do that? (I mean like redirect some pointer and make both Desolate Land and Drought works the same way).
Reply With Quote
  #336   Link to this post, but load the entire thread.  
Old February 12th, 2017 (4:55 AM).
Panda Face's Avatar
Panda Face Panda Face is offline
Pokemon Ultra Snowy White
 
Join Date: Jan 2017
Gender: Female
Posts: 127
Quote:
Originally Posted by kleenexfeu View Post
It is easily portable to FR, I'll update soon. It's just I never use FR so every time I do a routine I'm too lazy to seek for FR offset. But if someone ask I guess I can make an effort

I have also the -ate abilities done :
Spoiler:

Emerald :
Spoiler:

Code:
.text
.align 2
.thumb
.thumb_func
.global ateabilities

Start:
push {r0-r4}
mov r0, r10
cmp r0, #0	/*Normal type*/
beq AteCheck

PopAndClassic:
pop {r0-r4}

Classic:
ldrh r0, [r6, #0x2E]
cmp r0, #0xAF
bne Back
ldr r1, SomeLoc
ldr r2, Return
mov pc, r2

Back:
ldr r0, Return1
mov pc, r0

AteCheck:
mov r4, #0x20
ldrb r4, [r6, r4]
cmp r4, #0xB7	/*Index number Pixilate*/
beq Pixi
cmp r4, #0xB9	/*Index number Aerilate*/
beq Aeri
cmp r4, #0xAF	/*Index number Refrigerate*/
beq Refri
b PopAndClassic

Pixi:
mov r0, #0x17	/*Index number of your Fairy type*/
b StoreAndBoost

Aeri:
mov r0, #2	/*Index number of your Flying type*/
b StoreAndBoost

Refri:
mov r0, #0xF	/*Index number of your Ice type*/

StoreAndBoost:
Store:
ldr r1, ChangeTypeLoc
ldr r1, [r1]
add r1, #0x13
ldrb r2, [r1]
cmp r2, #0
bne PopAndClassic
strb r0, [r1]
mov r2, r0
mov r10, r0

Boost:
mov r0, r8
mov r3, #0xA7
mul r0, r3
lsr r0, #7
mov r8, r0
mul r7, r3
lsr r7, #7
b PopAndClassic



.align 2
Return: .word 0x0806961C+1
Return1: .word 0x08069634+1
ChangeTypeLoc: .word 0x0202449C
SomeLoc: .word 0x02024404

/*00 48 00 47 xx+1 xx xx 08 at 08069614*/

What is the hex form of that?
Reply With Quote
  #337   Link to this post, but load the entire thread.  
Old February 24th, 2017 (11:23 AM). Edited February 24th, 2017 by Catman12.
Catman12 Catman12 is offline
 
Join Date: Apr 2015
Posts: 9
Hi ! I have a question about abilities. Let's suppose that i create a new ability(i name it Test for example) thanks to ASM. How can i do to associate with Test its effect ?
(sorry if there are grammar/syntax mistakes, i'm not an english native)
Reply With Quote
  #338   Link to this post, but load the entire thread.  
Old February 24th, 2017 (5:44 PM).
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 Catman12 View Post
Hi ! I have a question about abilities. Let's suppose that i create a new ability(i name it Test for example) thanks to ASM. How can i do to associate with Test its effect ?
(sorry if there are grammar/syntax mistakes, i'm not an english native)
the asm covers everything for you; abilities are actually done by a check for the ability in the battle engine (i.e. the damage calculator) which then modifies the result until that point (to continue with the example, halving the attack or something)
__________________
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
  #339   Link to this post, but load the entire thread.  
Old February 25th, 2017 (12:40 AM).
Catman12 Catman12 is offline
 
Join Date: Apr 2015
Posts: 9
Thank you for your answer. I have another question about battle scripting this time. I saw there is a battle script editor, but it can be only used for a fire red ROM. How can i do to use battle script into emerald if i need it ? Is there an alternative ?
Reply With Quote
  #340   Link to this post, but load the entire thread.  
Old February 25th, 2017 (1:32 AM).
DizzyEgg's Avatar
DizzyEgg DizzyEgg is offline
 
Join Date: Feb 2014
Location: Poland
Age: 25
Gender: Male
Nature: Quiet
Posts: 794
Quote:
Originally Posted by Catman12 View Post
Thank you for your answer. I have another question about battle scripting this time. I saw there is a battle script editor, but it can be only used for a fire red ROM. How can i do to use battle script into emerald if i need it ? Is there an alternative ?
You use ASM macros.
__________________
Support Pokeemerald!

Pokeemerald starter pack:
Emerald Expansion
Reply With Quote
  #341   Link to this post, but load the entire thread.  
Old March 6th, 2017 (3:54 PM).
Jadenator Jadenator is offline
 
Join Date: Mar 2017
Posts: 1
I wish there was an ability editor that made this so much easier.
Reply With Quote
  #342   Link to this post, but load the entire thread.  
Old March 6th, 2017 (5:11 PM).
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 Jadenator View Post
I wish there was an ability editor that made this so much easier.
that would be great--why not make one?

but in all seriousness, all that it would really be able to edit would be the names. like there's not much that is absolutely set in stone about abilities; they are called within the battle code somewhere and aren't anything like moves with their battle scripts and such
__________________
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
  #343   Link to this post, but load the entire thread.  
Old March 11th, 2017 (9:33 PM).
Panda Face's Avatar
Panda Face Panda Face is offline
Pokemon Ultra Snowy White
 
Join Date: Jan 2017
Gender: Female
Posts: 127
What is the complied form of these:

#include abilities.bsh

#org @Main
attackcanceler
attackstring
ppreduce
jumpifabilitypresent ABILITY_CLOUDNINE @LimberCheck
jumpifabilitypresent ABILITY_AIRLOCK @LimberCheck
jumpifhalfword B_& 0x2023F1C 0x60 @LeafGuardCheck
jumpifabilitypresenttargetfield 0xA7 @GrassTypeCheck
goto @LimberCheck

#org @LeafGuardCheck
jumpifability BANK_TARGET 0x67 0x82D9362

#org @GrassTypeCheck
jumpiftype BANK_TARGET TYPE_GRASS 0x82D9F1C

#org @LimberCheck
jumpifability BANK_TARGET ABILITY_LIMBER 0x82D9362
jumpifhalfword 0x0 0x202341A 0x4E @StunSpore
goto @Paralyze

#org @StunSpore
jumpiftype BANK_TARGET TYPE_GRASS 0x82D9F2E

#org @Paralyze
jumpiftype BANK_TARGET TYPE_ELECTRIC 0x82D9F2E
jumpifsecondarystatus BANK_TARGET 0x1000000 0x82D9F1C
cmd6
jumpifbyte B_& 0x202427C 0x29 0x82D9F1C
jumpifstatus BANK_TARGET 0x40 0x82D9351
jumpifstatus BANK_TARGET 0xFF 0x82D9F1C
accuracycheck 0x82D9F1C 0x0
jumpifhalverset BANK_TARGET 0x20 0x82DAD01
attackanimation
waitanimation
setbyte 0x2024335 0x5
seteffecttarget
resultmessage
waitmessage DELAY_1SECOND
goto 0x82D8A4E
__________________

Pokemon Snowy White
Community Link: https://www.pokecommunity.com/showthread.php?p=9569056#post9569056
Download Link: https://pan.baidu.com/s/1eLFJ8KRm0hlB5bHshyin8w
Download Password:27q9
Reply With Quote
  #344   Link to this post, but load the entire thread.  
Old April 22nd, 2017 (11:36 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
Quote:
Originally Posted by MrDollSteak View Post
Here's Snow Warning for Fire Red! I'll update this and port it to Emerald. I'm going to edit it slightly in the future to account for the new weather abilities too that Kleenex has already written routines for.

Snow Warning

Spoiler:
Fire Red
Spoiler:
Code:
.text
.text
.align 2
.thumb
.thumb_func
.global snowwarning

BufferAbility:
	ldrb r0, [r1]
	cmp r0, #0xSnowWarning
	beq SnowWarning
SandStreamCheck:
	cmp r0, #0x2D
	bne ReturnChecks
SandStream:
	ldr r2, .Return
	bx r2
ReturnChecks:
	ldr r4, .Return2
	bx r4
SnowWarning:
CheckWeather:
	ldr r2, .WeatherLoc
	ldrh r1, [r2]
	mov r0, #0x80
	and r0, r1
CheckHail:
	cmp r0, #0x0
	beq Continue
	bl EndScript
SetHail:
	mov r0, #0x80
	strh r0, [r2]
	ldr r2, .Place
	mov r0, #0x0
	strb r0, [r2]
	ldr r0, .SnowWarningBS
	bl PlayScript
	ldr r0, .Place2
	mov r1, r10
	strb r1, [r0, #0x17]
	bl OtherBL
EndScript:
	ldr r4, .EndScriptBL
	bx r4
PlayScript:
	ldr r2, .PlayScriptBL
	bx r2
OtherBL:
	ldr r0, .OtherBL
	bx r0
.align 2

.Return: .word 0x0801A2AD
.Return2: .word 0x0801A149
.WeatherLoc: .word 0x02023F1C
.Place: .word 0x02023F48
.SnowWarningBS: .word 0x08CCCCCC
.Place2: .word 0x02023FC4
.EndScriptBL: .word 0x0801BBAB
.PlayScriptBL: .word 0x0801BC25
.OtherBL: .word 0x0801BB5B

#Insert 00 48 00 47 xx xx xx 08 at 1A140
I try port this to Pokemon Ruby. And I found a lot of pointers. But... What is exacly to do with Battle Script for Snow Warming? I Try put it in place of Cacophony.
__________________
- My new Project comming Soon
Reply With Quote
  #345   Link to this post, but load the entire thread.  
Old April 23rd, 2017 (12:49 AM).
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 have important question. How set Abilities to right pointer in Ability Table? I instered Moxie to Pokemon RUby and IDK where to put it's check as 4E <Which begins my updated table>
__________________
- My new Project comming Soon
Reply With Quote
  #346   Link to this post, but load the entire thread.  
Old May 18th, 2017 (5:46 PM). Edited May 18th, 2017 by LuksDahora.
LuksDahora LuksDahora is offline
 
Join Date: May 2017
Nature: Adamant
Posts: 3
Hi... I'm new in this forum... I would like to have abilities such as..: Customizable -Ate abilities (like Aerilate, Pixilate, Refrigerate, Galvanize, etc)(This Pokemon's Normal-type moves become [insert a type here] type and have 1.2x power.), Customizable "Rush" abilities like: Slush Rush, Chlorophyll, Sand Rush, Swift Swim, Contrary (If this Pokemon has a stat stage raised it is lowered instead, and vice versa.), Customizable "Worker" Abilities like Steelworker (This Pokemon's [insert type here]-type attacks have their power multiplied by 1.5.), Surge abilities from the Tapus (Electric Surge, Psychic Surge, etc) (also, i know that terrains aren't implemented in FR, so Just put like the Pokémon with that ability has his [insert a type here] type moves boosted by 5 turns), Protean: (This Pokemon's type changes to match the type of the move it is about to use.), Sharp Claws (or something like that, I would prefer the name to be customizable) (This Pokemon's physical moves have their power multiplied by 1.3.) also, an ability called "Hyper Lens", wich is the same things as Tinted Lens but instead of Doubled, are Tripled: (This Pokemon's attacks that are not very effective on a target deal triple damage.) That's it for now :), I think this will be useful not just for me... a lot of people will aprecciate that abilites to put on their own hacks. TY!
Reply With Quote
  #347   Link to this post, but load the entire thread.  
Old May 21st, 2017 (8:45 AM).
AceBlake AceBlake is offline
 
Join Date: Apr 2017
Posts: 12
Can someone please teach me, I tried all the abilities here but when I try it out, it just hangs or reset (well except for the Skill Link which is just some simple adding and editing in the hex(?)). I use emerald version but I'm hacking the one that is already PSS split from a video.

Here the step I do from what I understand with an example of "Tangled Feet"
1. Copy the code and paste it to notepad. save it as ASM file.
2. Drag the ASM file to "thumb".
3. Open the resulting file and the rom I'm hacking in the HxD.
4. Copy and paste the bytes(?) of the resulting file on the free space of the rom
5. (in the rom) Goto 468EC
6. starting from that address, typed 00 49 08 47 xx xx xx 08 (xx xx xx with my own address)
7. save it; open PGE and edit the pokemon which should have that ability.
(I already expanded that ability table by the way)
8. Try the pokemon with that ability and do what should be done to trigger the ability...

Then BOOM, it did not work.
Reply With Quote
  #348   Link to this post, but load the entire thread.  
Old May 23rd, 2017 (5:44 AM).
DizzyEgg's Avatar
DizzyEgg DizzyEgg is offline
 
Join Date: Feb 2014
Location: Poland
Age: 25
Gender: Male
Nature: Quiet
Posts: 794
Quote:
Originally Posted by AceBlake View Post
Can someone please teach me, I tried all the abilities here but when I try it out, it just hangs or reset (well except for the Skill Link which is just some simple adding and editing in the hex(?)). I use emerald version but I'm hacking the one that is already PSS split from a video.

Here the step I do from what I understand with an example of "Tangled Feet"
1. Copy the code and paste it to notepad. save it as ASM file.
2. Drag the ASM file to "thumb".
3. Open the resulting file and the rom I'm hacking in the HxD.
4. Copy and paste the bytes(?) of the resulting file on the free space of the rom
5. (in the rom) Goto 468EC
6. starting from that address, typed 00 49 08 47 xx xx xx 08 (xx xx xx with my own address)
7. save it; open PGE and edit the pokemon which should have that ability.
(I already expanded that ability table by the way)
8. Try the pokemon with that ability and do what should be done to trigger the ability...

Then BOOM, it did not work.
Don't bother with that thread, it was good 2 years ago. If you hack Emerald, check out the battle engine in my signature and enjoy a new battle experience.
__________________
Support Pokeemerald!

Pokeemerald starter pack:
Emerald Expansion
Reply With Quote
  #349   Link to this post, but load the entire thread.  
Old May 23rd, 2017 (11:57 PM).
AceBlake AceBlake is offline
 
Join Date: Apr 2017
Posts: 12
Quote:
Originally Posted by DizzyEgg View Post
Don't bother with that thread, it was good 2 years ago. If you hack Emerald, check out the battle engine in my signature and enjoy a new battle experience.
Oh, so that's why there are lesser replies. But the problem is, I'm hacking an already changed emerald rom (if you search pss split emerald, the first video result in google is probably the one I'm changing right now, the one posted by Andrew Inoue in youtube); Will it still function properly?
Reply With Quote
  #350   Link to this post, but load the entire thread.  
Old August 2nd, 2017 (12:48 AM). Edited August 3rd, 2017 by ShyGuy25.
ShyGuy25 ShyGuy25 is offline
 
Join Date: Jun 2012
Gender: Male
Posts: 22
I'm trying to add Galvanize as a branch off of DollSteak's -Ate abilities, I figured I could do it by changing the type from Ice/Fairy/Flying to Electric (0xD).

However it doesn't work, can anyone have a look and see what's wrong?

Fire Red
Spoiler:
[CODE].text
.align 2
.thumb
.thumb_func
.global typechangeabilities

BufferAbility:
mov r0, r6
add r0, #0x20
ldrb r1, [r0]
NormalCheck:
mov r0, r9
cmp r0, #0x0
bne NormalizeCheck
RefrigerateCheck:
cmp r1, #0x87
bne PixilateCheck
Refrigerate:
mov r0, #0xF
b StoreType
PixilateCheck:
cmp r1, #0x88
bne AerilateCheck
Pixilate:
mov r0, #0x17
b StoreType
GalvanizeCheck:
cmp r1, #0x8D
bne PixilateCheck
Galvanize:
mov r0, #0xD
b StoreType
AerilateCheck:
cmp r1, #0x89
bne Return
Aerilate:
mov r0, #0x2

StoreType:
mov r9, r0
ldr r0, .ChangeTypeLoc
ldr r1, [r0]
add r1, #0x13
ldrb r1, [r1]
mov r2, #0x3F
and r2, r1
cmp r2, #0x0
bne Return
mov r2, r9
strb r2, [r1]
Boost:
mov r0, r8
mov r1, #0xA7
mul r0, r1
lsr r0, #0x7
mov r8, r0
mul r7, r1
lsr r7, #0x7
b Return
NormalizeCheck:
cmp r1, #0x8A
bne Return
Normalize:
mov r0, #0x0
mov r9, r0
Return:
ldr r0, [sp, #0x4]
ldrh r0, [r0, #0xA]
str r0, [sp, #0x18]
ldrh r0, [r6, #0x2E]
cmp r0, #0x87
bne NoEnigmaBerry
ldr r1, .Return
bx r1
NoEnigmaBerry:
ldr r0, .Return2
bx r0

.align 2
.ChangeTypeLoc: .word 0x02023FE8
.Return: .word 0x0803ED87
.Return2: .word 0x0803EDA1


edit: if this helps with anything im using the MrDS rombase which might affect things like pointers.
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.