forked from leftspace89/pPlat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLCoreTest.hpp
154 lines (112 loc) · 3.4 KB
/
LCoreTest.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#pragma once
#ifndef LCORETEST
#define LCORETEST
class LCoreTest : public pComponent
{
public:
bool bEnabled = false;
bool bInited = false;
Obj_AI_Base*localplayer = nullptr;
LCoreTest() { strcpy(classname, "LCoreTest"); strcpy(classname, "Brand"); strcpy(version, "0.0.2"); };
~LCoreTest() {};
void onStart()
{
localplayer = ObjectManager::GetPlayer();
if (localplayer == nullptr)
return;
std::string name = *localplayer->GetHeroName();
if (localplayer)
if (!strcmp(name.c_str(), Heroname) == 0)
return;
bInited = true;
ENGINE_MSG("Loaded Component: %s Hero : %s Version: %s\n", classname,Heroname, version);
}
void onUpdate()
{
localplayer = ObjectManager::GetPlayer();
if (localplayer == nullptr)
return;
}
RVector3 lastspell;
void onProcessSpell(SpellData*spelldata, SpellCastInfo*spellcastinfo)
{
return;
if (spelldata != nullptr && spellcastinfo)
{
auto endPos = *spellcastinfo->GetEnd();
auto startPos = *spellcastinfo->GetStart();
lastspell = endPos;
ENGINE_MSG("Core Spell : %f %f %f\n", lastspell.x, lastspell.y, lastspell.z);
}
}
void onRender()
{
if (bEnabled)
{
#ifndef localplayerexample
auto player = ObjectManager::GetPlayer();
if (player)
{
RVector3 Screen;
if (render.r3dWorldToScreen(&player->GetPosition(), &Screen))
{
std::string name = *player->GetHeroName();
render.DrawString(Screen.x, Screen.y, D3DCOLOR_ARGB(255, 255, 255, 255), DT_LEFT, 15, "LocalPlayer : %s", name.c_str());
}
}
#endif
for (GameObject*minion : ObjectManager::GetMinions(ObjectManager::ObjectTeam::All))
{
auto base = (Obj_AI_Base*)minion;
auto basecord = base->GetPosition();//LinePred->Calculate(base);
RVector3 predict2(0,0,0);
render.r3dWorldToScreen(&basecord, &predict2);
render.DrawString(predict2.x,predict2.y, D3DCOLOR_ARGB(255, 255, 255, 255), DT_LEFT, 15, "Minion : %.f",*base->GetHealth());
}
#ifndef buffList
int buffin = 0;
for (auto buff : BuffInstance::GetBuffList(reinterpret_cast<GameObject*>(ObjectManager::GetPlayer())))
{
auto base = buff->GetScriptBaseBuff();
if (base != nullptr)
{
auto name = std::string(buff->GetScriptBaseBuff()->GetName());
for (size_t i = 0; i < name.length(); i++)
{
name[i] = tolower(name[i]);
}
RVector3 predict2;
render.r3dWorldToScreen(&ObjectManager::GetPlayer()->GetPosition(), &predict2);
render.DrawString(predict2.x, predict2.y+(buffin*10)+50, D3DCOLOR_ARGB(255, 255, 255, 255), DT_LEFT, 15, "Buff : %s", name.c_str());
buffin++;
}
}
#endif
RVector3 Screen;
if (targetselector->target !=nullptr)
{
if (render.r3dWorldToScreen(&targetselector->target->GetPosition(), &Screen))
{
render.DrawString(Screen.x, Screen.y + 50, D3DCOLOR_ARGB(255, 255, 255, 255), DT_LEFT, 15, "Target");
}
}
if (GetAsyncKeyState(VK_LSHIFT))
{
//ObjectManager::GetPlayer()->GetSpellbook()->CastSpell(SpellSlot::Q, RVector3(0, 0, 0), RVector3(0,0,0));
auto aim = *ObjectManager::GetPlayer()->GetAIManager_Client();
auto comm = aim->GetActor();
auto veloc = *comm->GetVelocity();
ENGINE_MSG("Aimanagerclient : %p , common : %p , %f %f %f\n", aim, comm,veloc.x,veloc.y,veloc.z);
}
}
}
void onMenu()
{
if (ImGui::TreeNode("Core Test"))
{
ui::Checkbox("Enabled", &bEnabled);
ImGui::TreePop();
}
}
};
#endif