forked from leftspace89/pPlat
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTospikBrand.hpp
More file actions
120 lines (95 loc) · 2.73 KB
/
TospikBrand.hpp
File metadata and controls
120 lines (95 loc) · 2.73 KB
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
#pragma once
#ifndef TOSPIKBRAND
#define TOSPIKBRAND
#include "LBuffInstance.h"
class TospikBrand : public pComponent
{
public:
bool bEnabled = true, bAutoQ = true;
bool bInited = false;
float sDelay = 0.1f, sSpeed = 0.25f;
Obj_AI_Base*localplayer = nullptr;
TospikBrand() { strcpy(classname, "TospikBrand"); strcpy(Heroname, "Brand"); strcpy(version, "0.0.1"); };
~TospikBrand() {};
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();
}
bool LogicQuse(Obj_AI_Base *t)
{
auto _E = localplayer->GetSpellbook()->GetSpell(static_cast<uint>(SpellSlot::E));
auto _W = localplayer->GetSpellbook()->GetSpell(static_cast<uint>(SpellSlot::W));
auto _Q = localplayer->GetSpellbook()->GetSpell(static_cast<uint>(SpellSlot::Q));
float gTime = (float)GetTickCount() / 1000;
if (t->HasBuff("brandablaze",false))
return true;
else if (*_E->GetCooldownExpires() - gTime + 2 >= *_Q->GetCooldown() && *_W->GetCooldownExpires() - gTime + 2 >= *_Q->GetCooldown())
return true;
else
return false;
}
void onRender()
{
if (!bInited)
return;
if (!bEnabled)
return;
if (!localplayer)
return;
/* if (GetAsyncKeyState(VK_LSHIFT))
{
auto _Q = localplayer->GetSpellbook()->GetSpell(static_cast<uint>(SpellSlot::Q));
ENGINE_MSG("Q %p", _Q);
}*/
if (bAutoQ)
{
if (targetselector->target != nullptr && GetAsyncKeyState(VK_SPACE))
{
/*W */
auto W_Pred = new Prediction(new CirclePrediction());
RVector3 Predict_W = W_Pred->CircPred->Calculate(targetselector->target, 900, 1800, 250, 0.850);
if (Predict_W != RVector3(0, 0, 0))
localplayer->GetSpellbook()->CastSpell(SpellSlot::W, RVector3(0, 0, 0), Predict_W);
/*W */
/*Q */
auto Q_Pred = new Prediction(new LinePrediction());
RVector3 Predict_Q = Q_Pred->LinePred->Calculate(targetselector->target, 1100, 1600, 0.250);
if (!Q_Pred->IsCollisioned(Prediction::CollisionType::Minion, targetselector->target->GetPosition(), 100))
{
if (Predict_Q != RVector3(0, 0, 0))
localplayer->GetSpellbook()->CastSpell(SpellSlot::Q, RVector3(0, 0, 0), Predict_Q);
}
/*Q */
}
}
}
void onMenu()
{
if (!bInited)
return;
if (ImGui::TreeNode("Brand"))
{
ui::Checkbox("Enabled", &bEnabled);
ui::Checkbox("Auto Combo", &bAutoQ);
ImGui::TreePop();
}
}
};
#endif