Updated all functions to 2.7

This commit is contained in:
Joaquin 2022-05-28 04:21:08 -06:00
parent 6ccf0056de
commit bba76d3708
21 changed files with 292 additions and 292 deletions

View File

@ -15,13 +15,13 @@ cheat::GenshinCM& cheat::GenshinCM::instance()
void cheat::GenshinCM::CursorSetVisibility(bool visibility)
{
app::Cursor_set_visible(nullptr, visibility, nullptr);
app::Cursor_set_lockState(nullptr, visibility ? app::CursorLockMode__Enum::None : app::CursorLockMode__Enum::Locked, nullptr);
app::Cursor_set_visible(visibility, nullptr);
app::Cursor_set_lockState(visibility ? app::CursorLockMode__Enum::None : app::CursorLockMode__Enum::Locked, nullptr);
}
bool cheat::GenshinCM::CursorGetVisibility()
{
return app::Cursor_get_visible(nullptr, nullptr);
return app::Cursor_get_visible(nullptr);
}
cheat::GenshinCM::GenshinCM() :

View File

@ -31,7 +31,7 @@ namespace cheat::feature::esp::render
return;
SAFE_BEGIN();
auto camera = app::Camera_get_main(nullptr, nullptr);
auto camera = app::Camera_get_main(nullptr);
if (camera == nullptr)
return;
@ -58,8 +58,8 @@ namespace cheat::feature::esp::render
if (pixelWidth == 0 || pixelHeight == 0)
return;
auto screenWidth = app::Screen_get_width(nullptr, nullptr);
auto screenHeight = app::Screen_get_height(nullptr, nullptr);
auto screenWidth = app::Screen_get_width(nullptr);
auto screenHeight = app::Screen_get_height(nullptr);
if (screenWidth == 0 || screenHeight == 0)
return;
@ -88,7 +88,7 @@ namespace cheat::feature::esp::render
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;
}
@ -141,7 +141,7 @@ namespace cheat::feature::esp::render
// Sometimes occurs access violation in UnityPlayer.dll
// 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 &&
bounds.m_Extents.y < 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
@ -263,7 +263,7 @@ namespace cheat::feature::esp::render
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.yMax = screenHeight - boxRect.yMax;
return boxRect;

View File

@ -24,7 +24,7 @@ namespace cheat::game
entityFilters[filter] = { false, 0 };
auto& entry = entityFilters[filter];
auto timestamp = app::GetTimestamp(nullptr, nullptr);
auto timestamp = app::TimeUtil_get_NowTimeStamp(nullptr);
if (entry.second + m_LifeTime > timestamp)
return entry.first;

View File

@ -77,7 +77,7 @@ namespace cheat::game
if (m_RawEntity == nullptr)
return {};
return app::Miscs_GenLevelPos_1(nullptr, absolutePosition(), nullptr);
return app::Miscs_GenLevelPos_1(absolutePosition(), nullptr);
}
float Entity::distance(Entity* entity)
@ -102,7 +102,7 @@ namespace cheat::game
if (m_RawEntity == nullptr)
return 10000;
auto dist = app::Vector3_Distance(nullptr, relativePosition(), point, nullptr);
auto dist = app::Vector3_Distance(relativePosition(), point, nullptr);
return dist;
}
@ -111,7 +111,7 @@ namespace cheat::game
if (m_RawEntity == nullptr)
return 10000;
return app::Vector2_Distance(nullptr, levelPosition(), levelPoint, nullptr);
return app::Vector2_Distance(levelPosition(), levelPoint, nullptr);
}
bool Entity::isGadget()

View File

@ -29,7 +29,7 @@ namespace cheat::game
continue;
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);
if (waypoint.isUnlocked && isAreaUnlocked && !config._unlocked && !waypoint.isGroupLimit && !waypoint.isModelHidden)
@ -45,7 +45,7 @@ namespace cheat::game
float minDistance = -1;
WaypointInfo result{};
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)
{
minDistance = distance;

View File

@ -483,7 +483,7 @@ namespace cheat::feature
if (nearestLabelPoint == nullptr)
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)
{
minDistance = distance;
@ -506,7 +506,7 @@ namespace cheat::feature
if (!completed && point.completed)
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)
{
minDistance = distance;
@ -1274,11 +1274,11 @@ namespace cheat::feature
static bool IsMapActive()
{
auto uimanager = GET_SINGLETON(UIManager_1);
auto uimanager = GET_SINGLETON(UIManager);
if (uimanager == nullptr)
return false;
return app::UIManager_1_HasEnableMapCamera(uimanager, nullptr);
return app::UIManager_HasEnableMapCamera(uimanager, nullptr);
}
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;
// Scaling to screen position
screenPosition.x = screenPosition.x * app::Screen_get_width(nullptr, nullptr);
screenPosition.y = (1.0f - screenPosition.y) * app::Screen_get_height(nullptr, nullptr);
screenPosition.x = screenPosition.x * app::Screen_get_width(nullptr);
screenPosition.y = (1.0f - screenPosition.y) * app::Screen_get_height(nullptr);
return screenPosition;
}
@ -1491,8 +1491,8 @@ namespace cheat::feature
if (m_ScenesData.count(sceneID) == 0)
return;
ImVec2 screenSize = { static_cast<float>(app::Screen_get_width(nullptr, nullptr)),
static_cast<float>(app::Screen_get_height(nullptr, nullptr)) };
ImVec2 screenSize = { static_cast<float>(app::Screen_get_width(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;
@ -1549,7 +1549,7 @@ namespace cheat::feature
UPDATE_DELAY_VAR(ImCircle, _miniMapCircle, 2000);
auto uiManager = GET_SINGLETON(UIManager_1);
auto uiManager = GET_SINGLETON(UIManager);
if (uiManager == nullptr || uiManager->fields._sceneCanvas == nullptr)
return {};
@ -1559,7 +1559,7 @@ namespace cheat::feature
auto mapPos = app::Transform_get_position(reinterpret_cast<app::Transform*>(back), 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);
float scaleFactor = app::Canvas_get_scaleFactor(uiManager->fields._sceneCanvas, nullptr);

View File

@ -152,7 +152,7 @@ namespace cheat::feature
ImGui::Text("Object position: %s", il2cppi_to_string(location._pos).c_str());
ImGui::Text("_unlocked: %s", location._unlocked ? "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("areaUnlocked: %s", app::MapModule_IsAreaUnlock(singleton, sceneId, areaId, nullptr) ? "true" : "false");
ImGui::Text("gadgetIdRawNum: %u", location.gadgetIdRawNum);
@ -236,8 +236,8 @@ namespace cheat::feature
auto combat = entity->combat();
if (combat != nullptr) {
auto combatProp = combat->fields._combatProperty_k__BackingField;
auto maxHP = app::SafeFloat_GetValue(nullptr, combatProp->fields.maxHP, nullptr);
auto HP = app::SafeFloat_GetValue(nullptr, combatProp->fields.HP, nullptr);
auto maxHP = app::SafeFloat_GetValue(combatProp->fields.maxHP, 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 isInvincible = combatProp->fields.isInvincible == nullptr || app::FixedBoolStack_get_value(combatProp->fields.isInvincible, nullptr);
ImGui::BeginTooltip();
@ -767,13 +767,13 @@ namespace cheat::feature
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());
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());
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());
@ -791,7 +791,7 @@ namespace cheat::feature
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());
static app::Vector3 pos{};
@ -807,7 +807,7 @@ namespace cheat::feature
static float length = 1000;
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();
}
@ -819,7 +819,7 @@ namespace cheat::feature
ImGui::SameLine();
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::SameLine();
@ -979,13 +979,13 @@ namespace cheat::feature
auto config = tree->fields._config->fields;
auto pattern = config._._.scenePropPatternName;
app::ECGLPBEEEAA__Enum value;
app::MoleMole_Config_TreeType__Enum value;
bool result = app::ScenePropManager_GetTreeTypeByPattern(scenePropManager, pattern, &value, nullptr);
if (!result)
continue;
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)));
}
}

View File

@ -24,7 +24,7 @@ namespace cheat::feature
{
for (int i = 0; i < 4; 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) {

View File

@ -183,7 +183,7 @@ namespace cheat::feature
byteArray->max_length = 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];
memcpy_s(result, length, byteArray->vector, length);
@ -249,13 +249,13 @@ namespace cheat::feature
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();
if (!sniffer.OnPacketIO(packet, PacketIOType::Send))
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);
}
}

View File

@ -49,7 +49,7 @@ namespace cheat::feature
static char* EncryptXor(void* content, uint32_t length);
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);
};

View File

@ -128,11 +128,11 @@ namespace cheat::feature
NoCD& noCD = NoCD::GetInstance();
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)
{
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;
}
}

View File

@ -154,7 +154,7 @@ namespace cheat::feature
if (IsVectorZero(prevPos))
return;
float deltaTime = app::Time_get_deltaTime(nullptr, nullptr);
float deltaTime = app::Time_get_deltaTime(nullptr);
app::Vector3 newPos = prevPos + dir * speed * deltaTime;
if (!f_VelocityMode)

View File

@ -121,7 +121,7 @@ namespace cheat::feature
return f_Multiplier;
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);
return std::clamp(attackCount, 1, 200);
}

View File

@ -30,7 +30,7 @@ namespace cheat::feature
static std::string teleportName;
ImGui::InputText("Teleport name", &teleportName);
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"))
{
// check if already added

View File

@ -10,12 +10,12 @@ namespace cheat::feature
{
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 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 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);
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(),
NF(f_Enabled, "Map teleport", "MapTeleport", false),
@ -28,14 +28,14 @@ namespace cheat::feature
HookManager::install(app::InLevelMapPageContext_OnMapClicked, InLevelMapPageContext_OnMapClicked_Hook);
// 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);
// Stage 2
HookManager::install(app::LoadingManager_PerformPlayerTransmit, LoadingManager_PerformPlayerTransmit_Hook);
// 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);
}
@ -99,7 +99,7 @@ namespace cheat::feature
{
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);
if (nearestWaypoint.data == nullptr)
@ -109,7 +109,7 @@ namespace cheat::feature
}
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.",
nearestWaypoint.sceneId, nearestWaypoint.waypointId, dist);
}
@ -122,7 +122,7 @@ namespace cheat::feature
if (!mapBackground)
return false;
auto uimanager = GET_SINGLETON(UIManager_1);
auto uimanager = GET_SINGLETON(UIManager);
if (uimanager == nullptr)
return false;
@ -149,10 +149,10 @@ namespace cheat::feature
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 groundHeight = app::Miscs_CalcCurrentGroundHeight(nullptr, relativePos.x, relativePos.z, nullptr);
auto relativePos = app::WorldShiftManager_GetRelativePosition(worldPosition, 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());
}
@ -232,17 +232,17 @@ namespace cheat::feature
if (taskInfo.needHeightCalculation)
{
auto relativePos = app::WorldShiftManager_GetRelativePosition(nullptr, position, nullptr);
auto relativePos = app::WorldShiftManager_GetRelativePosition(position, nullptr);
float groundHeight;
switch (taskInfo.sceneId)
{
// 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
groundHeight = app::Miscs_CalcCurrentGroundHeight_1(nullptr, relativePos.x, relativePos.z, originPosition.y, 100,
app::Miscs_GetSceneGroundLayerMask(nullptr, nullptr), nullptr);
groundHeight = app::Miscs_CalcCurrentGroundHeight_1(relativePos.x, relativePos.z, originPosition.y, 100,
app::Miscs_GetSceneGroundLayerMask(nullptr), nullptr);
break;
default:
groundHeight = app::Miscs_CalcCurrentGroundWaterHeight(nullptr, relativePos.x, relativePos.z, nullptr);
groundHeight = app::Miscs_CalcCurrentGroundWaterHeight(relativePos.x, relativePos.z, nullptr);
break;
}
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.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();
if (manager.avatar()->raw() == __this)
@ -297,7 +297,7 @@ namespace cheat::feature
mapTeleport.OnSetAvatarPosition(position);
}
CALL_ORIGIN(Entity_SetPosition_Hook, __this, position, someBool, method);
CALL_ORIGIN(Entity_SetRelativePosition_Hook, __this, position, someBool, method);
}
}

View File

@ -99,7 +99,7 @@ namespace cheat::feature
AutoCook& autoCook = AutoCook::GetInstance();
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;
}
return CALL_ORIGIN(CookRecipeExcelConfig_get_maxProficiency, __this, method);

View File

@ -91,7 +91,7 @@ namespace cheat::feature
}
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)
@ -115,7 +115,7 @@ namespace cheat::feature
{
LOG_WARNING("Failed to catch fish, retrying in %u ms", autoFish.f_DelayBeforeCatch);
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;
}
@ -123,7 +123,7 @@ namespace cheat::feature
return;
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)
@ -154,7 +154,7 @@ namespace cheat::feature
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> _lock2(m_RecastTimestampMutex);

View File

@ -126,7 +126,7 @@ namespace cheat::feature
static std::unordered_set<app::SceneTreeObject*> s_AttackQueueSet;
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)
return;
@ -146,7 +146,7 @@ namespace cheat::feature
continue;
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;
s_AttackQueueSet.insert(tree);
@ -163,10 +163,10 @@ namespace cheat::feature
continue;
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;
app::ECGLPBEEEAA__Enum treeType;
app::MoleMole_Config_TreeType__Enum treeType;
auto pattern = tree->fields._config->fields._._.scenePropPatternName;
if (!app::ScenePropManager_GetTreeTypeByPattern(scenePropManager, pattern, &treeType, nullptr))
continue;

View File

@ -77,7 +77,7 @@ namespace cheat::feature
return;
if (f_FastDialog)
app::Time_set_timeScale(nullptr, f_TimeSpeedup, nullptr);
app::Time_set_timeScale(f_TimeSpeedup, nullptr);
bool isImportant = false;
if (f_ExcludeImportant)
@ -107,7 +107,7 @@ namespace cheat::feature
{
int32_t value = 0;
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, &notify, nullptr);
}
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.
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)
app::Time_set_timeScale(nullptr, 1.0f, nullptr);
app::Time_set_timeScale(1.0f, nullptr);
CALL_ORIGIN(InLevelCutScenePageContext_ClearView_Hook, __this, method);
}
}

View File

@ -112,10 +112,10 @@ namespace cheat::feature
if (combatProp == nullptr)
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 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)
continue;
@ -151,9 +151,9 @@ namespace cheat::feature
attackSet.erase(monster->runtimeID());
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);
crashEvt->fields.maxHp = maxHP;
crashEvt->fields.velChange = 1000;

View File

@ -178,14 +178,14 @@ namespace cheat::feature
uint32_t entityId = entity->runtimeID();
app::Vector3 entityRelPos = positions->count(entityId) ? (*positions)[entityId] : entity->relativePosition();
app::Vector3 newPosition = {};
if (app::Vector3_Distance(nullptr, entityRelPos, targetPos, nullptr) < 0.1)
if (app::Vector3_Distance(entityRelPos, targetPos, nullptr) < 0.1)
{
newPosition = targetPos;
}
else
{
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;
}
@ -213,7 +213,7 @@ namespace cheat::feature
app::Vector3 targetPos = CalcMobVacTargetPos();
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;
app::Vector3 dir = GetVectorDirection(targetPos, entityPos);