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?
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
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
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!
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)
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)
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.
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).
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.
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.
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.
.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.
.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.
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.
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.