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
  #251   Link to this post, but load the entire thread.  
Old March 30th, 2016 (8:31 PM).
BlackYoshi485's Avatar
BlackYoshi485 BlackYoshi485 is offline
 
Join Date: Nov 2015
Location: Buenos Aires, Argentina
Gender: Male
Nature: Adamant
Posts: 33
Quote:
Originally Posted by Sky High View Post
This isn't Ability-related but I wonder if Safety Goggles can be included there. The item's effect is to immune weather-related damage and powder moves.
Much like a free Overcoat
__________________
Ho oh Ho oh it's Lugia, Unown, you'll never believe it's Zapdos.
Reply With Quote
  #252   Link to this post, but load the entire thread.  
Old April 10th, 2016 (9:06 AM).
Exodrake's Avatar
Exodrake Exodrake is offline
The Manliest Chick that Ever Manlied
 
Join Date: May 2013
Age: 29
Gender: Female
Nature: Quirky
Posts: 163
Quote:
Originally Posted by KDS View Post
Parental Bond:-

Fire Red:-
Spoiler:


Routine I:
Spoiler:

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

ParentalMultiStopper:
      ldr r1, .ParentalByte
      mov r8, r1
      ldrb r0, [r1]
      cmp r0, #0x0
      bne Exit

ParentalAbilityCheck:
      ldr r2, .BattleStruct
      mov r9, r2
      ldr r4, .UserBank
      mov r6, #0x58
      ldrb r1, [r4]
      mul r1, r6
      add r1, r1, r2
      add r1, #0x20
      ldrb r0, [r1]
      cmp r0, #0xBA
      bne Exit

MoveBanListCheck:
      ldr r7, .CurrMove
      ldrh r1, [r7]
      lsl r0, r1, #0x01
      add r1, r1, r0
      lsl r1, r1, #0x02
      ldr r2, .MoveData
      add r2, r2, r1
      mov r10, r2

CheckForStatusMove:
      ldrb r2, [r2, #0xA]
      cmp r2, #0x2
      beq Exit
      ldr r2, .TableLoc
      ldr r3, =0xFEFE

Loop:
      ldrh r5, [r2]
      cmp r5, r3
      beq DoubleBattleCheck
      cmp r5, r7
      beq Exit
      add r2, #0x2
      b Loop

DoubleBattleCheck:
      mov r5, r9
      ldr r0, .BattleTypeFlags
      ldr r0, [r0, #0x0]
      mov r1, #0x1
      and r0, r1
      cmp r0, #0x0
      beq SingleTargetHPCheck
      mov r1, r10
      ldrb r0, [r1, #0x6]
      mov r2, #0x0       
      cmp r0, #0x8
      beq NoOfFoeCheck
      cmp r0, #0x20
      bne SingleTargetHPCheck

UserPartnerHP:
      ldrb r3, [r4]
      mov r1, #0x2
      eor r3, r1 
      mul r3, r6
      add r3, r5
      ldrh r0, [r3, #0x28]
      cmp r0, #0x0
      beq NoOfFoeCheck
      add r2, #0x1

NoOfFoeCheck:
      ldrb r3, [r4]
      mov r1, #0x1
      eor r3, r1
      and r3, r1
      mul r3, r6
      add r3, r5
      ldrh r0, [r3, #0x28]
      cmp r0, #0x0
      beq CheckNextIter
      add r2, #0x1 

CheckNextIter:
      lsl r6, r6, #0x1
      add r3, r6
      ldrh r0, [r3, #0x28]
      cmp r0, #0x0
      beq CheckNoOfAliveTargets
      add r2, #0x1
 
CheckNoOfAliveTargets:
      cmp r2, #0x1
      beq Success
      cmp r2, #0x2
      blt Exit

SetParentalBan:
      mov r1, r8
      mov r0, #0x3
      strb r0, [r1]
      b Exit

SingleTargetHPCheck:
      ldrb r3, [r4, #0x1]
      mul r3, r6
      add r3, r5
      ldrh r0, [r3, #0x28]
      cmp r0, #0x0
      beq Exit

Success:
      mov r1, r8
      mov r0, #0x2
      strb r0, [r1]

Exit:
      mov r0, #0x0
      mov r9, r0
      ldr r1, =0x2023FC8
      ldr r2, =0x2023FE8
      mov r10, r1
      mov r8, r2
      ldr r0, =0x8019302+1
      bx r0

.align 2
.ParentalByte: .word 0x0203C03C
.BattleStruct: .word 0x02023BE4
.UserBank: .word 0x02023D6B
.CurrMove: .word 0x02023D4A
.MoveData: .word 0x08250C04
.TableLoc: .word 0x08DDDDDD
.BattleTypeFlags: .word 0x02022B4C
/*At x192E0: 00 48 00 47 XX+1 XX XX 08*/
Table at DDDDDD
Code:
04 00 0C 00 0D 00 18 00 13 00 1F 00 20 00 29 00 2A 00 4C 00 5A 00 82 00 83 00 8C 00 8F 00 9A 00 9B 00 A7 00 C6 00 03 00 78 00 5E 01 DC 00 FB 00 12 01 23 01 24 01 49 01 4D 01 54 01 61 01 F8 00 5B 00 13 00 8F 00 99 00 1B 01 FE FE
This is a table that contains the indices (Half Words) of damaging moves not supported by Parental Bond like Multi-Hit, Charging Turn Moves etc. Terminated by FEFE. Add indices for new moves like Dual Chop, Double Hit etc.



Routine II:
Spoiler:

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

ParentalChecker:
      ldr r1, .ParentalByte
      mov r8, r1
      ldrb r0, [r1]
      cmp r0, #0x2
      bne Exit

CheckOutcome:
      ldr r1, .Outcome
      ldrb r0, [r1]
      mov r1, #0x29
      and r0, r1
      cmp r0, #0x0
      bne Exit

UserHPCheck:
      ldr r2, .BattleStruct
      ldr r4, .UserBank
      mov r6, #0x58
      ldrb r1, [r4]
      mul r1, r6
      add r1, r1, r2
      ldrh r0, [r1, #0x28]
      cmp r0, #0x0
      beq Exit

TargetHPCheck:
      ldrb r1, [r4, #0x1]
      mul r1, r6
      add r1, r1, r2
      ldrh r0, [r1, #0x28]
      cmp r0, #0x0
      beq Exit 

CheckDamage:
      ldr r2, .DamageStruct
      add r0, r4, #0x1
      ldrb r1, [r0, #0x0]
      lsl r0, r1, #0x2
      add r0, r0, r1
      lsl r1, r0, #0x2
      add r0, r1, #0x4
      add r0, r0, r2
      ldr r1, [r0, #0x0]
      cmp r1, #0x0
      beq Exit

CheckAsleep:
      ldr r5, .HitMarker
      ldr r2, [r5]
      mov r0, #0x80
      lsl r0, r0, #0xC
      and r0, r2
      cmp r0, #0
      bne Exit
      
Success:
      mov r0, #0x80
      lsl r0, r0, #0x4
      orr r2, r0
      str r2, [r5] /*Avoid PP Reduction Next Strike */
      mov r1, r8
      ldr r2, .CurrMove
      mov r8, r2
      mov r0, #0x1
      strb r0, [r1]
      mov r4, #0x0
      ldr r0, =0x80232F8+1
      bx r0 

Exit:
      ldr r0, =0x8023BAC+1
      bx r0

.align 2
.ParentalByte: .word 0x0203C03C
.BattleStruct: .word 0x02023BE4
.DamageStruct: .word 0x02023ECC
.Outcome: .word 0x02023DCC
.UserBank: .word 0x02023D6B
.CurrMove: .word 0x02023D4A
.HitMarker: .word 0x02023DD0
Make the pointer to this routine the 3rd last entry of Jump Table in cmd49 while expanding it as donehere .


Routine III:
Spoiler:

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

CheckChildTurn:
  ldr r4, .ParentalByte
  ldrb r4, [r4]
  ldr r0, .ScriptPointer
  cmp r4, #0x1
  bne Exit

EnsureAccuracy:
   ldr r1, [r0]
   add r1, #0x7
   str r1, [r0]
   ldr r0, =0x0801E1C2+1
   bx r0  

Exit:
   ldr r0, [r0]
   ldrb r6, [r0, #5]
   ldrb r0, [r0, #6]
   lsl r0, r0, #8
   orr r6, r0
   ldr r0, =0x801DDDC+1
   bx r0

.align 2
.ParentalByte: .word 0x0203C03C
.ScriptPointer: .word 0x02023D74


/*At x1ddd0: 00 48 00 47 XX+1 XX XX 08*/


Routine IV:
Spoiler:

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

CheckChildTurn:
  ldr r4, .ParentalByte
  ldrb r4, [r4]
  cmp r4, #0x1
  bne Exit

HalfDamage:
  ldr r4, .Damage
  ldrh r5, [r4]
  lsr r5, r5, #0x1
  cmp r5, #0x0
  bne NotZero
  mov r5, #0x1

NotZero:
  strh r5, [r4]

Exit:
   ldr r0, [r1]
   add r0, #0x1
   str r0, [r1]
   add sp, #0x10
   pop {r4-r7}
   pop {r0}
   bx r0

.align 2
.ParentalByte: .word 0x0203C03C
.Damage: .word 0x02023D50

/*At x1e644: 00 4C 20 47 XX+1 XX XX 08*/


Routine V:
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]
        ldr r0, .ParentalByte
        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]
    bx lr

.align 2

.Outcome: .word 0x02023DCC
.Index: .word 0x02023BC4
.Battlers: .word 0x02023D6C
.DisabledAbilityLoc: .word 0x0203C034
.BattleData: .word 0x02023C04
.EndLoc: .word 0x02023BE3
.ParentalByte: .word 0x203C03C

@ Go to your Battle Script command table, search for CD 2C 02 08 and replace it by XX+1 XX XX 08 (We are replacing the 'End' Battle Script Command. Not the case in Emerald)
Basically the 4th Mold Breaker Routine with added logic to clear the Parental Byte.


Bugs
Spoiler:

Does not handle Knock Off, Smelling Salts and Color Change as done in Gen VI. This due to the differences in order between Gen VI and Gen III handling of events during a Move Execution.


I can't get the 5th routine to compile. The command prompt disappears at light speed but with a fast screenshot, it says the problem is on line 23?
__________________

I'M A WITCH THAT'S HOW
Reply With Quote
  #253   Link to this post, but load the entire thread.  
Old April 11th, 2016 (6:16 AM).
Trainer 781
Guest
 
Posts: n/a
In the first line after the Loop label, a comma is missing between ldrb r2 and [r5]. That is the compilation error. Thanks for notifying.
Reply With Quote
  #254   Link to this post, but load the entire thread.  
Old April 16th, 2016 (9:46 AM).
i0Bjhansen0's Avatar
i0Bjhansen0 i0Bjhansen0 is offline
 
Join Date: Mar 2016
Age: 27
Gender: Male
Posts: 130
What script editor is being used for these routines or can XSE use these when compiling?
I would like to make some new abilities for the new types in my hack. What is the routine (or offset so I can reverse engineer) for Overgrow, Swarm, Blaze, and/or Torrent so I can change the type to be one of the new ones.
And finally, after expanding the ability names and descriptions (PGE comes with a tool to do that), how would I get the game to know to use the routines? What offset would I need to change to make it work?

Thanks in advance.
Reply With Quote
  #255   Link to this post, but load the entire thread.  
Old April 16th, 2016 (11:09 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 i0Bjhansen0 View Post
What script editor is being used for these routines or can XSE use these when compiling?
I would like to make some new abilities for the new types in my hack. What is the routine (or offset so I can reverse engineer) for Overgrow, Swarm, Blaze, and/or Torrent so I can change the type to be one of the new ones.
And finally, after expanding the ability names and descriptions (PGE comes with a tool to do that), how would I get the game to know to use the routines? What offset would I need to change to make it work?

Thanks in advance.
I was confused about this at first too. I'll try to explain how abilities or rather ability's effect work in battle. Pokemon ability is stored in a certain battle struct and is always retrieved from there. Each ability has an ID, a byte in order in the abilities names table. There are no routines for each specific ability. Mostly there are three places where abilities are checked, first being damage calc, second being accuracy checker and most important being giant ability_battle_effects function. So swarm for example works like this:
damage calculator code...
if (attacker_ability == SWARM and move_type == BUG and has less than 31 % of max hp)
{
damage = damage * 1.5;
}
rest of the code...
As you can see, abilities are checked at run time. Now, I suggest you take a copy of FR or EM IDA, look at offset locations in this thread and see how battle functions work.
So to answer, if you expand the ability and want the game to recognize it, you just have to do something like this in your code:
if (pokes_ability == ID_of_new_ability)
do something;
And again, some of the abilities are placed at many places, like there are checks for white smoke and clear smog in stat lowering function or there's a wonder guard check in the type damage calc.

Also, I think this thread becomes more and more unusable. There are about 100 new abilities in gens IV-VI and they all have to be hooked somewhere. I'm not even talking about the time to assemble and insert every routine that's here but also about how the hook locations may contradict each other and how changes to it become more difficult. The solution would be a partial rewrite of the battle engine compiled dynamically(preferably done in C), something that FBI's doing but to a much smaller degree.
Reply With Quote
  #256   Link to this post, but load the entire thread.  
Old April 16th, 2016 (3:05 PM).
i0Bjhansen0's Avatar
i0Bjhansen0 i0Bjhansen0 is offline
 
Join Date: Mar 2016
Age: 27
Gender: Male
Posts: 130
Quote:
Originally Posted by DizzyEgg View Post
I was confused about this at first too. I'll try to explain how abilities or rather ability's effect work in battle. Pokemon ability is stored in a certain battle struct and is always retrieved from there. Each ability has an ID, a byte in order in the abilities names table. There are no routines for each specific ability. Mostly there are three places where abilities are checked, first being damage calc, second being accuracy checker and most important being giant ability_battle_effects function. So swarm for example works like this:
damage calculator code...
if (attacker_ability == SWARM and move_type == BUG and has less than 31 % of max hp)
{
damage = damage * 1.5;
}
rest of the code...
As you can see, abilities are checked at run time. Now, I suggest you take a copy of FR or EM IDA, look at offset locations in this thread and see how battle functions work.
So to answer, if you expand the ability and want the game to recognize it, you just have to do something like this in your code:
if (pokes_ability == ID_of_new_ability)
do something;
And again, some of the abilities are placed at many places, like there are checks for white smoke and clear smog in stat lowering function or there's a wonder guard check in the type damage calc.

Also, I think this thread becomes more and more unusable. There are about 100 new abilities in gens IV-VI and they all have to be hooked somewhere. I'm not even talking about the time to assemble and insert every routine that's here but also about how the hook locations may contradict each other and how changes to it become more difficult. The solution would be a partial rewrite of the battle engine compiled dynamically(preferably done in C), something that FBI's doing but to a much smaller degree.
Ok, so you're saying that in order to have the new Swarm/Torrent/Overgrow/Blaze-like ability work, I need to expand that damage calculator code section to include the newly created ability and the new type? Is the code that you posted, what is actually used in the game/script editor? Or will I need to find what is actually used and copy it from there?

I haven't looked at many of the posts here so I'm not sure where to look. I would just really like having abilities made for the new types. Like I'm planning on using those ?s between Celebi and Treecko for new Pokemon and using 9 of them as starters, so having one of those for the new types would be nice. ASM/Scripting is the hardest for me to do from scratch. If I can reverse engineer, I can make new things.
Reply With Quote
  #257   Link to this post, but load the entire thread.  
Old May 4th, 2016 (3:52 AM).
EdgeZard X's Avatar
EdgeZard X EdgeZard X is offline
 
Join Date: Sep 2015
Nature: Lonely
Posts: 35
So I have Mr DS's ROM base, and know how to insert the ASM for the abilities, but how would I go about adding the names and descriptions?

Also, how would one go about creating Poison Touch for Fire Red?
__________________
CHALA CHALLA KA HAPPY MEAL TIME!
Reply With Quote
  #258   Link to this post, but load the entire thread.  
Old May 4th, 2016 (3:59 AM).
pokefreak890's Avatar
pokefreak890 pokefreak890 is offline
The One that will make everything great
 
Join Date: Nov 2014
Gender: Male
Posts: 853
im on the works to complete my 1460 rombase and i want to add mold breaker,treavolt and turboblaze how would you go about adding them i know how to implement the routine but i dont know how the mold breaker table would look like if anyone already has the mold breaker table inserted for fire red can u show me what it looks like
__________________
3DS FREIND CODE : 2724-3540-0898
Reply With Quote
  #259   Link to this post, but load the entire thread.  
Old May 4th, 2016 (2:32 PM).
DraconianWing's Avatar
DraconianWing DraconianWing is offline
 
Join Date: Aug 2012
Location: Fallarbor Town
Age: 23
Gender: Male
Nature: Mild
Posts: 959
Quote:
Originally Posted by EdgeZard X View Post
So I have Mr DS's ROM base, and know how to insert the ASM for the abilities, but how would I go about adding the names and descriptions?

Also, how would one go about creating Poison Touch for Fire Red?
I believe there is a table for the ability names and another one for descriptions; you have to expand both of them to support the new abilities, then add the new names/descriptions to the index slots that match the ASM (ie. if Protean has index 0x75 in it's ASM check, you'll have to find slot 0x75 on both tables and put the name/description there accordingly)

Apologies if the explanation was a bit vague or even incorrect, it's been a long time since I've worked on expanding stuff for new abilities :P
__________________
"All dreams are but another reality. Never forget..."
Reply With Quote
  #260   Link to this post, but load the entire thread.  
Old May 27th, 2016 (2:52 PM).
DarkPsychic's Avatar
DarkPsychic DarkPsychic is offline
 
Join Date: Jul 2012
Location: CO
Gender: Male
Nature: Timid
Posts: 146
Looked through to see if this was already requested but didn't find anything...

I was wondering if MissingNo's ability which really has no name could be implemented.
It would be interesting as the original from Red/Blue not only adds 128 of an item to your sixth item slot but also the sprite is determined by specific slots in the players name (I think it's the 3rd, 5th, 7th and also 8th-10th but the naming function only uses 7 characters and leaves the last 3 blank).

That's all I have for now though...
Thanks for your time and all the work you all put into this;
I understand if this is not priority or even done as you all have a lot on your plate already.
^_^
Reply With Quote
  #261   Link to this post, but load the entire thread.  
Old May 27th, 2016 (3:13 PM).
azurile13 azurile13 is offline
 
Join Date: Mar 2015
Posts: 417
Quote:
Originally Posted by DarkPsychic View Post
Looked through to see if this was already requested but didn't find anything...

I was wondering if MissingNo's ability which really has no name could be implemented.
It would be interesting as the original from Red/Blue not only adds 128 of an item to your sixth item slot but also the sprite is determined by specific slots in the players name (I think it's the 3rd, 5th, 7th and also 8th-10th but the naming function only uses 7 characters and leaves the last 3 blank).

That's all I have for now though...
Thanks for your time and all the work you all put into this;
I understand if this is not priority or even done as you all have a lot on your plate already.
^_^
Handle it the same way as RBY :D on the set pokedex flag, add a check for the dex number of Missingno then add to item quantity. Idk which rom you're hacking, but you can find the dex flags routine in a pokedex expansion tutorial.
Reply With Quote
  #262   Link to this post, but load the entire thread.  
Old May 27th, 2016 (5:53 PM).
DarkPsychic's Avatar
DarkPsychic DarkPsychic is offline
 
Join Date: Jul 2012
Location: CO
Gender: Male
Nature: Timid
Posts: 146
Quote:
Originally Posted by azurile13 View Post
Handle it the same way as RBY :D on the set pokedex flag, add a check for the dex number of Missingno then add to item quantity. Idk which rom you're hacking, but you can find the dex flags routine in a pokedex expansion tutorial.

Thank you azurile13 ^_^
I shall looking in that direction then when I have some time.
Been so busy haven't had any time to really research and focus on rom hacking...
Honestly I need to start practicing again even if just for a 30min to an hour, I hate coming back and having to relearn what I was learning before I took a break an having to refresh my memory on this I already once learned >_< ehh Life right... ^_^ Gotta love it!!!

Basically for Fire Red but I wouldn't mind one for Emerald as well so they could be trade able (not priority though).

Honestly what would you even call this Ability >_< hahahaha Rift??? hahaha I don't know

Anyway thank you for your time; Much appreciated!
Reply With Quote
  #263   Link to this post, but load the entire thread.  
Old June 3rd, 2016 (3:28 PM).
i0Bjhansen0's Avatar
i0Bjhansen0 i0Bjhansen0 is offline
 
Join Date: Mar 2016
Age: 27
Gender: Male
Posts: 130
I'm not sure if it should be posted here or in the moves section, but I was wondering how the game decides if a move is sound based for Soundproof/Cacophony? If it's the ability, can someone clearly state how it works instead of hinting at it? And if it's for each move, is there an attack editor that changes what needs to be changed?
Reply With Quote
  #264   Link to this post, but load the entire thread.  
Old June 3rd, 2016 (9:15 PM).
leyn09's Avatar
leyn09 leyn09 is offline
Truant Trainer
 
Join Date: May 2011
Location: Philippines
Gender: Male
Nature: Careful
Posts: 84
Quote:
Originally Posted by i0Bjhansen0 View Post
I'm not sure if it should be posted here or in the moves section, but I was wondering how the game decides if a move is sound based for Soundproof/Cacophony? If it's the ability, can someone clearly state how it works instead of hinting at it? And if it's for each move, is there an attack editor that changes what needs to be changed?
There is a table which Soundproof reads if an attack is a sound-based move. You can use 3GT Tool to modify if a move is a sound-based. Be informed that it has only limit and if you wish to expand it, you should look on how to repoint the table. I believe there is a tutorial about that.
Reply With Quote
  #265   Link to this post, but load the entire thread.  
Old June 3rd, 2016 (9:28 PM).
i0Bjhansen0's Avatar
i0Bjhansen0 i0Bjhansen0 is offline
 
Join Date: Mar 2016
Age: 27
Gender: Male
Posts: 130
Quote:
Originally Posted by leyn09 View Post
There is a table which Soundproof reads if an attack is a sound-based move. You can use 3GT Tool to modify if a move is a sound-based. Be informed that it has only limit and if you wish to expand it, you should look on how to repoint the table. I believe there is a tutorial about that.
Thank you so much. G3T actually allows one to repoint the table. A couple new moves I'm going to be adding will be sound based so it would mean a lot that they be treated as such. And now they can be :D
Reply With Quote
  #266   Link to this post, but load the entire thread.  
Old June 22nd, 2016 (5:32 AM).
Reshiram white as snow Reshiram white as snow is offline
 
Join Date: Feb 2016
Location: New York
Gender: Other
Nature: Timid
Posts: 129
Can you transfer it into the hex to tutorial how to disable paralyzed in electric type Pokemon? (Emerald)
__________________

Welcome everybody to play 《Pokemon Eternal Snow》
website:
http://pan.baidu.com/s/1qY7p9bY
password:
4pqq
The website of Pokemon Eternal Snow pokecommunity:
http://www.pokecommunity.com/showthread.php?p=9200526
Reply With Quote
  #267   Link to this post, but load the entire thread.  
Old June 24th, 2016 (5:23 AM).
Lance32497's Avatar
Lance32497 Lance32497 is offline
LanceKoijer of Pokemon_Addicts
 
Join Date: Aug 2014
Location: Criscanto town-Ginoa Region xD
Gender: Male
Nature: Adamant
Posts: 792
Can anybody make a new but modified Swift Swim ability. Aside of gaining speed in Rain, it may also gain speed in Waters (I mean seas, ponds and etc.).
__________________
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
Reply With Quote
  #268   Link to this post, but load the entire thread.  
Old July 5th, 2016 (9:45 AM). Edited July 5th, 2016 by i0Bjhansen0.
i0Bjhansen0's Avatar
i0Bjhansen0 i0Bjhansen0 is offline
 
Join Date: Mar 2016
Age: 27
Gender: Male
Posts: 130
Quote:
Originally Posted by Touched View Post
After a quick glance I can't see anything obviously wrong with the logic. Did you follow the instruction telling you to put 01 48 00 47 00 00 xx xx xx 08 1A 4A at 01F1E2. Remember the offset has to be little-endian and plus 1 (since it's THUMB code). If you did this, I can only assume it's broken.
So.... Thank goodness I found this post. I had all of sturdy implemented but I didn't know to add the 1 to the offset.

I really wish the people who made these abilities said which ones need the +1 and which ones don't (I think KDS said when to +1). I had thought all of them needed the +1 but then I thought they didn't because the people didn't say.

Also, I think Protean is broken. I tried putting it into my hack but it would freeze every time I select a move, even if I didn't have Protean. Unless it was one of those +1 ones. In that case I didn't +1 (see what I mean....) (but I really want Protean to work since it could cover my new types). Speaking of new types. Does Protean account for expanded types? I managed to put Protean in and make it not freeze. It did need the +1.

But for those of us who know enough to put these in, but not enough to make them themselves, it would be nice to state +1 or not.

On that case, does the Normalize, Pixilate, Refrigerate, and Aerilate script need to be +1'd?

[EDIT] I think I found a little hiccup with the Pixilate section. It is highlighted.
Spoiler:
Quote:
Originally Posted by MrDollSteak View Post
Normalize, Refrigerate, Pixilate and Aerilate

Fire Red
Code:
....
PixilateCheck:
    cmp r1, #0xB7
    bne AerilateCheck
Pixilate:
    mov r0, #0x17
    b StoreType
....
It should be #0x12 if Fairy comes right after Dark. If it was in decimal, Fairy would actually be 18, as the ??? type is number 9. And unless someone made Fairy not after Dark, I suggest they move it, or find out what its number would be in hex and then putting it in that bolded section.

Now, I could be wrong an it could actually work right, since I don't know ASM enough to make my own scripts, but I just thought that number was wrong.
Reply With Quote
  #269   Link to this post, but load the entire thread.  
Old July 30th, 2016 (4:34 AM).
bynine's Avatar
bynine bynine is offline
 
Join Date: Jan 2016
Posts: 55
forgive my stupidity, but even after looking through this thread and all the resources, I'm stuck on where or how you would make the game call a routine after inserting it. I'm interested in just replacing a few old abilities with new ones, and i've successfully (as far as i know) stuck a new ability routine in empty space, but from there i can't find a single way forward. if anyone could point me in the right direction i'd very much appreciate it!
Reply With Quote
  #270   Link to this post, but load the entire thread.  
Old July 30th, 2016 (5:47 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 bynine View Post
forgive my stupidity, but even after looking through this thread and all the resources, I'm stuck on where or how you would make the game call a routine after inserting it. I'm interested in just replacing a few old abilities with new ones, and i've successfully (as far as i know) stuck a new ability routine in empty space, but from there i can't find a single way forward. if anyone could point me in the right direction i'd very much appreciate it!
there is literally no reason to replace an old ability with a new one, and is literally a lot harder (if not impossible) than you think it is. the way abilities are handled is way different than moves. abilities happen when the battle engine checks for it in various places, i.e. the damage calculator handles overgrow, torrent, blaze, and swarm, while the accuracy check handles sand veil. inserting new abilities is way easier than replacing old ones, so i strongly suggest you do that instead. so, this new ability routine probably had a few byte changes telling you how to do it. (the updated sturdy, for example, has you placing 01 48 00 47 00 00 xx+1 xx xx 08 1A 4A at 01F1E2). xx+1 xx xx refers to the address at which you put the routine +1 in little endian format.
__________________
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
  #271   Link to this post, but load the entire thread.  
Old July 31st, 2016 (6:46 AM).
bynine's Avatar
bynine bynine is offline
 
Join Date: Jan 2016
Posts: 55
Quote:
Originally Posted by BluRose View Post
there is literally no reason to replace an old ability with a new one, and is literally a lot harder (if not impossible) than you think it is. the way abilities are handled is way different than moves. abilities happen when the battle engine checks for it in various places, i.e. the damage calculator handles overgrow, torrent, blaze, and swarm, while the accuracy check handles sand veil. inserting new abilities is way easier than replacing old ones, so i strongly suggest you do that instead. so, this new ability routine probably had a few byte changes telling you how to do it. (the updated sturdy, for example, has you placing 01 48 00 47 00 00 xx+1 xx xx 08 1A 4A at 01F1E2). xx+1 xx xx refers to the address at which you put the routine +1 in little endian format.
after this i was still puzzled about the implementation until i realized that the routines themselves were checking if the pokemon had the ability. and now it works! thanks very much!
Reply With Quote
  #272   Link to this post, but load the entire thread.  
Old August 8th, 2016 (2:27 PM). Edited August 9th, 2016 by NewDenverCity.
NewDenverCity's Avatar
NewDenverCity NewDenverCity is offline
 
Join Date: Apr 2014
Location: Antarctica
Gender: Male
Nature: Calm
Posts: 326
Here's the other half of Sand Rush

SAND FORCE, SAND RUSH, IRON FIST, SHEER FORCE, STRONG JAW, MEGA LAUNCHER, TOUGH CLAWS, RECKLESS [FR]
Spoiler:
Don't delete the nops, they're important.
It's also worth noting that you should make sure your ability IDs match those in the .equ section. In addition, check out the bottom to make sure your attack IDs match those in the table section. You can customize it, of course.
Code:
.thumb

.equ table_offset, 0x08250C04 @change this, it's your table of moves
.equ main, 0x08800000

.equ Iron_Fist, 0x5A
.equ Reckless, 0x79
.equ Sheer_Force, 0x7E
.equ Sand_Rush, 0x93
.equ Sand_Force, 0xA0
.equ Strong_Jaw, 0xAE
.equ Mega_Launcher, 0xB3
.equ Tough_Claws, 0xB6

.align 2
.org 0x0801E59E
hook_in_base_damage_calc:
	nop
	ldr r0, base_power_override_rewrite
	bx r0

.align 2
base_power_override_rewrite: .word main + 1

null1:
	nop

.org 0x08021130
hook_in_seteffectwithchancetarget:
	ldr r1, skip_atk15_if_sheer_force
	bx r1

.align 2
skip_atk15_if_sheer_force: .word atk15_sheer_force_check + 1

null2:
	nop

.org 0x08021214
hook_in_seteffecttarget:
	ldr r1, skip_atk16_if_sheer_force
	bx r1

.align 2
skip_atk16_if_sheer_force: .word atk16_sheer_force_check + 1

@--------------------

.org 0x08028D60
sandstorm_check_rewrite:
@r0 is the battle struct
@r1 is attacker x 0x58
@r2 is the attacker
@r3 is nothing important but it's needed for the damage and all the checks
@r4 is the offset of the weather
@r5 is the offset of the attacker
@45 commands needed, no more no less. that's why i have nops in there.
	add r3, r0, r1 @r1 is now the offset of the attacker
	add r3, #0x20 @ability
	ldrb r0, [r3]
	cmp r0, #8 @sand veil
	beq 0x08028DD4 @store 0 damage from sandstorm
	cmp r0, #Sand_Force
	beq 0x08028DD4
	cmp r0, #Sand_Rush
	beq 0x08028DD4
	mov r1, #0
type_check_loop:
	add r3, #1
	ldrb r0, [r3]
	cmp r0, #4 @ground
	beq 0x08028DD4
	cmp r0, #5 @rock
	beq 0x08028DD4
	cmp r0, #8 @steel
	beq 0x08028DD4
	cmp r1, #1
	beq continue_rewrite
	add r1, #1
	b type_check_loop
continue_rewrite:
	ldr r0, status_bits_atk96
	lsl r1, r2, #2
	add r1, r0
	ldr r1, [r1]
	mov r0, #0x80 @dig flag
	and r0, r1
	cmp r0, #0
	bne 0x08028DD4
	mov r0, #80
	lsl r0, #0xB @mov r0, #0x40000, the dive flag
	and r1, r0
	cmp r1, #0
	bne 0x08028DD4
	ldr r1, sandstorm_damage
	ldrh r0, [r3, #8] @max hp
	lsr r0, #4
	str r0, [r1]
	cmp r0, #0
	bne 0x08028DDA
	mov r0, #1
	b 0x08028DD8
	nop
	nop
	nop
.word 0x02022B4C @battle_type_flags
.word 0x02023D6B @b_attacker
.word 0x02023F1C @weather
.word 0x02023BE4 @battle_struct
status_bits_atk96: .word 0x02023DFC
sandstorm_damage: .word 0x02023D50 @also known as b_move_damage but i wrote this after the rest
				@so i don't know what label number to use and i'm too lazy to check

@--------------------

.org main
.align 2
start:
	ldr r0, attacker1
	ldrb r0, [r0]
	mov r1, #0x58 @length of battle struct
	mul r0, r1
	ldr r2, battle_struct1 @make it r2 if there's an ability that stops some of these
	add r0, r0, r2
	mov r4, r0 @r4 is the offset of the attacker
	ldr r0, defender
	ldrb r0, [r0]
	mul r0, r1
	mov r5, r0 @r5 is the defender offset

setup:
	ldr r0, move_to_execute1
	ldrh r6, [r0]
	ldr r0, move_table1
	mov r1, #0xC
	mul r1, r6
	add r1, r0
	ldrb r7, [r1, #0x2]

attacker_ability_jump:
	add r4, #0x20
	ldrb r0, [r4] @ability
	cmp r0, #Iron_Fist
	beq iron_fist_routine
	cmp r0, #Strong_Jaw
	beq strong_jaw_routine
	cmp r0, #Mega_Launcher
	beq mega_launcher_routine
	cmp r0, #Sand_Force
	beq sand_force_routine
	cmp r0, #Sheer_Force
	beq sheer_force_routine
	cmp r0, #Reckless
	beq reckless_routine
	cmp r0, #Tough_Claws
	beq tough_claws_routine

defender_ability_jump:

all_ability_jump:
	b end1

@r0 has the ability of the attacker/defender, idk i haven't seen any ability that lowers bp yet
@r1 is the offset of the move to be executed
@r2 is the battle struct
@r3 is nothing
@r4 is the offset of the attacker
@r5 is the offset of the defender
@r6 is the move to execute
@r7 is the base power of the move to execute

tough_claws_routine:
	ldrb r0, [r1, #0x9]
	mov r1, #1
	and r0, r1
	cmp r0, #1 @if the contact flag is set in the move struct
	beq add_one_third_base_power @continue as it's supposed to
	b end1 @if else, end

reckless_routine:
	ldrb r0, [r1]
	cmp r0, #0x2D @jump kick effect
	beq add_one_third_base_power
	cmp r0, #0x30 @1/4 recoil effect
	beq add_one_third_base_power
	cmp r0, #0xC6 @1/3 recoil + paralysis chance
	bne end1

add_one_third_base_power
	mov r0, r7 @r0 is the base power
	mov r1, #3
	ldr r2, divsi3
	bl jump_with_r2
	add r7, r0 @r7 is the base power + 1/3 base power
	b end_of_attacking_ability_routine

sand_force_routine:
	ldr r0, weather
	ldrh r0, [r0]
	mov r3, #0x18
	and r0, r3
	cmp r0, #0
	bne end1
check_attack_type:
	ldrb r0, [r1, #3] @type of the move
	cmp r0, #4 @ground
	beq sheer_force_routine
	cmp r0, #5 @rock
	beq sheer_force_routine
	cmp r0, #8 @steel
	bne end1

sheer_force_routine:
	mov r0, r7
	mov r1, #0xA
	ldr r2, divsi3
	bl jump_with_r2 @r0 will be 1/10 of the bp
	mov r1, #3
	mul r0, r1 @and that's the 30%
	add r7, r0
	b end_of_attacking_ability_routine

iron_fist_routine:
	ldr r1, iron_fist_pointer
	b read_table

strong_jaw_routine:
	ldr r1, strong_jaw_pointer
	b read_table

mega_launcher_routine:
	ldr r1, mega_launcher_pointer

read_table:
	ldrh r0, [r1]
	cmp r0, #0
	beq end1
	add r1, #2
	cmp r0, r6
	bne read_table

check_for_iron_fist:
	ldrb r0, [r4] @ability
	cmp r0, #Iron_Fist
	bne add_one_half_boost_for_launcher_jaw

add_one_fifth_to_base_power_for_iron_fist:
	mov r0, r7
	mov r1, #5
	ldr r2, divsi3
	bl jump_with_r2
	add r7, r0, r7 @(bp/5) + bp = r7
	b end_of_attacking_ability_routine

add_one_half_boost_for_launcher_jaw:
	lsr r0, r7, #1
	add r7, r0

end_of_attacking_ability_routine:
	ldr r0, base_power_override
	strh r7, [r0]

end1:
	add sp, #-0x10
	ldr r4, flags_per_side_status
	ldr r5, defender
	ldrb r0, [r5]
	ldr r2, get_side_per_status
	bl jump_with_r2
	ldr r2, return_address1

jump_with_r2:
	bx r2

.align 2
attacker1: .word 0x02023D6B
defender: .word 0x02023D6C
battle_struct1: .word 0x02023BE4
move_to_execute1: .word 0x02023D4A
move_table1: .word table_offset
iron_fist_pointer: .word iron_fist_table
strong_jaw_pointer: .word strong_jaw_table
mega_launcher_pointer: .word mega_launcher_table
divsi3: .word 0x081E4018 + 1
flags_per_side_status: .word 0x02023DDE
get_side_per_status: .word 0x080751D8 + 1
return_address1: .word 0x0801E5AA + 1
weather: .word 0x02023F1C
base_power_override: .word 0x02023F50

@--------------------

atk15_sheer_force_check:
	add r0, r2 @r0 is the offset of the attacker
	add r0, #0x20
	ldrb r0, [r0] @loading the ability to r0
	cmp r0, #Sheer_Force
	beq end3
	cmp r0, #0x20 @serene grace
	bne end4
end2:
	bx lr
end3:
	ldr r0, move_script_pointer1
	ldr r1, [r0]
	add r1, #1
	str r1, [r0]
	ldr r0, return_address2
	bx r0
end4:
	ldr r0, return_address3
	bx r0

.align 2
return_address2: .word 0x080211FC + 1
return_address3: .word 0x08021160 + 1
move_script_pointer1: .word 0x02023D74

@--------------------

atk16_sheer_force_check:
	ldr r0, attacker2
	ldrb r0, [r0]
	mov r1, #0x58
	mul r0, r1
	ldr r1, battle_struct2
	add r0, r1
	add r0, #0x20 @to get in range of the ability
	ldrb r0, [r0]
	cmp r0, #Sheer_Force
	beq end5
continue:
	mov r0, #1
	mov r1, #0
	ldr r2, apply_effect
	bl jump_with_r2_again
end5:
	pop {pc}

jump_with_r2_again:
	bx r2

.align 2
attacker2: .word 0x02023D6B
battle_struct2: .word 0x02023BE4
apply_effect: .word 0x0801FF20 + 1

@--------------------


iron_fist_table:
.hword 0x4 @comet punch
.hword 0x5 @mega punch
.hword 0x7 @fire punch
.hword 0x8 @ice punch
.hword 0x9 @thunder punch
.hword 0x92 @dizzy punch
.hword 0xB7 @mach punch
.hword 0xDF @dynamic punch
.hword 0x108 @focus punch
.hword 0x135 @meteor mash
.hword 0x145 @shadow punch
.hword 0x147 @sky uppercut
.hword 0x167 @hammer arm
.hword 0x199 @drain punch
.hword 0x1A2 @bullet punch
.hword 0x264 @power-up punch
.hword 0x0 @end of table

strong_jaw_table:
.hword 0x2C @bite
.hword 0xF2 @crunch
.hword 0x131 @poison fang
.hword 0x1A6 @thunder fang
.hword 0x1A7 @ice fang
.hword 0x1A8 @fire fang
.hword 0x0 @end of table

mega_launcher_table:
.hword 0x160 @water pulse
.hword 0x18C @aura sphere
.hword 0x18F @dark pulse
.hword 0x196 @dragon pulse
.hword 0x1F9 @heal pulse
.hword 0x26A @origin pulse
.hword 0x0 @end of table
Tell me if you find any bugs please.

~EDIT~ and then i forgot that reckless and tough claws existed. oops. i fixed that, it was easy, assuming you edited the battle script for the jump kicks, take down, and double edge for brave bird and the like. which you should, because otherwise the AI won't use it right.
Reply With Quote
  #273   Link to this post, but load the entire thread.  
Old August 12th, 2016 (10:49 PM).
i0Bjhansen0's Avatar
i0Bjhansen0 i0Bjhansen0 is offline
 
Join Date: Mar 2016
Age: 27
Gender: Male
Posts: 130
I think the Ate abilities are broken. I tried on a clean Fire Red rom and Scratch did not change to the type I specified and did not change effectiveness to the type it should have changed to.

Spoiler:
I added one ability using PGE, changed refrigerate on the code to use that ability number and the fire type. Gave charmander the ability. Battled rival's squirtle and scratch didn't change type. I'm really disappointed because I wanted to create those abilities for the other types and use them.
Reply With Quote
  #274   Link to this post, but load the entire thread.  
Old August 13th, 2016 (6:37 AM).
AkameTheBulbasaur's Avatar
AkameTheBulbasaur AkameTheBulbasaur is offline
Akame Marukawa of Iyotono
 
Join Date: May 2013
Location: A place :D
Age: 25
Gender: Male
Nature: Docile
Posts: 408
Quote:
Originally Posted by i0Bjhansen0 View Post
I think the Ate abilities are broken. I tried on a clean Fire Red rom and Scratch did not change to the type I specified and did not change effectiveness to the type it should have changed to.

Spoiler:
I added one ability using PGE, changed refrigerate on the code to use that ability number and the fire type. Gave charmander the ability. Battled rival's squirtle and scratch didn't change type. I'm really disappointed because I wanted to create those abilities for the other types and use them.
I can verify that the Type Changing portion does indeed work. I don't know exactly what you did, but something must have gone wrong with the ability checking part. I haven't tested the ability buffer part (I ported the ability to items instead so I used a different check).
__________________
"The human sacrificed himself, to save the Pokemon. I pitted them against each other, but not until they set aside their differences did I see the true power they all share deep inside. I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are." -Mewtwo
Reply With Quote
  #275   Link to this post, but load the entire thread.  
Old August 13th, 2016 (9:55 AM).
i0Bjhansen0's Avatar
i0Bjhansen0 i0Bjhansen0 is offline
 
Join Date: Mar 2016
Age: 27
Gender: Male
Posts: 130
Quote:
Originally Posted by AkameTheBulbasaur View Post
I can verify that the Type Changing portion does indeed work. I don't know exactly what you did, but something must have gone wrong with the ability checking part. I haven't tested the ability buffer part (I ported the ability to items instead so I used a different check).
You wouldn't happen to know what I should do? It most likely is the ability buffer portion since you say you got it to change type by a different check. I really want to get these to work.
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.