Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring up to date with 2.0F #6

Open
wants to merge 65 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
198c743
Validity checks removal
SaltContainer Apr 12, 2023
ed99c50
Merge branch 'validity-checks' into 2-0-f
SaltContainer Apr 16, 2023
cca16e3
Removed validity check logs
SaltContainer Apr 19, 2023
de50d94
Custom Script Commands framework
SaltContainer Apr 20, 2023
4fe05ea
FormNo check commands
SaltContainer Apr 20, 2023
b26720e
Nature box check command
SaltContainer Apr 20, 2023
d92f621
Refactor and document custom_script.cpp
SaltContainer Apr 20, 2023
3402c7a
Release Pokémon Command
SaltContainer Apr 20, 2023
3930c7b
Fix form seen issues
SaltContainer Apr 21, 2023
92de7b0
Merge branch 'custom-commands' into 2-0-f
SaltContainer Apr 22, 2023
90dc0c3
Add overrides for diploma checks
SaltContainer Apr 22, 2023
775965c
Merge branch '2-0-f' into custom-commands
SaltContainer Apr 22, 2023
0226230
Restore Shiny Charm
SaltContainer Apr 23, 2023
668f4ea
Example Sunyshore gym gear command recreation
SaltContainer Apr 25, 2023
af73bb9
Toggle Box Collider command
SaltContainer Apr 25, 2023
cacbb9d
Reverse Ability Patch and Doubles Fix
SaltContainer Apr 26, 2023
13c9400
Merge branch 'custom-commands' into 2-0-f
SaltContainer Apr 26, 2023
0df9bc7
Merge branch 'item-changes' into 2-0-f
SaltContainer Apr 27, 2023
98a950d
Thief puts items in bag after wild battle
SaltContainer Apr 28, 2023
4af7e3d
Add fadeTime argument to _STOP_EFFECT
SaltContainer May 3, 2023
67d4676
Merge branch 'thief-bag' into 2-0-f
SaltContainer May 3, 2023
99df92b
Re-index custom commands
SaltContainer May 3, 2023
61024a6
Merge branch 'custom-commands' into 2-0-f
SaltContainer May 3, 2023
c6da047
First draft for new encounters methos
SaltContainer May 6, 2023
67ed41d
Finalize new encounter methods
SaltContainer May 8, 2023
e0ec4fc
Infinite Repel
SaltContainer May 8, 2023
04f9c99
Added repel sound to infinite repel
SaltContainer May 8, 2023
1d3aa3c
Merge branch 'encounter-slots' into 2-0-f
SaltContainer May 8, 2023
4609d10
Can't Escape Flag behavior
SaltContainer May 12, 2023
5719706
Merge branch 'cant-escape-flag' into 2-0-f
SaltContainer May 12, 2023
8aa351c
Extended local trades
SaltContainer May 15, 2023
166884c
Mewtwo MK1 Armor form change
SaltContainer May 25, 2023
c2493dc
WIP (crashes on title screen)
SaltContainer May 28, 2023
402514a
Fixed thief crashes + allow wild thief when holding item
SaltContainer May 31, 2023
d8c809c
Fixed form change held item issues
SaltContainer Jun 1, 2023
784e106
Merge branch 'thief-fix' into 2-0-f
SaltContainer Jun 1, 2023
fccd854
Pickup on level caps
SaltContainer Jun 3, 2023
79aabf9
Remove debug 100% pickup
SaltContainer Jun 4, 2023
4d898aa
Merge branch 'pickup-changes' into 2-0-f
SaltContainer Jun 6, 2023
f290464
Merge branch '2-0-f' into local-trades
SaltContainer Jun 7, 2023
99d99dd
Allow custom IVs in trade with tokusei
SaltContainer Jun 7, 2023
81b1861
Add extra data in seikaku and change how IVs are given
SaltContainer Jun 8, 2023
92d88c3
Adjusted Level caps and pickup
SaltContainer Jun 9, 2023
e6d7889
Merge branch 'local-trades' into 2-0-f
SaltContainer Jun 9, 2023
fb2ab3c
Held Items on static encounters
SaltContainer Jun 9, 2023
ad0dfa0
Merge branch 'static-held-items' into 2-0-f
SaltContainer Jun 10, 2023
090e155
Remove broken badge swap
SaltContainer Jun 11, 2023
0425353
Ancient Power handler on Ominous Wind and Silver Wind
SaltContainer Jun 11, 2023
43f6ecb
Merge branch 'small-move-fixes' into 2-0-f
SaltContainer Jun 12, 2023
7e0eeca
Fix reminder TMs
SaltContainer Jun 12, 2023
4275fd1
_INSTALL_CHECK command
SaltContainer Jul 6, 2023
6a83d6e
Merge pull request #1 from SaltContainer/2-0-f
SaltContainer Jul 6, 2023
a1b707c
Remove custom handler for Magnitude
SaltContainer Aug 24, 2023
ef00e98
2.0F Hotfix fixes
SaltContainer Oct 22, 2023
0646e72
Gigaton Hammer
SaltContainer Oct 30, 2023
7e707f0
Gigaton Hammer over Happy Hour
SaltContainer Oct 30, 2023
7ece58a
Unselectable fixes
SaltContainer Nov 6, 2023
fc624d9
Eevee moves
SaltContainer Nov 7, 2023
44d5866
Backport of FFFFFFFF PID fix from ExLaunch
SaltContainer Nov 7, 2023
6cd5ddf
Backport Leek on Sirfetch'd
SaltContainer Nov 7, 2023
7aba216
Finally fixed Magnitude
SaltContainer Nov 8, 2023
1c179e0
Quick Draw and Curious Medicine
SaltContainer Nov 8, 2023
f9b218c
Sp.Atk Flower Gift
SaltContainer Nov 9, 2023
bc73142
Shiny Eggs and Releasable eggs
SaltContainer Mar 13, 2024
a8b0bf4
Fix regional dex counts
SaltContainer Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Held Items on static encounters
  • Loading branch information
SaltContainer committed Jun 9, 2023
commit fb2ab3c9576485029634b0dd506bbfe7a8c68abf
2 changes: 2 additions & 0 deletions include/Pml/PokePara/CoreParam.h
Original file line number Diff line number Diff line change
@@ -83,6 +83,8 @@ namespace Pml
uint8_t GetRareType(MethodInfo * method);
// 2048740
int32_t GetSeikaku(MethodInfo *method);
// 20488a0
int32_t GetTokuseiNo(MethodInfo *method);
// 2045ce0
uint8_t GetTokuseiIndex(MethodInfo *method);
// 2048ac0
2 changes: 2 additions & 0 deletions linkerscripts/symbols.bd_130.ld
Original file line number Diff line number Diff line change
@@ -468,3 +468,5 @@ _ZN3Pml8PokePara9CoreParam17ChangeTalentPowerEijP10MethodInfo = 0x020446e0 - 0x0

_ZN11UnityEngine6Random5RangeEiiP10MethodInfo = 0x026941e0 - 0x05708000;
_ZN8GameData20DataManager_TypeInfoE = 0x04c59d70 - 0x05708000;

_ZN3Pml8PokePara9CoreParam12GetTokuseiNoEP10MethodInfo = 0x020488a0 - 0x05708000;
5 changes: 5 additions & 0 deletions patches/static_held_items.slpatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[target=main, version=bd_130]
// Replace call to Pml.PokeParty$$GetMemberPointer in FieldManager$$EventWildBattle
// Dpr.EncountTools$$SetWildPokemonItem is called within
0179f85c:
bl EventWildBattle_SetWildPokemonItem
53 changes: 53 additions & 0 deletions src/patches/static_held_items.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include "il2cpp.hpp"

#include "Dpr/EncountTools.hpp"
#include "PlayerWork.hpp"
#include "Pml/PokePara/CoreParam.h"
#include "Pml/PokePara/PokemonParam.h"
#include "Pml/PokeParty.hpp"
#include "UnityEngine/Random.hpp"

#include "util.hpp"
#include "logger.hpp"

const int32_t SUPERLUCK_ABILITYNO = 105;
const int32_t COMPOUNDEYES_ABILITYNO = 14;

const int32_t ITEM1_BASERATE = 50;
const int32_t ITEM1_BOOSTEDRATE = 60;
const int32_t ITEM2_BASERATE = 20;
const int32_t ITEM2_BOOSTEDRATE = 20;

Pml::PokePara::PokemonParam_o * EventWildBattle_SetWildPokemonItem(Pml::PokeParty_o *__this, uint32_t idx, MethodInfo *method)
{
system_load_typeinfo((void *)0x3f8c);

int32_t item1Rate = ITEM1_BASERATE;
int32_t item2Rate = ITEM2_BASERATE;

Pml::PokeParty_o * party = PlayerWork::get_playerParty(nullptr);
Pml::PokePara::CoreParam * firstPoke = (Pml::PokePara::CoreParam *) party->GetMemberPointer(0, nullptr);
if (!firstPoke->IsEgg(2, nullptr))
{
int32_t ability = firstPoke->GetTokuseiNo(nullptr);
switch (ability)
{
case SUPERLUCK_ABILITYNO:
case COMPOUNDEYES_ABILITYNO:
item1Rate = ITEM1_BOOSTEDRATE;
item2Rate = ITEM2_BOOSTEDRATE;
break;
default:
item1Rate = ITEM1_BASERATE;
item2Rate = ITEM2_BASERATE;
break;
}
}

Pml::PokePara::CoreParam * enemyPoke = (Pml::PokePara::CoreParam *) __this->GetMemberPointer(0, nullptr);
int32_t randomRoll = UnityEngine::Random::Range(0, 100, nullptr);

Dpr::EncountTools::SetWildPokemonItem(enemyPoke, randomRoll, item1Rate, item2Rate, nullptr);

return __this->GetMemberPointer(idx, method);
}