Tyranitar to level 100.

This commit is contained in:
Sergiotarxz 2023-11-04 17:15:58 +01:00
parent ba2a735551
commit cd5fc44860
11 changed files with 178 additions and 13 deletions

BIN
claydol.gba Normal file

Binary file not shown.

BIN
claydol.sav Normal file

Binary file not shown.

37
examples/modifyHadler.pl Normal file
View File

@ -0,0 +1,37 @@
#!/usr/bin/env perl
use v5.34.1;
use strict;
use warnings;
use feature 'signatures';
use Rsaves
qw/read_save check_correct_size get_saves find_current_save_index check_correct_size find_pokemon_substruct change_gender read_pc_storage save_pc_changes enable_eon_ticket save_changes pokemon_set_shiny read_pkm_file_box enable_mirage_island_for_pokemon parse_version_name pokemon_fill_pp to_3rd_encoding translate_3rd_encoding/;
use Rsaves::Constants::Global
qw/$MOVE_SPIKES $MOVE_DRILL_PECK $MOVE_HIDDEN_POWER $MOVE_TAUNT $MOVE_THUNDERBOLT $MOVE_ROAR $MOVE_THUNDER_WAVE $ITEM_LEFTOVERS $MOVE_DRAGON_DANCE $MOVE_ROCK_SLIDE $MOVE_EARTHQUAKE $MOVE_TAUNT $MOVE_FLAMETHROWER $MOVE_WILL_O_WISP $MOVE_HYDRO_PUMP $MOVE_ICE_BEAM $MOVE_FOCUS_PUNCH $MOVE_PSYCHIC $MOVE_FIRE_PUNCH $MOVE_WISH $MOVE_PROTECT $MOVE_TOXIC $MOVE_LEECH_SEED $MOVE_RECOVER/;
use Rsaves::Constants::Ruby::Global qw/$MALE $FEMALE/;
my $input = $ARGV[0] or die "No input save";
my $output = $ARGV[1] or die "No output save";
my $version = parse_version_name( $ARGV[2] ) // parse_version_name('ruby');
sub start {
my ( @saves_raw, $extra );
( @saves_raw[ 0, 1 ], $extra ) = read_save($input);
my @saves = get_saves( @saves_raw, $version );
my $current_save_index = find_current_save_index(@saves);
my $save = $saves[$current_save_index];
my $pc = read_pc_storage($save);
my $box = $pc->{boxes}[0];
my @pokemons = $box->@[0..5];
for my $pokemon (@pokemons) {
$pokemon->{substructures}[0]{held_item} = $ITEM_LEFTOVERS;
}
save_pc_changes( $save, $pc );
save_changes( @saves, $extra, $output );
}
start;

View File

@ -9,7 +9,7 @@ use feature 'signatures';
use Rsaves
qw/read_save check_correct_size get_saves find_current_save_index check_correct_size find_pokemon_substruct change_gender read_pc_storage save_pc_changes enable_eon_ticket save_changes pokemon_set_shiny read_pkm_file_box enable_mirage_island_for_pokemon parse_version_name pokemon_fill_pp to_3rd_encoding translate_3rd_encoding/;
use Rsaves::Constants::Global
qw/$MOVE_SPIKES $MOVE_DRILL_PECK $MOVE_HIDDEN_POWER $MOVE_TAUNT $MOVE_THUNDERBOLT $MOVE_ROAR $MOVE_THUNDER_WAVE $ITEM_LEFTOVERS $MOVE_DRAGON_DANCE $MOVE_ROCK_SLIDE $MOVE_EARTHQUAKE $MOVE_TAUNT $MOVE_FLAMETHROWER $MOVE_WILL_O_WISP $MOVE_HYDRO_PUMP $MOVE_ICE_BEAM $MOVE_FOCUS_PUNCH $MOVE_PSYCHIC $MOVE_FIRE_PUNCH $MOVE_WISH $MOVE_PROTECT $MOVE_TOXIC $MOVE_LEECH_SEED $MOVE_RECOVER/;
qw/$MOVE_SPIKES $MOVE_DRILL_PECK $MOVE_HIDDEN_POWER $MOVE_TAUNT $MOVE_THUNDERBOLT $MOVE_ROAR $MOVE_THUNDER_WAVE $ITEM_LEFTOVERS $MOVE_DRAGON_DANCE $MOVE_ROCK_SLIDE $MOVE_EARTHQUAKE $MOVE_TAUNT $MOVE_FLAMETHROWER $MOVE_WILL_O_WISP $MOVE_HYDRO_PUMP $MOVE_ICE_BEAM $MOVE_FOCUS_PUNCH $MOVE_PSYCHIC $MOVE_FIRE_PUNCH $MOVE_WISH $MOVE_PROTECT $MOVE_TOXIC $MOVE_LEECH_SEED $MOVE_RECOVER $MOVE_RAPID_SPIN $MOVE_EXPLOSION $MOVE_SURF $MOVE_REFRESH/;
use Rsaves::Constants::Ruby::Global qw/$MALE $FEMALE/;
@ -29,10 +29,14 @@ sub start {
my $celebi = $pc->{boxes}[13][1];
my $jirachi = $pc->{boxes}[13][2];
my $claydol = $pc->{boxes}[13][3];
my $milotic = $pc->{boxes}[13][4];
my $tyranitar = $pc->{boxes}[13][5];
modifyJirachi($jirachi);
modifyCelebi($celebi);
modifySkarmory($skarmory);
modifyClaydol($claydol);
modifyMilotic($milotic);
modifyTyranitar($tyranitar);
# modifyJolteon($jolteon);
# modifyLarvitar($larvitar);
@ -44,6 +48,8 @@ sub start {
pokemon_fill_pp($celebi);
pokemon_fill_pp($skarmory);
pokemon_fill_pp($claydol);
pokemon_fill_pp($milotic);
pokemon_fill_pp($tyranitar);
# pokemon_fill_pp($larvitar);
# pokemon_fill_pp($moltres);
@ -54,11 +60,9 @@ sub start {
save_changes( @saves, $extra, $output );
}
sub modifyClaydol ($pokemon) {
$pokemon->{personality} = 0xAB1B5E9E;
sub modifyTyranitar ($pokemon) {
$pokemon->{personality} = 0x9CF2063B;
$hi_otid = $hi_personality ^ $lo_personality ^ 6 ^ $lo_otid;
$pokemon->{otid} = ( $hi_otid << 16 ) | $lo_otid;
my $ivs_egg_status_and_ability =
$pokemon->{substructures}[3]{ivs_egg_status_and_ability};
@ -74,7 +78,54 @@ sub modifyClaydol ($pokemon) {
(
$iv_hp, $iv_attack, $iv_defense, $iv_special_attack,
$iv_special_defense, $iv_speed, $ability
) = ( 29, 30, 31, 30, 31, 31, 0 );
) = ( 31, 30, 30, 23, 30, 31, 0 );
$ivs_egg_status_and_ability = 0;
$ivs_egg_status_and_ability |= ( ( $ability & 1 ) << 31 );
$ivs_egg_status_and_ability |= ( ( $egg & 1 ) << 30 );
$ivs_egg_status_and_ability |= ( ( $iv_special_defense & 0x1F ) << 25 );
$ivs_egg_status_and_ability |= ( ( $iv_special_attack & 0x1F ) << 20 );
$ivs_egg_status_and_ability |= ( ( $iv_speed & 0x1F ) << 15 );
$ivs_egg_status_and_ability |= ( ( $iv_defense & 0x1F ) << 10 );
$ivs_egg_status_and_ability |= ( ( $iv_attack & 0x1F ) << 5 );
$ivs_egg_status_and_ability |= ( ( $iv_hp & 0x1F ) );
$pokemon->{substructures}[3]{ivs_egg_status_and_ability} =
$ivs_egg_status_and_ability;
$pokemon->{substructures}[2]{hp_ev} = 240;
$pokemon->{substructures}[2]{attack_ev} = 232;
$pokemon->{substructures}[2]{defense_ev} = 0;
$pokemon->{substructures}[2]{special_attack_ev} = 0;
$pokemon->{substructures}[2]{special_defense_ev} = 0;
$pokemon->{substructures}[2]{speed_ev} = 36;
$pokemon->{substructures}[1]{movements}[0] = $MOVE_FOCUS_PUNCH;
$pokemon->{substructures}[1]{movements}[1] = $MOVE_ROCK_SLIDE;
$pokemon->{substructures}[1]{movements}[2] = $MOVE_EARTHQUAKE;
$pokemon->{substructures}[1]{movements}[3] = $MOVE_HIDDEN_POWER;
$pokemon->{substructures}[0]{held_item} = $ITEM_LEFTOVERS;
$pokemon->{substructures}[0]{experience} = 1_250_000;
}
sub modifyMilotic ($pokemon) {
$pokemon->{personality} = 0x85F1BE0B;
my $ivs_egg_status_and_ability =
$pokemon->{substructures}[3]{ivs_egg_status_and_ability};
my $ability = $ivs_egg_status_and_ability >> 31 & 1;
my $egg = $ivs_egg_status_and_ability >> 30 & 1;
my $iv_special_defense = $ivs_egg_status_and_ability >> 25 & 0x1F;
my $iv_special_attack = $ivs_egg_status_and_ability >> 20 & 0x1F;
my $iv_speed = $ivs_egg_status_and_ability >> 15 & 0x1F;
my $iv_defense = $ivs_egg_status_and_ability >> 10 & 0x1F;
my $iv_attack = $ivs_egg_status_and_ability >> 5 & 0x1F;
my $iv_hp = $ivs_egg_status_and_ability >> 0 & 0x1F;
(
$iv_hp, $iv_attack, $iv_defense, $iv_special_attack,
$iv_special_defense, $iv_speed, $ability
) = ( 30, 31, 30, 30, 31, 31, 0 );
$ivs_egg_status_and_ability = 0;
$ivs_egg_status_and_ability |= ( ( $ability & 1 ) << 31 );
@ -90,17 +141,64 @@ sub modifyClaydol ($pokemon) {
$pokemon->{substructures}[2]{hp_ev} = 248;
$pokemon->{substructures}[2]{attack_ev} = 0;
$pokemon->{substructures}[2]{defense_ev} = 80;
$pokemon->{substructures}[2]{defense_ev} = 212;
$pokemon->{substructures}[2]{special_attack_ev} = 0;
$pokemon->{substructures}[2]{special_defense_ev} = 44;
$pokemon->{substructures}[2]{speed_ev} = 136;
$pokemon->{substructures}[2]{special_defense_ev} = 0;
$pokemon->{substructures}[2]{speed_ev} = 48;
$pokemon->{substructures}[1]{movements}[0] = $MOVE_PSYCHIC;
$pokemon->{substructures}[1]{movements}[1] = $MOVE_HIDDEN_POWER;
$pokemon->{substructures}[1]{movements}[2] = $MOVE_LEECH_SEED;
$pokemon->{substructures}[1]{movements}[0] = $MOVE_SURF;
$pokemon->{substructures}[1]{movements}[1] = $MOVE_TOXIC;
$pokemon->{substructures}[1]{movements}[2] = $MOVE_REFRESH;
$pokemon->{substructures}[1]{movements}[3] = $MOVE_RECOVER;
$pokemon->{substructures}[0]{held_item} = $ITEM_LEFTOVERS;
$pokemon->{substructures}[0]{experience} = 1_059_862;
$pokemon->{substructures}[0]{experience} = 600_000;
}
sub modifyClaydol ($pokemon) {
$pokemon->{personality} = 0x61A47352;
my $ivs_egg_status_and_ability =
$pokemon->{substructures}[3]{ivs_egg_status_and_ability};
my $ability = $ivs_egg_status_and_ability >> 31 & 1;
my $egg = $ivs_egg_status_and_ability >> 30 & 1;
my $iv_special_defense = $ivs_egg_status_and_ability >> 25 & 0x1F;
my $iv_special_attack = $ivs_egg_status_and_ability >> 20 & 0x1F;
my $iv_speed = $ivs_egg_status_and_ability >> 15 & 0x1F;
my $iv_defense = $ivs_egg_status_and_ability >> 10 & 0x1F;
my $iv_attack = $ivs_egg_status_and_ability >> 5 & 0x1F;
my $iv_hp = $ivs_egg_status_and_ability >> 0 & 0x1F;
(
$iv_hp, $iv_attack, $iv_defense, $iv_special_attack,
$iv_special_defense, $iv_speed, $ability
) = ( 30, 28, 30, 31, 30, 31, 0 );
$ivs_egg_status_and_ability = 0;
$ivs_egg_status_and_ability |= ( ( $ability & 1 ) << 31 );
$ivs_egg_status_and_ability |= ( ( $egg & 1 ) << 30 );
$ivs_egg_status_and_ability |= ( ( $iv_special_defense & 0x1F ) << 25 );
$ivs_egg_status_and_ability |= ( ( $iv_special_attack & 0x1F ) << 20 );
$ivs_egg_status_and_ability |= ( ( $iv_speed & 0x1F ) << 15 );
$ivs_egg_status_and_ability |= ( ( $iv_defense & 0x1F ) << 10 );
$ivs_egg_status_and_ability |= ( ( $iv_attack & 0x1F ) << 5 );
$ivs_egg_status_and_ability |= ( ( $iv_hp & 0x1F ) );
$pokemon->{substructures}[3]{ivs_egg_status_and_ability} =
$ivs_egg_status_and_ability;
$pokemon->{substructures}[2]{hp_ev} = 4;
$pokemon->{substructures}[2]{attack_ev} = 252;
$pokemon->{substructures}[2]{defense_ev} = 0;
$pokemon->{substructures}[2]{special_attack_ev} = 0;
$pokemon->{substructures}[2]{special_defense_ev} = 0;
$pokemon->{substructures}[2]{speed_ev} = 252;
$pokemon->{substructures}[1]{movements}[0] = $MOVE_EARTHQUAKE;
$pokemon->{substructures}[1]{movements}[1] = $MOVE_RAPID_SPIN;
$pokemon->{substructures}[1]{movements}[2] = $MOVE_PSYCHIC;
$pokemon->{substructures}[1]{movements}[3] = $MOVE_EXPLOSION;
$pokemon->{substructures}[0]{held_item} = $ITEM_LEFTOVERS;
$pokemon->{substructures}[0]{experience} = 1_000_000;
}
sub modifyCelebi ($pokemon) {
my $hi_otid = _hihalf_u32( $pokemon->{otid} );

30
findShinyJirachi.pl Normal file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env perl
use v5.36.0;
use strict;
use warnings;
open my $fh, '<', $ENV{HOME} . '/PokeFinder/jirachi';
while (my $line = <$fh>) {
my ($seed, $pid, $hpp) = [split ',', $line]->@[0,1,12];
my $tid = 40122;
my $sid = 29153;
$pid = hex($pid) + 0;
my $shiny_value = (_hihalf_u32($pid) ^ _lowhalf_u32($pid) ^ $sid ^ $tid);
say $shiny_value;
if ($shiny_value < 8 && $hpp > 65) {
say $line;
}
}
sub _hihalf_u32 {
my $n = shift;
return ( ( $n & 0xFFFF0000 ) >> 16 );
}
sub _lowhalf_u32 {
my $n = shift;
return ( $n & 0xFFFF );
}

BIN
hadlerliga.sav Normal file

Binary file not shown.

BIN
milotic.gba Normal file

Binary file not shown.

BIN
milotic.sav Normal file

Binary file not shown.

BIN
ruby.sav

Binary file not shown.

BIN
tyranitar.gba Normal file

Binary file not shown.

BIN
tyranitar.sav Normal file

Binary file not shown.