From b77b1e30328a5f8db5c470cc1a29e71f4e40123f Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Fri, 7 Oct 2022 23:40:15 +0300 Subject: [PATCH] Renamed ShootPlayers function to KnockoutPlayers --- DevourClient/Features/Misc/Misc.cpp | 95 +++++++++++++++++++++++++---- 1 file changed, 82 insertions(+), 13 deletions(-) diff --git a/DevourClient/Features/Misc/Misc.cpp b/DevourClient/Features/Misc/Misc.cpp index 825bf8f..aa90db2 100644 --- a/DevourClient/Features/Misc/Misc.cpp +++ b/DevourClient/Features/Misc/Misc.cpp @@ -387,24 +387,93 @@ void Misc::BurnRitualObj(bool burnAll) { } } -void Misc::ShootPlayers() { - Unity::CGameObject* AzazaelSam = Unity::GameObject::Find("AzazelSam(Clone)"); +void Misc::KnockoutPlayers(bool killYourself) { + try { + Unity::CGameObject* AzazelAnna = Unity::GameObject::Find("SurvivalAnnaNew(Clone)"); - if (!AzazaelSam) { - return; - } + if (AzazelAnna) { + Unity::CComponent* AzazelAnnaComp = AzazelAnna->GetComponent("SurvivalAzazelBehaviour"); - Unity::CComponent* AzazelSamBehaviour = AzazaelSam->GetComponent("AzazelSamBehaviour"); + if (!AzazelAnnaComp) { + return; + } - if (!AzazelSamBehaviour) { - return; - } + // check killYourself if true or false - for (Unity::CGameObject* player : Players::PlayerList) { - if (!player || player == Players::LocalPlayer) { - continue; + for (Unity::CGameObject* player : Players::PlayerList) { + if (!player || player == Players::LocalPlayer) { + continue; + } + + AzazelAnnaComp->CallMethodSafe("OnKnockout", AzazelAnna, player); + } } - AzazelSamBehaviour->CallMethodSafe("OnShootPlayer", player, true); + Unity::CGameObject* AzazelMolly = Unity::GameObject::Find("SurvivalAzazelMolly(Clone)"); + + if (AzazelMolly) { + Unity::CComponent* AzazelMollyComp = AzazelMolly->GetComponent("SurvivalAzazelBehaviour"); + + if (!AzazelMollyComp) { + return; + } + + // check killYourself if true or false + + for (Unity::CGameObject* player : Players::PlayerList) { + if (!player || player == Players::LocalPlayer) { + continue; + } + + AzazelMollyComp->CallMethodSafe("OnKnockout", AzazelMolly, player); + } + + } + + Unity::CGameObject* AzazaelSam = Unity::GameObject::Find("AzazelSam(Clone)"); + + if (AzazaelSam) { + Unity::CComponent* AzazelSamComp = AzazaelSam->GetComponent("AzazelSamBehaviour"); + + if (!AzazelSamComp) { + return; + } + + // check killYourself if true or false + + for (Unity::CGameObject* player : Players::PlayerList) { + if (!player || player == Players::LocalPlayer) { + continue; + } + + AzazelSamComp->CallMethodSafe("OnKnockout", AzazaelSam, player); + } + + AzazelSamComp->CallMethodSafe("OnKnockout", AzazaelSam, Players::LocalPlayer); + + } + + Unity::CGameObject* AzazelZara = Unity::GameObject::Find("AzazelZara(Clone)"); + + if (AzazelZara) { + Unity::CComponent* AzazelZaraComp = AzazelZara->GetComponent("AzazelZaraBehaviour"); + + if (!AzazelZaraComp) { + return; + } + + // check killYourself if true or false + + for (Unity::CGameObject* player : Players::PlayerList) { + if (!player || player == Players::LocalPlayer) { + continue; + } + + AzazelZaraComp->CallMethodSafe("OnKnockout", AzazelZara, player); + } + } + } + catch (...) { + return; } }