diff --git a/cheat-library/src/user/cheat/world/AutoSeelie.cpp b/cheat-library/src/user/cheat/world/AutoSeelie.cpp index f52adf3..482bfbb 100644 --- a/cheat-library/src/user/cheat/world/AutoSeelie.cpp +++ b/cheat-library/src/user/cheat/world/AutoSeelie.cpp @@ -9,22 +9,33 @@ namespace cheat::feature { AutoSeelie::AutoSeelie() : Feature(), - NF(f_Enabled, "Auto follow seelie", "AutoSeelie", false) - { - events::GameUpdateEvent += MY_METHOD_HANDLER(AutoSeelie::OnGameUpdate); - } + NF(f_Enabled, "Auto seelie", "Auto Seelie", false), + NF(f_ElectroSeelie, "Auto Electro seelie", "Auto Seelie", false), + nextTime(0) + { + events::GameUpdateEvent += MY_METHOD_HANDLER(AutoSeelie::OnGameUpdate); + } const FeatureGUIInfo& AutoSeelie::GetGUIInfo() const { static const FeatureGUIInfo info{ "", "World", true }; return info; } - void AutoSeelie::DrawMain() - { - ConfigWidget("Auto seelie", f_Enabled, "Auto follow seelie to its home"); - ImGui::SameLine(); - ImGui::TextColored(ImColor(255, 165, 0, 255), "Don't work with Electro Seelies"); - } + void AutoSeelie::DrawMain() + { + ConfigWidget("Auto seelie", f_Enabled, "Auto follow seelie to its home"); + + if (f_Enabled) + { + ImGui::Indent(); + ConfigWidget("Auto Electro seelie", f_ElectroSeelie, "Since you don't need to manually start electroseelie, \n" + "they start moving automatically with this option within 100m radius."); + ImGui::SameLine(); + ImGui::TextColored(ImColor(255, 165, 0, 255), "Read the note!"); + ImGui::Unindent(); + } + + } bool AutoSeelie::NeedStatusDraw() const { @@ -33,7 +44,7 @@ namespace cheat::feature void AutoSeelie::DrawStatus() { - ImGui::Text ("AutoSeelie"); + ImGui::Text("AutoSeelie %s", f_ElectroSeelie ? "+ Electro" : ""); } AutoSeelie& AutoSeelie::GetInstance() @@ -47,35 +58,52 @@ namespace cheat::feature auto& manager = game::EntityManager::instance(); auto distance = manager.avatar()->distance(entity); float radius = 100.0f; - - if (entity->name().find("Gear_Seelie") != std::string::npos || entity->name().find("_FireSeelie") != std::string::npos || - entity->name().find("_LitSeelie") != std::string::npos) + + if (entity->name().find("Seelie") != std::string::npos) { + if (entity->name().find("ElectricSeelie") != std::string::npos) + { + + if (f_ElectroSeelie) + { + auto EntityGameObject = app::MoleMole_BaseEntity_get_rootGameObject(entity->raw(), nullptr); + auto Transform = app::GameObject_GetComponentByName(EntityGameObject, string_to_il2cppi("Transform"), nullptr); + auto child = app::Transform_GetChild(reinterpret_cast(Transform), 1, nullptr); + auto pre_status = app::Component_1_get_gameObject(reinterpret_cast(child), nullptr); + auto status = app::GameObject_get_active(reinterpret_cast(pre_status), nullptr); + + if (status) + { + return false; + } + return distance <= radius; + } + return false; + } return distance <= radius; } - return false; } - void AutoSeelie::OnGameUpdate() - { - if (!f_Enabled) - return; + void AutoSeelie::OnGameUpdate() + { + if (!f_Enabled) + return; auto currentTime = util::GetCurrentTimeMillisec(); if (currentTime < nextTime) return; - auto& manager = game::EntityManager::instance(); + auto& manager = game::EntityManager::instance(); auto avatarEntity = manager.avatar(); - for (const auto& entity : manager.entities()) - { - if (!IsEntityForVac(entity)) - continue; + for (const auto& entity : manager.entities()) + { + if (!IsEntityForVac(entity)) + continue; - entity->setRelativePosition(avatarEntity->relativePosition()); - } + entity->setRelativePosition(avatarEntity->relativePosition()); + } nextTime = currentTime + 1000; - } - + } + } \ No newline at end of file diff --git a/cheat-library/src/user/cheat/world/AutoSeelie.h b/cheat-library/src/user/cheat/world/AutoSeelie.h index 0b02057..f2c751d 100644 --- a/cheat-library/src/user/cheat/world/AutoSeelie.h +++ b/cheat-library/src/user/cheat/world/AutoSeelie.h @@ -4,8 +4,10 @@ #include #include +#include #include + namespace cheat::feature { @@ -13,6 +15,7 @@ namespace cheat::feature { public: config::Field> f_Enabled; + config::Field f_ElectroSeelie; static AutoSeelie& GetInstance(); @@ -24,10 +27,8 @@ namespace cheat::feature void OnGameUpdate(); private: - - std::vector m_Filters; AutoSeelie(); - int nextTime{}; + SafeValue nextTime; bool IsEntityForVac(cheat::game::Entity* entity); }; }