aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBDKPlayer <fabian.stotz@yahoo.de>2020-03-19 19:09:44 +0100
committerBDKPlayer <fabian.stotz@yahoo.de>2020-03-19 19:09:44 +0100
commit3f92312439da04f8e02aa14299140aa833a15a77 (patch)
tree256372ef430aa79a4228533c69377b28d9259a5c
parent1fb0a22efeebe9c0b375449bb00c92183599949b (diff)
Added: Relic manager
-rw-r--r--AoE_imgui_DE.vcxproj2
-rw-r--r--AoE_imgui_DE.vcxproj.filters6
-rw-r--r--Classes.h21
-rw-r--r--Core.cpp17
-rw-r--r--ESP.cpp19
-rw-r--r--Engine.cpp5
-rw-r--r--Engine.h3
-rw-r--r--RelicManager.cpp51
-rw-r--r--RelicManager.h17
-rw-r--r--Source.cpp4
10 files changed, 130 insertions, 15 deletions
diff --git a/AoE_imgui_DE.vcxproj b/AoE_imgui_DE.vcxproj
index 7b5f219..bc4b41c 100644
--- a/AoE_imgui_DE.vcxproj
+++ b/AoE_imgui_DE.vcxproj
@@ -161,6 +161,7 @@
<ClInclude Include="main.h" />
<ClInclude Include="MinimapText.h" />
<ClInclude Include="Offsets.h" />
+ <ClInclude Include="RelicManager.h" />
<ClInclude Include="Renderer.h" />
<ClInclude Include="ResourceInformation.h" />
<ClInclude Include="Resources.h" />
@@ -181,6 +182,7 @@
<ClCompile Include="imgui\imgui_impl_win32.cpp" />
<ClCompile Include="imgui\imgui_widgets.cpp" />
<ClCompile Include="MinimapText.cpp" />
+ <ClCompile Include="RelicManager.cpp" />
<ClCompile Include="Renderer.cpp" />
<ClCompile Include="ResourceInformation.cpp" />
<ClCompile Include="Source.cpp" />
diff --git a/AoE_imgui_DE.vcxproj.filters b/AoE_imgui_DE.vcxproj.filters
index e5ef37a..ec3121a 100644
--- a/AoE_imgui_DE.vcxproj.filters
+++ b/AoE_imgui_DE.vcxproj.filters
@@ -108,6 +108,9 @@
<ClInclude Include="DetourHook64.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="RelicManager.h">
+ <Filter>Header Files\Feature</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="imgui\imgui.cpp">
@@ -158,5 +161,8 @@
<ClCompile Include="DetourHook64.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="RelicManager.cpp">
+ <Filter>Source Files\Feature</Filter>
+ </ClCompile>
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/Classes.h b/Classes.h
index f16c017..ba01391 100644
--- a/Classes.h
+++ b/Classes.h
@@ -166,10 +166,25 @@ public:
char pad_0x0030[0x40]; //0x0030
Resources* pResources; //0x0070
char pad_0x0078[0xE0]; //0x0078
- int* color; //0x0158
- char pad_0x0160[0x9238]; //0x0160
+ int* pColor; //0x0158
+ char pad_0x0160[0x18]; //0x0160
+ float xScreenPos; //0x0178
+ float yScreenPos; //0x017C
+ char pad_0x0180[0x9218]; //0x0180
char* name; //0x9398
+ void SetCameraPosition(Vector2 pos)
+ {
+ xScreenPos = pos.x;
+ yScreenPos = pos.y;
+ }
+
+ void SetCameraPosition(Vector3 pos)
+ {
+ xScreenPos = pos.x;
+ yScreenPos = pos.y;
+ }
+
}; //Size=0x93A0
class World
@@ -282,6 +297,8 @@ public:
return reinterpret_cast<Vector3*>(actionMoveTo + 0x38);
}
+
+
}; //Size=0x0250
class ObjectManager
diff --git a/Core.cpp b/Core.cpp
index 5f3045a..394d15a 100644
--- a/Core.cpp
+++ b/Core.cpp
@@ -16,6 +16,7 @@
#include "ResourceInformation.h"
#include "ESP.h"
#include "MinimapText.h"
+#include "RelicManager.h"
Core::Core()
{
@@ -23,19 +24,24 @@ Core::Core()
FeatureManager::Get()->registerFeature(new ResourceInformation());
FeatureManager::Get()->registerFeature(new ESP());
//FeatureManager::Get()->registerFeature(new MinimapText());
-
+ FeatureManager::Get()->registerFeature(new RelicManager());
FeatureManager::Get()->OnInitialise();
}
void createPlayerTreeNode(Player* player, int playerIndex)
{
- ImGui::PushStyleColor(ImGuiCol_Text, Engine::Get()->GetPlayerColorImGUI(*player->color));
+ ImGui::PushStyleColor(ImGuiCol_Text, Engine::Get()->GetPlayerColorImGUI(*player->pColor));
std::string playerText = "Player " + std::to_string(playerIndex);
if (ImGui::TreeNode(player->name))
{
ImGui::PushStyleColor(ImGuiCol_Text, 0xffffffff);
- ImGui::Text("Player %p", player);
+ ImGui::Text("Player %p (%f, %f)", player, player->xScreenPos, player->yScreenPos);
+ if (ImGui::Button("Set camera to 0"))
+ {
+ player->xScreenPos = 0;
+ player->yScreenPos = 0;
+ }
FeatureManager::Get()->OnMenuPlayerTreenode(player, playerIndex);
if (ImGui::TreeNode("Units"))
{
@@ -150,7 +156,7 @@ void Core::OnPresent()
Renderer::Get()->EndScene();
- ImGui::SetNextWindowBgAlpha(0.55f);
+ ImGui::SetNextWindowBgAlpha(0.8f);
if (openOverlay)
{
__try
@@ -163,6 +169,8 @@ void Core::OnPresent()
ImGui::Text("PlayerArray %p", playerArray);
ImGui::Text("totalPlayers %d", totalPlayers);
ImGui::Text("ScreenPos %f %f %f", mainScreen->pGameScreen->pMainView->ScreenPosX, mainScreen->pGameScreen->pMainView->ScreenPosY, mainScreen->pGameScreen->pMainView->ScreenPosZ);
+ ImGui::Separator();
+ ImGui::Text("Player Information");
for (int i = 0; i <= totalPlayers; i++)
{
Player* currentPlayer = playerArray->playerData[i].player;
@@ -173,6 +181,7 @@ void Core::OnPresent()
createPlayerTreeNode(currentPlayer, i);
}
FeatureManager::Get()->OnMenuMainWindow();
+ ImGui::Separator();
ImGui::Checkbox("Skip localplayer", &skipLocalplayer);
}
}
diff --git a/ESP.cpp b/ESP.cpp
index a0369f9..1526a74 100644
--- a/ESP.cpp
+++ b/ESP.cpp
@@ -94,7 +94,17 @@ void ESP::OnUnitIteration(Unit* unit, Player* player, int playerIndex)
if (destination)
{
Vector2 screenDestinationPos = Engine::Get()->worldToScreen(*destination);
- Renderer::Get()->RenderCircleFilled(ImVec2(screenDestinationPos.x, screenDestinationPos.y), 10, colors_hex[*player->color] & 0x77ffffff);
+ Renderer::Get()->RenderCircleFilled(ImVec2(screenDestinationPos.x, screenDestinationPos.y), 10, colors_hex[*player->pColor] & 0x77ffffff);
+ }
+ }
+
+ if (std::string(unit->pUnitData->name).find("Projectile Trebuchet") != std::string::npos)
+ {
+ Vector3* destination = unit->GetTargetPosition();
+ if (destination)
+ {
+ Vector2 screenDestinationPos = Engine::Get()->worldToScreen(*destination);
+ Renderer::Get()->RenderCircleFilled(ImVec2(screenDestinationPos.x, screenDestinationPos.y), 30, colors_hex[*player->pColor] & 0x77ffffff);
}
}
}
@@ -104,7 +114,7 @@ void ESP::OnUnitIteration(Unit* unit, Player* player, int playerIndex)
return;
}
- DrawBox(unit, colors_hex[*player->color], playerUnitNameEsp[playerIndex]);
+ DrawBox(unit, colors_hex[*player->pColor], playerUnitNameEsp[playerIndex]);
if (playerUnitDestinationEsp[playerIndex])
{
@@ -113,7 +123,7 @@ void ESP::OnUnitIteration(Unit* unit, Player* player, int playerIndex)
Vector2 screenPos = Engine::Get()->worldToScreen(unit);
Vector2 screenTargetPos = Engine::Get()->worldToScreen(*targetPosition);
- Renderer::Get()->RenderLine(ImVec2(screenPos.x, screenPos.y), ImVec2(screenTargetPos.x, screenTargetPos.y), colors_hex[*player->color]);
+ Renderer::Get()->RenderLine(ImVec2(screenPos.x, screenPos.y), ImVec2(screenTargetPos.x, screenTargetPos.y), colors_hex[*player->pColor]);
}
}
}
@@ -212,7 +222,10 @@ void ESP::OnNeutralUnit(Unit* unit)
void ESP::OnMenuMainWindow()
{
+ ImGui::Separator();
+ ImGui::Text("Resource ESP");
ImGui::Checkbox("GaiaESP", &gaiaEsp);
ImGui::Checkbox("GoldESP", &goldESP);
ImGui::Checkbox("StoneESP", &stoneESP);
+ ImGui::Separator();
} \ No newline at end of file
diff --git a/Engine.cpp b/Engine.cpp
index 5ca9b8b..1eb9f83 100644
--- a/Engine.cpp
+++ b/Engine.cpp
@@ -155,11 +155,10 @@ Player* Engine::GetPlayerByName(char* playerName)
{
continue;
}
- //TODO fix
- /*if (strcmp(playerName, player->name) == 0)
+ if (strcmp(playerName, player->name) == 0)
{
return player;
- }*/
+ }
}
return NULL;
}
diff --git a/Engine.h b/Engine.h
index bdd6905..24d5e81 100644
--- a/Engine.h
+++ b/Engine.h
@@ -16,9 +16,10 @@ class Engine
static Engine* instance;
uint64_t base;
-
uint32_t playerColors[8] = { 0xff0000ff, 0xffff0000,0xff00ff00,0xffffff00,0xff00ffff,0xffff00ff,0xff7f7f7f,0xffffb400 };
+ //void __fastcall UnitMoveTo_7FF64AAE6F40(int64_t* that, int one, int64_t zero, int fourty, int a5, int a6)
+
Engine();
public:
diff --git a/RelicManager.cpp b/RelicManager.cpp
new file mode 100644
index 0000000..10f41d2
--- /dev/null
+++ b/RelicManager.cpp
@@ -0,0 +1,51 @@
+#include "RelicManager.h"
+#include "Sdk.h"
+#include "Renderer.h"
+#include "Engine.h"
+
+void RelicManager::OnNeutralUnit(Unit* unit)
+{
+}
+
+void RelicManager::OnMenuMainWindow()
+{
+ if (true) //Need OnGameStart()
+ {
+ relics.clear();
+ Player* gaia = Engine::Get()->GetPlayerByName("Gaia");
+ for (int i = 0; i < gaia->pObjectManager->Count; i++)
+ {
+ Unit* unit = gaia->pObjectManager->units[i];
+ if (!unit)
+ {
+ continue;
+ }
+ if (strcmp(unit->pUnitData->name, "RELIC") == 0)
+ {
+ relics.push_back(unit);
+ }
+ }
+ }
+
+ ImGui::Separator();
+ ImGui::Text("Relics %d", relics.size());
+
+ if (relics.size() != 0)
+ {
+ if (ImGui::Button("<"))
+ {
+ currentRelic = (currentRelic - 1) % relics.size();
+ Engine::Get()->GetLocalPlayer()->SetCameraPosition(relics[currentRelic]->position);
+ }
+ ImGui::SameLine(24);
+ ImGui::Text("%d/%d", currentRelic + 1, relics.size());
+ ImGui::SameLine(48);
+ if (ImGui::Button(">"))
+ {
+ currentRelic = (currentRelic + 1) % relics.size();
+ Engine::Get()->GetLocalPlayer()->SetCameraPosition(relics[currentRelic]->position);
+ }
+ }
+ ImGui::Separator();
+
+}
diff --git a/RelicManager.h b/RelicManager.h
new file mode 100644
index 0000000..36249ac
--- /dev/null
+++ b/RelicManager.h
@@ -0,0 +1,17 @@
+#pragma once
+#include "Feature.h"
+
+struct Vector2;
+struct Vector3;
+class RelicManager : public Feature
+{
+ uint32_t color;
+ int radius = 20;
+
+ std::vector<Unit*> relics;
+ int currentRelic = 0;
+
+ //Callbacks
+ void OnNeutralUnit(Unit* unit);
+ void OnMenuMainWindow();
+}; \ No newline at end of file
diff --git a/Source.cpp b/Source.cpp
index 31744d9..8c31f38 100644
--- a/Source.cpp
+++ b/Source.cpp
@@ -210,9 +210,9 @@ DWORD __stdcall InitHooks(LPVOID hModule)
do
{
hDXGIDLL = GetModuleHandleA("dxgi.dll");
- Sleep(4000);
+ Sleep(100);
} while (!hDXGIDLL);
- Sleep(100);
+ //Sleep(100);
IDXGISwapChain* pSwapChain;