Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development

Notices
For all updates, view the main page.

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. 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!
Research & Development programs in this forum are subject to moderator approval before they are displayed.



Reply
 
Thread Tools
  #1    
Old 17 Hours Ago (08:09 PM). Edited 11 Hours Ago by MrDollSteak.
MrDollSteak's Avatar
MrDollSteak
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 19
Gender: Male

Ability Resource Thread



This thread is for the development and sharing of new ability routines and battle scripts for Fire Red and Emerald. Requests made by users can definitely be considered just make sure you follow the posting guidelines. Abilities are one of the things that I and other hackers are often asked to share, and make tutorials for, sadly the way in which abilities work, there is no real tutorial that can assist in making an ability outside of general ASM and battle scripting knowledge. For this reason I have decided to create this thread. It also makes it far easier for people to discover bugs or errors in routines, allowing for them to be fixed far more easily.

Extra Information


Before you get started, refer to the following threads for information about the procedure of inserting ASM and of how battle scripts work:

Inserting ASM Routines by FBI Agent
HackMew's Knowledge by HackMew
GBA ASM Programming by Shiny Quagsire
Yet another ASM tutorial by knizz
BSP Scripting Tutorial by Jambo51

Thread rules


Do not demand for your requests to be fulfilled!
People do not have to fulfil your requests, they do it because they want to! Not only are those posts annoying, they also are completely pointless! If such a post is found, it will probably be deleted.

Wrap your abilities and routines in [SPOILER]spoiler tags[/SPOILER].
This is here to keep the thread as easy to browse as possible, as most routines and whatnot tend to take up multiple lines and this can make scrolling through the thread a chore.

Be reasonable with your requests!
This thread is for mostly small ability routines or battle scripts: don't be greedy! No-one is going to make an entire hack for you.

Give credit when requested!
If and when you use any of the routines posted here, give credit to the original creator if they ask for it. If they don't explicitly ask for credit, assume they do. Theft won't be tolerated and if you're caught the moderators will request you add credits to your hack threads, and if not your thread may be deleted.

State the base game for which your requests / abilities are for.
This is mostly to avoid confusion, and to allow for easier organisation of the thread. Please try not to request abilities for Ruby or Sapphire: these games are very difficult to code for and Emerald tends to be far better in nearly every way.

Read the thread before making a request!
Again for organisational reasons, it is a waste of space and time to request abilities which have already been created.

New Abilities


All the routines here are for abilities from Gen 4 and above. They are treated in the index order of the most recent games ORAS +1. This is because Cacophony no longer exists in those games, and therefore does not take an index slot. For this reason while Tangled Feet is listed as ability number 77 on Bulbapedia, if you have expanded your ability table, it will in fact be ability number 78. Remember also that this is the decimal index number, so the routines themselves will be listed with their indexes in hex.

Additionally because some abilities are tied to the same routine, or have prerequisites please look at the ability routines themselves, because you may not need to insert it multiple times, or will need to have inserted other routines to get them to work.

Spoiler:
4E - Tangled Feet
4F - Motor Drive
50 - Rivalry
51 - Steadfast
52 - Snow Cloak
53 - Gluttony
54 - Anger Point
55 - Unburden
56 - Heatproof
57 - Simple
58 - Dry Skin
59 - Download
5A - Iron Fist
5B - Poison Heal
5C - Adaptability
5D - Skill Link
5E - Hydration
5F - Solar Power
60 - Quick Feet
61 - Normalize
62 - Sniper [FR] [EM]
63 - Magic Guard
64 - No Guard
65 - Stall
66 - Technician [FR] [EM]
67 - Leaf Guard
68 - Klutz
69 - Mold Breaker
6A - Super Luck
6B - Aftermath
6C - Anticipation
6D - Forewarn
6E - Unaware
6F - Tinted Lens
70 - Filter
71 - Slow Start
72 - Scrappy
73 - Storm Drain
74 - Ice Body
75 - Solid Rock
76 - Snow Warning
77 - Honey Gather
78 - Frisk
79 - Reckless
7A - Multitype
7B - Flower Gift
7C - Bad Dreams
7D - Pickpocket
7E - Sheer Force
7F - Contrary
80 - Unnerve
81 - Defiant
82 - Defeatist
83 - Cursed Body
84 - Healer
85 - Friend Guard
86 - Weak Armor
87 - Heavy Metal
88 - Light Metal
89 - Multiscale [FR] [EM]
8A - Toxic Boost [FR] [EM]
8B - Flare Boost [FR] [EM]
8C - Harvest
8D - Telepathy
8E - Moody
8F - Overcoat
90 - Poison Touch
91 - Regenerator
92 - Big Pecks
93 - Sand Rush
94 - Wonder Skin
95 - Analytic
96 - Illusion
97 - Imposter
98 - Infiltrator
99 - Mummy
9A - Moxie
9B - Justified
9C - Rattled
9D - Magic Bounce
9E - Sap Sipper
9F - Prankster
A0 - Sand Force
A1 - Iron Barbs
A2 - Zen Mode
A3 - Victory Star
A4 - Turboblaze
A5 - Teravolt
A6 - Aroma Veil
A7 - Flower Veil
A8 - Cheek Pouch
A9 - Protean
AA - Fur Coat [FR] [EM]
AB - Magician
AC - Bulletproof
AD - Competitive
AE - Strong Jaw
AF - Refrigerate
B0 - Sweet Veil
B1 - Stance Change
B2 - Gale Wings
B3 - Mega Launcher
B4 - Grass Pelt
B5 - Symbiosis
B6 - Tough Claws
B7 - Pixilate
B8 - Gooey
B9 - Aerilate
BA - Parental Bond
BB - Dark Aura
BC - Fairy Aura
BD - Aura Break
BE - Primordial Sea
BF - Desolate Land
C0 - Delta Stream


Updated Effects



All the routines here are to add effects that did not exist in Gen 3 to abilities that did. They use the same index numbers as the existing abilities.

Spoiler:
01 - Stench
05 - Sturdy [FR] [EM]
0C - Oblivious
17 - Shadow Tag
18 - Rough Skin
1F - Lightning Rod
28 - Magma Armor
2E - Pressure
31 - Flame Body
__________________
Reply With Quote
  #2    
Old 12 Hours Ago (01:21 AM). Edited 11 Hours Ago by MrDollSteak.
MrDollSteak's Avatar
MrDollSteak
Formerly known as 11bayerf1
 
Join Date: Dec 2008
Location: Hong Kong
Age: 19
Gender: Male
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 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 SlowStart
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
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 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 SlowStart
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
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 Furcoat
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:
	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:
	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, #0x32
	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.
__________________
Reply With Quote
  #3    
Old 11 Hours Ago (02:52 AM). Edited 10 Hours Ago by RaileysXerilyasRX.
RaileysXerilyasRX's Avatar
RaileysXerilyasRX
Impressive. Most impressive.
 
Join Date: Feb 2014
Location: Philippines
Gender: Male
Nature: Adamant
Send a message via Skype™ to RaileysXerilyasRX
It is an excellent thing that someone finally made this kind of thread. Keep it up dude!
It is kinda bit complicated for me about how abilities are triggered when in need. Well, I'm off to study them.

EDIT: One good question: if two routines (one is old and one is latest but different abilities) collides when "insert this at whatever offset", will you rewrite the asm? I don't know if you understand this question and I don't also know if this will possible in progress.
__________________











RaileysXerilyasRX

Reply With Quote
Reply
Quick Reply

Sponsored Links
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
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 02:01 PM.