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 pathTospikCait.hpp
115 lines (89 loc) · 2.88 KB
/
TospikCait.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
#pragma once
#ifndef TOSPIKCAIT
#define TOSPIKCAIT
#include "LBuffInstance.h"
class TospikCait : public pComponent
{
public:
bool bEnabled = true, bAutoQ = true;
bool bInited = false;
float sDelay = 0.1f, sSpeed = 0.25f;
Obj_AI_Base*localplayer = nullptr;
TospikCait() { strcpy(classname, "TospikCait"); strcpy(Heroname, "Caitlyn"); strcpy(version, "0.0.1"); };
~TospikCait() {};
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();
}
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,600,1600,0.150);//FastPrediction(localplayer->GetPosition(),target,sDelay,sSpeed);
if (!pred->IsCollisioned(Prediction::CollisionType::Minion, targetselector->target->GetPosition(), 100))
{
predcolor = D3DCOLOR_ARGB(255, 0, 255, 0);
if (targetselector->target->IsValidTarget(600))
if (Predict != RVector3(0, 0, 0))
localplayer->GetSpellbook()->CastSpell(SpellSlot::E, RVector3(0, 0, 0), Predict);
}
if (targetselector->target->IsValidTarget(1250))
{
auto pred = new Prediction(new LinePrediction());
RVector3 Predict = pred->LinePred->Calculate(targetselector->target,1250,2200,0.555f);
if (Predict != RVector3(0, 0, 0))
localplayer->GetSpellbook()->CastSpell(SpellSlot::Q, RVector3(0, 0, 0), Predict);
}
if (targetselector->target->IsValidTarget(800))
{
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,800,1600,0.625);
if(Predict != RVector3(0, 0, 0))
localplayer->GetSpellbook()->CastSpell(SpellSlot::W, RVector3(0, 0, 0), Predict);
}
if (targetselector->target->IsValidTarget(2000) && *targetselector->target->GetHealth() <=350)
{
localplayer->GetSpellbook()->CastSpell(SpellSlot::R, targetselector->target);
}
} // q end
}
}
void onMenu()
{
if (!bInited)
return;
if (ImGui::TreeNode("Caitlyn"))
{
ui::Checkbox("Enabled", &bEnabled);
ui::Checkbox("Auto Combo", &bAutoQ);
ImGui::TreePop();
}
}
};
#endif