Updated all functions to 2.7
This commit is contained in:
parent
6ccf0056de
commit
bba76d3708
@ -15,13 +15,13 @@ cheat::GenshinCM& cheat::GenshinCM::instance()
|
|||||||
|
|
||||||
void cheat::GenshinCM::CursorSetVisibility(bool visibility)
|
void cheat::GenshinCM::CursorSetVisibility(bool visibility)
|
||||||
{
|
{
|
||||||
app::Cursor_set_visible(nullptr, visibility, nullptr);
|
app::Cursor_set_visible(visibility, nullptr);
|
||||||
app::Cursor_set_lockState(nullptr, visibility ? app::CursorLockMode__Enum::None : app::CursorLockMode__Enum::Locked, nullptr);
|
app::Cursor_set_lockState(visibility ? app::CursorLockMode__Enum::None : app::CursorLockMode__Enum::Locked, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cheat::GenshinCM::CursorGetVisibility()
|
bool cheat::GenshinCM::CursorGetVisibility()
|
||||||
{
|
{
|
||||||
return app::Cursor_get_visible(nullptr, nullptr);
|
return app::Cursor_get_visible(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
cheat::GenshinCM::GenshinCM() :
|
cheat::GenshinCM::GenshinCM() :
|
||||||
|
@ -31,7 +31,7 @@ namespace cheat::feature::esp::render
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
SAFE_BEGIN();
|
SAFE_BEGIN();
|
||||||
auto camera = app::Camera_get_main(nullptr, nullptr);
|
auto camera = app::Camera_get_main(nullptr);
|
||||||
if (camera == nullptr)
|
if (camera == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -58,8 +58,8 @@ namespace cheat::feature::esp::render
|
|||||||
if (pixelWidth == 0 || pixelHeight == 0)
|
if (pixelWidth == 0 || pixelHeight == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto screenWidth = app::Screen_get_width(nullptr, nullptr);
|
auto screenWidth = app::Screen_get_width(nullptr);
|
||||||
auto screenHeight = app::Screen_get_height(nullptr, nullptr);
|
auto screenHeight = app::Screen_get_height(nullptr);
|
||||||
|
|
||||||
if (screenWidth == 0 || screenHeight == 0)
|
if (screenWidth == 0 || screenHeight == 0)
|
||||||
return;
|
return;
|
||||||
@ -88,7 +88,7 @@ namespace cheat::feature::esp::render
|
|||||||
screenPos.y *= s_ResolutionScale.y;
|
screenPos.y *= s_ResolutionScale.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
screenPos.y = app::Screen_get_height(nullptr, nullptr) - screenPos.y;
|
screenPos.y = app::Screen_get_height(nullptr) - screenPos.y;
|
||||||
return screenPos;
|
return screenPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ namespace cheat::feature::esp::render
|
|||||||
|
|
||||||
// Sometimes occurs access violation in UnityPlayer.dll
|
// Sometimes occurs access violation in UnityPlayer.dll
|
||||||
// Callow: Have no idea what to do with it unless just catch exception
|
// Callow: Have no idea what to do with it unless just catch exception
|
||||||
auto bounds = app::Utils_1_GetBounds(nullptr, gameObject, nullptr);
|
auto bounds = app::Utils_4_GetBounds(gameObject, nullptr);
|
||||||
if (bounds.m_Extents.x < esp.f_MinSize &&
|
if (bounds.m_Extents.x < esp.f_MinSize &&
|
||||||
bounds.m_Extents.y < esp.f_MinSize &&
|
bounds.m_Extents.y < esp.f_MinSize &&
|
||||||
bounds.m_Extents.z < esp.f_MinSize)
|
bounds.m_Extents.z < esp.f_MinSize)
|
||||||
@ -216,7 +216,7 @@ namespace cheat::feature::esp::render
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto screenHeight = app::Screen_get_height(nullptr, nullptr);
|
auto screenHeight = app::Screen_get_height(nullptr);
|
||||||
|
|
||||||
#define FIX_Y(field) boxScreen.##field##.y = screenHeight - boxScreen.##field##.y
|
#define FIX_Y(field) boxScreen.##field##.y = screenHeight - boxScreen.##field##.y
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ namespace cheat::feature::esp::render
|
|||||||
boxRect.yMax *= s_ResolutionScale.y;
|
boxRect.yMax *= s_ResolutionScale.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto screenHeight = app::Screen_get_height(nullptr, nullptr);
|
auto screenHeight = app::Screen_get_height(nullptr);
|
||||||
boxRect.yMin = screenHeight - boxRect.yMin;
|
boxRect.yMin = screenHeight - boxRect.yMin;
|
||||||
boxRect.yMax = screenHeight - boxRect.yMax;
|
boxRect.yMax = screenHeight - boxRect.yMax;
|
||||||
return boxRect;
|
return boxRect;
|
||||||
|
@ -24,7 +24,7 @@ namespace cheat::game
|
|||||||
entityFilters[filter] = { false, 0 };
|
entityFilters[filter] = { false, 0 };
|
||||||
|
|
||||||
auto& entry = entityFilters[filter];
|
auto& entry = entityFilters[filter];
|
||||||
auto timestamp = app::GetTimestamp(nullptr, nullptr);
|
auto timestamp = app::TimeUtil_get_NowTimeStamp(nullptr);
|
||||||
if (entry.second + m_LifeTime > timestamp)
|
if (entry.second + m_LifeTime > timestamp)
|
||||||
return entry.first;
|
return entry.first;
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ namespace cheat::game
|
|||||||
if (m_RawEntity == nullptr)
|
if (m_RawEntity == nullptr)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return app::Miscs_GenLevelPos_1(nullptr, absolutePosition(), nullptr);
|
return app::Miscs_GenLevelPos_1(absolutePosition(), nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
float Entity::distance(Entity* entity)
|
float Entity::distance(Entity* entity)
|
||||||
@ -102,7 +102,7 @@ namespace cheat::game
|
|||||||
if (m_RawEntity == nullptr)
|
if (m_RawEntity == nullptr)
|
||||||
return 10000;
|
return 10000;
|
||||||
|
|
||||||
auto dist = app::Vector3_Distance(nullptr, relativePosition(), point, nullptr);
|
auto dist = app::Vector3_Distance(relativePosition(), point, nullptr);
|
||||||
return dist;
|
return dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ namespace cheat::game
|
|||||||
if (m_RawEntity == nullptr)
|
if (m_RawEntity == nullptr)
|
||||||
return 10000;
|
return 10000;
|
||||||
|
|
||||||
return app::Vector2_Distance(nullptr, levelPosition(), levelPoint, nullptr);
|
return app::Vector2_Distance(levelPosition(), levelPoint, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Entity::isGadget()
|
bool Entity::isGadget()
|
||||||
|
@ -29,7 +29,7 @@ namespace cheat::game
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto& config = waypoint.config->fields;
|
auto& config = waypoint.config->fields;
|
||||||
uint16_t areaId = app::SimpleSafeUInt16_get_Value(nullptr, config.areaIdRawNum, nullptr);
|
uint16_t areaId = app::SimpleSafeUInt16_get_Value(config.areaIdRawNum, nullptr);
|
||||||
bool isAreaUnlocked = app::MapModule_IsAreaUnlock(mapModule, sceneId, areaId, nullptr);
|
bool isAreaUnlocked = app::MapModule_IsAreaUnlock(mapModule, sceneId, areaId, nullptr);
|
||||||
|
|
||||||
if (waypoint.isUnlocked && isAreaUnlocked && !config._unlocked && !waypoint.isGroupLimit && !waypoint.isModelHidden)
|
if (waypoint.isUnlocked && isAreaUnlocked && !config._unlocked && !waypoint.isGroupLimit && !waypoint.isModelHidden)
|
||||||
@ -45,7 +45,7 @@ namespace cheat::game
|
|||||||
float minDistance = -1;
|
float minDistance = -1;
|
||||||
WaypointInfo result{};
|
WaypointInfo result{};
|
||||||
for (const auto& info : GetUnlockedWaypoints(targetSceneId)) {
|
for (const auto& info : GetUnlockedWaypoints(targetSceneId)) {
|
||||||
float distance = app::Vector3_Distance(nullptr, position, info.position, nullptr);
|
float distance = app::Vector3_Distance(position, info.position, nullptr);
|
||||||
if (minDistance < 0 || distance < minDistance)
|
if (minDistance < 0 || distance < minDistance)
|
||||||
{
|
{
|
||||||
minDistance = distance;
|
minDistance = distance;
|
||||||
|
@ -483,7 +483,7 @@ namespace cheat::feature
|
|||||||
if (nearestLabelPoint == nullptr)
|
if (nearestLabelPoint == nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
float distance = app::Vector2_Distance(nullptr, levelPosition, nearestLabelPoint->levelPosition, nullptr);
|
float distance = app::Vector2_Distance(levelPosition, nearestLabelPoint->levelPosition, nullptr);
|
||||||
if (distance < minDistance || minDistancePoint == nullptr)
|
if (distance < minDistance || minDistancePoint == nullptr)
|
||||||
{
|
{
|
||||||
minDistance = distance;
|
minDistance = distance;
|
||||||
@ -506,7 +506,7 @@ namespace cheat::feature
|
|||||||
if (!completed && point.completed)
|
if (!completed && point.completed)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
float distance = app::Vector2_Distance(nullptr, levelPosition, point.levelPosition, nullptr);
|
float distance = app::Vector2_Distance(levelPosition, point.levelPosition, nullptr);
|
||||||
if (distance < minDistance || minDistancePoint == nullptr)
|
if (distance < minDistance || minDistancePoint == nullptr)
|
||||||
{
|
{
|
||||||
minDistance = distance;
|
minDistance = distance;
|
||||||
@ -1274,11 +1274,11 @@ namespace cheat::feature
|
|||||||
|
|
||||||
static bool IsMapActive()
|
static bool IsMapActive()
|
||||||
{
|
{
|
||||||
auto uimanager = GET_SINGLETON(UIManager_1);
|
auto uimanager = GET_SINGLETON(UIManager);
|
||||||
if (uimanager == nullptr)
|
if (uimanager == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return app::UIManager_1_HasEnableMapCamera(uimanager, nullptr);
|
return app::UIManager_HasEnableMapCamera(uimanager, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static app::Rect s_MapViewRect = { 0, 0, 1, 1 };
|
static app::Rect s_MapViewRect = { 0, 0, 1, 1 };
|
||||||
@ -1300,8 +1300,8 @@ namespace cheat::feature
|
|||||||
screenPosition.y = (levelPosition.y - s_MapViewRect.m_YMin) / s_MapViewRect.m_Height;
|
screenPosition.y = (levelPosition.y - s_MapViewRect.m_YMin) / s_MapViewRect.m_Height;
|
||||||
|
|
||||||
// Scaling to screen position
|
// Scaling to screen position
|
||||||
screenPosition.x = screenPosition.x * app::Screen_get_width(nullptr, nullptr);
|
screenPosition.x = screenPosition.x * app::Screen_get_width(nullptr);
|
||||||
screenPosition.y = (1.0f - screenPosition.y) * app::Screen_get_height(nullptr, nullptr);
|
screenPosition.y = (1.0f - screenPosition.y) * app::Screen_get_height(nullptr);
|
||||||
|
|
||||||
return screenPosition;
|
return screenPosition;
|
||||||
}
|
}
|
||||||
@ -1491,8 +1491,8 @@ namespace cheat::feature
|
|||||||
if (m_ScenesData.count(sceneID) == 0)
|
if (m_ScenesData.count(sceneID) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImVec2 screenSize = { static_cast<float>(app::Screen_get_width(nullptr, nullptr)),
|
ImVec2 screenSize = { static_cast<float>(app::Screen_get_width(nullptr)),
|
||||||
static_cast<float>(app::Screen_get_height(nullptr, nullptr)) };
|
static_cast<float>(app::Screen_get_height(nullptr)) };
|
||||||
|
|
||||||
|
|
||||||
auto iconSize = (f_DynamicSize && s_MapViewRect.m_Width != 0.0f) ? f_IconSize * (relativeSizeX / s_MapViewRect.m_Width) : f_IconSize;
|
auto iconSize = (f_DynamicSize && s_MapViewRect.m_Width != 0.0f) ? f_IconSize * (relativeSizeX / s_MapViewRect.m_Width) : f_IconSize;
|
||||||
@ -1549,7 +1549,7 @@ namespace cheat::feature
|
|||||||
|
|
||||||
UPDATE_DELAY_VAR(ImCircle, _miniMapCircle, 2000);
|
UPDATE_DELAY_VAR(ImCircle, _miniMapCircle, 2000);
|
||||||
|
|
||||||
auto uiManager = GET_SINGLETON(UIManager_1);
|
auto uiManager = GET_SINGLETON(UIManager);
|
||||||
if (uiManager == nullptr || uiManager->fields._sceneCanvas == nullptr)
|
if (uiManager == nullptr || uiManager->fields._sceneCanvas == nullptr)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
@ -1559,7 +1559,7 @@ namespace cheat::feature
|
|||||||
|
|
||||||
auto mapPos = app::Transform_get_position(reinterpret_cast<app::Transform*>(back), nullptr);
|
auto mapPos = app::Transform_get_position(reinterpret_cast<app::Transform*>(back), nullptr);
|
||||||
auto center = app::Camera_WorldToScreenPoint(uiManager->fields._uiCamera, mapPos, nullptr);
|
auto center = app::Camera_WorldToScreenPoint(uiManager->fields._uiCamera, mapPos, nullptr);
|
||||||
center.y = app::Screen_get_height(nullptr, nullptr) - center.y;
|
center.y = app::Screen_get_height(nullptr) - center.y;
|
||||||
|
|
||||||
auto mapRect = app::RectTransform_get_rect(back, nullptr);
|
auto mapRect = app::RectTransform_get_rect(back, nullptr);
|
||||||
float scaleFactor = app::Canvas_get_scaleFactor(uiManager->fields._sceneCanvas, nullptr);
|
float scaleFactor = app::Canvas_get_scaleFactor(uiManager->fields._sceneCanvas, nullptr);
|
||||||
|
@ -152,7 +152,7 @@ namespace cheat::feature
|
|||||||
ImGui::Text("Object position: %s", il2cppi_to_string(location._pos).c_str());
|
ImGui::Text("Object position: %s", il2cppi_to_string(location._pos).c_str());
|
||||||
ImGui::Text("_unlocked: %s", location._unlocked ? "true" : "false");
|
ImGui::Text("_unlocked: %s", location._unlocked ? "true" : "false");
|
||||||
ImGui::Text("_groupLimit: %s", location._groupLimit ? "true" : "false");
|
ImGui::Text("_groupLimit: %s", location._groupLimit ? "true" : "false");
|
||||||
uint16_t areaId = app::SimpleSafeUInt16_get_Value(nullptr, location.areaIdRawNum, nullptr);
|
uint16_t areaId = app::SimpleSafeUInt16_get_Value(location.areaIdRawNum, nullptr);
|
||||||
ImGui::Text("areaId: %u", areaId);
|
ImGui::Text("areaId: %u", areaId);
|
||||||
ImGui::Text("areaUnlocked: %s", app::MapModule_IsAreaUnlock(singleton, sceneId, areaId, nullptr) ? "true" : "false");
|
ImGui::Text("areaUnlocked: %s", app::MapModule_IsAreaUnlock(singleton, sceneId, areaId, nullptr) ? "true" : "false");
|
||||||
ImGui::Text("gadgetIdRawNum: %u", location.gadgetIdRawNum);
|
ImGui::Text("gadgetIdRawNum: %u", location.gadgetIdRawNum);
|
||||||
@ -236,8 +236,8 @@ namespace cheat::feature
|
|||||||
auto combat = entity->combat();
|
auto combat = entity->combat();
|
||||||
if (combat != nullptr) {
|
if (combat != nullptr) {
|
||||||
auto combatProp = combat->fields._combatProperty_k__BackingField;
|
auto combatProp = combat->fields._combatProperty_k__BackingField;
|
||||||
auto maxHP = app::SafeFloat_GetValue(nullptr, combatProp->fields.maxHP, nullptr);
|
auto maxHP = app::SafeFloat_GetValue(combatProp->fields.maxHP, nullptr);
|
||||||
auto HP = app::SafeFloat_GetValue(nullptr, combatProp->fields.HP, nullptr);
|
auto HP = app::SafeFloat_GetValue(combatProp->fields.HP, nullptr);
|
||||||
auto isLockHp = combatProp->fields.islockHP == nullptr || app::FixedBoolStack_get_value(combatProp->fields.islockHP, nullptr);
|
auto isLockHp = combatProp->fields.islockHP == nullptr || app::FixedBoolStack_get_value(combatProp->fields.islockHP, nullptr);
|
||||||
auto isInvincible = combatProp->fields.isInvincible == nullptr || app::FixedBoolStack_get_value(combatProp->fields.isInvincible, nullptr);
|
auto isInvincible = combatProp->fields.isInvincible == nullptr || app::FixedBoolStack_get_value(combatProp->fields.isInvincible, nullptr);
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
@ -767,13 +767,13 @@ namespace cheat::feature
|
|||||||
|
|
||||||
void DrawPositionInfo()
|
void DrawPositionInfo()
|
||||||
{
|
{
|
||||||
auto avatarPos = app::ActorUtils_GetAvatarPos(nullptr, nullptr);
|
auto avatarPos = app::ActorUtils_GetAvatarPos(nullptr);
|
||||||
ImGui::Text("Avatar position: %s", il2cppi_to_string(avatarPos).c_str());
|
ImGui::Text("Avatar position: %s", il2cppi_to_string(avatarPos).c_str());
|
||||||
|
|
||||||
auto relativePos = app::WorldShiftManager_GetRelativePosition(nullptr, avatarPos, nullptr);
|
auto relativePos = app::WorldShiftManager_GetRelativePosition(avatarPos, nullptr);
|
||||||
ImGui::Text("Relative position: %s", il2cppi_to_string(relativePos).c_str());
|
ImGui::Text("Relative position: %s", il2cppi_to_string(relativePos).c_str());
|
||||||
|
|
||||||
auto levelPos = app::Miscs_GenLevelPos_1(nullptr, avatarPos, nullptr);
|
auto levelPos = app::Miscs_GenLevelPos_1(avatarPos, nullptr);
|
||||||
ImGui::Text("Level position: %s", il2cppi_to_string(levelPos).c_str());
|
ImGui::Text("Level position: %s", il2cppi_to_string(levelPos).c_str());
|
||||||
|
|
||||||
|
|
||||||
@ -782,7 +782,7 @@ namespace cheat::feature
|
|||||||
|
|
||||||
auto& teleport = MapTeleport::GetInstance();
|
auto& teleport = MapTeleport::GetInstance();
|
||||||
if (ImGui::Button("Map teleport"))
|
if (ImGui::Button("Map teleport"))
|
||||||
teleport.TeleportTo(app::Vector2 { teleportPos.x, teleportPos.y });
|
teleport.TeleportTo(app::Vector2{ teleportPos.x, teleportPos.y });
|
||||||
|
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|
||||||
@ -791,7 +791,7 @@ namespace cheat::feature
|
|||||||
|
|
||||||
if (ImGui::TreeNode("Ground pos info"))
|
if (ImGui::TreeNode("Ground pos info"))
|
||||||
{
|
{
|
||||||
auto groundNormal = app::Miscs_CalcCurrentGroundNorm(nullptr, avatarPos, nullptr);
|
auto groundNormal = app::Miscs_CalcCurrentGroundNorm(avatarPos, nullptr);
|
||||||
ImGui::Text("Ground normal: %s", il2cppi_to_string(groundNormal).c_str());
|
ImGui::Text("Ground normal: %s", il2cppi_to_string(groundNormal).c_str());
|
||||||
|
|
||||||
static app::Vector3 pos{};
|
static app::Vector3 pos{};
|
||||||
@ -807,7 +807,7 @@ namespace cheat::feature
|
|||||||
static float length = 1000;
|
static float length = 1000;
|
||||||
ImGui::DragFloat("Raycast length", &length, 1.0f, -2000.0f, 2000.0f);
|
ImGui::DragFloat("Raycast length", &length, 1.0f, -2000.0f, 2000.0f);
|
||||||
|
|
||||||
ImGui::Text("All: %f", app::Miscs_CalcCurrentGroundHeight_1(nullptr, avatarPos.x, avatarPos.z, avatarPos.y, length, 0xFFFFFFFF, nullptr));
|
ImGui::Text("All: %f", app::Miscs_CalcCurrentGroundHeight_1(avatarPos.x, avatarPos.z, avatarPos.y, length, 0xFFFFFFFF, nullptr));
|
||||||
|
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
@ -819,7 +819,7 @@ namespace cheat::feature
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Copy All Info"))
|
if (ImGui::Button("Copy All Info"))
|
||||||
{
|
{
|
||||||
auto text = il2cppi_to_string(avatarPos) + "\n" + il2cppi_to_string(relativePos) + "\n" + il2cppi_to_string(levelPos) + "\n" + il2cppi_to_string(app::Miscs_CalcCurrentGroundNorm(nullptr, avatarPos, nullptr));
|
auto text = il2cppi_to_string(avatarPos) + "\n" + il2cppi_to_string(relativePos) + "\n" + il2cppi_to_string(levelPos) + "\n" + il2cppi_to_string(app::Miscs_CalcCurrentGroundNorm(avatarPos, nullptr));
|
||||||
ImGui::SetClipboardText(text.c_str());
|
ImGui::SetClipboardText(text.c_str());
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
@ -979,13 +979,13 @@ namespace cheat::feature
|
|||||||
auto config = tree->fields._config->fields;
|
auto config = tree->fields._config->fields;
|
||||||
|
|
||||||
auto pattern = config._._.scenePropPatternName;
|
auto pattern = config._._.scenePropPatternName;
|
||||||
app::ECGLPBEEEAA__Enum value;
|
app::MoleMole_Config_TreeType__Enum value;
|
||||||
bool result = app::ScenePropManager_GetTreeTypeByPattern(scenePropManager, pattern, &value, nullptr);
|
bool result = app::ScenePropManager_GetTreeTypeByPattern(scenePropManager, pattern, &value, nullptr);
|
||||||
if (!result)
|
if (!result)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ImGui::Text("Tree at %s, type: %s, distance %0.3f", il2cppi_to_string(pos).c_str(), magic_enum::enum_name(value).data(),
|
ImGui::Text("Tree at %s, type: %s, distance %0.3f", il2cppi_to_string(pos).c_str(), magic_enum::enum_name(value).data(),
|
||||||
manager.avatar()->distance(app::WorldShiftManager_GetRelativePosition(nullptr, pos, nullptr)));
|
manager.avatar()->distance(app::WorldShiftManager_GetRelativePosition(pos, nullptr)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1033,7 +1033,7 @@ namespace cheat::feature
|
|||||||
|
|
||||||
nlohmann::json jRoot;
|
nlohmann::json jRoot;
|
||||||
try {
|
try {
|
||||||
jRoot =nlohmann::json::parse(fs);
|
jRoot = nlohmann::json::parse(fs);
|
||||||
}
|
}
|
||||||
catch (nlohmann::detail::parse_error& parseError)
|
catch (nlohmann::detail::parse_error& parseError)
|
||||||
{
|
{
|
||||||
@ -1217,7 +1217,7 @@ namespace cheat::feature
|
|||||||
|
|
||||||
void DrawFPSGraph()
|
void DrawFPSGraph()
|
||||||
{
|
{
|
||||||
static float values[120] = {0};
|
static float values[120] = { 0 };
|
||||||
static int values_offset = 0;
|
static int values_offset = 0;
|
||||||
values[values_offset++] = ImGui::GetIO().Framerate;
|
values[values_offset++] = ImGui::GetIO().Framerate;
|
||||||
if (values_offset >= IM_ARRAYSIZE(values))
|
if (values_offset >= IM_ARRAYSIZE(values))
|
||||||
|
@ -24,7 +24,7 @@ namespace cheat::feature
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
LOG_TRACE("Emulating call of RecordUserData with type %d", i);
|
LOG_TRACE("Emulating call of RecordUserData with type %d", i);
|
||||||
app::Application_RecordUserData(nullptr, i, nullptr);
|
app::Application_RecordUserData(i, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (m_Enabled) {
|
// if (m_Enabled) {
|
||||||
|
@ -183,7 +183,7 @@ namespace cheat::feature
|
|||||||
byteArray->max_length = length;
|
byteArray->max_length = length;
|
||||||
memcpy_s(byteArray->vector, length, content, length);
|
memcpy_s(byteArray->vector, length, content, length);
|
||||||
|
|
||||||
app::Packet_XorEncrypt(nullptr, &byteArray, length, nullptr);
|
app::Packet_XorEncrypt(&byteArray, length, nullptr);
|
||||||
|
|
||||||
auto result = new char[length];
|
auto result = new char[length];
|
||||||
memcpy_s(result, length, byteArray->vector, length);
|
memcpy_s(result, length, byteArray->vector, length);
|
||||||
@ -249,13 +249,13 @@ namespace cheat::feature
|
|||||||
return sniffer.OnPacketIO(evt->_evt.packet, PacketIOType::Receive);
|
return sniffer.OnPacketIO(evt->_evt.packet, PacketIOType::Receive);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t PacketSniffer::KcpNative_kcp_client_send_packet_Hook(void* __this, void* kcp_client, app::KcpPacket_1* packet, MethodInfo* method)
|
int32_t PacketSniffer::KcpNative_kcp_client_send_packet_Hook(void* kcp_client, app::KcpPacket_1* packet, MethodInfo* method)
|
||||||
{
|
{
|
||||||
auto& sniffer = GetInstance();
|
auto& sniffer = GetInstance();
|
||||||
if (!sniffer.OnPacketIO(packet, PacketIOType::Send))
|
if (!sniffer.OnPacketIO(packet, PacketIOType::Send))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return CALL_ORIGIN(KcpNative_kcp_client_send_packet_Hook, __this, kcp_client, packet, method);
|
return CALL_ORIGIN(KcpNative_kcp_client_send_packet_Hook, kcp_client, packet, method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ namespace cheat::feature
|
|||||||
|
|
||||||
static char* EncryptXor(void* content, uint32_t length);
|
static char* EncryptXor(void* content, uint32_t length);
|
||||||
static bool KcpClient_TryDequeueEvent_Hook(void* __this, app::ClientKcpEvent* evt, MethodInfo* method);
|
static bool KcpClient_TryDequeueEvent_Hook(void* __this, app::ClientKcpEvent* evt, MethodInfo* method);
|
||||||
static int32_t KcpNative_kcp_client_send_packet_Hook(void* __this, void* kcp_client, app::KcpPacket_1* packet, MethodInfo* method);
|
static int32_t KcpNative_kcp_client_send_packet_Hook(void* kcp_client, app::KcpPacket_1* packet, MethodInfo* method);
|
||||||
|
|
||||||
bool OnPacketIO(app::KcpPacket_1* packet, PacketIOType type);
|
bool OnPacketIO(app::KcpPacket_1* packet, PacketIOType type);
|
||||||
};
|
};
|
||||||
|
@ -128,11 +128,11 @@ namespace cheat::feature
|
|||||||
NoCD& noCD = NoCD::GetInstance();
|
NoCD& noCD = NoCD::GetInstance();
|
||||||
if (noCD.f_AbilityReduce)
|
if (noCD.f_AbilityReduce)
|
||||||
{
|
{
|
||||||
auto cdTimer = app::SafeFloat_GetValue(nullptr, skillInfo->fields.cdTimer, nullptr);
|
auto cdTimer = app::SafeFloat_GetValue(skillInfo->fields.cdTimer, nullptr);
|
||||||
|
|
||||||
if (cdTimer > noCD.f_TimerReduce * 5.0f)
|
if (cdTimer > noCD.f_TimerReduce * 5.0f)
|
||||||
{
|
{
|
||||||
struct app::SafeFloat MyValueProtect = app::SafeFloat_SetValue(nullptr, noCD.f_TimerReduce * 5.0f, nullptr);
|
struct app::SafeFloat MyValueProtect = app::SafeFloat_SetValue(noCD.f_TimerReduce * 5.0f, nullptr);
|
||||||
skillInfo->fields.cdTimer = MyValueProtect;
|
skillInfo->fields.cdTimer = MyValueProtect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ namespace cheat::feature
|
|||||||
if (IsVectorZero(prevPos))
|
if (IsVectorZero(prevPos))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float deltaTime = app::Time_get_deltaTime(nullptr, nullptr);
|
float deltaTime = app::Time_get_deltaTime(nullptr);
|
||||||
|
|
||||||
app::Vector3 newPos = prevPos + dir * speed * deltaTime;
|
app::Vector3 newPos = prevPos + dir * speed * deltaTime;
|
||||||
if (!f_VelocityMode)
|
if (!f_VelocityMode)
|
||||||
|
@ -121,7 +121,7 @@ namespace cheat::feature
|
|||||||
return f_Multiplier;
|
return f_Multiplier;
|
||||||
|
|
||||||
auto safeHP = baseCombat->fields._combatProperty_k__BackingField->fields.HP;
|
auto safeHP = baseCombat->fields._combatProperty_k__BackingField->fields.HP;
|
||||||
auto HP = app::SafeFloat_GetValue(nullptr, safeHP, nullptr);
|
auto HP = app::SafeFloat_GetValue(safeHP, nullptr);
|
||||||
int attackCount = (int)ceil(HP / attackDamage);
|
int attackCount = (int)ceil(HP / attackDamage);
|
||||||
return std::clamp(attackCount, 1, 200);
|
return std::clamp(attackCount, 1, 200);
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ namespace cheat::feature
|
|||||||
static std::string teleportName;
|
static std::string teleportName;
|
||||||
ImGui::InputText("Teleport name", &teleportName);
|
ImGui::InputText("Teleport name", &teleportName);
|
||||||
static std::vector<std::pair<std::string, app::Vector3>> teleports;
|
static std::vector<std::pair<std::string, app::Vector3>> teleports;
|
||||||
app::Vector3 pos = app::ActorUtils_GetAvatarPos(nullptr, nullptr);
|
app::Vector3 pos = app::ActorUtils_GetAvatarPos(nullptr);
|
||||||
if (ImGui::Button("Add teleport"))
|
if (ImGui::Button("Add teleport"))
|
||||||
{
|
{
|
||||||
// check if already added
|
// check if already added
|
||||||
|
@ -10,12 +10,12 @@ namespace cheat::feature
|
|||||||
{
|
{
|
||||||
static void InLevelMapPageContext_OnMapClicked_Hook(app::InLevelMapPageContext* __this, app::Vector2 screenPos, MethodInfo* method);
|
static void InLevelMapPageContext_OnMapClicked_Hook(app::InLevelMapPageContext* __this, app::Vector2 screenPos, MethodInfo* method);
|
||||||
static void InLevelMapPageContext_OnMarkClicked_Hook(app::InLevelMapPageContext* __this, app::MonoMapMark* mark, MethodInfo* method);
|
static void InLevelMapPageContext_OnMarkClicked_Hook(app::InLevelMapPageContext* __this, app::MonoMapMark* mark, MethodInfo* method);
|
||||||
static app::Vector3 LocalEntityInfoData_GetTargetPos_Hook(app::LocalEntityInfoData* __this, MethodInfo* method);
|
static app::Vector3 LocalEntityInfoData_get_initPos_Hook(app::LocalEntityInfoData* __this, MethodInfo* method);
|
||||||
|
|
||||||
static bool LoadingManager_NeedTransByServer_Hook(app::LoadingManager* __this, uint32_t sceneId, app::Vector3 position, MethodInfo* method);
|
static bool LoadingManager_NeedTransByServer_Hook(app::LoadingManager* __this, uint32_t sceneId, app::Vector3 position, MethodInfo* method);
|
||||||
static void LoadingManager_PerformPlayerTransmit_Hook(app::LoadingManager* __this, app::Vector3 position, app::EnterType__Enum someEnum,
|
static void LoadingManager_PerformPlayerTransmit_Hook(app::LoadingManager* __this, app::Vector3 position, app::EnterType__Enum someEnum,
|
||||||
uint32_t someUint1, app::EvtTransmitAvatar_EvtTransmitAvatar_TransmitType__Enum teleportType, uint32_t someUint2, MethodInfo* method);
|
uint32_t someUint1, app::EvtTransmitAvatar_EvtTransmitAvatar_TransmitType__Enum teleportType, uint32_t someUint2, MethodInfo* method);
|
||||||
static void Entity_SetPosition_Hook(app::BaseEntity* __this, app::Vector3 position, bool someBool, MethodInfo* method);
|
static void Entity_SetRelativePosition_Hook(app::BaseEntity* __this, app::Vector3 position, bool someBool, MethodInfo* method);
|
||||||
|
|
||||||
MapTeleport::MapTeleport() : Feature(),
|
MapTeleport::MapTeleport() : Feature(),
|
||||||
NF(f_Enabled, "Map teleport", "MapTeleport", false),
|
NF(f_Enabled, "Map teleport", "MapTeleport", false),
|
||||||
@ -28,21 +28,21 @@ namespace cheat::feature
|
|||||||
HookManager::install(app::InLevelMapPageContext_OnMapClicked, InLevelMapPageContext_OnMapClicked_Hook);
|
HookManager::install(app::InLevelMapPageContext_OnMapClicked, InLevelMapPageContext_OnMapClicked_Hook);
|
||||||
|
|
||||||
// Stage 1
|
// Stage 1
|
||||||
HookManager::install(app::LocalEntityInfoData_GetTargetPos, LocalEntityInfoData_GetTargetPos_Hook);
|
HookManager::install(app::LocalEntityInfoData_get_initPos, LocalEntityInfoData_get_initPos_Hook);
|
||||||
HookManager::install(app::LoadingManager_NeedTransByServer, LoadingManager_NeedTransByServer_Hook);
|
HookManager::install(app::LoadingManager_NeedTransByServer, LoadingManager_NeedTransByServer_Hook);
|
||||||
|
|
||||||
// Stage 2
|
// Stage 2
|
||||||
HookManager::install(app::LoadingManager_PerformPlayerTransmit, LoadingManager_PerformPlayerTransmit_Hook);
|
HookManager::install(app::LoadingManager_PerformPlayerTransmit, LoadingManager_PerformPlayerTransmit_Hook);
|
||||||
|
|
||||||
// Stage 3
|
// Stage 3
|
||||||
HookManager::install(app::Entity_SetPosition, Entity_SetPosition_Hook);
|
HookManager::install(app::Entity_SetRelativePosition, Entity_SetRelativePosition_Hook);
|
||||||
|
|
||||||
events::GameUpdateEvent += MY_METHOD_HANDLER(MapTeleport::OnGameUpdate);
|
events::GameUpdateEvent += MY_METHOD_HANDLER(MapTeleport::OnGameUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
const FeatureGUIInfo& MapTeleport::GetGUIInfo() const
|
const FeatureGUIInfo& MapTeleport::GetGUIInfo() const
|
||||||
{
|
{
|
||||||
static const FeatureGUIInfo info { "Map Teleport", "Teleport", true };
|
static const FeatureGUIInfo info{ "Map Teleport", "Teleport", true };
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ namespace cheat::feature
|
|||||||
{
|
{
|
||||||
LOG_DEBUG("Stage 0. Target location at %s", il2cppi_to_string(position).c_str());
|
LOG_DEBUG("Stage 0. Target location at %s", il2cppi_to_string(position).c_str());
|
||||||
|
|
||||||
auto avatarPosition = app::ActorUtils_GetAvatarPos(nullptr, nullptr);
|
auto avatarPosition = app::ActorUtils_GetAvatarPos(nullptr);
|
||||||
auto nearestWaypoint = game::FindNearestWaypoint(position, sceneId);
|
auto nearestWaypoint = game::FindNearestWaypoint(position, sceneId);
|
||||||
|
|
||||||
if (nearestWaypoint.data == nullptr)
|
if (nearestWaypoint.data == nullptr)
|
||||||
@ -109,7 +109,7 @@ namespace cheat::feature
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float dist = app::Vector3_Distance(nullptr, position, nearestWaypoint.position, nullptr);
|
float dist = app::Vector3_Distance(position, nearestWaypoint.position, nullptr);
|
||||||
LOG_DEBUG("Stage 0. Found nearest waypoint { sceneId: %d; waypointId: %d } with distance %fm.",
|
LOG_DEBUG("Stage 0. Found nearest waypoint { sceneId: %d; waypointId: %d } with distance %fm.",
|
||||||
nearestWaypoint.sceneId, nearestWaypoint.waypointId, dist);
|
nearestWaypoint.sceneId, nearestWaypoint.waypointId, dist);
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ namespace cheat::feature
|
|||||||
if (!mapBackground)
|
if (!mapBackground)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
auto uimanager = GET_SINGLETON(UIManager_1);
|
auto uimanager = GET_SINGLETON(UIManager);
|
||||||
if (uimanager == nullptr)
|
if (uimanager == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -149,10 +149,10 @@ namespace cheat::feature
|
|||||||
|
|
||||||
void MapTeleport::TeleportTo(app::Vector2 mapPosition)
|
void MapTeleport::TeleportTo(app::Vector2 mapPosition)
|
||||||
{
|
{
|
||||||
auto worldPosition = app::Miscs_GenWorldPos(nullptr, mapPosition, nullptr);
|
auto worldPosition = app::Miscs_GenWorldPos(mapPosition, nullptr);
|
||||||
|
|
||||||
auto relativePos = app::WorldShiftManager_GetRelativePosition(nullptr, worldPosition, nullptr);
|
auto relativePos = app::WorldShiftManager_GetRelativePosition(worldPosition, nullptr);
|
||||||
auto groundHeight = app::Miscs_CalcCurrentGroundHeight(nullptr, relativePos.x, relativePos.z, nullptr);
|
auto groundHeight = app::Miscs_CalcCurrentGroundHeight(relativePos.x, relativePos.z, nullptr);
|
||||||
|
|
||||||
TeleportTo({ worldPosition.x, groundHeight > 0 ? groundHeight + 5 : f_DefaultHeight, worldPosition.z }, true, game::GetCurrentMapSceneID());
|
TeleportTo({ worldPosition.x, groundHeight > 0 ? groundHeight + 5 : f_DefaultHeight, worldPosition.z }, true, game::GetCurrentMapSceneID());
|
||||||
}
|
}
|
||||||
@ -232,17 +232,17 @@ namespace cheat::feature
|
|||||||
|
|
||||||
if (taskInfo.needHeightCalculation)
|
if (taskInfo.needHeightCalculation)
|
||||||
{
|
{
|
||||||
auto relativePos = app::WorldShiftManager_GetRelativePosition(nullptr, position, nullptr);
|
auto relativePos = app::WorldShiftManager_GetRelativePosition(position, nullptr);
|
||||||
float groundHeight;
|
float groundHeight;
|
||||||
switch (taskInfo.sceneId)
|
switch (taskInfo.sceneId)
|
||||||
{
|
{
|
||||||
// Underground mines has tunnel structure, so we need to calculate height from waypoint height to prevent tp above world.
|
// Underground mines has tunnel structure, so we need to calculate height from waypoint height to prevent tp above world.
|
||||||
case 6: // Underground mines scene id, if it was changed, please create issue
|
case 6: // Underground mines scene id, if it was changed, please create issue
|
||||||
groundHeight = app::Miscs_CalcCurrentGroundHeight_1(nullptr, relativePos.x, relativePos.z, originPosition.y, 100,
|
groundHeight = app::Miscs_CalcCurrentGroundHeight_1(relativePos.x, relativePos.z, originPosition.y, 100,
|
||||||
app::Miscs_GetSceneGroundLayerMask(nullptr, nullptr), nullptr);
|
app::Miscs_GetSceneGroundLayerMask(nullptr), nullptr);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
groundHeight = app::Miscs_CalcCurrentGroundWaterHeight(nullptr, relativePos.x, relativePos.z, nullptr);
|
groundHeight = app::Miscs_CalcCurrentGroundWaterHeight(relativePos.x, relativePos.z, nullptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (groundHeight > 0 && position.y != groundHeight)
|
if (groundHeight > 0 && position.y != groundHeight)
|
||||||
@ -257,9 +257,9 @@ namespace cheat::feature
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static app::Vector3 LocalEntityInfoData_GetTargetPos_Hook(app::LocalEntityInfoData* __this, MethodInfo* method)
|
static app::Vector3 LocalEntityInfoData_get_initPos_Hook(app::LocalEntityInfoData* __this, MethodInfo* method)
|
||||||
{
|
{
|
||||||
auto result = CALL_ORIGIN(LocalEntityInfoData_GetTargetPos_Hook, __this, method);
|
auto result = CALL_ORIGIN(LocalEntityInfoData_get_initPos_Hook, __this, method);
|
||||||
|
|
||||||
MapTeleport& mapTeleport = MapTeleport::GetInstance();
|
MapTeleport& mapTeleport = MapTeleport::GetInstance();
|
||||||
mapTeleport.OnGetTargetPos(result);
|
mapTeleport.OnGetTargetPos(result);
|
||||||
@ -288,7 +288,7 @@ namespace cheat::feature
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void Entity_SetPosition_Hook(app::BaseEntity* __this, app::Vector3 position, bool someBool, MethodInfo* method)
|
static void Entity_SetRelativePosition_Hook(app::BaseEntity* __this, app::Vector3 position, bool someBool, MethodInfo* method)
|
||||||
{
|
{
|
||||||
auto& manager = game::EntityManager::instance();
|
auto& manager = game::EntityManager::instance();
|
||||||
if (manager.avatar()->raw() == __this)
|
if (manager.avatar()->raw() == __this)
|
||||||
@ -297,7 +297,7 @@ namespace cheat::feature
|
|||||||
mapTeleport.OnSetAvatarPosition(position);
|
mapTeleport.OnSetAvatarPosition(position);
|
||||||
}
|
}
|
||||||
|
|
||||||
CALL_ORIGIN(Entity_SetPosition_Hook, __this, position, someBool, method);
|
CALL_ORIGIN(Entity_SetRelativePosition_Hook, __this, position, someBool, method);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ namespace cheat::feature
|
|||||||
AutoCook& autoCook = AutoCook::GetInstance();
|
AutoCook& autoCook = AutoCook::GetInstance();
|
||||||
if (autoCook.f_Enabled)
|
if (autoCook.f_Enabled)
|
||||||
{
|
{
|
||||||
uint32_t maxCount = app::SimpleSafeUInt32_get_Value(nullptr, __this->fields.maxProficiencyRawNum, nullptr);
|
uint32_t maxCount = app::SimpleSafeUInt32_get_Value(__this->fields.maxProficiencyRawNum, nullptr);
|
||||||
autoCook.CookCount = maxCount;
|
autoCook.CookCount = maxCount;
|
||||||
}
|
}
|
||||||
return CALL_ORIGIN(CookRecipeExcelConfig_get_maxProficiency, __this, method);
|
return CALL_ORIGIN(CookRecipeExcelConfig_get_maxProficiency, __this, method);
|
||||||
|
@ -91,7 +91,7 @@ namespace cheat::feature
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::lock_guard<std::mutex> catchLock(autoFish.m_BattleFinishTimestampMutex);
|
std::lock_guard<std::mutex> catchLock(autoFish.m_BattleFinishTimestampMutex);
|
||||||
autoFish.m_BattleFinishTimestamp = app::GetTimestamp(nullptr, nullptr) + autoFish.f_DelayBeforeCatch;
|
autoFish.m_BattleFinishTimestamp = app::TimeUtil_get_NowTimeStamp(nullptr) + autoFish.f_DelayBeforeCatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoFish::FishingModule_OnFishBattleEndRsp_Hook(void* __this, app::FishBattleEndRsp* rsp, MethodInfo* method)
|
void AutoFish::FishingModule_OnFishBattleEndRsp_Hook(void* __this, app::FishBattleEndRsp* rsp, MethodInfo* method)
|
||||||
@ -115,7 +115,7 @@ namespace cheat::feature
|
|||||||
{
|
{
|
||||||
LOG_WARNING("Failed to catch fish, retrying in %u ms", autoFish.f_DelayBeforeCatch);
|
LOG_WARNING("Failed to catch fish, retrying in %u ms", autoFish.f_DelayBeforeCatch);
|
||||||
std::lock_guard<std::mutex> catchLock(autoFish.m_BattleFinishTimestampMutex);
|
std::lock_guard<std::mutex> catchLock(autoFish.m_BattleFinishTimestampMutex);
|
||||||
autoFish.m_BattleFinishTimestamp = app::GetTimestamp(nullptr, nullptr) + autoFish.f_DelayBeforeCatch;
|
autoFish.m_BattleFinishTimestamp = app::TimeUtil_get_NowTimeStamp(nullptr) + autoFish.f_DelayBeforeCatch;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ namespace cheat::feature
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
std::lock_guard<std::mutex> _lock(autoFish.m_RecastTimestampMutex);
|
std::lock_guard<std::mutex> _lock(autoFish.m_RecastTimestampMutex);
|
||||||
autoFish.m_RecastTimestamp = app::GetTimestamp(nullptr, nullptr) + autoFish.f_DelayBeforeRecast;
|
autoFish.m_RecastTimestamp = app::TimeUtil_get_NowTimeStamp(nullptr) + autoFish.f_DelayBeforeRecast;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoFish::FishingModule_OnExitFishingRsp_Hook(void* __this, void* rsp, MethodInfo* method)
|
void AutoFish::FishingModule_OnExitFishingRsp_Hook(void* __this, void* rsp, MethodInfo* method)
|
||||||
@ -154,7 +154,7 @@ namespace cheat::feature
|
|||||||
|
|
||||||
void AutoFish::OnGameUpdate()
|
void AutoFish::OnGameUpdate()
|
||||||
{
|
{
|
||||||
auto timestamp = app::GetTimestamp(nullptr, nullptr);
|
auto timestamp = app::TimeUtil_get_NowTimeStamp(nullptr);
|
||||||
|
|
||||||
std::lock_guard<std::mutex> _lock(m_BattleFinishTimestampMutex);
|
std::lock_guard<std::mutex> _lock(m_BattleFinishTimestampMutex);
|
||||||
std::lock_guard<std::mutex> _lock2(m_RecastTimestampMutex);
|
std::lock_guard<std::mutex> _lock2(m_RecastTimestampMutex);
|
||||||
|
@ -14,7 +14,7 @@ namespace cheat::feature
|
|||||||
NF(m_Enabled, "Auto tree farm", "AutoTreeFarm", false),
|
NF(m_Enabled, "Auto tree farm", "AutoTreeFarm", false),
|
||||||
NF(m_AttackDelay, "Attack delay", "AutoTreeFarm", 150),
|
NF(m_AttackDelay, "Attack delay", "AutoTreeFarm", 150),
|
||||||
NF(m_RepeatDelay, "Repeat delay", "AutoTreeFarm", 500),
|
NF(m_RepeatDelay, "Repeat delay", "AutoTreeFarm", 500),
|
||||||
NF(m_AttackPerTree,"Attack per tree", "AutoTreeFarm", 5),
|
NF(m_AttackPerTree, "Attack per tree", "AutoTreeFarm", 5),
|
||||||
NF(m_Range, "Range", "AutoTreeFarm", 15.0f)
|
NF(m_Range, "Range", "AutoTreeFarm", 15.0f)
|
||||||
{
|
{
|
||||||
events::GameUpdateEvent += MY_METHOD_HANDLER(AutoTreeFarm::OnGameUpdate);
|
events::GameUpdateEvent += MY_METHOD_HANDLER(AutoTreeFarm::OnGameUpdate);
|
||||||
@ -126,7 +126,7 @@ namespace cheat::feature
|
|||||||
static std::unordered_set<app::SceneTreeObject*> s_AttackQueueSet;
|
static std::unordered_set<app::SceneTreeObject*> s_AttackQueueSet;
|
||||||
static uint64_t s_LastAttackTimestamp = 0;
|
static uint64_t s_LastAttackTimestamp = 0;
|
||||||
|
|
||||||
uint64_t timestamp = app::GetTimestamp(nullptr, nullptr);
|
uint64_t timestamp = app::TimeUtil_get_NowTimeStamp(nullptr);
|
||||||
if (!m_Enabled || s_LastAttackTimestamp + m_AttackDelay > timestamp)
|
if (!m_Enabled || s_LastAttackTimestamp + m_AttackDelay > timestamp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ namespace cheat::feature
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto position = tree->fields._.realBounds.m_Center;
|
auto position = tree->fields._.realBounds.m_Center;
|
||||||
if (manager.avatar()->distance(app::WorldShiftManager_GetRelativePosition(nullptr, position, nullptr)) > m_Range)
|
if (manager.avatar()->distance(app::WorldShiftManager_GetRelativePosition(position, nullptr)) > m_Range)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
s_AttackQueueSet.insert(tree);
|
s_AttackQueueSet.insert(tree);
|
||||||
@ -163,10 +163,10 @@ namespace cheat::feature
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto position = tree->fields._.realBounds.m_Center;
|
auto position = tree->fields._.realBounds.m_Center;
|
||||||
if (manager.avatar()->distance(app::WorldShiftManager_GetRelativePosition(nullptr, position, nullptr)) > m_Range)
|
if (manager.avatar()->distance(app::WorldShiftManager_GetRelativePosition(position, nullptr)) > m_Range)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
app::ECGLPBEEEAA__Enum treeType;
|
app::MoleMole_Config_TreeType__Enum treeType;
|
||||||
auto pattern = tree->fields._config->fields._._.scenePropPatternName;
|
auto pattern = tree->fields._config->fields._._.scenePropPatternName;
|
||||||
if (!app::ScenePropManager_GetTreeTypeByPattern(scenePropManager, pattern, &treeType, nullptr))
|
if (!app::ScenePropManager_GetTreeTypeByPattern(scenePropManager, pattern, &treeType, nullptr))
|
||||||
continue;
|
continue;
|
||||||
|
@ -77,7 +77,7 @@ namespace cheat::feature
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (f_FastDialog)
|
if (f_FastDialog)
|
||||||
app::Time_set_timeScale(nullptr, f_TimeSpeedup, nullptr);
|
app::Time_set_timeScale(f_TimeSpeedup, nullptr);
|
||||||
|
|
||||||
bool isImportant = false;
|
bool isImportant = false;
|
||||||
if (f_ExcludeImportant)
|
if (f_ExcludeImportant)
|
||||||
@ -107,7 +107,7 @@ namespace cheat::feature
|
|||||||
{
|
{
|
||||||
int32_t value = 0;
|
int32_t value = 0;
|
||||||
auto object = il2cpp_value_box((Il2CppClass*)*app::Int32__TypeInfo, &value);
|
auto object = il2cpp_value_box((Il2CppClass*)*app::Int32__TypeInfo, &value);
|
||||||
auto notify = app::Notify_CreateNotify_1(nullptr, app::MoleMole_NotifyTypes__Enum::DialogSelectItemNotify, (app::Object*)object, nullptr);
|
auto notify = app::Notify_CreateNotify_1(app::MoleMole_NotifyTypes__Enum::DialogSelectItemNotify, (app::Object*)object, nullptr);
|
||||||
app::TalkDialogContext_OnDialogSelectItem(talkDialog, ¬ify, nullptr);
|
app::TalkDialogContext_OnDialogSelectItem(talkDialog, ¬ify, nullptr);
|
||||||
}
|
}
|
||||||
else if (!talkDialog->fields._inSelect)
|
else if (!talkDialog->fields._inSelect)
|
||||||
@ -126,9 +126,9 @@ namespace cheat::feature
|
|||||||
// Should be a better way to store the pre-dialog speed using Time_get_timeScale.
|
// Should be a better way to store the pre-dialog speed using Time_get_timeScale.
|
||||||
static void InLevelCutScenePageContext_ClearView_Hook(app::InLevelCutScenePageContext* __this, MethodInfo* method)
|
static void InLevelCutScenePageContext_ClearView_Hook(app::InLevelCutScenePageContext* __this, MethodInfo* method)
|
||||||
{
|
{
|
||||||
float gameSpeed = app::Time_get_timeScale(nullptr, nullptr);
|
float gameSpeed = app::Time_get_timeScale(nullptr);
|
||||||
if (gameSpeed > 1.0f)
|
if (gameSpeed > 1.0f)
|
||||||
app::Time_set_timeScale(nullptr, 1.0f, nullptr);
|
app::Time_set_timeScale(1.0f, nullptr);
|
||||||
CALL_ORIGIN(InLevelCutScenePageContext_ClearView_Hook, __this, method);
|
CALL_ORIGIN(InLevelCutScenePageContext_ClearView_Hook, __this, method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,10 +112,10 @@ namespace cheat::feature
|
|||||||
if (combatProp == nullptr)
|
if (combatProp == nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto maxHP = app::SafeFloat_GetValue(nullptr, combatProp->fields.maxHP, nullptr);
|
auto maxHP = app::SafeFloat_GetValue(combatProp->fields.maxHP, nullptr);
|
||||||
auto isLockHp = combatProp->fields.islockHP == nullptr || app::FixedBoolStack_get_value(combatProp->fields.islockHP, nullptr);
|
auto isLockHp = combatProp->fields.islockHP == nullptr || app::FixedBoolStack_get_value(combatProp->fields.islockHP, nullptr);
|
||||||
auto isInvincible = combatProp->fields.isInvincible == nullptr || app::FixedBoolStack_get_value(combatProp->fields.isInvincible, nullptr);
|
auto isInvincible = combatProp->fields.isInvincible == nullptr || app::FixedBoolStack_get_value(combatProp->fields.isInvincible, nullptr);
|
||||||
auto HP = app::SafeFloat_GetValue(nullptr, combatProp->fields.HP, nullptr);
|
auto HP = app::SafeFloat_GetValue(combatProp->fields.HP, nullptr);
|
||||||
if (maxHP < 10 || HP < 2 || isLockHp || isInvincible)
|
if (maxHP < 10 || HP < 2 || isLockHp || isInvincible)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -151,9 +151,9 @@ namespace cheat::feature
|
|||||||
attackSet.erase(monster->runtimeID());
|
attackSet.erase(monster->runtimeID());
|
||||||
|
|
||||||
auto combat = monster->combat();
|
auto combat = monster->combat();
|
||||||
auto maxHP = app::SafeFloat_GetValue(nullptr, combat->fields._combatProperty_k__BackingField->fields.maxHP, nullptr);
|
auto maxHP = app::SafeFloat_GetValue(combat->fields._combatProperty_k__BackingField->fields.maxHP, nullptr);
|
||||||
|
|
||||||
auto crashEvt = app::CreateCrashEvent(nullptr, *app::CreateCrashEvent__MethodInfo);
|
auto crashEvt = app::CreateCrashEvent(*app::CreateCrashEvent__MethodInfo);
|
||||||
app::EvtCrash_Init(crashEvt, monster->runtimeID(), nullptr);
|
app::EvtCrash_Init(crashEvt, monster->runtimeID(), nullptr);
|
||||||
crashEvt->fields.maxHp = maxHP;
|
crashEvt->fields.maxHp = maxHP;
|
||||||
crashEvt->fields.velChange = 1000;
|
crashEvt->fields.velChange = 1000;
|
||||||
|
@ -178,14 +178,14 @@ namespace cheat::feature
|
|||||||
uint32_t entityId = entity->runtimeID();
|
uint32_t entityId = entity->runtimeID();
|
||||||
app::Vector3 entityRelPos = positions->count(entityId) ? (*positions)[entityId] : entity->relativePosition();
|
app::Vector3 entityRelPos = positions->count(entityId) ? (*positions)[entityId] : entity->relativePosition();
|
||||||
app::Vector3 newPosition = {};
|
app::Vector3 newPosition = {};
|
||||||
if (app::Vector3_Distance(nullptr, entityRelPos, targetPos, nullptr) < 0.1)
|
if (app::Vector3_Distance(entityRelPos, targetPos, nullptr) < 0.1)
|
||||||
{
|
{
|
||||||
newPosition = targetPos;
|
newPosition = targetPos;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
app::Vector3 dir = GetVectorDirection(entityRelPos, targetPos);
|
app::Vector3 dir = GetVectorDirection(entityRelPos, targetPos);
|
||||||
float deltaTime = app::Time_get_deltaTime(nullptr, nullptr);
|
float deltaTime = app::Time_get_deltaTime(nullptr);
|
||||||
newPosition = entityRelPos + dir * f_Speed * deltaTime;
|
newPosition = entityRelPos + dir * f_Speed * deltaTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ namespace cheat::feature
|
|||||||
|
|
||||||
app::Vector3 targetPos = CalcMobVacTargetPos();
|
app::Vector3 targetPos = CalcMobVacTargetPos();
|
||||||
app::Vector3 entityPos = entity->relativePosition();
|
app::Vector3 entityPos = entity->relativePosition();
|
||||||
if (app::Vector3_Distance(nullptr, targetPos, entityPos, nullptr) < 0.2)
|
if (app::Vector3_Distance(targetPos, entityPos, nullptr) < 0.2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
app::Vector3 dir = GetVectorDirection(targetPos, entityPos);
|
app::Vector3 dir = GetVectorDirection(targetPos, entityPos);
|
||||||
|
Loading…
Reference in New Issue
Block a user