/
RecallExploit.cs
184 lines (156 loc) · 6.3 KB
/
RecallExploit.cs
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
using System;
using System.Collections.Generic;
using System.Linq;
using LeagueSharp;
using LeagueSharp.Common;
using SharpDX;
namespace RecallExploit2
{
internal class Program
{
public delegate void SpellCallback(Obj_AI_Base target);
public class SpellAction
{
public SpellCallback CallbackObject;
public SpellAction(SpellCallback func)
{
CallbackObject = func;
}
}
private static Dictionary<string, SpellAction[]> ChampionSpellAction = new Dictionary<string, SpellAction[]>
{
{
"Sivir", new[]
{
new SpellAction(target => { Player.Spellbook.CastSpell(SpellSlot.Q, Player.ServerPosition); }),
new SpellAction(target => { Player.Spellbook.CastSpell(SpellSlot.W); })
}
},
{
"Irelia", new[] //not working always
{
new SpellAction(target => { Player.Spellbook.CastSpell(SpellSlot.E, target); }),
new SpellAction(target => { Player.Spellbook.CastSpell(SpellSlot.Q, target); })
}
},
{
"Vayne", new[] //not working always
{
new SpellAction(target => { Player.Spellbook.CastSpell(SpellSlot.E, target); }),
new SpellAction(target => { Player.Spellbook.CastSpell(SpellSlot.Q, Player.Position); })
}
},
{
"Riven", new[]
{
new SpellAction(target => { Player.Spellbook.CastSpell(SpellSlot.W); }),
new SpellAction(target => { Player.Spellbook.CastSpell(SpellSlot.Q, Player.Position); })
}
},
{
"Janna", new[]
{
new SpellAction(target => { Player.Spellbook.CastSpell(SpellSlot.R); }),
new SpellAction(target => { Player.Spellbook.CastSpell(SpellSlot.W, target); })
}
},
};
private static Obj_AI_Hero Player = ObjectManager.Player;
private static Vector3 TeamSpawnPos;
private static readonly string[] NoAttacks =
{
"jarvanivcataclysmattack", "monkeykingdoubleattack",
"shyvanadoubleattack", "shyvanadoubleattackdragon", "zyragraspingplantattack", "zyragraspingplantattack2",
"zyragraspingplantattackfire", "zyragraspingplantattack2fire", "viktorpowertransfer", "sivirwattackbounce"
};
private static readonly string[] Attacks =
{
"caitlynheadshotmissile", "frostarrow", "garenslash2",
"kennenmegaproc", "lucianpassiveattack", "masteryidoublestrike", "quinnwenhanced", "renektonexecute",
"renektonsuperexecute", "rengarnewpassivebuffdash", "trundleq", "xenzhaothrust", "xenzhaothrust2",
"xenzhaothrust3", "viktorqbuff"
};
private static int DoExploitState;
private static int _time;
private static Obj_AI_Minion closestminion;
private static uint hotkey = 0x24;
private static void Main(string[] args)
{
CustomEvents.Game.OnGameLoad += Game_OnGameLoad;
}
private static void Game_OnGameLoad(EventArgs args)
{
TeamSpawnPos = ObjectManager.Get<Obj_SpawnPoint>().FirstOrDefault(obj => obj.IsAlly).Position;
Drawing.OnDraw += OnDraw;
Game.OnWndProc += GameOnWndProc;
Game.OnUpdate += OnUpdate;
Obj_AI_Base.OnProcessSpellCast += OnProcessSpellCast;
}
private static void GameOnWndProc(WndEventArgs args)
{
if (args.Msg == 0x100) //WM_KEYDOWN
{
if (args.WParam == hotkey && DoExploitState == 0)
{
_time = Environment.TickCount;
DoExploitState = 2;
}
}
}
private static void OnDraw(EventArgs args)
{
if (DoExploitState > 0)
Drawing.DrawText(Drawing.Width/2 - 300, Drawing.Height/2 - 300, System.Drawing.Color.Red,
"Recall Exploit Active with state: {0}", DoExploitState.ToString());
if (closestminion == null)
return;
if (DoExploitState == 3)
{
Player.Spellbook.CastSpell(SpellSlot.Recall);
Utility.DelayAction.Add(2,
() => { ChampionSpellAction[Player.ChampionName][0].CallbackObject(closestminion); });
DoExploitState = 4;
}
if (DoExploitState == 4)
{
Utility.DelayAction.Add(2,
() => { Player.IssueOrder(GameObjectOrder.AttackUnit, closestminion); });
Utility.DelayAction.Add(4,
() => { ChampionSpellAction[Player.ChampionName][1].CallbackObject(closestminion); });
}
}
private static void OnUpdate(EventArgs args)
{
if (Environment.TickCount - _time > 4500 && DoExploitState >= 0)
DoExploitState = 0;
if (Player.Distance(TeamSpawnPos) <= 4000F)
DoExploitState = 0;
if (DoExploitState == 0)
return;
closestminion =
ObjectManager.Get<Obj_AI_Minion>()
.Where(unit => unit.IsEnemy && unit.IsVisible)
.OrderBy(unit => unit.Distance(Player))
.First();
if (closestminion == null)
return;
if (DoExploitState == 1)
{
Player.IssueOrder(GameObjectOrder.AttackUnit, closestminion);
DoExploitState = 2;
}
}
private static void OnProcessSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args)
{
if (sender.IsMe && IsAutoAttack(args.SData.Name) && DoExploitState == 2)
{
DoExploitState = 3;
}
}
public static bool IsAutoAttack(string name)
{
return (name.ToLower().Contains("attack") && !NoAttacks.Contains(name.ToLower())) ||
Attacks.Contains(name.ToLower());
}
}
}