diff --git a/include/AnimationPlayer.hpp b/include/AnimationPlayer.hpp new file mode 100644 index 000000000..aadb875ae --- /dev/null +++ b/include/AnimationPlayer.hpp @@ -0,0 +1,43 @@ +#pragma once + +#include "il2cpp.hpp" + +struct AnimationPlayer_Fields +{ + // TODO: Add fields and dependencies +}; + +struct AnimationPlayer_RGCTXs +{ +}; + +struct AnimationPlayer_VTable +{ + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; +}; + +struct AnimationPlayer_c +{ + Il2CppClass_1 _1; + struct AnimationPlayer_StaticFields* static_fields; + AnimationPlayer_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + AnimationPlayer_VTable vtable; +}; + +struct AnimationPlayer_o +{ + AnimationPlayer_c *klass; + void *monitor; + AnimationPlayer_Fields fields; + + // 0211e9b0 + void Play (int32_t index, float duration, float startTime, MethodInfo *method); +}; + +struct AnimationPlayer_StaticFields +{ +}; diff --git a/include/AttributeID.hpp b/include/AttributeID.hpp new file mode 100644 index 000000000..cd0356852 --- /dev/null +++ b/include/AttributeID.hpp @@ -0,0 +1,7 @@ +#pragma once + +struct AttributeID +{ + // 021267d0 + static bool MATR_IsWater(int32_t matr_code, MethodInfo *method); +}; diff --git a/include/Audio/AudioInstance.hpp b/include/Audio/AudioInstance.hpp new file mode 100644 index 000000000..21e9be2bd --- /dev/null +++ b/include/Audio/AudioInstance.hpp @@ -0,0 +1,60 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Audio +{ + struct AudioInstance_Fields + { + struct AkGameObj_o* _akGameObj; + int32_t _listenerType; + uint32_t _playEventId; + uint32_t _stopEventId; + struct UnityEngine_Transform_o* _attachedTransform; + struct UnityEngine_Vector3_o _localPosition; + struct UnityEngine_Quaternion_o _localRotation; + struct UnityEngine_Events_UnityAction_AudioInstance__o* _onFinished; + float _volume; + uint32_t _playId; + float _duration; + bool _isDurtyRtpc; + bool _isManualRemoved; + int32_t _stateBits; + }; + + struct AudioInstance_RGCTXs + { + }; + + struct AudioInstance_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + VirtualInvokeData _4_IObjectPoolInstance_SetGameObject; + VirtualInvokeData _5_IObjectPoolInstance_GetGameObject; + VirtualInvokeData _6_IObjectPoolInstance_OnCreate; + VirtualInvokeData _7_IObjectPoolInstance_OnRelease; + }; + + struct AudioInstance_c + { + Il2CppClass_1 _1; + struct AudioInstance_StaticFields* static_fields; + AudioInstance_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + AudioInstance_VTable vtable; + }; + + struct AudioInstance_o + { + AudioInstance_c *klass; + void *monitor; + AudioInstance_Fields fields; + }; + + struct AudioInstance_StaticFields + { + }; +} diff --git a/include/Audio/AudioManager.hpp b/include/Audio/AudioManager.hpp new file mode 100644 index 000000000..e4f4324dc --- /dev/null +++ b/include/Audio/AudioManager.hpp @@ -0,0 +1,68 @@ +#pragma once + +#include "il2cpp.hpp" +#include "Audio/AudioInstance.hpp" +#include "UnityEngine/GameObject.hpp" + +struct SmartPoint_AssetAssistant_SingletonMonoBehaviour_AudioManager__Fields { + UnityEngine_MonoBehaviour_Fields super; +}; + +namespace Audio +{ + struct AudioManager_Fields + { + SmartPoint_AssetAssistant_SingletonMonoBehaviour_AudioManager__Fields super; + struct UnityEngine::GameObject_o* _prefab; + struct System_Int32_array* _poolCounts; + struct UnityEngine_Transform_o* _listenerRoot; + struct System_String_o* _commonBankName; + struct System_Collections_Generic_List_AudioManager_ListenerParam__o* _listenerParams; + struct System_Collections_Generic_List_AudioInstance__o* _audioInstances; + struct ObjectPool_AudioManager_PoolType__AudioInstance__o* _objectPool; + struct System_Collections_Generic_HashSet_AudioData__o* _audioDatas; + uint32_t _eventId; + uint32_t _bgmPlayId; + bool _isUpdateListenerCamera; + float _duration; + struct UnityEngine_Events_UnityAction_uint__o* onFinishBgm; + int32_t _configVoice; + }; + + struct AudioManager_RGCTXs + { + }; + + struct AudioManager_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + VirtualInvokeData _4_Awake; + VirtualInvokeData _5_OnApplicationQuit; + }; + + struct AudioManager_c + { + Il2CppClass_1 _1; + struct AudioManager_StaticFields* static_fields; + AudioManager_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + AudioManager_VTable vtable; + }; + + struct AudioManager_o + { + AudioManager_c *klass; + void *monitor; + AudioManager_Fields fields; + + // 021eb8d0 + AudioInstance_o * PlaySe(uint32_t playEventId, void *onFinished, MethodInfo *method); + }; + + struct AudioManager_StaticFields + { + }; +} diff --git a/include/BaseEntity.hpp b/include/BaseEntity.hpp new file mode 100644 index 000000000..40f886238 --- /dev/null +++ b/include/BaseEntity.hpp @@ -0,0 +1,62 @@ +#pragma once + +#include "il2cpp.hpp" + +struct BaseEntity_Fields +{ + UnityEngine_MonoBehaviour_Fields super; + struct System_String_o* _enityName; + bool _alreadyRegistered; + float yawAngle; + struct UnityEngine_Vector3_o worldPosition; + float savedYawAngle; + struct UnityEngine_Vector3_o savedPosition; + struct UnityEngine_Vector3_o _beforePosition_k__BackingField; + struct UnityEngine_Transform_o* _cacheTransform; + int32_t _currentSequence_k__BackingField; + int32_t _nextSequence_k__BackingField; + float _sequenceTime_k__BackingField; + struct BaseEntity_o* _target_k__BackingField; +}; + +struct BaseEntity_RGCTXs +{ +}; + +struct BaseEntity_VTable +{ + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + VirtualInvokeData _4_get_entityType; + VirtualInvokeData _5_GetAnimationPlayer; + VirtualInvokeData _6_Awake; + VirtualInvokeData _7_OnEnable; + VirtualInvokeData _8_OnDisable; + VirtualInvokeData _9_OnDestroy; + VirtualInvokeData _10_OnUpdate; + VirtualInvokeData _11_OnLateUpdate; + VirtualInvokeData _12_SwitchToNext; + VirtualInvokeData _13_ProcessSequence; +}; + +struct BaseEntity_c +{ + Il2CppClass_1 _1; + struct BaseEntity_StaticFields* static_fields; + BaseEntity_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + BaseEntity_VTable vtable; +}; + +struct BaseEntity_o +{ + BaseEntity_c *klass; + void *monitor; + BaseEntity_Fields fields; +}; + +struct BaseEntity_StaticFields +{ +}; diff --git a/include/DpData.hpp b/include/DpData.hpp index 4721f6dbe..b0a21a2df 100644 --- a/include/DpData.hpp +++ b/include/DpData.hpp @@ -3,6 +3,7 @@ #include "System/Array.hpp" #include "System/String.hpp" +#include "Pml/PokePara/SavePokeParty.hpp" #include "il2cpp.hpp" namespace DPData @@ -936,7 +937,7 @@ namespace DPData int32_t ReturnGridPosZ; struct LOCATION_WORK_o ReturnZenmetsu_Ground; struct DigPos_array* DigPoints; - struct Pml::PokePara::SerializedPokemonFull_array* EncountPokes; + Pml::PokePara::SerializedPokemonFull_array* EncountPokes; struct UnityEngine_Vector3_array* EncountPokePositions; int32_t ReturnUgZoneID; struct UGRecord_o ugRecord; @@ -1313,4 +1314,4 @@ namespace DPData } -#endif \ No newline at end of file +#endif diff --git a/include/Dpr/Battle/Logic/BTLV_STRPARAM.hpp b/include/Dpr/Battle/Logic/BTLV_STRPARAM.hpp new file mode 100644 index 000000000..0da333d10 --- /dev/null +++ b/include/Dpr/Battle/Logic/BTLV_STRPARAM.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct BTLV_STRPARAM_Fields { + uint16_t strID; + uint8_t wait; + uint8_t strType; + uint8_t argCnt; + struct System_Int32_array* args; + }; + + struct BTLV_STRPARAM_c; + + struct BTLV_STRPARAM_o { + BTLV_STRPARAM_c *klass; + void *monitor; + BTLV_STRPARAM_Fields fields; + }; + } + } +} \ No newline at end of file diff --git a/include/Dpr/Battle/Logic/BTL_CLIENT.hpp b/include/Dpr/Battle/Logic/BTL_CLIENT.hpp index 50063d605..72fb4cf02 100644 --- a/include/Dpr/Battle/Logic/BTL_CLIENT.hpp +++ b/include/Dpr/Battle/Logic/BTL_CLIENT.hpp @@ -2,6 +2,7 @@ #include "il2cpp.hpp" #include "Dpr/Battle/Logic/BTL_POKEPARAM.hpp" +#include "Dpr/Battle/Logic/ServerSendData.hpp" namespace Dpr { @@ -9,8 +10,131 @@ namespace Dpr { namespace Logic { + struct BTL_CLIENT_Fields + { + struct MainModule_o* m_mainModule; + struct BattleEnv_o* m_pBattleEnv; + struct BTL_POKEPARAM_o* m_procPoke; + uint8_t m_actCountSum; + int32_t m_procActionIndex; + struct BTL_ACTION_PARAM_OBJ_o* m_procActionUIRet; + int32_t m_currentActionIndex; + struct rec_Data_o* m_recData; + struct rec_Reader_o* m_btlRecReader; + struct BTL_CLIENT_RECPLAYER_CONTROL_o* m_recPlayer; + struct BTL_CLIENT_ClientMainProc_o* m_mainProc; + struct FieldStatus_o* m_fldSim; + uint64_t m_randContext; + struct Adapter_o* m_adapter; + struct SendDataContainer_o* m_sendDataContainer; + struct SendDataContainer_o* m_receiveDataContainer; + struct Random_o* m_random; + struct Random_o* m_AIRand; + struct TrainerMessageManager_o* m_trainerMessageManager; + struct ClientSeq_TrainerMessage_o* m_seq_TrainerMessage; + struct ClientSeq_WinWild_o* m_seq_WinWild; + struct ClientSeq_Capture_o* m_seq_Capture; + struct BattleSimulator_o* m_battleSimulator; + struct BattleDriver_o* m_battleDriver; + struct ServerCommandQueue_o* m_serverCmdQueue; + struct GameTimer_o* m_gameTimer; + struct ServerSendData_CLIENT_LIMIT_TIME_o m_syncClientTime; + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT_o m_raidBossCaptureResult; + uint32_t m_turnCount; + uint16_t m_EnemyPokeHPBase; + struct BTL_CLIENT_SEL_ITEM_WORK_array* m_selItemWork; + uint8_t m_myID; + uint8_t m_myType; + uint8_t m_myState; + bool m_commWaitInfoOn; + uint8_t m_bagMode; + uint8_t* m_change_escape_code; + bool m_fForceQuitSelAct; + uint8_t m_cmdCheckTimingCode; + struct System_Byte_array* m_actionCountWork; + uint8_t m_wazaInfoPokeIdx; + uint8_t m_wazaInfoWazaIdx; + bool m_fAITrainerBGMChanged; + bool m_fCommError; + bool m_fSelActForceFinish; + bool m_fCmdCheckEnable; + bool m_fRecPlayEndTimeOver; + bool m_fRecPlayEndBufOver; + bool m_bRecPlayFadeStarted; + bool m_isWaitingAdapterCommand; + bool m_isGSelectedThisTurn; + bool m_isFirstActionSelectDone; + uint8_t m_myChangePokeCnt; + uint8_t m_myPuttablePokeCnt; + struct BtlPokePos_array* m_myChangePokePos; + uint16_t m_returnDataSerialNumber; + uint8_t m_returnDataServerSeq; + uint8_t m_returnDataServerRequest; + void* m_returnDataPtr; + uint32_t m_returnDataSize; + uint32_t* m_dummyReturnData; + struct ClientSendData_ACTION_SELECT_o* m_returnData_ActionSelect; + struct ClientSendData_CLIENT_LIMIT_TIME_o* m_returnData_ClientLimitTime; + struct ClientSendData_RAID_BALL_SELECT_o* m_returnData_RaidBallSelect; + uint16_t m_cmdLimitTime; + uint16_t m_gameLimitTime; + uint16_t m_clientLimitTime; + struct BTL_PARTY_o* m_myParty; + uint8_t m_procPokeIdx; + uint8_t m_procPokeActIdx; + int8_t m_prevPokeIdx; + uint8_t m_firstPokeIdx; + bool m_fStdMsgChanged; + bool m_b1stReadyMsgDisped; + struct BTL_SERVER_o* m_cmdCheckServer; + struct BattleViewBase_o* _m_viewCore; + struct BattleViewBase_ExpGetDesc_o* m_viewExpGetDesc; + struct BattleViewBase_ExpGetResult_o* m_viewExpGetResult; + struct BTL_ACTION_PARAM_array* m_actionParam; + struct System_Int32_array* m_cmdArgs; + struct BTL_CLIENT_VariableArgs_o* m_stdVariableArgs; + struct BTL_CLIENT_VariableArgs_o* m_tmpVariableArgs; + struct BattleAi_o* m_ai; + struct System_UInt16_array* m_AIItem; + struct System_SByte_array* m_AIChangeIndex; + struct System_Boolean_array* m_AITrainerMsgCheckedFlag; + struct BTL_CLIENT_ClientSubProc_o* m_subProc; + int32_t m_subSeq; + struct BTL_CLIENT_ClientSubProc_o* m_selActProc; + int32_t m_selActSeq; + struct BTLV_STRPARAM_o* m_strParam; + struct BTLV_STRPARAM_o* m_strParamSub; + struct PokeSelParam_o* m_pokeSelParam; + struct PokeSelResult_o* m_pokeSelResult; + struct BTL_CLIENT_ServerCmdProc_o* m_scProc; + uint16_t m_serverCmd; + int32_t m_scSeq; + struct BtlPokePos_array* m_deadPokePos; + bool m_isLiveRecSeedSetup; + uint32_t m_liveRecWaitCameraSeq; + uint32_t m_liveRecSizeSave; + struct BTL_CLIENT_WAZAEFF_SYNCDAMAGE_CMD_WORK_o* m_wazaEffDmgSyncWork; + bool m_bWazaEffectDone; + bool m_bSyncEffectDone; + struct BTL_CLIENT_FriendshipEffectProc_o* m_frEffectProc; + uint32_t m_JK3Joker_PrevTurnAttackToLegends; + uint32_t m_JK3Legend_PrevTurnUseKyozyuuzan; + int32_t scProc_MSG_StdSE_subSeq; + int32_t scProc_MSG_SetSE_subSeq; + uint32_t scProc_ACT_KinomiPrevWaza_procIdx; + int32_t scProc_ACT_FriendshipEffectMsg_effSeq; + int32_t scProc_ACT_FriendshipEffectMsg_msgSeq; + uint32_t scProc_ACTOP_SwapTokusei_timer; + }; + + struct BTL_CLIENT_c; + struct BTL_CLIENT_o { + BTL_CLIENT_c *klass; + void *monitor; + BTL_CLIENT_Fields fields; + // 1f574e0 int32_t checkForbidChangeEscapeCommon(BTL_POKEPARAM_o *procPoke, uint8_t *pokeID,uint16_t *tokuseiID,MethodInfo *method); }; diff --git a/include/Dpr/Battle/Logic/BTL_POKEPARAM.hpp b/include/Dpr/Battle/Logic/BTL_POKEPARAM.hpp index 4eda1fadd..1d8e3550e 100644 --- a/include/Dpr/Battle/Logic/BTL_POKEPARAM.hpp +++ b/include/Dpr/Battle/Logic/BTL_POKEPARAM.hpp @@ -4,6 +4,8 @@ #include "Pml/PokePara/CoreParam.h" #include "System/Array.hpp" +#include "BTL_SICKCONT.hpp" + namespace Dpr { namespace Battle @@ -70,6 +72,17 @@ namespace Dpr Pml::PokePara::CoreParam * GetSrcDataConst(MethodInfo *method); + uint16_t GetItemEffective(FieldStatus_o **fldSim, MethodInfo *method); + BTL_SICKCONT_o GetSickCont(int32_t sick, MethodInfo *method); + uint16_t GetSickParam(int32_t sick, MethodInfo *method); + bool IsGMode(MethodInfo *method); + bool PERMFLAG_Get(int32_t flagID, MethodInfo *method); + bool WAZA_IsUsable(int32_t waza, MethodInfo *method); + + bool CheckSick(int32_t sickType,MethodInfo *method); + uint8_t GetID(MethodInfo *method); + int32_t GetValue(int32_t valueID,MethodInfo *method); + uint16_t GetMonsNo(MethodInfo *method); BTL_POKEPARAM_c *klass; void *monitor; diff --git a/include/Dpr/Battle/Logic/BattleEnv.hpp b/include/Dpr/Battle/Logic/BattleEnv.hpp new file mode 100644 index 000000000..646d4c9eb --- /dev/null +++ b/include/Dpr/Battle/Logic/BattleEnv.hpp @@ -0,0 +1,69 @@ +#pragma once + +#include "il2cpp.hpp" +#include "Dpr/Battle/Logic/POKECON.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct BattleEnv_Fields + { + POKECON_o* m_pokecon; + struct FieldStatus_o* m_fieldStatus; + struct SideEffectManager_o* m_sideEffectManager; + struct PosEffectManager_o* m_posEffectManager; + struct EventFactorContainer_o* m_eventFactorContainer; + struct PosPoke_o* m_posPoke; + struct DeadRec_o* m_deadRec; + struct WazaRec_o* m_wazaRec; + struct AffCounter_o* m_affCounter; + struct ActionRecorder_o* m_actionRecorder; + struct ActionSerialNoManager_o* m_actionSerialNoManager; + struct TimeLimit_o* m_timeLimit; + struct GRightsManager_o* m_gRightsManager; + struct GGauge_array* m_gGauge; + struct RaidBattleStatus_o* m_raidBattleStatus; + struct BattleFlags_o* m_flags; + struct BattleCounter_o* m_counter; + struct EscapeInfo_o* m_escapeInfo; + struct WazaParam_o* m_lastExecutedWaza; + struct TamaHiroiData_o* m_tamaHiroiData; + }; + + struct BattleEnv_RGCTXs + { + }; + + struct BattleEnv_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct BattleEnv_c + { + Il2CppClass_1 _1; + struct BattleEnv_StaticFields* static_fields; + BattleEnv_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + BattleEnv_VTable vtable; + }; + + struct BattleEnv_o + { + BattleEnv_c *klass; + void *monitor; + BattleEnv_Fields fields; + }; + + struct BattleEnv_StaticFields + { + }; + } + } +} diff --git a/include/Dpr/Battle/Logic/Calc.hpp b/include/Dpr/Battle/Logic/Calc.hpp index 874857090..b3c9a0ea9 100644 --- a/include/Dpr/Battle/Logic/Calc.hpp +++ b/include/Dpr/Battle/Logic/Calc.hpp @@ -1,6 +1,7 @@ #pragma once #include "il2cpp.hpp" +#include "Dpr/Battle/Logic/BTL_SICKCONT.hpp" namespace Dpr { @@ -12,6 +13,8 @@ namespace Dpr { static uint32_t GetRand(uint32_t range, MethodInfo * method); static bool IsBasicSickID(int32_t sickID, MethodInfo * method); + static bool IsOccurPer(uint32_t per, MethodInfo *method); + static BTL_SICKCONT_o MakeDefaultPokeSickCont(uint32_t sick, uint8_t causePokeID, bool isCantUseRand, MethodInfo *method); }; } } diff --git a/include/Dpr/Battle/Logic/Common.hpp b/include/Dpr/Battle/Logic/Common.hpp index 131705a47..dc1dd6cb0 100644 --- a/include/Dpr/Battle/Logic/Common.hpp +++ b/include/Dpr/Battle/Logic/Common.hpp @@ -3,10 +3,18 @@ #include "il2cpp.hpp" #include "Dpr/Battle/Logic/BTL_POKEPARAM.hpp" #include "Dpr/Battle/Logic/EventFactor.hpp" +#include "Dpr/Battle/Logic/ExPokePos.hpp" +#include "Dpr/Battle/Logic/PokeAction.hpp" +#include "Dpr/Battle/Logic/Section_CureSick.hpp" #include "Dpr/Battle/Logic/Section_FromEvent_Message.hpp" #include "Dpr/Battle/Logic/Section_FromEvent_FormChange.hpp" #include "Dpr/Battle/Logic/Section_FieldEffect_Add_Description.hpp" #include "Dpr/Battle/Logic/Section_FromEvent_FieldEffect_Remove_Description.hpp" +#include "Dpr/Battle/Logic/Section_FromEvent_SetItem_Description.hpp" +#include "Dpr/Battle/Logic/Section_FromEvent_SetWazaEffectIndex_Description_o.hpp" +#include "Dpr/Battle/Logic/Section_FromEvent_SwapItem_Description.hpp" +#include "Dpr/Battle/Logic/Section_FromEvent_RankReset.hpp" +#include "Dpr/Battle/Logic/Section_SideEffect_Add.hpp" namespace Dpr { @@ -45,6 +53,29 @@ namespace Dpr static void AttachSkipCheckHandler(EventFactor_EventHandlerArgs_o ** args, EventFactor_SkipCheckHandler_o ** handler, MethodInfo * method); // 1d0a0c0 static void DetachSkipCheckHandler(EventFactor_EventHandlerArgs_o ** args, MethodInfo * method); + // 1d0e720 + static bool Dorobou_CheckEnable(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method); + // 1d0da30 + static bool CheckCantStealPoke(EventFactor_EventHandlerArgs_o **args, uint8_t attackPokeID, uint8_t targetPokeID, MethodInfo *method); + // 1d0bdb0 + static bool SwapItem(EventFactor_EventHandlerArgs_o **args, Section_FromEvent_SwapItem_Description_o **desc, MethodInfo *method); + // 1d0cb40 + static void SetWazaEffectIndex(EventFactor_EventHandlerArgs_o **args, Section_FromEvent_SetWazaEffectIndex_Description_o **desc, MethodInfo *method); + // 1d0a1f0 + static int32_t GetCompetitor(EventFactor_EventHandlerArgs_o **args, MethodInfo *method); + // 1d0bd20 + static bool SetItem(EventFactor_EventHandlerArgs_o **args, Section_FromEvent_SetItem_Description_o **desc, MethodInfo *method); + + static uint8_t ExpandExistPokeID(EventFactor_EventHandlerArgs_o **args, ExPokePos_o **exPos, System_Byte_array *dst_pokeID, MethodInfo *method); + static bool AddSideEffect(EventFactor_EventHandlerArgs_o **args, Section_SideEffect_Add_Description_o **desc, MethodInfo *method); + static bool RankReset(EventFactor_EventHandlerArgs_o **args, Section_FromEvent_RankReset_Description_o **desc, MethodInfo *method); + static uint8_t GetExistFrontPokePos(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method); + static int32_t PokeIDtoSide(EventFactor_EventHandlerArgs_o **args, uint8_t *pokeID, MethodInfo *method); + static bool CureSick(EventFactor_EventHandlerArgs_o **args, Section_CureSick_Description_o **desc, MethodInfo *method); + static PokeAction_o* SearchByPokeID(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, bool isSkipGStart, bool isSkipNull, MethodInfo *method); + static bool IsFriendPokeID(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID1, uint8_t pokeID2, MethodInfo *method); + static bool TokuseiWindow_In(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method); + static bool TokuseiWindow_Out(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method); }; extern void * Common_TypeInfo; @@ -53,4 +84,4 @@ namespace Dpr extern MethodInfo * Method_Common_Katayaburi_SkipCheck; } } -} \ No newline at end of file +} diff --git a/include/Dpr/Battle/Logic/EventFactor.hpp b/include/Dpr/Battle/Logic/EventFactor.hpp index 8b65b4ffb..8383925bd 100644 --- a/include/Dpr/Battle/Logic/EventFactor.hpp +++ b/include/Dpr/Battle/Logic/EventFactor.hpp @@ -1,6 +1,9 @@ #pragma once #include "il2cpp.hpp" +#include "Dpr/Battle/Logic/BattleEnv.hpp" +#include "Dpr/Battle/Logic/EventSystem.hpp" +#include "Dpr/Battle/Logic/PokeActionContainer.hpp" namespace Dpr { @@ -8,16 +11,96 @@ namespace Dpr { namespace Logic { + struct EventFactor_Data_Fields { + struct EventFactor_EventHandlerTable_array* handlerTable; + struct EventFactor_SkipCheckHandler_o* skipCheckHandler; + uint8_t factorType; + uint32_t priority; + uint16_t subID; + uint8_t dependID; + uint8_t pokeID; + uint32_t eventLevel; + uint32_t numHandlers; + bool callingFlag; + bool recallEnableFlag; + bool rmReserveFlag; + bool sleepFlag; + bool tmpItemFlag; + bool existFlag; + struct System_Int32_array* work; + }; + + struct EventFactor_Data_RGCTXs { + }; + + struct EventFactor_Data_VTable { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct EventFactor_Data_c { + Il2CppClass_1 _1; + struct EventFactor_Data_StaticFields* static_fields; + EventFactor_Data_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + EventFactor_Data_VTable vtable; + }; + + struct EventFactor_Data_o { + EventFactor_Data_c *klass; + void *monitor; + EventFactor_Data_Fields fields; + }; + + struct EventFactor_Data_StaticFields { + }; + + struct EventFactor_Fields { + uint16_t m_instanceID; + struct EventFactor_o* m_prevFactor; + struct EventFactor_o* m_nextFactor; + struct EventFactor_Data_o* m_data; + }; + + struct EventFactor_RGCTXs { + }; + + struct EventFactor_VTable { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct EventFactor_c { + Il2CppClass_1 _1; + struct EventFactor_StaticFields* static_fields; + EventFactor_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + EventFactor_VTable vtable; + }; + + struct EventFactor_o { + EventFactor_c *klass; + void *monitor; + EventFactor_Fields fields; + }; + + struct EventFactor_StaticFields { + }; + struct EventFactor_EventHandlerArgs_Fields { struct MainModule_o* pMainModule; - struct BattleEnv_o* pBattleEnv; - struct PokeActionContainer_o* pPokeActionContainer; + BattleEnv_o* pBattleEnv; + PokeActionContainer_o* pPokeActionContainer; struct PokeChangeRequest_o* pPokeChangeRequest; struct SectionContainer_o* pSectionContainer; struct SectionSharedData_o* pSectionSharedData; - struct EventSystem_o* pEventSystem; + EventSystem_o* pEventSystem; struct EventVarSet_o* pEventVar; - struct EventFactor_o* pMyFactor; + EventFactor_o* pMyFactor; }; struct EventFactor_EventHandlerArgs_c; @@ -86,4 +169,4 @@ namespace Dpr extern void * EventFactor_SkipCheckHandler_TypeInfo; } } -} \ No newline at end of file +} diff --git a/include/Dpr/Battle/Logic/EventSystem.hpp b/include/Dpr/Battle/Logic/EventSystem.hpp new file mode 100644 index 000000000..fe0f81aee --- /dev/null +++ b/include/Dpr/Battle/Logic/EventSystem.hpp @@ -0,0 +1,61 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct EventSystem_Fields + { + struct MainModule_o* m_pMainModule; + struct BattleEnv_o* m_pBattleEnv; + struct PokeActionContainer_o* m_pPokeActionContainer; + struct PokeChangeRequest_o* m_pPokeChangeRequest; + struct SectionContainer_o* m_pSectionContainer; + struct SectionSharedData_o* m_pSectionSharedData; + struct EventVarStack_o* m_variableStack; + struct EventVarSetStack_o* m_variableSetStack; + struct EventVarSet_o* m_pCurrentEventVarSet; + uint32_t m_eventLevel; + }; + + struct EventSystem_RGCTXs + { + }; + + struct EventSystem_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct EventSystem_c + { + Il2CppClass_1 _1; + struct EventSystem_StaticFields* static_fields; + EventSystem_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + EventSystem_VTable vtable; + }; + + struct EventSystem_o + { + EventSystem_c *klass; + void *monitor; + EventSystem_Fields fields; + + // 018f60a0 + int32_t EVENTVAR_GetValue(uint16_t label, MethodInfo *method); + }; + + struct EventSystem_StaticFields + { + }; + } + } +} diff --git a/include/Dpr/Battle/Logic/ExPokePos.hpp b/include/Dpr/Battle/Logic/ExPokePos.hpp new file mode 100644 index 000000000..049550212 --- /dev/null +++ b/include/Dpr/Battle/Logic/ExPokePos.hpp @@ -0,0 +1,44 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct ExPokePos_c; + + struct ExPokePos_Fields { + int32_t m_type; + uint8_t m_basePos; + }; + + struct ExPokePos_o { + ExPokePos_c *klass; + void *monitor; + ExPokePos_Fields fields; + + void ctor(int32_t type, uint8_t basePos, MethodInfo *method); + }; + + extern void *ExPokePos_TypeInfo; + + namespace ExPosType { + enum ExPosType { + BASE_POS, + NEXT_FRIENDS, + AREA_ENEMY, // Adjacent Opponents + AREA_OTHERS, // All but the User + AREA_MYTEAM, // All Allies + AREA_FRIENDS, // Adjacent Allies + AREA_ALL, + FULL_ENEMY, // All Opponents + FULL_FRIENDS, // All Allies and User + FULL_ALL // All + }; + } + } + } +} \ No newline at end of file diff --git a/include/Dpr/Battle/Logic/FieldStatus.hpp b/include/Dpr/Battle/Logic/FieldStatus.hpp new file mode 100644 index 000000000..a7b5661bb --- /dev/null +++ b/include/Dpr/Battle/Logic/FieldStatus.hpp @@ -0,0 +1,51 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct FieldStatus_c; + + struct FieldStatus_Fields { + struct FieldStatus_Data_o* m_data; + }; + + struct FieldStatus_o { + FieldStatus_c *klass; + void *monitor; + FieldStatus_Fields fields; + + bool CheckEffect(int32_t effect, MethodInfo *method); + bool CheckFuin(MainModule_o **mainModule, POKECON_o *pokeCon, BTL_POKEPARAM_o *attacker, int32_t waza, MethodInfo *method); + void clearFactorWork(int32_t effect, MethodInfo *method); + }; + + struct FieldStatus_Data_c; + + struct FieldStatus_Data_Fields { + uint8_t weather; + uint32_t weatherTurn; + uint32_t weatherTurnUpCount; + uint32_t weatherTurnCount; + uint8_t weatherCausePokeID; + uint8_t currentGround; + struct Dpr_Battle_Logic_BTL_SICKCONT_array* cont; + struct System_UInt32_array* turnCount; + struct System_UInt32_array_array* dependPokeID; + struct System_UInt32_array* dependPokeCount; + struct System_Boolean_array* enableFlag; + struct System_UInt16_array* subParam; + }; + + struct FieldStatus_Data_o { + FieldStatus_Data_c *klass; + void *monitor; + FieldStatus_Data_Fields fields; + }; + } + } +} \ No newline at end of file diff --git a/include/Dpr/Battle/Logic/GWaza.hpp b/include/Dpr/Battle/Logic/GWaza.hpp new file mode 100644 index 000000000..283255fe3 --- /dev/null +++ b/include/Dpr/Battle/Logic/GWaza.hpp @@ -0,0 +1,16 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct GWaza { + static bool IsGWaza(int32_t wazano, MethodInfo *method); + }; + } + } +} \ No newline at end of file diff --git a/include/Dpr/Battle/Logic/Handler.hpp b/include/Dpr/Battle/Logic/Handler.hpp index e9f2e9b5c..2d85fd4ef 100644 --- a/include/Dpr/Battle/Logic/Handler.hpp +++ b/include/Dpr/Battle/Logic/Handler.hpp @@ -336,6 +336,11 @@ namespace Dpr // 18114a0 static bool common_SideEffectCore(EventFactor_EventHandlerArgs_o ** args, uint8_t pokeID, int32_t side, int32_t effect, BTL_SICKCONT_o * cont, int32_t strType, uint32_t strID, int32_t strArg, bool replaceStrArg0ByExpandSide, MethodInfo * method); + static bool common_CureFriendPokeSick(EventFactor_EventHandlerArgs_o **args, uint8_t attackerID, bool excludeOutOfWazaTarget, bool canWriteGenFlag, MethodInfo *method); + + static void handler_Jisin_damage(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method); + static void handler_Jisin_checkHide(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method); + Waza_c *klass; void *monitor; diff --git a/include/Dpr/Battle/Logic/ItemData.h b/include/Dpr/Battle/Logic/ItemData.h index 6653f6484..02db18d21 100644 --- a/include/Dpr/Battle/Logic/ItemData.h +++ b/include/Dpr/Battle/Logic/ItemData.h @@ -12,7 +12,9 @@ namespace Dpr { // 02473d40 static bool HaveItem(uint16_t itemno, MethodInfo *method); + // 0249d4e0 + static uint32_t GetWazaMashineNo(uint16_t item, MethodInfo *method); }; } } -} \ No newline at end of file +} diff --git a/include/Dpr/Battle/Logic/MainModule.hpp b/include/Dpr/Battle/Logic/MainModule.hpp new file mode 100644 index 000000000..8e1b6d763 --- /dev/null +++ b/include/Dpr/Battle/Logic/MainModule.hpp @@ -0,0 +1,112 @@ +#pragma once + +#include "il2cpp.hpp" + +#include "BATTLE_SETUP_PARAM.hpp" +#include "Dpr/BallDeco.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct MainModule_Fields + { + BATTLE_SETUP_PARAM_o* m_setupParam; + struct BattleViewBase_o* m_viewCore; + struct Random_o* m_randSys; + uint64_t m_randomSeed; + struct MainModule_pSubProc_o* m_subProc; + int32_t m_subSeq; + int32_t m_setupStep; + struct MainModule_pMainProc_o* m_mainLoop; + struct Pml_PokeParty_array* m_srcParty; + struct Pml_PokeParty_array* m_srcPartyForServer; + struct Pml_PokeParty_o* m_tmpParty; + struct MyStatus_o* m_playerStatus; + struct System_Boolean_array* m_fClientQuit; + int32_t m_rule; + uint32_t m_regularMoney; + uint32_t m_bonusMoney; + uint32_t m_loseMoney; + int32_t m_msgSpeed; + uint16_t m_LimitTimeGame; + uint16_t m_LimitTimeClient; + uint16_t m_LimitTimeCommand; + int32_t m_serverResult; + int32_t m_serverResultCause; + uint8_t m_myClientID; + uint8_t m_myOrgPos; + int32_t m_changeMode; + uint8_t m_MultiAIDataSeq; + uint8_t m_MultiAIClientNum; + struct System_Byte_array* m_MultiAIClientID; + bool m_fCommError; + bool m_fCommErrorMainQuit; + bool m_fWazaEffectEnable; + bool m_fGetMoneyFixed; + bool m_fLoseMoneyFixed; + bool m_padding; + bool m_isFinalizeStarted; + struct BTL_SERVER_o* m_server; + struct BTL_SERVER_o* m_cmdCheckServer; + struct BTL_CLIENT_array* m_client; + struct BTL_CLIENT_array* m_dummyClient; + struct TRAINER_DATA_array* m_trainerParam; + struct ClientPublicInformation_array* m_clientPublicInformation; + struct AdapterFactory_o* m_adapterFactory; + struct rec_Reader_o* m_recReader; + struct System_Boolean_array* m_moneyDblUpCause; + struct System_Collections_Generic_Dictionary_uint__uint__o* m_zukanDataOnBattleStart; + struct PokeIDRec_o* m_deadPokeIDRec; + struct BattleEnv_o* m_battleEnvForClient; + struct BattleEnv_o* m_battleEnvForServer; + struct Net_Client_o* m_iPtrNetClient; + bool isInitialized; + bool isFinalized; + struct Dpr::BallDeco::CapsuleData_o DummyCapsuleData; + }; + + struct MainModule_RGCTXs + { + }; + + struct MainModule_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct MainModule_c + { + Il2CppClass_1 _1; + struct MainModule_StaticFields* static_fields; + MainModule_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + MainModule_VTable vtable; + }; + + struct MainModule_o + { + MainModule_c *klass; + void *monitor; + MainModule_Fields fields; + + bool IsSkyBattle(MethodInfo *method); + }; + + struct MainModule_StaticFields + { + struct BtlvPos_array_array* rule_double_vpos; + struct BtlvPos_array_array* rule_double_vpos_PA_A; + struct BtlvPos_array_array* rule_raid_vpos1; + struct BtlvPos_array_array* rule_raid_vpos2; + struct BtlvPos_array_array* rule_raid_vpos3; + struct BtlvPos_array_array* rule_raid_vpos4; + }; + } + } +} diff --git a/include/Dpr/Battle/Logic/POKECON.hpp b/include/Dpr/Battle/Logic/POKECON.hpp new file mode 100644 index 000000000..515b8c72f --- /dev/null +++ b/include/Dpr/Battle/Logic/POKECON.hpp @@ -0,0 +1,57 @@ +#pragma once + +#include "il2cpp.hpp" +#include "Dpr/Battle/Logic/BTL_POKEPARAM.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct POKECON_Fields + { + struct MainModule_o* m_mainModule; + struct BTL_PARTY_array* m_party; + struct BTL_POKEPARAM_array* m_activePokeParam; + struct BTL_POKEPARAM_array* m_storedPokeParam; + }; + + struct POKECON_RGCTXs + { + }; + + struct POKECON_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct POKECON_c + { + Il2CppClass_1 _1; + struct POKECON_StaticFields* static_fields; + POKECON_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + POKECON_VTable vtable; + }; + + struct POKECON_o + { + POKECON_c *klass; + void *monitor; + POKECON_Fields fields; + + // 02037250 + BTL_POKEPARAM_o * GetPokeParamConst(uint8_t pokeID, MethodInfo *method); + }; + + struct POKECON_StaticFields + { + struct Pml_PokeParty_o* s_tmpPokeParty; + }; + } + } +} diff --git a/include/Dpr/Battle/Logic/PokeAction.hpp b/include/Dpr/Battle/Logic/PokeAction.hpp new file mode 100644 index 000000000..3064e6cd1 --- /dev/null +++ b/include/Dpr/Battle/Logic/PokeAction.hpp @@ -0,0 +1,18 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct PokeAction_o; + + struct PokeAction { + static int32_t GetWazaID(PokeAction_o *action, MethodInfo *method); + }; + } + } +} \ No newline at end of file diff --git a/include/Dpr/Battle/Logic/PokeActionContainer.hpp b/include/Dpr/Battle/Logic/PokeActionContainer.hpp new file mode 100644 index 000000000..12d5bb016 --- /dev/null +++ b/include/Dpr/Battle/Logic/PokeActionContainer.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct PokeActionContainer_c; + + struct PokeActionContainer_Fields { + struct Dpr_Battle_Logic_PokeAction_array* m_actions; + uint8_t m_count; + }; + + struct PokeActionContainer_o { + bool IsAllActDoneByPokeID(uint8_t pokeID, MethodInfo *method); + + PokeActionContainer_c *klass; + void *monitor; + PokeActionContainer_Fields fields; + }; + } + } +} \ No newline at end of file diff --git a/include/Dpr/Battle/Logic/SICKCONT.hpp b/include/Dpr/Battle/Logic/SICKCONT.hpp index a8990c44f..35aabb145 100644 --- a/include/Dpr/Battle/Logic/SICKCONT.hpp +++ b/include/Dpr/Battle/Logic/SICKCONT.hpp @@ -15,6 +15,8 @@ namespace Dpr static BTL_SICKCONT_o MakePermanent(uint8_t causePokeID, MethodInfo * method); // 20d4680 static BTL_SICKCONT_o MakeTurn(uint8_t causePokeID, uint8_t turns, MethodInfo * method); + + static uint16_t GetParam(BTL_SICKCONT_o *cont, MethodInfo *method); }; } } diff --git a/include/Dpr/Battle/Logic/Section_CureSick.hpp b/include/Dpr/Battle/Logic/Section_CureSick.hpp new file mode 100644 index 000000000..6faf9d3e4 --- /dev/null +++ b/include/Dpr/Battle/Logic/Section_CureSick.hpp @@ -0,0 +1,36 @@ +#pragma once + +#include "il2cpp.hpp" +#include "Dpr/Battle/Logic/StrParam.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct Section_CureSick_Description_c; + + struct Section_CureSick_Description_Fields { + uint8_t pokeID; + int32_t sick; + struct System_Byte_array* targetPokeID; + uint8_t targetPokeCount; + uint16_t itemID; + bool isDisplayTokuseiWindow; + bool isStandardMessageDisable; + struct StrParam_o* successSpMessage; + }; + + struct Section_CureSick_Description_o { + void ctor(MethodInfo *method); + + Section_CureSick_Description_c *klass; + void *monitor; + Section_CureSick_Description_Fields fields; + }; + + extern void *Section_CureSick_Description_TypeInfo; + } + } +} \ No newline at end of file diff --git a/include/Dpr/Battle/Logic/Section_FromEvent_RankReset.hpp b/include/Dpr/Battle/Logic/Section_FromEvent_RankReset.hpp new file mode 100644 index 000000000..0cf72a30c --- /dev/null +++ b/include/Dpr/Battle/Logic/Section_FromEvent_RankReset.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct Section_FromEvent_RankReset_Description_c; + + struct Section_FromEvent_RankReset_Description_Fields { + uint8_t pokeCount; + struct System_Byte_array* pokeID; + }; + + struct Section_FromEvent_RankReset_Description_o { + void ctor(MethodInfo *method); + + Section_FromEvent_RankReset_Description_c *klass; + void *monitor; + Section_FromEvent_RankReset_Description_Fields fields; + }; + + extern void *Section_FromEvent_RankReset_Description_TypeInfo; + } + } +} \ No newline at end of file diff --git a/include/Dpr/Battle/Logic/Section_FromEvent_SetItem_Description.hpp b/include/Dpr/Battle/Logic/Section_FromEvent_SetItem_Description.hpp new file mode 100644 index 000000000..55a125151 --- /dev/null +++ b/include/Dpr/Battle/Logic/Section_FromEvent_SetItem_Description.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include "il2cpp.hpp" +#include "Dpr/Battle/Logic/BTL_POKEPARAM.hpp" +#include "Dpr/Battle/Logic/StrParam.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct Section_FromEvent_SetItem_Description_Fields { + uint8_t userPokeID; + uint8_t targetPokeID; + uint16_t itemID; + bool isClearConsume; + bool isClearConsumeOtherPoke; + uint8_t clearConsumePokeID; + bool isCallConsumedEvent; + bool isDisplayTokuseiWindow; + bool isConsumeItem; + struct Dpr::Battle::Logic::StrParam_o* successMessage; + }; + + struct Section_FromEvent_SetItem_Description_c; + + struct Section_FromEvent_SetItem_Description_o { + // 01fb7ab0 + void ctor(MethodInfo * method); + + Section_FromEvent_SetItem_Description_c *klass; + void *monitor; + Section_FromEvent_SetItem_Description_Fields fields; + }; + + // 04c5b1f8 + extern void * Section_FromEvent_SetItem_Description_TypeInfo; + } + } +} diff --git a/include/Dpr/Battle/Logic/Section_FromEvent_SetWazaEffectIndex_Description_o.hpp b/include/Dpr/Battle/Logic/Section_FromEvent_SetWazaEffectIndex_Description_o.hpp new file mode 100644 index 000000000..bda35429e --- /dev/null +++ b/include/Dpr/Battle/Logic/Section_FromEvent_SetWazaEffectIndex_Description_o.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include "il2cpp.hpp" +#include "Dpr/Battle/Logic/BTL_POKEPARAM.hpp" +#include "Dpr/Battle/Logic/StrParam.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct Section_FromEvent_SetWazaEffectIndex_Description_Fields { + uint8_t effectIndex; + }; + + struct Section_FromEvent_SetWazaEffectIndex_Description_c; + + struct Section_FromEvent_SetWazaEffectIndex_Description_o { + // 01fb7f40 + void ctor(MethodInfo * method); + + Section_FromEvent_SetWazaEffectIndex_Description_c *klass; + void *monitor; + Section_FromEvent_SetWazaEffectIndex_Description_Fields fields; + }; + + // 04c5b350 + extern void * Section_FromEvent_SetWazaEffectIndex_Description_TypeInfo; + } + } +} diff --git a/include/Dpr/Battle/Logic/Section_FromEvent_SwapItem_Description.hpp b/include/Dpr/Battle/Logic/Section_FromEvent_SwapItem_Description.hpp new file mode 100644 index 000000000..abf0f4e0a --- /dev/null +++ b/include/Dpr/Battle/Logic/Section_FromEvent_SwapItem_Description.hpp @@ -0,0 +1,38 @@ +#pragma once + +#include "il2cpp.hpp" +#include "Dpr/Battle/Logic/BTL_POKEPARAM.hpp" +#include "Dpr/Battle/Logic/StrParam.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct Section_FromEvent_SwapItem_Description_Fields { + uint8_t userPokeID; + uint8_t targetPokeID; + bool isIncRecordCount_StealItemFromWildPoke; + bool isDisplayTokuseiWindow; + struct StrParam_o* successMessage1; + struct StrParam_o* successMessage2; + struct StrParam_o* successMessage3; + }; + + struct Section_FromEvent_SwapItem_Description_c; + + struct Section_FromEvent_SwapItem_Description_o { + // 01fb8800 + void ctor(MethodInfo * method); + + Section_FromEvent_SwapItem_Description_c *klass; + void *monitor; + Section_FromEvent_SwapItem_Description_Fields fields; + }; + + // 04c5b1f0 + extern void * Section_FromEvent_SwapItem_Description_TypeInfo; + } + } +} diff --git a/include/Dpr/Battle/Logic/Section_SideEffect_Add.hpp b/include/Dpr/Battle/Logic/Section_SideEffect_Add.hpp new file mode 100644 index 000000000..74ea74caf --- /dev/null +++ b/include/Dpr/Battle/Logic/Section_SideEffect_Add.hpp @@ -0,0 +1,36 @@ +#pragma once + +#include "il2cpp.hpp" +#include "BTL_SICKCONT.hpp" +#include "StrParam.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct Section_SideEffect_Add_Description_c; + + struct Section_SideEffect_Add_Description_Fields { + uint8_t pokeID; + int32_t effect; + struct BTL_SICKCONT_o cont; + int32_t side; + uint16_t successEffectNo; + struct StrParam_o* successMessage; + bool isReplaceSuccessMessageArgs0ByExpandSide; + }; + + struct Section_SideEffect_Add_Description_o { + void ctor(MethodInfo *method); + + Section_SideEffect_Add_Description_c *klass; + void *monitor; + Section_SideEffect_Add_Description_Fields fields; + }; + + extern void *Section_SideEffect_Add_Description_TypeInfo; + } + } +} \ No newline at end of file diff --git a/include/Dpr/Battle/Logic/ServerSendData.hpp b/include/Dpr/Battle/Logic/ServerSendData.hpp new file mode 100644 index 000000000..31cc8da4d --- /dev/null +++ b/include/Dpr/Battle/Logic/ServerSendData.hpp @@ -0,0 +1,71 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Battle + { + namespace Logic + { + struct ServerSendData_CLIENT_LIMIT_TIME__limitTime_e__FixedBuffer_Fields { + uint16_t FixedElementField; + }; + + struct ServerSendData_CLIENT_LIMIT_TIME__limitTime_e__FixedBuffer_o { + ServerSendData_CLIENT_LIMIT_TIME__limitTime_e__FixedBuffer_Fields fields; + }; + + struct ServerSendData_CLIENT_LIMIT_TIME_Fields { + struct ServerSendData_CLIENT_LIMIT_TIME__limitTime_e__FixedBuffer_o limitTime; + }; + + struct ServerSendData_CLIENT_LIMIT_TIME_o { + ServerSendData_CLIENT_LIMIT_TIME_Fields fields; + }; + + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__isThrow_e__FixedBuffer_Fields { + bool FixedElementField; + }; + + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__isThrow_e__FixedBuffer_o { + ServerSendData_RAIDBOSS_CAPTURE_RESULT__isThrow_e__FixedBuffer_Fields fields; + }; + + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__itemno_e__FixedBuffer_Fields { + uint16_t FixedElementField; + }; + + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__itemno_e__FixedBuffer_o { + ServerSendData_RAIDBOSS_CAPTURE_RESULT__itemno_e__FixedBuffer_Fields fields; + }; + + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__isCaptured_e__FixedBuffer_Fields { + bool FixedElementField; + }; + + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__isCaptured_e__FixedBuffer_o { + ServerSendData_RAIDBOSS_CAPTURE_RESULT__isCaptured_e__FixedBuffer_Fields fields; + }; + + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__yureCount_e__FixedBuffer_Fields { + uint16_t FixedElementField; + }; + + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__yureCount_e__FixedBuffer_o { + ServerSendData_RAIDBOSS_CAPTURE_RESULT__yureCount_e__FixedBuffer_Fields fields; + }; + + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT_Fields { + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__isThrow_e__FixedBuffer_o isThrow; + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__itemno_e__FixedBuffer_o itemno; + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__isCaptured_e__FixedBuffer_o isCaptured; + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT__yureCount_e__FixedBuffer_o yureCount; + }; + + struct ServerSendData_RAIDBOSS_CAPTURE_RESULT_o { + ServerSendData_RAIDBOSS_CAPTURE_RESULT_Fields fields; + }; + } + } +} \ No newline at end of file diff --git a/include/Dpr/Battle/Logic/Tables.hpp b/include/Dpr/Battle/Logic/Tables.hpp index 1d652e82e..f9e1661b6 100644 --- a/include/Dpr/Battle/Logic/Tables.hpp +++ b/include/Dpr/Battle/Logic/Tables.hpp @@ -12,6 +12,8 @@ namespace Dpr struct Tables { static System::Array * GetYubiFuruPermitTable(MethodInfo * method); + + static bool IsKodawariItem(uint16_t itemID, MethodInfo *method); }; } } diff --git a/include/Dpr/Battle/Logic/WAZADATA.hpp b/include/Dpr/Battle/Logic/WAZADATA.hpp index e44aa9a96..48bb36bd4 100644 --- a/include/Dpr/Battle/Logic/WAZADATA.hpp +++ b/include/Dpr/Battle/Logic/WAZADATA.hpp @@ -12,6 +12,11 @@ namespace Dpr { // 1f72b40 static int32_t GetDamageType(int32_t id, MethodInfo * method); + + static bool IsDamage(int32_t id, MethodInfo *method); + static bool IsValid(int32_t id, MethodInfo *method); + + static bool GetFlag(int32_t id, int32_t flag, MethodInfo *method); }; } diff --git a/include/Dpr/Box/BoxPokemonWork.hpp b/include/Dpr/Box/BoxPokemonWork.hpp new file mode 100644 index 000000000..ea30d35ef --- /dev/null +++ b/include/Dpr/Box/BoxPokemonWork.hpp @@ -0,0 +1,49 @@ +#pragma once + +#include "System/String.hpp" +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Box + { + struct BoxPokemonWork_Fields + { + }; + + struct BoxPokemonWork_RGCTXs + { + }; + + struct BoxPokemonWork_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct BoxPokemonWork_c + { + Il2CppClass_1 _1; + struct BoxPokemonWork_StaticFields* static_fields; + BoxPokemonWork_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + BoxPokemonWork_VTable vtable; + }; + + struct BoxPokemonWork + { + BoxPokemonWork_c *klass; + void *monitor; + BoxPokemonWork_Fields fields; + + // 01d30e80 + static void ClearPokemon(int32_t tray, int32_t pos, MethodInfo *method); + }; + + struct BoxPokemonWork_StaticFields + { + }; + } +} diff --git a/include/Dpr/EncountTools.hpp b/include/Dpr/EncountTools.hpp index 7c234c4b7..def89d8bd 100644 --- a/include/Dpr/EncountTools.hpp +++ b/include/Dpr/EncountTools.hpp @@ -2,10 +2,13 @@ #include "Pml/PokePara/CoreParam.h" +struct Dpr_Battle_Logic_BATTLE_SETUP_PARAM_o; + namespace Dpr { struct EncountTools { static uint16_t SetWildPokemonItem(Pml::PokePara::CoreParam * pp, int32_t itemRnd, int32_t rnd1, int32_t rnd2, MethodInfo *method); + static void SetupBattleTrainer(Dpr_Battle_Logic_BATTLE_SETUP_PARAM_o *battleSetupParam, int32_t arenaID, int32_t mapAttrib, int32_t weatherType, int32_t rule, int32_t enemyID0, int32_t enemyID1, int32_t partnerID, MethodInfo *method); }; -} \ No newline at end of file +} diff --git a/include/Dpr/EvScript/EvDataManager.hpp b/include/Dpr/EvScript/EvDataManager.hpp index f097680d5..5fc2f83b8 100644 --- a/include/Dpr/EvScript/EvDataManager.hpp +++ b/include/Dpr/EvScript/EvDataManager.hpp @@ -1,8 +1,14 @@ #pragma once #include "il2cpp.hpp" +#include "Dpr/FieldObjectMove.hpp" +#include "Dpr/FieldObjectRotateYaw.hpp" +#include "Dpr/EvScript/EvScriptData.hpp" +#include "Effect/EffectInstance.hpp" #include "System/String.hpp" #include "System/Array.hpp" +#include "UnityEngine/Coroutine.hpp" +#include "UnityEngine/GameObject.hpp" struct System_Action_EvDataManager_EntityParam__o; struct System_Collections_Generic_Stack_EvDataManager_EvCallData__o; @@ -17,8 +23,6 @@ struct System_Collections_Generic_List_EvDataManager_AssetReqOpeRef__o; struct System_Collections_Generic_List_EvDataManager_LoadObjectData__o; struct System_Collections_Generic_Dictionary_int__GameObject__o; -struct UnityEngine_GameObject_o; - struct FieldObjectEntity_o; struct FieldEventDoorEntity_o; struct FieldEventLiftEntity_o; @@ -34,17 +38,15 @@ struct TelescopeNagisa_o; struct FieldWazaCutIn_o; struct InterviewWork_o; struct FieldShip_o; -struct FieldObjectMoveCode_array; // TODO: Make System.Array +struct FieldObjectMoveCode_o; struct Balloon_array; // TODO: Make System.Array struct FieldAnimatorController_array; // TODO: Make System.Array struct FieldToUgInvisibleObjects_o; struct EventCameraTable_o; struct TairyouHasseiPokeManager_o; -struct UnityEngine_Coroutine_o; struct System_Single_array; struct FieldEventEntity_o; struct FieldEventLiftEntity_o; -struct Effect_EffectInstance_o; struct System_Text_StringBuilder_o; struct Audio_AudioInstance_o; struct UnityEngine_Transform_o; @@ -145,12 +147,12 @@ namespace Dpr }; struct MsgOpenParam_Fields { - System::String MsbtFile; - System::String Label; + System::String* MsbtFile; + System::String* Label; int32_t LabelIndex; int32_t WindowType; bool Input; - System::Array * TrainerName; + System::Array* TrainerName; int32_t EndType; bool PlayTextFeedSe; }; @@ -158,11 +160,11 @@ namespace Dpr struct MsgOpenParam_o { MsgOpenParam_Fields fields; }; - + struct EvDataManager_Fields { struct System_Action_EvDataManager_EntityParam__o* OnTalkStartCallBack; bool _isScriptLoad; - struct Dpr_EvScript_EvScriptData_array* _eventList; + struct System::Array* _eventList; int32_t _eventListIndex; struct System_Collections_Generic_Stack_EvDataManager_EvCallData__o* _callQueue; struct System_Collections_Generic_Dictionary_string__int____o* _findAllLabel; @@ -174,13 +176,13 @@ namespace Dpr int32_t _areaID; struct System_Collections_Generic_List_FieldEventEntity__o* _warpList; struct XLSXContent_MapWarp_o* _warpData; - struct UnityEngine_GameObject_o* _warpRoot; - struct PlaySeData_array* _se_datas; - struct PlaySeData_array* _voice_datas; + struct UnityEngine::GameObject_o* _warpRoot; + struct System::Array* _se_datas; + struct System::Array* _voice_datas; struct UnityEngine_Vector2Int_o _eventEndPosition; struct System::String* _posEventLabelReserve; - struct EntityParam_array* _entityParamList; - struct UnityEngine_GameObject_o* _stopRoot; + struct System::Array* _entityParamList; + struct UnityEngine::GameObject_o* _stopRoot; bool _isInitFirstMap; struct FieldObjectEntity_o* __dummyPlayer_k__BackingField; struct UpdateDelegate_o* _updateDelegate; @@ -213,7 +215,7 @@ namespace Dpr bool _isCall_TrainerBtl; struct EvCallData_o _battleReturnData; struct FieldObjectEntity_o* _battleReturnHitObject; - struct FieldObjectMoveCode_array* _eyeEncountTarget; + struct System::Array* _eyeEncountTarget; struct Balloon_array* _eyeEncountBallon; float _eyeEncountWait; int32_t _eyeEncountSeq; @@ -255,7 +257,7 @@ namespace Dpr int32_t _boardState; struct Dpr_MsgWindow_MsgWindow_o* _msgWindow; struct Dpr_MsgWindow_MsgWindow_o* _msgWindowOther; - struct UnityEngine_Coroutine_o* _msgWindowCoroutine; + UnityEngine::Coroutine_o* _msgWindowCoroutine; int32_t _talkStart; int32_t _macroCmd; int32_t _procCmd; @@ -281,8 +283,8 @@ namespace Dpr int32_t _heroReqBit; int32_t _heroMoveGridCenterFrontDir; bool _heroMoveGridCenterFrontStat; - struct Dpr_FieldObjectMove_o* _fieldObjectMove; - struct Dpr_FieldObjectRotateYaw_o* _fieldObjectRotateYaw; + struct Dpr::FieldObjectMove_o* _fieldObjectMove; + struct Dpr::FieldObjectRotateYaw_o* _fieldObjectRotateYaw; struct Dpr_FieldFloatMove_o* _fieldFloatMove; int32_t _hidenSequence; struct UnityEngine_Vector3_o _takiTargetPosition; @@ -296,7 +298,7 @@ namespace Dpr int32_t _waterSequence; int32_t _kinomiSequence; float _kinomiSequenceTime; - struct Effect_EffectInstance_o* _kinomiEffect; + Effect::EffectInstance_o* _kinomiEffect; int32_t _warpSequence; int32_t _warpSpeedSequence; float _warpSpeedSequenceTime; @@ -326,21 +328,21 @@ namespace Dpr struct FieldAnimatorController_array* _umaAnimatorCtr; bool _isOpenCustomBallTrainer; int32_t _nicknamePlacementSequence; - struct Effect_EffectInstance_array* _scriptEffects; - struct UnityEngine_Coroutine_array* _scriptScaleCorutine; + System::Array* _scriptEffects; + System::Array* _scriptScaleCorutine; struct System_Boolean_array* _scriptScaleVectol; struct Pml_PokePara_PokemonParam_o* _temp_PokePara; bool _isBattleTowerBtl; bool _isBattleTowerWin; struct UnityEngine_Vector2_o _playerMoveGridCenterAngle; - struct Dpr_EvScript_EvScriptData_o* _evData; + struct EvScriptData_o* _evData; struct EvData_Script_o* _evScript; struct EvData_Command_o* _evCommand; struct System::Array * _evArg; int32_t btlsearchSeq; struct Audio_AudioInstance_o* btlserchAudio; bool _isOpenHallOfFame; - struct UnityEngine_Coroutine_o* _cmdReportSaveCoroutine; + UnityEngine::Coroutine_o* _cmdReportSaveCoroutine; int32_t _seqRankingView; bool _isOpenCertificate; int32_t returnSequenceID; @@ -381,10 +383,16 @@ namespace Dpr bool JumpLabel(System::String *label, EventEndDelegate_o *callback, MethodInfo *method); // 02c42ea0 bool UpdateEvdata(float time, bool sp_script, MethodInfo *method); + // 02c5b290 + bool RunEvCmd(int32_t index, MethodInfo *method); + // 02c67ff0 + int32_t GetPokemonFormNo(Pml::PokePara::PokemonParam_o *param, MethodInfo *method); + // 02c67f20 + Pml::PokePara::PokemonParam_o * GetPokemonParam(int32_t trayIndex, int32_t index, MethodInfo *method); EvDataManager_c *klass; void *monitor; EvDataManager_Fields fields; }; } -} \ No newline at end of file +} diff --git a/include/Dpr/EvScript/EvScriptData.hpp b/include/Dpr/EvScript/EvScriptData.hpp new file mode 100644 index 000000000..585ebbac5 --- /dev/null +++ b/include/Dpr/EvScript/EvScriptData.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include "il2cpp.hpp" +#include "EvData/EvData.hpp" + +namespace Dpr +{ + namespace EvScript + { + struct EvScriptData_Fields + { + struct EvData_o* EvData; + int32_t LabelIndex; + int32_t CommandIndex; + int32_t RetIndex; + }; + + struct EvScriptData_RGCTXs + { + }; + + struct EvScriptData_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct EvScriptData_c + { + Il2CppClass_1 _1; + struct EvScriptData_StaticFields* static_fields; + EvScriptData_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + EvScriptData_VTable vtable; + }; + + struct EvScriptData_o + { + EvScriptData_c *klass; + void *monitor; + EvScriptData_Fields fields; + }; + + struct EvScriptData_StaticFields + { + }; + } +} diff --git a/include/Dpr/Field/EncountResult.hpp b/include/Dpr/Field/EncountResult.hpp new file mode 100644 index 000000000..3281d0819 --- /dev/null +++ b/include/Dpr/Field/EncountResult.hpp @@ -0,0 +1,40 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/Array.hpp" + +namespace Dpr +{ + namespace Field + { + struct EncountResult_Fields { + int32_t Type; + System::Array * Enemy; // struct Pml_MonsNo_array* + System::Array * Level; + System::Array * FixSex; // struct Pml_Sex_array* + System::Array * FixSeikaku; // struct Pml_PokePara_Seikaku_array* + bool IsRare; + int32_t Partner; + int32_t HatudouTokusei; + int32_t BattleBG; + int32_t MP_SaveIndex; + bool IsKakure; + int32_t karanaForm; + int32_t annoForm; + }; + + struct EncountResult_c; + + struct EncountResult_o { + EncountResult_c *klass; + void *monitor; + EncountResult_Fields fields; + + // 019b2c70 + void ctor(MethodInfo *method); + }; + + // 04c5f200 + extern void * EncountResult_TypeInfo; + } +} diff --git a/include/Dpr/Field/FieldEncount.hpp b/include/Dpr/Field/FieldEncount.hpp new file mode 100644 index 000000000..3dac1d40c --- /dev/null +++ b/include/Dpr/Field/FieldEncount.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include "il2cpp.hpp" +#include "Dpr/Field/EncountResult.hpp" +#include "Dpr/Field/FieldEncount/ENC_FLD_SPA.hpp" +#include "Dpr/Field/FieldEncount/SWAY_ENC_INFO.hpp" +#include "Pml/PokePara/PokemonParam.h" +#include "XLSXContent/FieldEncountTable.hpp" + +namespace Dpr +{ + namespace Field + { + struct FieldEncount_o + { + // 019b3eb0 + static void SetSpaStruct(Pml::PokePara::PokemonParam_o *inPokeParam, XLSXContent::FieldEncountTable::Sheettable_o *inData, Dpr::Field::FieldEncount::ENC_FLD_SPA_o *outSpa, MethodInfo *method); + // 019b4100 + static bool MapEncountCheck(uint32_t per, int32_t attr, bool inGridmove, MethodInfo *method); + // 019b47f0 + static void EncountParamSet(int32_t poke, int32_t lv, int32_t inTarget, Dpr::Field::FieldEncount::ENC_FLD_SPA_o inFldSpa, Pml::PokePara::PokemonParam_o *inPokeParam, Dpr::Field::EncountResult_o **outBattleParam, MethodInfo *method); + // 019b4990 + static void LastProc(Dpr::Field::EncountResult_o **result, Dpr::Field::FieldEncount::ENC_FLD_SPA_o *spa, MethodInfo *method); + // 019b6e30 + static bool SetEncountData(Pml::PokePara::PokemonParam_o *param, int32_t inRodType, Dpr::Field::FieldEncount::ENC_FLD_SPA_o inFldSpa, System::Array *inData, int32_t location, int32_t inTarget, Dpr::Field::EncountResult_o **outBattleParam, MethodInfo *method); + // 019b4c00 + static bool WildEncSingle(Pml::PokePara::PokemonParam_o *poke_param, Dpr::Field::EncountResult_o **param, XLSXContent::FieldEncountTable::Sheettable_o *data, System::Array *enc_data, Dpr::Field::FieldEncount::ENC_FLD_SPA_o inFldSpa, Dpr::Field::FieldEncount::SWAY_ENC_INFO_o inSwayEncInfo, MethodInfo *method); + // 019b4500 + static int32_t CheckMovePokeEnc(MethodInfo *method); + }; + } +} diff --git a/include/Dpr/Field/FieldEncount/ENC_FLD_SPA.hpp b/include/Dpr/Field/FieldEncount/ENC_FLD_SPA.hpp new file mode 100644 index 000000000..1259dcf96 --- /dev/null +++ b/include/Dpr/Field/FieldEncount/ENC_FLD_SPA.hpp @@ -0,0 +1,55 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/Array.hpp" + +namespace Dpr +{ + namespace Field + { + namespace FieldEncount + { + struct ENC_FLD_SPA_Fields + { + int32_t TrainerID; + bool SprayCheck; + bool EncCancelSpInvalid; + int32_t SpMyLv; + bool Egg; + int32_t Spa; + System::Array* FormProb; + int32_t AnnoonTblType; + }; + + struct ENC_FLD_SPA_RGCTXs + { + }; + + struct ENC_FLD_SPA_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct ENC_FLD_SPA_c + { + Il2CppClass_1 _1; + struct ENC_FLD_SPA_StaticFields* static_fields; + ENC_FLD_SPA_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + ENC_FLD_SPA_VTable vtable; + }; + + struct ENC_FLD_SPA_o + { + ENC_FLD_SPA_Fields fields; + }; + + struct ENC_FLD_SPA_StaticFields + { + }; + } + } +} diff --git a/include/Dpr/Field/FieldEncount/SWAY_ENC_INFO.hpp b/include/Dpr/Field/FieldEncount/SWAY_ENC_INFO.hpp new file mode 100644 index 000000000..231295144 --- /dev/null +++ b/include/Dpr/Field/FieldEncount/SWAY_ENC_INFO.hpp @@ -0,0 +1,49 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Field + { + namespace FieldEncount + { + struct SWAY_ENC_INFO_Fields + { + int32_t Table; + bool Decide; + bool Enc; + }; + + struct SWAY_ENC_INFO_RGCTXs + { + }; + + struct SWAY_ENC_INFO_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct SWAY_ENC_INFO_c + { + Il2CppClass_1 _1; + struct SWAY_ENC_INFO_StaticFields* static_fields; + SWAY_ENC_INFO_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + SWAY_ENC_INFO_VTable vtable; + }; + + struct SWAY_ENC_INFO_o + { + SWAY_ENC_INFO_Fields fields; + }; + + struct SWAY_ENC_INFO_StaticFields + { + }; + } + } +} diff --git a/include/Dpr/Field/SpFishing.hpp b/include/Dpr/Field/SpFishing.hpp new file mode 100644 index 000000000..a8fb1fe0f --- /dev/null +++ b/include/Dpr/Field/SpFishing.hpp @@ -0,0 +1,15 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + namespace Field + { + struct SpFishing + { + // 019b55c0 + static bool CheckPoint(UnityEngine_Vector2Int_o *position, MethodInfo *method); + }; + } +} diff --git a/include/Dpr/Field/SwayGrass.hpp b/include/Dpr/Field/SwayGrass.hpp index 3df40ce0a..bf26ae663 100644 --- a/include/Dpr/Field/SwayGrass.hpp +++ b/include/Dpr/Field/SwayGrass.hpp @@ -1,6 +1,8 @@ #pragma once #include "il2cpp.hpp" +#include "UnityEngine/GameObject.hpp" +#include "Dpr/Field/FieldEncount/SWAY_ENC_INFO.hpp" namespace Dpr { @@ -27,6 +29,11 @@ namespace Dpr SwayGrass_c *klass; void *monitor; SwayGrass_Fields fields; + + // 019b43d0 + static bool SwayGrass_CheckSpEncount(Dpr::Field::FieldEncount::SWAY_ENC_INFO_o *info, UnityEngine_Vector3_o *pos, float size, MethodInfo *method); + // 019b4fa0 + static void StopSE(MethodInfo *method); }; struct SwayGrass_StaticFields { bool is_swaygrass_flag; @@ -38,10 +45,10 @@ namespace Dpr int32_t rensa_mons; uint32_t rensa_lv; bool BattleEndRensaStart; - struct UnityEngine_GameObject_o* RootGrass; + struct UnityEngine::GameObject_o* RootGrass; bool _callSwayBGM; bool _callStopSwayBGM; }; extern SwayGrass_c * SwayGrass_InfoType; } -} \ No newline at end of file +} diff --git a/include/Dpr/FieldObjectMove.hpp b/include/Dpr/FieldObjectMove.hpp new file mode 100644 index 000000000..c5165fe02 --- /dev/null +++ b/include/Dpr/FieldObjectMove.hpp @@ -0,0 +1,61 @@ +#pragma once + +#include "il2cpp.hpp" +#include "FieldObjectEntity.hpp" + +namespace Dpr +{ + struct FieldObjectMove_Fields + { + bool IgnoreY; + float JumpHeight; + struct System_WeakReference_FieldObjectEntity__o* _Entity; + struct Dpr_FieldFloatMove_o* FloatMove; + struct UnityEngine_Vector3_o BaseWldPos; + struct UnityEngine_Vector3_o TargetWldPos; + }; + + struct FieldObjectMove_RGCTXs + { + }; + + struct FieldObjectMove_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct FieldObjectMove_c + { + Il2CppClass_1 _1; + struct FieldObjectMove_StaticFields* static_fields; + FieldObjectMove_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + FieldObjectMove_VTable vtable; + }; + + struct FieldObjectMove_o + { + FieldObjectMove_c *klass; + void *monitor; + FieldObjectMove_Fields fields; + + // 01a77b00 + void Update(float deltaTime, MethodInfo *method); + + // 01a778d0 + bool get_IsBusy(MethodInfo *method); + + // 01a779e0 + void SetObjectEntity(FieldObjectEntity_o *entity, MethodInfo *method); + + // 01a77f40 + void MoveSpeed(UnityEngine_Vector3_o targetWldPos, float moveSpeed, MethodInfo *method); + }; + + struct FieldObjectMove_StaticFields + { + }; +} diff --git a/include/Dpr/FieldObjectRotateYaw.hpp b/include/Dpr/FieldObjectRotateYaw.hpp new file mode 100644 index 000000000..06ca0e02a --- /dev/null +++ b/include/Dpr/FieldObjectRotateYaw.hpp @@ -0,0 +1,58 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Dpr +{ + struct FieldObjectRotateYaw_Fields + { + struct System_WeakReference_FieldObjectEntity__o* _Entity; + struct Dpr_FieldFloatMove_o* FloatMove; + float BaseYawAngle; + float TargetYawAngle; + }; + + struct FieldObjectRotateYaw_RGCTXs + { + }; + + struct FieldObjectRotateYaw_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct FieldObjectRotateYaw_c + { + Il2CppClass_1 _1; + struct FieldObjectRotateYaw_StaticFields* static_fields; + FieldObjectRotateYaw_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + FieldObjectRotateYaw_VTable vtable; + }; + + struct FieldObjectRotateYaw_o + { + FieldObjectRotateYaw_c *klass; + void *monitor; + FieldObjectRotateYaw_Fields fields; + + // 01a783e0 + void Update(float deltaTime, MethodInfo *method); + + // 01a781c0 + bool get_IsBusy(MethodInfo *method); + + // 01a782d0 + void SetObjectEntity(FieldObjectEntity_o *entity, MethodInfo *method); + + // 01a785e0 + void MoveTime(float targetYawAngle, float moveTime, MethodInfo *method); + }; + + struct FieldObjectRotateYaw_StaticFields + { + }; +} diff --git a/include/Dpr/Item/ItemInfo.hpp b/include/Dpr/Item/ItemInfo.hpp index bddb036f0..8c395d139 100644 --- a/include/Dpr/Item/ItemInfo.hpp +++ b/include/Dpr/Item/ItemInfo.hpp @@ -1,3 +1,5 @@ +#pragma once + #include "il2cpp.hpp" namespace Dpr @@ -9,6 +11,8 @@ namespace Dpr int32_t GetFieldFunctionType(MethodInfo * method); // 1ca61f0 int32_t get_Id(MethodInfo *method); + // 1ca5cc0 + int32_t get_count(MethodInfo *method); }; } -} \ No newline at end of file +} diff --git a/include/Dpr/Message/MessageManager.hpp b/include/Dpr/Message/MessageManager.hpp new file mode 100644 index 000000000..71c02edaf --- /dev/null +++ b/include/Dpr/Message/MessageManager.hpp @@ -0,0 +1,61 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/String.hpp" + +struct SmartPoint_AssetAssistant_SingletonMonoBehaviour_MessageManager__Fields { + UnityEngine_MonoBehaviour_Fields super; +}; + +namespace Dpr +{ + namespace Message + { + struct MessageManager_Fields + { + SmartPoint_AssetAssistant_SingletonMonoBehaviour_MessageManager__Fields super; + struct Dpr_Message_MsgDataFileLoader_o* msbtLoader; + struct Dpr_Message_MessageDataModel_o* dataModel; + struct Dpr_Message_TagWordBuffer_o* tagWordBuffer; + struct Dpr_Message_MessageWordDataPool_o* wordDataPool; + }; + + struct MessageManager_RGCTXs + { + }; + + struct MessageManager_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + VirtualInvokeData _4_Awake; + VirtualInvokeData _5_OnApplicationQuit; + }; + + struct MessageManager_c + { + Il2CppClass_1 _1; + struct MessageManager_StaticFields* static_fields; + MessageManager_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + MessageManager_VTable vtable; + }; + + struct MessageManager_o + { + MessageManager_c *klass; + void *monitor; + MessageManager_Fields fields; + + // 0210ce50 + System::String * GetNameMessage(System::String *fileName, System::String *label, MethodInfo *method); + }; + + struct MessageManager_StaticFields + { + struct UnityEngine_Events_UnityAction_bool__o* onChangeKanjiMode; + }; + } +} diff --git a/include/Dpr/UI/UIBag.hpp b/include/Dpr/UI/UIBag.hpp index 3dea97747..c9494fde2 100644 --- a/include/Dpr/UI/UIBag.hpp +++ b/include/Dpr/UI/UIBag.hpp @@ -1,19 +1,61 @@ +#pragma once + #include "il2cpp.hpp" #include "System/Array.hpp" +#include "Pml/PokePara/PokemonParam.h" namespace Dpr { namespace UI { - struct UIBag_BattleBootParam_Fields { + struct UIBag___c__DisplayClass135_0_Fields + { + struct Pml::PokePara::PokemonParam_o* pokeParam; + }; + + struct UIBag___c__DisplayClass135_0_RGCTXs + { + }; + + struct UIBag___c__DisplayClass135_0_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct UIBag___c__DisplayClass135_0_c + { + Il2CppClass_1 _1; + struct UIBag___c__DisplayClass135_0_StaticFields* static_fields; + UIBag___c__DisplayClass135_0_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + UIBag___c__DisplayClass135_0_VTable vtable; + }; + + struct UIBag___c__DisplayClass135_0_o + { + UIBag___c__DisplayClass135_0_c *klass; + void *monitor; + UIBag___c__DisplayClass135_0_Fields fields; + }; + + struct UIBag___c__DisplayClass135_0_StaticFields + { + }; + + struct UIBag_BattleBootParam_Fields + { int32_t TopMemberIndex; bool IsTrainerBattle; bool isDouble; System::Array * SasiosaeFlags; }; - struct UIBag_BattleBootParam_o { + struct UIBag_BattleBootParam_o + { UIBag_BattleBootParam_Fields fields; }; } -} \ No newline at end of file +} diff --git a/include/Effect/EffectInstance.hpp b/include/Effect/EffectInstance.hpp new file mode 100644 index 000000000..8ee53ba97 --- /dev/null +++ b/include/Effect/EffectInstance.hpp @@ -0,0 +1,61 @@ +#pragma once + +#include "il2cpp.hpp" +#include "UnityEngine/Color.hpp" + +namespace Effect +{ + struct EffectInstance_Fields + { + struct EffectData_o* _effectData; + struct UnityEngine_ParticleSystem_o* _particleSystem; + struct ParticleSystemController_o* _particleSystemController; + struct UnityEngine_Events_UnityAction_object__o* _onFinished; + struct UnityEngine_Events_UnityAction_EffectInstance__o* _onPlayFinished; + struct UnityEngine_Transform_o* _attachedTransform; + struct UnityEngine_Vector3_o _localPosition; + struct UnityEngine_Quaternion_o _localRotation; + struct UnityEngine::Color_o _mulColor; + float _stopFadeLifeTime; + float _stopFadeTime; + }; + + struct EffectInstance_RGCTXs + { + }; + + struct EffectInstance_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + VirtualInvokeData _4_IObjectPoolInstance_SetGameObject; + VirtualInvokeData _5_IObjectPoolInstance_GetGameObject; + VirtualInvokeData _6_IObjectPoolInstance_OnCreate; + VirtualInvokeData _7_IObjectPoolInstance_OnRelease; + }; + + struct EffectInstance_c + { + Il2CppClass_1 _1; + struct EffectInstance_StaticFields* static_fields; + EffectInstance_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + EffectInstance_VTable vtable; + }; + + struct EffectInstance_o + { + EffectInstance_c *klass; + void *monitor; + EffectInstance_Fields fields; + + // 01efe7b0 + void Stop(float fadeTime, bool isForce, MethodInfo *method); + }; + + struct EffectInstance_StaticFields + { + }; +} diff --git a/include/EncountDataWork.hpp b/include/EncountDataWork.hpp new file mode 100644 index 000000000..9c5bb61af --- /dev/null +++ b/include/EncountDataWork.hpp @@ -0,0 +1,15 @@ +#pragma once + +#include "il2cpp.hpp" + +struct EncountDataWork +{ + // 01f08ac0 + static bool EncDataSave_CanUseSpray(MethodInfo *method); + // 01f08e10 + static bool GetMovePokeData(int32_t index, DPData::MV_POKE_DATA_o *outData, MethodInfo *method); + // 01f09d60 + static bool IsTairyouHassei(MethodInfo *method); + // 01f09de0 + static int32_t GetUrayamaIndex(int32_t index, MethodInfo *method); +}; diff --git a/include/EntityManager.hpp b/include/EntityManager.hpp new file mode 100644 index 000000000..e894ef869 --- /dev/null +++ b/include/EntityManager.hpp @@ -0,0 +1,66 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/Array.hpp" +#include "FieldNagisaGymGearEntity.hpp" + +struct EntityManager_Fields +{ +}; + +struct EntityManager_RGCTXs +{ +}; + +struct EntityManager_VTable +{ + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; +}; + +struct EntityManager_c +{ + Il2CppClass_1 _1; + struct EntityManager_StaticFields* static_fields; + EntityManager_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + EntityManager_VTable vtable; +}; + +struct EntityManager_o +{ + EntityManager_c *klass; + void *monitor; + EntityManager_Fields fields; +}; + +struct EntityManager_StaticFields +{ + struct System_Collections_Generic_List_BaseEntity__o* _baseEntities; + struct BattlePlayerEntity_o* _activeBattlePlayer_k__BackingField; + struct FieldPlayerEntity_o* _activeFieldPlayer_k__BackingField; + struct FieldPokemonEntity_o* _activeFieldPartner_k__BackingField; + struct FieldPlayerEntity_array* _fieldPlayers_k__BackingField; + struct FieldPokemonEntity_array* _fieldPokemons_k__BackingField; + struct FieldCharacterEntity_array* _fieldCharacters_k__BackingField; + struct FieldObjectEntity_array* _fieldObjects_k__BackingField; + struct FieldEventEntity_array* _fieldEventObjects_k__BackingField; + struct FieldEventDoorEntity_array* _fieldDoorObjects_k__BackingField; + struct FieldEventLiftEntity_array* _fieldLiftObjects_k__BackingField; + struct FieldTobariGymWallEntity_array* _fieldTobariGymWalls_k__BackingField; + struct System::Array* _fieldNagisaGymGears_k__BackingField; + struct FieldNomoseGymWaterEntity_array* _fieldNomoseGymWater_k__BackingField; + struct FieldNomoseGymSwitchEntity_array* _fieldNomoseGymSwitches_k__BackingField; + struct FieldElevatorBackgroundEntity_array* _fieldElevatorBackground_k__BackingField; + struct FieldPokemonCenterEntity_array* _fieldPokemonCenter_k__BackingField; + struct FieldPokemonCenterMonitorEntity_array* _fieldPokemonCenterMonitor_k__BackingField; + struct FieldEventTrainEntity_array* _fieldEventTrain_k__BackingField; + struct FieldEyePaintingEntity_array* _fieldEyePainting_k__BackingField; + struct FieldEmbankmentEntity_array* _fieldEmbankment_k__BackingField; + struct FieldTvEntity_array* _fieldTv_k__BackingField; +}; + +// 04c59d10 +extern EntityManager_c * EntityManager_TypeInfo; diff --git a/include/EvData/ArgType.hpp b/include/EvData/ArgType.hpp new file mode 100644 index 000000000..4bd663daf --- /dev/null +++ b/include/EvData/ArgType.hpp @@ -0,0 +1,14 @@ +#pragma once + +namespace EvData +{ + enum ArgType + { + Command = 0, + Float = 1, + Work = 2, + Flag = 3, + SysFlag = 4, + String = 5, + }; +} diff --git a/include/EvData/EvCmdID.hpp b/include/EvData/EvCmdID.hpp new file mode 100644 index 000000000..d7c918ed2 --- /dev/null +++ b/include/EvData/EvCmdID.hpp @@ -0,0 +1,1244 @@ +#pragma once + +namespace EvData +{ + enum EvCmdID + { + _NOP = 1, + _DUMMY = 2, + _END = 3, + _TIME_WAIT = 4, + _LD_REG_VAL = 5, + _LD_REG_WDATA = 6, + _LD_REG_ADR = 7, + _LD_ADR_VAL = 8, + _LD_ADR_REG = 9, + _LD_REG_REG = 10, + _LD_ADR_ADR = 11, + _CP_REG_REG = 12, + _CP_REG_VAL = 13, + _CP_REG_ADR = 14, + _CP_ADR_REG = 15, + _CP_ADR_VAL = 16, + _CP_ADR_ADR = 17, + _CMPVAL = 18, + _CMPWK = 19, + _DEBUG_WATCH_WORK = 20, + _VM_ADD = 21, + _CHG_COMMON_SCR = 22, + _CHG_LOCAL_SCR = 23, + _JUMP = 24, + _OBJ_ID_JUMP = 25, + _BG_ID_JUMP = 26, + _PLAYER_DIR_JUMP = 27, + _CALL = 28, + _RET = 29, + _IF_JUMP = 30, + _IF_CALL = 31, + _IFVAL_JUMP = 32, + _IFVAL_CALL = 33, + _IFWK_JUMP = 34, + _IFWK_CALL = 35, + _SWITCH = 36, + _CASE_JUMP = 37, + _CASE_CANCEL = 38, + _ADD_WAITICON = 39, + _DEL_WAITICON = 40, + _FLAG_SET = 41, + _ARRIVE_FLAG_SET = 42, + _FLAG_RESET = 43, + _FLAG_CHECK = 44, + _IF_FLAGON_JUMP = 45, + _IF_FLAGOFF_JUMP = 46, + _IF_FLAGON_CALL = 47, + _IF_FLAGOFF_CALL = 48, + _FLAG_CHECK_WK = 49, + _FLAG_SET_WK = 50, + _TRAINER_FLAG_SET = 51, + _TRAINER_FLAG_RESET = 52, + _TRAINER_FLAG_CHECK = 53, + _IF_TR_FLAGON_JUMP = 54, + _IF_TR_FLAGOFF_JUMP = 55, + _IF_TR_FLAGON_CALL = 56, + _IF_TR_FLAGOFF_CALL = 57, + _ADD_WK = 58, + _SUB_WK = 59, + _LDVAL = 60, + _LDWK = 61, + _LDWKVAL = 62, + _TALKMSG_ALLPUT = 63, + _TALKMSG_ALLPUT_ARC = 64, + _TALKMSG_ARC = 65, + _TALKMSG_ALLPUT_PMS = 66, + _TALKMSG_PMS = 67, + _TALKMSG_BTOWER_APPEAR = 68, + _TALKMSG_NG_POKE_NAME = 69, + _TALKMSG = 70, + _TALKMSG_SP = 71, + _TALKMSG_SP_AUTO = 72, + _TALKMSG_NOSKIP = 73, + _TALKMSG_CON_SIO = 74, + _TALKMSG_AUTOGET = 75, + _AB_KEYWAIT = 76, + _AB_KEY_TIME_WAIT = 77, + _LAST_KEYWAIT = 78, + _NEXT_ANM_LAST_KEYWAIT = 79, + _TALK_OPEN = 80, + _TALK_CLOSE = 81, + _TALK_CLOSE_NO_CLEAR = 82, + _TALK_KEYWAIT = 83, + _EASY_OBJ_MSG = 84, + _EASY_MSG = 85, + _BOARD_MAKE = 86, + _INFOBOARD_MAKE = 87, + _BOARD_REQ = 88, + _BOARD_REQ_WAIT = 89, + _BOARD_MSG = 90, + _BOARD_END_WAIT = 91, + _EASY_BOARD_MSG = 92, + _EASY_INFOBOARD_MSG = 93, + _MENU_REQ = 94, + _BG_SCROLL = 95, + _YES_NO_WIN = 96, + _GUINNESS_WIN = 97, + _BMPMENU_INIT = 98, + _BMPMENU_INIT_EX = 99, + _BMPMENU_MAKE_LIST = 100, + _BMPMENU_MAKE_LIST16 = 101, + _BMPMENU_START = 102, + _SEL_WIN_JUMP = 103, + _BMPLIST_INIT = 104, + _BMPLIST_INIT_EX = 105, + _BMPLIST_MAKE_LIST = 106, + _BMPLIST_START = 107, + _BMPMENU_HV_START = 108, + _SE_PLAY = 109, + _SE_STOP = 110, + _SE_WAIT = 111, + _VOICE_PLAY = 112, + _VOICE_WAIT = 113, + _EASY_VOICE_MSG = 114, + _ME_PLAY = 115, + _ME_WAIT = 116, + _SND_INITIAL_VOL_SET = 117, + _BGM_PLAY = 118, + _BGM_PLAY_CHECK = 119, + _BGM_STOP = 120, + _BGM_NOW_MAP_PLAY = 121, + _BGM_SPECIAL_SET = 122, + _BGM_SPECIAL_CLR = 123, + _BGM_FADEOUT = 124, + _BGM_FADEOUT_PLAY = 125, + _BGM_FADEIN = 126, + _BGM_PLAYER_PAUSE = 127, + _PLAYER_FIELD_DEMO_BGM_PLAY = 128, + _CTRL_BGM_FLAG_SET = 129, + _CTRL_BGM_FLAG_RESET = 130, + _PERAP_DATA_CHECK = 131, + _PERAP_REC_START = 132, + _PERAP_REC_STOP = 133, + _PERAP_SAVE = 134, + _SND_CLIMAX_DATA_LOAD = 135, + _OBJ_ANIME = 136, + _OBJ_ANIME_POS = 137, + _ANIME_LABEL = 138, + _ANIME_DATA = 139, + _OBJ_ANIME_WAIT = 140, + _TALK_OBJ_PAUSE_ALL = 141, + _OBJ_PAUSE_ALL = 142, + _OBJ_PAUSE_CLEAR_ALL = 143, + _OBJ_PAUSE = 144, + _OBJ_PAUSE_CLEAR = 145, + _OBJ_ADD = 146, + _OBJ_DEL = 147, + _VANISH_DUMMY_OBJ_ADD = 148, + _VANISH_DUMMY_OBJ_DEL = 149, + _TURN_HERO_SITE = 150, + _TALK_OBJ_START = 151, + _TALK_OBJ_START_TURN_NOT = 152, + _TALK_OBJ_END = 153, + _TALK_START = 154, + _EVENT_START = 155, + _TALK_END = 156, + _EVENT_END = 157, + _PLAYER_POS_GET = 158, + _OBJ_POS_GET = 159, + _PLAYER_POS_OFFSET_SET = 160, + _PLAYER_DIR_GET = 161, + _NOT_ZONE_DEL_SET = 162, + _MOVE_CODE_CHANGE = 163, + _MOVE_CODE_GET = 164, + _PAIR_OBJID_SET = 165, + _EVENT_DATA = 166, + _EVENT_DATA_END = 167, + _SP_EVENT_DATA_END = 168, + _SCENE_CHANGE_LABEL = 169, + _SCENE_CHANGE_DATA = 170, + _SCENE_CHANGE_END = 171, + _FLAG_CHANGE_LABEL = 172, + _OBJ_CHANGE_LABEL = 173, + _INIT_CHANGE_LABEL = 174, + _ADD_GOLD = 175, + _SUB_GOLD = 176, + _COMP_GOLD = 177, + _GOLD_WIN_WRITE = 178, + _GOLD_WIN_DEL = 179, + _GOLD_WRITE = 180, + _COIN_WIN_WRITE = 181, + _COIN_WIN_DEL = 182, + _COIN_WRITE = 183, + _GET_COIN_NUM = 184, + _ADD_COIN = 185, + _SUB_COIN = 186, + _FLD_ITEM_EVENT = 187, + _HIDE_ITEM_EVENT = 188, + _ADD_ITEM = 189, + _SUB_ITEM = 190, + _ADD_ITEM_CHK = 191, + _ITEM_CHK = 192, + _WAZA_ITEM_CHK = 193, + _GET_POCKET_NO = 194, + _CHECK_POCKET = 195, + _ADD_BOX_ITEM = 196, + _CHK_BOX_ITEM = 197, + _ADD_GOODS = 198, + _SUB_GOODS = 199, + _ADD_GOODS_CHK = 200, + _GOODS_CHK = 201, + _ADD_TRAP = 202, + _SUB_TRAP = 203, + _ADD_TRAP_CHK = 204, + _TRAP_CHK = 205, + _ADD_TREASURE = 206, + _SUB_TREASURE = 207, + _ADD_TREASURE_CHK = 208, + _TREASURE_CHK = 209, + _ADD_TAMA = 210, + _SUB_TAMA = 211, + _ADD_TAMA_CHK = 212, + _TAMA_CHK = 213, + _CB_SEAL_KIND_NUM_GET = 214, + _CB_ITEM_NUM_GET = 215, + _CB_ITEM_NUM_ADD = 216, + _UNKNOWN_FORM_GET = 217, + _ADD_POKEMON = 218, + _ADD_TAMAGO = 219, + _CHG_POKE_WAZA = 220, + _CHK_POKE_WAZA = 221, + _CHK_POKE_WAZA_GROUP = 222, + _APPROVE_POISON_DEAD = 223, + _REVENGE_TRAINER_SEARCH = 224, + _INIT_WEATHER = 225, + _SET_WEATHER = 226, + _UPDATE_WEATHER = 227, + _GET_MAP_POS = 228, + _GET_TEMOTI_POKE_NUM = 229, + _SET_MAP_PROC = 230, + _FINISH_MAP_PROC = 231, + _WIFI_AUTO_REG = 232, + _WIFI_P2P_MATCH_EVENT_CALL = 233, + _WIFI_P2P_MATCH_SET_DEL = 234, + _COMM_GET_CURRENT_ID = 235, + _DENDOU_NUM_GET = 236, + _POKE_WINDOW_PUT = 237, + _POKE_WINDOW_PUT_PP = 238, + _POKE_WINDOW_DEL = 239, + _POKE_WINDOW_ANM = 240, + _POKE_WINDOW_ANM_WAIT = 241, + _BTL_SEARCHER_EVENT_CALL = 242, + _BTL_SEARCHER_DIR_MV_SET = 243, + _MSG_BOY_EVENT = 244, + _IMAGE_CLIP_SET_PROC = 245, + _IMAGE_CLIP_VIEW_TV_SET_PROC = 246, + _IMAGE_CLIP_VIEW_CON_SET_PROC = 247, + _CUSTOM_BALL_EVENT_CALL = 248, + _TMAP_BG_SET_PROC = 249, + _BOX_SET_PROC = 250, + _OEKAKI_BOARD_SET_PROC = 251, + _TR_CARD_SET_PROC = 252, + _TRADE_LIST_SET_PROC = 253, + _RECORD_CORNER_SET_PROC = 254, + _DENDOU_SET_PROC = 255, + _PC_DENDOU_SET_PROC = 256, + _WORLDTRADE_SET_PROC = 257, + _DPW_INIT_PROC = 258, + _FIRST_POKE_SELECT_PROC = 259, + _FIRST_POKE_SELECT_SET_AND_DEL = 260, + _BAG_SET_PROC_NORMAL = 261, + _BAG_SET_PROC_KINOMI = 262, + _BAG_GET_RESULT = 263, + _POKELIST_SET_PROC = 264, + _NPC_TRADE_POKELIST_SET_PROC = 265, + _UNION_POKELIST_SET_PROC = 266, + _POKELIST_GET_RESULT = 267, + _CON_POKELIST_SET_PROC = 268, + _CON_POKELIST_GET_RESULT = 269, + _CON_POKESTATUS_SET_PROC = 270, + _POKESTATUS_GET_RESULT = 271, + _WIFI_EARTH_SET_PROC = 272, + _EYE_TRAINER_MOVE_SET = 273, + _EYE_TRAINER_MOVE_CHECK = 274, + _EYE_TRAINER_TYPE_GET = 275, + _EYE_TRAINER_ID_GET = 276, + _NAMEIN = 277, + _NAMEIN_POKE = 278, + _WIPE_FADE_START = 279, + _WIPE_FADE_END_CHECK = 280, + _WHITE_OUT = 281, + _WHITE_IN = 282, + _BLACK_OUT = 283, + _BLACK_IN = 284, + _MAP_CHANGE = 285, + _MAP_CHANGE_NONE_FADE = 286, + _COLOSSEUM_MAP_CHANGE_IN = 287, + _COLOSSEUM_MAP_CHANGE_OUT = 288, + _GET_BEFORE_ZONE_ID = 289, + _GET_NOW_ZONE_ID = 290, + _KABENOBORI = 291, + _NAMINORI = 292, + _BICYCLE_CHECK = 293, + _BICYCLE_REQ = 294, + _BICYCLE_REQ_NON_BGM = 295, + _CYCLING_ROAD_SET = 296, + _PLAYER_FORM_GET = 297, + _PLAYER_REQ_BIT_ON = 298, + _PLAYER_REQ_START = 299, + _TAKINOBORI = 300, + _SORAWOTOBU = 301, + _HIDEN_FLASH = 302, + _HIDEN_KIRIBARAI = 303, + _CUTIN = 304, + _CON_HERO_CHANGE = 305, + _PLAYER_NAME = 306, + _RIVAL_NAME = 307, + _SUPPORT_NAME = 308, + _POKEMON_NAME = 309, + _ITEM_NAME = 310, + _POCKET_NAME = 311, + _ITEM_WAZA_NAME = 312, + _WAZA_NAME = 313, + _NUMBER_NAME = 314, + _NUMBER_NAME_EX = 315, + _BIRTH_DAY_CHECK = 316, + _ANOON_SEE_NUM = 317, + _NICK_NAME = 318, + _POKETCH_NAME = 319, + _TR_TYPE_NAME = 320, + _MY_TR_TYPE_NAME = 321, + _POKEMON_NAME_EXTRA = 322, + _FIRST_POKEMON_NAME = 323, + _RIVAL_POKEMON_NAME = 324, + _SUPPORT_POKEMON_NAME = 325, + _FIRST_POKE_NO_GET = 326, + _NUTS_NAME = 327, + _SEIKAKU_NAME = 328, + _GOODS_NAME = 329, + _TRAP_NAME = 330, + _TAMA_NAME = 331, + _ZONE_NAME = 332, + _GENERATE_INFO_GET = 333, + _TRAINER_ID_GET = 334, + _TRAINER_BTL_SET = 335, + _TRAINER_MULTI_BTL_SET = 336, + _TRAINER_MSG_SET = 337, + _TRAINER_TALK_TYPE_GET = 338, + _REVENGE_TRAINER_TALK_TYPE_GET = 339, + _TRAINER_TYPE_GET = 340, + _TRAINER_BGM_SET = 341, + _TRAINER_LOSE = 342, + _TRAINER_LOSE_CHECK = 343, + _NORMAL_LOSE = 344, + _LOSE_CHECK = 345, + _SEACRET_POKE_RETRY_CHECK = 346, + _HAIFU_POKE_RETRY_CHECK = 347, + _2VS2_BATTLE_CHECK = 348, + _DEBUG_BTL_SET = 349, + _DEBUG_TRAINER_FLAG_SET = 350, + _DEBUG_TRAINER_FLAG_ON_JUMP = 351, + _DEBUG_TR_TALK_BTL = 352, + _SEL_PARENT_WIN = 353, + _SEL_CHILD_WIN = 354, + _DEBUG_PARENT_WIN = 355, + _DEBUG_CHILD_WIN = 356, + _DEBUG_SIO_ENCOUNT = 357, + _DEBUG_SIO_CONTEST = 358, + _CONSIO_TIMING_SEND = 359, + _CONSIO_TIMING_CHECK = 360, + _CON_SYSTEM_CREATE = 361, + _CON_SYSTEM_EXIT = 362, + _CON_JUDGE_NAME_GET = 363, + _CON_BREEDER_NAME_GET = 364, + _CON_NICK_NAME_GET = 365, + _CON_NUM_TAG_SET = 366, + _CON_SIO_PARAM_INIT_SET = 367, + _CONTEST_PROC = 368, + _CON_RANK_NAME_GET = 369, + _CON_TYPE_NAME_GET = 370, + _CON_VICTORY_BREEDER_NAME_GET = 371, + _CON_VICTORY_ITEM_NO_GET = 372, + _CON_VICTORY_NICK_NAME_GET = 373, + _CON_RANKING_CHECK = 374, + _CON_VICTORY_ENTRY_NO_GET = 375, + _CON_MY_ENTRY_NO_GET = 376, + _CON_OBJ_CODE_GET = 377, + _CON_POPULARITY_GET = 378, + _CON_DESK_MODE_GET = 379, + _CON_HAVE_RIBBON_CHECK = 380, + _CON_RIBBON_NAME_GET = 381, + _CON_ACCE_NO_GET = 382, + _CON_ENTRY_PARAM_GET = 383, + _CON_CAMERA_FLASH_SET = 384, + _CON_CAMERA_FLASH_CHECK = 385, + _CON_HBLANK_STOP = 386, + _CON_HBLANK_START = 387, + _CON_ENDING_SKIP_CHECK = 388, + _CON_RECORD_DISP = 389, + _CON_MSGPRINT_FLAG_SET = 390, + _CON_MSGPRINT_FLAG_RESET = 391, + _SP_LOCATION_SET = 392, + _ELEVATOR_FLOOR_GET = 393, + _ELEVATOR_FLOOR_WRITE = 394, + _SHINOU_ZUKAN_SEE_NUM = 395, + _SHINOU_ZUKAN_GET_NUM = 396, + _ZENKOKU_ZUKAN_SEE_NUM = 397, + _ZENKOKU_ZUKAN_GET_NUM = 398, + _CHK_ZENKOKU_ZUKAN = 399, + _GET_HYOUKA_MSGID = 400, + _WILD_BTL_SET = 401, + _SP_WILD_BTL_SET = 402, + _FIRST_BTL_SET = 403, + _CAPTURE_BTL_SET = 404, + _HONEY_TREE = 405, + _GET_HONEY_TREE_STATE = 406, + _HONEY_TREE_BTL_SET = 407, + _HONEY_TREE_AFTER_SET = 408, + _TSIGN_SET_PROC = 409, + _REPORT_SAVE_CHECK = 410, + _REPORT_SAVE = 411, + _REPORT_WIN_OPEN = 412, + _REPORT_WIN_CLOSE = 413, + _CLIP_TVSAVEDATA_CHECK = 414, + _CLIP_CONSAVEDATA_CHECK = 415, + _CLIP_TV_TITLE_SAVE = 416, + _GET_POKETCH = 417, + _GET_POKETCH_FLAG = 418, + _POKETCH_ADD = 419, + _POKETCH_CHECK = 420, + _COMM_SYNCHRONIZE = 421, + _COMM_RESET = 422, + _UNION_PARENT_CARD_TALK_NO = 423, + _UNION_GET_INFO_TALK_NO = 424, + _UNION_BEACON_CHANGE = 425, + _UNION_CONNECT_TALK_DENIED = 426, + _UNION_CONNECT_TALK_OK = 427, + _UNION_TRAINER_NAME_REGIST = 428, + _UNION_RETURN_SETUP = 429, + _UNION_CONNECT_CUT_RESTART = 430, + _UNION_GET_TALK_NUMBER = 431, + _UNION_ID_SET = 432, + _UNION_RESULT_GET = 433, + _UNION_OBJ_ALL_VANISH = 434, + _UNION_SCRIPT_RESULT_SET = 435, + _UNION_PARENT_START_COMMAND_SET = 436, + _UNION_CHILD_SELECT_COMMAND_SET = 437, + _UNION_CONNECT_START = 438, + _UNION_MAP_CHANGE = 439, + _UNION_VIEW_TR_SEL_SET = 440, + _UNION_VIEW_TR_TYPE_MSG_GET = 441, + _UNION_VIEW_TR_TYPE_NO_GET = 442, + _UNION_VIEW_MY_STATUS_SET = 443, + _SYS_FLAG_ZUKAN_GET = 444, + _SYS_FLAG_ZUKAN_SET = 445, + _SYS_FLAG_SHOES_GET = 446, + _SYS_FLAG_SHOES_SET = 447, + _SYS_FLAG_BADGE_GET = 448, + _SYS_FLAG_BADGE_SET = 449, + _SYS_FLAG_BADGE_COUNT = 450, + _SYS_FLAG_BAG_GET = 451, + _SYS_FLAG_BAG_SET = 452, + _SYS_FLAG_PAIR_GET = 453, + _SYS_FLAG_PAIR_SET = 454, + _SYS_FLAG_PAIR_RESET = 455, + _SYS_FLAG_ONE_STEP_GET = 456, + _SYS_FLAG_ONE_STEP_SET = 457, + _SYS_FLAG_ONE_STEP_RESET = 458, + _SYS_FLAG_GAME_CLEAR_GET = 459, + _SYS_FLAG_GAME_CLEAR_SET = 460, + _SYS_FLAG_KAIRIKI_SET = 461, + _SYS_FLAG_KAIRIKI_RESET = 462, + _SYS_FLAG_KAIRIKI_GET = 463, + _SYS_FLAG_FLASH_SET = 464, + _SYS_FLAG_FLASH_RESET = 465, + _SYS_FLAG_FLASH_GET = 466, + _SYS_FLAG_KIRIBARAI_SET = 467, + _SYS_FLAG_KIRIBARAI_RESET = 468, + _SYS_FLAG_KIRIBARAI_GET = 469, + _SHOP_CALL = 470, + _FIX_SHOP_CALL = 471, + _FIX_GOODS_CALL = 472, + _FIX_SEAL_CALL = 473, + _ACCE_SHOP_CALL = 474, + _PLAYER_REPORT_DRAW_SET = 475, + _PLAYER_REPORT_DRAW_DEL = 476, + _GAME_OVER_CALL = 477, + _SET_WARP_ID = 478, + _GET_MY_SEX = 479, + _PC_KAIFUKU = 480, + _UG_MAN_SHOP_NPC_RAND_PLACE = 481, + _COMM_DIRECT_END = 482, + _COMM_DIRECT_END_TIMING = 483, + _COMM_DIRECT_ENTER_BTL_ROOM = 484, + _COMM_PLAYER_SET_DIR = 485, + _SET_UP_DOOR_ANIME = 486, + _WAIT_3D_ANIME = 487, + _FREE_3D_ANIME = 488, + _SEQ_OPEN_DOOR = 489, + _SEQ_CLOSE_DOOR = 490, + _PMS_INPUT_SINGLE = 491, + _PMS_INPUT_DOUBLE = 492, + _PMS_BUF = 493, + _GET_SEED_STATUS = 494, + _GET_SEED_TYPE = 495, + _GET_SEED_COMPOST = 496, + _GET_SEED_GROUND = 497, + _GET_SEED_COUNT = 498, + _SET_SEED_COMPOST = 499, + _SET_SEED_NUTS = 500, + _SET_SEED_WATER = 501, + _TAKE_SEED = 502, + _SXY_POS_CHANGE = 503, + _OBJ_POS_CHANGE = 504, + _SXY_MV_CHANGE = 505, + _SXY_DIR_CHANGE = 506, + _SXY_EXIT_POS_CHANGE = 507, + _SXY_BG_POS_CHANGE = 508, + _OBJ_DIR_CHANGE = 509, + _RETURN_SCRIPT_WK_SET = 510, + _MSGEXPANDBUF = 511, + _GET_SODATE_NAME = 512, + _GET_SODATEYA_ZIISAN = 513, + _INIT_WATER_GYM = 514, + _PUSH_WATER_GYM_BUTTON = 515, + _INIT_GHOST_GYM = 516, + _MOVE_GHOST_GYM_LIFT = 517, + _INIT_STEEL_GYM = 518, + _INIT_COMBAT_GYM = 519, + _INIT_ELEC_GYM = 520, + _ROTATE_ELEC_GYM_GEAR = 521, + _GET_POKE_COUNT = 522, + _GET_POKE_COUNT2 = 523, + _GET_POKE_COUNT3 = 524, + _GET_POKE_COUNT4 = 525, + _GET_TAMAGO_COUNT = 526, + _UG_SHOP_MENU_INIT = 527, + _UG_SHOP_TALK_START = 528, + _UG_SHOP_TALK_END = 529, + _UG_SHOP_ITEM_NAME = 530, + _UG_SHOP_TRAP_NAME = 531, + _DEL_SODATEYA_EGG = 532, + _GET_SODATEYA_EGG = 533, + _MSG_SODATEYA_AISHOU = 534, + _MSG_AZUKE_SET = 535, + _SET_SODATEYA_POKE = 536, + _SODATEYA_POKELIST = 537, + _HIKITORI_LIST = 538, + _SODATE_POKE_LEVEL_STR = 539, + _HIKITORI_RYOUKIN = 540, + _HIKITORI_POKE = 541, + _TAMAGO_DEMO = 542, + _TEMOTI_MONSNO = 543, + _MONS_OWN_CHK = 544, + _CHK_TEMOTI_POKERUS = 545, + _TEMOTI_POKE_SEX_GET = 546, + _SUB_MY_GOLD = 547, + _COMP_MY_GOLD = 548, + _OBJ_VISIBLE = 549, + _OBJ_INVISIBLE = 550, + _MAILBOX = 551, + _GET_MAILBOX_DATANUM = 552, + _RANKING_VIEW = 553, + _GET_TIME_ZONE = 554, + _GET_RND = 555, + _GET_RND_NEXT = 556, + _GET_NATSUKI = 557, + _ADD_NATSUKI = 558, + _SUB_NATSUKI = 559, + _HIKITORI_LIST_NAME_SET = 560, + _GET_SODATEYA_AISHOU = 561, + _SODATEYA_TAMAGO_CHK = 562, + _TEMOTI_POKE_CHK = 563, + _OOKISA_RECORD_CHK = 564, + _OOKISA_RECORD_SET = 565, + _OOKISA_TEMOTI_SET_BUF = 566, + _OOKISA_KIROKU_SET_BUF = 567, + _OOKISA_KURABE_INIT = 568, + _WAZALIST_SET_PROC = 569, + _WAZALIST_GET_RESULT = 570, + _WAZA_COUNT = 571, + _WAZA_DEL = 572, + _TEMOTI_WAZANO = 573, + _TEMOTI_WAZA_NAME = 574, + _FNOTE_START_SET = 575, + _FNOTE_DATA_MAKE = 576, + _FNOTE_DATA_SAVE = 577, + _IMC_ACCE_ADD_ITEM = 578, + _IMC_ACCE_ADD_ITEM_CHK = 579, + _IMC_ACCE_ITEM_CHK = 580, + _IMC_BG_ADD_ITEM = 581, + _IMC_BG_ITEM_CHK = 582, + _NUTMIXER_CALL = 583, + _NUTMIXER_PLAY_CHECK = 584, + _ZUKAN_CHK_SHINOU = 585, + _ZUKAN_CHK_NATIONAL = 586, + _ZUKAN_RECONGNIZE_SHINOU = 587, + _ZUKAN_RECONGNIZE_NATIONAL = 588, + _URAYAMA_ENCOUNT_SET = 589, + _URAYAMA_ENCOUNT_NO_CHK = 590, + _POKE_MAIL_CHK = 591, + _PAPERPLANE_SET = 592, + _POKE_MAIL_DEL = 593, + _KASEKI_COUNT = 594, + _ITEMLIST_SET_PROC = 595, + _ITEMLIST_GET_RESULT = 596, + _ITEMNO_TO_MONSNO = 597, + _KASEKI_ITEMNO = 598, + _POKE_LEVEL_CHK = 599, + _BTOWER_APP_CALL = 600, + _BTOWER_WORK_CLEAR = 601, + _BTOWER_WORK_INIT = 602, + _BTOWER_WORK_RELEASE = 603, + _BTOWER_TOOLS = 604, + _BTOWER_SEVEN_POKE_GET = 605, + _BTOWER_PRIZE_GET = 606, + _BTOWER_PRIZEMAN_SET = 607, + _BTOWER_SEND_BUF = 608, + _BTOWER_RECV_BUF = 609, + _BTOWER_GET_LEADER_ROOMID = 610, + _BTOWER_IS_LEADER_EXIST = 611, + _RECORD_INC = 612, + _RECORD_GET = 613, + _RECORD_ADD = 614, + _RECORD_SET = 615, + _RECORD_SETIFLARGE = 616, + _SAFARI_START = 617, + _SAFARI_END = 618, + _CALL_SAFARI_SCOPE = 619, + _CLIMAX_DEMO = 620, + _INIT_SAFARI_TRAIN = 621, + _MOVE_SAFARI_TRAIN = 622, + _CHECK_SAFARI_TRAIN = 623, + _PLAYER_HEGIHT_VALID = 624, + _GET_POKE_SEIKAKU = 625, + _CHK_POKE_SEIKAKU_ALL = 626, + _UNDERGROUND_TALK_COUNT = 627, + _NATURAL_PARK_WALK_COUNT_CLEAR = 628, + _NATURAL_PARK_WALK_COUNT_GET = 629, + _NATURAL_PARK_ACCESSORY_NO_GET = 630, + _GET_NEWS_POKE_NO = 631, + _NEWS_COUNT_SET = 632, + _NEWS_COUNT_CHK = 633, + _START_GENERATE = 634, + _ADD_MOVE_POKE = 635, + _OSHIE_WAZA_COUNT = 636, + _REMAIND_WAZA_COUNT = 637, + _OSHIE_WAZALIST_SET_PROC = 638, + _REMAIND_WAZALIST_SET_PROC = 639, + _OSHIE_WAZALIST_GET_RESULT = 640, + _REMAIND_WAZALIST_GET_RESULT = 641, + _NORMAL_WAZALIST_SET_PROC = 642, + _NORMAL_WAZALIST_GET_RESULT = 643, + _FLD_TRADE_ALLOC = 644, + _FLD_TRADE_MONSNO = 645, + _FLD_TRADE_CHG_MONSNO = 646, + _FLD_TRADE_EVENT = 647, + _FLD_TRADE_DEL = 648, + _ZUKAN_TEXT_VER_UP = 649, + _ZUKAN_SEX_VER_UP = 650, + _ZENKOKU_ZUKAN_FLAG = 651, + _CHK_RIBBON_COUNT = 652, + _CHK_RIBBON_COUNT_ALL = 653, + _CHK_RIBBON = 654, + _SET_RIBBON = 655, + _RIBBON_NAME = 656, + _CHK_PRMEXP = 657, + _CHK_WEEK = 658, + _TV_ENTRY_WATCH_HIDE_ITEM = 659, + _TV_ENTRY_WATCH_CHANGE_NAME = 660, + _REGULATION_LIST_CALL = 661, + _ASHIATO_CHK = 662, + _PC_RECOVER_ANM = 663, + _ELEVATOR_ANM = 664, + _CALL_SHIP_DEMO = 665, + _DEBUG_PRINT_WORK = 666, + _DEBUG_PRINT_FLAG = 667, + _DEBUG_PRINT_WORK_STATIONED = 668, + _DEBUG_PRINT_FLAG_STATIONED = 669, + _PM_VERSION_GET = 670, + _FRONT_POKEMON = 671, + _TEMOTI_POKE_TYPE = 672, + _AIKOTOBA_KABEGAMI_SET = 673, + _GET_UG_HATA_NUM = 674, + _SETUP_PASO_ANM = 675, + _START_PASO_ON_ANM = 676, + _START_PASO_OFF_ANM = 677, + _GET_KUJI_ATARI_NUM = 678, + _KUJI_ATARI_CHK = 679, + _KUJI_ATARI_INIT = 680, + _NICK_NAME_PC = 681, + _TV_INTERVIEWER_CHECK = 682, + _COUNT_MONSBOX_SPACE = 683, + _POKEPARK_CONTROL = 684, + _POKEPARK_DEPOSIT_COUNT = 685, + _POKEPARK_TRANS_MONS = 686, + _POKEPARK_GET_SCORE = 687, + _DENDOU_BALL_ANM = 688, + _INIT_FLD_LIFT = 689, + _MOVE_FLD_LIFT = 690, + _CHECK_FLD_LIFT = 691, + _SETUP_RAH_CYL = 692, + _START_RAH_CYL = 693, + _ADD_SCORE = 694, + _ACCE_NAME = 695, + _PARTY_MONSNO_CHECK = 696, + _PARTY_DEOKISISUFORM_CHANGE = 697, + _CHECKMINOMUCHICOMP = 698, + _POKETCH_HOOK_SET = 699, + _POKETCH_HOOK_RESET = 700, + _SLOT_MACHINE = 701, + _GET_NOW_HOUR = 702, + _FLDOBJ_SHAKE_ANM = 703, + _FLDOBJ_BLINK_ANM = 704, + _D20R0106_LEGEND_IS_UNSEAL = 705, + _DRESSING_IMC_ACCE_CHECK = 706, + _AGB_CARTRIDGE_VER_GET = 707, + _UNDERGROUND_TALK_COUNT_CLEAR = 708, + _HIDEMAP_STATE_CHG = 709, + _NAMEIN_MONUMENT = 710, + _MONUMENT_NAME = 711, + _IMC_BG_NAME = 712, + _COMP_COIN = 713, + _SLOT_RENTYAN_CHK = 714, + _ADD_COIN_CHK = 715, + _LEVEL_JIJII_NO = 716, + _POKE_LEVEL_GET = 717, + _IMC_ACCE_SUB_ITEM = 718, + _C08R0801SCOPECAMERASET = 719, + _LEVEL_JIJII_INIT = 720, + _NEW_NANKAI_WORD_SET = 721, + _REGULAR_CHECK = 722, + _NEW_NANKAI_WORD_COMPLETE_CHECK = 723, + _TEMOTI_POKE_CONTEST_STATUS_GET = 724, + _D17SYSTEM_MAP_SELECT = 725, + _UNDERGROUND_TOOL_GIVE_COUNT = 726, + _UNDERGROUND_KASEKI_DIG_COUNT = 727, + _UNDERGROUND_TRAP_HIT_COUNT = 728, + _POFIN_ADD = 729, + _POFIN_ADD_CHK = 730, + _IS_HAIHU_EVENT_ENABLE = 731, + _SODATEYA_POKELIST_SET_PROC = 732, + _SODATEYA_POKELIST_GET_RESULT = 733, + _GET_RANDOM_HIT = 734, + _UNDERGROUND_TALK_COUNT2 = 735, + _HIDENEFF_START = 736, + _ZISHIN = 737, + _BTL_POINT_WIN_WRITE = 738, + _BTL_POINT_WIN_DEL = 739, + _BTL_POINT_WRITE = 740, + _GET_BTL_POINT = 741, + _BTL_POINT_ADD = 742, + _BTL_POINT_SUB = 743, + _COMP_BTL_POINT = 744, + _GET_BP_GIFT = 745, + _UG_BALLITEM_CHECK = 746, + _AUSU_ITEM_CHECK = 747, + _CHECK_MY_GSID = 748, + _FRIEND_DATA_NUM = 749, + _GET_COIN_GIFT = 750, + _SUB_WK_COIN = 751, + _COMP_WK_COIN = 752, + _AIKOTOBA_OKURIMONO_CHK = 753, + _WIFI_HUSIGINAOKURIMONO_OPEN_FLAG_SET = 754, + _UNION_GET_CARD_TALK_NO = 755, + _WIRELESS_ICON_EASY = 756, + _WIRELESS_ICON_EASY_END = 757, + _SAVE_FIELD_OBJ = 758, + _SEAL_NAME = 759, + _SET_ESCAPE_LOCATION = 760, + _FIELDOBJ_BITSET_FELLOWHIT = 761, + _DAME_TAMAGO_CHK_ALL = 762, + _UNION_BMPMENU_START = 763, + _UNION_BATTLE_START_CHECK = 764, + _GET_TRCARD_RANK = 765, + _FLD_SCOPE_MODE_ON = 766, + _FLD_SCOPE_MODE_OFF = 767, + AC_UP = 768, + AC_DOWN = 769, + AC_LEFT = 770, + AC_RIGHT = 771, + AC_LOOP = 772, + AC_DIR_U = 773, + AC_DIR_R = 774, + AC_DIR_D = 775, + AC_DIR_L = 776, + ACMD_END = 777, + AC_DIR_VAL = 778, + AC_WAIT = 779, + _SET_TURN_HERO_FRAME = 780, + _SET_TURN_OBJ_FRAME = 781, + _DEBUG_PRINT = 782, + AC_MARK_GYOE = 783, + _FADE_WAIT = 784, + _HERO_MOVE_GRID_CENTER = 785, + AC_WORLD_X = 786, + AC_WORLD_Z = 787, + AC_HERO_MATCH_X = 788, + AC_HERO_MATCH_Z = 789, + _SET_POS_HERO_MATCH_X = 790, + _SET_POS_HERO_MATCH_Z = 791, + AC_UP_CENTER = 792, + AC_DOWN_CENTER = 793, + AC_LEFT_CENTER = 794, + AC_RIGHT_CENTER = 795, + AC_DIR_UP_CENTER = 796, + AC_DIR_DOWN_CENTER = 797, + AC_DIR_LEFT_CENTER = 798, + AC_DIR_RIGHT_CENTER = 799, + AC_VANISH_ON = 800, + AC_VANISH_OFF = 801, + AC_DIR_PAUSE_ON = 802, + AC_DIR_PAUSE_OFF = 803, + AC_ANM_PAUSE_ON = 804, + AC_ANM_PAUSE_OFF = 805, + AC_PC_BOW = 806, + AC_HIDE_PULLOFF = 807, + AC_HERO_BANZAI = 808, + AC_MARK_SAISEN = 809, + AC_HERO_BANZAI_UKE = 810, + ACMD_NOT = 811, + _GET_LANGUAGE = 812, + _GET_REL_POS_HERO = 813, + _CAMERA_TARGET_HERO = 814, + _CAMERA_TARGET_DUMMY = 815, + _DUMMY_ANIME = 816, + _DUMMY_ANIME_WAIT = 817, + _DUMMY_SET_POS = 818, + _DUMMY_SET_POS_HERO = 819, + _SET_CUSTUM_WIN_MSBT = 820, + _ADD_CUSTUM_WIN_LABEL = 821, + _OPEN_CUSTUM_WIN = 822, + _VISIBLE_OBJ_PROP = 823, + _INVISIBLE_OBJ_PROP = 824, + _EVENT_CAMERA_MODE = 825, + _SET_EVENT_CAMERA_PARAM = 826, + _EVENT_CAMERA_WAIT = 827, + _EVENT_CAMERA_FRAME = 828, + _HIT_DOOR_ANIME = 829, + _HIT_DOOR_ANIME_WAIT = 830, + _SET_DOOR_OBJ = 831, + _ROTOMU_FORM_CHECK = 832, + _TEMOTI_ROTOMU_FORM_WAZA_CHG = 833, + _EVENT_GET_TEMOTI_POKE_CHK_GET_POS = 834, + _TURN_HERO_TALK_OBJ = 835, + _FADE_SPEED = 836, + _FADE_BALL = 837, + _FADE_DEFAULT = 838, + _DOOR_FORCE_ANIME_END = 839, + _LDVAL_VERSION = 840, + _LDVAL_SEX = 841, + _TV_ENTRY_PARKINFO_INIT = 842, + _TV_ENTRY_PARKINFO_ITEM = 843, + _TV_ENTRY_PARKINFO_ACCE = 844, + _GROUP_EXIST_CHECK = 845, + _GROUP_ENTRY_CHECK = 846, + _GROUP_NAME = 847, + _GROUP_LEADER_NAME = 848, + _GROUP_NAME_IN = 849, + _GROUP_ENTRY = 850, + _GROUP_MAKE = 851, + _MYSTERY_POSTMAN_INIT = 852, + _MYSTERY_PRESENT_CHECK = 853, + _MYSTERY_GET_PRESENT_ID = 854, + _MYSTERY_RECEIVE_CHECK = 855, + _MYSTERY_RECEIVE_PRESENT = 856, + _MYSTERY_DISABLE_MSG = 857, + _MYSTERY_ENABLE_MSG = 858, + _MYSTERY_POSTMAN_END = 859, + _MYSTERY_POSTMAN_SAVE_END = 860, + _UNKNOWN_MSG = 861, + _TV_INTERVIEW_MSG = 862, + _TV_INTERVIEW_ENTRY = 863, + _TV_START = 864, + _TV_END = 865, + _TV_START_NUMBER = 866, + _TV_SET_ENDFLAG = 867, + _TV_MAKE_MSG = 868, + _TV_GET_DATA_TOTAL = 869, + AC_INDEX_ANIME = 870, + AC_INDEX_ANIME_WAIT = 871, + _DEBUG_RESET_WORK = 872, + _SET_SYS_FLAG = 873, + _RESET_SYS_FLAG = 874, + _CAMERA_SET_COS_ANGLE = 875, + _CAMERA_COS_ANGLE_WAIT = 876, + _HERO_MOVE_GRID_CENTER_FRONT = 877, + _WARP_ENABLE_SET = 878, + _DOOR_ENABLE_SET = 879, + _AC_ANIM_LOCK = 880, + _AC_ANIM_RELEASE = 881, + _SET_OFFSET = 882, + _OFFSET_WAIT = 883, + _NAMINORI_END = 884, + _TAKIKUDARI = 885, + _KABENOBORI_CHECK = 886, + _TALK_POKE_GET_TEMOTI_INDEX = 887, + _NATURAL_PARK_GET_MONOHIROI_ITEM_NO = 888, + _CON_OPEN_POKE_SELECT_MENU = 889, + _CON_OPEN_CAPSULE_SELECT_MENU = 890, + _CON_OPEN_BOUTIQUE_SELECT_MENU = 891, + _CON_WAIT_CONTEST_MENU = 892, + _CON_MY_ENTRY_NO_WORD_SET = 893, + _CON_BEST_PERFORMER_CHECK = 894, + _CON_CATEGORY_RIBBON_NAME_SET = 895, + _CON_HAVE_CONTEST_STAR_CHECK = 896, + _CON_CONTEST_STAR_NAME_SET = 897, + _CON_REWARD_NAME_SET = 898, + _OBJ_ANIME_FUREAI = 899, + AC_MARK_EMO = 900, + _CON_CATEGORY_AND_RANK_SET = 901, + _CON_RANK_SET = 902, + _NATURAL_PARK_POKE_CREATE = 903, + _NATURAL_PARK_POKE_KAISAN = 904, + _NATURAL_PARK_POKE_SYUUGOU = 905, + _CON_CHECK_ENTRY_POKE = 906, + _NATURAL_PARK_POKE_SELECT_MENU = 907, + AC_NECK_ROTATE = 908, + _CON_RESET_PARAMETER = 909, + _CON_SELECT_SINGLE_MODE = 910, + _CON_SELECT_MULTI_MODE = 911, + _DPR_SHOP_OPEN = 912, + _DPR_SHOP_OPEN_WAIT = 913, + _DOOR_TRANSITION_ZONE_SET = 914, + _IMAGE_CLIP_VIEW_CON_CHECK_PROC = 915, + _MOVE_COMBAT_GYM_WALL = 916, + _EV_ENTITY_PLAYER_MOVE_START = 917, + _EV_ENTITY_PLAYER_MOVE_END = 918, + _EV_ENTITY_PLAYER_MOVE_RESET = 919, + _CHECK_CAN_SEED_WATER = 920, + _SHOP_OPEN_FIXED = 921, + _SHOP_OPEN_SEAL = 922, + _SHOP_OPEN_BATTLE = 923, + _SHOP_OPEN_FLOWER = 924, + _SHOP_OPEN_OTENKI = 925, + _SHOP_OPEN_SELL = 926, + AC_OFFSET = 927, + _GET_COSTUME = 928, + _SHOP_OPEN_BOUTIQUE_BUY = 929, + _SHOP_OPEN_BOUTIQUE_CHANGE = 930, + _CON_REWARD_SHOWMASTER_NAME_SET = 931, + _CON_TWINKLE_STAR_NAME_SET = 932, + _ANAWOHORU = 933, + _ANANUKENOHIMO = 934, + _TELEPORT = 935, + _AMAIKAORI = 936, + _CHECK_POFIN = 937, + _AMAIMITU = 938, + _WARP_START_ANIMATION = 939, + _WARP_END_ANIMATION = 940, + _SAFARI_SCOPE_SEQUENCE = 941, + _EVENT_CAMERA_INDEX = 942, + _EVENT_CAMERA_END_WAIT = 943, + _SHOP_OPEN_PALPARK = 944, + _BTOWER_APP_WAIT = 945, + _FLOOR_OPEN = 946, + _FLOOR_CLOSE = 947, + _MONEY_OPEN = 948, + _MONEY_CLOSE = 949, + _AZUKARIYA_EXIST_EGG = 950, + _AZUKARIYA_STORED_COUNT = 951, + _AZUKARIYA_SET_STORED_NAME = 952, + _AZUKARIYA_STORE = 953, + _AZUKARIYA_RESTORE = 954, + _AZUKARIYA_LOVE_LEVEL = 955, + _AZUKARIYA_GET_STORED_MONSNO = 956, + _AZUKARIYA_GET_EGG = 957, + _AZUKARIYA_DISCARD_EGG = 958, + _AZUKARIYA_SET_STORED_INFO_STR = 959, + _AZUKARIYA_GET_STORED_SEX = 960, + _AZUKARIYA_OLDMAN_INIT = 961, + _ADD_CUSTUM_WIN_LABEL_WORD_SET = 962, + _OPEN_CUSTUM_WIN_WORD_SET = 963, + AC_INVISIBLE_ON = 964, + AC_INVISIBLE_OFF = 965, + _BTL_ENCSEQ_LOAD = 966, + _USE_SPRAY = 967, + _BIRTH_MOUNTH_INPUT = 968, + _BIRTH_DAY_INPUT = 969, + _SPEAKERS_NAME = 970, + _GET_PLAYER_CAP = 971, + _CAMERA_SHAKE = 972, + _EVENT_ENTITY_CLIP_PLAY = 973, + _EVENT_ENTITY_CLIP_WAIT = 974, + _FACE_INDEX = 975, + AC_FACE_INDEX = 976, + _TEMOTI_BALL_LOAD = 977, + _TEMOTI_BALL_LOAD_WAIT = 978, + _POKECEN_PUT_BALL = 979, + _POKECEN_CLEAR_BALL = 980, + _CHARA_LOOK_LOCK = 981, + _CHARA_LOOK_RELEASE = 982, + _TALK_OBJ_START_LOOK_NONE = 983, + _BOUKENNOOTO_TIPS_OPEN = 984, + _HIDENEFF_WAIT = 985, + _GET_URAYAMA_ENCOUNT_INDEX = 986, + _CUSTOM_BALL_NUM_ADD = 987, + _CHANGE_FASHION_REQ = 988, + _WARP_PANEL_START = 989, + _WARP_PANEL_END = 990, + _CON_OPEN_MATCHING_MENU = 991, + _OPEN_PASSWORD_SWKEYBOARD = 992, + _DENDOU_NUM_SET = 993, + _TEMOTI_BOX_POKE_CHK = 994, + _TEMOTI_BOX_MONSNO = 995, + _CALL_WAZA_OMOIDASHI_UI = 996, + _CALL_WAZA_WASURE_UI = 997, + _CALL_WAZA_OSHIE_UI = 998, + _CHECK_WAZA_OSHIE = 999, + _CHECK_WAZA_OSHIE_ALL = 1000, + _TEMOTI_BOX_POKEMON_NAME = 1001, + _BTWR_TOOL_CHK_ENTRY_POKE_NUM = 1002, + _BTWR_TOOL_CLEAR_PLAY_DATA = 1003, + _BTWR_TOOL_PUSH_NOW_LOCATION = 1004, + _BTWR_TOOL_POP_NOW_LOCATION = 1005, + _BTWR_TOOL_GET_WIFI_RANK = 1006, + _BTWR_TOOL_SET_PLAY_MODE = 1007, + _BTWR_TOOL_SET_NOW_WIN = 1008, + _BTWR_TOOL_SET_RANK = 1009, + _BTWR_SUB_CHK_ENTRY_POKE = 1010, + _BTWR_SUB_GET_NOW_ROUND = 1011, + _BTWR_SUB_INC_ROUND = 1012, + _BTWR_SUB_IS_CLEAR = 1013, + _BTWR_SUB_GET_RENSHOU_CNT = 1014, + _BTWR_SUB_SET_SCORE = 1015, + _BTWR_SUB_CHOICE_BTL_PARTNER = 1016, + _BTWR_SUB_LOCAL_BTL_CALL = 1017, + _BTWR_SUB_GET_PLAY_MODE = 1018, + _BTWR_SUB_SET_LEADER_CLEAR_FLAG = 1019, + _BTWR_SUB_GET_LEADER_CLEAR_FLAG = 1020, + _BTWR_SUB_ADD_BATTLE_POINT = 1021, + _BTWR_SUB_RENSHOU_RIBBON_SET = 1022, + _BTWR_SUB_GET_MINE_OBJ = 1023, + _BTWR_SUB_UPDATE_RANDOM = 1024, + _BTWR_DEB_IS_WORK_NULL = 1025, + _BOUKENNOOTO_TIPS_WAIT = 1026, + _SAVE_RENDOU_ENABLE = 1027, + _RETURN_LOOP = 1028, + _INPUT_JUMP = 1029, + _BTWR_SUB_BTL_TRAINER_SET = 1030, + _BTWR_SUB_GET_RANK = 1031, + _BTWR_SUB_RANK_DOWN_LOSE = 1032, + _BTWR_SUB_RANK_DOWN_LOSE_RESET = 1033, + _BTWR_SUB_ADD_LOSE = 1034, + _SET_VISIBILITY = 1035, + _LOAD_CAMERA_CONTROLLER = 1036, + _LOAD_WAIT_CAMERA_CONTROLLER = 1037, + _CAMERA_CONTROLLER_PLAY = 1038, + _CAMERA_CONTROLLER_END = 1039, + _TEMOTI_ROTOMU_FORM_CHG_CHECK = 1040, + _TEMOTI_POKE_CHK_NUM = 1041, + _TEMOTI_ROTOMU_FORM_GET = 1042, + _POKELIST_FORM_CHANGE_SET_PROC = 1043, + _POKELIST_FORM_CHANGE_GET_RESULT = 1044, + _TUREARUKI_POKEMON_TALK = 1045, + _TUREARUKI_POKEMON_INDEX = 1046, + _TUREARUKI_TAKE_ITEM = 1047, + _TUREARUKI_ITEM_TIMER_SET = 1048, + _RELEASE_CAMERA_CONTROLLER = 1049, + _FIND_BG_ENABLE = 1050, + _FIND_BG_DISABLE = 1051, + _CALL_EFFECT = 1052, + _STOP_EFFECT = 1053, + _RELEASE_EFFECT = 1054, + _CASSET_VERSION_GET = 1055, + _BOX_OPEN_NORMAL = 1056, + _BOX_OPEN_SELECT = 1057, + _CALL_EFFECT_OBJ = 1058, + _SORAWOTOBU_END = 1059, + _CON_OPEN_RESUME_MATCHING_MENU = 1060, + _BOX_SEAL_UI_WAIT = 1061, + _OBJ_POS_CHANGE_WORLD = 1062, + _OPEN_SPECIAL_WIN_LABEL = 1063, + _WAIT_SPECIAL_WIN_LABEL = 1064, + _AK_LISNER_TRA = 1065, + _AK_LISNER_POS = 1066, + _AK_LISNER_ROT = 1067, + _UNION_PROC = 1068, + _CAMERA_CONTROLLER_WAIT = 1069, + _SET_TV_INT = 1070, + _SET_TV_PLAYER_NAME = 1071, + _SET_TV_POKE_NICK_NAME = 1072, + _TV_TPIC_ENABLE = 1073, + _TV_TPIC_BRANCH = 1074, + _TUREARUKI_POKE_CREATE = 1075, + _TUREARUKI_POKE_DELETE = 1076, + _AUTO_TANKEN_SET = 1077, + _SET_MATCHING_GROUP = 1078, + _AUTO_TANKEN_SET_WAIT = 1079, + _USE_TANKENSET = 1080, + _TALK_UNION_NPC = 1081, + _CHECK_ONLINE_ACCOUNT = 1082, + _WAIT_CHECK_ONLINE_ACCOUNT = 1083, + _LOCALKOUKAN_APPLY = 1084, + _ZUKAN_TOUROKU = 1085, + _ZUKAN_TOUROKU_WAIT = 1086, + _CHK_ZUKAN_TOUROKU = 1087, + _AUTO_SAVE = 1088, + _ENDING_DEMO = 1089, + _AZUKARIYA_TAKE_OVER_POKE = 1090, + _POKETORE_GET_CHARGE = 1091, + _POKETORE_START = 1092, + _BICYCLE_COLOR_SET = 1093, + _BICYCLE_COLOR_GET = 1094, + _PARK_ITEM_NAME = 1095, + _LOAD_UMA_ANIME = 1096, + _RELEASE_UMA_ANIME = 1097, + _LOAD_UMA_ANIME_WAIT = 1098, + _UMA_ANIME_PLAY = 1099, + _UMA_ANIME_ATTACH = 1100, + _UMA_PLAY_WAIT = 1101, + _OBJ_ANIME_SPEED = 1102, + _OBJ_SCALE = 1103, + _BADGE_GET = 1104, + _ADD_UG_ITEM = 1105, + _TOBARI_4F_SHOP_OPEN = 1106, + _DOF_FAR_DEPTH = 1107, + _DISPLAY_MESSAGE = 1108, + _DISPLAY_MESSAGE_CLOSE = 1109, + _CUSTOM_BALL_TRAINER_PAGE = 1110, + _CUSTOM_BALL_TRAINER_COPY_OPEN = 1111, + _RECONGNIZE_TOKIKAKE = 1112, + _RECONGNIZE_OPEN_WAIT = 1113, + _UG_ITEM_NAME = 1114, + _FUREAI_TALK_START = 1115, + _FUREAI_TALK_END = 1116, + _PLAY_FUREAI_VOICE_NAKAYOSHIRANK = 1117, + _CREATE_HYOUTA = 1118, + _CALL_SHIP_DEMO_SEA_MAP = 1119, + _SETUP_SHIP = 1120, + _PC_DENDOU_SET_PROC_OPEN_WAIT = 1121, + _GET_POKETCH_APP_ID = 1122, + _FADE_DUNGEON_OUT = 1123, + _FADE_DUNGEON_IN = 1124, + _FADE_BUILDING_OUT = 1125, + _FADE_BUILDING_IN = 1126, + _FADE_AREA_OUT = 1127, + _FADE_AREA_IN = 1128, + _CUSTOM_BALL_TRAINER_PAGE_WAIT = 1129, + _C08R0801SCOPECAMERA_SEQUENCE = 1130, + _EMBANKMENT = 1131, + _ENTRY_UWASA_ZUKAN = 1132, + _TALK_UG_NPC = 1133, + _TRAINING_OPEN = 1134, + _TRAINING_OPEN_WAIT = 1135, + _CAMERA_CONTROLLER_IS_NULL = 1136, + _UMA_IS_NULL = 1137, + _GET_IS_HAVE_SECRETBASE = 1138, + _GET_UG_NPC_TALK_COUNT = 1139, + _RESET_UG_NPC_TALK_COUNT = 1140, + _TEMOTI_POKE_CHK_GET_POS = 1141, + AC_STOP_WALK_ANIME = 1142, + _SET_FORCE_BLINK = 1143, + _CHECK_SECRET_BASE_EXPANTION = 1144, + _TV_TOPIC_BRANCH_GET = 1145, + _TV_TOPIC_INT_GET = 1146, + _TV_TOPIC_STR_WORD_SET = 1147, + _OOKISA_VALUE_SET_BUF = 1148, + _SET_LIGHTINTENSITY = 1149, + _SET_LIGHTINTENSITY_CHARCTER = 1150, + _SET_LIGHTINTENSITY_POKE = 1151, + _END_LIGHTINTENSITY = 1152, + _END_LIGHTINTENSITY_CHARCTER = 1153, + _END_LIGHTINTENSITY_POKE = 1154, + AC_ANIME_DURATION = 1155, + _TV_RED_GYARADOS_ON = 1156, + _TV_RED_GYARADOS_OFF = 1157, + _PARTNER_NAME_SET = 1158, + _TV_MONITOR_SET = 1159, + _TV_MONITOR_RESET = 1160, + _EFF_SCALE = 1161, + _GET_ITEM_COUNT = 1162, + _PLAY_EMO_SE = 1163, + _AUTO_MSG = 1164, + _AUTO_MSG_STOP = 1165, + _GET_TAG_PATNER_ID = 1166, + _ADD_WAZA = 1167, + _NICKNAME_PLACEMENT = 1168, + _UNIQUE_POKE_TEMP = 1169, + _UNIQUE_POKE_FIX = 1170, + _GET_FORM = 1171, + _NICK_NAME_ALL = 1172, + _DOF_CHANGE_TARGET_POS = 1173, + _DOF_RESET_TARGET_POS = 1174, + _ADD_MAROYAKA_POFFIN = 1175, + _ALL_MONSNO = 1176, + _ALL_MONS_OWN_CHK = 1177, + _CON_CATEGORY_NAME = 1178, + _CON_RANK_NAME = 1179, + _POKE_TYPE_NAME = 1180, + _POFFIN_NAME = 1181, + _DRESS_NAME = 1182, + _EVENT_ENTITY_VISIBLE = 1183, + _UG_LEAVE_HOYUTA = 1184, + _AZUKARIYA_STORE_UI = 1185, + _SET_TELEPORT_ID = 1186, + _POKE_LVUP_HOW_MANY = 1187, + _USE_SPECIAL_ITEM = 1188, + _GET_BP = 1189, + _FOV_OFFSET_RATE = 1190, + _OBJ_DIR_CHANGE_WORLD = 1191, + _OBJ_POS_CHANGE_WORLD_FIND = 1192, + _ZONE_NAME2 = 1193, + _TALK_COLISEUM_NPC = 1194, + _USE_SUB_ATTRIBUTE = 1195, + _ADD_CUSTUM_WIN_LABEL_TWO_WINDOW = 1196, + _POKE_LEVEL_GET_ALL = 1197, + _RESET_SAVEBGM = 1198, + _BTWR_SUB_SELECT_POKE = 1199, + _BTWR_SUB_GET_ENTRY_POKE = 1200, + _SET_GLOBALWATERFIELD = 1201, + _TV_INTERVIEW_STR_WORD_SET = 1202, + _ZONE_NAME_LABEL = 1203, + _AUTO_SAVE_BACK_UP_ON = 1204, + _GET_STATUE_NUM = 1205, + _BTWR_PLAYER_WIN_CHECK = 1206, + _GET_GOLD = 1207, + _AG_TRANSITION_HOYUTA = 1208, + _ADD_POKEMON_UI = 1209, + _GET_FUREAI_SELECT_POKE_TEMOTI_NO = 1210, + _TV_TOPIC_STR_GENDER_WORD_SET = 1211, + _EVENT_ENTITY_CLIP_ATTACH_PLAYER = 1212, + _GET_POKE_COUNT5 = 1213, + _ADD_UNIQUE_POKEMON_UI = 1214, + _BTWR_SUB_ADD_BATTLE_POINT_MANUAL = 1215, + _POKE_TARENT_POW_MAX = 1216, + _OPEN_BATTLE_WIN = 1217, + _OJIGI = 1218, + _DARKNESS_TEMPORARILY_OFF = 1219, + _DARKNESS_TEMPORARILY_ON = 1220, + _SAVE_PLAYREPORT = 1221, + _SET_STOP_EYE_ENCOUNT = 1222, + _RESET_STOP_EYE_ENCOUNT = 1223, + _OPEN_CUSTUM_WIN_FIXED = 1224, + _PLAY_REPORT_TRAINING = 1225, + _GET_WATER_GYM_WATER_LEVEL = 1226, + _REGET_WATER_GYM_WATER_LEVEL = 1227, + _PLAY_REPORT_BTLTOWER_WIN = 1228, + _TEMOTI_FORMNO = 1236, + _TEMOTI_BOX_FORMNO = 1237, + _GET_BOX_POKE_SEIKAKU = 1238, + _RELEASE_BOX_POKE = 1239, + _TOGGLE_COLLISION_BOX = 1240, + _INSTALL_CHECK = 1241, + + _CHANGE_FORMNO = 1248, + }; +} diff --git a/include/EvData/EvData.hpp b/include/EvData/EvData.hpp new file mode 100644 index 000000000..325204d7c --- /dev/null +++ b/include/EvData/EvData.hpp @@ -0,0 +1,46 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/String.hpp" + +struct EvData_Fields +{ + UnityEngine_ScriptableObject_Fields super; + struct System_Collections_Generic_List_EvData_Script__o* Scripts; + struct System_Collections_Generic_List_string__o* StrList; +}; + +struct EvData_RGCTXs +{ +}; + +struct EvData_VTable +{ + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; +}; + +struct EvData_c +{ + Il2CppClass_1 _1; + struct EvData_StaticFields* static_fields; + EvData_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + EvData_VTable vtable; +}; + +struct EvData_o +{ + EvData_c *klass; + void *monitor; + EvData_Fields fields; + + // 01f115b0 + System::String * GetString(int32_t index, MethodInfo *method); +}; + +struct EvData_StaticFields +{ +}; diff --git a/include/FieldCharacterEntity.hpp b/include/FieldCharacterEntity.hpp new file mode 100644 index 000000000..946e0abf2 --- /dev/null +++ b/include/FieldCharacterEntity.hpp @@ -0,0 +1,87 @@ +#pragma once + +#include "il2cpp.hpp" +#include "FieldObjectEntity.hpp" + +struct FieldCharacterEntity_Fields +{ + FieldObjectEntity_Fields super; + float HandScale; + struct AnimationPlayer_o* _animationPlayer; + struct CurvePatterns_o* _blinkPatterns; + struct FieldCharacterVariation_array* _variations; + int32_t _eyePatternIndex; + int32_t _mouthPatternIndex; + int32_t _currentVariation; + struct UnityEngine_Renderer_o* _watchRenderer; + int32_t _blinkCurveIndex; + float _blinkTime; + int32_t _UVOffsetID; + struct UnityEngine_MaterialPropertyBlock_o* _propertyBlock; + struct System_Single_array* _effectCoolTime; + struct UnityEngine_Vector3_o NeckAngle; + struct UnityEngine_Vector3_o _updateNeckAngle; + struct UnityEngine_Vector3_o _updateNeckAngle2; + struct UnityEngine_Transform_o* _subductionNode; + struct UnityEngine_Transform_o* _hipNode; + float SubductionDepth; + struct Effect_EffectInstance_o* SwimEffect; + bool isPlayingSwimEffect; + struct Effect_EffectInstance_o* _swimWalkEffect; + bool _isPlayingSwimWalkEffect; + bool _IsForceBlink_k__BackingField; + bool _reqestStopFootEffect; + bool _isStopFootEffect; + float _stopFootEffectRetrunTime; + int32_t _oldAnimEventIndex; + int32_t _oldAnimClipIndex; + struct XLSXContent_CharcterAnimeEvent_SheetanimeEvent_array_array* _animEvents; + struct System_Func_AnimationPlayer__bool__o* animeEndCallBack; +}; + +struct FieldCharacterEntity_RGCTXs +{ +}; + +struct FieldCharacterEntity_VTable +{ + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + VirtualInvokeData _4_get_entityType; + VirtualInvokeData _5_GetAnimationPlayer; + VirtualInvokeData _6_Awake; + VirtualInvokeData _7_OnEnable; + VirtualInvokeData _8_OnDisable; + VirtualInvokeData _9_OnDestroy; + VirtualInvokeData _10_OnUpdate; + VirtualInvokeData _11_OnLateUpdate; + VirtualInvokeData _12_SwitchToNext; + VirtualInvokeData _13_ProcessSequence; + VirtualInvokeData _14_OnFootSE; + VirtualInvokeData _15_OnFootEffect; + VirtualInvokeData _16_GetIdleAnimationIndex; +}; + +struct FieldCharacterEntity_c +{ + Il2CppClass_1 _1; + struct FieldCharacterEntity_StaticFields* static_fields; + FieldCharacterEntity_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + FieldCharacterEntity_VTable vtable; +}; + +struct FieldCharacterEntity_o +{ + FieldCharacterEntity_c *klass; + void *monitor; + FieldCharacterEntity_Fields fields; +}; + +struct FieldCharacterEntity_StaticFields +{ + struct UnityEngine_Vector2_array* FaceUVs; + float ViewerHandScale; +}; diff --git a/include/FieldEventEntity.hpp b/include/FieldEventEntity.hpp new file mode 100644 index 000000000..baf8b9dd9 --- /dev/null +++ b/include/FieldEventEntity.hpp @@ -0,0 +1,99 @@ +#pragma once + +#include "il2cpp.hpp" +#include "FieldObjectEntity.hpp" + +struct UnityEngine_Playables_PlayableGraph_Fields +{ + intptr_t m_Handle; + uint32_t m_Version; +}; + +struct UnityEngine_Playables_PlayableGraph_o +{ + UnityEngine_Playables_PlayableGraph_Fields fields; +}; + +struct UnityEngine_Playables_PlayableOutputHandle_Fields +{ + intptr_t m_Handle; + uint32_t m_Version; +}; + +struct UnityEngine_Playables_PlayableOutputHandle_o +{ + UnityEngine_Playables_PlayableOutputHandle_Fields fields; +}; + +struct UnityEngine_Playables_PlayableOutput_Fields +{ + struct UnityEngine_Playables_PlayableOutputHandle_o m_Handle; +}; + +struct UnityEngine_Playables_PlayableOutput_o +{ + UnityEngine_Playables_PlayableOutput_Fields fields; +}; + +struct FieldEventEntity_Fields +{ + FieldObjectEntity_Fields super; + int32_t shapeType; + float radius; + struct UnityEngine_Vector2_o offset; + struct UnityEngine_Vector2_o size; + int32_t transitionZone; + int32_t locatorIndex; + bool playOnAwake; + int32_t clipIndex; + struct System_Collections_Generic_List_TweenClip__o* clips; + bool checkHeight; + struct UnityEngine_Animator_o* _animator; + struct UnityEngine_Playables_PlayableGraph_o _graph; + struct UnityEngine_Playables_PlayableOutput_o _output; + int32_t correctionDir; + bool isLandingEntity; + bool _hit; +}; + +struct FieldEventEntity_RGCTXs +{ +}; + +struct FieldEventEntity_VTable +{ + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + VirtualInvokeData _4_get_entityType; + VirtualInvokeData _5_GetAnimationPlayer; + VirtualInvokeData _6_Awake; + VirtualInvokeData _7_OnEnable; + VirtualInvokeData _8_OnDisable; + VirtualInvokeData _9_OnDestroy; + VirtualInvokeData _10_OnUpdate; + VirtualInvokeData _11_OnLateUpdate; + VirtualInvokeData _12_SwitchToNext; + VirtualInvokeData _13_ProcessSequence; +}; + +struct FieldEventEntity_c +{ + Il2CppClass_1 _1; + struct FieldEventEntity_StaticFields* static_fields; + FieldEventEntity_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + FieldEventEntity_VTable vtable; +}; + +struct FieldEventEntity_o +{ + FieldEventEntity_c *klass; + void *monitor; + FieldEventEntity_Fields fields; +}; + +struct FieldEventEntity_StaticFields +{ +}; diff --git a/include/FieldNagisaGymGearEntity.hpp b/include/FieldNagisaGymGearEntity.hpp new file mode 100644 index 000000000..b41fb63ec --- /dev/null +++ b/include/FieldNagisaGymGearEntity.hpp @@ -0,0 +1,69 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/Array.hpp" +#include "FieldEventEntity.hpp" + +struct FieldNagisaGymGearEntity_Fields +{ + FieldEventEntity_Fields super; + int32_t GearGroupNo; + int32_t GearRotateButton; + int32_t GearRotateAxis; + struct System_String_o* GearRotateEventLabel; + struct Dpr_FieldFloatMove_o* DegMove; + struct UnityEngine_Vector3_o originalLocalEulerAngles; + bool IsSetuped; + int32_t InitSequence; +}; + +struct FieldNagisaGymGearEntity_RGCTXs +{ +}; + +struct FieldNagisaGymGearEntity_VTable +{ + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + VirtualInvokeData _4_get_entityType; + VirtualInvokeData _5_GetAnimationPlayer; + VirtualInvokeData _6_Awake; + VirtualInvokeData _7_OnEnable; + VirtualInvokeData _8_OnDisable; + VirtualInvokeData _9_OnDestroy; + VirtualInvokeData _10_OnUpdate; + VirtualInvokeData _11_OnLateUpdate; + VirtualInvokeData _12_SwitchToNext; + VirtualInvokeData _13_ProcessSequence; +}; + +struct FieldNagisaGymGearEntity_c +{ + Il2CppClass_1 _1; + struct FieldNagisaGymGearEntity_StaticFields* static_fields; + FieldNagisaGymGearEntity_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + FieldNagisaGymGearEntity_VTable vtable; +}; + +struct FieldNagisaGymGearEntity_o +{ + FieldNagisaGymGearEntity_c *klass; + void *monitor; + FieldNagisaGymGearEntity_Fields fields; + + // 01d52b20 + bool IsRotating(MethodInfo *method); + + // 01d52990 + static float GetDegRotateType(int32_t rotateType, MethodInfo *method); + + // 01d529c0 + void Rotate(int32_t rotateType, int32_t triggerGroupNo, MethodInfo *method); +}; + +struct FieldNagisaGymGearEntity_StaticFields +{ +}; diff --git a/include/FieldObjectEntity.hpp b/include/FieldObjectEntity.hpp new file mode 100644 index 000000000..c1d1c3147 --- /dev/null +++ b/include/FieldObjectEntity.hpp @@ -0,0 +1,70 @@ +#pragma once + +#include "il2cpp.hpp" +#include "BaseEntity.hpp" + +struct FieldObjectEntity_Fields +{ + BaseEntity_Fields super; + struct UnityEngine_Vector3_o moveVector; + bool isExtruded; + bool isLanding; + struct UnityEngine_Vector3_o _oldMoveVector_k__BackingField; + struct Dpr_RouteSearch_FieldObjectRouteMove_o* _routeMove; + bool IsIgnorePlayerCollision; + struct EvEntityCommand_o* _evEntityCmd; + struct UnityEngine_Vector2Int_o _oldGridPosition_k__BackingField; + struct UnityEngine_Vector3_array* logPosition; + uint8_t logcount; + bool _scaleChangeFlag; + float _scaleStart; + float _scaleEnd; + float _scaleTime; + float _scaleProgressTime; + struct Dpr_EvScript_EvDataManager_EntityParam_o* EventParams; +}; + +struct FieldObjectEntity_RGCTXs +{ +}; + +struct FieldObjectEntity_VTable +{ + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + VirtualInvokeData _4_get_entityType; + VirtualInvokeData _5_GetAnimationPlayer; + VirtualInvokeData _6_Awake; + VirtualInvokeData _7_OnEnable; + VirtualInvokeData _8_OnDisable; + VirtualInvokeData _9_OnDestroy; + VirtualInvokeData _10_OnUpdate; + VirtualInvokeData _11_OnLateUpdate; + VirtualInvokeData _12_SwitchToNext; + VirtualInvokeData _13_ProcessSequence; +}; + +struct FieldObjectEntity_c +{ + Il2CppClass_1 _1; + struct FieldObjectEntity_StaticFields* static_fields; + FieldObjectEntity_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + FieldObjectEntity_VTable vtable; +}; + +struct FieldObjectEntity_o +{ + FieldObjectEntity_c *klass; + void *monitor; + FieldObjectEntity_Fields fields; + + // 01d50aa0 + UnityEngine_Vector2Int_o get_gridPosition(MethodInfo *method); +}; + +struct FieldObjectEntity_StaticFields +{ +}; diff --git a/include/FieldPlayerEntity.hpp b/include/FieldPlayerEntity.hpp new file mode 100644 index 000000000..969a5188d --- /dev/null +++ b/include/FieldPlayerEntity.hpp @@ -0,0 +1,153 @@ +#pragma once + +#include "il2cpp.hpp" +#include "FieldCharacterEntity.hpp" +#include "UnityEngine/GameObject.hpp" + +struct FieldPlayerEntity_Fields +{ + FieldCharacterEntity_Fields super; + struct UnityEngine_Renderer_array* _hatRenderers; + struct UnityEngine_Renderer_array* _shoesRenderers; + struct UnityEngine::GameObject_o* _meshGroup; + struct UnityEngine::GameObject_o* _bicycleObject; + struct UnityEngine_Renderer_array* _rodRenderers; + struct UnityEngine_Renderer_o* _podRenderer; + struct UnityEngine_Renderer_o* _beadaruRenderer; + struct UnityEngine_Renderer_o* _mukuhawkRenderer; + struct UnityEngine_Color_array* _bicycleColors; + struct UnityEngine_Renderer_o* _bicycleRenderer; + int32_t _bicycleMaterialIndex; + int32_t _bicycleColorIndex_k__BackingField; + bool isExtrudable; + bool _DashFlag_k__BackingField; + struct JumpCalculator_o* _path; + bool _setupMaterials; + bool _hit_se_request; + float _hit_se_wait; + struct UnityEngine_Vector3_o InputMoveVector; + struct System_Func_FieldPlayerEntity__bool__o* _LateUpdateEvent_k__BackingField; + float _MoveSpeed_k__BackingField; + float _beforeAngle; + int32_t FormType; + struct XLSXContent_MapAttributeTable_SheetData_o* nowAttribute; + bool isAttributeStop; + int32_t _FashionTableID_k__BackingField; + bool FootSeWalkStartEvent; + struct FieldPlayerEntity_CheckGridCollisionFunc_o* CheckGridCollision; + int32_t _sandFallSeq; + float _sandFallWait; + float _sandFallPosZ; + bool UpdateInputAngleDisable; + int32_t KairikiPushObjectIndex; + float KairikiPushTime; + float debugInputTime; + float debugInputVectolX; + bool _isCrossUpdate; + struct UnityEngine_Vector2_o _crossInputVectol; + struct UnityEngine_Vector2_o _crossStopPosition; + int32_t _crossInputDir; + float _crossKey_pushTime; + struct UnityEngine_Vector3_o _eventMoveTargetPosition; + float _eventMoveTargetAngle; + bool _eventMoveEnd; + bool _eventRotateEnd; + int32_t currentForm; + int32_t nextForm; + struct System_Action_o* formFinish; + bool changeFormRetInput; + struct BicycleJump_o* _bicJump; + bool _isCycDownHillMode; + float _bicOldAcceleration; + float _bicAccelerationTime; + float _bicDecelerateTime; + bool _isBicMaxSpeed; + int32_t IceFloorState; + struct UnityEngine_Vector3_o IceFloorDirection; + int32_t IceSlidingLevel; + float IceSlidingSpeed; + bool IsIceSlope; + float IceFloorStopTime; + struct UnityEngine_Vector3_o IceFloorStartGridCenterPos; + struct Dpr_FieldObjectMove_o* IceSlopeDownMove; + struct Dpr_FieldObjectRotateYaw_o* IceSlidingRotate; + int32_t IceFloorDirtyNextDir; + int32_t CurrentMoveFloor; + int32_t NextMoveFloor; + float MoveFloorTime; + float PrevRotateOffset; + struct Dpr_FieldObjectRotateYaw_o* MoveFloorRotate; + bool ForcePlayNaminoriEffect; + struct Effect_EffectInstance_o* NaminoriEffect; + struct Audio_AudioInstance_o* NaminoriAudio; + bool IsPlayNaminoriEffect; + float NaminoriSeWait; + int32_t NaminoriEventRequest; + struct FieldPlayerEntity_CheckGridCollisionCheckSwimFunc_o* CheckGridCollisionCheckSwim; + struct FieldPlayerEntity_CheckGridCollisionCalcSwimFunc_o* CheckGridCollisionCalcSwim; + struct FieldPlayerEntity_CheckGridCollisionEndSwimFunc_o* CheckGridCollisionEndSwim; + struct FieldPlayerEntity_CheckGridCollisionCalcSwimEndFunc_o* CheckGridCollisionCalcSwimEnd; + struct UnityEngine_Transform_o* _BiidaruTransform_k__BackingField; + struct UnityEngine_Vector3_o BiidaruPosOriginal; + struct UnityEngine_Vector3_o BiidaruMoveStartPos; + struct UnityEngine_Vector3_o BiidaruMoveEndPos; + struct Dpr_FieldFloatMove_o* BiidaruMoveTime; + struct Dpr_FieldFloatMove_o* _VisiblePodMove_k__BackingField; + struct Effect_EffectInstance_o* RockClimbEffect; + int32_t SwampDeepInputDir; + int32_t SwampDeepInputCount; + int32_t SwampPhase; + struct Dpr_FieldObjectMove_o* SwampMove; + struct Dpr_FieldFloatMove_o* SwampWait; + bool isPlayedSwampStartEffect; + bool isSwampLoopEffect; +}; + +struct FieldPlayerEntity_RGCTXs +{ +}; + +struct FieldPlayerEntity_VTable +{ + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + VirtualInvokeData _4_get_entityType; + VirtualInvokeData _5_GetAnimationPlayer; + VirtualInvokeData _6_Awake; + VirtualInvokeData _7_OnEnable; + VirtualInvokeData _8_OnDisable; + VirtualInvokeData _9_OnDestroy; + VirtualInvokeData _10_OnUpdate; + VirtualInvokeData _11_OnLateUpdate; + VirtualInvokeData _12_SwitchToNext; + VirtualInvokeData _13_ProcessSequence; + VirtualInvokeData _14_OnFootSE; + VirtualInvokeData _15_OnFootEffect; + VirtualInvokeData _16_GetIdleAnimationIndex; +}; + +struct FieldPlayerEntity_c +{ + Il2CppClass_1 _1; + struct FieldPlayerEntity_StaticFields* static_fields; + FieldPlayerEntity_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + FieldPlayerEntity_VTable vtable; +}; + +struct FieldPlayerEntity_o +{ + FieldPlayerEntity_c *klass; + void *monitor; + FieldPlayerEntity_Fields fields; + + // 01dad950 + void PlayWalk(MethodInfo *method); +}; + +struct FieldPlayerEntity_StaticFields +{ + int32_t _StencilRefID; +}; diff --git a/include/GameData/DataManager.hpp b/include/GameData/DataManager.hpp index ff26bc3da..aa80ab4c5 100644 --- a/include/GameData/DataManager.hpp +++ b/include/GameData/DataManager.hpp @@ -1,16 +1,90 @@ #pragma once + #include "il2cpp.hpp" +#include "XLSXContent/FieldCommonParam.hpp" +#include "XLSXContent/LocalKoukanData.hpp" +#include "XLSXContent/MonohiroiTable.hpp" #include "XLSXContent/PokemonInfo.hpp" namespace GameData { + struct DataManager_Fields + { + }; + + struct DataManager_RGCTXs + { + }; + + struct DataManager_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct DataManager_c + { + Il2CppClass_1 _1; + struct DataManager_StaticFields* static_fields; + DataManager_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + DataManager_VTable vtable; + }; + + struct DataManager_StaticFields + { + struct XLSXContent_CharacterGraphics_o* CharacterGraphics; + struct XLSXContent_TrainerTable_o* TrainerTable; + struct System_Collections_Generic_Dictionary_string__PlaceData__o* PlaceData; + struct System_Collections_Generic_Dictionary_string__MapWarp__o* MapWarpData; + struct System_Collections_Generic_Dictionary_string__StopData__o* StopData; + struct XLSXContent_GimmickGraphics_o* GimmickGraphics; + struct XLSXContent_PokemonInfo_o* PokemonInfo; + struct XLSXContent_ContestWazaInfo_o* ContestWazaInfo; + struct XLSXContent_ShopTable_o* ShopTable; + struct XLSXContent_CharacterDressData_o* CharacterDressData; + struct XLSXContent_KinomiData_o* KinomiData; + struct XLSXContent_KinomiPlaceData_o* KinomiPlaceData; + struct XLSXContent_HoneyTree_o* HoneyTree; + XLSXContent::MonohiroiTable_o* MonohiroiTable; + struct XLSXContent_UgJumpPos_o* UgJumpPos; + struct XLSXContent_TowerTrainerTable_o* TowerTrainerTable; + struct XLSXContent_TowerMatchingTable_o* TowerMatchingTable; + struct XLSXContent_TowerSingleStockTable_o* TowerSingleStockTable; + struct XLSXContent_TowerDoubleStockTable_o* TowerDoubleStockTable; + struct XLSXContent_AdventureNoteData_o* AdventureNoteData; + struct System_Collections_Generic_Dictionary_int__List_AdventureNoteData_SheetData___o* AdventureNoteDataDict; + struct XLSXContent_TowerBattlePoint_o* TowerBattlePoint; + struct TagPlaceData_o* TagPlaceData; + XLSXContent::LocalKoukanData_o* LocalKoukanData; + struct XLSXContent_ContestCommonData_o* ContestCommonData; + struct XLSXContent_TvDataTable_o* TvDataTable; + struct XLSXContent_TvSchedule_o* TvSchedule; + struct DataManager_OnPostLoadDataDelegate_o* onPostLoadData; + XLSXContent::FieldCommonParam_o* FieldCommonParam; + struct XLSXContent_FieldWazaCutInParam_o* FieldWazaCutInParam; + struct XLSXContent_ZenmetuZone_o* ZenmetuZone; + struct XLSXContent_MoveAfterSaveGrid_o* MoveAfterSaveGrid; + struct DataManager_ComparerCatalog_o* _comparerCatalog; + struct DataManager_ComparerKinomi_o* _comparerKinomi; + struct XLSXContent_StatueEffectRawData_o* statueEffectRawData; + }; struct DataManager { + DataManager_c *klass; + void *monitor; + DataManager_Fields fields; + // 2cccf00 // static int32_t GetUniqueID(int32_t monsNo, int32_t formNo, uint8_t sex, bool isRare, bool isEgg, MethodInfo *method); // 2cc76a0 static XLSXContent::PokemonInfo::SheetCatalog_o * GetPokemonCatalog(int32_t monsNo,int32_t formNo,uint8_t sex,bool isRare,bool isEgg,MethodInfo *method); }; -} \ No newline at end of file + + // 04c59d70 + extern DataManager_c * DataManager_TypeInfo; +} diff --git a/include/GameManager.hpp b/include/GameManager.hpp index b60c3beb6..57abd5895 100644 --- a/include/GameManager.hpp +++ b/include/GameManager.hpp @@ -2,9 +2,16 @@ #include "il2cpp.hpp" #include "XLSXContent/FieldEncountTable.hpp" +#include "XLSXContent/MapAttributeTable.hpp" +#include "XLSXContent/MapInfo.hpp" struct GameManager { static XLSXContent::FieldEncountTable::Sheettable_o * GetFieldEncountData(int32_t zoneID, MethodInfo *method); static int32_t get_currentPeriodOfDay(MethodInfo * method); -}; \ No newline at end of file + static void GetAttribute(UnityEngine_Vector2Int_o grid, int32_t *code, int32_t *stop, bool debugdraw, MethodInfo *method); + static XLSXContent::MapAttributeTable_SheetData_o * GetAttributeTable(int32_t code, MethodInfo *method); + static XLSXContent::MapInfo_o * get_mapInfo(MethodInfo *method); + static int32_t GetUrayamaMonsNo(int32_t index, MethodInfo *method); + static int32_t GetSafariMonsNo(int32_t index, MethodInfo *method); +}; diff --git a/include/GimmickWork.hpp b/include/GimmickWork.hpp new file mode 100644 index 000000000..8f6a62df5 --- /dev/null +++ b/include/GimmickWork.hpp @@ -0,0 +1,50 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/Array.hpp" + +struct GimmickWork_Fields +{ +}; + +struct GimmickWork_RGCTXs +{ +}; + +struct GimmickWork_VTable +{ + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; +}; + +struct GimmickWork_c +{ + Il2CppClass_1 _1; + struct GimmickWork_StaticFields* static_fields; + GimmickWork_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + GimmickWork_VTable vtable; +}; + +struct GimmickWork_o +{ + GimmickWork_c *klass; + void *monitor; + GimmickWork_Fields fields; + + // 02cd72d0 + static int32_t GetGearRotate(int32_t areaId, MethodInfo *method); + + // 02cd7470 + static void SetGearRotate(int32_t areaId, int32_t deg, MethodInfo *method); +}; + +struct GimmickWork_StaticFields +{ + struct System::Array* GearAreaIdTable; +}; + +// 04c59d08 +extern GimmickWork_c * GimmickWork_TypeInfo; diff --git a/include/ItemWork.hpp b/include/ItemWork.hpp index e2261cb9f..7fc671638 100644 --- a/include/ItemWork.hpp +++ b/include/ItemWork.hpp @@ -1,11 +1,57 @@ #pragma once #include "il2cpp.hpp" +#include "Dpr/Item/ItemInfo.hpp" +#include "System/Array.hpp" + +struct System_Collections_Generic_List_ItemInfo__array; +struct Dpr_Item_ItemListMemory_array; + +struct ItemWork_Fields { + struct System::Array* _items; + struct System_Collections_Generic_List_ItemInfo__array* _categorizedItems; + struct Dpr_Item_ItemListMemory_array* _itemListMemories; + bool _bagIconSex; + bool _isShowWazaName; +}; + +struct ItemWork_RGCTXs { +}; + +struct ItemWork_VTable { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; +}; + +struct ItemWork_c { + Il2CppClass_1 _1; + struct ItemWork_StaticFields* static_fields; + ItemWork_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + ItemWork_VTable vtable; +}; + +struct ItemWork { + ItemWork_c *klass; + void *monitor; + ItemWork_Fields fields; -class ItemWork -{ -public: static int32_t SubItem(int32_t itemno, int32_t num, MethodInfo * method); // 1aeb550 static bool IsDsPlayer(MethodInfo *method); -}; \ No newline at end of file + // 1aea5b0 + static Dpr::Item::ItemInfo_o * GetItemInfo(int32_t itemno, MethodInfo *method); + // 1aea500 + static bool IsAddItem(int32_t itemno, int32_t num, MethodInfo *method); + // 1aea3a0 + static int32_t AddItem(int32_t itemno, int32_t num, MethodInfo *method); + // 1aeb720 + static bool IsUseSpray(uint16_t *itemno, MethodInfo *method); +}; + +struct ItemWork_StaticFields { + struct ItemWork* _instance; + struct ItemWork* _temp_instance; +}; diff --git a/include/MonsLv.hpp b/include/MonsLv.hpp index bca022d65..e0c3efd72 100644 --- a/include/MonsLv.hpp +++ b/include/MonsLv.hpp @@ -10,4 +10,7 @@ struct MonsLv_Fields { struct MonsLv_o { MonsLv_Fields fields; -}; \ No newline at end of file +}; + +// 04c5f208 +extern void * MonsLv_Array_TypeInfo; diff --git a/include/PlayerWork.hpp b/include/PlayerWork.hpp index bc5501bd6..de9a9f31f 100644 --- a/include/PlayerWork.hpp +++ b/include/PlayerWork.hpp @@ -4,10 +4,12 @@ #include "il2cpp.hpp" #include "Pml/PokePara/SavePokeParty.hpp" +#include "Pml/PokeParty.hpp" #include "Dpr/BallDeco.hpp" #include "Dpr/Box.hpp" #include "Dpr/Item.hpp" #include "DpData.hpp" +#include "System/String.hpp" struct AzukariyaData_Fields { struct Pml::PokePara::SerializedPokemonFull_array* pokemonParam; @@ -133,6 +135,50 @@ struct PlayerWork_VTable { struct PlayerWork_RGCTXs { }; +struct PlayerWork_StaticFields { + bool _NoSavePlayerPos_k__BackingField; + int32_t _capturedMonsNo_k__BackingField; + int32_t _capturedBallCountTvTopic_k__BackingField; + bool _encountEnable_k__BackingField; + bool _isDebugWalk_k__BackingField; + bool _isDebugPlayerVisible_k__BackingField; + bool _isDebugBattleTextView_k__BackingField; + bool _isPlayerInputActive; + bool _isPlayerInputActive_ContactEvent; + bool IsFieldKuruKuruStart; + bool IsFieldFallStart; + bool IsToUg; + bool IsFromUg; + bool ReserveZoneChangeNaminoriEnd; + System::String* _FieldWorpLinkName_k__BackingField; + System::String* _FieldWorpLabel_k__BackingField; + bool _isDebugNpcVisble_k__BackingField; + bool _isDebugNpcPokeVisble_k__BackingField; + int32_t _DebugEncountMonsNo_k__BackingField; + int32_t _FieldWeather_k__BackingField; + int32_t _DebugWeek_k__BackingField; + int32_t _FieldInputMode_k__BackingField; + bool _IsZenmetuFlag_k__BackingField; + bool _IsNeedUnloadOnFieldConnector_k__BackingField; + int32_t _Warp_k__BackingField; + bool _Telescope_k__BackingField; + bool _TelescopeReturn_k__BackingField; + bool _FieldCacheFlag_k__BackingField; + int32_t _SafariBallNum_k__BackingField; + int32_t _SafariStepCount_k__BackingField; + struct System_Collections_Generic_List_MonsNo__o* _SafariCaptureMonsNo_k__BackingField; + int32_t _IsCpuBoostMode_k__BackingField; + struct Dpr_Item_ItemInfo_o* _UsedFieldItem_k__BackingField; + int32_t _UsedFieldWazaNo_k__BackingField; + int32_t _UsedFieldWazaTemotiNo_k__BackingField; + bool _Flash_k__BackingField; + struct System_Collections_Generic_List_WazaNo__o* UsedFieldWazaInArea; + bool _PoketchOpen_k__BackingField; + int32_t _MovePokemonIndex_k__BackingField; + bool _IsD26Key_k__BackingField; + bool isNeedFixPokemonExp; +}; + struct PlayerWork_c { Il2CppClass_1 _1; struct PlayerWork_StaticFields* static_fields; @@ -257,9 +303,11 @@ class PlayerWork bool CustomSaveOperation(MethodInfo *method); bool CustomLoadAsyncOperation(MethodInfo *method); void OnPreSave(MethodInfo *method); + // 02cf2c00 + static void set_WalkEncountCount(int32_t value, MethodInfo *method); - static DPData::ENC_SV_DATA_o * get_Enc_SV_Data(); + static DPData::ENC_SV_DATA_o get_Enc_SV_Data(DPData::ENC_SV_DATA_o *__return_storage_ptr__, MethodInfo * method); static void set_Enc_SV_Data(DPData::ENC_SV_DATA_o value); static int32_t get_defaultPokeNo(MethodInfo *method); @@ -270,11 +318,17 @@ class PlayerWork static int32_t get_rivalPokeType(MethodInfo *method); + static Pml::PokeParty_o * get_playerParty(MethodInfo *method); static int32_t get_zoneID(MethodInfo *method); static DPData::ZUKAN_WORK_o get_zukan(DPData::ZUKAN_WORK_o *__return_storage_ptr__, MethodInfo * method); + // 02ce2c20 + static int32_t get_msgLangID(MethodInfo *method); + // 02ce2d20 + static DPData::MYSTATUS_o * get_playerStatus(MethodInfo *method); + // 0236e9f0 static int32_t GetInt(int32_t index, MethodInfo *method); // 02379290 diff --git a/include/Pml/Item/ItemData.hpp b/include/Pml/Item/ItemData.hpp new file mode 100644 index 000000000..00e9df851 --- /dev/null +++ b/include/Pml/Item/ItemData.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace Pml +{ + namespace Item + { + struct ItemData { + static bool IsNuts(uint16_t itemno, MethodInfo *method); + }; + } +} \ No newline at end of file diff --git a/include/Pml/Personal/PersonalSystem.hpp b/include/Pml/Personal/PersonalSystem.hpp index 8c398f3b4..7fd75f29a 100644 --- a/include/Pml/Personal/PersonalSystem.hpp +++ b/include/Pml/Personal/PersonalSystem.hpp @@ -14,6 +14,8 @@ namespace Pml static void LoadPersonalData(int32_t monsno, uint16_t formno, MethodInfo *method); // 0x027fc3a0 static bool CheckPersonalWazaMachine(uint16_t machineNo, MethodInfo *method); + // 0x024a15d0 + static int32_t GetTokuseiPattern(MethodInfo *method); }; } -} \ No newline at end of file +} diff --git a/include/Pml/PokePara/CoreParam.h b/include/Pml/PokePara/CoreParam.h index b0f7cd102..45aa7c42b 100644 --- a/include/Pml/PokePara/CoreParam.h +++ b/include/Pml/PokePara/CoreParam.h @@ -4,6 +4,7 @@ // #include "types.h" // #include "Pml/MonsNo.h" #include "Pml/PokePara/Accessor.h" +#include "Pml/PokePara/OwnerInfo.hpp" #include "System/String.hpp" namespace System @@ -51,6 +52,27 @@ namespace Pml uint8_t GetMezapaType(MethodInfo *method); + // 0204ac00 + void SetParentName(System::String *name, MethodInfo *method); + // 02049650 + void SetLangId(uint32_t langId, MethodInfo *method); + // 0204b840 + void SetGetBall(uint32_t value, MethodInfo *method); + // 0204b040 + void SetCondition(int32_t cond, uint8_t value, MethodInfo *method); + // 020464e0 + void SetWaza(uint8_t wazaIndex, int32_t wazano, MethodInfo *method); + // 02048c90 + bool UpdateOwnerInfo(Pml::PokePara::OwnerInfo_o *ownerInfo, MethodInfo *method); + // 020446e0 + void ChangeTalentPower(int32_t powerId, uint32_t value, MethodInfo *method); + + // 0204c910 + bool StartFastMode(MethodInfo *method); + // 0204c960 + bool EndFastMode(bool validFlag, MethodInfo *method); + + void ChangeFormNo(uint16_t nextFormno, CoreParam_FormChangeResult_o *pResult, MethodInfo *method); uint32_t GetPower(int32_t powerId, MethodInfo *method); // 2044680 @@ -59,13 +81,26 @@ namespace Pml uint32_t GetTalentPower(int32_t powerId, MethodInfo *method); // 204a5a0 uint8_t GetRareType(MethodInfo * method); - + // 2048740 + int32_t GetSeikaku(MethodInfo *method); + // 20488a0 + int32_t GetTokuseiNo(MethodInfo *method); + // 2045ce0 + uint8_t GetTokuseiIndex(MethodInfo *method); + // 2048ac0 + void SetTokuseiIndex(uint8_t tokuseiIndex, MethodInfo *method); bool IsNull(MethodInfo * method); bool IsEgg(int32_t type, MethodInfo * method); uint16_t GetItem(MethodInfo * method); void SetItem(uint16_t itemno, MethodInfo *method); + // 2043bd0 + bool IsHpZero(MethodInfo *method); + // 2043e30 + uint32_t GetLevel(MethodInfo *method); + // 2046b40 + bool CheckWazaMachine(uint32_t machineNo, MethodInfo *method); System::Collections::Generic::HashSet_WazaNo__o * CollectRemindableWaza( MethodInfo *method ); diff --git a/include/Pml/PokePara/InitialSpec.hpp b/include/Pml/PokePara/InitialSpec.hpp index df4b2e006..8b2df6c5a 100644 --- a/include/Pml/PokePara/InitialSpec.hpp +++ b/include/Pml/PokePara/InitialSpec.hpp @@ -1,13 +1,12 @@ #pragma once #include "il2cpp.hpp" +#include "System/Array.hpp" namespace Pml { - namespace PokePara { - struct InitialSpec_Fields { uint64_t randomSeed; bool isRandomSeedEnable; @@ -21,7 +20,7 @@ namespace Pml uint16_t seikaku; uint8_t tokuseiIndex; uint8_t rareTryCount; - struct System_UInt16_array* talentPower; + System_UInt16_array* talentPower; uint32_t friendship; uint8_t talentVNum; uint16_t weight; @@ -47,5 +46,8 @@ namespace Pml void *monitor; InitialSpec_Fields fields; }; + + // 04c5e700 + extern void * InitialSpec_TypeInfo; } -} \ No newline at end of file +} diff --git a/include/Pml/PokePara/OwnerInfo.hpp b/include/Pml/PokePara/OwnerInfo.hpp new file mode 100644 index 000000000..e1962c94f --- /dev/null +++ b/include/Pml/PokePara/OwnerInfo.hpp @@ -0,0 +1,57 @@ +#pragma once + +#include "il2cpp.hpp" +#include "DpData.hpp" +#include "System/String.hpp" + +namespace Pml +{ + namespace PokePara + { + struct OwnerInfo_Fields + { + uint32_t trainerId; + uint8_t sex; + uint8_t langID; + struct System::String* name; + }; + + struct OwnerInfo_RGCTXs + { + }; + + struct OwnerInfo_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct OwnerInfo_c + { + Il2CppClass_1 _1; + struct OwnerInfo_StaticFields* static_fields; + OwnerInfo_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + OwnerInfo_VTable vtable; + }; + + struct OwnerInfo_o + { + OwnerInfo_c *klass; + void *monitor; + OwnerInfo_Fields fields; + + // 02054ea0 + void ctor(DPData::MYSTATUS_o *ownerStatus, MethodInfo *method); + }; + + struct OwnerInfo_StaticFields + { + }; + + // 04c5fbe8 + extern void * OwnerInfo_TypeInfo; + } +} diff --git a/include/Pml/PokePara/PokemonParam.h b/include/Pml/PokePara/PokemonParam.h index 1b1d82010..0718ba11c 100644 --- a/include/Pml/PokePara/PokemonParam.h +++ b/include/Pml/PokePara/PokemonParam.h @@ -1,6 +1,7 @@ #pragma once #include "Pml/PokePara/CoreParam.h" +#include "Pml/PokePara/InitialSpec.hpp" namespace Pml { @@ -15,7 +16,13 @@ namespace Pml PokemonParam_c *klass; void *monitor; PokemonParam_Fields fields; + + // 02055140 + void ctor(Pml::PokePara::InitialSpec_o *spec, MethodInfo *method); }; + + // 04c59c10 + extern void * PokemonParam_TypeInfo; } } diff --git a/include/RandomGroupWork.hpp b/include/RandomGroupWork.hpp new file mode 100644 index 000000000..f8802641f --- /dev/null +++ b/include/RandomGroupWork.hpp @@ -0,0 +1,9 @@ +#pragma once + +#include "il2cpp.hpp" + +struct RandomGroupWork +{ + // 01998cb0 + static int32_t RandomValue(int32_t max, MethodInfo *method); +}; diff --git a/include/SmartPoint/AssetAssistant/Sequencer.hpp b/include/SmartPoint/AssetAssistant/Sequencer.hpp new file mode 100644 index 000000000..0ae773816 --- /dev/null +++ b/include/SmartPoint/AssetAssistant/Sequencer.hpp @@ -0,0 +1,16 @@ +#pragma once + +#include "il2cpp.hpp" +#include "UnityEngine/Coroutine.hpp" + +namespace SmartPoint +{ + namespace AssetAssistant + { + struct Sequencer + { + // 02bc29b0 + static void Stop(UnityEngine::Coroutine_o *coroutine, MethodInfo *method); + }; + } +} diff --git a/include/SmartPoint/AssetAssistant/SingletonMonoBehavior.hpp b/include/SmartPoint/AssetAssistant/SingletonMonoBehavior.hpp new file mode 100644 index 000000000..58e596ff8 --- /dev/null +++ b/include/SmartPoint/AssetAssistant/SingletonMonoBehavior.hpp @@ -0,0 +1,17 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace SmartPoint +{ + namespace AssetAssistant + { + struct SingletonMonoBehaviour + { + static void * get_Instance(MethodInfo * method); + }; + extern MethodInfo ** PTR_SingletonMonoBehaviour_UIManager_get_Instance; + extern MethodInfo ** PTR_SingletonMonoBehaviour_AudioManager_get_Instance; + extern MethodInfo ** PTR_SingletonMonoBehaviour_MessageManager_get_Instance; + } +} diff --git a/include/TairyouHasseiPokeManager.hpp b/include/TairyouHasseiPokeManager.hpp index 0564a25f1..5e85ede08 100644 --- a/include/TairyouHasseiPokeManager.hpp +++ b/include/TairyouHasseiPokeManager.hpp @@ -1,12 +1,14 @@ #pragma once + #include "il2cpp.hpp" +#include "UnityEngine/GameObject.hpp" struct TairyouHasseiPokeManager_Fields { struct TairyouHasseiPoke_array* _objects; struct SmartPoint_AssetAssistant_AssetRequestOperation_o* _operation; float _defaultScale; uint8_t _loadingState; - struct UnityEngine_GameObject_o* _parent; + struct UnityEngine::GameObject_o* _parent; int32_t _targetZone; }; @@ -16,4 +18,4 @@ struct TairyouHasseiPokeManager_o { TairyouHasseiPokeManager_c *klass; void *monitor; TairyouHasseiPokeManager_Fields fields; -}; \ No newline at end of file +}; diff --git a/include/UgMainProc/SimbolMons.hpp b/include/UgMainProc/SimbolMons.hpp index 38606d27f..3eb28ef8c 100644 --- a/include/UgMainProc/SimbolMons.hpp +++ b/include/UgMainProc/SimbolMons.hpp @@ -1,3 +1,6 @@ +#pragma once + +#include "UnityEngine/GameObject.hpp" struct UgMainProc_StaticFields { struct Dpr_Field_Walking_UgWalkingAIManager_o* walkingManager; @@ -12,7 +15,7 @@ struct UgMainProc_SimbolMons_Fields { bool Active; bool isLoaded; int32_t moveType; - struct UnityEngine_GameObject_o* gameObject; + struct UnityEngine::GameObject_o* gameObject; struct UnityEngine_Transform_o* transform; struct FieldPokemonEntity_o* entity; }; @@ -21,4 +24,4 @@ struct UgMainProc_SimbolMons_o { UgMainProc_SimbolMons_c *klass; void *monitor; UgMainProc_SimbolMons_Fields fields; -}; \ No newline at end of file +}; diff --git a/include/UnityEngine/BoxCollider.hpp b/include/UnityEngine/BoxCollider.hpp new file mode 100644 index 000000000..874d80659 --- /dev/null +++ b/include/UnityEngine/BoxCollider.hpp @@ -0,0 +1,44 @@ +#pragma once + +#include "il2cpp.hpp" +#include "UnityEngine/Collider.hpp" + +namespace UnityEngine +{ + struct BoxCollider_Fields + { + Collider_Fields super; + }; + + struct BoxCollider_RGCTXs + { + }; + + struct BoxCollider_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct BoxCollider_c + { + Il2CppClass_1 _1; + struct BoxCollider_StaticFields* static_fields; + BoxCollider_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + BoxCollider_VTable vtable; + }; + + struct BoxCollider_o + { + BoxCollider_c *klass; + void *monitor; + BoxCollider_Fields fields; + }; + + struct BoxCollider_StaticFields + { + }; +} diff --git a/include/UnityEngine/Collider.hpp b/include/UnityEngine/Collider.hpp new file mode 100644 index 000000000..fdf59831e --- /dev/null +++ b/include/UnityEngine/Collider.hpp @@ -0,0 +1,47 @@ +#pragma once + +#include "il2cpp.hpp" +#include "UnityEngine/Component.hpp" + +namespace UnityEngine +{ + struct Collider_Fields + { + Component_Fields super; + }; + + struct Collider_RGCTXs + { + }; + + struct Collider_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct Collider_c + { + Il2CppClass_1 _1; + struct Collider_StaticFields* static_fields; + Collider_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + Collider_VTable vtable; + }; + + struct Collider_o + { + Collider_c *klass; + void *monitor; + Collider_Fields fields; + + // 02c1c600 + void set_enabled(bool value, MethodInfo *method); + }; + + struct Collider_StaticFields + { + }; +} diff --git a/include/UnityEngine/Color.hpp b/include/UnityEngine/Color.hpp new file mode 100644 index 000000000..5f78b397e --- /dev/null +++ b/include/UnityEngine/Color.hpp @@ -0,0 +1,45 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace UnityEngine +{ + struct Color_Fields + { + float r; + float g; + float b; + float a; + }; + + struct Color_RGCTXs + { + }; + + struct Color_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + VirtualInvokeData _4_Equals; + }; + + struct Color_c + { + Il2CppClass_1 _1; + struct Color_StaticFields* static_fields; + Color_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + Color_VTable vtable; + }; + + struct Color_o + { + Color_Fields fields; + }; + + struct Color_StaticFields + { + }; +} diff --git a/include/UnityEngine/Component.hpp b/include/UnityEngine/Component.hpp new file mode 100644 index 000000000..782d65cf6 --- /dev/null +++ b/include/UnityEngine/Component.hpp @@ -0,0 +1,44 @@ +#pragma once + +#include "il2cpp.hpp" +#include "UnityEngine/Object.hpp" + +namespace UnityEngine +{ + struct Component_Fields + { + Object_Fields super; + }; + + struct Component_RGCTXs + { + }; + + struct Component_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct Component_c + { + Il2CppClass_1 _1; + struct Component_StaticFields* static_fields; + Component_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + Component_VTable vtable; + }; + + struct Component_o + { + Component_c *klass; + void *monitor; + Component_Fields fields; + }; + + struct Component_StaticFields + { + }; +} diff --git a/include/UnityEngine/Coroutine.hpp b/include/UnityEngine/Coroutine.hpp new file mode 100644 index 000000000..96d286aee --- /dev/null +++ b/include/UnityEngine/Coroutine.hpp @@ -0,0 +1,45 @@ +#pragma once + +#include "il2cpp.hpp" +#include "UnityEngine/YieldInstruction.hpp" + +namespace UnityEngine +{ + struct Coroutine_Fields + { + YieldInstruction_Fields super; + intptr_t m_Ptr; + }; + + struct Coroutine_RGCTXs + { + }; + + struct Coroutine_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct Coroutine_c + { + Il2CppClass_1 _1; + struct Coroutine_StaticFields* static_fields; + Coroutine_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + Coroutine_VTable vtable; + }; + + struct Coroutine_o + { + Coroutine_c *klass; + void *monitor; + Coroutine_Fields fields; + }; + + struct Coroutine_StaticFields + { + }; +} diff --git a/include/UnityEngine/GameObject.hpp b/include/UnityEngine/GameObject.hpp new file mode 100644 index 000000000..7cef82988 --- /dev/null +++ b/include/UnityEngine/GameObject.hpp @@ -0,0 +1,53 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/String.hpp" +#include "UnityEngine/Object.hpp" + +namespace UnityEngine +{ + struct GameObject_Fields + { + Object_Fields super; + }; + + struct GameObject_RGCTXs + { + }; + + struct GameObject_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct GameObject_c + { + Il2CppClass_1 _1; + struct GameObject_StaticFields* static_fields; + GameObject_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + GameObject_VTable vtable; + }; + + struct GameObject_o + { + GameObject_c *klass; + void *monitor; + GameObject_Fields fields; + + // 026b1ea0 + static GameObject_o * Find(System::String *name, MethodInfo *method); + + // 01f48980 + void * GetComponent(MethodInfo *method); + }; + + struct GameObject_StaticFields + { + }; + + extern MethodInfo ** PTR_GameObject_BoxCollider_GetComponent; +} diff --git a/include/UnityEngine/Random.hpp b/include/UnityEngine/Random.hpp new file mode 100644 index 000000000..a062885ca --- /dev/null +++ b/include/UnityEngine/Random.hpp @@ -0,0 +1,12 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace UnityEngine +{ + struct Random + { + // 026941e0 + static int32_t Range(int32_t min, int32_t max, MethodInfo *method); + }; +} diff --git a/include/UnityEngine/YieldInstruction.hpp b/include/UnityEngine/YieldInstruction.hpp new file mode 100644 index 000000000..f9f1fafd3 --- /dev/null +++ b/include/UnityEngine/YieldInstruction.hpp @@ -0,0 +1,42 @@ +#pragma once + +#include "il2cpp.hpp" + +namespace UnityEngine +{ + struct YieldInstruction_Fields + { + }; + + struct YieldInstruction_RGCTXs + { + }; + + struct YieldInstruction_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct YieldInstruction_c + { + Il2CppClass_1 _1; + struct YieldInstruction_StaticFields* static_fields; + YieldInstruction_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + YieldInstruction_VTable vtable; + }; + + struct YieldInstruction_o + { + YieldInstruction_c *klass; + void *monitor; + YieldInstruction_Fields fields; + }; + + struct YieldInstruction_StaticFields + { + }; +} diff --git a/include/WeatherWork.hpp b/include/WeatherWork.hpp new file mode 100644 index 000000000..285797b0c --- /dev/null +++ b/include/WeatherWork.hpp @@ -0,0 +1,42 @@ +#pragma once + +#include "il2cpp.hpp" + +struct WeatherWork_Fields +{ +}; + +struct WeatherWork_RGCTXs +{ +}; + +struct WeatherWork_VTable +{ + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; +}; + +struct WeatherWork_c +{ + Il2CppClass_1 _1; + struct WeatherWork_StaticFields* static_fields; + WeatherWork_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + WeatherWork_VTable vtable; +}; + +struct WeatherWork +{ + WeatherWork_c *klass; + void *monitor; + WeatherWork_Fields fields; + + // 017d18a0 + static void set_WeatherID(int32_t value, MethodInfo *method); +}; + +struct WeatherWork_StaticFields +{ +}; diff --git a/include/XLSXContent/FieldCommonParam.hpp b/include/XLSXContent/FieldCommonParam.hpp new file mode 100644 index 000000000..7c6d3c896 --- /dev/null +++ b/include/XLSXContent/FieldCommonParam.hpp @@ -0,0 +1,82 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/Array.hpp" + +namespace XLSXContent +{ + struct FieldCommonParam_Sheetdata_Fields + { + float param; + }; + + struct FieldCommonParam_Sheetdata_RGCTXs + { + }; + + struct FieldCommonParam_Sheetdata_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct FieldCommonParam_Sheetdata_c + { + Il2CppClass_1 _1; + struct FieldCommonParam_Sheetdata_StaticFields* static_fields; + FieldCommonParam_Sheetdata_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + FieldCommonParam_Sheetdata_VTable vtable; + }; + + struct FieldCommonParam_Sheetdata_o + { + FieldCommonParam_Sheetdata_c *klass; + void *monitor; + FieldCommonParam_Sheetdata_Fields fields; + }; + + struct FieldCommonParam_Sheetdata_StaticFields + { + }; + + struct FieldCommonParam_Fields + { + UnityEngine_ScriptableObject_Fields super; + System::Array* data; + }; + + struct FieldCommonParam_RGCTXs + { + }; + + struct FieldCommonParam_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct FieldCommonParam_c + { + Il2CppClass_1 _1; + struct FieldCommonParam_StaticFields* static_fields; + FieldCommonParam_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + FieldCommonParam_VTable vtable; + }; + + struct FieldCommonParam_o + { + FieldCommonParam_c *klass; + void *monitor; + FieldCommonParam_Fields fields; + }; + + struct FieldCommonParam_StaticFields + { + }; +} diff --git a/include/XLSXContent/LocalKoukanData.hpp b/include/XLSXContent/LocalKoukanData.hpp new file mode 100644 index 000000000..a148c1a6d --- /dev/null +++ b/include/XLSXContent/LocalKoukanData.hpp @@ -0,0 +1,48 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/Array.hpp" +#include "System/String.hpp" + +namespace XLSXContent +{ + struct LocalKoukanData_Sheetdata_Fields { + int32_t target; + System::String* name_label; + int32_t trainerid; + int32_t monsno; + System::String* nickname_label; + int32_t level; + int32_t seikaku; + int32_t tokusei; + uint16_t itemno; + int32_t rand; + uint8_t sex; + int32_t language; + System::Array* waza; + }; + + struct LocalKoukanData_Sheetdata_c; + + struct LocalKoukanData_Sheetdata_o { + LocalKoukanData_Sheetdata_c *klass; + void *monitor; + LocalKoukanData_Sheetdata_Fields fields; + }; + + struct LocalKoukanData_Fields { + UnityEngine_ScriptableObject_Fields super; + System::Array* data; + }; + + struct LocalKoukanData_c; + + struct LocalKoukanData_o { + LocalKoukanData_c *klass; + void *monitor; + LocalKoukanData_Fields fields; + + // 017d5670 + XLSXContent::LocalKoukanData_Sheetdata_o * get_Item(int32_t index, MethodInfo *method); + }; +} diff --git a/include/XLSXContent/MapAttributeTable.hpp b/include/XLSXContent/MapAttributeTable.hpp new file mode 100644 index 000000000..7a2253d9d --- /dev/null +++ b/include/XLSXContent/MapAttributeTable.hpp @@ -0,0 +1,38 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/Array.hpp" +#include "System/String.hpp" + +namespace XLSXContent +{ + struct MapAttributeTable_SheetData_Fields { + int32_t Code; + int32_t Attribute; + bool Entry; + bool Water; + bool Encount; + struct System::String* FieldEncount; + }; + + struct MapAttributeTable_SheetData_c; + + struct MapAttributeTable_SheetData_o { + MapAttributeTable_SheetData_c *klass; + void *monitor; + MapAttributeTable_SheetData_Fields fields; + }; + + struct MapAttributeTable_Fields { + UnityEngine_ScriptableObject_Fields super; + struct System::Array* Data; + }; + + struct MapAttributeTable_c; + + struct MapAttributeTable_o { + MapAttributeTable_c *klass; + void *monitor; + MapAttributeTable_Fields fields; + }; +} diff --git a/include/XLSXContent/MapInfo.hpp b/include/XLSXContent/MapInfo.hpp new file mode 100644 index 000000000..ed96b03dc --- /dev/null +++ b/include/XLSXContent/MapInfo.hpp @@ -0,0 +1,170 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/Array.hpp" +#include "System/String.hpp" + +namespace XLSXContent +{ + struct MapInfo_SheetZoneData_Fields + { + System::String* Caption; + System::String* MSLabel; + System::String* PokePlaceName; + System::String* FlyingPlaceName; + int32_t MapType; + bool IsField; + int32_t LandmarkType; + struct UnityEngine_Vector2_o MiniMapOffset; + bool Bicycle; + bool Escape; + bool Fly; + bool BattleSearcher; + bool TureAruki; + bool KuruKuru; + bool Fall; + System::Array* BattleBg; + int32_t ZoneID; + int32_t AreaID; + struct ZoneTable_o* ZoneGrid; + struct AttributeMatrix_o* Attribute; + struct AttributeMatrix_o* AttributeEx; + struct AttributeMatrix_o* SubAttribute; + struct AttributeMatrix_o* SubAttributeEx; + System::Array* BGM; + System::String* EnvironmentalSound; + int32_t Weather; + struct EnvironmentSettings_o* RenderSettings; + bool ReflectionCamera; + bool FixedTime; + System::String* AssetBundleName; + bool RoomPanCamera; + struct UnityEngine_Vector4_array* Locators; + bool Reload; + }; + + struct MapInfo_SheetZoneData_RGCTXs + { + }; + + struct MapInfo_SheetZoneData_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct MapInfo_SheetZoneData_c + { + Il2CppClass_1 _1; + struct MapInfo_SheetZoneData_StaticFields* static_fields; + MapInfo_SheetZoneData_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + MapInfo_SheetZoneData_VTable vtable; + }; + + struct MapInfo_SheetZoneData_o + { + MapInfo_SheetZoneData_c *klass; + void *monitor; + MapInfo_SheetZoneData_Fields fields; + }; + + struct MapInfo_SheetZoneData_StaticFields + { + }; + + struct MapInfo_SheetCamera_Fields + { + int32_t ariaID; + float pitch; + float fov; + float targetRange; + float panDistance; + float panPitch; + float panFov; + bool panpos_useflag; + float panMinposY; + float panMaxposY; + float panMinposZ; + float panMaxposZ; + float defocusStart; + float defocusEnd; + float distance; + }; + + struct MapInfo_SheetCamera_RGCTXs + { + }; + + struct MapInfo_SheetCamera_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct MapInfo_SheetCamera_c + { + Il2CppClass_1 _1; + struct MapInfo_SheetCamera_StaticFields* static_fields; + MapInfo_SheetCamera_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + MapInfo_SheetCamera_VTable vtable; + }; + + struct MapInfo_SheetCamera_o + { + MapInfo_SheetCamera_c *klass; + void *monitor; + MapInfo_SheetCamera_Fields fields; + }; + + struct MapInfo_SheetCamera_StaticFields + { + }; + + struct MapInfo_Fields + { + UnityEngine_ScriptableObject_Fields super; + System::Array* ZoneData; + System::Array* Camera; + }; + + struct MapInfo_RGCTXs + { + }; + + struct MapInfo_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct MapInfo_c + { + Il2CppClass_1 _1; + struct MapInfo_StaticFields* static_fields; + MapInfo_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + MapInfo_VTable vtable; + }; + + struct MapInfo_o + { + MapInfo_c *klass; + void *monitor; + MapInfo_Fields fields; + + // 017d5790 + MapInfo_SheetZoneData_o * get_Item(int32_t index, MethodInfo *method); + }; + + struct MapInfo_StaticFields + { + }; +} diff --git a/include/XLSXContent/MonohiroiTable.hpp b/include/XLSXContent/MonohiroiTable.hpp new file mode 100644 index 000000000..8bef46991 --- /dev/null +++ b/include/XLSXContent/MonohiroiTable.hpp @@ -0,0 +1,84 @@ +#pragma once + +#include "il2cpp.hpp" +#include "System/Array.hpp" +#include "System/String.hpp" + +namespace XLSXContent +{ + struct MonohiroiTable_SheetMonoHiroi_Fields + { + uint16_t ID; + System::Array* Ratios; + }; + + struct MonohiroiTable_SheetMonoHiroi_RGCTXs + { + }; + + struct MonohiroiTable_SheetMonoHiroi_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct MonohiroiTable_SheetMonoHiroi_c + { + Il2CppClass_1 _1; + struct MonohiroiTable_SheetMonoHiroi_StaticFields* static_fields; + MonohiroiTable_SheetMonoHiroi_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + MonohiroiTable_SheetMonoHiroi_VTable vtable; + }; + + struct MonohiroiTable_SheetMonoHiroi_o + { + MonohiroiTable_SheetMonoHiroi_c *klass; + void *monitor; + MonohiroiTable_SheetMonoHiroi_Fields fields; + }; + + struct MonohiroiTable_SheetMonoHiroi_StaticFields + { + }; + + struct MonohiroiTable_Fields + { + UnityEngine_ScriptableObject_Fields super; + System::Array* MonoHiroi; + }; + + struct MonohiroiTable_RGCTXs + { + }; + + struct MonohiroiTable_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct MonohiroiTable_c + { + Il2CppClass_1 _1; + struct MonohiroiTable_StaticFields* static_fields; + MonohiroiTable_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + MonohiroiTable_VTable vtable; + }; + + struct MonohiroiTable_o + { + MonohiroiTable_c *klass; + void *monitor; + MonohiroiTable_Fields fields; + }; + + struct MonohiroiTable_StaticFields + { + }; +} diff --git a/include/ZoneWork.hpp b/include/ZoneWork.hpp index e1b325e0b..5b874b4ba 100644 --- a/include/ZoneWork.hpp +++ b/include/ZoneWork.hpp @@ -7,4 +7,12 @@ struct ZoneWork { // Get array of swarm pokemon static System::Array * TairyouHassei_MonsLv(int32_t zoneId, MethodInfo * method); -}; \ No newline at end of file + // 017da6f0 + static int32_t TairyouHassei_ZoneID(MethodInfo *method); + // 017da610 + static bool IsHillBackZone(int32_t zone_id, MethodInfo *method); + // 017da660 + static int32_t SafariZonePosID(int32_t zone_id, MethodInfo *method); + // 017da600 + static bool IsSpFishingZone(int32_t zone_id, MethodInfo *method); +}; diff --git a/include/ZukanWork.hpp b/include/ZukanWork.hpp index 6134c6c13..c75c570bb 100644 --- a/include/ZukanWork.hpp +++ b/include/ZukanWork.hpp @@ -35,4 +35,11 @@ struct ZukanWork_c { ZukanWork_VTable vtable; }; -extern ZukanWork_c * ZukanWork_TypeInfo; \ No newline at end of file +struct ZukanWork +{ + static System::Array * GetFormFlags(uint32_t monsno,uint8_t sex,bool color,MethodInfo *method); + static bool GetZenkokuFlag(MethodInfo *method); + static void SetPoke(Pml::PokePara::PokemonParam_o* mons, int32_t get, MethodInfo *method); +}; + +extern ZukanWork_c * ZukanWork_TypeInfo; diff --git a/include/poketool/poke_memo/poketool_poke_memo.hpp b/include/poketool/poke_memo/poketool_poke_memo.hpp new file mode 100644 index 000000000..668c7ae4b --- /dev/null +++ b/include/poketool/poke_memo/poketool_poke_memo.hpp @@ -0,0 +1,55 @@ +#pragma once + +#include "il2cpp.hpp" +#include "Pml/PokePara/CoreParam.h" + +namespace poketool +{ + namespace poke_memo + { + struct poketool_poke_memo_Fields + { + }; + + struct poketool_poke_memo_RGCTXs + { + }; + + struct poketool_poke_memo_VTable + { + VirtualInvokeData _0_Equals; + VirtualInvokeData _1_Finalize; + VirtualInvokeData _2_GetHashCode; + VirtualInvokeData _3_ToString; + }; + + struct poketool_poke_memo_c + { + Il2CppClass_1 _1; + struct poketool_poke_memo_StaticFields* static_fields; + poketool_poke_memo_RGCTXs* rgctx_data; + Il2CppClass_2 _2; + poketool_poke_memo_VTable vtable; + }; + + struct poketool_poke_memo_o + { + poketool_poke_memo_c *klass; + void *monitor; + poketool_poke_memo_Fields fields; + + // 02bacca0 + static void ClearPlaceTime(Pml::PokePara::CoreParam *pParam, int32_t type, MethodInfo *method); + // 02baccc0 + static void SetPlaceTime(Pml::PokePara::CoreParam *pParam, uint32_t placeNo, int32_t dataType, MethodInfo *method); + // 02bace70 + static void SetGetLevel(Pml::PokePara::CoreParam *pParam, MethodInfo *method); + // 02baceb0 + static void SetVersion(Pml::PokePara::CoreParam *pParam, MethodInfo *method); + }; + + struct poketool_poke_memo_StaticFields + { + }; + } +} diff --git a/include/util.hpp b/include/util.hpp index e4b503a99..b2324da6e 100644 --- a/include/util.hpp +++ b/include/util.hpp @@ -23,4 +23,12 @@ void * system_array_new(void * typeInfo, uint32_t len); MethodInfo * copyMethodInfo(MethodInfo * src, Il2CppMethodPointer methodPointer); uint32_t GetBadgeCount(); -Dpr::Battle::Logic::EventFactor_EventHandlerTable_o * createEventHandlerTable(uint16_t eventID, MethodInfo * src, Il2CppMethodPointer methodPointer); \ No newline at end of file +uint32_t getLevelCapIndex(); +uint32_t getMaxLevelOfCapIndex(uint32_t index); +uint32_t getMaxLevel(); +uint32_t getLevelCapIndexOfLevel(uint32_t level); +System::Array * CreateEventHandlerTable(uint32_t size); +Dpr::Battle::Logic::EventFactor_EventHandlerTable_o * CreateEventHandler(uint16_t eventID, MethodInfo * src, Il2CppMethodPointer methodPointer); +void HandlerRankResetAll(Dpr::Battle::Logic::EventFactor_EventHandlerArgs_o **args, uint8_t pokeID); +void HandlerRankReset(Dpr::Battle::Logic::EventFactor_EventHandlerArgs_o **args, uint8_t pokeID); + diff --git a/linkerscripts/symbols.bd_130.ld b/linkerscripts/symbols.bd_130.ld index cb5d55909..bacde8d57 100644 --- a/linkerscripts/symbols.bd_130.ld +++ b/linkerscripts/symbols.bd_130.ld @@ -12,7 +12,8 @@ _Znwm = 0x00584220 - 0x05708000; _Znam = 0x00584560 - 0x05708000; _ZdlPv = 0x005845c0 - 0x05708000; _ZdaPv = 0x005848d0 - 0x05708000; - + +_ZN10PlayerWork15get_playerPartyEP10MethodInfo = 0x02ce2b50 - 0x05708000; _ZN10PlayerWork10get_zoneIDEP10MethodInfo = 0x02ceea50 - 0x05708000; _ZN3Pml5Local6Random8GetValueEP10MethodInfo = 0x024a00a0 - 0x05708000; _ZN3Pml8PokePara8CalcTool11IsRareColorEjjP10MethodInfo = 0x024ad790 - 0x05708000; @@ -48,7 +49,7 @@ _Z21_system_load_typeinfoPv = 0x00264fe0 - 0x05708000; _Z18il2cpp_object_initPvS_ = 0x002926e0 - 0x05708000; System_Boolean_array_TypeInfo = 0x04e4aa20 - 0x056E6000; System_Byte_array_typeInfo = 0x04c552e0 - 0x05708000; -System_UInt16_array_TypeInfo = 0x04e4aae8 - 0x056E6000; +System_UInt16_array_TypeInfo = 0x04c559e8 - 0x05708000; System_UInt32_array_TypeInfo = 0x04e4a9c8 - 0x056E6000; System_Int32_array_TypeInfo = 0x04c553e0 - 0x05708000; UnityEngine_Vector3_Array_TypeInfo = 0x04e4cdf8 - 0x056E6000; @@ -110,7 +111,6 @@ _ZN6System11Collections7Generic20ListXMenuTopItem_AddEPNS1_33List_ShopBoutiqueIt _ZN6System11Collections7Generic46List_ShopBoutiqueItemItem_Param_Add_MethodInfoE = 0x04bba810 - 0x05708000; PTR_DATA_04bba8a8 = 0x04bba8a8 - 0x05708000; -MonsLv_Array_TypeInfo = 0x04e54300 - 0x056E6000; _ZN11GameManager19GetFieldEncountDataEiP10MethodInfo = 0x02cd1150 - 0x05708000; _ZN3Dpr2UI30ContextMenuItem_Param_TypeInfoE = 0x04c5e788 - 0x05708000; @@ -247,6 +247,8 @@ _ZN14FieldManager_o9GetFormNoEiiiP10MethodInfo = 0x179f560 - 0x05708000; _ZN8ItemWork7SubItemEiiP10MethodInfo = 0x01aea450 - 0x05708000; _ZN3Dpr4Item10ItemInfo_o6get_IdEP10MethodInfo = 0x01ca61f0 - 0x05708000; +_ZN8ItemWork11GetItemInfoEiP10MethodInfo = 0x01aea5b0 - 0x05708000; +_ZN3Dpr4Item10ItemInfo_o9get_countEP10MethodInfo = 0x01ca5cc0 - 0x05708000; _ZN10PlayerWork9get_zukanEPN6DPData12ZUKAN_WORK_oEP10MethodInfo = 0x2cf1040 - 0x05708000; _ZN3Dpr7Message20MessageWordSetHelper12SetDigitWordEiiP10MethodInfo = 0x01f9a580 - 0x05708000; _ZN3Pml8PokePara9CoreParam8GetPowerEiP10MethodInfo = 0x20435c0 - 0x05708000; @@ -287,11 +289,15 @@ _ZN3Dpr2UI7UIBag_o15OpenContextMenuEPN6System5ArrayIiEEP30System_Action_ContextM _ZN8ItemWork10IsDsPlayerEP10MethodInfo = 0x1aeb550 - 0x05708000; _ZN3Pml8Personal14PersonalSystem15GetPersonalDataEitP10MethodInfo = 0x024a0ca0 - 0x05708000; _ZN3Pml8PokePara9CoreParam11GetRareTypeEP10MethodInfo = 0x204a5a0 - 0x05708000; +_ZN3Pml8PokePara9CoreParam10GetSeikakuEP10MethodInfo = 0x2048740 - 0x05708000; DAT_7103a679b8 = 0x3a679b8 - 0x05708000; _ZN11GameManager22get_currentPeriodOfDayEP10MethodInfo = 0x2cd0c60 - 0x05708000; _ZN3Pml8PokePara13InitialSpec_o4ctorEP10MethodInfo = 0x20521d0 - 0x05708000; _ZN3Dpr8EvScript15EvDataManager_o9JumpLabelEPN6System6StringEPNS0_18EventEndDelegate_oEP10MethodInfo = 0x02c423c0 - 0x05708000; _ZN3Dpr8EvScript15EvDataManager_o12UpdateEvdataEfbP10MethodInfo = 0x02c42ea0 - 0x05708000; +_ZN3Dpr8EvScript15EvDataManager_o8RunEvCmdEiP10MethodInfo = 0x02c5b290 - 0x05708000; +_ZN3Dpr8EvScript15EvDataManager_o16GetPokemonFormNoEPN3Pml8PokePara14PokemonParam_oEP10MethodInfo = 0x02c67ff0 - 0x05708000; +_ZN3Dpr8EvScript15EvDataManager_o15GetPokemonParamEiiP10MethodInfo = 0x02c67f20 - 0x05708000; Handler_Karagenki_WazaPowMethodInfo = 0x04c7a3b0 - 0x05708000; Method_handler_TetunoKobusi = 0x4c79da0 - 0x05708000; _ZN3Dpr6Battle5Logic44EventFactor_EventHandlerTable_Array_TypeInfoE = 0x4c5b148 - 0x05708000; @@ -320,6 +326,7 @@ _ZN3Dpr6Battle5Logic6Common22DetachSkipCheckHandlerEPPNS1_30EventFactor_EventHan DAT_7104cbc6f7 = 0x04cbc6f7 - 0x05708000; _ZN3Dpr5Field18SwayGrass_InfoTypeE = 0x4c5ac58 - 0x05708000; _Z12handler_HazePPN3Dpr6Battle5Logic30EventFactor_EventHandlerArgs_oEhP10MethodInfo = 0x17fc490 - 0x05708000; +_ZN11WeatherWork13set_WeatherIDEiP10MethodInfo = 0x17d18a0 - 0x05708000; _ZN3Dpr6Battle5Logic37Section_FieldEffect_Add_Description_o4ctorEP10MethodInfo = 0x21b8240 - 0x05708000; _ZN3Dpr6Battle5Logic44Section_FieldEffect_Add_Description_TypeInfoE = 0x4c5b2f8 - 0x05708000; @@ -329,8 +336,11 @@ _ZN3Dpr6Battle5Logic6Common14AddFieldEffectEPPNS1_30EventFactor_EventHandlerArgs _ZN3Dpr6Battle5Logic6Common16CheckFieldEffectEPPNS1_30EventFactor_EventHandlerArgs_oEPiP10MethodInfo = 0x1d0a260 - 0x05708000; _ZN3Dpr6Battle5Logic6Common17RemoveFieldEffectEPPNS1_30EventFactor_EventHandlerArgs_oEPPNS1_50Section_FromEvent_FieldEffect_Remove_Description_oEP10MethodInfo = 0x1d0b7c0 - 0x05708000; -_ZN10PlayerWork15get_Enc_SV_DataEv = 0x02cf2840 - 0x05708000; +_ZN10PlayerWork15get_Enc_SV_DataEPN6DPData13ENC_SV_DATA_oEP10MethodInfo = 0x02cf2840 - 0x05708000; _ZN10PlayerWork15set_Enc_SV_DataEN6DPData13ENC_SV_DATA_oE = 0x02cf27d0 - 0x05708000; +_ZN3Pml8PokePara9CoreParam9GetFormNoEP10MethodInfo = 0x02ce2b50 - 0x05708000; + +_ZN3Dpr3Box14BoxPokemonWork12ClearPokemonEiiP10MethodInfo = 0x01d30e80 - 0x05708000; StringLiteral_9194 = 0x4ca7d88 - 0x05708000; StringLiteral_9195 = 0x4ca7d90 - 0x05708000; @@ -343,3 +353,178 @@ _Z14FUN_710025de78j = 0x25de78 - 0x05708000; _Z14FUN_71002543b0lj = 0x2543b0 - 0x05708000; _Z14FUN_7100266700Pv = 0x266700 - 0x05708000; _Z20thunk_FUN_71002926e0Pvm = 0x2926e0 - 0x05708000; + +EntityManager_TypeInfo = 0x04c59d10 - 0x05708000; +GimmickWork_TypeInfo = 0x04c5ee48 - 0x05708000; +AreaID_Array_TypeInfo = 0x04c64060 - 0x05708000; + +_ZN3Dpr17FieldObjectMove_o6UpdateEfP10MethodInfo = 0x01a77b00 - 0x05708000; +_ZN3Dpr22FieldObjectRotateYaw_o6UpdateEfP10MethodInfo = 0x01a783e0 - 0x05708000; +_ZN26FieldNagisaGymGearEntity_o10IsRotatingEP10MethodInfo = 0x01d52b20 - 0x05708000; +_ZN26FieldNagisaGymGearEntity_o16GetDegRotateTypeEiP10MethodInfo = 0x01d52990 - 0x05708000; +_ZN26FieldNagisaGymGearEntity_o6RotateEiiP10MethodInfo = 0x01d529c0 - 0x05708000; +_ZN13GimmickWork_o13GetGearRotateEiP10MethodInfo = 0x02cd72d0 - 0x05708000; +_ZN13GimmickWork_o13SetGearRotateEiiP10MethodInfo = 0x02cd7470 - 0x05708000; +_ZN3Dpr17FieldObjectMove_o10get_IsBusyEP10MethodInfo = 0x01a778d0 - 0x05708000; +_ZN3Dpr22FieldObjectRotateYaw_o10get_IsBusyEP10MethodInfo = 0x01a781c0 - 0x05708000; +_ZN17AnimationPlayer_o4PlayEiffP10MethodInfo = 0x0211e9b0 - 0x05708000; +_ZN10SmartPoint14AssetAssistant52PTR_SingletonMonoBehaviour_AudioManager_get_InstanceE = 0x04b76380 - 0x05708000; +_ZN5Audio14AudioManager_o6PlaySeEjPvP10MethodInfo = 0x021eb8d0 - 0x05708000; +_ZN19FieldPlayerEntity_o8PlayWalkEP10MethodInfo = 0x01dad950 - 0x05708000; +_ZN3Dpr17FieldObjectMove_o15SetObjectEntityEP19FieldObjectEntity_oP10MethodInfo = 0x01a779e0 - 0x05708000; +_ZN3Dpr17FieldObjectMove_o9MoveSpeedE21UnityEngine_Vector3_ofP10MethodInfo = 0x01a77f40 - 0x05708000; +_ZN3Dpr22FieldObjectRotateYaw_o15SetObjectEntityEP19FieldObjectEntity_oP10MethodInfo = 0x01a782d0 - 0x05708000; +_ZN3Dpr22FieldObjectRotateYaw_o8MoveTimeEffP10MethodInfo = 0x01a785e0 - 0x05708000; +_ZN6Effect16EffectInstance_o4StopEfbP10MethodInfo = 0x01efe7b0 - 0x05708000; +_ZN10SmartPoint14AssetAssistant9Sequencer4StopEPN11UnityEngine11Coroutine_oEP10MethodInfo = 0x02bc29b0 - 0x05708000; + +_ZN8EvData_o9GetStringEiP10MethodInfo = 0x01f115b0 - 0x05708000; +_ZN11UnityEngine12GameObject_o4FindEPN6System6StringEP10MethodInfo = 0x026b1ea0 - 0x05708000; +_ZN11UnityEngine12GameObject_o12GetComponentEP10MethodInfo = 0x01f48980 - 0x05708000; +_ZN11UnityEngine39PTR_GameObject_BoxCollider_GetComponentE = 0x04be4160 - 0x05708000; +_ZN11UnityEngine10Collider_o11set_enabledEbP10MethodInfo = 0x02c1c600 - 0x05708000; +_ZN3Pml8Personal14PersonalSystem17GetTokuseiPatternEP10MethodInfo = 0x024a15d0 - 0x05708000; +_ZN3Pml8PokePara9CoreParam15GetTokuseiIndexEP10MethodInfo = 0x02045ce0 - 0x05708000; +_ZN3Pml8PokePara9CoreParam15SetTokuseiIndexEhP10MethodInfo = 0x02048ac0 - 0x05708000; +_ZN3Dpr12EncountTools18SetupBattleTrainerEP37Dpr_Battle_Logic_BATTLE_SETUP_PARAM_oiiiiiiiP10MethodInfo = 0x02c3b800 - 0x05708000; + +_ZN3Dpr6Battle5Logic47Section_FromEvent_SwapItem_Description_TypeInfoE = 0x04c5b1f0 - 0x05708000; +_ZN3Dpr6Battle5Logic40Section_FromEvent_SwapItem_Description_o4ctorEP10MethodInfo = 0x01fb8800 - 0x05708000; +_ZN3Dpr6Battle5Logic57Section_FromEvent_SetWazaEffectIndex_Description_TypeInfoE = 0x04c5b350 - 0x05708000; +_ZN3Dpr6Battle5Logic50Section_FromEvent_SetWazaEffectIndex_Description_o4ctorEP10MethodInfo = 0x01fb7f40 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common19Dorobou_CheckEnableEPPNS1_30EventFactor_EventHandlerArgs_oEhP10MethodInfo = 0x01d0e720 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common18CheckCantStealPokeEPPNS1_30EventFactor_EventHandlerArgs_oEhhP10MethodInfo = 0x01d0da30 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common8SwapItemEPPNS1_30EventFactor_EventHandlerArgs_oEPPNS1_40Section_FromEvent_SwapItem_Description_oEP10MethodInfo = 0x01d0bdb0 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common18SetWazaEffectIndexEPPNS1_30EventFactor_EventHandlerArgs_oEPPNS1_50Section_FromEvent_SetWazaEffectIndex_Description_oEP10MethodInfo = 0x01d0cb40 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common13GetCompetitorEPPNS1_30EventFactor_EventHandlerArgs_oEP10MethodInfo = 0x01d0a1f0 - 0x05708000; +_ZN3Dpr6Battle5Logic46Section_FromEvent_SetItem_Description_TypeInfoE = 0x04c5b1f8 - 0x05708000; +_ZN3Dpr6Battle5Logic39Section_FromEvent_SetItem_Description_o4ctorEP10MethodInfo = 0x01fb7ab0 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common7SetItemEPPNS1_30EventFactor_EventHandlerArgs_oEPPNS1_39Section_FromEvent_SetItem_Description_oEP10MethodInfo = 0x01d0bd20 - 0x05708000; +_ZN8ItemWork9IsAddItemEiiP10MethodInfo = 0x01aea500 - 0x05708000; +_ZN8ItemWork7AddItemEiiP10MethodInfo = 0x01aea3a0 - 0x05708000; +_ZN3Dpr6Battle5Logic13EventSystem_o17EVENTVAR_GetValueEtP10MethodInfo = 0x018f60a0 - 0x05708000; +_ZN3Dpr6Battle5Logic9POKECON_o17GetPokeParamConstEhP10MethodInfo = 0x02037250 - 0x05708000; + +_ZN19FieldObjectEntity_o16get_gridPositionEP10MethodInfo = 0x01d50aa0 - 0x05708000; +_ZN11GameManager12GetAttributeE24UnityEngine_Vector2Int_oPiS1_bP10MethodInfo = 0x02cd3b60 - 0x05708000; +_ZN11GameManager17GetAttributeTableEiP10MethodInfo = 0x02cd3ed0 - 0x05708000; +_ZN11AttributeID12MATR_IsWaterEiP10MethodInfo = 0x021267d0 - 0x05708000; +_ZN3Dpr5Field14FieldEncount_o12SetSpaStructEPN3Pml8PokePara14PokemonParam_oEPN11XLSXContent17FieldEncountTable12Sheettable_oEPNS0_12FieldEncount13ENC_FLD_SPA_oEP10MethodInfo = 0x019b3eb0 - 0x05708000; +_ZN15EncountDataWork23EncDataSave_CanUseSprayEP10MethodInfo = 0x01f08ac0 - 0x05708000; +_ZN3Pml8PokePara9CoreParam8IsHpZeroEP10MethodInfo = 0x02043bd0 - 0x05708000; +_ZN3Pml8PokePara9CoreParam8GetLevelEP10MethodInfo = 0x02043e30 - 0x05708000; +_ZN3Dpr5Field14FieldEncount_o15MapEncountCheckEjibP10MethodInfo = 0x019b4100 - 0x05708000; +_ZN3Dpr5Field11SwayGrass_o24SwayGrass_CheckSpEncountEPNS0_12FieldEncount15SWAY_ENC_INFO_oEP21UnityEngine_Vector3_ofP10MethodInfo = 0x019b43d0 - 0x05708000; +_ZN3Dpr5Field22EncountResult_TypeInfoE = 0x04c5f200 - 0x05708000; +_ZN3Dpr5Field15EncountResult_o4ctorEP10MethodInfo = 0x019b2c70 - 0x05708000; +MonsLv_Array_TypeInfo = 0x04c5f208 - 0x05708000; +_ZN15EncountDataWork15GetMovePokeDataEiPN6DPData14MV_POKE_DATA_oEP10MethodInfo = 0x01f08e10 - 0x05708000; +_ZN3Dpr5Field14FieldEncount_o15EncountParamSetEiiiNS0_12FieldEncount13ENC_FLD_SPA_oEPN3Pml8PokePara14PokemonParam_oEPPNS0_15EncountResult_oEP10MethodInfo = 0x019b47f0 - 0x05708000; +_ZN3Dpr5Field14FieldEncount_o8LastProcEPPNS0_15EncountResult_oEPNS0_12FieldEncount13ENC_FLD_SPA_oEP10MethodInfo = 0x019b4990 - 0x05708000; +_ZN11GameManager11get_mapInfoEP10MethodInfo = 0x02cca5f0 - 0x05708000; +_ZN11XLSXContent9MapInfo_o8get_ItemEiP10MethodInfo = 0x017d5790 - 0x05708000; +_ZN3Dpr5Field14FieldEncount_o14SetEncountDataEPN3Pml8PokePara14PokemonParam_oEiNS0_12FieldEncount13ENC_FLD_SPA_oEPN6System5ArrayI8MonsLv_oEEiiPPNS0_15EncountResult_oEP10MethodInfo = 0x019b6e30 - 0x05708000; +_ZN3Dpr5Field11SwayGrass_o6StopSEEP10MethodInfo = 0x019b4fa0 - 0x05708000; +_ZN9ZukanWork14GetZenkokuFlagEP10MethodInfo = 0x017db490 - 0x05708000; +_ZN15EncountDataWork15IsTairyouHasseiEP10MethodInfo = 0x01f09d60 - 0x05708000; +_ZN8ZoneWork20TairyouHassei_ZoneIDEP10MethodInfo = 0x017da6f0 - 0x05708000; +_ZN8ZoneWork14IsHillBackZoneEiP10MethodInfo = 0x017da610 - 0x05708000; +_ZN15EncountDataWork15GetUrayamaIndexEiP10MethodInfo = 0x01f09de0 - 0x05708000; +_ZN11GameManager16GetUrayamaMonsNoEiP10MethodInfo = 0x02cd1590 - 0x05708000; +_ZN3Dpr5Field14FieldEncount_o13WildEncSingleEPN3Pml8PokePara14PokemonParam_oEPPNS0_15EncountResult_oEPN11XLSXContent17FieldEncountTable12Sheettable_oEPN6System5ArrayI8MonsLv_oEENS0_12FieldEncount13ENC_FLD_SPA_oENSI_15SWAY_ENC_INFO_oEP10MethodInfo = 0x019b4c00 - 0x05708000; +_ZN3Dpr5Field14FieldEncount_o16CheckMovePokeEncEP10MethodInfo = 0x019b4500 - 0x05708000; +_ZN8ZoneWork15SafariZonePosIDEiP10MethodInfo = 0x017da660 - 0x05708000; +_ZN11GameManager15GetSafariMonsNoEiP10MethodInfo = 0x02cd1480 - 0x05708000; +_ZN15RandomGroupWork11RandomValueEiP10MethodInfo = 0x01998cb0 - 0x05708000; +_ZN8ZoneWork15IsSpFishingZoneEiP10MethodInfo = 0x017da600 - 0x05708000; +_ZN3Dpr5Field9SpFishing10CheckPointEP24UnityEngine_Vector2Int_oP10MethodInfo = 0x019b55c0 - 0x05708000; +_ZN10PlayerWork20set_WalkEncountCountEiP10MethodInfo = 0x02cf2c00 - 0x05708000; +_ZN8ItemWork10IsUseSprayEPtP10MethodInfo = 0x01aeb720 - 0x05708000; + +_ZN11XLSXContent17LocalKoukanData_o8get_ItemEiP10MethodInfo = 0x017d5670 - 0x05708000; +_ZN8GameData20DataManager_TypeInfoE = 0x04c59d70 - 0x05708000; +_ZN10PlayerWork13get_msgLangIDEP10MethodInfo = 0x02ce2c20 - 0x05708000; +_ZN3Pml8PokePara20InitialSpec_TypeInfoE = 0x04c5e700 - 0x05708000; +_ZN3Pml8PokePara21PokemonParam_TypeInfoE = 0x04c59c10 - 0x05708000; +_ZN3Pml8PokePara14PokemonParam_o4ctorEPNS0_13InitialSpec_oEP10MethodInfo = 0x02055140 - 0x05708000; +_ZN10SmartPoint14AssetAssistant54PTR_SingletonMonoBehaviour_MessageManager_get_InstanceE = 0x04b7ac50 - 0x05708000; +_ZN3Dpr7Message16MessageManager_o14GetNameMessageEPN6System6StringES4_P10MethodInfo = 0x0210ce50 - 0x05708000; +_ZN3Pml8PokePara9CoreParam13SetParentNameEPN6System6StringEP10MethodInfo = 0x0204ac00 - 0x05708000; +_ZN3Pml8PokePara9CoreParam9SetLangIdEjP10MethodInfo = 0x02049650 - 0x05708000; +_ZN3Pml8PokePara9CoreParam10SetGetBallEjP10MethodInfo = 0x0204b840 - 0x05708000; +_ZN3Pml8PokePara9CoreParam12SetConditionEihP10MethodInfo = 0x0204b040 - 0x05708000; +_ZN3Pml8PokePara9CoreParam7SetWazaEhiP10MethodInfo = 0x020464e0 - 0x05708000; +_ZN10PlayerWork16get_playerStatusEP10MethodInfo = 0x02ce2d20 - 0x05708000; +_ZN3Pml8PokePara18OwnerInfo_TypeInfoE = 0x04c5fbe8 - 0x05708000; +_ZN3Pml8PokePara11OwnerInfo_o4ctorEPN6DPData10MYSTATUS_oEP10MethodInfo = 0x02054ea0 - 0x05708000; +_ZN3Pml8PokePara9CoreParam15UpdateOwnerInfoEPNS0_11OwnerInfo_oEP10MethodInfo = 0x02048c90 - 0x05708000; +_ZN8poketool9poke_memo20poketool_poke_memo_o14ClearPlaceTimeEPN3Pml8PokePara9CoreParamEiP10MethodInfo = 0x02bacca0 - 0x05708000; +_ZN8poketool9poke_memo20poketool_poke_memo_o12SetPlaceTimeEPN3Pml8PokePara9CoreParamEjiP10MethodInfo = 0x02baccc0 - 0x05708000; +_ZN8poketool9poke_memo20poketool_poke_memo_o11SetGetLevelEPN3Pml8PokePara9CoreParamEP10MethodInfo = 0x02bace70 - 0x05708000; +_ZN8poketool9poke_memo20poketool_poke_memo_o10SetVersionEPN3Pml8PokePara9CoreParamEP10MethodInfo = 0x02baceb0 - 0x05708000; +_ZN3Pml8PokePara9CoreParam13StartFastModeEP10MethodInfo = 0x0204c910 - 0x05708000; +_ZN3Pml8PokePara9CoreParam11EndFastModeEbP10MethodInfo = 0x0204c960 - 0x05708000; +_ZN3Pml8PokePara9CoreParam17ChangeTalentPowerEijP10MethodInfo = 0x020446e0 - 0x05708000; + +_ZN11UnityEngine6Random5RangeEiiP10MethodInfo = 0x026941e0 - 0x05708000; +_ZN8GameData20DataManager_TypeInfoE = 0x04c59d70 - 0x05708000; + +_ZN3Pml8PokePara9CoreParam12GetTokuseiNoEP10MethodInfo = 0x020488a0 - 0x05708000; + +ADD_GensiNoTikara = 0x01819480 - 0x05708000; +_ZN3Pml8PokePara9CoreParam16CheckWazaMachineEjP10MethodInfo = 0x02046b40 - 0x05708000; +_ZN3Dpr6Battle5Logic8ItemData16GetWazaMashineNoEtP10MethodInfo = 0x0249d4e0 - 0x05708000; + +_ZN9ZukanWork7SetPokeEPN3Pml8PokePara14PokemonParam_oEiP10MethodInfo = 0x017dc560 - 0x05708000; + +_ZN3Dpr6Battle5Logic12MainModule_o11IsSkyBattleEP10MethodInfo = 0x202c950 - 0x05708000; +_ZN3Dpr6Battle5Logic13FieldStatus_o11CheckEffectEiP10MethodInfo = 0x18f54b0 - 0x05708000; +_ZN3Dpr6Battle5Logic13FieldStatus_o9CheckFuinEPPNS1_12MainModule_oEPNS1_9POKECON_oEPNS1_15BTL_POKEPARAM_oEiP10MethodInfo = 0x18fb0e0 - 0x05708000; +_ZN3Dpr6Battle5Logic15BTL_POKEPARAM_o11GetSickContEiP10MethodInfo = 0x1fddf80 - 0x05708000; +_ZN3Dpr6Battle5Logic15BTL_POKEPARAM_o12GetSickParamEiP10MethodInfo = 0x1fddf00 - 0x05708000; +_ZN3Dpr6Battle5Logic15BTL_POKEPARAM_o12PERMFLAG_GetEiP10MethodInfo = 0x1fdfec0 - 0x05708000; +_ZN3Dpr6Battle5Logic15BTL_POKEPARAM_o13WAZA_IsUsableEiP10MethodInfo = 0x1fdf800 - 0x05708000; +_ZN3Dpr6Battle5Logic15BTL_POKEPARAM_o16GetItemEffectiveEPPNS1_13FieldStatus_oEP10MethodInfo = 0x1fdfd70 - 0x05708000; +_ZN3Dpr6Battle5Logic15BTL_POKEPARAM_o7IsGModeEP10MethodInfo = 0x1fdb9a0 - 0x05708000; +_ZN3Dpr6Battle5Logic5GWaza7IsGWazaEiP10MethodInfo = 0x1900cf0 - 0x05708000; +_ZN3Dpr6Battle5Logic6Tables14IsKodawariItemEtP10MethodInfo = 0x1f790d0 - 0x05708000; +_ZN3Dpr6Battle5Logic8SICKCONT8GetParamEPNS1_14BTL_SICKCONT_oEP10MethodInfo = 0x20d4de0 - 0x05708000; +_ZN3Dpr6Battle5Logic8WAZADATA7IsValidEiP10MethodInfo = 0x1f72c00 - 0x05708000; +_ZN3Pml4Item8ItemData6IsNutsEtP10MethodInfo = 0x249dc50 - 0x05708000; + +_ZN3Dpr6Battle5Logic15BTL_POKEPARAM_o9CheckSickEiP10MethodInfo = 0x1fd8b30 - 0x05708000; +_ZN3Dpr6Battle5Logic15BTL_POKEPARAM_o5GetIDEP10MethodInfo = 0x1fd8a50 - 0x05708000; +_ZN3Dpr6Battle5Logic15BTL_POKEPARAM_o8GetValueEiP10MethodInfo = 0x1fdd010 - 0x05708000; +_ZN3Dpr6Battle5Logic8WAZADATA8IsDamageEiP10MethodInfo = 0x1f72c80 - 0x05708000; +_ZN3Dpr6Battle5Logic8WAZADATA7GetFlagEiiP10MethodInfo = 0x1f72bf0 - 0x05708000; + +_ZN3Dpr6Battle5Logic41Section_FromEvent_RankReset_Description_o4ctorEP10MethodInfo = 0x1fb7090 - 0x05708000; +_ZN3Dpr6Battle5Logic48Section_FromEvent_RankReset_Description_TypeInfoE = 0x4c5b360 - 0x05708000; +_ZN3Dpr6Battle5Logic36Section_SideEffect_Add_Description_o4ctorEP10MethodInfo = 0x21cb080 - 0x05708000; +_ZN3Dpr6Battle5Logic43Section_SideEffect_Add_Description_TypeInfoE = 0x4c5b3c8 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common13AddSideEffectEPPNS1_30EventFactor_EventHandlerArgs_oEPPNS1_36Section_SideEffect_Add_Description_oEP10MethodInfo = 0x1d0b4b0 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common9RankResetEPPNS1_30EventFactor_EventHandlerArgs_oEPPNS1_41Section_FromEvent_RankReset_Description_oEP10MethodInfo = 0x1d0ad80 - 0x05708000; +_ZN3Dpr6Battle5Logic11ExPokePos_o4ctorEihP10MethodInfo = 0x18f6730 - 0x05708000; +_ZN3Dpr6Battle5Logic18ExPokePos_TypeInfoE = 0x4c5a8e8 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common17ExpandExistPokeIDEPPNS1_30EventFactor_EventHandlerArgs_oEPPNS1_11ExPokePos_oEP17System_Byte_arrayP10MethodInfo = 0x1d0f510 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common20GetExistFrontPokePosEPPNS1_30EventFactor_EventHandlerArgs_oEhP10MethodInfo = 0x1d0f1e0 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common12PokeIDtoSideEPPNS1_30EventFactor_EventHandlerArgs_oEPhP10MethodInfo = 0x1d09f50 - 0x05708000; +_ZN3Dpr6Battle5Logic7Handler6Waza_o25common_CureFriendPokeSickEPPNS1_30EventFactor_EventHandlerArgs_oEhbbP10MethodInfo = 0x180d360 - 0x05708000; +_ZN3Dpr6Battle5Logic8SICKCONT8MakeTurnEhhP10MethodInfo = 0x20d4680 - 0x05708000; +_ZN3Dpr6Battle5Logic30Section_CureSick_Description_o4ctorEP10MethodInfo = 0x21b48b0 - 0x05708000; +_ZN3Dpr6Battle5Logic37Section_CureSick_Description_TypeInfoE = 0x4c5b1a8 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common8CureSickEPPNS1_30EventFactor_EventHandlerArgs_oEPPNS1_30Section_CureSick_Description_oEP10MethodInfo = 0x1d0a960 - 0x05708000; + +_ZN3Dpr6Battle5Logic15BTL_POKEPARAM_o9GetMonsNoEP10MethodInfo = 0x1fdcfb0 - 0x05708000; + +_ZN3Dpr6Battle5Logic7Handler4Waza20handler_Jisin_damageEPPNS1_30EventFactor_EventHandlerArgs_oEhP10MethodInfo = 0x1806520 - 0x05708000; +_ZN3Dpr6Battle5Logic7Handler4Waza23handler_Jisin_checkHideEPPNS1_30EventFactor_EventHandlerArgs_oEhP10MethodInfo = 0x1806610 - 0x05708000; +_ZN3Dpr6Battle5Logic4Calc7GetRandEjP10MethodInfo = 0x1f74990 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common14SearchByPokeIDEPPNS1_30EventFactor_EventHandlerArgs_oEhbbP10MethodInfo = 0x1d0a1c0 - 0x05708000; +_ZN3Dpr6Battle5Logic10PokeAction9GetWazaIDEPNS1_12PokeAction_oEP10MethodInfo = 0x2042560 - 0x05708000; +_ZN3Dpr6Battle5Logic21PokeActionContainer_o20IsAllActDoneByPokeIDEhP10MethodInfo = 0x2042860 - 0x05708000; +_ZN3Dpr6Battle5Logic4Calc10IsOccurPerEjP10MethodInfo = 0x1f75e20 - 0x05708000; +_ZN3Dpr6Battle5Logic4Calc23MakeDefaultPokeSickContEjhbP10MethodInfo = 0x1f74d20 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common14IsFriendPokeIDEPPNS1_30EventFactor_EventHandlerArgs_oEhhP10MethodInfo = 0x1d0a040 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common16TokuseiWindow_InEPPNS1_30EventFactor_EventHandlerArgs_oEhP10MethodInfo = 0x1d0a4a0 - 0x05708000; +_ZN3Dpr6Battle5Logic6Common17TokuseiWindow_OutEPPNS1_30EventFactor_EventHandlerArgs_oEhP10MethodInfo = 0x1d0a550 - 0x05708000; \ No newline at end of file diff --git a/patches/ability_restoration.slpatch b/patches/ability_restoration.slpatch index 75ea62659..bd880ea40 100644 --- a/patches/ability_restoration.slpatch +++ b/patches/ability_restoration.slpatch @@ -1,3 +1,6 @@ [target=main, version=bd_130] 1964f24: - bl Tokusei_system_array_new \ No newline at end of file + bl Tokusei_system_array_new + +1942fd0: + cmp x0, #0x2 \ No newline at end of file diff --git a/patches/badge_check.slpatch b/patches/badge_check.slpatch index 3cb4b0056..3cad11308 100644 --- a/patches/badge_check.slpatch +++ b/patches/badge_check.slpatch @@ -1,7 +1,7 @@ [target=main, version=bd_130] // 01d68a10: -01d603e0: - b BadgeWork_IsGet +//01d603e0: +// b BadgeWork_IsGet // 025684c0: // b Dpr_Battle_Logic_Section_WazaExec_CheckFail_1st_checkSabotageType diff --git a/patches/battle_escape.slpatch b/patches/battle_escape.slpatch new file mode 100644 index 000000000..4241257b7 --- /dev/null +++ b/patches/battle_escape.slpatch @@ -0,0 +1,8 @@ +[target=main, version=bd_130] +// Rewrite Dpr.Battle.Logic.MainModule$$IsEscapeEnableBattle +02034b70: + b MainModule_IsEscapeEnableBattle + +// Rewrite Dpr.Battle.Logic.MainModule$$GetEscapeMode +02034bb0: + b MainModule_GetEscapeMode diff --git a/patches/custom_script.slpatch b/patches/custom_script.slpatch new file mode 100644 index 000000000..62a185ab0 --- /dev/null +++ b/patches/custom_script.slpatch @@ -0,0 +1,11 @@ +[target=main, version=bd_130] +// Replace call to Dpr.EvScript.EvDataManager$$RunEvCmd in Dpr.EvScript.EvDataManager$$UpdateEvdata +// Dpr.EvScript.EvDataManager$$RunEvCmd is called within +02c43018: + bl RunEvCmdExtended + + +// Rewrite GimmickWork$$.cctor +// Adds Eterna gym to area id list for gears +//02cd76b0: +// b GimmickWork_cctor diff --git a/patches/custom_script.slpatch.disabled b/patches/custom_script.slpatch.disabled deleted file mode 100644 index 1771f7df2..000000000 --- a/patches/custom_script.slpatch.disabled +++ /dev/null @@ -1,10 +0,0 @@ -[target=main, version=bd_130] -// Doesn't matter -// 01b39f70: -// b Dpr_EvScript_EvDataManager_EvCmdInitElecGym - -// 01b593f0: -// b Dpr_EvScript_EvDataManager_EvCmd_AUTO_TANKEN_SET_WAIT - -01b23c20: - b Dpr.EvScript.EvDataManager$$EvCmdTrainerFlagCheck diff --git a/patches/drnd.slpatch b/patches/drnd.slpatch index 4a6e263cd..67334ad1f 100644 --- a/patches/drnd.slpatch +++ b/patches/drnd.slpatch @@ -29,6 +29,12 @@ 17db6a0: b ZukanWork_GetSinouCount +17dd0b0: + b ZukanWork_CheckShinouZukanCompSee + +17dd260: + b ZukanWork_CheckZenkokuZukanCompGet + // 1bb1364: mov x3, x21 @@ -150,4 +156,4 @@ // Pml.PokePara.Accessor$$GetNickName 024A6B38: - mov w0, #0x3F3 \ No newline at end of file + mov w0, #0x3F3 diff --git a/patches/dualslot_incense.slpatch b/patches/dualslot_incense.slpatch index 59f77e60b..c0b11e34f 100644 --- a/patches/dualslot_incense.slpatch +++ b/patches/dualslot_incense.slpatch @@ -14,24 +14,3 @@ 19b3bd4: ldr x0, [sp, #0xB0] bl PlayerWork_set_DoubleSlot - -019b31fc: - bl Incense_GameManager_GetFieldEncountData -019b32d0: - bl Incense_GameManager_GetFieldEncountData -019b8338: - bl Incense_GameManager_GetFieldEncountData -019b51dc: - bl Incense_GameManager_GetFieldEncountData -019b521c: - bl Incense_GameManager_GetFieldEncountData -019b5b34: - bl Incense_GameManager_GetFieldEncountData -019b5d1c: - bl Incense_GameManager_GetFieldEncountData -019b8824: - bl Incense_GameManager_GetFieldEncountData -018cc5d4: - bl Incense_GameManager_GetFieldEncountData -017da7dc: - bl Incense_GameManager_GetFieldEncountData diff --git a/patches/encounter_slots.slpatch b/patches/encounter_slots.slpatch new file mode 100644 index 000000000..4e573703e --- /dev/null +++ b/patches/encounter_slots.slpatch @@ -0,0 +1,25 @@ +[target=main, version=bd_130] +// Rewrite Dpr.Field.FieldEncount$$FieldEncount_Check +// This method is used for most wild encounters. +019b30b0: + b FieldEncount_Check_EncounterSlots + +// Rewrite Dpr.Field.FieldEncount$$GetSafariScopeMonster +// This method is used for safari binoculars. +019b82c0: + b GetSafariScopeMonster_EncounterSlots + +// Rewrite Dpr.Field.FieldEncount$$SetFishingEncount +// This method is used for fishing encounters. +019b5130: + b SetFishingEncount_EncounterSlots + +// Rewrite Dpr.Field.FieldEncount$$SetSweetEncount +// This method is used for sweet scent encounters. +019b5950: + b SetSweetEncount_EncounterSlots + + +// Dummy out radar slot overwriting in Dpr.Field.FieldEncount$$WildEncSingle +019b4c80: + b #0x88 diff --git a/patches/item_changes.slpatch b/patches/item_changes.slpatch new file mode 100644 index 000000000..506144742 --- /dev/null +++ b/patches/item_changes.slpatch @@ -0,0 +1,4 @@ +[target=main, version=bd_130] +// Rewrite Dpr.UI.UIBag.<>c__DisplayClass135_0$$b__1 +01be1580: + b AbilityPatchUsability diff --git a/patches/leek.slpatch b/patches/leek.slpatch new file mode 100644 index 000000000..db7bf22a0 --- /dev/null +++ b/patches/leek.slpatch @@ -0,0 +1,4 @@ +[target=main, version=bd_130] + +01911260: + b Dpr_Battle_Logic_Handler_Item_handler_Leek diff --git a/patches/local_koukan.slpatch.disabled b/patches/local_koukan.slpatch.disabled deleted file mode 100644 index 11b82c8c9..000000000 --- a/patches/local_koukan.slpatch.disabled +++ /dev/null @@ -1,6 +0,0 @@ -[target=main, version=bd_130] -01f6db20: - bl LocalKoukan_GetTargetData - -01f6db48: - bl LocalKoukan_CreateTradePokeParam diff --git a/patches/local_trades_extension.slpatch b/patches/local_trades_extension.slpatch new file mode 100644 index 000000000..f093d445c --- /dev/null +++ b/patches/local_trades_extension.slpatch @@ -0,0 +1,16 @@ +[target=main, version=bd_130] +// Rewrite LocalKoukan$$GetIndex +01af3390: + b LocalKoukan_GetIndex + +// Rewrite LocalKoukan$$GetTargetData +01af32a0: + b LocalKoukan_GetTargetData + +// Overwrite call to Dpr.Message.MessageHelper$$ConvertMsgId in LocalKoukan$$CreateTradePokeParam +//01af368c: +// bl LocalKoukan_Language + +// Rewrite LocalKoukan$$CreateTradePokeParam +01af3510: + b LocalKoukan_CreateTradePokeParam diff --git a/patches/move_restoration.slpatch b/patches/move_restoration.slpatch index 2335261db..7cd6f76b3 100644 --- a/patches/move_restoration.slpatch +++ b/patches/move_restoration.slpatch @@ -22,7 +22,12 @@ // b handler_Kaminari_excuseHitCalc // 18060b0: // b handler_Kaminari_hitRatio -221f004: - bl BTL_STRID_STD_system_array_new +//221f004: +// bl BTL_STRID_STD_system_array_new // 18048c0: // b ADD_Karagenki + + +// BTL_CLIENT$$is_unselectable_waza +1f54b40: + b Dpr_Battle_Logic_BTL_CLIENT_is_unselectable_waza \ No newline at end of file diff --git a/patches/pickup.slpatch b/patches/pickup.slpatch new file mode 100644 index 000000000..297136544 --- /dev/null +++ b/patches/pickup.slpatch @@ -0,0 +1,9 @@ +[target=main, version=bd_130] + +// Rewrite Dpr.EncountTools$$GetMonohiroiItem +02c3d790: + b GetPickupItem + +// DEBUG: 100% for Pickup to proc after Battle +//02c3d1f0: +// cmp x0, #0x64 diff --git a/patches/repel_fix.slpatch b/patches/repel_fix.slpatch index 565e2f66c..feb0ef2f2 100644 --- a/patches/repel_fix.slpatch +++ b/patches/repel_fix.slpatch @@ -1,4 +1,14 @@ [target=main, version=bd_130] // void Dpr.EvScript.EvDataManager$$EndSpray(Dpr_EvScript_EvDataManager_o *__this,MethodInfo *method ) -2c550b8: - bl JumpLabel \ No newline at end of file +//2c550b8: +// bl JumpLabel + +// EncountDataWork$$EncDataSave_CanUseSpray +01f08ac0: + b EncDataSave_CanUseSpray + +// Overwrite calls to ItemWork$$IsUseSpray +017a2984: + bl IsUseSpray +01bde854: + bl IsUseSpray diff --git a/patches/shiny.slpatch b/patches/shiny.slpatch index 9991d32ae..f27d3386d 100644 --- a/patches/shiny.slpatch +++ b/patches/shiny.slpatch @@ -1,53 +1,4 @@ [target=main, version=bd_130] -// x21 = spec -// x19 = pFixSpec -// != 0xffffffffffffffff -2053938: - mov x0, x19 - bl Pml_Local_Random_GetValue_Hook - -2053914: - mov x0, x20 - mov x1, x19 - bl Pml_Local_RandomGenerator_GetRand_Hook - -// 0xffffffffffffffff -2053924: - mov x0, x19 - bl Pml_Local_Random_GetValue_Hook - -20538f0: - mov x0, x20 - mov x1, x19 - bl Pml_Local_RandomGenerator_GetRand_Hook - -// 0x1ffffffff -2053aac: - mov x0, x19 - bl Pml_Local_Random_GetValue_Hook - -2053a50: - mov x0, x20 - mov x1, x19 - bl Pml_Local_RandomGenerator_GetRand_Hook - -// 0x2ffffffff -2053ad8: - mov x0, x19 - bl Pml_Local_Random_GetValue_Hook - -2053a80: - mov x0, x20 - mov x1, x19 - bl Pml_Local_RandomGenerator_GetRand_Hook - -// 0x3ffffffff -02053a04: - mov x0, x19 - bl Pml_Local_Random_GetValue_Hook - -02053998: - mov x0, x20 - mov x1, x19 - bl Pml_Local_RandomGenerator_GetRand_Hook +020521d0: + b Shiny_InitialSpec_ctor diff --git a/patches/shiny_eggs.slpatch b/patches/shiny_eggs.slpatch new file mode 100644 index 000000000..46e69d303 --- /dev/null +++ b/patches/shiny_eggs.slpatch @@ -0,0 +1,17 @@ +[target=main, version=bd_130] + +02cccf00: + b DataManager_GetUniqueID1 + +//02ccd050: +// b DataManager_GetUniqueID2 + +02ccd170: + b DataManager_GetUniqueID3 + + +01cc503c: + bl Allow_Release_Egg + +01cc5888: + bl Allow_Release_Egg diff --git a/patches/static_held_items.slpatch b/patches/static_held_items.slpatch new file mode 100644 index 000000000..29e8bfcc0 --- /dev/null +++ b/patches/static_held_items.slpatch @@ -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 diff --git a/patches/thief_patch.slpatch b/patches/thief_patch.slpatch new file mode 100644 index 000000000..22140cb72 --- /dev/null +++ b/patches/thief_patch.slpatch @@ -0,0 +1,8 @@ +[target=main, version=bd_130] +// Rewrite Dpr.Battle.Logic.Handler.Waza$$handler_Dorobou +01807cb0: + b HandlerDorobou + +// Rewrite Dpr.Battle.Logic.Common$$Dorobou_CheckEnable +01d0e720: + b Dorobou_CheckEnable diff --git a/patches/trainer_double_battle.slpatch b/patches/trainer_double_battle.slpatch index 5c7d4227c..1b23b114b 100644 --- a/patches/trainer_double_battle.slpatch +++ b/patches/trainer_double_battle.slpatch @@ -1,3 +1,4 @@ [target=main, version=bd_130] -2c3b9e4: - bl BTL_SETUP_Trainer + +2c5015c: + bl Dpr_EncountTools_SetupBattleTrainer diff --git a/patches/validity_checks.slpatch b/patches/validity_checks.slpatch new file mode 100644 index 000000000..a36fe2ed1 --- /dev/null +++ b/patches/validity_checks.slpatch @@ -0,0 +1,21 @@ +[target=main, version=bd_130] + +// Pml.PokePara.Accessor$$GetDprIllegalFlag +// Always return false (legal) +024a8520: + b GetDprIllegalFlag + +// PokeDupeChecker$$IsDuplicatedPokemonParam +// Always return false (legal) +01997390: + b IsDuplicatedPokemonParam + +// Pml.PokePara.Accessor$$SetDprIllegalFlag +// Do nothing (Don't set the illegal flag) +024a84a0: + b SetDprIllegalFlag + +// Pml.PokePara.CoreDataHeader$$set_fuseiTamagoFlag +// Do nothing (Don't set the Bad Egg flag) +//02043460: +// b set_fuseiTamagoFlag diff --git a/src/CoreParam.cpp b/src/CoreParam.cpp index 39f5d8703..458175402 100644 --- a/src/CoreParam.cpp +++ b/src/CoreParam.cpp @@ -130,32 +130,24 @@ HashSet_WazaNo__o * CoreParam::CollectRemindableWaza( MethodInfo *method ) socket_log_fmt("CollectRemindableWaza\n"); socket_log_fmt("&Pml::PokePara::Accessor::GetWazaNo: %08X\n", &Pml::PokePara::Accessor::GetWazaNo); - int32_t monsNo = this->GetMonsNo((MethodInfo *) nullptr); - uint16_t formNo = this->GetFormNo((MethodInfo *) nullptr); - socket_log_fmt("monsNo: %04X\n", monsNo); - socket_log_fmt("formNo: %02X\n", formNo); HashSet_WazaNo__o * hashSet = this->_CollectRemindableWaza((MethodInfo *) nullptr); - socket_log_fmt("hashSet: %08X\n", hashSet); PmlUse_o * pmlUse = PmlUse_o::get_Instance((MethodInfo *) nullptr); - socket_log_fmt("pmlUse: %08X\n", pmlUse); ItemTable_o * itemTable = pmlUse->fields.itemPrmTotal; - socket_log_fmt("itemTable: %08X\n", itemTable); System::Array * wazaMachine = itemTable->fields.WazaMachine; - socket_log_fmt("wazaMachine: %08X\n", wazaMachine); - socket_log_fmt("this->fields.m_accessor: %08X\n", this->fields.m_accessor); SheetWazaMachine_o * iWazaMachine; for (size_t i = 0; i < wazaMachine->max_length; i++) { iWazaMachine = wazaMachine->m_Items[i]; - if (!ItemData::HaveItem(iWazaMachine->fields.itemNo, (MethodInfo *) nullptr)) + if (!ItemData::HaveItem(iWazaMachine->fields.itemNo, nullptr)) { continue; } - PersonalSystem::LoadPersonalData(monsNo, formNo, (MethodInfo *) nullptr); - if (!PersonalSystem::CheckPersonalWazaMachine(iWazaMachine->fields.machineNo, (MethodInfo *) nullptr)) + uint32_t machineNo = ItemData::GetWazaMashineNo(iWazaMachine->fields.itemNo, nullptr); + bool canLearnTm = this->CheckWazaMachine(machineNo, nullptr); + if (!canLearnTm) { continue; } @@ -190,4 +182,4 @@ HashSet_WazaNo__o * CoreParam::CollectRemindableWaza( MethodInfo *method ) HashSet_WazaNo__o * CoreParam_CollectRemindableWaza(CoreParam * __this, MethodInfo *method ) { return __this->CollectRemindableWaza(method); -} \ No newline at end of file +} diff --git a/src/patches/ability_restoration.cpp b/src/patches/ability_restoration.cpp index 76074d17b..00ff93678 100644 --- a/src/patches/ability_restoration.cpp +++ b/src/patches/ability_restoration.cpp @@ -3,6 +3,7 @@ #include "Dpr/Battle/Logic/EventFactor.hpp" #include "Dpr/Battle/Logic/EventID.hpp" #include "Dpr/Battle/Logic/EventVar.hpp" +#include "Dpr/Battle/Logic/ExPokePos.hpp" #include "Dpr/Battle/Logic/BtlSideEffect.hpp" #include "Dpr/Battle/Logic/SICKCONT.hpp" #include "Dpr/Battle/Logic/BTL_SICKCONT.hpp" @@ -45,8 +46,13 @@ using namespace Dpr::Battle::Logic::Handler; // 4c79da0 extern MethodInfo * Method_handler_TetunoKobusi; -const uint32_t NUM_NEW_ABILITIES = 1; -const uint32_t BLADEMASTER_ID = 268; +extern void * System_Byte_array_typeInfo; + +const uint32_t NUM_NEW_ABILITIES = 2; + +constexpr uint32_t QUICK_DRAW = 259; +constexpr uint32_t CURIOUS_MEDICINE = 261; + // Rad Red static System::Array * sBlademasterEventHandlerTable = nullptr; // Luminescent @@ -61,6 +67,21 @@ static System::Array * sTrickySurgeEventHandl static System::Array * sWonderSurgeEventHandlerTable = nullptr; static System::Array * sMagicSurgeEventHandlerTable = nullptr; +// SwSh DLC +static System::Array * sQuickDrawEventHandlerTable = nullptr; +static System::Array * sCuriousMedicineEventHandlerTable = nullptr; + + +void HandlerMessage(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, bool displayAbility) { + system_load_typeinfo((void *)0x58d8); + Section_FromEvent_Message::Description_o *desc = (Section_FromEvent_Message::Description_o *) + il2cpp_object_new(Section_FromEvent_Message::Description_TypeInfo); + desc->ctor(nullptr); + desc->fields.pokeID = pokeID; + desc->fields.isDisplayTokuseiWindow = displayAbility; + Common::Message(args, &desc, nullptr); +} + const uint32_t NUM_BLADEMASTER_MOVES = 12; const int32_t BLADEMASTER_MOVES[NUM_BLADEMASTER_MOVES] = { @@ -412,14 +433,99 @@ void handler_WonderSurge(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, handle_EffectSurge(args, pokeID, EffectType::EFF_WONDERROOM, method); } +void HandlerQuickDrawCheckSpPriority(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) { + if (Common::GetEventVar(args, EventVar::SP_PRIORITY, nullptr) != 1) + return; + + if (Common::GetEventVar(args, EventVar::POKEID, nullptr) != pokeID) + return; + + PokeAction_o *pokeAction = Common::SearchByPokeID(args, pokeID, true, true, nullptr); + if (pokeAction == nullptr) + return; + + if (!WAZADATA::IsDamage(PokeAction::GetWazaID(pokeAction, nullptr), nullptr)) + return; + + if ((*args)->fields.pPokeActionContainer->IsAllActDoneByPokeID(pokeID, nullptr)) + return; + + if (Common::GetWorkValue(args, 0, nullptr) == 0) { + Common::SetWorkValue(args, 0, 1, nullptr); + Common::SetWorkValue(args, 1, Calc::IsOccurPer(30, nullptr), nullptr); + } + + if (Common::GetWorkValue(args, 1, nullptr) == 0) + return; + + bool success = Common::RewriteEventVar(args, EventVar::SP_PRIORITY, 2, nullptr); + if (!success) + return; + + if (Common::GetWorkValue(args, 2, nullptr) != 0) + return; + + Common::SetWorkValue(args, 2, 1, nullptr); + HandlerMessage(args, pokeID, true); +} + +void HandlerQuickDrawTurncheckDone(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) { + if (Common::GetEventVar(args, EventVar::POKEID, nullptr) != pokeID) + return; + + Common::SetWorkValue(args, 0, 0, nullptr); + Common::SetWorkValue(args, 1, 0, nullptr); + Common::SetWorkValue(args, 2, 0, nullptr); +} + + +void HandlerCuriousMedicineMemberInEvo(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) { + socket_log_fmt("HandlerCuriousMedicineMemberInEvo\n"); + system_load_typeinfo((void *)0x89a6); + system_load_typeinfo((void *)0xa9b3); + + if (Common::GetEventVar(args, EventVar::POKEID, nullptr) != pokeID) + return; + + auto exPos = (ExPokePos_o *)il2cpp_object_new(ExPokePos_TypeInfo); + exPos->ctor(ExPosType::AREA_FRIENDS, Common::GetExistFrontPokePos(args, pokeID, nullptr), nullptr); + auto dstPokeID = (System_Byte_array *)system_array_new(System_Byte_array_typeInfo, 5); + uint8_t pokeIDCount = Common::ExpandExistPokeID(args, &exPos, dstPokeID, nullptr); + if (pokeIDCount == 0) + return; + + Common::TokuseiWindow_In(args, pokeID, nullptr); + + auto desc = (Section_FromEvent_RankReset_Description_o *) il2cpp_object_new(Section_FromEvent_RankReset_Description_TypeInfo); + desc->ctor(nullptr); + desc->fields.pokeCount = pokeIDCount; + for (uint64_t i=0; ifields.pokeID->m_Items[i] = dstPokeID->m_Items[i]; + } + desc->fields.pokeCount = pokeIDCount; + Common::RankReset(args, &desc, nullptr); + + for (uint64_t i=0; ictor(nullptr); + descMsg->fields.pokeID = dstPokeID->m_Items[i]; + descMsg->fields.message->Setup(2, 268, nullptr); + descMsg->fields.message->AddArg(dstPokeID->m_Items[i], nullptr); + Common::Message(args, &descMsg, nullptr); + } + + Common::TokuseiWindow_Out(args, pokeID, nullptr); +} + + System::Array * ADD_Blademaster(MethodInfo *method) { socket_log_fmt("ADD_Blademaster\n"); if (sBlademasterEventHandlerTable == nullptr) { socket_log_fmt("ADD_Blademaster init\n"); - sBlademasterEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 2); - sBlademasterEventHandlerTable->m_Items[0] = createEventHandlerTable(EventID::WAZA_POWER, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_Blademaster_WazaPow); - sBlademasterEventHandlerTable->m_Items[1] = createEventHandlerTable(EventID::CRITICAL_CHECK, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_Blademaster_CritCheck); + sBlademasterEventHandlerTable = (System::Array *) CreateEventHandlerTable(2); + sBlademasterEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::WAZA_POWER, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_Blademaster_WazaPow); + sBlademasterEventHandlerTable->m_Items[1] = CreateEventHandler(EventID::CRITICAL_CHECK, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_Blademaster_CritCheck); } return sBlademasterEventHandlerTable; @@ -431,8 +537,8 @@ System::Array * ADD_ToxicDebris(MethodInfo *m socket_log_fmt("ADD_ToxicDebris\n"); if (sToxicDebrisEventHandlerTable == nullptr) { socket_log_fmt("ADD_ToxicDebris init\n"); - sToxicDebrisEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 1); - sToxicDebrisEventHandlerTable->m_Items[0] = createEventHandlerTable(EventID::WAZA_DMG_REACTION, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_ToxicDebris); + sToxicDebrisEventHandlerTable = (System::Array *) CreateEventHandlerTable(1); + sToxicDebrisEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::WAZA_DMG_REACTION, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_ToxicDebris); } return sToxicDebrisEventHandlerTable; @@ -443,10 +549,10 @@ System::Array * ADD_PurifyingSalt(MethodInfo socket_log_fmt("ADD_PurifyingSalt\n"); if (sPurifyingSaltEventHandlerTable == nullptr) { socket_log_fmt("ADD_PurifyingSalt init\n"); - sPurifyingSaltEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 3); - sPurifyingSaltEventHandlerTable->m_Items[0] = createEventHandlerTable(EventID::WAZA_DMG_REACTION, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_PurifyingSalt_AttackerPower); - sPurifyingSaltEventHandlerTable->m_Items[1] = createEventHandlerTable(EventID::ADDSICK_CHECKFAIL, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_PurifyingSalt_AddSick_Checkfail); - sPurifyingSaltEventHandlerTable->m_Items[2] = createEventHandlerTable(EventID::CHECK_INEMURI, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_PurifyingSalt_InemuriCheck); + sPurifyingSaltEventHandlerTable = (System::Array *) CreateEventHandlerTable(3); + sPurifyingSaltEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::WAZA_DMG_REACTION, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_PurifyingSalt_AttackerPower); + sPurifyingSaltEventHandlerTable->m_Items[1] = CreateEventHandler(EventID::ADDSICK_CHECKFAIL, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_PurifyingSalt_AddSick_Checkfail); + sPurifyingSaltEventHandlerTable->m_Items[2] = CreateEventHandler(EventID::CHECK_INEMURI, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_PurifyingSalt_InemuriCheck); } return sPurifyingSaltEventHandlerTable; @@ -457,8 +563,8 @@ System::Array * ADD_VikavoltPriority(MethodIn socket_log_fmt("ADD_VikavoltPriority\n"); if (sVikavoltPriorityEventHandlerTable == nullptr) { socket_log_fmt("ADD_VikavoltPriority init\n"); - sVikavoltPriorityEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 1); - sVikavoltPriorityEventHandlerTable->m_Items[0] = createEventHandlerTable(EventID::GET_WAZA_PRI, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_VikavoltPriority_GetPriority); + sVikavoltPriorityEventHandlerTable = (System::Array *) CreateEventHandlerTable(1); + sVikavoltPriorityEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::GET_WAZA_PRI, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_VikavoltPriority_GetPriority); } return sVikavoltPriorityEventHandlerTable; @@ -469,8 +575,8 @@ System::Array * ADD_ZeroToHero(MethodInfo *me socket_log_fmt("ADD_ZeroToHero\n"); if (sZeroToHeroEventHandlerTable == nullptr) { socket_log_fmt("ADD_ZeroToHero init\n"); - sZeroToHeroEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 1); - sZeroToHeroEventHandlerTable->m_Items[0] = createEventHandlerTable(EventID::MEMBER_OUT_FIXED, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_ZeroToHero_MemberOutFixed); + sZeroToHeroEventHandlerTable = (System::Array *) CreateEventHandlerTable(1); + sZeroToHeroEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::MEMBER_OUT_FIXED, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_ZeroToHero_MemberOutFixed); } return sZeroToHeroEventHandlerTable; @@ -481,8 +587,8 @@ System::Array * ADD_ZeroToHero(MethodInfo *me // socket_log_fmt("ADD_Opportunist\n"); // if (sOpportunistEventHandlerTable == nullptr) { // socket_log_fmt("ADD_Opportunist init\n"); -// sOpportunistEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 1); -// sOpportunistEventHandlerTable->m_Items[0] = createEventHandlerTable(EventID::RANKEFF_FIXED, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handlerOpportunist_Rankeff_Fixed); +// sOpportunistEventHandlerTable = (System::Array *) CreateEventHandlerTable(1); +// sOpportunistEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::RANKEFF_FIXED, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handlerOpportunist_Rankeff_Fixed); // } // return sOpportunistEventHandlerTable; @@ -494,11 +600,11 @@ System::Array * ADD_MyceliumMight(MethodInfo socket_log_fmt("ADD_MyceliumMight\n"); if (sMyceliumMightEventHandlerTable == nullptr) { socket_log_fmt("ADD_MyceliumMight init\n"); - sMyceliumMightEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 4); - sMyceliumMightEventHandlerTable->m_Items[0] = createEventHandlerTable(EventID::GET_WAZA_PRI, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MyceliumMight_GetPriority); - sMyceliumMightEventHandlerTable->m_Items[1] = createEventHandlerTable(EventID::WAZASEQ_START, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MyceliumMight_Start); - sMyceliumMightEventHandlerTable->m_Items[2] = createEventHandlerTable(EventID::WAZASEQ_END, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MyceliumMight_End); - sMyceliumMightEventHandlerTable->m_Items[3] = createEventHandlerTable(EventID::TOKUSEI_DISABLE, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MyceliumMight_End); + sMyceliumMightEventHandlerTable = (System::Array *) CreateEventHandlerTable(4); + sMyceliumMightEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::GET_WAZA_PRI, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MyceliumMight_GetPriority); + sMyceliumMightEventHandlerTable->m_Items[1] = CreateEventHandler(EventID::WAZASEQ_START, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MyceliumMight_Start); + sMyceliumMightEventHandlerTable->m_Items[2] = CreateEventHandler(EventID::WAZASEQ_END, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MyceliumMight_End); + sMyceliumMightEventHandlerTable->m_Items[3] = CreateEventHandler(EventID::TOKUSEI_DISABLE, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MyceliumMight_End); } return sMyceliumMightEventHandlerTable; @@ -507,9 +613,9 @@ System::Array * ADD_MyceliumMight(MethodInfo System::Array * ADD_TrickySurge(MethodInfo * method) { if (sTrickySurgeEventHandlerTable == nullptr) { - sTrickySurgeEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 2); - sTrickySurgeEventHandlerTable->m_Items[0] = createEventHandlerTable(EventID::MEMBER_IN, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_TrickySurge); - sTrickySurgeEventHandlerTable->m_Items[1] = createEventHandlerTable(EventID::CHANGE_TOKUSEI_AFTER, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_TrickySurge); + sTrickySurgeEventHandlerTable = (System::Array *) CreateEventHandlerTable(2); + sTrickySurgeEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::MEMBER_IN, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_TrickySurge); + sTrickySurgeEventHandlerTable->m_Items[1] = CreateEventHandler(EventID::CHANGE_TOKUSEI_AFTER, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_TrickySurge); } return sTrickySurgeEventHandlerTable; @@ -519,9 +625,9 @@ System::Array * ADD_TrickySurge(MethodInfo * System::Array * ADD_WonderSurge(MethodInfo * method) { if (sWonderSurgeEventHandlerTable == nullptr) { - sWonderSurgeEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 2); - sWonderSurgeEventHandlerTable->m_Items[0] = createEventHandlerTable(EventID::MEMBER_IN, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_WonderSurge); - sWonderSurgeEventHandlerTable->m_Items[1] = createEventHandlerTable(EventID::CHANGE_TOKUSEI_AFTER, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_WonderSurge); + sWonderSurgeEventHandlerTable = (System::Array *) CreateEventHandlerTable(2); + sWonderSurgeEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::MEMBER_IN, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_WonderSurge); + sWonderSurgeEventHandlerTable->m_Items[1] = CreateEventHandler(EventID::CHANGE_TOKUSEI_AFTER, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_WonderSurge); } return sWonderSurgeEventHandlerTable; @@ -531,24 +637,41 @@ System::Array * ADD_WonderSurge(MethodInfo * System::Array * ADD_MagicSurge(MethodInfo * method) { if (sMagicSurgeEventHandlerTable == nullptr) { - sMagicSurgeEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 2); - sMagicSurgeEventHandlerTable->m_Items[0] = createEventHandlerTable(EventID::MEMBER_IN, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MagicSurge); - sMagicSurgeEventHandlerTable->m_Items[1] = createEventHandlerTable(EventID::CHANGE_TOKUSEI_AFTER, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MagicSurge); + sMagicSurgeEventHandlerTable = (System::Array *) CreateEventHandlerTable(2); + sMagicSurgeEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::MEMBER_IN, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MagicSurge); + sMagicSurgeEventHandlerTable->m_Items[1] = CreateEventHandler(EventID::CHANGE_TOKUSEI_AFTER, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &handler_MagicSurge); } return sMagicSurgeEventHandlerTable; } +System::Array * ADD_QuickDraw(MethodInfo *method) +{ + if (sQuickDrawEventHandlerTable == nullptr) { + sQuickDrawEventHandlerTable = (System::Array *) CreateEventHandlerTable(2); + sQuickDrawEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::CHECK_SP_PRIORITY, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &HandlerQuickDrawCheckSpPriority); + sQuickDrawEventHandlerTable->m_Items[1] = CreateEventHandler(EventID::TURNCHECK_DONE, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &HandlerQuickDrawTurncheckDone); + } + return sQuickDrawEventHandlerTable; +} + +System::Array * ADD_CuriousMedicine(MethodInfo *method) +{ + if (sCuriousMedicineEventHandlerTable == nullptr) { + sCuriousMedicineEventHandlerTable = (System::Array *) CreateEventHandlerTable(1); + sCuriousMedicineEventHandlerTable->m_Items[0] = CreateEventHandler(EventID::MEMBER_IN, Method_handler_TetunoKobusi, (Il2CppMethodPointer) &HandlerCuriousMedicineMemberInEvo); + } + return sCuriousMedicineEventHandlerTable; +} + void AddHandler(System::Array * getFuncTable, uint32_t * idx, int32_t tokusei, Il2CppMethodPointer methodPointer) { - socket_log_fmt("Method_ADD_Karagenki: %08X\n", Method_ADD_Karagenki); - socket_log_fmt("Method_ADD_TetunoKobusi: %08X\n", Method_ADD_TetunoKobusi); MethodInfo * method = copyMethodInfo(Method_ADD_TetunoKobusi, methodPointer); Tokusei_GET_FUNC_TABLE_ELEM_o * elem = &getFuncTable->m_Items[*idx]; socket_log_fmt("Got GET_FUNC_TABLE_ELEM at %i\n", *idx); Tokusei_HandlerGetFunc_o * func = (Tokusei_HandlerGetFunc_o *) il2cpp_object_new(Tokusei_HandlerGetFunc_TypeInfo); socket_log_fmt("entry.method: %08X\n", methodPointer); - func->ctor((intptr_t) methodPointer, method); + func->ctor(0, method); elem->fields.tokusei = tokusei; elem->fields.func = func; *idx += 1; @@ -564,7 +687,9 @@ void * Tokusei_system_array_new(void * typeInfo, uint32_t len) // AddHandler(getFuncTable, &idx, BLADEMASTER_ID, (Il2CppMethodPointer) &ADD_Blademaster); // AddHandler(getFuncTable, &idx, BLADEMASTER_ID, (Il2CppMethodPointer) &ADD_ToxicDebris); // AddHandler(getFuncTable, &idx, BLADEMASTER_ID, (Il2CppMethodPointer) &ADD_PurifyingSalt); - AddHandler(getFuncTable, &idx, BLADEMASTER_ID, (Il2CppMethodPointer) &ADD_ZeroToHero); + // AddHandler(getFuncTable, &idx, BLADEMASTER_ID, (Il2CppMethodPointer) &ADD_ZeroToHero); + AddHandler(getFuncTable, &idx, QUICK_DRAW, (Il2CppMethodPointer) &ADD_QuickDraw); + AddHandler(getFuncTable, &idx, CURIOUS_MEDICINE, (Il2CppMethodPointer) &ADD_CuriousMedicine); return getFuncTable; } diff --git a/src/patches/battle_escape.cpp b/src/patches/battle_escape.cpp new file mode 100644 index 000000000..c335fb3f5 --- /dev/null +++ b/src/patches/battle_escape.cpp @@ -0,0 +1,71 @@ +#include "il2cpp.hpp" + +#include "Dpr/Battle/Logic/MainModule.hpp" +#include "PlayerWork.hpp" + +#include "util.hpp" +#include "logger.hpp" + +const int32_t CANT_ESCAPE_FLAG = 2591; + +const int32_t BTL_ESCAPE_MODE_WILD = 0; +const int32_t BTL_ESCAPE_MODE_NG = 1; +const int32_t BTL_ESCAPE_MODE_CONFIRM = 2; + +bool MainModule_IsEscapeEnableBattle(Dpr::Battle::Logic::MainModule_o *__this, MethodInfo *method) +{ + // Disallow escaping if can't escape flag is on + if (PlayerWork::GetBool(CANT_ESCAPE_FLAG, nullptr)) + { + return false; + } + + if (__this->fields.m_rule != 2) + { + uint competitor = __this->fields.m_setupParam->fields.competitor; + switch (competitor) + { + case 0: + return true; + case 1: + return false; + case 2: + return true; + case 3: + return true; + default: + return false; + } + } + + return false; +} + +int32_t MainModule_GetEscapeMode(Dpr::Battle::Logic::MainModule_o *__this, MethodInfo *method) +{ + // Disallow escaping if can't escape flag is on + if (PlayerWork::GetBool(CANT_ESCAPE_FLAG, nullptr)) + { + return BTL_ESCAPE_MODE_NG; + } + + if (__this->fields.m_rule != 2) + { + uint competitor = __this->fields.m_setupParam->fields.competitor; + switch (competitor) + { + case 0: + return BTL_ESCAPE_MODE_WILD; + case 1: + return BTL_ESCAPE_MODE_NG; + case 2: + return BTL_ESCAPE_MODE_CONFIRM; + case 3: + return BTL_ESCAPE_MODE_CONFIRM; + default: + return BTL_ESCAPE_MODE_NG; + } + } + + return BTL_ESCAPE_MODE_NG; +} diff --git a/src/patches/custom_script.cpp b/src/patches/custom_script.cpp index 367271786..50ffe18a5 100644 --- a/src/patches/custom_script.cpp +++ b/src/patches/custom_script.cpp @@ -1,16 +1,577 @@ +#include + #include "il2cpp.hpp" + +#include "Audio/AudioManager.hpp" +#include "Dpr/Box/BoxPokemonWork.hpp" +#include "Dpr/EvScript/EvDataManager.hpp" +#include "EvData/EvCmdID.hpp" +#include "EvData/ArgType.hpp" +#include "GameData/DataManager.hpp" +#include "Pml/PokeParty.hpp" +#include "Pml/PokePara/CoreParam.h" +#include "SmartPoint/AssetAssistant/SingletonMonoBehavior.hpp" +#include "SmartPoint/AssetAssistant/Sequencer.hpp" +#include "UnityEngine/BoxCollider.hpp" +#include "UnityEngine/GameObject.hpp" + +#include "AnimationPlayer.hpp" +#include "areaID.hpp" +#include "EntityManager.hpp" +#include "FieldNagisaGymGearEntity.hpp" +#include "FieldPlayerEntity.hpp" +#include "GimmickWork.hpp" #include "PlayerWork.hpp" +#include "WeatherWork.hpp" +#include "ZukanWork.hpp" + +#include "util.hpp" +#include "logger.hpp" + +// EXTERNAL + +extern void * AreaID_Array_TypeInfo; + + +// UTILITY METHODS + +// Converts the IEEE-754 formatted int32 into its proper float value. +float ConvertToFloat(int32_t value) +{ + float fresult; + std::memcpy(&fresult, &value, sizeof(value)); + return fresult; +} + +// Returns either the value at the given work variable or the direct int value depending on the given argument's type. +// Returns 0 for any other argument type. +int32_t GetWorkOrIntValue(EvData::Aregment_o arg) +{ + int32_t argType = arg.fields.argType; + int32_t data = arg.fields.data; + int32_t result = 0; + + switch (argType) + { + case EvData::ArgType::Work: + result = PlayerWork::GetInt(data, nullptr); + break; + case EvData::ArgType::Float: + result = (int32_t)ConvertToFloat(data); + break; + default: + break; + } + + return result; +} + +// Returns either the value at the given work variable or the direct float value depending on the given argument's type. +// Returns 0 for any other argument type. +float GetWorkOrFloatValue(EvData::Aregment_o arg) +{ + int32_t argType = arg.fields.argType; + int32_t data = arg.fields.data; + float result = 0; + + switch (argType) + { + case EvData::ArgType::Work: + result = PlayerWork::GetInt(data, nullptr); + break; + case EvData::ArgType::Float: + result = ConvertToFloat(data); + break; + default: + break; + } + + return result; +} + +// If the given argument is a work variable, set it to the given value. +// Does nothing otherwise. +void SetWorkToValue(EvData::Aregment_o arg, int32_t value) +{ + int32_t argType = arg.fields.argType; + int32_t data = arg.fields.data; + + if (argType == EvData::ArgType::Work) + { + socket_log_fmt("Setting work %d to value %d\n", data, value); + PlayerWork::SetInt(data, value, nullptr); + } +} + +// Checks if the given PokemonParam is null or an egg. +bool IsNullOrEgg(Pml::PokePara::PokemonParam_o * param) +{ + Pml::PokePara::CoreParam * coreParam = (Pml::PokePara::CoreParam *)param; + return coreParam == nullptr || coreParam->IsNull(nullptr) || coreParam->IsEgg(2, nullptr); +} + +// Virtual call to GetAnimationPlayer. +typedef AnimationPlayer_o * (*GetAnimationPlayerPointer)(FieldPlayerEntity_o*, const MethodInfo*); +AnimationPlayer_o * GetAnimationPlayerVirtual(FieldPlayerEntity_o * activePlayer) +{ + GetAnimationPlayerPointer methodPtr = (GetAnimationPlayerPointer)(activePlayer->klass->vtable)._5_GetAnimationPlayer.methodPtr; + return (AnimationPlayer_o *) (*methodPtr)(activePlayer,(activePlayer->klass->vtable)._5_GetAnimationPlayer.method); +} + + +// EXTRA OVERRIDEN METHODS + +// Rewrite GimmickWork$$.cctor +// Adds Eterna gym to area id list for gears +/*void GimmickWork_cctor(MethodInfo *method) +{ + system_load_typeinfo((void *)0x502f); + + int32_t GEAR_AREAS_NUM = 4; + int32_t GEAR_AREAS[GEAR_AREAS_NUM] = { + C08GYM0101, C08GYM0102, C08GYM0103, C04GYM0102 + }; + + System::Array* array = system_array_new(AreaID_Array_TypeInfo, GEAR_AREAS_NUM); + GimmickWork_TypeInfo->static_fields->GearAreaIdTable = array; +}*/ + + +// SCRIPT COMMAND METHODS + +// Sets the weather. +// Arguments: +// [Work, Number] weather: The ID of the weather to change to. +bool SetWeather(Dpr::EvScript::EvDataManager_o * manager) +{ + socket_log_fmt("_SET_WEATHER\n"); + System::Array* args = manager->fields._evArg; + + if (args->max_length >= 2) + { + int32_t weather = GetWorkOrIntValue(args->m_Items[1]); + socket_log_fmt("Calling set_WeatherID with weatherId: %d\n", weather); + WeatherWork::set_WeatherID(weather, nullptr); + } + + return true; +} + +// Rotates a gear in the Sunyshore gym. +// Arguments: +// [Label] gear: The gear to rotate. +bool RotateSunyshoreGymGear(Dpr::EvScript::EvDataManager_o * manager) +{ + socket_log_fmt("_ROTATE_ELEC_GYM_GEAR\n"); + system_load_typeinfo((void *)0x44ba); + system_load_typeinfo((void *)0x3f7e); + + FieldPlayerEntity_o * activePlayer = EntityManager_TypeInfo->static_fields->_activeFieldPlayer_k__BackingField; + if (activePlayer == nullptr) + { + return true; + } + + FieldNagisaGymGearEntity_o * gearEntitiy = manager->fields._nagisaGymGearEntity; + if (gearEntitiy == nullptr) + { + return true; + } + + manager->fields._fieldObjectMove->Update(manager->fields._deltatime, nullptr); + manager->fields._fieldObjectRotateYaw->Update(manager->fields._deltatime, nullptr); + + switch (manager->fields._gearSequence) + { + case 0: + { + activePlayer->PlayWalk(nullptr); + manager->fields._fieldObjectMove->SetObjectEntity((FieldObjectEntity_o*)activePlayer, nullptr); + + float x = gearEntitiy->fields.super.super.super.worldPosition.fields.x + + (-gearEntitiy->fields.super.offset.fields.x - gearEntitiy->fields.super.size.fields.x * 0.5); + float y = gearEntitiy->fields.super.super.super.worldPosition.fields.z + + (gearEntitiy->fields.super.offset.fields.y - gearEntitiy->fields.super.size.fields.y * 0.5); + float z = gearEntitiy->fields.super.super.super.worldPosition.fields.z; + + UnityEngine_Vector3_Fields vectorFields = { .x = x, .y = y, .z = z }; + UnityEngine_Vector3_o vector = { .fields = vectorFields }; + manager->fields._fieldObjectMove->MoveSpeed(vector, x, nullptr); + manager->fields._fieldObjectRotateYaw->SetObjectEntity((FieldObjectEntity_o*)activePlayer, nullptr); + double angleRad = atan2((double)x, (double)y); + float angleDegree = (float)angleRad * 57.29578; + manager->fields._fieldObjectRotateYaw->MoveTime(angleDegree, 0.1, nullptr); + + Audio::AudioManager_o * audioManager = (Audio::AudioManager_o *) + SmartPoint::AssetAssistant::SingletonMonoBehaviour::get_Instance + (*SmartPoint::AssetAssistant::PTR_SingletonMonoBehaviour_AudioManager_get_Instance); + audioManager->PlaySe(0x2207d7db, nullptr, nullptr); + + manager->fields._gearSequence += 1; + } + break; + + case 1: + { + if (manager->fields._fieldObjectMove->get_IsBusy(nullptr)) return false; + if (manager->fields._fieldObjectRotateYaw->get_IsBusy(nullptr)) return false; + + AnimationPlayer_o * animationPlayer = GetAnimationPlayerVirtual(activePlayer); + animationPlayer->Play(0, 0.0, 0.0, nullptr); + + system_load_typeinfo((void *)0x3fb9); + + System::Array* gears = EntityManager_TypeInfo->static_fields->_fieldNagisaGymGears_k__BackingField; + for (int i=0; imax_length; i++) + { + gears->m_Items[i]->Rotate(gearEntitiy->fields.GearRotateButton, gearEntitiy->fields.GearGroupNo, nullptr); + } + + Audio::AudioManager_o * audioManager = (Audio::AudioManager_o *) + SmartPoint::AssetAssistant::SingletonMonoBehaviour::get_Instance + (*SmartPoint::AssetAssistant::PTR_SingletonMonoBehaviour_AudioManager_get_Instance); + audioManager->PlaySe(0x2107d669, nullptr, nullptr); + + manager->fields._gearSequence += 1; + } + break; + + case 2: + { + if (gearEntitiy->IsRotating(nullptr)) return false; + + float rotateType = FieldNagisaGymGearEntity_o::GetDegRotateType(gearEntitiy->fields.GearRotateButton, nullptr); + int32_t areaId = manager->fields._areaID; + if (gearEntitiy->fields.GearGroupNo != 0) + { + rotateType = -rotateType; + } + + int32_t gearRotate = GimmickWork_o::GetGearRotate(areaId, nullptr); + gearRotate = (int32_t)(rotateType + (float)gearRotate); + if (gearRotate < 0) gearRotate += 360; + if (gearRotate >= 360) gearRotate -= 360; + GimmickWork_o::SetGearRotate(areaId, gearRotate, nullptr); + + manager->fields._gearSequence = -1; + } + break; + } + + return manager->fields._gearSequence == -1; +} + +// Stops a Field Effect. +// Arguments: +// [Work, Number] index: The index of the field effect to stop. 0-10 +// [Work, Number] isForce: Unknown use. +// [Work, Number] fadeTime: The time in seconds it takes for the effect to fade. +bool StopEffect(Dpr::EvScript::EvDataManager_o * manager) +{ + socket_log_fmt("_STOP_EFFECT\n"); + system_load_typeinfo((void *)0x45a2); -namespace Dpr + System::Array* args = manager->fields._evArg; + + if (args->max_length >= 2) + { + int32_t index = GetWorkOrIntValue(args->m_Items[1]); + + if (args->max_length >= 3) + { + int32_t isForce = GetWorkOrIntValue(args->m_Items[2]); + + float fadeTime = 0; + if (args->max_length >= 4) + { + fadeTime = GetWorkOrFloatValue(args->m_Items[3]); + } + + if (index < manager->fields._scriptEffects->max_length) + { + if (manager->fields._scriptEffects->m_Items[index] != nullptr) + { + socket_log_fmt("Stopping Effect %d with isForce %d in %f seconds\n", index, isForce, fadeTime); + manager->fields._scriptEffects->m_Items[index]->Stop(fadeTime, isForce == 1, nullptr); + } + + if (index < manager->fields._scriptScaleCorutine->max_length) + { + if (manager->fields._scriptScaleCorutine->m_Items[index] != nullptr) + { + SmartPoint::AssetAssistant::Sequencer::Stop(manager->fields._scriptScaleCorutine->m_Items[index], nullptr); + } + } + } + } + } + + return true; +} + +// Returns the form id of the Pokémon at the given index in the party. +// Arguments: +// [Work, Number] index: The index that points to the given Pokémon. +// [Work] result: The work in which to put the result in. -1 if the chosen Pokémon is null or an egg. +bool PartyFormsNo(Dpr::EvScript::EvDataManager_o * manager) { - namespace EvScript + socket_log_fmt("_TEMOTI_FORMNO\n"); + system_load_typeinfo((void *)0x44f9); + + System::Array* args = manager->fields._evArg; + + if (args->max_length >= 2) { - struct EvDataManager_o; + int32_t index = GetWorkOrIntValue(args->m_Items[1]); + + Pml::PokeParty_o * party = PlayerWork::get_playerParty(nullptr); + Pml::PokePara::PokemonParam_o * param = party->GetMemberPointer(index, nullptr); + int32_t result = -1; + + if (!IsNullOrEgg(param)) + { + socket_log_fmt("Calling GetPokemonFormNo with party index: %d\n", index); + result = manager->GetPokemonFormNo(param, nullptr); + } + + if (args->max_length >= 3) + { + SetWorkToValue(args->m_Items[2], result); + } } + + return true; } -// bool Dpr_EvScript_EvDataManager_EvCmdTrainerFlagCheck(Dpr::EvScript::EvDataManager_o *__this,MethodInfo *method) -// { -// *((int32_t *) NULL) = 12345; -// return true; -// } \ No newline at end of file +// Returns the form id of the Pokémon at the given index and tray index. +// Arguments: +// [Work, Number] index: The index that points to the given Pokémon. +// [Work, Number] trayIndex: The tray index in which to look for the given Pokémon. +// [Work] result: The work in which to put the result in. -1 if the chosen Pokémon is null or an egg. +bool PartyBoxFormsNo(Dpr::EvScript::EvDataManager_o * manager) +{ + socket_log_fmt("_TEMOTI_BOX_FORMNO\n"); + System::Array* args = manager->fields._evArg; + + if (args->max_length >= 2) + { + int32_t index = GetWorkOrIntValue(args->m_Items[1]); + + if (args->max_length >= 3) + { + int32_t trayIndex = GetWorkOrIntValue(args->m_Items[2]); + + Pml::PokePara::PokemonParam_o * param = manager->GetPokemonParam(trayIndex, index, nullptr); + int32_t result = -1; + + if (!IsNullOrEgg(param)) + { + socket_log_fmt("Calling GetPokemonFormNo with tray index %d and index %d\n", trayIndex, index); + result = manager->GetPokemonFormNo(param, nullptr); + } + + if (args->max_length >= 4) + { + SetWorkToValue(args->m_Items[3], result); + } + } + } + + return true; +} + +// Returns the nature id of the Pokémon at the given index and tray index. +// Arguments: +// [Work, Number] index: The index that points to the given Pokémon. +// [Work, Number] trayIndex: The tray index in which to look for the given Pokémon. +// [Work] result: The work in which to put the result in. -1 if the chosen Pokémon is null or an egg. +bool PartyBoxNature(Dpr::EvScript::EvDataManager_o * manager) +{ + socket_log_fmt("_GET_BOX_POKE_SEIKAKU\n"); + System::Array* args = manager->fields._evArg; + + if (args->max_length >= 2) + { + int32_t index = GetWorkOrIntValue(args->m_Items[1]); + + if (args->max_length >= 3) + { + int32_t trayIndex = GetWorkOrIntValue(args->m_Items[2]); + + Pml::PokePara::PokemonParam_o * param = manager->GetPokemonParam(trayIndex, index, nullptr); + int32_t result = -1; + + if (!IsNullOrEgg(param)) + { + socket_log_fmt("Calling GetSeikaku with tray index %d and index %d\n", trayIndex, index); + result = ((Pml::PokePara::CoreParam *)param)->GetSeikaku(nullptr); + } + + if (args->max_length >= 4) + { + SetWorkToValue(args->m_Items[3], result); + } + } + } + + return true; +} + +// Releases the Pokémon at the given index and tray index. +// Arguments: +// [Work, Number] index: The index that points to the given Pokémon. +// [Work, Number] trayIndex: The tray index in which to look for the given Pokémon. +bool PartyBoxRelease(Dpr::EvScript::EvDataManager_o * manager) +{ + socket_log_fmt("_RELEASE_BOX_POKE\n"); + System::Array* args = manager->fields._evArg; + + if (args->max_length >= 2) + { + int32_t index = GetWorkOrIntValue(args->m_Items[1]); + + if (args->max_length >= 3) + { + int32_t trayIndex = GetWorkOrIntValue(args->m_Items[2]); + + Pml::PokePara::PokemonParam_o * param = manager->GetPokemonParam(trayIndex, index, nullptr); + + if (!IsNullOrEgg(param)) + { + socket_log_fmt("Calling ClearPokemon with tray index %d and index %d\n", trayIndex, index); + Dpr::Box::BoxPokemonWork::ClearPokemon(trayIndex, index, nullptr); + + } + } + } + + return true; +} + +// Toggles a BoxCollider of the given name on the current map. +// Arguments: +// [Label] label: The name of the BoxCollider to toggle. +bool ToggleCollisionBox(Dpr::EvScript::EvDataManager_o * manager) +{ + socket_log_fmt("_TOGGLE_COLLISION_BOX\n"); + system_load_typeinfo((void *)0x5b6); + System::Array* args = manager->fields._evArg; + Dpr::EvScript::EvScriptData_o * evData = manager->fields._evData; + + if (args->max_length >= 2) + { + if (args->m_Items[1].fields.argType == EvData::ArgType::String) + { + System::String * objectName = evData->fields.EvData->GetString(args->m_Items[1].fields.data, nullptr); + UnityEngine::GameObject_o* object = UnityEngine::GameObject_o::Find(objectName, nullptr); + + if (object != nullptr) + { + UnityEngine::BoxCollider_o * boxCollider = (UnityEngine::BoxCollider_o *)object->GetComponent(*UnityEngine::PTR_GameObject_BoxCollider_GetComponent); + + if (boxCollider != nullptr) + { + UnityEngine::Collider_o * collider = (UnityEngine::Collider_o *)boxCollider; + + if (args->max_length >= 3) + { + int32_t value = GetWorkOrIntValue(args->m_Items[2]); + socket_log_fmt("Setting the collider to: %0d\n", value != 0); + collider->set_enabled(value != 0, nullptr); + } + } + } + } + } + + return true; +} + +// Sets the given work to 69. Acts as a check for a proper installation. +// Arguments: +// [Work] work: The work to set. +bool InstallCheck(Dpr::EvScript::EvDataManager_o * manager) +{ + socket_log_fmt("_INSTALL_CHECK\n"); + System::Array* args = manager->fields._evArg; + + if (args->max_length >= 2) + { + SetWorkToValue(args->m_Items[1], 69); + } + + return true; +} + +// Sets the form of the Pokémon at the given index and tray index. +// Arguments: +// [Work, Number] index: The index that points to the given Pokémon. +// [Work, Number] trayIndex: The tray index in which to look for the given Pokémon. +// [Work, Number] formno: The form to set the Pokémon to. +bool ChangeFormNo(Dpr::EvScript::EvDataManager_o * manager) +{ + socket_log_fmt("_CHANGE_FORMNO\n"); + system_load_typeinfo((void *)0x4495); + System::Array* args = manager->fields._evArg; + + if (args->max_length >= 2) + { + int32_t index = GetWorkOrIntValue(args->m_Items[1]); + + if (args->max_length >= 3) + { + int32_t trayIndex = GetWorkOrIntValue(args->m_Items[2]); + + Pml::PokePara::PokemonParam_o * param = manager->GetPokemonParam(trayIndex, index, nullptr); + Pml::PokePara::CoreParam * coreparam = (Pml::PokePara::CoreParam *)param; + + if (!IsNullOrEgg(param)) + { + if (args->max_length >= 4) + { + int32_t formno = GetWorkOrIntValue(args->m_Items[3]); + socket_log_fmt("Changing form of Pokémon with tray index %d and index %d, to form %d\n", trayIndex, index, formno); + coreparam->ChangeFormNo((uint16_t) formno, nullptr, nullptr); + + ZukanWork::SetPoke(param, 3, nullptr); + } + } + } + } + + return true; +} + +// Handles overriden and new script commands, then calls the original method to handle the rest normally. +bool RunEvCmdExtended(Dpr::EvScript::EvDataManager_o *__this, EvData::EvCmdID index, MethodInfo *method) +{ + // Overriden/New Commands + switch (index) + { + case EvData::EvCmdID::_SET_WEATHER: + return SetWeather(__this); + //case EvData::EvCmdID::_ROTATE_ELEC_GYM_GEAR: + // return RotateSunyshoreGymGear(__this); + case EvData::EvCmdID::_STOP_EFFECT: + return StopEffect(__this); + case EvData::EvCmdID::_TEMOTI_FORMNO: + return PartyFormsNo(__this); + case EvData::EvCmdID::_TEMOTI_BOX_FORMNO: + return PartyBoxFormsNo(__this); + case EvData::EvCmdID::_GET_BOX_POKE_SEIKAKU: + return PartyBoxNature(__this); + case EvData::EvCmdID::_RELEASE_BOX_POKE: + return PartyBoxRelease(__this); + case EvData::EvCmdID::_TOGGLE_COLLISION_BOX: + return ToggleCollisionBox(__this); + case EvData::EvCmdID::_INSTALL_CHECK: + return InstallCheck(__this); + case EvData::EvCmdID::_CHANGE_FORMNO: + return ChangeFormNo(__this); + default: + break; + } + + // Call original method + return __this->RunEvCmd(index, method); +} diff --git a/src/patches/drnd.cpp b/src/patches/drnd.cpp index bbb72a290..9662c1f83 100644 --- a/src/patches/drnd.cpp +++ b/src/patches/drnd.cpp @@ -11,9 +11,9 @@ const int32_t IS_SEE = 2; const int32_t IS_GET = 3; const uint32_t MAX_MONS = 1010; -struct ZukanWork -{ - static System::Array * GetFormFlags(uint32_t monsno,uint8_t sex,bool color,MethodInfo *method); +const uint32_t NATDEX_MONS_COUNT = 17; +uint32_t NATDEX_MONS[NATDEX_MONS_COUNT] = { + 607, 608, 609, 700, 862, 863, 864, 865, 866, 899, 900, 901, 903, 904, 957, 958, 959 }; // External links @@ -167,7 +167,6 @@ bool ZukanWork_IsGet1(uint32_t monsno,MethodInfo *method) bool ZukanWork_IsGet2(uint32_t monsno,uint8_t sex,int32_t form,bool color,MethodInfo *method) { - monsno -= 1; System::Array * formFlags = ZukanWork::GetFormFlags(monsno, sex, color, (MethodInfo *) nullptr); if (formFlags != nullptr) { @@ -196,6 +195,7 @@ bool ZukanWork_IsGet2(uint32_t monsno,uint8_t sex,int32_t form,bool color,Method return false; } + monsno -= 1; return GetZukanFlag(flags, monsno); } @@ -242,7 +242,6 @@ bool ZukanWork_IsUwasa(uint32_t monsno, MethodInfo *method) void ZukanWork_SetPoke(uint32_t monsno, int32_t get, uint8_t sex, int32_t form, bool color, MethodInfo *method) { - monsno -= 1; if (monsno > MAX_MONS) { return; @@ -254,6 +253,7 @@ void ZukanWork_SetPoke(uint32_t monsno, int32_t get, uint8_t sex, int32_t form, formFlags->m_Items[form] = true; } + monsno -= 1; DPData::ZUKAN_WORK_o zukanWork = PlayerWork::get_zukan(nullptr, nullptr); int32_t zukanStatus = GetZukanStatus(&zukanWork, monsno); if (zukanStatus <= get) @@ -409,8 +409,80 @@ int32_t ZukanWork_GetSinouCount(bool isRating, MethodInfo *method) return seeCount; } -// TODO: bool ZukanWork$$CheckShinouZukanCompSee(MethodInfo *method) -// TODO: bool ZukanWork$$CheckZenkokuZukanCompGet(MethodInfo *method) +bool ZukanWork_CheckShinouZukanCompSee(MethodInfo *method) +{ + system_load_typeinfo((void *)0xac6c); + + DPData::ZUKAN_WORK_o zukanWork = PlayerWork::get_zukan(nullptr, nullptr); + if (!zukanWork.fields.zukan_get) + { + return false; + } + + System::Array * ShinouZukanNos = ZukanWork_TypeInfo->static_fields->ShinouZukanNos; + for (il2cpp_array_size_t i = 0; i < ShinouZukanNos->max_length; i++) + { + int32_t monsno = ShinouZukanNos->m_Items[i]; + int32_t index = Array_IndexOf(ZukanWork_TypeInfo->static_fields->ZukanRatingExcludeNos, monsno+1, Array_IndexOf_MethodInfo); + if (index >= 0) + { + continue; + } + + int32_t zukanStatus = GetZukanStatus(&zukanWork, monsno); + if (zukanStatus < IS_SEE) + { + return false; + } + } + + return true; +} + +bool ZukanWork_CheckZenkokuZukanCompGet(MethodInfo *method) +{ + system_load_typeinfo((void *)0xac6d); + + DPData::ZUKAN_WORK_o zukanWork = PlayerWork::get_zukan(nullptr, nullptr); + if (!zukanWork.fields.zukan_get) + { + return false; + } + + for (uint32_t monsno = 0; monsno < 493; monsno++) + { + int32_t index = Array_IndexOf(ZukanWork_TypeInfo->static_fields->ZukanRatingExcludeNos, monsno+1, Array_IndexOf_MethodInfo); + + if (index >= 0) + { + continue; + } + + int32_t zukanStatus = GetZukanStatus(&zukanWork, monsno); + if (zukanStatus != IS_GET) + { + return false; + } + } + + for (uint32_t i=0; istatic_fields->ZukanRatingExcludeNos, monsno, Array_IndexOf_MethodInfo); + if (index >= 0) + { + continue; + } + + int32_t zukanStatus = GetZukanStatus(&zukanWork, monsno-1); + if (zukanStatus != IS_GET) + { + return false; + } + } + + return true; +} struct Dpr_UI_UIText_o { @@ -431,4 +503,4 @@ void DescText_SetupMessage(Dpr_UI_UIText_o * __this, System::String * messageFil } __this->SetupMessage(messageFile, messageIndex, nullptr); -} \ No newline at end of file +} diff --git a/src/patches/dualslot_incense.cpp b/src/patches/dualslot_incense.cpp index db403bde7..1fb8c4a6f 100644 --- a/src/patches/dualslot_incense.cpp +++ b/src/patches/dualslot_incense.cpp @@ -1,5 +1,7 @@ #include "il2cpp.hpp" #include "il2cpp-api.h" + +#include "Audio/AudioManager.hpp" #include "Dpr/Item/ItemInfo.hpp" #include "Dpr/UI/UIBag.hpp" #include "Pml/PokePara/PokemonParam.h" @@ -7,6 +9,7 @@ #include "dual_slot.hpp" #include "ItemWork.hpp" #include "PlayerWork.hpp" +#include "SmartPoint/AssetAssistant/SingletonMonoBehavior.hpp" #include "logger.hpp" #include "util.hpp" #include "XLSXContent/FieldEncountTable.hpp" @@ -331,31 +334,48 @@ bool UseInfiniteRepelItem() void UIManager_UseDSPlayerItem(Dpr::UI::UIManager_o * __this, Dpr::UI::UIBag_Displayclass_o * dispClass) { system_load_typeinfo(DAT_7103a679b8); + + Audio::AudioManager_o * audioManager = (Audio::AudioManager_o *) + SmartPoint::AssetAssistant::SingletonMonoBehaviour::get_Instance + (*SmartPoint::AssetAssistant::PTR_SingletonMonoBehaviour_AudioManager_get_Instance); + // TODO: Fix DS Slots item and maybe update to give some text when you use it socket_log_fmt("UIManager_UseDSPlayerItem\n"); sDisplayClassLocals = dispClass->fields.locals; Dpr::UI::UIBag_o * uiBag = dispClass->fields.locals->fields.__4__this; + // Currently used item Dpr::Item::ItemInfo_o* item = dispClass->fields.locals->fields.item; sUIBag = uiBag; int32_t itemId = item->get_Id(nullptr); + if (itemId == DUAL_SLOT_INCENSE_ITEM_ID) { + // INCENSE BURNER UseDualSlotIncense(__this, dispClass); - } else if (itemId == INFINITE_REPEL_ITEM_ID) + } + else if (itemId == INFINITE_REPEL_ITEM_ID) { + // INFINITE REPEL bool flag = UseInfiniteRepelItem(); System_Action_o * action = (System_Action_o *) il2cpp_object_new(System_Action_TypeInfo); action->ctor(dispClass->fields.locals, ShowItemContextMenu_EndUseAction_MethodInfo, nullptr); System::String * labelName; + if (flag) { - labelName = System::String::CreateString("SS_bag_353"); - } else { - labelName = System::String::CreateString("SS_bag_354"); + labelName = System::String::CreateString("SS_bag_371"); + audioManager->PlaySe(0x8e8a8de1, nullptr, nullptr); + } + else + { + labelName = System::String::CreateString("SS_bag_372"); } uiBag->fields.msgWindowController->OpenMsgWindow(0, labelName, true, false, nullptr, action, nullptr); - } else { + } + else + { + // DS PLAYER __this->UseDSPlayerItem(nullptr); System_Action_o * action = (System_Action_o *) il2cpp_object_new(System_Action_TypeInfo); action->ctor(dispClass->fields.locals, ShowItemContextMenu_EndUseAction_MethodInfo, nullptr); @@ -363,7 +383,9 @@ void UIManager_UseDSPlayerItem(Dpr::UI::UIManager_o * __this, Dpr::UI::UIBag_Dis if (ItemWork::IsDsPlayer(nullptr)) { labelName = System::String::CreateString("SS_bag_353"); - } else { + } + else + { labelName = System::String::CreateString("SS_bag_354"); } uiBag->fields.msgWindowController->OpenMsgWindow(0, labelName, true, false, nullptr, action, nullptr); diff --git a/src/patches/encounter_slots.cpp b/src/patches/encounter_slots.cpp new file mode 100644 index 000000000..8531cc318 --- /dev/null +++ b/src/patches/encounter_slots.cpp @@ -0,0 +1,971 @@ +#include "il2cpp.hpp" +#include "il2cpp-api.h" + +#include "AttributeID.hpp" +#include "DpData.hpp" +#include "Dpr/Field/EncountResult.hpp" +#include "Dpr/Field/FieldEncount.hpp" +#include "Dpr/Field/FieldEncount/ENC_FLD_SPA.hpp" +#include "Dpr/Field/SpFishing.hpp" +#include "Dpr/Field/SwayGrass.hpp" +#include "EncountDataWork.hpp" +#include "EntityManager.hpp" +#include "FieldObjectEntity.hpp" +#include "GameManager.hpp" +#include "PlayerWork.hpp" +#include "Pml/Local/Random.h" +#include "Pml/PokePara/CoreParam.h" +#include "Pml/PokePara/PokemonParam.h" +#include "Pml/PokeParty.hpp" +#include "RandomGroupWork.hpp" +#include "XLSXContent/MapAttributeTable.hpp" +#include "XLSXContent/MapInfo.hpp" +#include "XLSXContent/FieldEncountTable.hpp" +#include "ZoneWork.hpp" +#include "ZukanWork.hpp" + +#include "logger.hpp" +#include "util.hpp" + +// Slots +const int32_t SLOT_SWARM_1 = 0; +const int32_t SLOT_RADAR_1 = 1; +const int32_t SLOT_TIME_OF_DAY_1 = 2; +const int32_t SLOT_TIME_OF_DAY_2 = 3; +const int32_t SLOT_DUALSLOT_1 = 4; +const int32_t SLOT_DUALSLOT_2 = 5; +const int32_t SLOT_SAFARI_1 = 6; +const int32_t SLOT_SAFARI_2 = 7; +const int32_t SLOT_TROPHY_GARDEN_1 = 6; +const int32_t SLOT_TROPHY_GARDEN_2 = 7; + +const int32_t SLOT_DUALSLOT_WATER_1 = 1; + +const int32_t SLOT_RADAR_BUMP_1 = 9; +const int32_t SLOT_DUALSLOT_BUMP_1 = 10; +const int32_t SLOT_DUALSLOT_BUMP_2 = 11; + + +// Constants +const int32_t DOUBLE_SLOT_WORK = 495; +const int32_t SYS_WORK_PAIR_TRAINER_ID = 263; + +const int32_t ILLUMINATE_ABILITY = 35; +const int32_t ARENA_TRAP_ABILITY = 71; +const int32_t NO_GUARD_ABILITY = 99; +const int32_t STENCH_ABILITY = 1; +const int32_t WHITE_SMOKE_ABILITY = 73; +const int32_t QUICK_FEET_ABILITY = 95; +const int32_t INFILTRATOR_ABILITY = 151; +const int32_t SAND_VEIL_ABILITY = 8; +const int32_t SNOW_CLOAK_ABILITY = 81; +const int32_t SUCTION_CUPS_ABILITY = 21; +const int32_t STICKY_HOLD_ABILITY = 60; + +const int32_t SANDSTORM_WEATHER = 10; +const int32_t HAIL_WEATHER = 5; + +const int32_t PURE_INCENSE_ITEM = 320; +const int32_t CLEANSE_TAG_ITEM = 224; + +const int32_t SYS_FLAG_PAIR = 2; +const int32_t SYS_FLAG_SAFARI_MODE = 8; + +const int32_t FV_R212AR0103_RICH = 1647; + +const int32_t ENCOUNTER_TYPE_SINGLE = 0; +const int32_t ENCOUNTER_TYPE_DOUBLE = 1; +const int32_t ENCOUNTER_TYPE_SAFARI = 2; +const int32_t ENCOUNTER_TYPE_MOVEPOKE = 3; + +const int32_t FEEBAS_MONSNO = 349; + + +// Logs the given encounter slots. +void LogSlots(System::Array *slots) +{ + socket_log_fmt("SLOTS DUMP\n"); + for (int i=0; imax_length; i++) + { + socket_log_fmt("Slot %d: MonsNo %d, Level %d-%d\n", i+1, slots->m_Items[i].fields.monsNo, slots->m_Items[i].fields.minlv, slots->m_Items[i].fields.maxlv); + } +} + +// Replaces a slot in the slot list. +void ReplaceSlot(System::Array *slots, int32_t slot, int32_t monsNo, int32_t minLv, int32_t maxLv) +{ + if (slots->max_length > slot) + { + slots->m_Items[slot].fields.monsNo = monsNo; + slots->m_Items[slot].fields.minlv = minLv; + slots->m_Items[slot].fields.maxlv = maxLv; + } +} + +// Replaces a slot in the slot list. +void ReplaceSlot(System::Array *slots, int32_t slot, int32_t monsNo) +{ + if (slots->max_length > slot) + { + slots->m_Items[slot].fields.monsNo = monsNo; + } +} + +// Replaces a slot in the slot list. +void ReplaceSlot(System::Array *slots, int32_t slot, MonsLv_o newSlot) +{ + ReplaceSlot(slots, slot, newSlot.fields.monsNo, newSlot.fields.minlv, newSlot.fields.maxlv); +} + +// Gets the encounter list for the zone ID the player is currently in. +XLSXContent::FieldEncountTable::Sheettable_o * GetFieldEncountersOfCurrentZoneID() +{ + int32_t zoneId = PlayerWork::get_zoneID(nullptr); + return GameManager::GetFieldEncountData(zoneId, nullptr); +} + +// Initializes the slot list to contain all the base ground encounters. +void SetBaseGroundSlots(Dpr::Field::EncountResult_o **encounterHolder, System::Array *slots) +{ + int32_t zoneId = PlayerWork::get_zoneID(nullptr); + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + + XLSXContent::MapInfo_o *mapInfo = GameManager::get_mapInfo(nullptr); + XLSXContent::MapInfo_SheetZoneData_o *zoneData = mapInfo->get_Item(zoneId, nullptr); + if (zoneData->fields.BattleBg->max_length >= 1) + { + (*encounterHolder)->fields.BattleBG = zoneData->fields.BattleBg->m_Items[0]; + } + + if (slots->max_length > 0) + { + for (uint32_t i=0; imax_length && ifields.ground_mons->max_length; i++) + { + slots->m_Items[i] = fieldEnc->fields.ground_mons->m_Items[i]; + } + } +} + +// Initializes the slot list to contain all the base fishing encounters, based on the rod type. +void SetBaseFishingSlots(Dpr::Field::EncountResult_o **encounterHolder, System::Array *slots, int32_t inRodType) +{ + int32_t zoneId = PlayerWork::get_zoneID(nullptr); + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + + XLSXContent::MapInfo_o *mapInfo = GameManager::get_mapInfo(nullptr); + XLSXContent::MapInfo_SheetZoneData_o *zoneData = mapInfo->get_Item(zoneId, nullptr); + if (zoneData->fields.BattleBg->max_length >= 2) + { + (*encounterHolder)->fields.BattleBG = zoneData->fields.BattleBg->m_Items[1]; + } + + switch (inRodType) + { + case 1: + for (uint32_t i=0; imax_length && ifields.boro_mons->max_length; i++) + { + slots->m_Items[i] = fieldEnc->fields.boro_mons->m_Items[i]; + } + break; + case 2: + for (uint32_t i=0; imax_length && ifields.ii_mons->max_length; i++) + { + slots->m_Items[i] = fieldEnc->fields.ii_mons->m_Items[i]; + } + break; + case 3: + for (uint32_t i=0; imax_length && ifields.sugoi_mons->max_length; i++) + { + slots->m_Items[i] = fieldEnc->fields.sugoi_mons->m_Items[i]; + } + break; + } +} + +// Sets the time of day slots. +void SetTimeOfDaySlots(System::Array *slots) +{ + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + + int32_t periodOfDay = GameManager::get_currentPeriodOfDay(nullptr); + switch (periodOfDay) + { + case 1: + case 2: + if (fieldEnc->fields.day->max_length > 0) ReplaceSlot(slots, SLOT_TIME_OF_DAY_1, fieldEnc->fields.day->m_Items[0]); + if (fieldEnc->fields.day->max_length > 1) ReplaceSlot(slots, SLOT_TIME_OF_DAY_2, fieldEnc->fields.day->m_Items[1]); + break; + case 3: + case 4: + if (fieldEnc->fields.night->max_length > 0) ReplaceSlot(slots, SLOT_TIME_OF_DAY_1, fieldEnc->fields.night->m_Items[0]); + if (fieldEnc->fields.night->max_length > 1) ReplaceSlot(slots, SLOT_TIME_OF_DAY_2, fieldEnc->fields.night->m_Items[1]); + break; + } +} + +// Sets the swarm slots. +void SetSwarmSlots(System::Array *slots) +{ + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + + int32_t zoneId = PlayerWork::get_zoneID(nullptr); + int32_t swarmZoneId = ZoneWork::TairyouHassei_ZoneID(nullptr); + if (swarmZoneId == zoneId) + { + if (fieldEnc->fields.tairyo->max_length > 0) ReplaceSlot(slots, SLOT_SWARM_1, fieldEnc->fields.tairyo->m_Items[0]); + } +} + +// Sets the Trophy Garden slots. +void SetTrophyGardenSlots(System::Array *slots) +{ + bool talkedToBacklot = PlayerWork::GetBool(FV_R212AR0103_RICH, nullptr); + if (talkedToBacklot) + { + int32_t trophyIndex1 = EncountDataWork::GetUrayamaIndex(0, nullptr); + int32_t trophyMon1 = GameManager::GetUrayamaMonsNo(trophyIndex1, nullptr); + int32_t trophyIndex2 = EncountDataWork::GetUrayamaIndex(1, nullptr); + int32_t trophyMon2 = GameManager::GetUrayamaMonsNo(trophyIndex2, nullptr); + + ReplaceSlot(slots, SLOT_TROPHY_GARDEN_1, trophyMon1); + ReplaceSlot(slots, SLOT_TROPHY_GARDEN_2, trophyMon2); + } +} + +// Sets the dual-slot slots. +void SetGBASlots(System::Array *slots) +{ + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + + int32_t incenseSlot = PlayerWork::GetInt(DOUBLE_SLOT_WORK, nullptr); + System::Array* gbaDualSlot = nullptr; + switch (incenseSlot) + { + case 1: + gbaDualSlot = fieldEnc->fields.gbaRuby; + break; + case 2: + gbaDualSlot = fieldEnc->fields.gbaSapp; + break; + case 3: + gbaDualSlot = fieldEnc->fields.gbaEme; + break; + case 4: + gbaDualSlot = fieldEnc->fields.gbaFire; + break; + case 5: + gbaDualSlot = fieldEnc->fields.gbaLeaf; + break; + } + if (gbaDualSlot != nullptr) + { + if (slots->max_length > SLOT_DUALSLOT_1) ReplaceSlot(slots, SLOT_DUALSLOT_BUMP_1, slots->m_Items[SLOT_DUALSLOT_1]); + if (slots->max_length > SLOT_DUALSLOT_2) ReplaceSlot(slots, SLOT_DUALSLOT_BUMP_2, slots->m_Items[SLOT_DUALSLOT_2]); + if (gbaDualSlot->max_length > 0) ReplaceSlot(slots, SLOT_DUALSLOT_1, gbaDualSlot->m_Items[0]); + if (gbaDualSlot->max_length > 1) ReplaceSlot(slots, SLOT_DUALSLOT_2, gbaDualSlot->m_Items[1]); + } +} + +// Sets the water dual-slot slots. +void SetWaterGBASlots(System::Array *slots) +{ + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + + int32_t incenseSlot = PlayerWork::GetInt(DOUBLE_SLOT_WORK, nullptr); + System::Array* gbaDualSlot = nullptr; + switch (incenseSlot) + { + case 1: + gbaDualSlot = fieldEnc->fields.gbaRuby; + break; + case 2: + gbaDualSlot = fieldEnc->fields.gbaSapp; + break; + case 3: + gbaDualSlot = fieldEnc->fields.gbaEme; + break; + case 4: + gbaDualSlot = fieldEnc->fields.gbaFire; + break; + case 5: + gbaDualSlot = fieldEnc->fields.gbaLeaf; + break; + } + if (gbaDualSlot != nullptr) + { + if (gbaDualSlot->max_length > 2) ReplaceSlot(slots, SLOT_DUALSLOT_WATER_1, gbaDualSlot->m_Items[2]); + } +} + +// Sets the safari slots. +void SetSafariSlots(System::Array *slots) +{ + DPData::ENC_SV_DATA_o encData = PlayerWork::get_Enc_SV_Data(nullptr, nullptr); + int32_t zoneId = PlayerWork::get_zoneID(nullptr); + bool zukanFlag = ZukanWork::GetZenkokuFlag(nullptr); + + int32_t safariPos = ZoneWork::SafariZonePosID(zoneId, nullptr); + uint result = encData.fields.SafariRandSeed >> ((safariPos * 5) & 0x1fU); + int32_t index = (result & 0x1f) | 0x20; + if (!zukanFlag) + { + index = result & 0x1f; + } + + int32_t monsno = GameManager::GetSafariMonsNo(index, nullptr); + ReplaceSlot(slots, SLOT_SAFARI_1, monsno); + ReplaceSlot(slots, SLOT_SAFARI_2, monsno); +} + +// Sets the radar slots. +void SetRadarSlots(System::Array *slots) +{ + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + + if (slots->max_length > SLOT_RADAR_1) ReplaceSlot(slots, SLOT_RADAR_BUMP_1, slots->m_Items[SLOT_RADAR_1]); + if (fieldEnc->fields.swayGrass->max_length > 3) ReplaceSlot(slots, SLOT_RADAR_1, fieldEnc->fields.swayGrass->m_Items[3]); +} + +// Gets the Pokémon in the first Safari slot. +int32_t GetRandomSafariMon(System::Array *slots) +{ + if (slots->max_length > 6) + { + int32_t monsNo = slots->m_Items[SLOT_SAFARI_1].fields.monsNo & 0x0000FFFF; + int32_t formNo = (slots->m_Items[SLOT_SAFARI_1].fields.monsNo & 0xFFFF0000) >> 16; + return monsNo; + } + + return 1; +} + +// Calls a few methods and finalizes the encounter. +Dpr::Field::EncountResult_o * ReturnEncounterSlots(bool randomWildEncounter, Dpr::Field::EncountResult_o **encounterHolder, Dpr::Field::FieldEncount::ENC_FLD_SPA_o *spa, System::Array *slots, bool stopRadarSE, bool resetWalkEncountCount) +{ + LogSlots(slots); + if (!randomWildEncounter) + { + return nullptr; + } + + Dpr::Field::FieldEncount_o::LastProc(encounterHolder, spa, nullptr); + if (stopRadarSE) Dpr::Field::SwayGrass_o::StopSE(nullptr); + if (resetWalkEncountCount) PlayerWork::set_WalkEncountCount(0, nullptr); + + return *encounterHolder; +} + +// Checks if the player's party is empty. +bool IsPartyEmpty() +{ + Pml::PokeParty_o *party = PlayerWork::get_playerParty(nullptr); + + if (party->fields.m_memberCount == 0) + { + return true; + } + + return false; +} + +// Returns the attributes of the given tile. +XLSXContent::MapAttributeTable_SheetData_o * GetAttributeOfTile(UnityEngine_Vector2Int_o tile) +{ + int32_t code; + int32_t stop; + GameManager::GetAttribute(tile, &code, &stop, false, nullptr); + return GameManager::GetAttributeTable(code, nullptr); +} + +// Checks if the given tile can give an encounter. +bool DoesTileGiveEncounters(UnityEngine_Vector2Int_o tile) +{ + XLSXContent::MapAttributeTable_SheetData_o * attribute = GetAttributeOfTile(tile); + + if (!attribute->fields.Encount) + { + return false; + } + + return true; +} + +// Checks if the zone the player is currently in has any encounters. +bool DoesCurrentZoneIDHaveEncounters() +{ + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + + if (fieldEnc == nullptr) + { + return false; + } + + return true; +} + +// Checks if the given tile is a water tile. +bool IsTileAWaterTile(UnityEngine_Vector2Int_o tile) +{ + XLSXContent::MapAttributeTable_SheetData_o * attribute = GetAttributeOfTile(tile); + return AttributeID::MATR_IsWater(attribute->fields.Code, nullptr); +} + +// Returns the base encounter rate for the given tile in the zone the player is currently in. +int32_t GetBaseEncounterRate(UnityEngine_Vector2Int_o tile) +{ + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + + if (IsTileAWaterTile(tile)) + { + return fieldEnc->fields.encRate_wat; + } + else + { + return fieldEnc->fields.encRate_gr; + } +} + +// Returns the base fishing encounter rate for the given rod in the zone the player is currently in. +int32_t GetBaseFishingEncounterRate(int32_t inRodType) +{ + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + + switch (inRodType) + { + case 1: + return fieldEnc->fields.encRate_turi_boro; + break; + case 2: + return fieldEnc->fields.encRate_turi_ii; + break; + case 3: + return fieldEnc->fields.encRate_sugoi; + break; + } + return 0; +} + +// Sets values relating to repels in the SPA struct. +void CheckRepel(Dpr::Field::FieldEncount::ENC_FLD_SPA_o *spaStruct) +{ + Pml::PokeParty_o *party = PlayerWork::get_playerParty(nullptr); + bool repelActive = EncountDataWork::EncDataSave_CanUseSpray(nullptr); + uint32_t firstLevel; + if (repelActive) + { + firstLevel = 1; + for (uint32_t i=0; ifields.m_memberCount; i++) + { + Pml::PokePara::CoreParam *currentPoke = (Pml::PokePara::CoreParam *)party->GetMemberPointer(i, nullptr); + if (!currentPoke->IsEgg(2, nullptr) && !currentPoke->IsHpZero(nullptr)) + { + firstLevel = currentPoke->GetLevel(nullptr); + break; + } + } + spaStruct->fields.SprayCheck = true; //part of local_e8 + spaStruct->fields.SpMyLv = firstLevel; //local_e0 + } +} + +// Applies ability effects to the encounter rate. +int32_t ApplyAbilityToEncounterRate(Dpr::Field::FieldEncount::ENC_FLD_SPA_o *spaStruct, int32_t baseEncounterRate) +{ + int32_t encounterRate = baseEncounterRate; + if (!spaStruct->fields.Egg) + { + switch (spaStruct->fields.Spa) + { + // Double + case ILLUMINATE_ABILITY: + case ARENA_TRAP_ABILITY: + case NO_GUARD_ABILITY: + encounterRate *= 2; + break; + // Half + case STENCH_ABILITY: + case WHITE_SMOKE_ABILITY: + case QUICK_FEET_ABILITY: + case INFILTRATOR_ABILITY: + encounterRate /= 2; + break; + // Half if sandstorm + case SAND_VEIL_ABILITY: + if (((PlayerWork_c*) PlayerWork_TypeInfo)->static_fields->_FieldWeather_k__BackingField == SANDSTORM_WEATHER) + { + encounterRate /= 2; + } + break; + // Half if hail + case SNOW_CLOAK_ABILITY: + if (((PlayerWork_c*) PlayerWork_TypeInfo)->static_fields->_FieldWeather_k__BackingField == HAIL_WEATHER) + { + encounterRate /= 2; + } + break; + } + + if (encounterRate > 99) + { + encounterRate = 100; + } + } + + return encounterRate; +} + +// Applies fishing ability effects to the encounter rate. +int32_t ApplyFishingAbilityToEncounterRate(Dpr::Field::FieldEncount::ENC_FLD_SPA_o *spaStruct, int32_t baseEncounterRate) +{ + int32_t encounterRate = baseEncounterRate; + if (!spaStruct->fields.Egg) + { + switch (spaStruct->fields.Spa) + { + // Double + case STICKY_HOLD_ABILITY: + case SUCTION_CUPS_ABILITY: + encounterRate *= 2; + break; + } + + if (encounterRate > 99) + { + encounterRate = 100; + } + } + + return encounterRate; +} + +// Applies held item effects to the encounter rate. +int32_t ApplyLeadItemToEncounterRate(int32_t baseEncounterRate) +{ + Pml::PokeParty_o *party = PlayerWork::get_playerParty(nullptr); + Pml::PokePara::CoreParam *firstPokemon = (Pml::PokePara::CoreParam *)party->GetMemberPointer(0, nullptr); + + int32_t encounterRate = baseEncounterRate; + uint16_t item = firstPokemon->GetItem(nullptr); + if (item == PURE_INCENSE_ITEM || item == CLEANSE_TAG_ITEM) + { + // 66% + encounterRate = (encounterRate * 2) / 3; + } + + return encounterRate; +} + +// Determines the encounter type and sets it in the encounter result. +void SetEncounterType(Dpr::Field::EncountResult_o **encounterHolder, Dpr::Field::FieldEncount::ENC_FLD_SPA_o *spaStruct, Dpr::Field::FieldEncount::SWAY_ENC_INFO_o *swayInfo, bool *isSafariFlag) +{ + if (PlayerWork::GetSytemFlag(SYS_FLAG_PAIR, nullptr)) + { + (*encounterHolder)->fields.Type = ENCOUNTER_TYPE_DOUBLE; + *isSafariFlag = false; + } + else + { + int32_t moveZoneId = Dpr::Field::FieldEncount_o::CheckMovePokeEnc(nullptr); + if ((swayInfo == nullptr || !swayInfo->fields.Enc) && moveZoneId > -1) + { + (*encounterHolder)->fields.MP_SaveIndex = moveZoneId; + (*encounterHolder)->fields.Type = ENCOUNTER_TYPE_MOVEPOKE; + } + else if (PlayerWork::GetSytemFlag(SYS_FLAG_SAFARI_MODE, nullptr)) + { + (*encounterHolder)->fields.Type = ENCOUNTER_TYPE_SAFARI; + *isSafariFlag = true; + } + else + { + (*encounterHolder)->fields.Type = ENCOUNTER_TYPE_SINGLE; + *isSafariFlag = false; + } + } +} + +// Performs repel checks and triggers an encounter with the romaing Pokémon in the current route if it fails. +Dpr::Field::EncountResult_o * ReturnRoamingPokemonEncounter(Dpr::Field::EncountResult_o **encounterHolder, Dpr::Field::FieldEncount::ENC_FLD_SPA_o *spaStruct) +{ + Pml::PokeParty_o *party = PlayerWork::get_playerParty(nullptr); + Pml::PokePara::CoreParam *firstPokemon = (Pml::PokePara::CoreParam *)party->GetMemberPointer(0, nullptr); + + int32_t moveZoneId = Dpr::Field::FieldEncount_o::CheckMovePokeEnc(nullptr); + DPData::MV_POKE_DATA_o mvPokeData; // local_120 = 0x0, local_118 = 0x8, etc. Total size 0x28 NOTE: ALIGNMENT IS WRONG IN GHIDRA + EncountDataWork::GetMovePokeData(moveZoneId, &mvPokeData, nullptr); + if (spaStruct->fields.SprayCheck && mvPokeData.fields.Lv < spaStruct->fields.SpMyLv) + { + return nullptr; + } + + Dpr::Field::FieldEncount_o::EncountParamSet(mvPokeData.fields.MonsNo, mvPokeData.fields.Lv, 1, *spaStruct, (Pml::PokePara::PokemonParam_o*)firstPokemon, encounterHolder, nullptr); + Dpr::Field::FieldEncount_o::LastProc(encounterHolder, spaStruct, nullptr); + return *encounterHolder; +} + +// Prepares the water encounter slots and triggers a water encounter. +Dpr::Field::EncountResult_o * ReturnWaterEncounter(Dpr::Field::EncountResult_o **encounterHolder, Dpr::Field::FieldEncount::ENC_FLD_SPA_o *spaStruct, System::Array *slots, bool resetWalkEncountCount) +{ + Pml::PokeParty_o *party = PlayerWork::get_playerParty(nullptr); + Pml::PokePara::CoreParam *firstPokemon = (Pml::PokePara::CoreParam *)party->GetMemberPointer(0, nullptr); + + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + + int32_t zoneId = PlayerWork::get_zoneID(nullptr); + XLSXContent::MapInfo_o *mapInfo = GameManager::get_mapInfo(nullptr); + XLSXContent::MapInfo_SheetZoneData_o *zoneData = mapInfo->get_Item(zoneId, nullptr); + if (zoneData->fields.BattleBg->max_length >= 2) + { + (*encounterHolder)->fields.BattleBG = zoneData->fields.BattleBg->m_Items[1]; + } + + for (uint32_t i=0; imax_length && ifields.water_mons->max_length; i++) + { + slots->m_Items[i] = fieldEnc->fields.water_mons->m_Items[i]; + } + + SetWaterGBASlots(slots); + + bool randomWildEncounter = Dpr::Field::FieldEncount_o::SetEncountData((Pml::PokePara::PokemonParam_o*)firstPokemon, 0, *spaStruct, slots, 1, 1, encounterHolder, nullptr); + return ReturnEncounterSlots(randomWildEncounter, encounterHolder, spaStruct, slots, false, resetWalkEncountCount); +} + +// Replaces all the fishing slots with Feebas if fishing on a Feebas tile. +void CheckFeebasTiles(System::Array *slots, UnityEngine_Vector2Int_o tile) +{ + int32_t zoneId = PlayerWork::get_zoneID(nullptr); + bool isFeebasZone = ZoneWork::IsSpFishingZone(zoneId, nullptr); + if (isFeebasZone) + { + bool isFeebasTile = Dpr::Field::SpFishing::CheckPoint(&tile, nullptr); + if (isFeebasTile) + { + for (uint32_t i=0; imax_length; i++) + { + slots->m_Items[i].fields.monsNo = FEEBAS_MONSNO; + } + } + } +} + +/////////////////////////////////////////////////////////// + +// REGULAR ENCOUNTER GENERATION +Dpr::Field::EncountResult_o * FieldEncount_Check_EncounterSlots(FieldObjectEntity_o *entity, bool inGridmove, MethodInfo *method) +{ + system_load_typeinfo((void *)0x48c1); + system_load_typeinfo((void *)0x6ae9); + system_load_typeinfo((void *)0x48c9); + system_load_typeinfo((void *)0x48c7); + system_load_typeinfo((void *)0x48c6); + + // No encounters if party is empty + if (IsPartyEmpty()) + { + return nullptr; + } + + // No encounters if current tile does not give encounters + if (!DoesTileGiveEncounters(entity->get_gridPosition(nullptr))) + { + return nullptr; + } + + // No encounters if current zone does not have encounters + if (!DoesCurrentZoneIDHaveEncounters()) + { + return nullptr; + } + + // Get base encounter rate (ground or water) + // No encounters if encounter rate is 0 + int32_t encounterRate = GetBaseEncounterRate(entity->get_gridPosition(nullptr)); + if (encounterRate == 0) + { + return nullptr; + } + + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + Pml::PokeParty_o *party = PlayerWork::get_playerParty(nullptr); + Pml::PokePara::CoreParam *firstPokemon = (Pml::PokePara::CoreParam *)party->GetMemberPointer(0, nullptr); + Dpr::Field::FieldEncount::ENC_FLD_SPA_o spaStruct; // local_e8 = 0x0, local_e0 = 0x8, etc. Total size 0x28 + Dpr::Field::FieldEncount_o::SetSpaStruct((Pml::PokePara::PokemonParam_o *)firstPokemon, fieldEnc, &spaStruct, nullptr); + + // Sets repel-related values in spaStruct + CheckRepel(&spaStruct); + + // Applies ability and item effects to the encounter rate + encounterRate = ApplyAbilityToEncounterRate(&spaStruct, encounterRate); + encounterRate = ApplyLeadItemToEncounterRate(encounterRate); + + // Roll for a grass encounter / Check if radar patch entered + XLSXContent::MapAttributeTable_SheetData_o * attribute = GetAttributeOfTile(entity->get_gridPosition(nullptr)); + bool rolledGrassEncounter = Dpr::Field::FieldEncount_o::MapEncountCheck(encounterRate, (attribute->fields).Code, inGridmove, nullptr); + Dpr::Field::FieldEncount::SWAY_ENC_INFO_o swayInfo; // local_f0 = 0x0, Total size 0x8 + bool radarEncounter = Dpr::Field::SwayGrass_o::SwayGrass_CheckSpEncount(&swayInfo, &entity->fields.super.worldPosition, 0.48, nullptr); + if (!radarEncounter) + { + if (!rolledGrassEncounter) + { + return nullptr; + } + } + else + { + swayInfo.fields.Enc = true; + } + + Dpr::Field::EncountResult_o *encounterHolder = (Dpr::Field::EncountResult_o *)il2cpp_object_new(Dpr::Field::EncountResult_TypeInfo); + encounterHolder->ctor(nullptr); + System::Array *slots = (System::Array *)system_array_new(MonsLv_Array_TypeInfo, 12); // local_100 = 0x0 + bool isSafariFlag = false; + + // Handle Roaming and water encounters + SetEncounterType(&encounterHolder, &spaStruct, &swayInfo, &isSafariFlag); + if (encounterHolder->fields.Type == ENCOUNTER_TYPE_MOVEPOKE) + { + return ReturnRoamingPokemonEncounter(&encounterHolder, &spaStruct); + } + if (IsTileAWaterTile(entity->get_gridPosition(nullptr))) + { + return ReturnWaterEncounter(&encounterHolder, &spaStruct, slots, false); + } + + // Set slots + SetBaseGroundSlots(&encounterHolder, slots); + SetTimeOfDaySlots(slots); + bool isSwarm = EncountDataWork::IsTairyouHassei(nullptr); + if (isSwarm) + { + SetSwarmSlots(slots); + } + int32_t zoneId = PlayerWork::get_zoneID(nullptr); + bool isTrophyGardenZoneId = ZoneWork::IsHillBackZone(zoneId, nullptr); + bool zukanFlag = ZukanWork::GetZenkokuFlag(nullptr); + if (isTrophyGardenZoneId && zukanFlag) + { + SetTrophyGardenSlots(slots); + } + SetGBASlots(slots); + + if (PlayerWork::GetSytemFlag(SYS_FLAG_PAIR, nullptr)) + { + // Handle double wild encounter with partner + int32_t partner = PlayerWork::GetInt(SYS_WORK_PAIR_TRAINER_ID, nullptr); + encounterHolder->fields.Partner = partner; + + bool randomWildEncounter = Dpr::Field::FieldEncount_o::SetEncountData((Pml::PokePara::PokemonParam_o*)firstPokemon, 0, spaStruct, slots, 0, 1, &encounterHolder, nullptr); + if (!randomWildEncounter) + { + return nullptr; + } + + randomWildEncounter = Dpr::Field::FieldEncount_o::SetEncountData((Pml::PokePara::PokemonParam_o*)firstPokemon, 0, spaStruct, slots, 0, 3, &encounterHolder, nullptr); + return ReturnEncounterSlots(randomWildEncounter, &encounterHolder, &spaStruct, slots, true, false); + } + else + { + // Handle single wild encounter + + // Set single wild specific slots + if (isSafariFlag) + { + SetSafariSlots(slots); + } + if (swayInfo.fields.Enc) + { + SetRadarSlots(slots); + } + + bool randomWildEncounter = Dpr::Field::FieldEncount_o::WildEncSingle((Pml::PokePara::PokemonParam_o*)firstPokemon, &encounterHolder, fieldEnc, slots, spaStruct, swayInfo, nullptr); + return ReturnEncounterSlots(randomWildEncounter, &encounterHolder, &spaStruct, slots, true, false); + } +} + +// SAFARI BINOCULARS ENCOUNTER GENERATION +int32_t GetSafariScopeMonster_EncounterSlots(int32_t zoneId, MethodInfo *method) +{ + system_load_typeinfo((void *)0x48c3); + + System::Array *slots = (System::Array *)system_array_new(MonsLv_Array_TypeInfo, 12); + XLSXContent::FieldEncountTable::Sheettable_o *fieldEnc = GameManager::GetFieldEncountData(zoneId, nullptr); + + if (slots->max_length > 0) + { + for (uint32_t i=0; imax_length && ifields.ground_mons->max_length; i++) + { + slots->m_Items[i] = fieldEnc->fields.ground_mons->m_Items[i]; + } + } + + SetTimeOfDaySlots(slots); + SetGBASlots(slots); + SetSafariSlots(slots); + + return GetRandomSafariMon(slots); +} + +// FISHING ENCOUNTER GENERATION +Dpr::Field::EncountResult_o * SetFishingEncount_EncounterSlots(int32_t inRodType, UnityEngine_Vector2Int_o position, MethodInfo *method) +{ + system_load_typeinfo((void *)0x48c8); + system_load_typeinfo((void *)0x6ae9); + + // No encounters if current zone does not have encounters + if (!DoesCurrentZoneIDHaveEncounters()) + { + return nullptr; + } + + // Get base encounter rate (fishing rod) + // No encounters if encounter rate is 0 + int32_t encounterRate = GetBaseFishingEncounterRate(inRodType); + if (encounterRate == 0) + { + return nullptr; + } + + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + Pml::PokeParty_o *party = PlayerWork::get_playerParty(nullptr); + Pml::PokePara::CoreParam *firstPokemon = (Pml::PokePara::CoreParam *)party->GetMemberPointer(0, nullptr); + Dpr::Field::FieldEncount::ENC_FLD_SPA_o spaStruct; // local_b0 = 0x0, local_a8 = 0x8, etc. Total size 0x28 + Dpr::Field::FieldEncount_o::SetSpaStruct((Pml::PokePara::PokemonParam_o *)firstPokemon, fieldEnc, &spaStruct, nullptr); + + // Applies ability effects to the encounter rate + encounterRate = ApplyFishingAbilityToEncounterRate(&spaStruct, encounterRate); + + // Roll if we get a hooked Pokémon + int32_t encounterRoll = RandomGroupWork::RandomValue(100, nullptr); + if (encounterRate <= encounterRoll) + { + return nullptr; + } + + Dpr::Field::EncountResult_o *encounterHolder = (Dpr::Field::EncountResult_o *)il2cpp_object_new(Dpr::Field::EncountResult_TypeInfo); + encounterHolder->ctor(nullptr); + System::Array *slots = (System::Array *)system_array_new(MonsLv_Array_TypeInfo, 5); + + // Set slots + SetBaseFishingSlots(&encounterHolder, slots, inRodType); + + // Replace all slots with Feebas if fishing in a feebas tile + CheckFeebasTiles(slots, position); + + // Set encounter type + if (PlayerWork::GetSytemFlag(SYS_FLAG_SAFARI_MODE, nullptr)) + { + encounterHolder->fields.Type = ENCOUNTER_TYPE_SAFARI; + } + else + { + encounterHolder->fields.Type = ENCOUNTER_TYPE_SINGLE; + } + + // Handle wild encounter + bool randomWildEncounter = Dpr::Field::FieldEncount_o::SetEncountData((Pml::PokePara::PokemonParam_o*)firstPokemon, inRodType, spaStruct, slots, 2, 1, &encounterHolder, nullptr); + return ReturnEncounterSlots(randomWildEncounter, &encounterHolder, &spaStruct, slots, false, false); +} + +// SWEET SCENT ENCOUNTER GENERATION +Dpr::Field::EncountResult_o * SetSweetEncount_EncounterSlots(MethodInfo *method) +{ + system_load_typeinfo((void *)0x48cc); + system_load_typeinfo((void *)0x3f80); + system_load_typeinfo((void *)0x48c4); + + // No encounters if party is empty + if (IsPartyEmpty()) + { + return nullptr; + } + + // No encounters if current tile does not give encounters + FieldObjectEntity_o *entity = (FieldObjectEntity_o *)EntityManager_TypeInfo->static_fields->_activeFieldPlayer_k__BackingField; + if (!DoesTileGiveEncounters(entity->get_gridPosition(nullptr))) + { + return nullptr; + } + + // No encounters if current zone does not have encounters + if (!DoesCurrentZoneIDHaveEncounters()) + { + return nullptr; + } + + // Get base encounter rate (ground or water) + // No encounters if encounter rate is 0 + int32_t encounterRate = GetBaseEncounterRate(entity->get_gridPosition(nullptr)); + if (encounterRate == 0) + { + return nullptr; + } + + XLSXContent::FieldEncountTable::Sheettable_o * fieldEnc = GetFieldEncountersOfCurrentZoneID(); + Pml::PokeParty_o *party = PlayerWork::get_playerParty(nullptr); + Pml::PokePara::CoreParam *firstPokemon = (Pml::PokePara::CoreParam *)party->GetMemberPointer(0, nullptr); + Dpr::Field::FieldEncount::ENC_FLD_SPA_o spaStruct; // local_e0 = 0x0, local_d8 = 0x8, etc. Total size 0x28 + Dpr::Field::FieldEncount_o::SetSpaStruct((Pml::PokePara::PokemonParam_o *)firstPokemon, fieldEnc, &spaStruct, nullptr); + + Dpr::Field::EncountResult_o *encounterHolder = (Dpr::Field::EncountResult_o *)il2cpp_object_new(Dpr::Field::EncountResult_TypeInfo); // local_f0 = 0x0 + encounterHolder->ctor(nullptr); + System::Array *slots = (System::Array *)system_array_new(MonsLv_Array_TypeInfo, 12); // local_100 = 0x0 + bool isSafariFlag = false; + + // Handle Roaming and water encounters + SetEncounterType(&encounterHolder, &spaStruct, nullptr, &isSafariFlag); + if (encounterHolder->fields.Type == ENCOUNTER_TYPE_MOVEPOKE) + { + return ReturnRoamingPokemonEncounter(&encounterHolder, &spaStruct); + } + if (IsTileAWaterTile(entity->get_gridPosition(nullptr))) + { + return ReturnWaterEncounter(&encounterHolder, &spaStruct, slots, true); + } + + // Set slots + SetBaseGroundSlots(&encounterHolder, slots); + SetTimeOfDaySlots(slots); + bool isSwarm = EncountDataWork::IsTairyouHassei(nullptr); + if (isSwarm) + { + SetSwarmSlots(slots); + } + int32_t zoneId = PlayerWork::get_zoneID(nullptr); + bool isTrophyGardenZoneId = ZoneWork::IsHillBackZone(zoneId, nullptr); + bool zukanFlag = ZukanWork::GetZenkokuFlag(nullptr); + if (isTrophyGardenZoneId && zukanFlag) + { + SetTrophyGardenSlots(slots); + } + SetGBASlots(slots); + + if (PlayerWork::GetSytemFlag(SYS_FLAG_PAIR, nullptr)) + { + // Handle double wild encounter with partner + int32_t partner = PlayerWork::GetInt(SYS_WORK_PAIR_TRAINER_ID, nullptr); + encounterHolder->fields.Partner = partner; + + bool randomWildEncounter = Dpr::Field::FieldEncount_o::SetEncountData((Pml::PokePara::PokemonParam_o*)firstPokemon, 0, spaStruct, slots, 0, 1, &encounterHolder, nullptr); + if (!randomWildEncounter) + { + return nullptr; + } + + randomWildEncounter = Dpr::Field::FieldEncount_o::SetEncountData((Pml::PokePara::PokemonParam_o*)firstPokemon, 0, spaStruct, slots, 0, 3, &encounterHolder, nullptr); + return ReturnEncounterSlots(randomWildEncounter, &encounterHolder, &spaStruct, slots, true, true); + } + else + { + // Handle single wild encounter + + // Set single wild specific slots + if (isSafariFlag) + { + SetSafariSlots(slots); + } + + Dpr::Field::FieldEncount::SWAY_ENC_INFO_o swayInfo; + bool randomWildEncounter = Dpr::Field::FieldEncount_o::WildEncSingle((Pml::PokePara::PokemonParam_o*)firstPokemon, &encounterHolder, fieldEnc, slots, spaStruct, swayInfo, nullptr); + return ReturnEncounterSlots(randomWildEncounter, &encounterHolder, &spaStruct, slots, true, true); + } +} diff --git a/src/patches/ev_iv_ui.cpp b/src/patches/ev_iv_ui.cpp index c7f892f51..e2b5efa92 100644 --- a/src/patches/ev_iv_ui.cpp +++ b/src/patches/ev_iv_ui.cpp @@ -2,6 +2,7 @@ #include "Dpr/Message/MessageWordSetHelper.hpp" #include "System/Array.hpp" #include "System/String.hpp" +#include "UnityEngine/GameObject.hpp" struct BoxStatusPanelUI_Fields { Pml::PokePara::CoreParam * pokemonParam; @@ -21,7 +22,7 @@ struct BoxStatusPanelUI_o { struct Dpr_UI_PokemonStatusPanel_Fields { UnityEngine_MonoBehaviour_Fields super; struct Pml_PokePara_PokemonParam_o* _pokemonParam; - struct UnityEngine_GameObject_o* _aButtonGuide; + struct UnityEngine::GameObject_o* _aButtonGuide; struct Dpr_UI_UIInputController_o* input; struct Dpr_UI_PokemonStatusWindow_Param_o* statusParam; struct UnityEngine_Events_UnityAction_bool__o* onChangeMemberSelectArrow; @@ -136,4 +137,4 @@ System::String * Dpr_UI_BoxStatusPanel_GetJudgeTextCode(Dpr_UI_BoxStatusPanel_o Il2CppObject * intObject = thunk_FUN_7100252fd8(int_TypeInfo, (void *) &messageID); return System::String::Concat(StringLiteral_11167, intObject, nullptr); -} \ No newline at end of file +} diff --git a/src/patches/everlasting_candies.cpp b/src/patches/everlasting_candies.cpp index 118245a7d..da8f76a81 100644 --- a/src/patches/everlasting_candies.cpp +++ b/src/patches/everlasting_candies.cpp @@ -40,7 +40,7 @@ namespace Dpr struct UnityEngine_Sprite_array* shortcutButonSprites; int32_t index; struct UnityEngine_RectTransform_o* rectTransform; - struct Dpr::Item::ItemInfo_o* item; + Dpr::Item::ItemInfo_o* item; }; struct BagItemButton_o { diff --git a/src/patches/form_change.cpp b/src/patches/form_change.cpp index e2a060a57..d599fd194 100644 --- a/src/patches/form_change.cpp +++ b/src/patches/form_change.cpp @@ -1,39 +1,36 @@ #include "Pml/PokePara/CalcTool.h" #include "Dpr/Battle/Logic/Common.hpp" +const int32_t ROTOM_MONSNO = 0x1DF; +const int32_t GIRATINA_MONSNO = 0x1E7; +const int32_t ARCEUS_MONSNO = 0x1ED; +const uint32_t GIRATINA_ORB_ITEMNO = 0x70; + bool DecideFormNoFromHoldItem(int32_t monsno, uint32_t holdItemno, uint16_t *formno, MethodInfo *method) { // 0xf - Form Change Item field function // Dpr.UI.UIBag$$UseFormChangeItem for stuff like Shaymin // Dpr.EncountTools$$SetWildPokemonItem - int32_t MEWTWO_MONSNO = 0x96; - int32_t ROTOM_MONSNO = 0x1DF; - int32_t GIRATINA_MONSNO = 0x1E7; - int32_t ARCEUS_MONSNO = 0x1ED; - uint32_t GIRATINA_ORB_ITEMNO = 0x70; - uint32_t MEWTWO_ARMOR_ITEMNO = 0x72A; - uint16_t MEWTWO_ARMOR_FORMNO = 0x3; + switch (monsno) + { + case GIRATINA_MONSNO: + *formno = holdItemno == GIRATINA_ORB_ITEMNO; + return true; - if (monsno == GIRATINA_MONSNO) { - *formno = holdItemno == GIRATINA_ORB_ITEMNO; - } else if (monsno == ARCEUS_MONSNO) { - *formno = Pml::PokePara::CalcTool::GetAruseusuType(holdItemno, (MethodInfo *) nullptr); - } else if (monsno == MEWTWO_MONSNO) { - *formno = holdItemno == MEWTWO_ARMOR_ITEMNO ? MEWTWO_ARMOR_FORMNO : 0; - } else { - return false; + case ARCEUS_MONSNO: + *formno = Pml::PokePara::CalcTool::GetAruseusuType(holdItemno, (MethodInfo *) nullptr); + return true; + + // Doesn't match any pokémon that changes forms, don't change + default: + return false; } - return true; + return false; } bool CheckUnbreakablePokeItem(uint16_t monsno,uint16_t itemID,MethodInfo *method) { - uint16_t MEWTWO_MONSNO = 0x96; - uint16_t MEWTWO_ARMOR_ITEMNO = 0x72A; - if (monsno == MEWTWO_MONSNO && itemID == MEWTWO_ARMOR_ITEMNO) { - return true; - } // TODO: Any other form change items TTIN asks of me return Dpr::Battle::Logic::Common::CheckUnbreakablePokeItem(monsno, itemID, method); diff --git a/src/patches/item_changes.cpp b/src/patches/item_changes.cpp new file mode 100644 index 000000000..fccb1415f --- /dev/null +++ b/src/patches/item_changes.cpp @@ -0,0 +1,44 @@ +#include "il2cpp.hpp" + +#include "Dpr/UI/UIBag.hpp" +#include "Pml/Personal/PersonalSystem.hpp" +#include "Pml/PokePara/CoreParam.h" +#include "Pml/PokePara/PokemonParam.h" + +#include "util.hpp" +#include "logger.hpp" + +// Checks if Ability Patch can be used. +bool AbilityPatchUsability(Dpr::UI::UIBag___c__DisplayClass135_0_o *__this, Pml::PokePara::PokemonParam_o *pp, MethodInfo *method) +{ + system_load_typeinfo((void *)0x9592); + + Pml::PokePara::CoreParam* coreParam = (Pml::PokePara::CoreParam*)__this->fields.pokeParam; + + int32_t monsno = coreParam->GetMonsNo(nullptr); + int32_t formno = coreParam->GetFormNo(nullptr); + + Pml::Personal::PersonalSystem::LoadPersonalData(monsno, formno, nullptr); + int32_t pattern = Pml::Personal::PersonalSystem::GetTokuseiPattern(nullptr); + + switch (pattern) + { + case 0: // A1 == A2 == HA + return false; + case 1: // A1 == A2 != HA + case 2: // A1 != A2 != HA + Pml::PokePara::CoreParam* corePp = (Pml::PokePara::CoreParam*)pp; + uint8_t abilitySlot = corePp->GetTokuseiIndex(nullptr); + if (abilitySlot != 2) // Change to Hidden Ability + { + corePp->SetTokuseiIndex(2, nullptr); + } + else // Change to first Ability + { + corePp->SetTokuseiIndex(0, nullptr); + } + return true; + } + + return false; +} diff --git a/src/patches/leek.cpp b/src/patches/leek.cpp new file mode 100644 index 000000000..aa851b617 --- /dev/null +++ b/src/patches/leek.cpp @@ -0,0 +1,25 @@ +#include "Dpr/Battle/Logic/Common.hpp" +#include "Dpr/Battle/Logic/EventFactor.hpp" + +#include "il2cpp-api.h" +#include "util.hpp" +#include "logger.hpp" + +using namespace Dpr::Battle::Logic; + +void Dpr_Battle_Logic_Handler_Item_handler_Leek(EventFactor_EventHandlerArgs_o** args, uint8_t pokeID) { + system_load_typeinfo((void *)0x58a2); + system_load_typeinfo((void *)0x5910); + + uint32_t attackingMon = Common::GetEventVar(args, 3, nullptr); + if (attackingMon != pokeID) + return; + + BTL_POKEPARAM_o* __this = Common::GetPokeParam(args, pokeID, nullptr); + uint16_t monsNo = __this->GetMonsNo(nullptr); + + if (monsNo == 83 || monsNo == 865) { + int32_t critStage = Common::GetEventVar(args, 47, nullptr); + Common::RewriteEventVar(args, 47, critStage + 2, nullptr); + } +} \ No newline at end of file diff --git a/src/patches/level_cap.cpp b/src/patches/level_cap.cpp index 8d234aa52..73211e3c2 100644 --- a/src/patches/level_cap.cpp +++ b/src/patches/level_cap.cpp @@ -8,78 +8,6 @@ #include -uint32_t getMaxLevel() { - constexpr size_t NUM_FLAGS = 1; - constexpr size_t NUM_SYS_FLAGS = 1; - uint32_t maxLevel = 100; - uint32_t numEvents = GetBadgeCount(); - - uint32_t flags[NUM_FLAGS] = { - 2770 // Beating Cyrus at spear pillar - }; - - uint32_t sysflags[NUM_SYS_FLAGS] = { - 5 // Game clear - }; - - for (size_t i = 0; i < NUM_FLAGS; i++) - { - if (PlayerWork::GetBool(flags[i], nullptr)) - { - numEvents += 1; - } - } - - for (size_t i = 0; i < NUM_SYS_FLAGS; i++) - { - if (PlayerWork::GetSytemFlag(sysflags[i], nullptr)) - { - numEvents += 1; - } - } - - switch (numEvents) - { - case 0: // Roark - maxLevel = 16; - break; - case 1: // Gardenia - maxLevel = 26; - break; - case 2: // Fantina - maxLevel = 33; - break; - case 3: // Maylene - maxLevel = 39; - break; - case 4: // Crasher Wake - maxLevel = 44; - break; - case 5: // Byron - maxLevel = 53; - break; - case 6: // Candice - maxLevel = 56; - break; - case 7: // Spear Pillar - maxLevel = 60; - break; - case 8: // Volkner - maxLevel = 62; - break; - case 9: // Cynthia - maxLevel = 78; - break; - case 10: // Stark Mountain - maxLevel = 85; - break; - default: - break; - } - - return maxLevel; -} - uint32_t Dpr::Battle::Logic::Exp::getexp_calc_adjust_level(uint32_t base_exp,uint16_t getpoke_lv,uint16_t deadpoke_lv,MethodInfo *method ) { float fVar4; diff --git a/src/patches/local_koukan.cpp b/src/patches/local_koukan.cpp deleted file mode 100644 index 5b0ba8537..000000000 --- a/src/patches/local_koukan.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// #include "il2cpp.hpp" -// #include "Pml/PokePara/CoreParam.h" - -// namespace XLSXContent -// { -// struct LocalKoukanData_Sheetdata_o; -// } - -// namespace Pml -// { -// namespace PokePara -// { -// // struct Pml_PokePara_PokemonParam_StaticFields { -// // struct System_Byte_array* sParamSerializeBuffer; -// // }; -// struct PokemonParam_Fields { -// CoreParam_Fields super; -// }; -// struct PokemonParam_VTable { -// VirtualInvokeData _0_Equals; -// VirtualInvokeData _1_Finalize; -// VirtualInvokeData _2_GetHashCode; -// VirtualInvokeData _3_ToString; -// VirtualInvokeData _4_Serialize_Core; -// VirtualInvokeData _5_Serialize_Core; -// VirtualInvokeData _6_Deserialize_Core; -// VirtualInvokeData _7_Deserialize_Core; -// }; -// struct PokemonParam_c { -// Il2CppClass_1 _1; -// struct PokemonParam_StaticFields* static_fields; -// Il2CppRGCTXData* rgctx_data; -// Il2CppClass_2 _2; -// PokemonParam_VTable vtable; -// }; -// struct PokemonParam_o { -// PokemonParam_c *klass; -// void *monitor; -// PokemonParam_Fields fields; -// }; -// } -// } - -// using namespace Pml::PokePara; -// using namespace XLSXContent; - -// struct LocalKoukan -// { -// static LocalKoukanData_Sheetdata_o * GetTargetData(int32_t npcindex, int32_t lang, MethodInfo *method); -// static PokemonParam_o * CreateTradePokeParam(LocalKoukanData_Sheetdata_o *data, MethodInfo *method); -// }; - -// static int32_t s_npcindex = -1; -// static int32_t s_lang = -1; - -// LocalKoukanData_Sheetdata_o * LocalKoukan_GetTargetData(int32_t npcindex, int32_t lang, MethodInfo *method) -// { -// s_npcindex = npcindex; -// s_lang = lang; -// return LocalKoukan::GetTargetData(npcindex, lang, method); -// } - -// PokemonParam_o * LocalKoukan_CreateTradePokeParam(LocalKoukanData_Sheetdata_o *data, MethodInfo *method) -// { -// PokemonParam_o * pokeParam = LocalKoukan::CreateTradePokeParam(data, method); - -// if (s_npcindex != -1) -// { -// Accessor * accessor = pokeParam->fields.super.m_accessor; -// accessor->SetTalentAgi(31, (MethodInfo *) nullptr); -// accessor->SetTalentAtk(31, (MethodInfo *) nullptr); -// accessor->SetTalentDef(31, (MethodInfo *) nullptr); -// accessor->SetTalentHp(31, (MethodInfo *) nullptr); -// accessor->SetTalentSpAtk(31, (MethodInfo *) nullptr); -// accessor->SetTalentSpDef(31, (MethodInfo *) nullptr); -// } - -// return pokeParam; -// } \ No newline at end of file diff --git a/src/patches/local_trades_extension.cpp b/src/patches/local_trades_extension.cpp new file mode 100644 index 000000000..7d4124ca4 --- /dev/null +++ b/src/patches/local_trades_extension.cpp @@ -0,0 +1,161 @@ +#include "il2cpp.hpp" +#include "il2cpp-api.h" + +#include "Dpr/Message/MessageManager.hpp" +#include "GameData/DataManager.hpp" +#include "PlayerWork.hpp" +#include "Pml/PokePara/InitialSpec.hpp" +#include "Pml/PokePara/OwnerInfo.hpp" +#include "Pml/PokePara/PokemonParam.h" +#include "poketool/poke_memo/poketool_poke_memo.hpp" +#include "SmartPoint/AssetAssistant/SingletonMonoBehavior.hpp" +#include "XLSXContent/LocalKoukanData.hpp" + +#include "util.hpp" +#include "logger.hpp" + +const int32_t JAPANESE_LANGID = 1; +const int32_t ENGLISH_LANGID = 2; + +const uint32_t POKEBALL_BALLID = 4; + +const int32_t HP_POWERID = 0; +const int32_t ATK_POWERID = 1; +const int32_t DEF_POWERID = 2; +const int32_t SPATK_POWERID = 3; +const int32_t SPDEF_POWERID = 4; +const int32_t SPEED_POWERID = 5; + +int32_t LocalKoukan_GetIndex(int32_t npcindex, int32_t lang, MethodInfo *method) +{ + return npcindex; +} + +XLSXContent::LocalKoukanData_Sheetdata_o * LocalKoukan_GetTargetData(int32_t npcindex, int32_t lang, MethodInfo *method) +{ + system_load_typeinfo((void *)0x5e91); + XLSXContent::LocalKoukanData_Sheetdata_o *data = GameData::DataManager_TypeInfo->static_fields->LocalKoukanData->get_Item(npcindex, nullptr); + return data; +} + +int32_t LocalKoukan_Language(int32_t langId, MethodInfo *method) +{ + int32_t playerLangId = PlayerWork::get_msgLangID(nullptr); + + if (langId == 0) + { + // No set language, so set to same language as player. + return playerLangId; + } + else if (langId != playerLangId) + { + // Set language that doesn't match player, so set to that language. + return langId; + } + else if (langId != ENGLISH_LANGID) + { + // Set language that matches player, so set to english. + return ENGLISH_LANGID; + } + else + { + // Set language that matches player, but it's english, so set to japanese. + return JAPANESE_LANGID; + } +} + +Pml::PokePara::PokemonParam_o * LocalKoukan_CreateTradePokeParam(XLSXContent::LocalKoukanData_Sheetdata_o *data, MethodInfo *method) +{ + system_load_typeinfo((void *)0x5e90); + + Pml::PokePara::InitialSpec_o * initialSpec = (Pml::PokePara::InitialSpec_o *) il2cpp_object_new(Pml::PokePara::InitialSpec_TypeInfo); + initialSpec->ctor(nullptr); + + int32_t formNo = (data->fields.monsno & 0xFFFF0000) >> 16; // Bits 16-31 + int32_t monsNo = data->fields.monsno & 0x0000FFFF; // Bits 0-15 + + int32_t speedIV = (data->fields.tokusei & 0xF8000000) >> 27; // Bits 27-31 + int32_t spDefIV = (data->fields.tokusei & 0x07C00000) >> 22; // Bits 22-26 + int32_t spAtkIV = (data->fields.tokusei & 0x003E0000) >> 17; // Bits 17-21 + int32_t defIV = (data->fields.tokusei & 0x0001F000) >> 12; // Bits 12-16 + int32_t atkIV = (data->fields.tokusei & 0x00000F80) >> 7; // Bits 7-11 + int32_t hpIV = (data->fields.tokusei & 0x0000007C) >> 2; // Bits 2-6 + int32_t tokusei = data->fields.tokusei & 0x00000003; // Bits 0-1 + + int32_t ivFlag = (data->fields.seikaku & 0x00000800) >> 11; // Bit 11 + int32_t contestFlag = (data->fields.seikaku & 0x00000400) >> 10; // Bit 10 + int32_t ballId = (data->fields.seikaku & 0x000003E0) >> 5; // Bits 5-9 + int32_t seikaku = data->fields.seikaku & 0x0000001F; // Bits 0-4 + + if (ballId == 0) ballId = POKEBALL_BALLID; + + initialSpec->fields.monsno = monsNo; + initialSpec->fields.formno = formNo; + initialSpec->fields.level = (uint16_t)data->fields.level; + initialSpec->fields.rareRnd = 0x1ffffffff; + initialSpec->fields.id = (uint64_t)data->fields.trainerid; + initialSpec->fields.sex = (uint16_t)data->fields.sex; + initialSpec->fields.seikaku = (uint16_t)seikaku; + initialSpec->fields.tokuseiIndex = (uint8_t)tokusei; + initialSpec->fields.personalRnd = (uint64_t)data->fields.rand; + initialSpec->fields.randomSeed = (uint64_t)data->fields.rand; + initialSpec->fields.isRandomSeedEnable = true; + + if (ivFlag & 1) + { + if (initialSpec->fields.talentPower->max_length > HP_POWERID) initialSpec->fields.talentPower->m_Items[HP_POWERID] = (uint16_t)hpIV; + if (initialSpec->fields.talentPower->max_length > ATK_POWERID) initialSpec->fields.talentPower->m_Items[ATK_POWERID] = (uint16_t)atkIV; + if (initialSpec->fields.talentPower->max_length > DEF_POWERID) initialSpec->fields.talentPower->m_Items[DEF_POWERID] = (uint16_t)defIV; + if (initialSpec->fields.talentPower->max_length > SPATK_POWERID) initialSpec->fields.talentPower->m_Items[SPATK_POWERID] = (uint16_t)spAtkIV; + if (initialSpec->fields.talentPower->max_length > SPDEF_POWERID) initialSpec->fields.talentPower->m_Items[SPDEF_POWERID] = (uint16_t)spDefIV; + if (initialSpec->fields.talentPower->max_length > SPEED_POWERID) initialSpec->fields.talentPower->m_Items[SPEED_POWERID] = (uint16_t)speedIV; + } + + Pml::PokePara::PokemonParam_o * pokeParam = (Pml::PokePara::PokemonParam_o *) il2cpp_object_new(Pml::PokePara::PokemonParam_TypeInfo); + pokeParam->ctor(initialSpec, nullptr); + Pml::PokePara::CoreParam * coreParam = (Pml::PokePara::CoreParam *)pokeParam; + + Dpr::Message::MessageManager_o * messageManager = (Dpr::Message::MessageManager_o *) + SmartPoint::AssetAssistant::SingletonMonoBehaviour::get_Instance + (*SmartPoint::AssetAssistant::PTR_SingletonMonoBehaviour_MessageManager_get_Instance); + System::String* nickname = messageManager->GetNameMessage(System::String::CreateString("dp_scenario3"), data->fields.nickname_label, nullptr); + coreParam->SetNickName(nickname, nullptr); + + coreParam->SetItem(data->fields.itemno, nullptr); + + System::String* trainerName = messageManager->GetNameMessage(System::String::CreateString("dp_scenario3"), data->fields.name_label, nullptr); + coreParam->SetParentName(trainerName, nullptr); + + uint32_t language = LocalKoukan_Language(data->fields.language, nullptr); + coreParam->SetLangId(language, nullptr); + + coreParam->SetGetBall(ballId, nullptr); + + if (contestFlag & 1) + { + coreParam->SetCondition(0, 20, nullptr); + coreParam->SetCondition(1, 20, nullptr); + coreParam->SetCondition(2, 20, nullptr); + coreParam->SetCondition(3, 20, nullptr); + coreParam->SetCondition(4, 20, nullptr); + } + + for (int32_t i=0; ifields.waza->max_length && i<4; i++) + { + coreParam->SetWaza(i, data->fields.waza->m_Items[i], nullptr); + } + + Pml::PokePara::OwnerInfo_o * ownerInfo = (Pml::PokePara::OwnerInfo_o *) il2cpp_object_new(Pml::PokePara::OwnerInfo_TypeInfo); + ownerInfo->ctor(PlayerWork::get_playerStatus(nullptr), nullptr); + + coreParam->UpdateOwnerInfo(ownerInfo, nullptr); + poketool::poke_memo::poketool_poke_memo_o::ClearPlaceTime(coreParam, 0, nullptr); + poketool::poke_memo::poketool_poke_memo_o::SetPlaceTime(coreParam, 0x7531, 1, nullptr); + poketool::poke_memo::poketool_poke_memo_o::SetGetLevel(coreParam, nullptr); + poketool::poke_memo::poketool_poke_memo_o::SetVersion(coreParam, nullptr); + + bool isValid = coreParam->StartFastMode(nullptr); + coreParam->EndFastMode(isValid, nullptr); + + return pokeParam; +} diff --git a/src/patches/move_restoration.cpp b/src/patches/move_restoration.cpp index 0d94c6d4e..c310c44d4 100644 --- a/src/patches/move_restoration.cpp +++ b/src/patches/move_restoration.cpp @@ -1,11 +1,22 @@ +#include "Dpr/Battle/Logic/BTL_CLIENT.hpp" +#include "Dpr/Battle/Logic/BTLV_STRPARAM.hpp" #include "Dpr/Battle/Logic/Common.hpp" #include "Dpr/Battle/Logic/Calc.hpp" #include "Dpr/Battle/Logic/EventFactor.hpp" #include "Dpr/Battle/Logic/EventID.hpp" +#include "Dpr/Battle/Logic/FieldStatus.hpp" +#include "Dpr/Battle/Logic/GWaza.hpp" #include "Dpr/Battle/Logic/Handler.hpp" +#include "Dpr/Battle/Logic/MainModule.hpp" #include "Dpr/Battle/Logic/Tables.hpp" -#include "Dpr/Battle/Logic/StrParam.hpp" +#include "Dpr/Battle/Logic/Section_CureSick.hpp" #include "Dpr/Battle/Logic/Section_FromEvent_Message.hpp" +#include "Dpr/Battle/Logic/Section_FromEvent_RankReset.hpp" +#include "Dpr/Battle/Logic/Section_SideEffect_Add.hpp" +#include "Dpr/Battle/Logic/SICKCONT.hpp" +#include "Dpr/Battle/Logic/StrParam.hpp" +#include "Dpr/Battle/Logic/WAZADATA.hpp" +#include "Pml/Item/ItemData.hpp" #include "il2cpp-api.h" #include "il2cpp.hpp" @@ -34,6 +45,7 @@ const uint16_t WORK_ADRS = 68; const uint16_t AVOID_FLAG = 73; const uint16_t GEN_FLAG = 89; const uint16_t DISABLE_BURN_FLAG = 90; +const uint16_t SUCCESS_FLAG = 120; // Refer to EventVar.Label = CHECK_HIDE const uint16_t HIDE_FLY = 3; const uint16_t HIDE_DIG = 5; @@ -49,27 +61,44 @@ constexpr size_t BTL_STRID_STD_Magnitude6 = 124; constexpr size_t BTL_STRID_STD_Magnitude7 = 125; constexpr size_t BTL_STRID_STD_YubiWoFuru = 137; -constexpr uint32_t NUM_NEW_MOVES = 7; +constexpr uint32_t NUM_NEW_MOVES = 10; constexpr uint32_t NUM_KARAGENKI_MOVES = 2; -constexpr uint32_t NUM_YUBI_WO_FURU_MOVES = 1; +constexpr uint32_t NUM_YUBI_WO_FURU_MOVES = 0; // WazaNo constexpr int32_t JUMPKICK_WAZANO = 26; constexpr int32_t THUNDER_WAZANO = 87; constexpr int32_t HIJUMPKICK_WAZANO = 136; +constexpr int32_t STRUGGLE_WAZANO = 165; constexpr int32_t RETURN_WAZANO = 216; constexpr int32_t FRUSTRATION_WAZANO = 218; constexpr int32_t MAGNITUDE_WAZANO = 222; constexpr int32_t SILVERWIND_WAZANO = 318; constexpr int32_t SKYUPPERCUT_WAZANO = 327; constexpr int32_t OMINIOUSWIND_WAZANO = 466; +constexpr int32_t BELCH_WAZANO = 562; +constexpr int32_t GIGATON_HAMMER_WAZANO = 603; +constexpr int32_t GLITZY_GLOW_WAZANO = 736; +constexpr int32_t BADDY_BAD_WAZANO = 737; +constexpr int32_t FREEZY_FROST_WAZANO = 739; +constexpr int32_t SPARKLY_SWIRL_WAZANO = 740; +constexpr int32_t VEEVEE_VOLLEY_WAZANO = 741; +constexpr int32_t STUFF_CHEEKS_WAZANO = 747; constexpr uint32_t NUM_NEW_BTL_STRID_SET = 6; constexpr uint32_t NUM_NEW_BTL_STRID_STD = 6; constexpr uint32_t NUM_BTL_STRID_STD = 547; +constexpr uint16_t NULL_ITEM = 0; + +// SideEffectIDs +constexpr int32_t REFLECT_SIDE = 0; +constexpr int32_t LIGHT_SCREEN_SIDE = 1; + extern void * DAT_03a6bb14; extern MethodInfo * Handler_Karagenki_WazaPowMethodInfo; +extern Il2CppMethodPointer ADD_GensiNoTikara; + static uint32_t gMagnitude = 6; int32_t MAGNITUDE_POWER_TABLE[7] = { 10, @@ -81,6 +110,22 @@ int32_t MAGNITUDE_POWER_TABLE[7] = { 150, }; + +bool HandlerAddSideEffect(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, int32_t effect, int32_t side, BTL_SICKCONT_o cont) { + socket_log_fmt("HandlerAddSideEffect\n"); + + system_load_typeinfo((void *)0xa8ef); + auto *desc = (Section_SideEffect_Add_Description_o *) il2cpp_object_new(Section_SideEffect_Add_Description_TypeInfo); + desc->ctor(nullptr); + desc->fields.pokeID = pokeID; + desc->fields.effect = effect; + desc->fields.side = side; + desc->fields.cont = cont; + desc->fields.isReplaceSuccessMessageArgs0ByExpandSide = true; + return Common::AddSideEffect(args, &desc, nullptr); +} + + void handler_Return_WazaPow(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) { socket_log_fmt("handler_Return_WazaPow\n"); @@ -115,20 +160,22 @@ void handler_Frustration_WazaPow(EventFactor_EventHandlerArgs_o **args, uint8_t void handler_Magnitude_WazaPow(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) { - // TODO: Stubbed socket_log_fmt("handler_Magnitude_WazaPow\n"); - int32_t evPokeID = Common::GetEventVar(args, POKEID_ATK, (MethodInfo *) nullptr); - - if (evPokeID != pokeID) - { + if (Common::GetEventVar(args, POKEID_ATK, nullptr) != pokeID) return; - } - // gMagnitude = Pml::Local::Random::GetValue((MethodInfo *) nullptr) % 7; - socket_log_fmt("Magnitude: %08X\n", gMagnitude); - int32_t waza_power = MAGNITUDE_POWER_TABLE[gMagnitude]; - socket_log_fmt("waza_power: %08X\n", waza_power); - Common::RewriteEventVar(args, WAZA_POWER, waza_power, (MethodInfo *) nullptr); + uint32_t r = Calc::GetRand(20, nullptr); + int32_t power; + if (r < 1) power = 10; + else if (r < 3) power = 30; + else if (r < 7) power = 50; + else if (r < 13) power = 70; + else if (r < 17) power = 90; + else if (r < 19) power = 110; + else power = 150; + socket_log_fmt("power: %08X\n", power); + + Common::RewriteEventVar(args, WAZA_POWER, power, nullptr); } void handler_Magnitude_Msg(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) @@ -137,7 +184,6 @@ void handler_Magnitude_Msg(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID system_load_typeinfo((void *)0xa9bf); il2cpp_runtime_class_init(Common_TypeInfo); - // TODO: Stubbed socket_log_fmt("handler_Magnitude_Msg\n"); int32_t evPokeID = Common::GetEventVar(args, POKEID_ATK, (MethodInfo *) nullptr); @@ -153,7 +199,7 @@ void handler_Magnitude_Msg(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID socket_log_fmt("Section_FromEvent_Message::Description_o::ctor: %08X\n", &Section_FromEvent_Message::Description_o::ctor); socket_log_fmt("StrParam_o::Setup: %08X\n", &StrParam_o::Setup); - gMagnitude = Pml::Local::Random::GetValue((MethodInfo *) nullptr) % 7; + //gMagnitude = Pml::Local::Random::GetValue((MethodInfo *) nullptr) % 7; Section_FromEvent_Message::Description_o * desc = (Section_FromEvent_Message::Description_o *) il2cpp_object_new(Section_FromEvent_Message::Description_TypeInfo); desc->ctor((MethodInfo *) nullptr); desc->fields.pokeID = pokeID; @@ -168,15 +214,66 @@ void handler_Magnitude_Msg(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID // Common::RewriteEventVar(args, GEN_FLAG, 1, (MethodInfo *) nullptr); } +// Glitzy Glow +void HandlerGlitzyGlowDamageprocEndHitReal(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) { + if (Common::GetEventVar(args, POKEID_ATK, nullptr) != pokeID) + return; + + int32_t side = Common::PokeIDtoSide(args, &pokeID, nullptr); + BTL_SICKCONT_o sickCont = SICKCONT::MakeTurn(pokeID, 5, nullptr); + + Handler::Waza_o::common_SideEffectCore(args, pokeID, side, + LIGHT_SCREEN_SIDE, &sickCont, + 1, 145, side, true, nullptr); +} +// Baddy Bad +void HandlerBaddyBadDamageprocEndHitReal(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) { + if (Common::GetEventVar(args, POKEID_ATK, nullptr) != pokeID) + return; + + int32_t side = Common::PokeIDtoSide(args, &pokeID, nullptr); + BTL_SICKCONT_o sickCont = SICKCONT::MakeTurn(pokeID, 5, nullptr); + + Handler::Waza_o::common_SideEffectCore(args, pokeID, side, + REFLECT_SIDE, &sickCont, + 1, 141, side, true, nullptr); +} +// Freezy Frost +void HandlerFreezyFrostDamageprocEndHitReal(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) { + if (Common::GetEventVar(args, POKEID_ATK, nullptr) != pokeID) + return; + + HandlerRankResetAll(args, pokeID); +} +// Sparkly Swirl +void HandlerSparklySwirlDamageprocEndHitReal(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) { + if (Common::GetEventVar(args, POKEID_ATK, nullptr) != pokeID) + return; + + BTL_POKEPARAM_o * bpp = Common::GetPokeParam(args, pokeID, (MethodInfo *) nullptr); + uint32_t sick = bpp->GetPokeSick(nullptr); + + system_load_typeinfo((void *)0x893f); + Section_CureSick_Description_o* desc = (Section_CureSick_Description_o*) il2cpp_object_new(Section_CureSick_Description_TypeInfo); + desc->ctor(nullptr); + desc->fields.targetPokeCount = '\x01'; + desc->fields.targetPokeID->m_Items[0] = pokeID; + desc->fields.pokeID = pokeID; + desc->fields.sick = sick; + Common::CureSick(args, &desc, nullptr); + + Handler::Waza_o::common_CureFriendPokeSick(args, pokeID, true, true, nullptr); +} + int32_t KARAGENKI_ENTRIES[NUM_KARAGENKI_MOVES] = { RETURN_WAZANO, FRUSTRATION_WAZANO }; -int32_t YUBI_WO_FURU_ENTRIES[NUM_YUBI_WO_FURU_MOVES] = { +/*int32_t YUBI_WO_FURU_ENTRIES[NUM_YUBI_WO_FURU_MOVES] = { MAGNITUDE_WAZANO -}; +};*/ // 4c7a3b0 @@ -187,18 +284,24 @@ int32_t YUBI_WO_FURU_ENTRIES[NUM_YUBI_WO_FURU_MOVES] = { static System::Array * sReturnEventHandlerTable = nullptr; static System::Array * sFrustrationEventHandlerTable = nullptr; static System::Array * sMagnitudeEventHandlerTable = nullptr; +static System::Array * sHandlerTableGlitzyGlow = nullptr; +static System::Array * sHandlerTableBaddyBad = nullptr; +static System::Array * sHandlerTableFreezyFrost = nullptr; +static System::Array * sHandlerTableSparklySwirl = nullptr; const int16_t EVENT_ID_REQWAZA_MSG = 27; const int16_t EVENT_ID_WAZA_POWER = 70; +const int16_t EVENT_ID_WAZA_DMG_PROC3 = 90; +const int16_t EVENT_ID_DAMAGEPROC_END_HIT_REAL = 162; +const int16_t EVENT_ID_CHECK_POKE_HIDE = 189; // Dpr.Battle.Logic.Handler.Waza$$ System::Array * ADD_Return(MethodInfo *method) { socket_log_fmt("ADD_Return\n"); if (sReturnEventHandlerTable == nullptr) { - // socket_log_fmt("ADD_Return init\n"); - sReturnEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 1); - sReturnEventHandlerTable->m_Items[0] = createEventHandlerTable(EVENT_ID_WAZA_POWER, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &handler_Return_WazaPow); + sReturnEventHandlerTable = (System::Array *) CreateEventHandlerTable(1); + sReturnEventHandlerTable->m_Items[0] = CreateEventHandler(EVENT_ID_WAZA_POWER, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &handler_Return_WazaPow); } return sReturnEventHandlerTable; @@ -208,9 +311,8 @@ System::Array * ADD_Frustration(MethodInfo *m { socket_log_fmt("ADD_Frustration\n"); if (sFrustrationEventHandlerTable == nullptr) { - // socket_log_fmt("ADD_Frustration init\n"); - sFrustrationEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 1); - sFrustrationEventHandlerTable->m_Items[0] = createEventHandlerTable(EVENT_ID_WAZA_POWER, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &handler_Frustration_WazaPow); + sFrustrationEventHandlerTable = (System::Array *) CreateEventHandlerTable(1); + sFrustrationEventHandlerTable->m_Items[0] = CreateEventHandler(EVENT_ID_WAZA_POWER, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &handler_Frustration_WazaPow); } return sFrustrationEventHandlerTable; @@ -220,20 +322,55 @@ System::Array * ADD_Magnitude(MethodInfo *met { socket_log_fmt("ADD_Magnitude\n"); if (sMagnitudeEventHandlerTable == nullptr) { - // socket_log_fmt("ADD_Magnitude init\n"); - sMagnitudeEventHandlerTable = (System::Array *) system_array_new(EventFactor_EventHandlerTable_Array_TypeInfo, 2); - sMagnitudeEventHandlerTable->m_Items[0] = createEventHandlerTable(EVENT_ID_WAZA_POWER, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &handler_Magnitude_WazaPow); - sMagnitudeEventHandlerTable->m_Items[1] = createEventHandlerTable(EVENT_ID_REQWAZA_MSG, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &handler_Magnitude_Msg); + sMagnitudeEventHandlerTable = (System::Array *) CreateEventHandlerTable(3); + sMagnitudeEventHandlerTable->m_Items[0] = CreateEventHandler(EVENT_ID_WAZA_POWER, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &handler_Magnitude_WazaPow); + sMagnitudeEventHandlerTable->m_Items[1] = CreateEventHandler(EVENT_ID_WAZA_DMG_PROC3, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &Handler::Waza_o::handler_Jisin_damage); + sMagnitudeEventHandlerTable->m_Items[2] = CreateEventHandler(EVENT_ID_CHECK_POKE_HIDE, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &Handler::Waza_o::handler_Jisin_checkHide); } return sMagnitudeEventHandlerTable; } +System::Array * ADD_GlitzyGlow(MethodInfo *method) { + socket_log_fmt("ADD_GlitzyGlow\n"); + if (sHandlerTableGlitzyGlow == nullptr) { + sHandlerTableGlitzyGlow = (System::Array *) CreateEventHandlerTable(1); + sHandlerTableGlitzyGlow->m_Items[0] = CreateEventHandler(EVENT_ID_DAMAGEPROC_END_HIT_REAL, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &HandlerGlitzyGlowDamageprocEndHitReal); + } + return sHandlerTableGlitzyGlow; +} + +System::Array * ADD_BaddyBad(MethodInfo *method) { + socket_log_fmt("ADD_BaddyBad\n"); + if (sHandlerTableBaddyBad == nullptr) { + sHandlerTableBaddyBad = (System::Array *) CreateEventHandlerTable(1); + sHandlerTableBaddyBad->m_Items[0] = CreateEventHandler(EVENT_ID_DAMAGEPROC_END_HIT_REAL, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &HandlerBaddyBadDamageprocEndHitReal); + } + return sHandlerTableBaddyBad; +} + +System::Array * ADD_FreezyFrost(MethodInfo *method) { + socket_log_fmt("ADD_FreezyFrost\n"); + if (sHandlerTableFreezyFrost == nullptr) { + sHandlerTableFreezyFrost = (System::Array *) CreateEventHandlerTable(1); + sHandlerTableFreezyFrost->m_Items[0] = CreateEventHandler(EVENT_ID_DAMAGEPROC_END_HIT_REAL, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &HandlerFreezyFrostDamageprocEndHitReal); + } + return sHandlerTableFreezyFrost; +} + +System::Array * ADD_SparklySwirl(MethodInfo *method) { + socket_log_fmt("ADD_SparklySwirl\n"); + if (sHandlerTableSparklySwirl == nullptr) { + sHandlerTableSparklySwirl = (System::Array *) CreateEventHandlerTable(1); + sHandlerTableSparklySwirl->m_Items[0] = CreateEventHandler(EVENT_ID_DAMAGEPROC_END_HIT_REAL, Handler_Karagenki_WazaPowMethodInfo, (Il2CppMethodPointer) &HandlerSparklySwirlDamageprocEndHitReal); + } + return sHandlerTableSparklySwirl; +} + void AddHandler(System::Array * getFuncTable, uint32_t * idx, int32_t wazaNo, Il2CppMethodPointer methodPointer) { - MethodInfo * method = copyMethodInfo(Method_ADD_Karagenki, methodPointer); Waza_GET_FUNC_TABLE_ELEM_o * elem = &getFuncTable->m_Items[*idx]; socket_log_fmt("Got GET_FUNC_TABLE_ELEM at %i\n", *idx); @@ -257,6 +394,21 @@ void * Waza_system_array_new(void * typeInfo, uint32_t len) AddHandler(getFuncTable, &idx, FRUSTRATION_WAZANO, (Il2CppMethodPointer) &ADD_Frustration); socket_log_fmt("Magnitude idx: %08X\n", idx); AddHandler(getFuncTable, &idx, MAGNITUDE_WAZANO, (Il2CppMethodPointer) &ADD_Magnitude); + socket_log_fmt("Ominous Wind idx: %08X\n", idx); + AddHandler(getFuncTable, &idx, OMINIOUSWIND_WAZANO, (Il2CppMethodPointer) &ADD_GensiNoTikara); + socket_log_fmt("Silver Wind idx: %08X\n", idx); + AddHandler(getFuncTable, &idx, SILVERWIND_WAZANO, (Il2CppMethodPointer) &ADD_GensiNoTikara); + + socket_log_fmt("Glitzy Glow idx: %08X\n", idx); + AddHandler(getFuncTable, &idx, GLITZY_GLOW_WAZANO, (Il2CppMethodPointer) &ADD_GlitzyGlow); + socket_log_fmt("Baddy Bad idx: %08X\n", idx); + AddHandler(getFuncTable, &idx, BADDY_BAD_WAZANO, (Il2CppMethodPointer) &ADD_BaddyBad); + socket_log_fmt("Freezy Frost idx: %08X\n", idx); + AddHandler(getFuncTable, &idx, FREEZY_FROST_WAZANO, (Il2CppMethodPointer) &ADD_FreezyFrost); + socket_log_fmt("Sparkly Swirl idx: %08X\n", idx); + AddHandler(getFuncTable, &idx, SPARKLY_SWIRL_WAZANO, (Il2CppMethodPointer) &ADD_SparklySwirl); + socket_log_fmt("Veevee Volley idx: %08X\n", idx); + AddHandler(getFuncTable, &idx, VEEVEE_VOLLEY_WAZANO, (Il2CppMethodPointer) &ADD_Return); return getFuncTable; } @@ -281,4 +433,139 @@ void * BTL_STRID_STD_system_array_new(void * typeInfo, uint32_t len) btl_strid_std_label->m_Items[BTL_STRID_STD_Magnitude6] = *System::String::CreateString("BTL_STRID_STD_Magnitude6"); btl_strid_std_label->m_Items[BTL_STRID_STD_Magnitude7] = *System::String::CreateString("BTL_STRID_STD_Magnitude7"); return arrayPtr; +} + + +// Gigaton Hammer stuff +bool SetupBTLV_STRPARAM(BTLV_STRPARAM_o *strParam, uint16_t strID, uint8_t strType, const int32_t args[], uint64_t argCnt) { + if (strParam == nullptr) + return true; + + strParam->fields.strType = strType; + strParam->fields.strID = strID; + strParam->fields.wait = 0; + System_Int32_array *oldArgs = strParam->fields.args; + + for (uint64_t i = 0; i < oldArgs->max_length; ++i) + oldArgs->m_Items[i] = 0; + + if (oldArgs->max_length < argCnt) + argCnt = oldArgs->max_length; + + strParam->fields.argCnt = argCnt; + + for (uint64_t i = 0; i < argCnt; ++i) + oldArgs->m_Items[i] = args[i]; + + return true; +} + +bool Dpr_Battle_Logic_BTL_CLIENT_is_unselectable_waza(BTL_CLIENT_o *bc, BTL_POKEPARAM_o *bpp, int32_t waza, BTLV_STRPARAM_o *strParam, MethodInfo *method) { + system_load_typeinfo((void *)0x1ebc); + + if (waza == STRUGGLE_WAZANO) + return false; + + if (!WAZADATA::IsValid(waza, nullptr)) { + int32_t args[] = {}; + return SetupBTLV_STRPARAM(strParam, 0x1fc, 1, args, sizeof(args) / sizeof(*args)); + } + + FieldStatus_o **fldSim = &bc->fields.m_fldSim; + uint16_t effItem = bpp->GetItemEffective(fldSim, nullptr); + + if (effItem != NULL_ITEM) { + if (bpp->CheckSick(0x1c, nullptr) && !bpp->IsGMode(nullptr) && !GWaza::IsGWaza(waza, nullptr) && Tables::IsKodawariItem(effItem, nullptr)) { + BTL_SICKCONT_o cont = bpp->GetSickCont(0x1c, nullptr); + uint16_t lockMove = SICKCONT::GetParam(&cont, nullptr); + + if (lockMove != waza && bpp->WAZA_IsUsable(lockMove, nullptr)) { + int32_t args[] = { effItem, lockMove }; + return SetupBTLV_STRPARAM(strParam, 0x71, 1, args, sizeof(args) / sizeof(*args)); + } + } + + if (effItem == 0x280 && !WAZADATA::IsDamage(waza, nullptr)) { + int32_t args[] = { 0x280 }; + return SetupBTLV_STRPARAM(strParam, 0x72, 1, args, sizeof(args) / sizeof(*args)); + } + } + + if (bpp->GetValue(20, nullptr) == 0xff && bpp->CheckSick(0x1c, nullptr) && !bpp->IsGMode(nullptr) && !GWaza::IsGWaza(waza, nullptr)) { + BTL_SICKCONT_o cont = bpp->GetSickCont(0x1c, nullptr); + uint16_t lockMove = SICKCONT::GetParam(&cont, nullptr); + + if (lockMove != waza && bpp->WAZA_IsUsable(lockMove, nullptr)) { + int32_t args[] = { bpp->GetID(nullptr), lockMove }; + return SetupBTLV_STRPARAM(strParam, 0x73, 1, args, sizeof(args) / sizeof(*args)); + } + } + + if (bpp->CheckSick(0x17, nullptr)) { + BTL_SICKCONT_o cont = bpp->GetSickCont(0x17, nullptr); + uint16_t lockMove = SICKCONT::GetParam(&cont, nullptr); + + if (lockMove != waza && !GWaza::IsGWaza(waza, nullptr)) { + int32_t args[] = { bpp->GetID(nullptr), lockMove }; + return SetupBTLV_STRPARAM(strParam, 0x73, 1, args, sizeof(args) / sizeof(*args)); + } + } + + if (bpp->CheckSick(0xb, nullptr) && !WAZADATA::IsDamage(waza, nullptr)) { + int32_t args[] = { bpp->GetID(nullptr), waza }; + return SetupBTLV_STRPARAM(strParam, 0x302, 2, args, sizeof(args) / sizeof(*args)); + } + + if (bpp->CheckSick(0xc, nullptr) && bpp->fields.m_prevSelectWazaID == waza && !bpp->IsGMode(nullptr)) { + int32_t args[] = { bpp->GetID(nullptr), waza }; + return SetupBTLV_STRPARAM(strParam, 0x30e, 2, args, sizeof(args) / sizeof(*args)); + } + + if (bpp->CheckSick(0xd, nullptr) && bpp->GetSickParam(0xd, nullptr) == waza && !GWaza::IsGWaza(waza, nullptr)) { + int32_t args[] = { bpp->GetID(nullptr), waza }; + return SetupBTLV_STRPARAM(strParam, 0x322, 2, args, sizeof(args) / sizeof(*args)); + } + + if (bpp->CheckSick(0xf, nullptr) && WAZADATA::GetFlag(waza, 0xc, nullptr)) { + int32_t args[] = { bpp->GetID(nullptr), waza }; + return SetupBTLV_STRPARAM(strParam, 0x4b4, 2, args, sizeof(args) / sizeof(*args)); + } + + if ((*fldSim)->CheckEffect(3, nullptr) && !bpp->IsGMode(nullptr) && bc->fields.m_fldSim->CheckFuin(&bc->fields.m_mainModule, bc->fields.m_pBattleEnv->fields.m_pokecon, bpp, waza, nullptr)) { + int32_t args[] = { bpp->GetID(nullptr), waza }; + return SetupBTLV_STRPARAM(strParam, 0x31a, 2, args, sizeof(args) / sizeof(*args)); + } + + if ((*fldSim)->CheckEffect(2, nullptr) && !bpp->IsGMode(nullptr) && WAZADATA::GetFlag(waza, 9, nullptr)) { + int32_t args[] = { bpp->GetID(nullptr), waza }; + return SetupBTLV_STRPARAM(strParam, 0x5c0, 2, args, sizeof(args) / sizeof(*args)); + } + + if (waza == STUFF_CHEEKS_WAZANO && !Pml::Item::ItemData::IsNuts(bpp->GetItem(nullptr), nullptr)) { + int32_t args[] = { bpp->GetID(nullptr) }; + return SetupBTLV_STRPARAM(strParam, 0x199, 1, args, sizeof(args) / sizeof(*args)); + } + + if (waza == BELCH_WAZANO && !bpp->PERMFLAG_Get(0, nullptr)) { + int32_t args[] = { bpp->GetID(nullptr) }; + return SetupBTLV_STRPARAM(strParam, 0x648, 2, args, sizeof(args) / sizeof(*args)); + } + + if (bc->fields.m_mainModule->IsSkyBattle(nullptr) && WAZADATA::GetFlag(waza, 0xe, nullptr)) { + int32_t args[] = {}; + return SetupBTLV_STRPARAM(strParam, 0x110, 1, args, sizeof(args) / sizeof(*args)); + } + + if (bpp->CheckSick(0x18, nullptr) && !bpp->IsGMode(nullptr) && WAZADATA::GetFlag(waza, 8, nullptr)) { + int32_t args[] = { bpp->GetID(nullptr) }; + return SetupBTLV_STRPARAM(strParam, 0x744, 2, args, sizeof(args) / sizeof(*args)); + } + + if (waza == GIGATON_HAMMER_WAZANO && bpp->fields.m_prevSelectWazaID == waza) { + int32_t args[] = { bpp->GetID(nullptr), waza }; + return SetupBTLV_STRPARAM(strParam, 1926, 2, args, sizeof(args) / sizeof(*args)); + return true; + } + + return false; } \ No newline at end of file diff --git a/src/patches/pickup.cpp b/src/patches/pickup.cpp new file mode 100644 index 000000000..b171f1ad1 --- /dev/null +++ b/src/patches/pickup.cpp @@ -0,0 +1,49 @@ +#include "il2cpp.hpp" + +#include "GameData/DataManager.hpp" +#include "System/Array.hpp" +#include "UnityEngine/Random.hpp" +#include "XLSXContent/MonohiroiTable.hpp" + +#include "util.hpp" +#include "logger.hpp" + +uint16_t GetPickupItem(uint32_t level, MethodInfo *method) +{ + socket_log_fmt("Generating a Pickup Item at level %d\n", level); + system_load_typeinfo((void *)0x3f4d); + + if (level > 100) + { + return 0; + } + + System::Array* pickupTable = GameData::DataManager_TypeInfo->static_fields->MonohiroiTable->fields.MonoHiroi; + uint32_t tableIndex = getLevelCapIndexOfLevel(level); + + if (tableIndex >= pickupTable->m_Items[0]->fields.Ratios->max_length) + { + // Use the last column if we go over the end of the table + tableIndex = pickupTable->m_Items[0]->fields.Ratios->max_length - 1; + } + + int32_t ratioTotal = 0; + for (int32_t i=0; imax_length; i++) + { + ratioTotal += pickupTable->m_Items[i]->fields.Ratios->m_Items[tableIndex]; + } + + int32_t randomRoll = UnityEngine::Random::Range(1, ratioTotal+1, nullptr); + int32_t ratio = 0; + for (int32_t i=0; imax_length; i++) + { + ratio += pickupTable->m_Items[i]->fields.Ratios->m_Items[tableIndex]; + if (randomRoll <= ratio) + { + socket_log_fmt("Returning item %d\n", pickupTable->m_Items[i]->fields.ID); + return pickupTable->m_Items[i]->fields.ID; + } + } + + return 0; +} diff --git a/src/patches/pla_context_menu.cpp b/src/patches/pla_context_menu.cpp index e6b9b99bb..2d9470b2b 100644 --- a/src/patches/pla_context_menu.cpp +++ b/src/patches/pla_context_menu.cpp @@ -11,6 +11,7 @@ #include "Dpr/EvScript/EvDataManager.hpp" #include "PlayerWork.hpp" #include "Pml/Local/Random.h" +#include "SmartPoint/AssetAssistant/SingletonMonoBehavior.hpp" #include "Dpr/EncountTools.hpp" const int32_t QUIVER_DANCE = 483; @@ -353,18 +354,6 @@ namespace Dpr } } -namespace SmartPoint -{ - namespace AssetAssistant - { - struct SingletonMonoBehaviour - { - static void * get_Instance(MethodInfo * method); - }; - extern MethodInfo ** PTR_SingletonMonoBehaviour_UIManager_get_Instance; - } -} - struct System_Func_string__SoftwareKeyboard_ErrorState__ValueTuple_bool__string___o { // 0x02ab3f30 @@ -842,4 +831,4 @@ bool IsPushButton_Patch(UIWindow_o *__this,int32_t button,bool isForce,MethodInf } return false; -} \ No newline at end of file +} diff --git a/src/patches/repel_fix.cpp b/src/patches/repel_fix.cpp index 7ad6b9ab7..b234e8837 100644 --- a/src/patches/repel_fix.cpp +++ b/src/patches/repel_fix.cpp @@ -1,9 +1,19 @@ #include "il2cpp.hpp" + #include "Dpr/EvScript/EvDataManager.hpp" +#include "ItemWork.hpp" +#include "PlayerWork.hpp" #include "System/String.hpp" + #include "logger.hpp" #include "util.hpp" +const int32_t REPEL_ITEM_ID = 79; +const int32_t SUPER_REPEL_ITEM_ID = 76; +const int32_t MAX_REPEL_ITEM_ID = 77; + +const int32_t INFINITE_REPEL_FLAG = 2195; + // Dpr.EvScript.EvDataManager$$ bool JumpLabel(Dpr::EvScript::EvDataManager_o *__this, System::String *label, Dpr::EvScript::EventEndDelegate_o *callback, MethodInfo *method) @@ -16,4 +26,22 @@ bool JumpLabel(Dpr::EvScript::EvDataManager_o *__this, System::String *label, } return false; -} \ No newline at end of file +} + +bool EncDataSave_CanUseSpray(MethodInfo *method) +{ + system_load_typeinfo((void *)0x3f33); + + DPData::ENC_SV_DATA_o encData = PlayerWork::get_Enc_SV_Data(nullptr, nullptr); + bool repelRemaining = encData.fields.SprayCount > 0; + bool infiniteRepelOn = PlayerWork::GetBool(INFINITE_REPEL_FLAG, nullptr); + return repelRemaining || infiniteRepelOn; + +} + +bool IsUseSpray(uint16_t *itemno, MethodInfo *method) +{ + bool isRegularRepelInUse = ItemWork::IsUseSpray(itemno, nullptr); + bool infiniteRepelOn = PlayerWork::GetBool(INFINITE_REPEL_FLAG, nullptr); + return isRegularRepelInUse || infiniteRepelOn; +} diff --git a/src/patches/shiny.cpp b/src/patches/shiny.cpp index 7d42b0139..39aa26579 100644 --- a/src/patches/shiny.cpp +++ b/src/patches/shiny.cpp @@ -1,56 +1,47 @@ #include "Pml/PokePara/InitialSpec.hpp" -#include "Pml/PokePara/CalcTool.h" -#include "Pml/PokePara/Factory.hpp" -#include "Pml/Local/Random.h" -#include "Pml/Local/RandomGenerator.hpp" -#include "Pml/Personal/PersonalSystem.hpp" -#include "Pml/Personal/PersonalTableExtensions.hpp" +#include "ItemWork.hpp" #include "il2cpp-api.h" #include "util.hpp" -uint32_t Pml_Local_Random_GetValue_Hook(Pml::PokePara::InitialSpec_o * pFixSpec) -{ - uint32_t rareTryCount = pFixSpec->fields.rareTryCount; - uint32_t rareRnd = 0; - uint32_t id = pFixSpec->fields.id; +const int32_t SHINY_CHARM_ID = 0x278; - rareTryCount += 8; +extern void* System_UInt16_array_TypeInfo; - for (uint32_t i = 0; i < rareTryCount; i++) +uint8_t ShinyRolls() { + uint8_t rolls = 8; + + Dpr::Item::ItemInfo_o * item = ItemWork::GetItemInfo(SHINY_CHARM_ID, nullptr); + if (item != nullptr && item->get_count(nullptr) > 0) { - rareRnd = Pml::Local::Random::GetValue((MethodInfo *) nullptr); - - if (Pml::PokePara::CalcTool::IsRareColor(id, rareRnd, (MethodInfo *) nullptr)) - { - break; - } + rolls += 2; } - // Make sure that we don't keep looping - pFixSpec->fields.rareTryCount = 0; - return rareRnd; + return rolls; } -uint32_t Pml_Local_RandomGenerator_GetRand_Hook(Pml::Local::RandomGenerator_o * rng, Pml::PokePara::InitialSpec_o * pFixSpec) -{ - uint32_t rareTryCount = pFixSpec->fields.rareTryCount; - uint32_t rareRnd = 0; - uint32_t id = pFixSpec->fields.id; - - rareTryCount += 8; - - for (uint32_t i = 0; i < rareTryCount; i++) - { - rareRnd = rng->GetRand((MethodInfo *) nullptr); - - if (Pml::PokePara::CalcTool::IsRareColor(id, rareRnd, (MethodInfo *) nullptr)) - { - break; - } +void Shiny_InitialSpec_ctor(Pml::PokePara::InitialSpec_o* __this) { + system_load_typeinfo((void *)0x53c4); + + __this->fields.id = 0xffffffffffffffff; + __this->fields.personalRnd = 0xffffffffffffffff; + __this->fields.rareRnd = 0x3ffffffff; + __this->fields.monsno = 0x1ee; + __this->fields.formno = 0; + __this->fields.level = 1; + __this->fields.sex = 0xff; + __this->fields.seikaku = 0xffff; + __this->fields.tokuseiIndex = 0xff; + __this->fields.rareTryCount = ShinyRolls(); + __this->fields.randomSeed = 0; + __this->fields.isRandomSeedEnable = '\0'; + __this->fields.weight = 0x100; + __this->fields.height = 0x100; + __this->fields.friendship = 0xffff; + __this->fields.talentVNum = '\0'; + + __this->fields.talentPower = (System_UInt16_array *)system_array_new(System_UInt16_array_TypeInfo, 6); + for (int i=0; i<6; i++) { + __this->fields.talentPower->m_Items[i] = 0xFFFF; } - - pFixSpec->fields.rareTryCount = 0; - - return rareRnd; -} +} \ No newline at end of file diff --git a/src/patches/shiny_eggs.cpp b/src/patches/shiny_eggs.cpp new file mode 100644 index 000000000..437d63e38 --- /dev/null +++ b/src/patches/shiny_eggs.cpp @@ -0,0 +1,56 @@ +#include "Pml/PokePara/CoreParam.h" + +#include "il2cpp-api.h" +#include "util.hpp" +#include "logger.hpp" + +const int32_t MANAPHY_MONSNO = 490; + +int32_t MakeUniqueID(int32_t monsNo, int32_t formNo, uint8_t sex, bool isRare, bool isEgg) +{ + if (isEgg) + { + if (monsNo == MANAPHY_MONSNO) + { + return 120 + (isRare ? 1 : 0); + } + else + { + return 20 + (isRare ? 1 : 0); + } + } + else + { + return (monsNo * 10000) + (formNo * 100) + (sex * 10) + (isRare ? 1 : 0); + } +} + + +int32_t DataManager_GetUniqueID1(int32_t monsNo, int32_t formNo, uint8_t sex, bool isRare, bool isEgg) +{ + return MakeUniqueID(monsNo, formNo, sex, isRare, isEgg); +} + +int32_t DataManager_GetUniqueID2(Pml::PokePara::CoreParam* pokemonParam) +{ + system_load_typeinfo((void *)0x3435); + + if (pokemonParam == nullptr) + return 0; + + return MakeUniqueID(pokemonParam->GetMonsNo(nullptr), pokemonParam->GetFormNo(nullptr), pokemonParam->GetSex(nullptr), pokemonParam->GetRareType(nullptr) != 0, pokemonParam->IsEgg(2, nullptr)); +} + +int32_t DataManager_GetUniqueID3(int32_t monsNo, int32_t formNo, uint8_t sex, uint8_t rareType, bool isEgg) +{ + system_load_typeinfo((void *)0x3436); + + return MakeUniqueID(monsNo, formNo, sex, rareType != 0, isEgg); +} + + +bool Allow_Release_Egg() +{ + // Never is an egg + return false; +} diff --git a/src/patches/static_held_items.cpp b/src/patches/static_held_items.cpp new file mode 100644 index 000000000..8cc30bb66 --- /dev/null +++ b/src/patches/static_held_items.cpp @@ -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); +} diff --git a/src/patches/thief_patch.cpp b/src/patches/thief_patch.cpp new file mode 100644 index 000000000..66314d21c --- /dev/null +++ b/src/patches/thief_patch.cpp @@ -0,0 +1,134 @@ +#include "il2cpp.hpp" +#include "il2cpp-api.h" +#include "Dpr/Battle/Logic/BTL_POKEPARAM.hpp" +#include "Dpr/Battle/Logic/Common.hpp" +#include "Dpr/Battle/Logic/Calc.hpp" +#include "Dpr/Battle/Logic/EventFactor.hpp" +#include "Dpr/Battle/Logic/EventID.hpp" +#include "Dpr/Battle/Logic/EventSystem.hpp" +#include "Dpr/Battle/Logic/Handler.hpp" +#include "Dpr/Battle/Logic/Tables.hpp" +#include "Dpr/Battle/Logic/Section_FromEvent_SetItem_Description.hpp" +#include "Dpr/Battle/Logic/Section_FromEvent_SetWazaEffectIndex_Description_o.hpp" +#include "Dpr/Battle/Logic/Section_FromEvent_SwapItem_Description.hpp" +#include "ItemWork.hpp" + +#include "util.hpp" +#include "logger.hpp" + +// EventVar.Label +const uint16_t POKEID = 2; +const uint16_t POKEID_ATK = 3; +const uint16_t POKEID_TARGET1 = 6; + +using namespace Dpr::Battle::Logic; + +// Changes the handler for Thief to put the item into the player's bag. +void HandlerDorobou(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) +{ + socket_log_fmt("HandlerDorobou\n"); + + system_load_typeinfo((void *)0xa92f); + system_load_typeinfo((void *)0xa965); + system_load_typeinfo((void *)0x43b9); + system_load_typeinfo((void *)0x43ba); + il2cpp_runtime_class_init(Common_TypeInfo); + + // Check that we're looking at the attacking pokémon. + uint attackingPoke = Common::GetEventVar(args, POKEID_ATK, nullptr); + if (attackingPoke == pokeID) + { + // Check that the attacking pokémon is not holding an item. + bool attackerHasNoItem = Common::Dorobou_CheckEnable(args, pokeID, nullptr); + if (attackerHasNoItem) + { + // Check the target?? + uint targetPoke = Common::GetEventVar(args, POKEID_TARGET1, nullptr); + if ((targetPoke & 0xff) != 0x1f) + { + // Check if the target is holding an item. + BTL_POKEPARAM_o* targetPokeParam = Common::GetPokeParam(args, (uint8_t)targetPoke, nullptr); + uint16_t item = targetPokeParam->GetItem(nullptr); + if (item != 0) + { + // Check if the item can be thieved. (Form change items, wild pokémon using the move, etc.) + bool cantSteal = Common::CheckCantStealPoke(args, pokeID, (uint8_t)targetPoke, nullptr); + if (!cantSteal) + { + if (Common::GetCompetitor(args, nullptr) != 0) // Is a trainer + { + Section_FromEvent_SwapItem_Description_o* swapItemDesc = (Section_FromEvent_SwapItem_Description_o *) il2cpp_object_new(Section_FromEvent_SwapItem_Description_TypeInfo); + swapItemDesc->ctor(nullptr); + swapItemDesc->fields.userPokeID = pokeID; + swapItemDesc->fields.targetPokeID = (uint8_t)targetPoke; + swapItemDesc->fields.isIncRecordCount_StealItemFromWildPoke = true; + + swapItemDesc->fields.successMessage1->Setup(2, 0x598, nullptr); + swapItemDesc->fields.successMessage1->AddArg(attackingPoke, nullptr); + swapItemDesc->fields.successMessage1->AddArg(targetPoke & 0xff, nullptr); + swapItemDesc->fields.successMessage1->AddArg(item, nullptr); + + bool swapped = Common::SwapItem(args, &swapItemDesc, nullptr); + if (swapped) + { + Section_FromEvent_SetWazaEffectIndex_Description_o* setWazaDesc = (Section_FromEvent_SetWazaEffectIndex_Description_o *) il2cpp_object_new(Section_FromEvent_SetWazaEffectIndex_Description_TypeInfo); + setWazaDesc->ctor(nullptr); + setWazaDesc->fields.effectIndex = 1; + Common::SetWazaEffectIndex(args, &setWazaDesc, nullptr); + } + } + else // Is wild + { + Section_FromEvent_SetItem_Description_o* setItemDesc = (Section_FromEvent_SetItem_Description_o *) il2cpp_object_new(Section_FromEvent_SetItem_Description_TypeInfo); + setItemDesc->ctor(nullptr); + setItemDesc->fields.userPokeID = pokeID; + setItemDesc->fields.targetPokeID = (uint8_t)targetPoke; + setItemDesc->fields.itemID = 0; + + setItemDesc->fields.successMessage->Setup(2, 0x598, nullptr); + setItemDesc->fields.successMessage->AddArg(attackingPoke, nullptr); + setItemDesc->fields.successMessage->AddArg(targetPoke & 0xff, nullptr); + setItemDesc->fields.successMessage->AddArg(item, nullptr); + + bool itemSet = Common::SetItem(args, &setItemDesc, nullptr); + if (itemSet) + { + if (ItemWork::IsAddItem(item, 1, nullptr)) + { + ItemWork::AddItem(item, 1, nullptr); + } + } + } + } + } + } + } + } +} + +// Remove the check for if the attacking Pokémon is holding an item (for wilds) +bool Dorobou_CheckEnable(EventFactor_EventHandlerArgs_o **args, uint8_t pokeID, MethodInfo *method) +{ + BTL_POKEPARAM_o *pokeparam = (*args)->fields.pBattleEnv->fields.m_pokecon->GetPokeParamConst(pokeID, nullptr); + uint16_t item = pokeparam->GetItem(nullptr); + + if (Common::GetCompetitor(args, nullptr) != 0) // Is a trainer + { + // Keep default behavior (true if attacking poke has no item) + System_Int32_array *work = (*args)->fields.pMyFactor->fields.m_data->fields.work; + if (work->max_length > 0) + { + if (work->m_Items[0] != 0) + { + return false; + } + } + + return item == 0; + } + else // Is wild + { + // Always set to true (attacking poke has no item) + return true; + } +} diff --git a/src/patches/trainer_double_battle.cpp b/src/patches/trainer_double_battle.cpp index cce2d8c2c..387351bdb 100644 --- a/src/patches/trainer_double_battle.cpp +++ b/src/patches/trainer_double_battle.cpp @@ -2,15 +2,19 @@ #include "logger.hpp" #include "il2cpp-api.h" #include "Dpr/Battle/Logic/Setup.hpp" +#include "Dpr/EncountTools.hpp" #include "PlayerWork.hpp" -void BTL_SETUP_Trainer(Dpr::Battle::Logic::BATTLE_SETUP_PARAM_o *bp, Pml::PokeParty_o *playerParty,int32_t trID, - Dpr::Battle::Logic::BTL_FIELD_SITUATION_o *sit, int32_t rule, MethodInfo *method) +const int32_t BTL_RULE_SINGLE = 0; +const int32_t BTL_RULE_DOUBLE = 1; + + +void Dpr_EncountTools_SetupBattleTrainer(Dpr_Battle_Logic_BATTLE_SETUP_PARAM_o *battleSetupParam, int32_t arenaID, + int32_t mapAttrib, int32_t weatherType, int32_t rule, int32_t enemyID0, int32_t enemyID1, int32_t partnerID, MethodInfo *method) { - const int32_t BTL_RULE_DOUBLE = 1; if (PlayerWork::GetBool(2196, (MethodInfo *) nullptr)) { rule = BTL_RULE_DOUBLE; } - Dpr::Battle::Logic::Setup::BTL_SETUP_Trainer(bp, playerParty, trID, sit, rule, (MethodInfo *) nullptr); -} \ No newline at end of file + Dpr::EncountTools::SetupBattleTrainer(battleSetupParam, arenaID, mapAttrib, weatherType, rule, enemyID0, enemyID1, partnerID, method); +} diff --git a/src/patches/validity_checks.cpp b/src/patches/validity_checks.cpp new file mode 100644 index 000000000..b316d8a8b --- /dev/null +++ b/src/patches/validity_checks.cpp @@ -0,0 +1,44 @@ +#include "il2cpp.hpp" + +#include "Pml/PokePara/Accessor.h" +#include "Pml/PokePara/PokemonParam.h" +#include "Pml/PokePara/CoreParam.h" + +#include "logger.hpp" + +struct System_Collections_Generic_List_PokemonParam__o; +namespace Pml { + namespace PokePara { + struct CoreDataHeader_Fields { + uint32_t personalRnd; + uint16_t _bitsA; + uint16_t checksum; + }; + + struct CoreDataHeader { + CoreDataHeader_Fields fields; + }; + } +} + +bool GetDprIllegalFlag(Pml::PokePara::Accessor *__this, MethodInfo *method) +{ + // Always return valid + return false; +} + +bool IsDuplicatedPokemonParam(Pml::PokePara::PokemonParam_o *pp0, System_Collections_Generic_List_PokemonParam__o *checkedParams, MethodInfo *method) +{ + // Always return valid + return false; +} + +void SetDprIllegalFlag(Pml::PokePara::Accessor *__this, bool flag, MethodInfo *method) +{ + // Do Nothing +} + +void set_fuseiTamagoFlag(Pml::PokePara::CoreDataHeader __this, bool value, MethodInfo *method) +{ + // Do Nothing +} diff --git a/src/patches/wild_form.cpp b/src/patches/wild_form.cpp index 3016e6467..2dcaea395 100644 --- a/src/patches/wild_form.cpp +++ b/src/patches/wild_form.cpp @@ -1,56 +1,10 @@ #include "il2cpp.hpp" #include "System/Array.hpp" +#include "Dpr/Field/EncountResult.hpp" +#include "Dpr/Field/FieldEncount/ENC_FLD_SPA.hpp" #include "logger.hpp" #include "util.hpp" -namespace Dpr -{ - namespace Field - { - struct EncountResult_Fields { - int32_t Type; - System::Array * Enemy; // struct Pml_MonsNo_array* - System::Array * Level; - System::Array * FixSex; // struct Pml_Sex_array* - System::Array * FixSeikaku; // struct Pml_PokePara_Seikaku_array* - bool IsRare; - int32_t Partner; - int32_t HatudouTokusei; - int32_t BattleBG; - int32_t MP_SaveIndex; - bool IsKakure; - int32_t karanaForm; - int32_t annoForm; - }; - - struct EncountResult_c; - - struct EncountResult_o { - EncountResult_c *klass; - void *monitor; - EncountResult_Fields fields; - }; - - namespace FieldEncount - { - struct ENC_FLD_SPA_Fields { - int32_t TrainerID; - bool SprayCheck; - bool EncCancelSpInvalid; - int32_t SpMyLv; - bool Egg; - int32_t Spa; - System::Array * FormProb; - int32_t AnnoonTblType; - }; - - struct ENC_FLD_SPA_o { - ENC_FLD_SPA_Fields fields; - }; - } - } -} - struct FieldManager_o { uint16_t GetFormNo(int32_t mons, int32_t karana, int32_t anno, MethodInfo *method); @@ -129,4 +83,4 @@ uint16_t GetFormNo1(FieldManager_o *__this, int32_t mons, int32_t karana, int32_ } return __this->GetFormNo(mons, karana, anno, method); -} \ No newline at end of file +} diff --git a/src/util.cpp b/src/util.cpp index 28a337625..c5f0f27b7 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,6 +1,10 @@ #include "util.hpp" #include "il2cpp-api.h" #include "PlayerWork.hpp" +#include "Dpr/Battle/Logic/Common.hpp" +#include "Dpr/Battle/Logic/Section_FromEvent_Message.hpp" +#include "Dpr/Battle/Logic/Section_FromEvent_RankReset.hpp" +#include "logger.hpp" void system_load_typeinfo(void * typeInfo) @@ -44,14 +48,175 @@ uint32_t GetBadgeCount() (bVar7 & 1) + (bVar8 & 1); } -Dpr::Battle::Logic::EventFactor_EventHandlerTable_o * createEventHandlerTable(uint16_t eventID, MethodInfo * src, Il2CppMethodPointer methodPointer) +uint32_t getLevelCapIndex() +{ + constexpr size_t NUM_FLAGS = 1; + constexpr size_t NUM_SYS_FLAGS = 1; + constexpr size_t NUM_WORK_VALUES = 2; + uint32_t numEvents = GetBadgeCount(); + + uint32_t flags[NUM_FLAGS] = { + 2770 // Beating Cyrus at spear pillar + }; + + uint32_t sysflags[NUM_SYS_FLAGS] = { + 5 // Game clear + }; + + uint32_t works[NUM_WORK_VALUES] = { + 71, // WK_SCENE_R205A, Beating Mars at Valley Windworks + 54 // WK_SCENE_C02, Beating Barry at Canalave + }; + + uint32_t workMins[NUM_WORK_VALUES] = { + 2, // WK_SCENE_R205A, Beating Mars at Valley Windworks + 1 // WK_SCENE_C02, Beating Barry at Canalave + }; + + for (size_t i = 0; i < NUM_FLAGS; i++) + { + if (PlayerWork::GetBool(flags[i], nullptr)) + { + numEvents += 1; + } + } + + for (size_t i = 0; i < NUM_SYS_FLAGS; i++) + { + if (PlayerWork::GetSytemFlag(sysflags[i], nullptr)) + { + numEvents += 1; + } + } + + for (size_t i = 0; i < NUM_WORK_VALUES; i++) + { + if (PlayerWork::GetInt(works[i], nullptr) >= workMins[i]) + { + numEvents += 1; + } + } + + return numEvents; +} + +uint32_t getMaxLevelOfCapIndex(uint32_t index) +{ + switch (index) + { + case 0: // Roark + return 16; + case 1: // Valley Windworks + return 19; + case 2: // Gardenia + return 26; + case 3: // Fantina + return 33; + case 4: // Maylene + return 39; + case 5: // Crasher Wake + return 44; + case 6: // Canalave Barry + return 49; + case 7: // Byron + return 53; + case 8: // Candice + return 56; + case 9: // Spear Pillar + return 60; + case 10: // Volkner + return 62; + case 11: // Cynthia + return 78; + case 12: // Stark Mountain + return 85; + default: // Max + return 100; + } +} + +uint32_t getMaxLevel() +{ + uint32_t index = getLevelCapIndex(); + return getMaxLevelOfCapIndex(index); +} + +uint32_t getLevelCapIndexOfLevel(uint32_t level) +{ + uint32_t i = 0; + uint32_t levelOfCap = 0; + do + { + levelOfCap = getMaxLevelOfCapIndex(i); + socket_log_fmt("checking cap %d\n", levelOfCap); + if (level <= levelOfCap) + { + return i; + } + i++; + } + while (levelOfCap < 100); + + return 0; +} + +System::Array * CreateEventHandlerTable(uint32_t size) +{ + auto *array = (System::Array *) malloc(32 + 8 * size); + array->max_length = size; + for (int i = 0; i < size; ++i) + array->m_Items[i] = nullptr; + return array; +} + +Dpr::Battle::Logic::EventFactor_EventHandlerTable_o * CreateEventHandler(uint16_t eventID, MethodInfo * src, Il2CppMethodPointer methodPointer) { MethodInfo * method = copyMethodInfo(src, methodPointer); - Dpr::Battle::Logic::EventFactor_EventHandlerTable_o * evtHandlerTable = (Dpr::Battle::Logic::EventFactor_EventHandlerTable_o *) il2cpp_object_new(Dpr::Battle::Logic::EventFactor_EventHandlerTable_TypeInfo); - Dpr::Battle::Logic::EventFactor_EventHandler_o * evtHandler = (Dpr::Battle::Logic::EventFactor_EventHandler_o *) il2cpp_object_new(Dpr::Battle::Logic::EventFactor_EventHandler_TypeInfo); + auto * evtHandlerTable = (Dpr::Battle::Logic::EventFactor_EventHandlerTable_o *) malloc(sizeof(Dpr::Battle::Logic::EventFactor_EventHandlerTable_o)); + auto * evtHandler = (Dpr::Battle::Logic::EventFactor_EventHandler_o *) malloc(sizeof(Dpr::Battle::Logic::EventFactor_EventHandler_o)); evtHandler->ctor((intptr_t) methodPointer, method); + evtHandler->fields.super.delegates = nullptr; evtHandlerTable->fields.eventID = eventID; evtHandlerTable->fields.eventHandler = evtHandler; return evtHandlerTable; +} + +void HandlerRankResetAll(Dpr::Battle::Logic::EventFactor_EventHandlerArgs_o **args, uint8_t pokeID) { + socket_log_fmt("HandlerRankResetAll\n"); + + using namespace Dpr::Battle::Logic; + + system_load_typeinfo((void *)0xa9b3); + auto *desc = (Section_FromEvent_RankReset_Description_o *) il2cpp_object_new(Section_FromEvent_RankReset_Description_TypeInfo); + desc->ctor(nullptr); + auto *exPos = (ExPokePos_o *)il2cpp_object_new(ExPokePos_TypeInfo); + exPos->ctor(ExPosType::FULL_ALL, Common::GetExistFrontPokePos(args, pokeID, nullptr), nullptr); + desc->fields.pokeCount = Common::ExpandExistPokeID(args, &exPos, desc->fields.pokeID, nullptr); + Common::RankReset(args, &desc, nullptr); + + Section_FromEvent_Message::Description_o * descMsg = (Section_FromEvent_Message::Description_o *) il2cpp_object_new(Section_FromEvent_Message::Description_TypeInfo); + descMsg->ctor(nullptr); + descMsg->fields.pokeID = pokeID; + descMsg->fields.message->Setup(1, 116, nullptr); + Common::Message(args, &descMsg, nullptr); +} + +void HandlerRankReset(Dpr::Battle::Logic::EventFactor_EventHandlerArgs_o **args, uint8_t pokeID) { + socket_log_fmt("HandlerRankReset\n"); + + using namespace Dpr::Battle::Logic; + + system_load_typeinfo((void *)0xa911); + auto *desc = (Section_FromEvent_RankReset_Description_o *) il2cpp_object_new(Section_FromEvent_RankReset_Description_TypeInfo); + desc->ctor(nullptr); + desc->fields.pokeCount = 1; + desc->fields.pokeID->m_Items[0] = pokeID; + Common::RankReset(args, &desc, nullptr); + + Section_FromEvent_Message::Description_o * descMsg = (Section_FromEvent_Message::Description_o *) il2cpp_object_new(Section_FromEvent_Message::Description_TypeInfo); + descMsg->ctor(nullptr); + descMsg->fields.pokeID = pokeID; + descMsg->fields.message->Setup(1, 268, nullptr); + Common::Message(args, &descMsg, nullptr); } \ No newline at end of file