The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Research & Development (https://www.pokecommunity.com/forumdisplay.php?f=195)
-   -   Quick Research & Development Thread (https://www.pokecommunity.com/showthread.php?t=205158)

EddyHg80 December 29th, 2016 6:06 AM

Guys I need some help to port this feature to the Italian Emerald rom.
I found the battle script offset and the other offsets required but I'm pretty sure some hex valuse needs to be changed. When inserting this new battle script when I catch a pokemon it's all fine, then the pokeball disappears but the battle doesn't end, if I go to the bag and then back into the battle the pokemon is still there.
Can someone have a look into this?

Battle script offset: 0x2DCD10
Pokemons evolve from this experience, replace the bytes at 0x3DE80 with B9 DE 03 08

You can use my save file to test the results.

Trev December 29th, 2016 6:32 AM

The bytes you put at 0x3DE80 should be B5 DE 03 08. Unless that has something to do with Emerald, I don't know because I don't hack Emerald...

Anyway, you don't need to insert any actual battle scripts. Copy this:

Code:

2A 00 08 42 02 02 05 00 92 BD 2D 08 60 0B 10 0B 01 F1 XX XX XX XX 2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0F 01 3A 2E 32 43 02 02 00 F2 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08


to freespace, and replace the XX XX XX XX with a pointer to:

Code:

2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08


which you also insert into freespace. Then, go to your offset in a hex editor, and write the pointer to the first code overtop of the pointer already there. The pointer in the first code should be XX XX XX 08 (I don't know why Chaos wouldn't put the 08 there). That's what I did in FireRed so it should, theoretically, work.

Quote:

Originally Posted by Lost Heart (Post 9524148)
Spoiler:
Door Animation Format

Door animations follow a very simple 12-byte format, which I'm sharing for anyone that needs a reference.

Code:

| Offset  | Type          | Notes                            |
|------------------------------------------------------------|
| 0-1    | Tile index    |                                  |
| 2      | Sound flag    | 00 = door, other = sliding door  |
| 3      | Tile flag    | 00 = one tile, other = two tiles |
| 4-7    | Image        | pointer, uncompressed            |
| 8-11    | Palette      | pointer                          |


The data is stored in tables, and can be found at the following offsets:
Code:

AXVE: 30F9B4
AXPE: 30F944
BPRE: 35B5D8
BPGE: 35B5B8
BPEE: 497174



We can repoint this, I assume, which means we could probably have a much easier time inserting and creating doors. Images encompass the animation frames, yes? Does the animation occur naturally if data is added to this table? How would we utilize a newly-inserted door in a map editor?

EddyHg80 December 30th, 2016 3:42 AM

Quote:

Originally Posted by Trev (Post 9532601)
Spoiler:
The bytes you put at 0x3DE80 should be B5 DE 03 08. Unless that has something to do with Emerald, I don't know because I don't hack Emerald...

Anyway, you don't need to insert any actual battle scripts. Copy this:

Code:

2A 00 08 42 02 02 05 00 92 BD 2D 08 60 0B 10 0B 01 F1 XX XX XX XX 2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0F 01 3A 2E 32 43 02 02 00 F2 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08


to freespace, and replace the XX XX XX XX with a pointer to:

Code:

2E 90 44 02 02 00 2E AC 40 02 02 00 2E AD 40 02 02 00 23 00 10 0D 01 3A 2E 32 43 02 02 00 F3 C2 BD 2D 08 F0 13 7A C9 5C 08 12 40 00 28 C3 BD 2D 08


which you also insert into freespace. Then, go to your offset in a hex editor, and write the pointer to the first code overtop of the pointer already there. The pointer in the first code should be XX XX XX 08 (I don't know why Chaos wouldn't put the 08 there). That's what I did in FireRed so it should, theoretically, work.


You just made a copy paste of what Chaos wrote, didn't you? :D
Same result, something has to be changed to get this work with the Italian rom.

Quote:

Originally Posted by Trev (Post 9532601)
The bytes you put at 0x3DE80 should be B5 DE 03 08. Unless that has something to do with Emerald, I don't know because I don't hack Emerald...

In the italian rom that pointer need to be changed since the bytes are not in the same place of the english one.

Can someone download an italian rom and try to fix it please?
(just serch for "Pokemon Smeraldo ita rom download")
Here's my save file to test the results.

Trev December 30th, 2016 6:26 AM

[FR] If you want every Pokemon who participates in battle to receive full exp instead of having it divided, write 01 21 at 0x21C3A. Credit to Doesnt for finding this (somehow).

frezgle December 30th, 2016 1:44 PM

Quote:

Originally Posted by Trev (Post 9533473)
[FR] If you want every Pokemon who participates in battle to receive full exp instead of having it divided, write 01 21 at 0x21C3A.

On this note, the equivalent bytes to change in Emerald are located at 0x4A4FE.

Froosty January 4th, 2017 2:47 AM

Quote:

Originally Posted by azurile13 (Post 9090677)
I don't know if this has been posted before, but whatevs. It came to my attention today that the bag in FireRed crashes if a "main" pocket has more than 42 items (the normal max for regular items). I had always assumed the malloc was done based on a multiple of the numbers inputted at the routine beginning 0x08099E44, because the TM pocket works fine even with over 100 items, but apparently the berry/TM cases mean they run off of something different. Anyhow, to allow for sufficient malloc requests, change ".equ largest_pocket_size" to your new max and insert this:
Code:

.equ largest_pocket_size,        CHANGE THIS LINE
.equ largest_pocket_size_plus_one, largest_pocket_size + 1
.equ strings_size,        largest_pocket_size_plus_one * 19

.org 0x08002B9C
malloc:
        push {lr}
        mov r1, r0

.org 0x081083F4
main:
        push {r4, lr}
        ldr r4, =(0x0203AD18)
        mov r0, #largest_pocket_size_plus_one
        lsl r0, r0, #0x3
        bl malloc
        str r0, [r4, #0x0]
        cmp r0, #0x0
        beq return
        ldr r0, =strings_size
        bl malloc
        str r0, [r4, #0x4]
        cmp r0, #0x0
        beq return
        mov r0, #0x1

return:
        pop {r4}
        pop {r1}
        bx r1


EDIT: I haven't done much testing. I've only thrown like 60 items into the general items pocket before I got bored & assumed this routine was the only problem.

Info on 0x08099E44: http://www.pokecommunity.com/showpost.php?p=9014911&postcount=2018

I cant seem to compile it,
can anyone help me out???

Trev January 4th, 2017 6:12 AM

Quote:

Originally Posted by The_learner (Post 9537833)
I cant seem to compile it,
can anyone help me out???

Post a thread in the Help-Me-Hack section.

Megax Rocker January 4th, 2017 10:52 AM

Is there a way to make Wobuffet and Maril/Azumaril always breed their baby forms without the need of the Incense items to be held? Essentially making them behave like Pikachu and pichu?

Chaotix January 4th, 2017 2:03 PM

Quote:

Originally Posted by Touched (Post 8987453)
Try increasing the value at 0809B430 (FR) from 4 to 5. That number should be the digit length of prices for the Pokemart.

I just tried this recently and I can't seem to get it to work. On attempting to load a pokemart containing an item with a value greater than 5 digits in it's stock the game gets stuck on a black screen. Not sure what could be going wrong here.

BluRose January 4th, 2017 3:55 PM

Quote:

Originally Posted by Chaotix (Post 9538212)
I just tried this recently and I can't seem to get it to work. On attempting to load a pokemart containing an item with a value greater than 5 digits in it's stock the game gets stuck on a black screen. Not sure what could be going wrong here.

hi chaotix! me again

figured it out
9B430 - 05 (max characters taken from a string)
9B440 - 05 (i have no idea, maybe max characters that can be shown? necessary nonetheless)

so just doing these two changes creates an annoying thing where everything has its last digit cut off
9B47A - 64 (instead of 69) (it's an x-coordinate, so i don't know if this value is exact or not)
http://i.imgur.com/QzAT2K9.png
(resultant picture, you can use to compare to original and subtract/add pixel values as necessary)

EDIT: AHHHH KILL ATTACHED THUMBNAILS WITH FIRE

Chaotix January 4th, 2017 4:07 PM

Quote:

Originally Posted by BluRose (Post 9538288)
hi chaotix! me again

figured it out
9B430 - 05 (max characters taken from a string)
9B440 - 05 (i have no idea, maybe max characters that can be shown? necessary nonetheless)

so just doing these two changes creates an annoying thing where everything has its last digit cut off
9B47A - 64 (instead of 69) (it's an x-coordinate, so i don't know if this value is exact or not)

I appreciate this sooo much BluRose! I'll mess around with it soon and thanks much, sorry to bother you with all this.

Squeetz January 5th, 2017 7:03 AM

To change what Pokémon gets the DeepseaScale and DeepseaTooth boosts, change the bytes at 0x3F24C to your new Pokémon's index, reversed. (0x175 is Clamperl)

This will give the Pokémon both boosts, however, so if you want a separate Pokémon for each item, insert this routine somewhere:
Spoiler:
.text
.align 2
.thumb
.thumb_func

main:
LDR R0, .index
CMP R1, R0
BNE .skip
MOV R1, R8
LDR R0, .return
BX R0

.skip
LDR R0, .return2
BX R0

.align 2
.index: .word 0x00000175 @pokemon that should get SpA boost from Deepseatooth
.return: .word 0x803EFD8 +1
.return2: .word 0x803EFDE +1


After that, go to 0x3EFD0 and place:
Code:

00 48 00 47 XX XX XX 08


where the XX is the pointer to the routine, +1.
After this, the byte change you made first in this post will only be relevant for the Pokémon that should get the Sp. Def boost from Deepseascale.

A huge thanks to NewDenverCity for helping me out with this, and making me understand instructions and hooks better!

ShyGuy25 January 7th, 2017 6:01 AM

Does anyone know how to remove the 10% stat boosts given by badges in Fire Red?

Quote:

Originally Posted by Megax Rocker (Post 9538125)
Is there a way to make Wobuffet and Maril/Azumaril always breed their baby forms without the need of the Incense items to be held? Essentially making them behave like Pikachu and pichu?

Open up any Pokemon editor and remove the "breeding only" in the evolutions tab for Wobbuffet, Marill and Azumarill. Its very simple.

Shiny Quagsire January 7th, 2017 5:23 PM

In Fire Red, 0824EFC4 contains a table of structures 4 bytes long describing which environments go with a map's Fight Type. The structure is as follows:
Code:

<byte> Map Type
<byte> Battle Background Index
<Half-Word> Padding


An equivalent structure does not seem to exist in Emerald or Ruby.

The routine which reads the table has a maximum of 7 elements it will attempt to check the map type against. This table can be extended by repointing it and increasing the byte value at 0800F254. In theory, this can allow forcing particular environments in a map for wild/trainer battles. This table is only ever read if the Fight Type is not index 0 (Random in A-Map), and it overrides environments from tile types (ie all grass, water, cave, trainer etc battles will be forced). In theory you could also add additional battle backgrounds by extending the structure array at 0824EE34.

Trev January 7th, 2017 6:51 PM

Quote:

Originally Posted by Shiny Quagsire (Post 9541562)
In Fire Red, 0824EFC4 contains a table of structures 4 bytes long describing which environments go with a map's Fight Type. The structure is as follows:
Code:

<byte> Map Type
<byte> Battle Background Index
<Half-Word> Padding


An equivalent structure does not seem to exist in Emerald or Ruby.

The routine which reads the table has a maximum of 7 elements it will attempt to check the map type against. This table can be extended by repointing it and increasing the byte value at 0800F254. In theory, this can allow forcing particular environments in a map for wild/trainer battles. This table is only ever read if the Fight Type is not index 0 (Random in A-Map), and it overrides environments from tile types (ie all grass, water, cave, trainer etc battles will be forced). In theory you could also add additional battle backgrounds by extending the structure array at 0824EE34.

So, this? :v

BluRose January 8th, 2017 5:32 PM

Quote:

Originally Posted by Megax Rocker (Post 9538125)
Is there a way to make Wobuffet and Maril/Azumaril always breed their baby forms without the need of the Incense items to be held? Essentially making them behave like Pikachu and pichu?

idk if the previous answer actually works (it seems like it wouldn't because there's literally a func handling this) but here's a definite one (fire red)
45FA8 - wynaut's index (1/2 value)
45FB0, 45FE6 - azurill's index (1/2 value)
45FD8, 45FDC - lax incense index
45FE0 - wobbuffet index
45FEE , 45FF2 - sea incense index
45FF6 - marill index
so the way this works is it checks for the species in the egg. if it matches with wynaut or azurill, it checks the held items of the padres. if this matches, it does nothing, if it doesn't, it changes the index to the correct one.

the "fix?" write 00 to 45FA8, 45FB0, and 45FE6. this just changes the pokémon to check for, making the pokémon with index 0 the required pokémon to do the checks. since you never encounter 0, you won't rewlly run into a problem (but it is theoretically possible to have your 00 turn into wobbuffet/marill if you use like cheats to get it smh)
Quote:

Originally Posted by ShyGuy25 (Post 9540962)
Does anyone know how to remove the 10% stat boosts given by badges in Fire Red?

Open up any Pokemon editor and remove the "breeding only" in the evolutions tab for Wobbuffet, Marill and Azumarill. Its very simple.

flag checks in the damage calc for this (don't know where speed is)
3EE1C - boulderbadge check (atk)
3EE50 - soulbadge check (def)
3EE86 - volcanobadge (sp. atk)
3EEBE - volcanobadge (sp. def)
as for speed i'm too lazy to find it :(

Megax Rocker January 8th, 2017 6:11 PM

Quote:

Originally Posted by BluRose (Post 9542547)
idk if the previous answer actually works (it seems like it wouldn't because there's literally a func handling this) but here's a definite one (fire red)
45FA8 - wynaut's index (1/2 value)
45FB0, 45FE6 - azurill's index (1/2 value)
45FD8, 45FDC - lax incense index
45FE0 - wobbuffet index
45FEE , 45FF2 - sea incense index
45FF6 - marill index
so the way this works is it checks for the species in the egg. if it matches with wynaut or azurill, it checks the held items of the padres. if this matches, it does nothing, if it doesn't, it changes the index to the correct one.

the "fix?" write 00 to 45FA8, 45FB0, and 45FE6. this just changes the pokémon to check for, making the pokémon with index 0 the required pokémon to do the checks. since you never encounter 0, you won't rewlly run into a problem (but it is theoretically possible to have your 00 turn into wobbuffet/marill if you use like cheats to get it smh)
flag checks in the damage calc for this (don't know where speed is)
3EE1C - boulderbadge check (atk)
3EE50 - soulbadge check (def)
3EE86 - volcanobadge (sp. atk)
3EEBE - volcanobadge (sp. def)
as for speed i'm too lazy to find it :(

Thanks bro, I really appreciate it.

Froosty January 16th, 2017 8:32 PM

Quote:

Originally Posted by kearnseyboy6 (Post 8271341)
If you want to change a text box permanently navigate to 0x160450. There are pointer to textbox type 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6 etc.

Yes you can use XSE to decompile these scripts and feel free to add in anything you may desire.... permanently!

So you won't have to call the transparency asm in every script you want, it does it automatically.

I checked the pointer,
the first two pointers in the offset you gave somehow account to the "found an item" and "bag is full" events,
but the pointers after that really account to the text box :)

BluRose January 18th, 2017 2:12 PM

esipode's question made me do this and i have exams all throughout this week
my priorities literally do not matter

EDIT: a lot more values that are a lot better and that i'd actually be interested in changing!
shoutouts to esipode again for finding 136684 way before i did

fire red - miscellaneous summary screen values that somewhat make sense
as they appear in my notes:
Spoiler:
Code:

when i say "character limit" it's more accurate to say "loaded amount of characters"

13627E - character limit for shown OT
1362B2 - character limit for OT ID, natively supports 7 before showing NONE at the end
1362C8 - character limit for level shown next to pokémon's name
136378 - character limit for current hp
13639C - character limit for maximum hp
1363FA, 136432, 136468, 13649E, 1364D4 - "something probablyTM" but i haven't found anything that it changes
136534 - character limit for attack
136552 - x-value for stats (signed int but only on background?)
13656E - character limit for defense
1365A4 - character limit for sp. atk
1365DA - character limit for sp. def
136610 - character limit for speed
13664C - character limit for maximum experience
13666A - x-value for both experience values (signed int but only on covered area)
136684 - sets the exp to next level to 0 when the level is this +1
1366C0 - character limit for experience to next level
136992 - character limit for current pp
1369CA - character limit for max pp
136A7E - character limit for base power
136A9C - the accuracy value replaced by --- (0)
136AD4 - character limit for accuracy
136DCE - x-value for text in top left
136DD0 - y-value for text in top left
136E92 - x-value for the level above the sprite
136E94 - y-value for the level above the sprite
136EB2 - x-value for the name above the sprite
136EB4 - y-value for the name above the sprite
136EE0 - x-value for the pokémon gender (female)
136EE2 - y-value for the pokémon gender (female)
136F20 - x-value for the pokémon gender (male)
136F22 - y-value for the pokémon gender (male)
136FD0 - x-value for pokémon name
136FD2 - y-value for pokémon name
136FF2 - x-value for pokédex number
137004 - y-value for pokédex number
13701E - x-value for OT name
137020 - y-value for OT name
13703A - x-value for OT ID
13703C - y-value for OT ID
137056 - x-value for item
137058 - y-value for item
1370C2 - x-value for egg state description
1370C4 - y-value for egg state description
13710A - x-value for hp
137122 - y-value for hp
137136 - x-value for attack
137148 - y-value for attack
13715C - x-value for defense
13716E - y-value for defense
137182 - x-value for special attack
137194 - y-value for special attack
1371A8 - x-value for special defense
1371BA - y-value for special defense
1371CE - x-value for speed
1371E0 - y-value for speed
1371F4 - x-value for current exp
137206 - y-value for current exp
13721A - x-value for exp to next level
13722C - y-value for exp to next level
137B3E - x-value for base power
137B40 - y-value for base power
133B62 - x-value for accuracy
133B64 - y-value for accuracy
137B96 - x-value for move description
137B98 - y-value for move description
137C4A - x-value for ability name
137C4C - y-value for ability name
137C66 - x-value for ability description
137C68 - y-value for ability description
138A80 - x-value for first type
138A82 - y-value for first type
138AA4 - x-value for second type (first screen)
138AA6 - y-value for second type (first screen)
138ADA - x-value for first type (when move selected)
138ADC - y-value for first type (when move selected)
138AFC - x-value for second type (when move selected)
138AFE - y-value for second type (when move selected)
138BB4 - change it to anything lower than 64 to badeggify the team entire
139CF4 - x-value for poké ball shown
139CF6 - y-value for poké ball shown
139E5C - x-value for pokémon icon (when move selected)
139E5E - y-value for pokémon icon (when move selected)
13A028 - x-value for the thing that shows you have selected a move (the red border)
13A154 - initial y-value for the thing that shows you have selected a move (the red border)
note  - the y-value shown on-screen is dependent on position.
0203B16D - position of the move selected
0203B16E - position of the move selected to switch
13A6E6 - partitions on hp bar?
13A904 - exp bar y-value
note  - x is in r1 but values i thought would work aren't
13A9DC - when the pokemon level is this +1, then the exp bar in the summary will not show any progress
13AC24 - pokérus indicator x-value-loaded on direct access
13AC26 - pokérus indicator y-value-loaded on direct access
13AD98 - pokérus indicator x-value-loaded on switching pokémon
13AD9E - pokérus indicator y-value-loaded on switching pokémon
13AE20 - something x-value - same as shiny indicator
13AE22 - something y-value - same as shiny indicator
13AF26 - x-value shiny indicator when move selected
13AF2C - y-value shiny indicator when move selected
13AF40 - shiny indicator x-value
13AF46 - shiny indicator y-value
13B040 - markings x-value
13B046 - markings y-value


i'll organize it sometime or something

EDIT2: but blurose! there are multiple x-values for a few things!
haha ye i know and i have no idea what the difference is, either!
it's important to know that the x- and y-values don't match with what is shown in vba as x-/y-values (usually)

EDIT3: found a few more values
still searching for the x-value to the pokémon sprite itself (likely not hardcoded at this point)

Megax Rocker January 25th, 2017 1:12 PM

Is there a way to make link battles faster, as in making the default text speed set as fast in link battles similar to how the battle mode is always SET in link battles, so basically how to change the default options in link battles?

Panda Face January 29th, 2017 6:27 AM

How to disable paralysis in electricity type pokemon in Emerald?

PurpleOrange January 31st, 2017 9:17 AM

In FireRed, LeafGreen, and Emerald there's the altering cave which only has zubat in, however if you went to an event (whether these events happened varies by sources) it would change them to other pokemon.

However making them change in the game is actually really easy.

For FireRed/LeafGreen:
Code:

setvar 0x4024 0xYY


For Emerald
Code:

setvar 0x403E 0xYY


Replace YY with the following:
Code:

00 (for zubat)
01 (for mareep)
02 (for pineco)
03 (for houndour)
04 (for teddiursa)
05 (for aipom)
06 (for shuckle)
07 (for stantler)
08 (for smeargle)
(Anything above this will result in zubat)


This is worked out from the scripts already in the rom of FRLG and Emerald

FireRed
Spoiler:
'-----------------------
#org 0x489862
setvirtualaddress 0x8489862
addvar 0x4024 0x1
compare 0x4024 0xA
virtualjumpif 0x0 0x848987C
setvar 0x4024 0x0
lock
faceplayer
virtualmsgbox 0x8489887 '"Thank you for using the MYSTERY\nGI..."
waitmsgbox
waitkeypress
release
end

'-----------------------
#org 0x48987C
lock
faceplayer
virtualmsgbox 0x8489887 '"Thank you for using the MYSTERY\nGI..."
waitmsgbox
waitkeypress
release
end


'---------
' Strings
'---------
#org 0x489887
= Thank you for using the MYSTERY\nGIFT System.\pRecently, there have been rumors\nof rare POKéMON appearances.\pThe rumors are about ALTERING\nCAVE on OUTCAST ISLAND.\pWhy not visit there and check if\nthe rumors are indeed true?

Emerald
Spoiler:
'-----------------------
#org 0x6756E3
setvirtualaddress 0x86756E3
addvar 0x403E 0x1
compare 0x403E 0xA
virtualjumpif 0x0 0x86756FD
setvar 0x403E 0x0
lock
faceplayer
virtualmsgbox 0x8675708 '"Thank you for using the MYSTERY\nGI..."
waitmsgbox
waitkeypress
release
end

'-----------------------
#org 0x6756FD
lock
faceplayer
virtualmsgbox 0x8675708 '"Thank you for using the MYSTERY\nGI..."
waitmsgbox
waitkeypress
release
end


'---------
' Strings
'---------
#org 0x675708
= Thank you for using the MYSTERY\nGIFT System.\pThere appears to be a rumor about\nrare POKéMON sightings.\pThe sightings reportedly came from\nthe ALTERING CAVE on ROUTE 103.\pPerhaps it would be worthwhile for\nyou to investigate this rumor.

Panda Face February 1st, 2017 2:07 AM

In Emerald, if type 00 00 00 00 in F978F, it will become BW poison effect. Pokemon will not lose HP by poison in overworld.

PurpleOrange February 1st, 2017 5:03 AM

Another bit of scripting stuff, not sure if this has been documented before. But you're able to give pokemon custom moves without asm.
Code:

setpkmnpp 0xAA 0xBB 0xCC


Where AA is the pokemon's party slot -1
Where BB is the move slot -1
Where CC is the move (in hex)

This is worked out from from the surfing pikachu egg scipt which is already in the ROM (at least in emerald)
Spoiler:
'-----------------------
#org 0x674D3D
setvirtualaddress 0x8674D3D
checkflag 0x1E4
virtualjumpif 0x0 0x8674D4C
jumpram
special2 0x40DD 0x86
compare 0x40DD 0x6
virtualjumpif 0x1 0x8674D73
setflag 0x1E4
virtualcall 0x8674D7E
lock
faceplayer
virtualmsgbox 0x8674DDE '"Thank you for using the MYSTERY\nGI..."
waitmsgbox
waitkeypress
fanfare 0x172
waitfanfare
release
end

'-----------------------
#org 0x674D4C
special2 0x40DD 0x86
compare 0x40DD 0x6
virtualjumpif 0x1 0x8674D73
setflag 0x1E4
virtualcall 0x8674D7E
lock
faceplayer
virtualmsgbox 0x8674DDE '"Thank you for using the MYSTERY\nGI..."
waitmsgbox
waitkeypress
fanfare 0x172
waitfanfare
release
end

'-----------------------
#org 0x674D73
lock
faceplayer
virtualmsgbox 0x8674E6A '"Oh, your party appears to be full.\..."
waitmsgbox
waitkeypress
release
end

'-----------------------
#org 0x674D7E
giveegg 0xAC
setobedience 0x40DD
setcatchlocation 0x40DD 0xFF
compare 0x40DD 0x1
virtualjumpif 0x1 0x8674DC0
compare 0x40DD 0x2
virtualjumpif 0x1 0x8674DC6
compare 0x40DD 0x3
virtualjumpif 0x1 0x8674DCC
compare 0x40DD 0x4
virtualjumpif 0x1 0x8674DD2
compare 0x40DD 0x5
virtualjumpif 0x1 0x8674DD8
return

'-----------------------
#org 0x674DC0
setpkmnpp 0x1 0x2 0x39
return

'-----------------------
#org 0x674DC6
setpkmnpp 0x2 0x2 0x39
return

'-----------------------
#org 0x674DCC
setpkmnpp 0x3 0x2 0x39
return

'-----------------------
#org 0x674DD2
setpkmnpp 0x4 0x2 0x39
return

'-----------------------
#org 0x674DD8
setpkmnpp 0x5 0x2 0x39
return


'---------
' Strings
'---------
#org 0x674DDE
= Thank you for using the MYSTERY\nGIFT System.\pFrom the POKéMON CENTER we\nhave a gift--a POKéMON EGG!\pPlease raise it with love and\nkindness.

#org 0x674E6A
= Oh, your party appears to be full.\pPlease come see me after storing\na POKéMON on a PC.

Deokishisu February 3rd, 2017 6:54 AM

Quote:

Originally Posted by PurpleOrange (Post 9561803)
Another bit of scripting stuff, not sure if this has been documented before. But you're able to give pokemon custom moves without asm.
Code:

setpkmnpp 0xAA 0xBB 0xCC


Where AA is the pokemon's party slot -1
Where BB is the move slot -1
Where CC is the move (in hex)

This is worked out from from the surfing pikachu egg scipt which is already in the ROM (at least in emerald)
Spoiler:
'-----------------------
#org 0x674D3D
setvirtualaddress 0x8674D3D
checkflag 0x1E4
virtualjumpif 0x0 0x8674D4C
jumpram
special2 0x40DD 0x86
compare 0x40DD 0x6
virtualjumpif 0x1 0x8674D73
setflag 0x1E4
virtualcall 0x8674D7E
lock
faceplayer
virtualmsgbox 0x8674DDE '"Thank you for using the MYSTERY\nGI..."
waitmsgbox
waitkeypress
fanfare 0x172
waitfanfare
release
end

'-----------------------
#org 0x674D4C
special2 0x40DD 0x86
compare 0x40DD 0x6
virtualjumpif 0x1 0x8674D73
setflag 0x1E4
virtualcall 0x8674D7E
lock
faceplayer
virtualmsgbox 0x8674DDE '"Thank you for using the MYSTERY\nGI..."
waitmsgbox
waitkeypress
fanfare 0x172
waitfanfare
release
end

'-----------------------
#org 0x674D73
lock
faceplayer
virtualmsgbox 0x8674E6A '"Oh, your party appears to be full.\..."
waitmsgbox
waitkeypress
release
end

'-----------------------
#org 0x674D7E
giveegg 0xAC
setobedience 0x40DD
setcatchlocation 0x40DD 0xFF
compare 0x40DD 0x1
virtualjumpif 0x1 0x8674DC0
compare 0x40DD 0x2
virtualjumpif 0x1 0x8674DC6
compare 0x40DD 0x3
virtualjumpif 0x1 0x8674DCC
compare 0x40DD 0x4
virtualjumpif 0x1 0x8674DD2
compare 0x40DD 0x5
virtualjumpif 0x1 0x8674DD8
return

'-----------------------
#org 0x674DC0
setpkmnpp 0x1 0x2 0x39
return

'-----------------------
#org 0x674DC6
setpkmnpp 0x2 0x2 0x39
return

'-----------------------
#org 0x674DCC
setpkmnpp 0x3 0x2 0x39
return

'-----------------------
#org 0x674DD2
setpkmnpp 0x4 0x2 0x39
return

'-----------------------
#org 0x674DD8
setpkmnpp 0x5 0x2 0x39
return


'---------
' Strings
'---------
#org 0x674DDE
= Thank you for using the MYSTERY\nGIFT System.\pFrom the POKéMON CENTER we\nhave a gift--a POKéMON EGG!\pPlease raise it with love and\nkindness.

#org 0x674E6A
= Oh, your party appears to be full.\pPlease come see me after storing\na POKéMON on a PC.

This has been documented and only works this way for Emerald.


All times are GMT -8. The time now is 8:53 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.