Added animation rapid fire

This commit is contained in:
Joaquin 2022-08-05 23:47:10 -06:00
parent 954fa15555
commit 05325464a3
4 changed files with 83 additions and 2 deletions

View File

@ -56,6 +56,7 @@ DO_APP_FUNC(0x02DB4680, void, MoleMole_ActorAbilityPlugin_AddDynamicFloatWithRan
// Rapid fire // Rapid fire
DO_APP_FUNC(0x017B1D50, void, MoleMole_LCBaseCombat_DoHitEntity, (LCBaseCombat* __this, uint32_t targetID, AttackResult* attackResult, bool ignoreCheckCanBeHitInMP, MethodInfo* method)); DO_APP_FUNC(0x017B1D50, void, MoleMole_LCBaseCombat_DoHitEntity, (LCBaseCombat* __this, uint32_t targetID, AttackResult* attackResult, bool ignoreCheckCanBeHitInMP, MethodInfo* method));
DO_APP_FUNC(0x019DDF40, void, MoleMole_Formula_CalcAttackResult, (CombatProperty* attackCombatProperty, CombatProperty* defenseCombatProperty, AttackResult* attackResult, BaseEntity* attackerEntity, BaseEntity* attackeeEntity, MethodInfo* method)); DO_APP_FUNC(0x019DDF40, void, MoleMole_Formula_CalcAttackResult, (CombatProperty* attackCombatProperty, CombatProperty* defenseCombatProperty, AttackResult* attackResult, BaseEntity* attackerEntity, BaseEntity* attackeeEntity, MethodInfo* method));
DO_APP_FUNC(0x0106D020, void, MoleMole_VCAnimatorEvent_HandleProcessItem, (MoleMole_VCAnimatorEvent* __this, MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_AnimatorEventPatternProcessItem* processItem, AnimatorStateInfo processStateInfo, MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_TriggerMode__Enum mode, MethodInfo* method));
// World cheats // World cheats

View File

@ -11998,6 +11998,61 @@ namespace app {
struct MoleMole_ActorAbilityPlugin__Fields fields; struct MoleMole_ActorAbilityPlugin__Fields fields;
}; };
struct MoleMole_VCAnimatorEvent__Fields {
struct VCBase__Fields _;
struct Animator* _animator;
struct Action_1_MoleMole_AnimatorParameterEntry_* onUserInputControllerChanged;
struct Action_4_Int32_UnityEngine_AnimatorStateInfo_UnityEngine_AnimatorStateInfo_MoleMole_AnimatorStateChangeExtra_* onAnimatorStateTransitionFinish;
struct Dictionary_2_System_Int32_Dictionary_2_System_Int32_List_1_System_Int32_* _activeAnimatorEventPatterns;
struct Dictionary_2_System_Int32_System_Int32_* _filterOldPattern2newPattern;
struct Action_2_Int32_Single_* processNormalizedTimeActions;
struct Queue_1_MoleMole_CompensateDiffInfo_* authorityEventQueue;
struct Queue_1_MoleMole_CompensateDiffInfo_* remoteEventQueue;
struct MoleMole_VCMoveData* _moveData;
struct MoleMole_VCSyncAnimator* _vcSyncAnimator;
int32_t MAX_ALLOW_COMPENSATE_TIME;
struct List_1_System_Int32_* _layerIndexes;
struct Dictionary_2_System_Int32_MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_AnimatorLayerItem_* _layerItems;
};
struct MoleMole_VCAnimatorEvent {
struct MoleMole_VCAnimatorEvent__Class* klass;
MonitorData* monitor;
struct MoleMole_VCAnimatorEvent__Fields fields;
};
struct AnimatorStateInfo {
int32_t m_Name;
int32_t m_Path;
int32_t m_FullPath;
float m_NormalizedTime;
float m_Length;
float m_Speed;
float m_SpeedMultiplier;
int32_t m_Tag;
int32_t m_Loop;
};
struct __declspec(align(8)) MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_AnimatorEventPatternProcessItem__Fields {
struct List_1_System_Int32_* patterns;
struct AnimatorStateInfo stateInfo;
float lastTime;
};
struct MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_AnimatorEventPatternProcessItem {
struct MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_AnimatorEventPatternProcessItem__Class* klass;
MonitorData* monitor;
struct MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_AnimatorEventPatternProcessItem__Fields fields;
};
enum class MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_TriggerMode__Enum : int32_t {
NormalTrigger = 0x00000000,
ForceTriggerOnEnter = 0x00000001,
ForceTriggerOnExitImediately = 0x00000002,
ForceTriggerOnExitTransition = 0x00000003,
ForceTriggerOnExitTransitionFinish = 0x00000004,
};
#if !defined(_GHIDRA_) && !defined(_IDA_) #if !defined(_GHIDRA_) && !defined(_IDA_)
} }
#endif #endif

View File

@ -10,6 +10,9 @@ namespace cheat::feature
{ {
static void LCBaseCombat_DoHitEntity_Hook(app::LCBaseCombat* __this, uint32_t targetID, app::AttackResult* attackResult, static void LCBaseCombat_DoHitEntity_Hook(app::LCBaseCombat* __this, uint32_t targetID, app::AttackResult* attackResult,
bool ignoreCheckCanBeHitInMP, MethodInfo* method); bool ignoreCheckCanBeHitInMP, MethodInfo* method);
static void VCAnimatorEvent_HandleProcessItem_Hook(app::MoleMole_VCAnimatorEvent* __this,
app::MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_AnimatorEventPatternProcessItem* processItem,
app::AnimatorStateInfo processStateInfo, app::MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_TriggerMode__Enum mode, MethodInfo* method);
RapidFire::RapidFire() : Feature(), RapidFire::RapidFire() : Feature(),
NF(f_Enabled, "Attack Multiplier", "RapidFire", false), NF(f_Enabled, "Attack Multiplier", "RapidFire", false),
@ -20,9 +23,11 @@ namespace cheat::feature
NF(f_minMultiplier, "Min Multiplier", "RapidFire", 1), NF(f_minMultiplier, "Min Multiplier", "RapidFire", 1),
NF(f_maxMultiplier, "Max Multiplier", "RapidFire", 3), NF(f_maxMultiplier, "Max Multiplier", "RapidFire", 3),
NF(f_MultiTarget, "Multi-target", "RapidFire", false), NF(f_MultiTarget, "Multi-target", "RapidFire", false),
NF(f_MultiTargetRadius, "Multi-target Radius", "RapidFire", 20.0f) NF(f_MultiTargetRadius, "Multi-target Radius", "RapidFire", 20.0f),
NF(f_MultiAnimation, "Multi-animation", "RapidFire", false)
{ {
HookManager::install(app::MoleMole_LCBaseCombat_DoHitEntity, LCBaseCombat_DoHitEntity_Hook); HookManager::install(app::MoleMole_LCBaseCombat_DoHitEntity, LCBaseCombat_DoHitEntity_Hook);
HookManager::install(app::MoleMole_VCAnimatorEvent_HandleProcessItem, VCAnimatorEvent_HandleProcessItem_Hook);
} }
const FeatureGUIInfo& RapidFire::GetGUIInfo() const const FeatureGUIInfo& RapidFire::GetGUIInfo() const
@ -77,11 +82,14 @@ namespace cheat::feature
ImGui::Indent(); ImGui::Indent();
ConfigWidget("Radius (m)", f_MultiTargetRadius, 0.1f, 5.0f, 50.0f, "Radius to check for valid targets."); ConfigWidget("Radius (m)", f_MultiTargetRadius, 0.1f, 5.0f, 50.0f, "Radius to check for valid targets.");
ImGui::Unindent(); ImGui::Unindent();
ConfigWidget("Multi-animation", f_MultiAnimation, "Enables multi-animation attacks.\n" \
"Do keep in mind that the character's audio will also be spammed.");
} }
bool RapidFire::NeedStatusDraw() const bool RapidFire::NeedStatusDraw() const
{ {
return f_Enabled && (f_MultiHit || f_MultiTarget); return f_Enabled && (f_MultiHit || f_MultiTarget || f_MultiAnimation);
} }
void RapidFire::DrawStatus() void RapidFire::DrawStatus()
@ -97,6 +105,9 @@ namespace cheat::feature
} }
if (f_MultiTarget) if (f_MultiTarget)
ImGui::Text("Multi-Target [%.01fm]", f_MultiTargetRadius.value()); ImGui::Text("Multi-Target [%.01fm]", f_MultiTargetRadius.value());
if (f_MultiAnimation)
ImGui::Text("Multi-Animation");
} }
RapidFire& RapidFire::GetInstance() RapidFire& RapidFire::GetInstance()
@ -261,5 +272,18 @@ namespace cheat::feature
else CALL_ORIGIN(LCBaseCombat_DoHitEntity_Hook, __this, entity->runtimeID(), attackResult, ignoreCheckCanBeHitInMP, method); else CALL_ORIGIN(LCBaseCombat_DoHitEntity_Hook, __this, entity->runtimeID(), attackResult, ignoreCheckCanBeHitInMP, method);
} }
} }
static void VCAnimatorEvent_HandleProcessItem_Hook(app::MoleMole_VCAnimatorEvent* __this,
app::MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_AnimatorEventPatternProcessItem* processItem,
app::AnimatorStateInfo processStateInfo, app::MoleMole_VCAnimatorEvent_MoleMole_VCAnimatorEvent_TriggerMode__Enum mode, MethodInfo* method)
{
auto attacker = game::Entity(__this->fields._._._entity);
RapidFire& rapidFire = RapidFire::GetInstance();
if (rapidFire.f_MultiAnimation && IsAttackByAvatar(attacker))
processItem->fields.lastTime = -1;
CALL_ORIGIN(VCAnimatorEvent_HandleProcessItem_Hook, __this, processItem, processStateInfo, mode, method);
}
} }

View File

@ -19,6 +19,7 @@ namespace cheat::feature
config::Field<int> f_maxMultiplier; config::Field<int> f_maxMultiplier;
config::Field<config::Toggle<Hotkey>> f_MultiTarget; config::Field<config::Toggle<Hotkey>> f_MultiTarget;
config::Field<float> f_MultiTargetRadius; config::Field<float> f_MultiTargetRadius;
config::Field<config::Toggle<Hotkey>> f_MultiAnimation;
static RapidFire& GetInstance(); static RapidFire& GetInstance();