Merge pull request #150 from Taiga74164/AltGodMode-fix

Alt god mode improvement
This commit is contained in:
Callow 2022-06-21 23:58:18 +03:00 committed by GitHub
commit f99c8f0dad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 244 additions and 15 deletions

View File

@ -900,7 +900,8 @@
</Command> </Command>
</PostBuildEvent> </PostBuildEvent>
<CustomBuildStep> <CustomBuildStep>
<Command>"$(OutDir)injector.exe" powershell -nop -c "&amp;amp; {sleep 15}"</Command> <Command>"$(OutDir)injector.exe"
powershell -nop -c "&amp; {sleep 20}"</Command>
<Outputs>$(OutDir)_noexist.nope;%(Outputs)</Outputs> <Outputs>$(OutDir)_noexist.nope;%(Outputs)</Outputs>
<Inputs>$(TargetPath);%(Inputs)</Inputs> <Inputs>$(TargetPath);%(Inputs)</Inputs>
</CustomBuildStep> </CustomBuildStep>

View File

@ -12,6 +12,7 @@ DO_TYPEDEF(0x0967B508, Int32);
// v 2.7 // v 2.7
DO_TYPEDEF(0x0968AD88, LCChestPlugin); DO_TYPEDEF(0x0968AD88, LCChestPlugin);
DO_TYPEDEF(0x09688FD8, SceneTreeObject); DO_TYPEDEF(0x09688FD8, SceneTreeObject);
DO_TYPEDEF(0x0969D1F8, MoleMole_ActorModifier);
//// v 2.6 //// v 2.6
//DO_SINGLETONEDEF(0x0B3442D8, Singleton_1_MoleMole_MapModule_); //DO_SINGLETONEDEF(0x0B3442D8, Singleton_1_MoleMole_MapModule_);

View File

@ -4118,6 +4118,10 @@ namespace app {
uint16_t _value; uint16_t _value;
}; };
struct SimpleSafeInt16 {
uint16_t _value;
};
struct Quaternion { struct Quaternion {
float x; float x;
float y; float y;
@ -11728,6 +11732,178 @@ namespace app {
struct MoleMole_VCBaseSetDitherValue__Fields fields; struct MoleMole_VCBaseSetDitherValue__Fields fields;
}; };
enum class MoleMole_Config_AbilityState__Enum : uint64_t {
None = 0x0000000000000000,
Invincible = 0x0000000000000001,
DenyLockOn = 0x0000000000000002,
IsGhostToAllied = 0x0000000000000004,
IsGhostToEnemy = 0x0000000000000008,
ElementBurning = 0x0000000000000010,
ElementWet = 0x0000000000000020,
ElementFrozen = 0x0000000000000080,
LockHP = 0x0000000000000200,
IgnoreTriggerBullet = 0x0000000000000400,
ElementShock = 0x0000000000000800,
Struggle = 0x0000000000001000,
ElementRock = 0x0000000000002000,
ElementIce = 0x0000000000008000,
ElementFreeze = 0x0000000000010000,
AttackUp = 0x0000000000020000,
DefenseUp = 0x0000000000040000,
SpeedUp = 0x0000000000080000,
DefenseDown = 0x0000000000100000,
SpeedDown = 0x0000000000200000,
ElementWind = 0x0000000000400000,
ElementElectric = 0x0000000000800000,
ElementFire = 0x0000000001000000,
NoHeal = 0x0000000002000000,
Limbo = 0x0000000004000000,
MuteTaunt = 0x0000000008000000,
ElementPetrifaction = 0x0000000010000000,
IgnoreAddEnergy = 0x0000000040000000,
ElementGrass = 0x0000000080000000,
ElementOverdose = 0x0000000100000000,
Corruption = 0x0000000200000000,
UnlockFrequencyLimit = 0x0000000400000000,
ElementDeadTime = 0x0000000800000000,
};
enum class MoleMole_Config_ModifierTimeScale__Enum : int32_t {
Owner = 0x00000000,
Level = 0x00000001,
};
enum class MoleMole_Config_ModifierStacking__Enum : int32_t {
Refresh = 0x00000000,
Unique = 0x00000001,
Prolong = 0x00000002,
RefreshAndAddDurability = 0x00000003,
Multiple = 0x00000004,
MultipleRefresh = 0x00000005,
MultipleRefreshNoRemove = 0x00000006,
MultipleAllRefresh = 0x00000007,
GlobalUnique = 0x00000008,
Overlap = 0x00000009,
RefreshUniqueDurability = 0x0000000a,
};
enum class MoleMole_Config_ConfigAbilityModifier_MoleMole_Config_ConfigAbilityModifier_ModifierMPBehavior__Enum : int32_t {
NormallySynced = 0x00000000,
MuteRemoteAuthorityOnly = 0x00000001,
};
struct __declspec(align(8)) MoleMole_Config_ConfigAbilityModifier__Fields {
MoleMole_Config_ModifierTimeScale__Enum _timeScale;
MoleMole_Config_ModifierStacking__Enum _stacking;
struct MoleMole_Config_ConfigModifierStackingOption* _stackingOption;
bool _isBuff;
bool _isDebuff;
struct String* _modifierName;
bool _isUnique;
struct MoleMole_Config_DynamicFloat* _duration;
ElementType__Enum _elementType;
struct MoleMole_Config_DynamicFloat* _elementDurability;
struct SimpleSafeFloat maxElementDurabilityRawNum;
struct SimpleSafeFloat purgeIncrementRawNum;
bool _isElementDurabilityMutable;
bool _forceTriggerBurning;
bool _overrideWeaponElement;
struct MoleMole_Config_DynamicFloat* _thinkInterval;
struct MoleMole_Config_ConfigAbilityMixin__Array* _modifierMixins;
bool _trimThinkInterval;
struct Dictionary_2_System_String_MoleMole_Config_DynamicFloat_* _properties;
MoleMole_Config_AbilityState__Enum _state;
struct MoleMole_Config_ConfigAbilityStateOption* _stateOption;
bool _muteStateDisplayEffect;
bool _applyAttackerWitchTimeRatio;
struct MoleMole_Config_ConfigAbilityAction__Array* _onAdded;
struct MoleMole_Config_ConfigAbilityAction__Array* _onRemoved;
struct MoleMole_Config_ConfigAbilityAction__Array* _onBeingHit;
struct MoleMole_Config_ConfigAbilityAction__Array* _onAttackLanded;
struct MoleMole_Config_ConfigAbilityAction__Array* _onHittingOther;
struct MoleMole_Config_ConfigAbilityAction__Array* _onThinkInterval;
struct MoleMole_Config_ConfigAbilityAction__Array* CLKOPBOIEEH;
struct MoleMole_Config_ConfigAbilityAction__Array* PBDDACFFPOE;
bool _onThinkIntervalIsFixedUpdate;
struct MoleMole_Config_ConfigAbilityAction__Array* _onKill;
struct MoleMole_Config_ConfigAbilityAction__Array* _onCrash;
struct MoleMole_Config_ConfigAbilityAction__Array* _onAvatarIn;
struct MoleMole_Config_ConfigAbilityAction__Array* _onAvatarOut;
struct MoleMole_Config_ConfigAbilityAction__Array* _onVehicleIn;
struct MoleMole_Config_ConfigAbilityAction__Array* _onVehicleOut;
struct MoleMole_Config_ConfigAbilityAction__Array* _onZoneEnter;
struct MoleMole_Config_ConfigAbilityAction__Array* _onZoneExit;
struct MoleMole_Config_ConfigAbilityAction__Array* _onReconnect;
struct MoleMole_Config_ConfigAbilityAction__Array* _onChangeAuthority;
struct MoleMole_Config_EntityType__Enum__Array* _forbiddenEntities;
bool _fireEventWhenApply;
bool _isDurabilityGlobal;
bool _tickThinkIntervalAfterDie;
bool _thinkIntervalIgnoreTimeScale;
bool _reduceDurablityIgnoreTimeScale;
bool _isLimitedProperties;
bool _forceSyncToRemote;
void* buffIDRawNum;
bool _retainWhenDurabilityIsZero;
struct OCDGDLOKFEB__Enum__Array* HFBALDBFOOH;
int32_t fullNameHashCode;
int32_t configLocalID;
MoleMole_Config_ConfigAbilityModifier_MoleMole_Config_ConfigAbilityModifier_ModifierMPBehavior__Enum mpBehavior;
bool isAuthorityOnly;
};
struct MoleMole_Config_ConfigAbilityModifier {
struct MoleMole_Config_ConfigAbilityModifier__Class* klass;
MonitorData* monitor;
struct MoleMole_Config_ConfigAbilityModifier__Fields fields;
};
struct __declspec(align(8)) HKMHAGBLLMK__Fields {
struct MoleMole_BaseAbilityMixin__Array* JGLDNAPGGGC;
struct List_1_System_ValueTuple_2__1* JFLGBBBFBLF;
struct List_1_System_ValueTuple_2__2* EFOPNOEMFBI;
struct List_1_MoleMole_Config_ConfigAbilityAction__1* PGICFJEDMAE;
struct List_1_System_ValueTuple_3__1* CGBNAMBLDOE;
struct IList_1_MoleMole_BaseAbilityMixin_* LOGOJNMHLIF;
};
struct MoleMole_ActorModifier__Fields {
HKMHAGBLLMK__Fields _;
struct MoleMole_ActorAbility* parentAbility;
uint32_t parentAbilityInstanceID;
struct MoleMole_Config_ConfigAbility* _parentAbilityConfig;
uint32_t parentAbilityEntityID;
uint32_t _applyEntityId_k__BackingField;
struct MoleMole_LCAbility* owner;
struct MoleMole_Config_ConfigAbilityModifier* _config;
struct Dictionary_2_MoleMole_EncryptedString_System_Int32_* stackIndices;
int32_t _parentOwnedIx;
uint32_t instancedModifierID;
struct MoleMole_ActorModifier* attachedInstancedModifier;
uint32_t attachedModifierOwnerEntityId;
uint32_t attachedModifierInstancedModifierId;
bool attachedModifierIsServerBuff;
int32_t attachedModifierNameHash;
bool isAttachedParentAbility;
bool PBDIKHPKHLF;
struct Action_1_MoleMole_ActorModifier_* onDetached;
uint32_t serverBuffUid;
struct Action_1_Nullable_1_Single_* onDurabilityEmpty;
bool _isValid_k__BackingField;
uint64_t _modifierStartTime_k__BackingField;
bool isModifierInvalidByServer;
bool hasAddedAbilityState;
float thinkInterval;
float reduceElementRatio;
float PHKNIPMALFB;
};
struct MoleMole_ActorModifier {
struct MoleMole_ActorModifier__Class* klass;
MonitorData* monitor;
struct MoleMole_ActorModifier__Fields fields;
};
struct Button_1 { struct Button_1 {
struct Button_1__Class* klass; struct Button_1__Class* klass;
MonitorData* monitor; MonitorData* monitor;

View File

@ -6,11 +6,6 @@
namespace cheat::feature namespace cheat::feature
{ {
static bool Miscs_CheckTargetAttackable_Hook(app::BaseEntity* attacker, app::BaseEntity* target, MethodInfo* method);
static void VCHumanoidMove_NotifyLandVelocity_Hook(app::VCHumanoidMove* __this, app::Vector3 velocity, float reachMaxDownVelocityTime, MethodInfo* method);
static void LCBaseCombat_FireBeingHitEvent_Hook(app::LCBaseCombat* __this, uint32_t attackeeRuntimeID, app::AttackResult* attackResult, MethodInfo* method);
static bool MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook(app::ActorAbilityPlugin* __this, float delay, app::Object* arg, MethodInfo* method);
GodMode::GodMode() : Feature(), GodMode::GodMode() : Feature(),
NFEX(f_Enabled, "God mode", "m_GodMode", "Player", false, false), NFEX(f_Enabled, "God mode", "m_GodMode", "Player", false, false),
NF(f_AltGodMode, "Alternative God Mode", "Player", false) NF(f_AltGodMode, "Alternative God Mode", "Player", false)
@ -56,7 +51,7 @@ namespace cheat::feature
} }
// Attack immunity (return false when target is avatar, that mean avatar entity isn't attackable) // Attack immunity (return false when target is avatar, that mean avatar entity isn't attackable)
static bool Miscs_CheckTargetAttackable_Hook(app::BaseEntity* attacker, app::BaseEntity* target, MethodInfo* method) bool GodMode::Miscs_CheckTargetAttackable_Hook(app::BaseEntity* attacker, app::BaseEntity* target, MethodInfo* method)
{ {
auto& gm = GodMode::GetInstance(); auto& gm = GodMode::GetInstance();
auto& manager = game::EntityManager::instance(); auto& manager = game::EntityManager::instance();
@ -70,7 +65,7 @@ namespace cheat::feature
// Raised when avatar fall on ground. // Raised when avatar fall on ground.
// Sending fall speed, and how many time pass from gain max fall speed (~30m/s). // Sending fall speed, and how many time pass from gain max fall speed (~30m/s).
// To disable fall damage reset reachMaxDownVelocityTime and decrease fall velocity. // To disable fall damage reset reachMaxDownVelocityTime and decrease fall velocity.
static void VCHumanoidMove_NotifyLandVelocity_Hook(app::VCHumanoidMove* __this, app::Vector3 velocity, float reachMaxDownVelocityTime, MethodInfo* method) void GodMode::VCHumanoidMove_NotifyLandVelocity_Hook(app::VCHumanoidMove* __this, app::Vector3 velocity, float reachMaxDownVelocityTime, MethodInfo* method)
{ {
auto& gm = GodMode::GetInstance(); auto& gm = GodMode::GetInstance();
if ((gm.f_Enabled || gm.f_AltGodMode) && -velocity.y > 13) if ((gm.f_Enabled || gm.f_AltGodMode) && -velocity.y > 13)
@ -84,7 +79,7 @@ namespace cheat::feature
} }
// Analog function for disable attack damage (Thanks to Taiga74164) // Analog function for disable attack damage (Thanks to Taiga74164)
static void LCBaseCombat_FireBeingHitEvent_Hook(app::LCBaseCombat* __this, uint32_t attackeeRuntimeID, app::AttackResult* attackResult, MethodInfo* method) void GodMode::LCBaseCombat_FireBeingHitEvent_Hook(app::LCBaseCombat* __this, uint32_t attackeeRuntimeID, app::AttackResult* attackResult, MethodInfo* method)
{ {
auto& gm = GodMode::GetInstance(); auto& gm = GodMode::GetInstance();
auto& manager = game::EntityManager::instance(); auto& manager = game::EntityManager::instance();
@ -95,13 +90,61 @@ namespace cheat::feature
} }
// Environmental damage immunity (Thanks to RELOADED#7236 / GitHub: @34736384) // Environmental damage immunity (Thanks to RELOADED#7236 / GitHub: @34736384)
static bool MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook(app::ActorAbilityPlugin* __this, float delay, app::Object* arg, MethodInfo* method) bool GodMode::MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook(app::ActorAbilityPlugin* __this, float delay, app::Object* arg, MethodInfo* method)
{ {
auto& gm = GodMode::GetInstance(); if (GetInstance().NeedBlockHanlerModifierThinkTimeUp(arg))
if (gm.f_AltGodMode/* || gm.f_Enabled*/) return false;
return FALSE;
return CALL_ORIGIN(MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook, __this, delay, arg, method); return CALL_ORIGIN(MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook, __this, delay, arg, method);
} }
}
bool GodMode::NeedBlockHanlerModifierThinkTimeUp(app::Object* arg)
{
if (!f_AltGodMode)
return false;
auto actorModifier = CastTo<app::MoleMole_ActorModifier>(arg, *app::MoleMole_ActorModifier__TypeInfo);
if (actorModifier == nullptr)
return false;
static std::vector<std::string> modifierBlacklist
{
"BlackMud",
"SERVER_ClimateAbility",
"ElectricWater",
"SeiraiThunder",
"UNIQUE_Monster_",
"Monster_Shougun"
};
std::string modifierName = il2cppi_to_string(actorModifier->fields._config->fields._modifierName);
for (auto& forbiddenModifierName : modifierBlacklist)
if (modifierName.find(forbiddenModifierName) != std::string::npos)
return true;
return false;
}
// ____________________________________________________________________________________________________________
// | Name | Description |
// |------------------------------------------------------------------------|-----------------------------------|
// | SERVER_ClimateAbility_Cold_Area | Sheer cold |
// | SERVER_ClimateAbility_Cold_Lv1 | Sheer cold |
// | SERVER_ClimateAbility_Cold_Lv2 | Sheer cold |
// | SERVER_ClimateAbility_TsurumiMist_Area | Electric debuff |
// | SERVER_ClimateAbility_TatariRegion_Area | Electric debuff |
// | SERVER_ClimateAbility_TatariRegion_Lv1 | Electric debuff |
// | SERVER_ClimateAbility_TatariRegion_Lv2 | Electric debuff |
// | SERVER_ClimateAbility_SeiraiStorm_Area | Serai Island |
// | SERVER_ClimateAbility_SeiraiStorm_Lv1 | Serai Island |
// | SERVER_ClimateAbility_SeiraiStorm_Lv2 | Serai Island |
// | SERVER_ClimateAbility_TsurumiMist_Area | Tsurumi Island |
// | ElectricWaterAreaModifier | All electric water in inazuma |
// | BlackMudAreaBuff_Avatar | |
// | BlackMudAreaBuff_Avatar02 | |
// | WaterAreaModifier | |
// | SeiraiThunder_Manager | |
// | UNIQUE_Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldPredicated | |
// | Monster_Shougun_Mitakenarukami_BurstAtk02_NotInShieldAtk | |
// |------------------------------------------------------------------------|-----------------------------------|
}

View File

@ -16,10 +16,18 @@ namespace cheat::feature
const FeatureGUIInfo& GetGUIInfo() const override; const FeatureGUIInfo& GetGUIInfo() const override;
void DrawMain() override; void DrawMain() override;
virtual bool NeedStatusDraw() const override; bool NeedStatusDraw() const override;
void DrawStatus() override; void DrawStatus() override;
private: private:
bool NeedBlockHanlerModifierThinkTimeUp(app::Object* arg);
static bool MoleMole_ActorAbilityPlugin_HanlderModifierThinkTimerUp_Hook(app::ActorAbilityPlugin* __this, float delay, app::Object* arg, MethodInfo* method);
static void LCBaseCombat_FireBeingHitEvent_Hook(app::LCBaseCombat* __this, uint32_t attackeeRuntimeID, app::AttackResult* attackResult, MethodInfo* method);
static void VCHumanoidMove_NotifyLandVelocity_Hook(app::VCHumanoidMove* __this, app::Vector3 velocity, float reachMaxDownVelocityTime, MethodInfo* method);
static bool Miscs_CheckTargetAttackable_Hook(app::BaseEntity* attacker, app::BaseEntity* target, MethodInfo* method);
GodMode(); GodMode();
}; };
} }