From d691a8defdd7a445572c8aa324d9395408b3295c Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Thu, 24 Nov 2022 01:20:44 +0300 Subject: [PATCH] add: FreezeAzazel function --- DevourClient/Features/Misc/Misc.cpp | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/DevourClient/Features/Misc/Misc.cpp b/DevourClient/Features/Misc/Misc.cpp index f189237..3a4fe16 100644 --- a/DevourClient/Features/Misc/Misc.cpp +++ b/DevourClient/Features/Misc/Misc.cpp @@ -784,3 +784,42 @@ void Misc::Jumpscare(bool inHidingSpot) { } } } + +void Misc::FreezeAzazel() { + if (Helpers::GetActiveScene() == std::string("Menu")) { + return; + } + + float azazelTimeScale = 1; + + Unity::il2cppArray* Azazel = Unity::GameObject::FindWithTag("Azazel"); + + for (int j = 0; j < Azazel->m_uMaxLength + 1; j++) + { + if (!Azazel->operator[](j)) { + return; + } + + Unity::CGameObject* AzazelObj = Azazel->operator[](j)->GetMemberValue("gameObject"); + + if (!AzazelObj) { + return; + } + + Unity::CComponent* AzazelComp = AzazelObj->GetComponent("Opsive.UltimateCharacterController.Character.UltimateCharacterLocomotion"); + + if (AzazelComp != NULL) { + float currentAzazelTimeScale = AzazelComp->GetMemberValue("TimeScale"); + + if (currentAzazelTimeScale == azazelTimeScale) { + AzazelComp->SetMemberValue("TimeScale", 0); + } + else { + AzazelComp->SetMemberValue("TimeScale", azazelTimeScale); + } + } + else { + return; + } + } +}