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
  #301   Link to this post, but load the entire thread.  
Old November 1st, 2016 (3:58 AM).
ShyRayq's Avatar
ShyRayq ShyRayq is offline
Unprofessional Unprofessional
 
Join Date: Aug 2007
Gender: Male
Nature: Adamant
Posts: 1,855
Quote:
Originally Posted by PufferJumps View Post
hello. i just wanna ask how to properly implement a new ability.

i'm kind of new to asm hacking and so far i think i'm doing well (just a thought, though)
i successfully added some into my rom like the BW2 Repel system, gain-exp-on-catch, fix sturdy, color codes on nature and IV indicator. since i've done it pretty well i just thought maybe i'd try adding a new ability.

the ability i was trying to add is this protean:

because greninja is a thing, but whenever i tried to use it on battle, it doesn't work.

now the problem is, when i paste this ( 00 49 08 47 01 7B 77 08 ) to 1D7D8 (as instructed) nothing happens. i tried to not to add 1 on the "00" (last) part of the hex where i insert the asm but the screen just stuck after an attack. then i even tried not to reverse the hex and it called a rain, then crash >___<

the part (offset?) where i inserted the asm was on 777B00. i can't really figure out where did i got it wrong, but i really want to learn how to add it because it's a good feature. i hope someone could tell me my mistake. and lastly, sorry for a long reply, plus the bad english since it's not my mother language.

ps: i'm using mrds patch
Okay, I'm not really good at ASM, but I picked up a few things.
1st, in the ASM code, there is a section near the start called 'Proteancheck'.
In this section there's a bit of code that says:
cmp r0, #0xA9.
The A9 represents the index for the ability Protean in the table of abilities. This will not be exactly the same as in your rom. Assuming this is the only ability you have added, it should be 0x4E.
If you have added more, then it should be 0x4D + NN + 0x01 where NN is the number of abilities you have added before protean in hex.

2nd, I believe there is a string that prints that the user has changed type that you have to insert as well, but I'm not entirely sure.
__________________
3DS Friend Code: 5069-3944-3902
IGN: Peter; (X, Y, OR, AS, S, M, US, UM)
Friend Safari: (Fighting) Throh, Meditite, Breloom
Living Pokedex Complete: Y, C, R, LG, E, D, Pl, HG, B, B2, X, Y, OR, AS, M, UM, LGP, Sw, LA
Big thanks especially to DestinedJagold, Xerneas_X, Elements1, ~RNC~ and ThePoke Man

PM me if you want to trade, or add my FC.
Reply With Quote
  #302   Link to this post, but load the entire thread.  
Old November 2nd, 2016 (8:18 PM). Edited November 2nd, 2016 by PufferJumps.
PufferJumps's Avatar
PufferJumps PufferJumps is offline
 
Join Date: Jul 2016
Location: Philippines
Gender: Male
Nature: Jolly
Posts: 39
Quote:
Originally Posted by ShyRayq View Post
Okay, I'm not really good at ASM, but I picked up a few things.
1st, in the ASM code, there is a section near the start called 'Proteancheck'.
In this section there's a bit of code that says:
cmp r0, #0xA9.
The A9 represents the index for the ability Protean in the table of abilities. This will not be exactly the same as in your rom. Assuming this is the only ability you have added, it should be 0x4E.
If you have added more, then it should be 0x4D + NN + 0x01 where NN is the number of abilities you have added before protean in hex.

2nd, I believe there is a string that prints that the user has changed type that you have to insert as well, but I'm not entirely sure.


i see. so it's a lot more complicated than i thought. thanks for telling me. ill try it again and see if ill be able to do it. thanks for the tips!
__________________

Yay! Yay! Yay! Yay! Yay! Yay! Yay! Yay! Yay! Yay! Yay!



Reply With Quote
  #303   Link to this post, but load the entire thread.  
Old November 3rd, 2016 (9:22 AM).
Zervais's Avatar
Zervais Zervais is offline
Island Kahuna
 
Join Date: Aug 2016
Location: Norfolk, England
Age: 28
Gender: Male
Nature: Modest
Posts: 258
Is there a routine for Multitype and Judgement around? I think there's an Arceus form change somewhere but I'd like to know if anyone has a fully working version of him, as he should be, Judgement and all.
Reply With Quote
  #304   Link to this post, but load the entire thread.  
Old November 12th, 2016 (11:45 PM).
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
I'm trying to duplicate Victory Star

Will this code work?
Spoiler:

.text
.text
.align 2
.thumb
.thumb_func
.global victorystar

CheckBattleType:
ldr r0, .BattleType
ldrb r0, [r0]
mov r1, #0x1
and r0, r1
cmp r0, #0x0
bne DoubleBattle
SingleBattle:
ldr r0, .Bank
ldrb r0, [r0]
mov r5, #0x58
mul r0, r5
add r0, r0, r7
add r0, #0x20
ldrb r0, [r0]
b VictoryStarCheck
DoubleBattle:
ldr r0, .Bank
ldrb r0, [r0]
and r0, r1
cmp r0, #0x0
bne CheckFoeTeam
CheckUserTeam:
mov r0, #0x0
b DoupleLoop
CheckFoeTeam:
mov r0, #0x1
DoupleLoop:
mov r5, #0x58
mul r0, r5
add r1, r0, r7
add r1, #0x20
ldrb r0, [r1]
cmp r0, #0xA3
beq VictoryStar
cmp r0, #C1
beq VictoryStar

add r1, r1, #0xB0
ldrb r0, [r1]
VictoryStarCheck:
cmp r0, #0xA3
bne BufferAbility
cmp r0, #0xC1
bne BufferAbility

VictoryStar:
mov r0, #0x6E
mov r1, #0x64
mul r0, r4
bl Divide
lsl r0, r0, #0x10
lsr r4, r0, #0x10
BufferAbility:
ldr r0, .Bank
ldrb r0, [r0]
mov r5, #0x58
mul r0, r5
add r0, r0, r7
add r0, #0x20
ldrb r0, [r0]
CompoundEyesCheck:
cmp r0, #0xE
bne Return
CompoundEyes:
ldr r0, .Return
bx r0
Return:
ldr r0, .Return2
bx r0
Divide:
ldr r2, .DivideBL
bx r2

.align 2

.BattleType: .word 0x2022B4C
.Bank: .word 0x02023D6B
.Return: .word 0x0801E041
.Return2: .word 0x0801E051
.DivideBL: .word 0x081E4019

Insert 01 48 00 47 00 00 xx xx xx 08 at 0801E02E


The bolded lines indicate my additions. Let's say C1 is the ability index, will this work?
__________________
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
  #305   Link to this post, but load the entire thread.  
Old November 13th, 2016 (12:23 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
Excuse me. But any of this abilities have porting to Pokemon Ruby?
__________________
- My new Project comming Soon
Reply With Quote
  #306   Link to this post, but load the entire thread.  
Old November 13th, 2016 (5:54 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 AtecainCorp. View Post
Excuse me. But any of this abilities have porting to Pokemon Ruby?
for most, it probably wouldn't be that hard. it's just finding addresses :P
__________________
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
  #307   Link to this post, but load the entire thread.  
Old November 13th, 2016 (8:26 AM).
NewDenverCity's Avatar
NewDenverCity NewDenverCity is offline
 
Join Date: Apr 2014
Location: Antarctica
Gender: Male
Nature: Calm
Posts: 326
Quote:
Originally Posted by Lance32497 View Post
I'm trying to duplicate Victory Star

Will this code work?
Spoiler:

.text
.text
.align 2
.thumb
.thumb_func
.global victorystar

CheckBattleType:
ldr r0, .BattleType
ldrb r0, [r0]
mov r1, #0x1
and r0, r1
cmp r0, #0x0
bne DoubleBattle
SingleBattle:
ldr r0, .Bank
ldrb r0, [r0]
mov r5, #0x58
mul r0, r5
add r0, r0, r7
add r0, #0x20
ldrb r0, [r0]
b VictoryStarCheck
DoubleBattle:
ldr r0, .Bank
ldrb r0, [r0]
and r0, r1
cmp r0, #0x0
bne CheckFoeTeam
CheckUserTeam:
mov r0, #0x0
b DoupleLoop
CheckFoeTeam:
mov r0, #0x1
DoupleLoop:
mov r5, #0x58
mul r0, r5
add r1, r0, r7
add r1, #0x20
ldrb r0, [r1]
cmp r0, #0xA3
beq VictoryStar
cmp r0, #C1
beq VictoryStar

add r1, r1, #0xB0
ldrb r0, [r1]
VictoryStarCheck:
cmp r0, #0xA3
bne BufferAbility
cmp r0, #0xC1
bne BufferAbility

VictoryStar:
mov r0, #0x6E
mov r1, #0x64
mul r0, r4
bl Divide
lsl r0, r0, #0x10
lsr r4, r0, #0x10
BufferAbility:
ldr r0, .Bank
ldrb r0, [r0]
mov r5, #0x58
mul r0, r5
add r0, r0, r7
add r0, #0x20
ldrb r0, [r0]
CompoundEyesCheck:
cmp r0, #0xE
bne Return
CompoundEyes:
ldr r0, .Return
bx r0
Return:
ldr r0, .Return2
bx r0
Divide:
ldr r2, .DivideBL
bx r2

.align 2

.BattleType: .word 0x2022B4C
.Bank: .word 0x02023D6B
.Return: .word 0x0801E041
.Return2: .word 0x0801E051
.DivideBL: .word 0x081E4019

Insert 01 48 00 47 00 00 xx xx xx 08 at 0801E02E


The bolded lines indicate my additions. Let's say C1 is the ability index, will this work?
I don't see why not, yeah.
Reply With Quote
  #308   Link to this post, but load the entire thread.  
Old November 13th, 2016 (9:04 PM). Edited November 14th, 2016 by Lance32497.
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
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
Hello I tried editing the Snow warning Routine in your Rom Base which is located at 0x8909990
Code:
08 78 2D 28 01 D1 10 4A 10 47 6F 28 01 D0 0F 4C 20 47 0F 4A 11 88 80 20 08
40 00 28 01 D0 00 F0 0D F8 80 20 10 80 0B 4A 00 20 10 70 0A 48 00 F0 07 F8
0A 48 51 46 C1 75 00 F0 04 F8 08 4C 20 47 08 4A 10 47 08 48 00 47 AD A2 01
08 49 A1 01 08 1C 3F 02 02 48 3F 02 02 D0 9A 90 08 C4 3F 02 02 AB BB 01 08 
25 BC 01 08 5B BB 01 08
I added 8B 28 03 D0 which adds these lines
Code:
	cmp r0, #0x8B @8B is the index ID of Snow Warning Duplicate
	beq SnowWarning
so the code is now:
Code:
08 78 2D 28 01 D1 10 4A 10 47 6F 28 01 D0 8B 28 03 D0 0F 4C 20 47 0F 
4A 11 88 80 20 08 40 00 28 01 D0 00 F0 0D F8 80 20 10 80 0B 4A 00 20 10 70 
0A 48 00 F0 07 F8 0A 48 51 46 C1 75 00 F0 04 F8 08 4C 20 47 08 4A 10 47 08 
48 00 47 AD A2 01 08 49 A1 01 08 1C 3F 02 02 48 3F 02 02 D0 9A 90 08 C4 3F 
02 02 AB BB 01 08 25 BC 01 08 5B BB 01 08
I gave Chirpich (my ideamon) an Ability Snow Warning and Draciate(Don't mind the Draciate name, that's not its effect, just for a test) and capture two Chirpichs with Snow Warning and Draciate Ability. However, instead of "Chirpich's Snow Warning made it hail!", the text appears as "Chirpich's Draciate made it hail!" even though that Chirpich has Snow Warning Ability.

I provided 2 videos below.
The first one shows the success of Draciate but the second one fails.





Can anyone here help me with this?
__________________
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
  #309   Link to this post, but load the entire thread.  
Old November 17th, 2016 (5:30 AM).
Froosty's Avatar
Froosty Froosty is offline
The_Learner
 
Join Date: Sep 2014
Location: Somewhere in this world.
Age: 25
Gender: Male
Nature: Brave
Posts: 535
Quote:
Originally Posted by KDS View Post
There was a report mentioning problems with the Magic Bounce Ability in MrDS's Rombase, so I decided it to implement this myself from scratch, and it is working fine in Trainer Battles and Doubles.
Here it is posted with Moxie.

Magic Bounce
Spoiler:
Fire Red

For MrDS's base 1.5a at x1D8D6 insert, 18 01 80 18 00 78 C0 06 88 46 before applying the new routines to remove branch to the old routine.

Spoiler:
Routine At XXXXXX:
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
.global magicbounce
.align 2
     
        mov r9, r2
        ldr r1, freeRAMLoc
        ldrb r1, [r1, #0x0]
        cmp r1, #0x0
        bne nobouncing
        cmp r0, #0x0
        bge magicbouncecheck
        
        ldr r2, moveTable
        ldr r1, =0x0801D8E9
        bx r1

magicbouncecheck:
        ldr r2, =0x02023C04
        ldr r1, =0x02023D6C
        ldrb r3, [r1, #0x0]
        mov r1, #0x58
        mul r1, r3
        add r1, r1, r2
        ldrb r1, [r1, #0x0]
        cmp r1, #0x9D
        bne nobouncing

        ldr r2, =0x02023DFC
        lsl r1, r3, #0x02
        add r1, r1, r2
        ldr r1, [r1, #0x0]
        ldr r0, =0x000400C0
        and r0, r1
        cmp r0, #0x0
        bne nobouncing

        ldr r2, moveTable
        ldr r0, =0x02023D4A
        ldrh r1, [r0, #0x0]
        lsl r0, r1, #0x01
        add r0, r0, r1
        lsl r0, r0, #0x02
        add r0, r0, r2
        ldrb r1, [r0, #0x8]
        mov r0, #0x4
        and r0, r1
        cmp r0, #0x0
        beq nobouncing 

        ldr r0, =0x02023D6B
        ldrb r0, [r0, #0x0]
        ldr r2, =0x00000115
        add r1, r3, #0x0
        bl pressure

        bl returnSetter

        ldr r1, =0x02023D74
        ldr r0, MBScript
        str r0, [r1, #0x0]
        ldr r0, =0x0801DAFD
        bx r0

nobouncing:
        ldr r1, =0x0801D94D
        bx r1

pressure:
        ldr r3, =0x08016EC9
        bx r3

returnSetter:
        ldr r1, =0x08017545
        bx r1

.align 2
freeRAMLoc: .word 0x0203C030
moveTable: .word 0x08250C04
MBScript: .word 0x08VVVVVV

@At 1D8E0, insert: 00 49 08 47 XX+1 XX XX 08


Routine At YYYYYY:
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
.global bounceflagclear
.align 2

ldr r3, freeRAMLoc
ldrb r0, [r3, #0x0]
cmp r0, #0x0
beq exit
sub r0, r0, #0x1
strb r0, [r3, #0x0]

exit:
add sp, #0x4
pop {r3, r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0

.align 2
freeRAMLoc: .word 0x0203C030

@At 1DAFC, insert: 00 48 00 47 YY+1 YY YY 08


Routine At ZZZZZZ:
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
.global setbouncereflectionflag

main:    
    push {lr}
    ldr r0, freeRAMLoc
    ldr r1, =0x02023BCC
    ldrb r1, [r1, #0x0]
    cmp r1, #0x2
    beq oneexit

    ldr r2, =0x02023D4A
    ldr r1, moveTable
    mov r3, #0xC
    ldrb r2, [r2, #0x0]
    mul r3, r2
    add r1, r1, r3
    ldrb r1, [r1, #0x6]
    cmp r1, #0x8
    bne oneexit

    ldr r2, =0x02023D6D
    ldrb r2, [r2, #0x0]
    mov r1, #0x58
    mul r1, r2
    ldr r3, =0x02023C0C
    add r3, r3, r1
    ldrh r3, [r3, #0x0]
    cmp r3, #0x0
    beq oneexit

    mov r1, #0x2
    strb r1, [r0, #0x0]
    pop {r0}
    bx r0

oneexit:
    mov r1, #0x1
    strb r1, [r0, #0x0]
    pop {r0}
    bx r0

.align 2
freeRAMLoc: .word 0x0203C030
moveTable: .word 0x08250C04


Magic Coat Script (At UUUUUU):
Spoiler:
At x1D934, insert in reverse hex: UU UU UU 08
Code:
02 03 39 20 00 10 BE 00 12 40 00 F8 ZZ+1 ZZ ZZ 08 35 D0 3D 02 02 00 0C 80 00 76 01 01 3C


Magic Bounce Script (At VVVVVV):
Spoiler:
Code:
02 03 39 20 00 FA 20 C0 03 02 SS SS SS 08 10 84 01 12 40 00 F8 ZZ+1 ZZ ZZ 08 35 D0 3D 02 02 00 0C 80 00 76 01 01 3C


String At SSSSSS:
Code:
FD 13 B4 E7 00 FD 14 FE EB D5 E7 00 D6 E3 E9 E2 D7 D9 D8 00 D6 D5 D7 DF 00 D6 ED 00 FD 1B AB FF
Notes to understand this:
Spoiler:

+ If for some stupid reason, Magic Coat is used on a Magic Bounce pokemon, then Magic coat activates before Magic bounce.
+ Magic Bounce does not activate, if the mon with Magic Bounce is in a semi-invulnerable state (fly, dive etc.).
+ Added a special Flag to ensure that Magic Bounce does not re-reflect a move reflected by Magic Bounce/Magic Coat. Otherwise, a infinite ping-pong loop happens between two Magic Bounce pokemon.
+ A free RAM location is used for this Flag. Initially, it is set to 0. When the condition for Magic Coat or Magic Bounce is met, it is set to 1 (e.g, always the case in singles, reflected spore in doubles) or 2 (e.g reflected growl in doubles), according to the no. of mons the rebounded Move can affect, and then the Rebound is executed.
+ If the value of the Flag is non-zero, the Magic Bounce and Magic Coat checks are automatically skipped to avoid the re-reflection situation and the Flag is decremented by 1 and this Step is repeated until the Flag is cleared to 0.
+ This to try to ensure that during the Rebound itself, the Flag is successfully cleared to 0.
+ The free RAM location refered in the 3 routines MUST BE SAME.
+ Will port to Emerald soon.




Moxie
Spoiler:
Fire Red
Spoiler:
At x213DC, insert in reverse hex: XX XX XX 08

Battle Script at XXXXXX:
Spoiler:
Code:
56 00
39 40 00
1A 00
1B 00
10 1D 00
10 30 01
1E 01 9A YY YY YY 08
3C


Battle Script at YYYYYY:
Spoiler:
Code:
E3 01 ZZ ZZ ZZ 08
20 01 00 01 0C ZZ ZZ ZZ 08
39 20 00
2E DF 3F 02 02 00
48 01 02 00
2E DE 3F 02 02 11
89 41 ZZ ZZ ZZ 08
FA 20 C0 03 02 SS SS SS 08 
10 84 01
12 40 00
3C


Battle Script at ZZZZZZ:
Code:
3C
String at SSSSSS:
Code:
FD 0F B4 E7 00 C7 E3 EC DD D9 FE E6 D5 DD E7 D9 D8 00 DD E8 E7 00 BB E8 E8 D5 D7 DF AB FF


Emerald
Spoiler:

At x49C8C insert in reverse hex: XX XX XX 08

Battle Script at XXXXXX:
Spoiler:
Code:
56 00
39 40 00
1A 00
1B 00
10 1D 00
10 30 01
1E 01 9A YY YY YY 08
3C


Battle Script at YYYYYY:
Spoiler:
Code:
E3 01 ZZ ZZ ZZ 08
20 01 00 01 0C ZZ ZZ ZZ 08
39 20 00
2E 8F 44 02 02 00
48 01 02 00
2E 8E 44 02 02 11
89 41 ZZ ZZ ZZ 08
FB 20 E3 03 02 SS SS SS 08 //Assuming that setword command is at FB, and the RAM location for the string pointer is at 0x203E320. If not, then change this line accordingly
10 84 01
12 40 00
3C


Battle Script at ZZZZZZ:
Code:
3C
String At SSSSSS:
Code:
FD 0F B4 E7 00 C7 E3 EC DD D9 FE E6 D5 DD E7 D9 D8 00 DD E8 E7 00 BB E8 E8 D5 D7 DF AB FF



Also, these require Jambo's Callasm and Setword commands, and his Battle String Loader Hack.
I expanded the table...
I think it has f7(starting from 00) commands.... so I inserted the jambo's callasm at f8 and setword command at f9 is it ok ????
also
1E 01 9A YY YY YY 08
what about that underlined 9A
do it needs to be changed or is something special there ???

hoping to get answer :)
__________________
My works:
TOOL: TL's Quick Enhancer
TUTORIAL: Fire red habitat editing
TUTORIAL: Fire red Transparent text-box


| |
Reply With Quote
  #310   Link to this post, but load the entire thread.  
Old November 17th, 2016 (5:52 AM).
Trainer 781
Guest
 
Posts: n/a
Quote:
Originally Posted by The_learner View Post
I expanded the table...
I think it has f7(starting from 00) commands.... so I inserted the jambo's callasm at f8 and setword command at f9 is it ok ????
also
1E 01 9A YY YY YY 08
what about that underlined 9A
do it needs to be changed or is something special there ???

hoping to get answer :)
Yes, its good to go.
9A is the ability index for moxie. So if you have an index other than 9A for moxie then you will have to change this.
Reply With Quote
  #311   Link to this post, but load the entire thread.  
Old November 17th, 2016 (6:01 AM).
Froosty's Avatar
Froosty Froosty is offline
The_Learner
 
Join Date: Sep 2014
Location: Somewhere in this world.
Age: 25
Gender: Male
Nature: Brave
Posts: 535
Quote:
Originally Posted by KDS View Post
Yes, its good to go.
9A is the ability index for moxie. So if you have an index other than 9A for moxie then you will have to change this.
You are really great man!!!

THANKS for the reply :)

Respect and appreciate your help!!!

Thanks again :)
__________________
My works:
TOOL: TL's Quick Enhancer
TUTORIAL: Fire red habitat editing
TUTORIAL: Fire red Transparent text-box


| |
Reply With Quote
  #312   Link to this post, but load the entire thread.  
Old November 23rd, 2016 (5:58 AM).
Versekr Dark Versekr Dark is offline
 
Join Date: Sep 2014
Gender: Male
Posts: 50
Sorry for my ignorance but I wanted to know if it has already opened a new post for the 7th skills, if I am annoying sorry, it is not my intention.
Reply With Quote
  #313   Link to this post, but load the entire thread.  
Old December 1st, 2016 (7:10 AM).
PufferJumps's Avatar
PufferJumps PufferJumps is offline
 
Join Date: Jul 2016
Location: Philippines
Gender: Male
Nature: Jolly
Posts: 39
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.
False Swipe no longer works after I put Sturdy {D:}
__________________

Yay! Yay! Yay! Yay! Yay! Yay! Yay! Yay! Yay! Yay! Yay!



Reply With Quote
  #314   Link to this post, but load the entire thread.  
Old December 4th, 2016 (7:19 AM). Edited December 4th, 2016 by lee s.b..
lee s.b.'s Avatar
lee s.b. lee s.b. is offline
 
Join Date: Oct 2016
Gender: Male
Posts: 9
Help!
I really want to add protean to fire red.
Sorry i'm bad at this stuff and i need an easy tutorial for beginners like me.
__________________
Reply With Quote
  #315   Link to this post, but load the entire thread.  
Old December 23rd, 2016 (12:07 AM).
VeryBestRogue VeryBestRogue is offline
 
Join Date: Oct 2016
Gender: Male
Nature: Bold
Posts: 22
Hey guys! I am finding it hard to insert the abilities in my ROM is there any one who could be willing to help out? I expand the Ability Table and then insert the ASM then what do i Have to do ??? I dont want to rely on MrDs' Patch (no offence) as it is not dynamic...
Reply With Quote
  #316   Link to this post, but load the entire thread.  
Old December 23rd, 2016 (8:33 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 VeryBestRogue View Post
Hey guys! I am finding it hard to insert the abilities in my ROM is there any one who could be willing to help out? I expand the Ability Table and then insert the ASM then what do i Have to do ??? I dont want to rely on MrDs' Patch (no offence) as it is not dynamic...
insert the asm routines and make the necessary byte changes, and all should be outlined in the post :P

edit: and mrds' patch is rather fine to use unless if you're using that space starting at 0x900000
__________________
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
  #317   Link to this post, but load the entire thread.  
Old December 24th, 2016 (12:51 AM).
VeryBestRogue VeryBestRogue is offline
 
Join Date: Oct 2016
Gender: Male
Nature: Bold
Posts: 22
Quote:
Originally Posted by BluRose View Post
insert the asm routines and make the necessary byte changes, and all should be outlined in the post :P

edit: and mrds' patch is rather fine to use unless if you're using that space starting at 0x900000
Thanks they are working... :)
Reply With Quote
  #318   Link to this post, but load the entire thread.  
Old December 30th, 2016 (4:00 PM).
frezgle frezgle is offline
 
Join Date: Dec 2014
Gender: Male
Posts: 16
Quote:
Originally Posted by MrDollSteak View Post
Skill Link

Spoiler:
Fire Red
Spoiler:
Search for the pointer D9 6C 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 5D YY YY YY 08
28 D9 6C 1D 08
Battle Script at YY YY YY
Code:
00
01 5E 69 1D 08
00 00 02 03
8D 05 
8E 2E
2E DA 3F 02 02 00
28 EC 6C 1D 08

Emerald
Spoiler:
Search for the pointer EA 8D 2D 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 5D YY YY YY 08 
28 EA 8D 2D 08
Battle Script at YY YY YY
Code:
00 
01 5E 8A 2D 08 
00 00 02 03
8D 05 
8E 2E 
2E 8A 44 02 02 00 
28 FD 8D 2D 08
Having a problem with this one - all multi-hit moves are hitting five times 100% of the time, even if the user does not have Skill Link. I figured maybe the 5D in the first script was just taken from the "default" index for Skill Link, and I changed that to the index of what it is in my hack, but no dice. Is there something else I need to do?

EDIT: Nevermind!! What I had accidentally done was, when replacing the pointers, I replaced the one in the second script by mistake. Working fine now.
Reply With Quote
  #319   Link to this post, but load the entire thread.  
Old January 7th, 2017 (3:03 AM).
Chaotix Chaotix is offline
Love to test
 
Join Date: Feb 2007
Nature: Adamant
Posts: 59
Quote:
Originally Posted by KDS View Post
There was a report mentioning problems with the Magic Bounce Ability in MrDS's Rombase, so I decided it to implement this myself from scratch, and it is working fine in Trainer Battles and Doubles.
Here it is posted with Moxie.

Magic Bounce
Spoiler:
Fire Red

For MrDS's base 1.5a at x1D8D6 insert, 18 01 80 18 00 78 C0 06 88 46 before applying the new routines to remove branch to the old routine.

Spoiler:
Routine At XXXXXX:
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
.global magicbounce
.align 2
     
        mov r9, r2
        ldr r1, freeRAMLoc
        ldrb r1, [r1, #0x0]
        cmp r1, #0x0
        bne nobouncing
        cmp r0, #0x0
        bge magicbouncecheck
        
        ldr r2, moveTable
        ldr r1, =0x0801D8E9
        bx r1

magicbouncecheck:
        ldr r2, =0x02023C04
        ldr r1, =0x02023D6C
        ldrb r3, [r1, #0x0]
        mov r1, #0x58
        mul r1, r3
        add r1, r1, r2
        ldrb r1, [r1, #0x0]
        cmp r1, #0x9D
        bne nobouncing

        ldr r2, =0x02023DFC
        lsl r1, r3, #0x02
        add r1, r1, r2
        ldr r1, [r1, #0x0]
        ldr r0, =0x000400C0
        and r0, r1
        cmp r0, #0x0
        bne nobouncing

        ldr r2, moveTable
        ldr r0, =0x02023D4A
        ldrh r1, [r0, #0x0]
        lsl r0, r1, #0x01
        add r0, r0, r1
        lsl r0, r0, #0x02
        add r0, r0, r2
        ldrb r1, [r0, #0x8]
        mov r0, #0x4
        and r0, r1
        cmp r0, #0x0
        beq nobouncing 

        ldr r0, =0x02023D6B
        ldrb r0, [r0, #0x0]
        ldr r2, =0x00000115
        add r1, r3, #0x0
        bl pressure

        bl returnSetter

        ldr r1, =0x02023D74
        ldr r0, MBScript
        str r0, [r1, #0x0]
        ldr r0, =0x0801DAFD
        bx r0

nobouncing:
        ldr r1, =0x0801D94D
        bx r1

pressure:
        ldr r3, =0x08016EC9
        bx r3

returnSetter:
        ldr r1, =0x08017545
        bx r1

.align 2
freeRAMLoc: .word 0x0203C030
moveTable: .word 0x08250C04
MBScript: .word 0x08VVVVVV

@At 1D8E0, insert: 00 49 08 47 XX+1 XX XX 08


Routine At YYYYYY:
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
.global bounceflagclear
.align 2

ldr r3, freeRAMLoc
ldrb r0, [r3, #0x0]
cmp r0, #0x0
beq exit
sub r0, r0, #0x1
strb r0, [r3, #0x0]

exit:
add sp, #0x4
pop {r3, r4}
mov r8, r3
mov r9, r4
pop {r4-r7}
pop {r0}
bx r0

.align 2
freeRAMLoc: .word 0x0203C030

@At 1DAFC, insert: 00 48 00 47 YY+1 YY YY 08


Routine At ZZZZZZ:
Spoiler:
Code:
.text
.align 2
.thumb
.thumb_func
.global setbouncereflectionflag

main:    
    push {lr}
    ldr r0, freeRAMLoc
    ldr r1, =0x02023BCC
    ldrb r1, [r1, #0x0]
    cmp r1, #0x2
    beq oneexit

    ldr r2, =0x02023D4A
    ldr r1, moveTable
    mov r3, #0xC
    ldrb r2, [r2, #0x0]
    mul r3, r2
    add r1, r1, r3
    ldrb r1, [r1, #0x6]
    cmp r1, #0x8
    bne oneexit

    ldr r2, =0x02023D6D
    ldrb r2, [r2, #0x0]
    mov r1, #0x58
    mul r1, r2
    ldr r3, =0x02023C0C
    add r3, r3, r1
    ldrh r3, [r3, #0x0]
    cmp r3, #0x0
    beq oneexit

    mov r1, #0x2
    strb r1, [r0, #0x0]
    pop {r0}
    bx r0

oneexit:
    mov r1, #0x1
    strb r1, [r0, #0x0]
    pop {r0}
    bx r0

.align 2
freeRAMLoc: .word 0x0203C030
moveTable: .word 0x08250C04


Magic Coat Script (At UUUUUU):
Spoiler:
At x1D934, insert in reverse hex: UU UU UU 08
Code:
02 03 39 20 00 10 BE 00 12 40 00 F8 ZZ+1 ZZ ZZ 08 35 D0 3D 02 02 00 0C 80 00 76 01 01 3C


Magic Bounce Script (At VVVVVV):
Spoiler:
Code:
02 03 39 20 00 FA 20 C0 03 02 SS SS SS 08 10 84 01 12 40 00 F8 ZZ+1 ZZ ZZ 08 35 D0 3D 02 02 00 0C 80 00 76 01 01 3C


String At SSSSSS:
Code:
FD 13 B4 E7 00 FD 14 FE EB D5 E7 00 D6 E3 E9 E2 D7 D9 D8 00 D6 D5 D7 DF 00 D6 ED 00 FD 1B AB FF
Notes to understand this:
Spoiler:

+ If for some stupid reason, Magic Coat is used on a Magic Bounce pokemon, then Magic coat activates before Magic bounce.
+ Magic Bounce does not activate, if the mon with Magic Bounce is in a semi-invulnerable state (fly, dive etc.).
+ Added a special Flag to ensure that Magic Bounce does not re-reflect a move reflected by Magic Bounce/Magic Coat. Otherwise, a infinite ping-pong loop happens between two Magic Bounce pokemon.
+ A free RAM location is used for this Flag. Initially, it is set to 0. When the condition for Magic Coat or Magic Bounce is met, it is set to 1 (e.g, always the case in singles, reflected spore in doubles) or 2 (e.g reflected growl in doubles), according to the no. of mons the rebounded Move can affect, and then the Rebound is executed.
+ If the value of the Flag is non-zero, the Magic Bounce and Magic Coat checks are automatically skipped to avoid the re-reflection situation and the Flag is decremented by 1 and this Step is repeated until the Flag is cleared to 0.
+ This to try to ensure that during the Rebound itself, the Flag is successfully cleared to 0.
+ The free RAM location refered in the 3 routines MUST BE SAME.
+ Will port to Emerald soon.




Moxie
Spoiler:
Fire Red
Spoiler:
At x213DC, insert in reverse hex: XX XX XX 08

Battle Script at XXXXXX:
Spoiler:
Code:
56 00
39 40 00
1A 00
1B 00
10 1D 00
10 30 01
1E 01 9A YY YY YY 08
3C


Battle Script at YYYYYY:
Spoiler:
Code:
E3 01 ZZ ZZ ZZ 08
20 01 00 01 0C ZZ ZZ ZZ 08
39 20 00
2E DF 3F 02 02 00
48 01 02 00
2E DE 3F 02 02 11
89 41 ZZ ZZ ZZ 08
FA 20 C0 03 02 SS SS SS 08 
10 84 01
12 40 00
3C


Battle Script at ZZZZZZ:
Code:
3C
String at SSSSSS:
Code:
FD 0F B4 E7 00 C7 E3 EC DD D9 FE E6 D5 DD E7 D9 D8 00 DD E8 E7 00 BB E8 E8 D5 D7 DF AB FF


Emerald
Spoiler:

At x49C8C insert in reverse hex: XX XX XX 08

Battle Script at XXXXXX:
Spoiler:
Code:
56 00
39 40 00
1A 00
1B 00
10 1D 00
10 30 01
1E 01 9A YY YY YY 08
3C


Battle Script at YYYYYY:
Spoiler:
Code:
E3 01 ZZ ZZ ZZ 08
20 01 00 01 0C ZZ ZZ ZZ 08
39 20 00
2E 8F 44 02 02 00
48 01 02 00
2E 8E 44 02 02 11
89 41 ZZ ZZ ZZ 08
FB 20 E3 03 02 SS SS SS 08 //Assuming that setword command is at FB, and the RAM location for the string pointer is at 0x203E320. If not, then change this line accordingly
10 84 01
12 40 00
3C


Battle Script at ZZZZZZ:
Code:
3C
String At SSSSSS:
Code:
FD 0F B4 E7 00 C7 E3 EC DD D9 FE E6 D5 DD E7 D9 D8 00 DD E8 E7 00 BB E8 E8 D5 D7 DF AB FF



Also, these require Jambo's Callasm and Setword commands, and his Battle String Loader Hack.
Not sure why I am having a tough time getting Moxie to work. When I KO a pokemon in the wild the attack boost animation plays then the game gets stuck there.

I put the pointer to where I inserted script XXXXXX at 0x08213DC;
changed the ability index to 4E from 9A since I only added Moxie;
added callasm to the command table at F8;
added battle string loader exactly as Jambo posted it here https://www.pokecommunity.com/showpost.php?p=7101031&postcount=230 do I need to change it at all?;
added setword command KDS posted on page 3 and added a pointer to it at FA in the command table.

What could be wrong?

Edit: For Fire Red
Reply With Quote
  #320   Link to this post, but load the entire thread.  
Old January 7th, 2017 (3:17 AM).
Trainer 781
Guest
 
Posts: n/a
Quote:
Originally Posted by Chaotix View Post
Not sure why I am having a tough time getting Moxie to work. When I KO a pokemon in the wild the attack boost animation plays then the game gets stuck there.

I put the pointer to where I inserted script XXXXXX at 0x08213DC;
changed the ability index to 4E from 9A since I only added Moxie;
added callasm to the command table at F8;
added battle string loader exactly as Jambo posted it here https://www.pokecommunity.com/showpost.php?p=7101031&postcount=230 do I need to change it at all?;
added setword command KDS posted on page 3 and added a pointer to it at FA in the command table.

What could be wrong?

Edit: For Fire Red
Code:
FB 20 E3 03 02 SS SS SS 08
have you changed the FB to FA here?
Reply With Quote
  #321   Link to this post, but load the entire thread.  
Old January 7th, 2017 (3:22 AM).
Chaotix Chaotix is offline
Love to test
 
Join Date: Feb 2007
Nature: Adamant
Posts: 59
Quote:
Originally Posted by KDS View Post
Code:
FB 20 E3 03 02 SS SS SS 08
have you changed the FB to FA here?
The code for Fire Red has it as FA to start,

That segment of code as it is in my ROM:
Code:
FA 20 C0 03 02 90 50 77 08
Reply With Quote
  #322   Link to this post, but load the entire thread.  
Old January 7th, 2017 (3:28 AM).
Trainer 781
Guest
 
Posts: n/a
Quote:
Originally Posted by Chaotix View Post
The code for Fire Red has it as FA to start,

That segment of code as it is in my ROM:
Code:
FA 20 C0 03 02 90 50 77 08
Oops, my bad. The issue must be setword command not being set up properly if you are getting the animation to play properly. Try to redo the steps from scratch.
Reply With Quote
  #323   Link to this post, but load the entire thread.  
Old January 7th, 2017 (3:53 AM). Edited January 7th, 2017 by Chaotix.
Chaotix Chaotix is offline
Love to test
 
Join Date: Feb 2007
Nature: Adamant
Posts: 59
Quote:
Originally Posted by KDS View Post
Oops, my bad. The issue must be setword command not being set up properly if you are getting the animation to play properly. Try to redo the steps from scratch.
Started from back-up before adding the one new ability, battle string loader, and setword; after re-implementing all of them it was the same result.

The changes made so far are: Doesn't's 1.6 PSS, repointed attack everything and added 1 new attack, Repointed BS command table, added callasm to F8, First Side Routine Rewrite. Could any of that cause a problem?

Either way gonna try straight from a clean FR now and add only the ability, repoint the BSC table and add F8 Callasm, FA Setword, and Battle String Loader.

Edit: From clean FR start after KOing a pokemon the animation for attack up plays then the message displayed is the Rival's "WHAT? Unbelievable! I Picked the wrong pokemon!" RAM offset issue for one of the things?
Reply With Quote
  #324   Link to this post, but load the entire thread.  
Old January 7th, 2017 (5:18 AM).
Trainer 781
Guest
 
Posts: n/a
Quote:
Originally Posted by Chaotix View Post
Started from back-up before adding the one new ability, battle string loader, and setword; after re-implementing all of them it was the same result.

The changes made so far are: Doesn't's 1.6 PSS, repointed attack everything and added 1 new attack, Repointed BS command table, added callasm to F8, First Side Routine Rewrite. Could any of that cause a problem?

Either way gonna try straight from a clean FR now and add only the ability, repoint the BSC table and add F8 Callasm, FA Setword, and Battle String Loader.

Edit: From clean FR start after KOing a pokemon the animation for attack up plays then the message displayed is the Rival's "WHAT? Unbelievable! I Picked the wrong pokemon!" RAM offset issue for one of the things?
Check the contents of 0x203C020 in the VBA memory viewer at the time of message display.
Reply With Quote
  #325   Link to this post, but load the entire thread.  
Old January 7th, 2017 (5:28 AM). Edited January 7th, 2017 by Chaotix.
Chaotix Chaotix is offline
Love to test
 
Join Date: Feb 2007
Nature: Adamant
Posts: 59
Quote:
Originally Posted by KDS View Post
Check the contents of 0x203C020 in the VBA memory viewer at the time of message display.
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?
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.