This repository was archived by the owner on Feb 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathTospikThresh.h
154 lines (124 loc) · 4.18 KB
/
TospikThresh.h
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 TOSPIKTHRESH
#define TOSPIKTHRESH
#include "LBuffInstance.h"
class TospikThresh : public pComponent
{
public:
bool bEnabled = true, bAutoQ = true,bAutoW=true;
bool bInited = false;
float sDelay = 0.1f, sSpeed = 0.25f;
Obj_AI_Base*localplayer=nullptr;
TospikThresh() { strcpy(classname, "TospikThresh"); strcpy(Heroname, "Thresh"); strcpy(version, "0.0.1"); };
~TospikThresh() {};
void onProcessSpell(SpellData*spelldata, SpellCastInfo*spellcastinfo)
{
}
void onStart()
{
localplayer = ObjectManager::GetPlayer();
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()
{
if (!bInited)
return;
if (!bEnabled)
return;
localplayer = ObjectManager::GetPlayer();
if (bAutoW)
autoWLogic();
}
void autoWLogic()
{
auto xdrkek = ObjectManager::GetHeroes(ObjectManager::Allies, 950);
for (auto teamheroobj : xdrkek)
{
auto enemies = ObjectManager::GetHeroes(ObjectManager::Enemies, 700, (Obj_AI_Base*)teamheroobj);
if (enemies.size() <= 0)
continue;
auto hero = (Obj_Hero*)teamheroobj;
if (hero->IsValidTarget(950) && hero->GetHealthPercent() < 35 )
{
localplayer->GetSpellbook()->CastSpell(SpellSlot::W, RVector3(0, 0, 0), hero->GetPosition());
break;
}
}
}
void onRender()
{
if (!bInited)
return;
if (!bEnabled)
return;
if (bAutoQ)
{
if (targetselector->target != nullptr && GetAsyncKeyState(VK_SPACE))
{
D3DCOLOR predcolor = D3DCOLOR_ARGB(255, 255, 255, 255);
auto pred = new Prediction(new LinePrediction());
RVector3 Predict = pred->LinePred->Calculate(targetselector->target,1100,1900,0.500);//FastPrediction(localplayer->GetPosition(),target,sDelay,sSpeed);
if (!pred->IsCollisioned(Prediction::CollisionType::Minion, targetselector->target->GetPosition(), 100))
{
predcolor = D3DCOLOR_ARGB(255, 0, 255, 0);
if (Predict != RVector3(0, 0, 0))
if (targetselector->target->IsValidTarget(1100))
localplayer->GetSpellbook()->CastSpell(SpellSlot::Q, RVector3(0, 0, 0), Predict);
if (targetselector->target->HasBuff("threshq", true))
{
localplayer->GetSpellbook()->CastSpell(SpellSlot::Q);
}
}
if (targetselector->target->IsValidTarget(400) && !targetselector->target->HasBuff("threshq", true))
{
auto pred = new Prediction(new LinePrediction());
auto kaciyor = localplayer->Distance(targetselector->target->GetPosition()) < targetselector->target->Distance(*Game::Cursor()->GetPosition());
RVector3 Predict = pred->LinePred->Calculate(targetselector->target,400, 1800, 0.550);
auto x = localplayer->GetPosition().x - targetselector->target->GetPosition().x;
auto y = localplayer->GetPosition().z - targetselector->target->GetPosition().z;
RVector3 vec = RVector3(localplayer->GetPosition().x + x, localplayer->GetPosition().y , localplayer->GetPosition().z +y);
if(Predict != RVector3(0, 0, 0))
if (kaciyor) {
localplayer->GetSpellbook()->CastSpell(SpellSlot::E, RVector3(0, 0, 0), vec);
}
else {
localplayer->GetSpellbook()->CastSpell(SpellSlot::E, RVector3(0, 0, 0), Predict);
}
}
if (targetselector->target->HasBuff("threshq", true)) {
//Bütün takým arkadaþlarýmý çek
for (auto teamheroobj : ObjectManager::GetHeroes(ObjectManager::Allies))
{
auto hero = (Obj_Hero*)teamheroobj;
if (hero->IsValidTarget(950) && hero->GetPosition().Distance(localplayer->GetPosition()) > 300)
{
localplayer->GetSpellbook()->CastSpell(SpellSlot::W, RVector3(0, 0, 0), hero->GetPosition());
break;
}
}
}
if (localplayer->GetHealthPercent() < 50) {
localplayer->GetSpellbook()->CastSpell(SpellSlot::W, RVector3(0, 0, 0), localplayer->GetPosition());
}
} // q end
}
}
void onMenu()
{
if (!bInited)
return;
if (ImGui::TreeNode("Thresh"))
{
ui::Checkbox("Enabled", &bEnabled);
ui::Checkbox("Auto Combo", &bAutoQ);
ui::Checkbox("Auto W", &bAutoW);
ImGui::TreePop();
}
}
};
#endif