diff --git a/cheat-library/cheat-library.vcxproj b/cheat-library/cheat-library.vcxproj index 4b97d16..af6ba65 100644 --- a/cheat-library/cheat-library.vcxproj +++ b/cheat-library/cheat-library.vcxproj @@ -24,6 +24,7 @@ + false @@ -115,6 +116,7 @@ + false diff --git a/cheat-library/cheat-library.vcxproj.filters b/cheat-library/cheat-library.vcxproj.filters index 27e4666..7392f94 100644 --- a/cheat-library/cheat-library.vcxproj.filters +++ b/cheat-library/cheat-library.vcxproj.filters @@ -249,6 +249,9 @@ Header Files + + Header Files + @@ -456,6 +459,9 @@ Source Files + + Source Files + diff --git a/cheat-library/src/appdata/il2cpp-functions.h b/cheat-library/src/appdata/il2cpp-functions.h index b7fefa6..f13f8bc 100644 --- a/cheat-library/src/appdata/il2cpp-functions.h +++ b/cheat-library/src/appdata/il2cpp-functions.h @@ -155,6 +155,11 @@ DO_APP_FUNC(0x012BC260, void, CookingQtePageContext_CloseItemGotPanel, (CookingQ DO_APP_FUNC(0x02A37D50, Button_1*, ProfilePage, (MonoInLevelPlayerProfilePage* __this, MethodInfo* method)); // MonoInLevelPlayerProfilePage_get_logoutButton DO_APP_FUNC(0x01B101B0, void, ProfileEditPage, (MonoFriendInformationDialog* __this, Sprite* value, MethodInfo* method)); // MonoFriendInformationDialog_set_icon +// Custom Weather | RyujinZX#6666 +DO_APP_FUNC(0x027774F0, bool, EnviroSky_ChangeWeather, (void* /*app::EnviroSky*/ __this, String* weatherPath, float transTime, float ratio, MethodInfo* method)); +DO_APP_FUNC(0x014EDB10, void* /*app::EnviroSky*/, EnviroSky_get_Instance, (MethodInfo* method)); + + // Free Camera DO_APP_FUNC(0x057E9C00, float, Camera_get_fieldOfView, (Camera* __this, MethodInfo* method)); DO_APP_FUNC(0x057EA060, void, Camera_set_fieldOfView, (Camera* __this, float value, MethodInfo* method)); diff --git a/cheat-library/src/user/cheat/cheat.cpp b/cheat-library/src/user/cheat/cheat.cpp index a0f2093..5093d7f 100644 --- a/cheat-library/src/user/cheat/cheat.cpp +++ b/cheat-library/src/user/cheat/cheat.cpp @@ -42,6 +42,7 @@ #include #include +#include #include #include @@ -109,6 +110,8 @@ namespace cheat FEAT_INST(AutoFish), FEAT_INST(AutoCook), + FEAT_INST(CustomWeather), + FEAT_INST(NoFog), FEAT_INST(FPSUnlock), FEAT_INST(CameraZoom), diff --git a/cheat-library/src/user/cheat/game/filters.cpp b/cheat-library/src/user/cheat/game/filters.cpp index 6a0e1df..acb3964 100644 --- a/cheat-library/src/user/cheat/game/filters.cpp +++ b/cheat-library/src/user/cheat/game/filters.cpp @@ -529,5 +529,7 @@ namespace cheat::game::filters SimpleFilter OrganicTargets = { Monsters, Animals }; // Solael: Please don't mess around with this filter. //m0nkrel: We can choose the entities we need ourselves so as not to magnetize cats, dogs, etc. //AdvancedFilter Animals = { {EntityType__Enum_1::EnvAnimal, EntityType__Enum_1::Monster }, {"Crane", "Tit", "Boar", "Squirrel", "Fox", "Pigeon", "Wigeon", "Falcon" ,"Marten" } }; + + SimpleFilter Lightning = { EntityType__Enum_1::Lightning }; } } diff --git a/cheat-library/src/user/cheat/game/filters.h b/cheat-library/src/user/cheat/game/filters.h index 2910149..04d2f74 100644 --- a/cheat-library/src/user/cheat/game/filters.h +++ b/cheat-library/src/user/cheat/game/filters.h @@ -337,5 +337,6 @@ namespace cheat::game::filters extern SimpleFilter MonsterEquips; extern BlacklistFilter Living; extern SimpleFilter OrganicTargets; + extern SimpleFilter Lightning; } } \ No newline at end of file diff --git a/cheat-library/src/user/cheat/world/CustomWeather.cpp b/cheat-library/src/user/cheat/world/CustomWeather.cpp new file mode 100644 index 0000000..960a873 --- /dev/null +++ b/cheat-library/src/user/cheat/world/CustomWeather.cpp @@ -0,0 +1,114 @@ +#include "pch-il2cpp.h" +#include "CustomWeather.h" +#include +#include +#include +#include +#include + +namespace cheat::feature +{ + const char* WeatherType[]{ "ClearSky", "Cloudy", "Foggy", "Storm", "RainHeavy", "FountainRain", "SnowLight", "EastCoast" }; + std::string CustomWeather::GetWeather() { + switch (current_weather) + { + case 0: + return "Data/Environment/Weather/BigWorld/Weather_ClearSky"; + + case 1: + return "Data/Environment/Weather/BigWorld/Weather_Cloudy"; + + case 2: + return "Data/Environment/Weather/BigWorld/Weather_Foggy"; + + case 3: + return "Data/Environment/Weather/BigWorld/Weather_Storm"; + + case 4: + return "Data/Environment/Weather/BigWorld/Weather_Dq_Tabeisha_Rain_Heavy"; + + case 5: + return "Data/Environment/Weather/BigWorld/Weather_LY_Fountain_Rain"; + + case 6: + return "Data/Environment/Weather/BigWorld/Weather_Snowmountain_Snow_Light"; + + case 7: + return "Data/Environment/Weather/BigWorld/Weather_Snowmountain_EastCoast"; + + default: + return "Data/Environment/Weather/BigWorld/Weather_ClearSky"; + } + } + + CustomWeather::CustomWeather() : Feature(), + NF(f_Enabled, "Custom Weather", "World", false), + NF(f_Lightning, "Lightning", "World", false), + toBeUpdate(), nextUpdate(0) + { + events::GameUpdateEvent += MY_METHOD_HANDLER(CustomWeather::OnGameUpdate); + } + + const FeatureGUIInfo& CustomWeather::GetGUIInfo() const + { + static const FeatureGUIInfo info{ "CustomWeather", "Visuals", true }; + return info; + } + + void CustomWeather::DrawMain() + { + ConfigWidget(f_Enabled, "Custom Weather."); + if (f_Enabled) { + ImGui::Combo(("Weather Type"), ¤t_weather, WeatherType, ARRAYSIZE(WeatherType)); + } + ConfigWidget(f_Lightning, "Lightning target enemy, works with RainHeavy weather."); + } + + bool CustomWeather::NeedStatusDraw() const + { + return f_Enabled; + } + + void CustomWeather::DrawStatus() + { + ImGui::Text("Custom Weather"); + if (f_Lightning) + ImGui::Text("Lightning"); + } + + CustomWeather& CustomWeather::GetInstance() + { + static CustomWeather instance; + return instance; + } + + void CustomWeather::OnGameUpdate() + { + if (!f_Enabled) + return; + + auto currentTime = util::GetCurrentTimeMillisec(); + if (currentTime < nextUpdate) + return; + + auto Enviro = app::EnviroSky_get_Instance(nullptr); + if (Enviro != nullptr) { + app::EnviroSky_ChangeWeather(Enviro, string_to_il2cppi(GetWeather()), 1, 1, nullptr); + + if (f_Lightning && current_weather == 4) { + auto& manager = game::EntityManager::instance(); + + for (auto& Monsters : manager.entities(game::filters::combined::Monsters)) { + if (manager.avatar()->distance(Monsters) >= 30) + continue; + + for (auto& entity : manager.entities(game::filters::combined::Lightning)) { + entity->setRelativePosition(Monsters->relativePosition()); + } + } + } + } + + nextUpdate = currentTime + (int)f_DelayUpdate; + } +} \ No newline at end of file diff --git a/cheat-library/src/user/cheat/world/CustomWeather.h b/cheat-library/src/user/cheat/world/CustomWeather.h new file mode 100644 index 0000000..738b38a --- /dev/null +++ b/cheat-library/src/user/cheat/world/CustomWeather.h @@ -0,0 +1,28 @@ +#pragma once +#include +#include +#include + +namespace cheat::feature +{ + class CustomWeather : public Feature + { + public: + config::Field> f_Enabled; + config::Field> f_Lightning; + + static CustomWeather& GetInstance(); + const FeatureGUIInfo& GetGUIInfo() const override; + void DrawMain() override; + bool NeedStatusDraw() const override; + void DrawStatus() override; + private: + int current_weather; + std::string GetWeather(); + SafeQueue toBeUpdate; + SafeValue nextUpdate; + int f_DelayUpdate = 1; + void OnGameUpdate(); + CustomWeather(); + }; +} \ No newline at end of file