From f4284bd483762aa9b508621b304b926401d5d5c3 Mon Sep 17 00:00:00 2001 From: jadis0x <49281043+jadis0x@users.noreply.github.com> Date: Tue, 11 Oct 2022 13:29:57 +0300 Subject: [PATCH] add: ShootEveryone function --- DevourClient/Features/Misc/Misc.cpp | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/DevourClient/Features/Misc/Misc.cpp b/DevourClient/Features/Misc/Misc.cpp index e819bf8..7f17af5 100644 --- a/DevourClient/Features/Misc/Misc.cpp +++ b/DevourClient/Features/Misc/Misc.cpp @@ -634,3 +634,43 @@ void Misc::TPKeys() { } } } + +void Misc::ShootEveryone(bool shootEveryone, bool hit) { + + std::string currentMap = Helpers::GetActiveScene(); + + if (currentMap == IL2CPP::String::New("Town")->ToString()) { + if (!Players::LocalPlayer) { + return; + } + + Unity::CGameObject* Sam = Unity::GameObject::Find("AzazelSam(Clone)"); + + if (!Sam) { + return; + } + + Unity::CComponent* SamBehaviour = Sam->GetComponent("AzazelSamBehaviour"); + + if (!SamBehaviour) { + return; + } + + + if (shootEveryone) { + for (Unity::CGameObject* player : Players::PlayerList) { + if (!player || player == Players::LocalPlayer) { + continue; + } + + SamBehaviour->CallMethodSafe("OnShootPlayer", player, hit); + } + } + else { + SamBehaviour->CallMethodSafe("OnShootPlayer", Players::LocalPlayer, hit); + } + } + else { + return; + } +}