From f528cb882d9889a9bb522416af91e0e2bc89415d Mon Sep 17 00:00:00 2001 From: m0nkrel Date: Thu, 21 Jul 2022 18:18:57 +0300 Subject: [PATCH] Added Animal and Monster NPC support --- cheat-library/src/user/cheat/esp/ESP.cpp | 92 ++++++++++++++++++- cheat-library/src/user/cheat/game/filters.cpp | 2 +- 2 files changed, 92 insertions(+), 2 deletions(-) diff --git a/cheat-library/src/user/cheat/esp/ESP.cpp b/cheat-library/src/user/cheat/esp/ESP.cpp index 6b0c6ab..95f94f6 100644 --- a/cheat-library/src/user/cheat/esp/ESP.cpp +++ b/cheat-library/src/user/cheat/esp/ESP.cpp @@ -173,6 +173,97 @@ namespace cheat::feature } name = name.substr(pos1 + 1, pos2 - pos1 - 1); } + else if (name.find("Animal") != std::string::npos) + { + int count = 0; + int j = 0; + int pos1 = 0; + int pos2 = 0; + for (int i = 0; i < name.length(); i++) + { + if (name[i] == '_') + { + count++; + } + } + //switch statement to determine how we will get name + switch (count) + { + case 3: + { + j = 0; // j is the number of spaces before the name starts + pos1 = 0; + pos2 = 0; + for (int i = 0; i < name.length(); i++) + { + if (name[i] == '_') + { + j++; + if (j == 3) + { + pos1 = i; + } + + } + if (name[i] == '(') + { + pos2 = i; + break; + } + } + name = name.substr(pos1, pos2 - pos1); + } + case 4: + { + j = 0; // j is the number of spaces before the name starts + pos1 = 0; + pos2 = 0; + for (int i = 0; i < name.length(); i++) + { + if (name[i] == '_') + { + j++; + if (j == 3) + { + pos1 = i; + } + if (j == 4) + { + pos2 = i; + break; + } + } + } + name = name.substr(pos1 + 1, pos2 - pos1 - 1); + } + default: + break; + } + return; + } + else if (name.find("Monster") != std::string::npos) + { + int j = 0; //number of underscores in the name + int pos1 = 0; //position of the first underscore in the name + int pos2 = 0; //position of the second underscore in the name + for (int i = 0; i < name.length(); i++) + { + if (name[i] == '_') + { + j++; + if (j == 3) + { + pos1 = i; + } + if (j == 4) + { + pos2 = i; + break; + } + } + } + name = name.substr(pos1 + 1, pos2 - pos1 - 1); + } else { int j = 0; //number of underscores in the name @@ -324,7 +415,6 @@ namespace cheat::feature break; } } - esp::render::DrawEntity(entry.m_Name, entity, entry.m_Color, entry.m_ContrastColor); break; } diff --git a/cheat-library/src/user/cheat/game/filters.cpp b/cheat-library/src/user/cheat/game/filters.cpp index 6b52379..85babfd 100644 --- a/cheat-library/src/user/cheat/game/filters.cpp +++ b/cheat-library/src/user/cheat/game/filters.cpp @@ -95,7 +95,7 @@ namespace cheat::game::filters SimpleFilter Boar = { EntityType__Enum_1::Monster, "Boar" }; SimpleFilter Fox = { EntityType__Enum_1::Monster, "Fox" }; SimpleFilter Squirrel = { EntityType__Enum_1::Monster, "Squirrel" }; - SimpleFilter Npc = { EntityType__Enum_1::NPC, { "_Liyue", "_Mengde", "_Inazuma", "_Coop", "_Quest", "_Enkanomiya", "_Animal", "_Guide", "_Homeworld" } }; + SimpleFilter Npc = { EntityType__Enum_1::NPC, { "_Liyue", "_Mengde", "_Inazuma", "_Coop", "_Quest", "_Enkanomiya", "_Animal", "_Guide", "_Homeworld", "_Monster"}}; SimpleFilter Crane = { EntityType__Enum_1::Monster, "Crane" }; SimpleFilter Falcon = { EntityType__Enum_1::Monster, "Falcon" }; SimpleFilter LucklightFly = { EntityType__Enum_1::EnvAnimal, "Boltbug_" };