-
Notifications
You must be signed in to change notification settings - Fork 22
/
Leona-Put-Your-Sunglasses.lua
336 lines (273 loc) · 13.4 KB
/
Leona-Put-Your-Sunglasses.lua
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
if myHero.charName ~= "Leona" then return end
local LeonaPutYourSunglasses_Version = 2.52
class "SxUpdate"
function SxUpdate:__init(LocalVersion, Host, VersionPath, ScriptPath, SavePath, Callback)
self.Callback = Callback
self.LocalVersion = LocalVersion
self.Host = Host
self.VersionPath = VersionPath
self.ScriptPath = ScriptPath
self.SavePath = SavePath
self.LuaSocket = require("socket")
AddTickCallback(function() self:GetOnlineVersion() end)
end
function SxUpdate:GetOnlineVersion()
if not self.OnlineVersion and not self.VersionSocket then
self.VersionSocket = self.LuaSocket.connect("sx-bol.eu", 80)
self.VersionSocket:send("GET /BoL/TCPUpdater/GetScript.php?script="..self.Host..self.VersionPath.."&rand="..tostring(math.random(1000)).." HTTP/1.0\r\n\r\n")
end
if not self.OnlineVersion and self.VersionSocket then
self.VersionSocket:settimeout(0, 'b')
self.VersionSocket:settimeout(99999999, 't')
self.VersionReceive, self.VersionStatus = self.VersionSocket:receive('*a')
end
if not self.OnlineVersion and self.VersionSocket and self.VersionStatus ~= 'timeout' then
if self.VersionReceive then
self.OnlineVersion = tonumber(string.sub(self.VersionReceive, string.find(self.VersionReceive, "<bols".."cript>")+11, string.find(self.VersionReceive, "</bols".."cript>")-1))
else
print('AutoUpdate Failed')
self.OnlineVersion = 0
end
self:DownloadUpdate()
end
end
function SxUpdate:DownloadUpdate()
if self.OnlineVersion > self.LocalVersion then
self.ScriptSocket = self.LuaSocket.connect("sx-bol.eu", 80)
self.ScriptSocket:send("GET /BoL/TCPUpdater/GetScript.php?script="..self.Host..self.ScriptPath.."&rand="..tostring(math.random(1000)).." HTTP/1.0\r\n\r\n")
self.ScriptReceive, self.ScriptStatus = self.ScriptSocket:receive('*a')
self.ScriptRAW = string.sub(self.ScriptReceive, string.find(self.ScriptReceive, "<bols".."cript>")+11, string.find(self.ScriptReceive, "</bols".."cript>")-1)
local ScriptFileOpen = io.open(self.SavePath, "w+")
ScriptFileOpen:write(self.ScriptRAW)
ScriptFileOpen:close()
end
if type(self.Callback) == 'function' then
self.Callback(self.OnlineVersion)
end
end
local ForceReload = false
SxUpdate(LeonaPutYourSunglasses_Version,
"raw.githubusercontent.com",
"/AMBER17/BoL/master/Leona-Put-Your-Sunglasses.version",
"/AMBER17/BoL/master/Leona-Put-Your-Sunglasses.lua",
SCRIPT_PATH.."/" .. GetCurrentEnv().FILE_NAME,
function(NewVersion) if NewVersion > LeonaPutYourSunglasses_Version then print("<font color=\"#F0Ff8d\"><b>Leona Put Your Sunglasses : </b></font> <font color=\"#FF0F0F\">Updated to "..NewVersion..". Please Reload with 2x F9</b></font>") ForceReload = true else print("<font color=\"#F0Ff8d\"><b>Leona Put Your Sunglasses: </b></font> <font color=\"#FF0F0F\">You have the Latest Version</b></font>") end
end)
if FileExist(LIB_PATH .. "/SxOrbWalk.lua") then
require("SxOrbWalk")
else
SxUpdate(0,
"raw.githubusercontent.com",
"/Superx321/BoL/master/common/SxOrbWalk.Version",
"/Superx321/BoL/master/common/SxOrbWalk.lua",
LIB_PATH.."/SxOrbWalk.lua",
function(NewVersion) if NewVersion > 0 then print("<font color=\"#F0Ff8d\"><b>SxOrbWalk: </b></font> <font color=\"#FF0F0F\">Updated to "..NewVersion..". Please Reload with 2x F9</b></font>") ForceReload = true end
end)
end
if FileExist(LIB_PATH .. "/VPrediction.lua") then
require("VPrediction")
VP = VPrediction()
if VP.version >= 3 then
SxUpdate(0,
"raw.githubusercontent.com",
"/SidaBoL/Scripts/master/Common/VPrediction.version",
"/SidaBoL/Scripts/master/Common/VPrediction.lua",
LIB_PATH.."/VPrediction.lua",
function(NewVersion) if NewVersion > 0 then print("<font color=\"#F0Ff8d\"><b>VPrediction: </b></font> <font color=\"#FF0F0F\">Updated to "..NewVersion..". Please Reload with 2x F9</b></font>") ForceReload = true end
end)
end
else
SxUpdate(0,
"raw.githubusercontent.com",
"/SidaBoL/Scripts/master/Common/VPrediction.version",
"/SidaBoL/Scripts/master/Common/VPrediction.lua",
LIB_PATH.."/VPrediction.lua",
function(NewVersion) if NewVersion > 0 then print("<font color=\"#F0Ff8d\"><b>VPrediction: </b></font> <font color=\"#FF0F0F\">Updated to "..NewVersion..". Please Reload with 2x F9</b></font>") ForceReload = true end
end)
end
function OnLoad()
print("<b><font color=\"#FF001E\"></font></b><font color=\"#FF980F\"> Have a Good Game </font><font color=\"#FF001E\">| AMBER |</font>")
TargetSelector = TargetSelector(TARGET_MOST_AD, 1500, DAMAGE_MAGICAL, false, true)
Variables()
Menu()
Target = GetCustomTarget()
end
function OnTick()
Checks()
TargetSelector:update()
Target = GetCustomTarget()
SxOrb:ForceTarget(Target)
CastAutoR()
if Target ~= nil then
if Settings.combo.comboKey then
Combo(Target)
end
end
end
function OnDraw()
if not myHero.dead then
if ValidTarget(Target) then
DrawText3D("Current Target",Target.x-100, Target.y-50, Target.z, 20, 0xFFFFFF00)
DrawCircle(Target.x, Target.y, Target.z, 150, ARGB(200,100 ,100,0 ))
end
if SkillE.ready and Settings.Draw.DrawE then
DrawCircle(myHero.x, myHero.y, myHero.z, SkillE.range, ARGB(200,50 ,100,0 ))
end
if SkillW.ready and Settings.Draw.DrawZ then
DrawCircle(myHero.x, myHero.y, myHero.z, SkillW.range, ARGB(200,50 ,100,0 ))
end
if SkillR.ready and Settings.Draw.DrawR then
DrawCircle(myHero.x, myHero.y, myHero.z, SkillR.range, ARGB(200,50 ,100,0 ))
end
end
end
function Checks()
SkillQ.ready = (myHero:CanUseSpell(_Q) == READY)
SkillW.ready = (myHero:CanUseSpell(_W) == READY)
SkillE.ready = (myHero:CanUseSpell(_E) == READY)
SkillR.ready = (myHero:CanUseSpell(_R) == READY)
_G.DrawCircle = _G.oldDrawCircle
end
function Variables()
SkillQ = { range = nil, delay = nil, speed = math.huge, width = nil, ready = false }
SkillW = { range = 430, delay = nil, speed = math.huge, width = nil, ready = false }
SkillE = { range = 875, delay = 0.2, speed = math.huge, width = 40, ready = false }
SkillR = { range = 1100, delay = 0.625, speed = math.huge, width = 220, ready = false }
VP = VPrediction()
_G.oldDrawCircle = rawget(_G, 'DrawCircle')
_G.DrawCircle = DrawCircle2
end
function GetCustomTarget()
if SelectedTarget ~= nil and ValidTarget(SelectedTarget, 1500) and (Ignore == nil or (Ignore.networkID ~= SelectedTarget.networkID)) then
return SelectedTarget
end
TargetSelector:update()
if TargetSelector.target and not TargetSelector.target.dead and TargetSelector.target.type == myHero.type then
return TargetSelector.target
else
return nil
end
end
function OnWndMsg(Msg, Key)
if Msg == WM_LBUTTONDOWN then
local minD = 0
local Target = nil
for i, unit in ipairs(GetEnemyHeroes()) do
if ValidTarget(unit) then
if GetDistance(unit, mousePos) <= minD or Target == nil then
minD = GetDistance(unit, mousePos)
Target = unit
end
end
end
if Target and minD < 115 then
if SelectedTarget and Target.charName == SelectedTarget.charName then
SelectedTarget = nil
else
SelectedTarget = Target
end
end
end
end
function DrawCircle2(x, y, z, radius, color)
local vPos1 = Vector(x, y, z)
local vPos2 = Vector(cameraPos.x, cameraPos.y, cameraPos.z)
local tPos = vPos1 - (vPos1 - vPos2):normalized() * radius
local sPos = WorldToScreen(D3DXVECTOR3(tPos.x, tPos.y, tPos.z))
end
function Combo(unit)
if Settings.combo.UseE then
CastE(unit)
end
if Settings.combo.UseZ then
CastW(unit)
end
myHero:Attack(unit)
if Settings.combo.UseQ then
CastQ(unit)
end
myHero:Attack(unit)
if Settings.combo.EngageR then
CastR2(unit)
end
if Settings.combo.UseR then
CastR1(unit)
end
end
function Menu()
Settings = scriptConfig("Leona Put Your Sunglasses", "AMBER")
Settings:addSubMenu("["..myHero.charName.."] - Combo", "combo")
Settings.combo:addParam("comboKey", "Combo Key", SCRIPT_PARAM_ONKEYDOWN, false, 32)
Settings.combo:addParam("UseQ", "Use (Q) ", SCRIPT_PARAM_ONOFF, true)
Settings.combo:addParam("UseZ", "Use (Z) ", SCRIPT_PARAM_ONOFF, true)
Settings.combo:addParam("UseE", "Use (E) ", SCRIPT_PARAM_ONOFF, true)
Settings.combo:addParam("UseR", "Use (R) After (E)",SCRIPT_PARAM_ONOFF, true)
Settings.combo:addParam("EngageR", "Use (R) For Engage",SCRIPT_PARAM_ONOFF, true)
Settings:addSubMenu("["..myHero.charName.."] - Auto Ult ", "AutoUlt")
Settings.AutoUlt:addParam("UseAutoR", "Auto R if X enemie", SCRIPT_PARAM_ONKEYTOGGLE, false, GetKey("V"))
Settings.AutoUlt:addParam("ARX", "X = ", SCRIPT_PARAM_SLICE, 3, 1, 5, 0)
Settings:addSubMenu("["..myHero.charName.."] - Draw", "Draw")
Settings.Draw:addParam("DrawZ", "Draw (Z)", SCRIPT_PARAM_ONOFF, true)
Settings.Draw:addParam("DrawE", "Draw (E)", SCRIPT_PARAM_ONOFF, true)
Settings.Draw:addParam("DrawR", "Draw (R)", SCRIPT_PARAM_ONOFF, true)
Settings.combo:permaShow("comboKey")
Settings.combo:permaShow("UseR")
Settings.combo:permaShow("EngageR")
Settings.AutoUlt:permaShow("UseAutoR")
Settings.AutoUlt:permaShow("ARX")
Settings:addSubMenu("["..myHero.charName.."] - Orbwalking Settings", "Orbwalking")
SxOrb:LoadToMenu(Settings.Orbwalking)
TargetSelector.name = "Leona"
Settings:addTS(TargetSelector)
end
function CastQ(unit)
if unit ~= nil and GetDistance(unit) <= 300 and SkillQ.ready then
Packet("S_CAST", {spellId = _Q}):send()
end
end
function CastW(unit)
if unit ~= nil and GetDistance(unit) <= SkillW.range and SkillW.ready then
Packet("S_CAST", {spellId = _W}):send()
end
end
function CastE(unit)
if unit ~= nil and GetDistance(unit) <= SkillE.range and GetDistance(unit) > 300 and SkillE.ready then
CastPosition, HitChance, Position = VP:GetLineCastPosition(unit, SkillE.delay, SkillE.width, SkillE.range, SkillE.speed, myHero, false)
if HitChance >= 2 then
Packet("S_CAST", {spellId = _E, fromX = CastPosition.x, fromY = CastPosition.z, toX = CastPosition.x, toY = CastPosition.z}):send()
end
end
end
function CastR1(unit)
if Settings.combo.UseR then
if unit ~= nil and GetDistance(unit) <= 300 and SkillR.ready then
CastPosition, HitChance, Position = VP:GetCircularCastPosition(unit, SkillR.delay, SkillR.width, SkillR.range, SkillR.speed, myHero, false)
if HitChance >= 2 then
Packet("S_CAST", {spellId = _R, fromX = CastPosition.x, fromY = CastPosition.z, toX = CastPosition.x, toY = CastPosition.z}):send()
end
end
end
end
function CastR2(unit)
if Settings.combo.EngageR then
if unit ~= nil and GetDistance(unit) <= SkillR.range and SkillR.ready then
CastPosition, HitChance, Position = VP:GetCircularCastPosition(unit, SkillR.delay, SkillR.width, SkillR.range, SkillR.speed, myHero, false)
if HitChance >= 2 then
Packet("S_CAST", {spellId = _R, fromX = CastPosition.x, fromY = CastPosition.z, toX = CastPosition.x, toY = CastPosition.z}):send()
end
end
end
end
function CastAutoR()
if SkillR.ready then
if Settings.AutoUlt.UseAutoR then
for _, unit in pairs(GetEnemyHeroes()) do
local rPos, HitChance, maxHit, Positions = VP:GetCircularAOECastPosition(unit, SkillR.delay, SkillR.width, SkillR.range, SkillR.speed, myHero)
if ValidTarget(unit, SkillR.range) and rPos ~= nil and maxHit >= Settings.AutoUlt.ARX then
Packet("S_CAST", {spellId = _R, fromX = rPos.x, fromY = rPos.z, toX = rPos.x, toY = rPos.z}):send()
end
end
end
end
end
assert(load(Base64Decode("G0x1YVIAAQQEBAgAGZMNChoKAAAAAAAAAAAAAQIKAAAABgBAAEFAAAAdQAABBkBAAGUAAAAKQACBBkBAAGVAAAAKQICBHwCAAAQAAAAEBgAAAGNsYXNzAAQNAAAAU2NyaXB0U3RhdHVzAAQHAAAAX19pbml0AAQLAAAAU2VuZFVwZGF0ZQACAAAAAgAAAAgAAAACAAotAAAAhkBAAMaAQAAGwUAABwFBAkFBAQAdgQABRsFAAEcBwQKBgQEAXYEAAYbBQACHAUEDwcEBAJ2BAAHGwUAAxwHBAwECAgDdgQABBsJAAAcCQQRBQgIAHYIAARYBAgLdAAABnYAAAAqAAIAKQACFhgBDAMHAAgCdgAABCoCAhQqAw4aGAEQAx8BCAMfAwwHdAIAAnYAAAAqAgIeMQEQAAYEEAJ1AgAGGwEQA5QAAAJ1AAAEfAIAAFAAAAAQFAAAAaHdpZAAEDQAAAEJhc2U2NEVuY29kZQAECQAAAHRvc3RyaW5nAAQDAAAAb3MABAcAAABnZXRlbnYABBUAAABQUk9DRVNTT1JfSURFTlRJRklFUgAECQAAAFVTRVJOQU1FAAQNAAAAQ09NUFVURVJOQU1FAAQQAAAAUFJPQ0VTU09SX0xFVkVMAAQTAAAAUFJPQ0VTU09SX1JFVklTSU9OAAQEAAAAS2V5AAQHAAAAc29ja2V0AAQIAAAAcmVxdWlyZ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