/
InsidiousVarus.lua
766 lines (618 loc) · 22.6 KB
/
InsidiousVarus.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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
local myHero = GetMyHero()
if GetObjectName(myHero) ~= "Varus" then return end
local LocalVersion = 1.04
local UpdateURL = ""
local pred = nil
local vishandle = nil
local LaneClearMode = 1
function VarusMessage(msg)
print("<font color=\"#00f0ff\"><b>Insidious Varus:</b></font><font color=\"#ffffff\"> "..msg.."</font>")
end
local skills = {
Q = { delay = 0, speed = 1750, width = 75, minRange = 1050, maxRange = 1675, range=1675},
E = { delay = 0.1, speed = 1600, width = 550, range = 975, radius = 275},
R = { delay = 0.1, speed = 1850, width = 120, range = 1075}
}
local itemconstants = {ITEM_1, ITEM_2, ITEM_3, ITEM_4, ITEM_5, ITEM_6, ITEM_7}
local items = {trinket = 3363, bork = 3153, cutlass = 3144, youmuus = 3142}
local LastComboSpellTime = 0
local IsKSChannel = false
local shop = nil
AutoUpdater(LocalVersion,
true,
"raw.githubusercontent.com",
"/Fret13103/Gaming-On-Steroids/master/InsidiousVarus.ver.lua".. "?no-cache=".. math.random(9999, 1001020201),
"/Fret13103/Gaming-On-Steroids/master/InsidiousVarus.lua".. "?no-cache=".. math.random(9999, 1001020201),
SCRIPT_PATH .. "InsidiousVarus.lua",
function() VarusMessage("Update completed successfully!") return end,
function() VarusMessage("You are up to date!") return end,
function() VarusMessage("Update found - starting update!") return end,
function() VarusMessage("Failed to update!") return end)
if not pcall( require, "OpenPredict" ) then VarusMessage("Please install OpenPredict!") return end
-- SCRIPT MENU CREATION
local mainMenu = Menu("varus", "Insidious Varus")
mainMenu:SubMenu("qconfig", "Varus: Q")
mainMenu.qconfig:Slider("qstacks", "Minimum stacks on target to Q", 3, 1, 3 , 1)
mainMenu.qconfig:Boolean("comboq", "Use Q in combo", true)
mainMenu.qconfig:Boolean("harassq", "Use Q in harass", true)
mainMenu:SubMenu("econfig", "Varus: E")
mainMenu.econfig:Slider("estacks", "Minimum stacks on target to E", 3, 1, 3, 1)
mainMenu.econfig:Boolean("comboe", "Use E in combo", true)
mainMenu.econfig:Boolean("harasse", "Use E in harass", true)
mainMenu:SubMenu("clearconfig", "Varus: Laneclear")
mainMenu.clearconfig:Info("blank", " ")
mainMenu.clearconfig:Info("separator", "Q logics") --SEPARATOR
mainMenu.clearconfig:Boolean("laneclearQ", "Use Q in laneclear", true)
mainMenu.clearconfig:Slider("QMinionsNumber", "Q to hit x minions", 3, 1, 7, 1)
mainMenu.clearconfig:Slider("QChargeTime", "Charge Q for (x) ms", 500, 1, 1500, 10)
mainMenu.clearconfig:Boolean("ShoveQ", "Use Q to shove", true)
mainMenu.clearconfig:Info("blank", " ")
mainMenu.clearconfig:Info("separator", "E logics") --SEPARATOR
mainMenu.clearconfig:Boolean("laneclearE", "Use E in laneclear", true)
mainMenu.clearconfig:Slider("EMinionsNumber", "E to hit x minions", 4, 1, 7, 1)
mainMenu.clearconfig:Boolean("ShoveE", "Use E to shove", true)
mainMenu.clearconfig:Slider("ClearManaE", "Shove min% mana to ult", 60, 1, 100, 1)
mainMenu:SubMenu("misc", "Varus: Miscellaneous")
mainMenu.misc:DropDown("drawPos", "Where on screen to draw text: ", 1, {"On myHero", "Topleft corner", "Topright corner", "Above minimap"}, function() print("changed draw pos") end, false)
mainMenu.misc:Boolean("disableStacks", "Use abilities at 0 w stacks", false)
mainMenu:SubMenu("keyconfig", "Varus: Keys")
mainMenu.keyconfig:Key("combo", "Combo key", string.byte(" "))
mainMenu.keyconfig:Key("harass", "Harass key", string.byte("C"))
mainMenu.keyconfig:Key("clear", "Lane & Jungle clear", string.byte("V"))
mainMenu:SubMenu("autolevel", "Varus: Autolevel")
mainMenu.autolevel:Boolean("allowLeveling", "Autolevel skills", true)
mainMenu.autolevel:Slider("skillOrder", "Skill order priority", 2, 1, 2, 1)
mainMenu.autolevel:Info("displayOrder", "Skill order is: E")
-- SCRIPT CLASSES
local SkillOrders = {
{_Q,_E,_E, _Q, _Q, _R,_Q,_E,_Q,_E,_R,_E,_E,_W,_W,_R,_W,_W},
{_Q,_W,_E, _Q, _Q, _R,_Q,_W,_Q,_W,_R,_W,_W,_E,_E,_R,_E,_E}
}
class "PredictMain"
function PredictMain:__init()
self.EnemyHeroes = {}
for i, enemy in pairs(GetEnemyHeroes()) do
table.insert(self.EnemyHeroes, EnemyHero(enemy, GetGameTimer(), GetOrigin(EnemyHero), GetDirection(enemy) or Vector(0,0,1), GetMoveSpeed(enemy) or 360))
end
OnTick(function() self:Tick() end)
end
function PredictMain:EstimateMissingPos(EnemyHero, time)
if EnemyHero == nil then return end
local ms = EnemyHero.LastSpeed
if not EnemyHero.LastDirection then print ("no direction") return end
local dir = EnemyHero.LastDirection
local time = GetGameTimer() - EnemyHero.LastSeen
if dir == nil then return end
local missingtime = GetGameTimer() - EnemyHero.LastSeen
if missingtime > 2 then print("not missing PREDMAIN") return end
local vec = GetOrigin(EnemyHero.Hero) + Vector(Vector(dir):normalized() * time * ms)
return vec
end
function PredictMain:GetEnemyHeroObject(champ)
for _, enemyhero in pairs(self.EnemyHeroes) do
if enemyhero.Hero.networkID == champ.networkID then
return enemyhero
end
end
end
function PredictMain:Tick()
for _, enemyhero in pairs(self.EnemyHeroes) do
if IsVisible(enemyhero) then
enemyhero.LastSeen = GetGameTimer()
enemyhero.LastPos = GetOrigin(enemyhero)
enemyhero.LastSpeed = GetMoveSpeed(enemyhero)
enemyhero.LastDirection = GetDirection(enemyhero)
end
end
end
class "EnemyHero"
function EnemyHero:__init(champ, lastseen, lastpos, lastdirection, lastspeed, lasthp)
self.Hero = champ
self.LastSeen = lastseen
self.LastPos = lastpos
self.LastDirection = lastdirection
self.LastSpeed = lastspeed
self.LastHP = lasthp
return {Hero = self.Hero, LastSeen = self.LastSeen, LastPos = self.LastPos, LastDirection = self.LastDirection, LastHP = self.LastHP}
end
class "VisionHandler"
function VisionHandler:__init()
self.VisibleEnemies = {}
self.EnemyDatas = {}
self.BlueTrinketID = 3363
self.DefaultTrinketID = 3340
for i, unit in pairs(GetEnemyHeroes()) do
table.insert(self.EnemyDatas, EnemyHero(unit, GetGameTimer(), Vector(0,0,0), GetDirection(unit) or Vector(0,0,1), 300, unit.health))
end
OnTick(function() self:Tick() end)
end
function VisionHandler:GetVisibleEnemies()
local visibles = {}
for i, unit in pairs(GetEnemyHeroes()) do
if unit.visible then
table.insert(visibles, unit)
end
end
return visibles
end
function VisionHandler:Tick()
for _, enemy in pairs(self:GetVisibleEnemies()) do
local contains = false
for i, enemydata in pairs(self.EnemyDatas) do
if enemydata.Hero.networkID == enemy.networkID then
contains = true
enemydata.LastSeen = GetGameTimer()
enemydata.LastPos = GetOrigin(enemy)
enemydata.LastSpeed = GetMoveSpeed(enemy)
enemydata.LastDirection = GetDirection(enemy)
enemydata.LastHP = enemy.health
end
end
if contains == false then
table.insert(self.EnemyDatas, EnemyHero(unit, GetGameTimer(), GetOrigin(enemy), GetDirection(enemy), 300, enemy.health))
end
end
self:WardMissing()
end
function VisionHandler:LastSeenTime(unit)
for _, enemydata in pairs(self.EnemyDatas) do
if enemydata.Hero.networkID == unit.networkID then
return enemydata.LastSeen
--return MapPositionGos:inBush(enemydata.LastSeen)
end
end
end
function VisionHandler:GetMissing()
local missings = {}
for i, enemydata in pairs(self.EnemyDatas) do
if not IsVisible(enemydata.Hero) and GetGameTimer() - self:LastSeenTime(enemydata.Hero) <= .5 then
table.insert(missings, enemydata)
end
end
return missings
end
function VisionHandler:UseTrinket(enemyhero)
local itemconstants = {ITEM_1, ITEM_2, ITEM_3, ITEM_4, ITEM_5, ITEM_6, ITEM_7}
if enemyhero.LastHP <= 0 then return end
local pos = pred:EstimateMissingPos(enemyhero, GetGameTimer() - enemyhero.LastSeen)
if pos == nil then print("Insidious Varus Debug - VISIONHANDLER:USETRINKET ~ nil pos") return end
if myHero:DistanceTo(pos) <= skills.E.range and CanCast(2) then
CastSkillShot(2, pos)
return
end
for _, item in pairs(itemconstants) do
if GetItemID(myHero, item) == self.DefaultTrinketID then
if myHero:DistanceTo(pos) <= 600 then
CastSkillShot(item, pos)
end
elseif GetItemID(myHero, item) == self.BlueTrinketID then
if myHero:DistanceTo(pos) <= 2000 then
CastSkillShot(item, pos)
end
end
end
end
function VisionHandler:WardMissing()
local missings = self:GetMissing()
for i, enemydata in pairs(missings) do
trinketdata = { delay = 0.0, speed = math.huge, width = 238, range = 3500, radius = 475}
if enemydata.LastHP > 0 then
self:UseTrinket(enemydata)
end
end
end
class "autolevel"
function autolevel:__init() -- I would've done self.SkillOrders but it always returned nil... ?!?
OnTick(function() autolevel:Tick() end)
end
function autolevel:displayPriority()
if mainMenu.autolevel.skillOrder:Value() == 1 then
mainMenu.autolevel.displayOrder.name = "Skill order is: ".. "QWE"
elseif mainMenu.autolevel.skillOrder:Value() == 2 then
mainMenu.autolevel.displayOrder.name = "Skill order is: ".. "QEW"
end
end
function autolevel:Tick()
self:displayPriority()
if SkillOrders == nil then print("Skillorder nil error") return end
if GetLevelPoints(myHero) > 0 and mainMenu.autolevel.allowLeveling:Value() then
if (myHero.level + 1 - GetLevelPoints(myHero)) then
LevelSpell(SkillOrders[mainMenu.autolevel.skillOrder:Value()][myHero.level + 1 - GetLevelPoints(myHero)])
end
end
end
-- SCRIPT USEFUL FUNCTIONS
local wDatas = {}
DelayAction(function()
for i, v in pairs(GetEnemyHeroes()) do
wDatas[v.networkID] = 0
end
end, 1)
local QCastData = {casting, starttime}
function CalcQRange(timer)
local rangediff = skills.Q.maxRange - skills.Q.minRange
local min = skills.Q.minRange
local total = rangediff / 1.4 * timer + min
if total > skills.Q.maxRange then total = skills.Q.maxRange end
return total
end
function DrawQRange()
if QCastData.casting then
local timecasting = GetGameTimer() - QCastData.starttime
local range = CalcQRange(timecasting)
DrawCircle(GetOrigin(myHero), range, 1, 10, GoS.White)
else
DrawCircle(GetOrigin(myHero), skills.Q.minRange, 1, 10, GoS.White)
end
end
function stackDmg(unit)
if wDatas[unit.networkID] then
local wDmg = GetMaxHP(unit)*((1.25+GetCastLevel(myHero,_W)*0.75)+GetBonusAP(myHero)*0.02)*.01
return CalcDamage(myHero, unit, 0, wDmg*wDatas[unit.networkID])
else
return 0
end
end
function qDmg(unit, timer)
local minDmg = GetCastLevel(myHero,_Q)*55-30+GetBonusDmg(myHero)*1.6+GetBaseDamage(myHero)*1.6
local maxDmg = minDmg/16*10
local diff = maxDmg - minDmg
if timer == nil then timer = 1 end
local dmgadded = diff / 4 * timer
local dmgtot = minDmg + dmgadded
if not CanCast(_Q) then return 0 end
return CalcDamage(myHero, unit, dmgtot , 0) + stackDmg(unit)
end
function eDmg(unit)
if not CanCast(_E) then return 0 end
return CalcDamage(myHero, unit, GetCastLevel(myHero,_E)*35+30+GetBonusDmg(myHero)*.6 ,0) + stackDmg(unit)
end
function rDmg(unit)
if not CanCast(_R) then return 0 end
return CalcDamage(myHero, unit, 0 ,GetCastLevel(myHero,_R)*75+25+GetBonusAP(myHero)) + stackDmg(unit)
end
function ComboWillKill(unit)
local dmg = 0
if QCastData.casting then
dmg = qDmg(unit, GetGameTimer() - QCastData.starttime)
else
dmg = qDmg(unit, 1)
end
dmg = dmg + eDmg(unit)
dmg = dmg + rDmg(unit)
dmg = dmg + GetBonusDmg(myHero)
return unit.health <= dmg
end
function DrawDamageHealth(unit)
local dmg = 0
if QCastData.casting then
dmg = qDmg(unit, GetGameTimer() - QCastData.starttime)
else
dmg = qDmg(unit, 1)
end
dmg = dmg + eDmg(unit)
dmg = dmg + rDmg(unit)
DrawDmgOverHpBar(unit,GetCurrentHP(unit), dmg, 0, GoS.Blue)
end
function Ghostblade()
for i, item in pairs(itemconstants) do
local bork = nil
if GetItemID(myHero, item) == items.bork then
bork = item
elseif GetItemID(myHero, item) == items.cutlass then
bork = item
end
if bork ~= nil then
if CanCast(item) and ValidTarget(GetCurrentTarget()) then
CastTargetSpell(GetCurrentTarget(), item)
end
end
end
end
function PrintItems()
for i, item in pairs(itemconstants) do
PrintChat(GetItemID(myHero, item))
end
end
-- SCRIPT LOGICS COMBO
function CanCast(slot)
return myHero:CanUseSpell(slot) == 0
end
function ComboQ()
if not mainMenu.keyconfig.combo:Value() then return end
if isAttacking then return end
if not CanCast(_Q) then return end
if not mainMenu.qconfig.comboq:Value() then return end
if QCastData.casting then
local timecasting = GetGameTimer() - QCastData.starttime
local QPredData = {delay = skills.Q.delay, speed = skills.Q.speed, width = skills.Q.width, range = CalcQRange(timecasting)}
local predictinfo = GetLinearAOEPrediction(GetCurrentTarget(), QPredData, GetOrigin(myHero))
local castpos = predictinfo.castPos
if predictinfo.hitChance >= .6 and ValidTarget(GetCurrentTarget()) and GetGameTimer() - LastComboSpellTime >= 1.5 then
CastSkillShot2(0, castpos)
LastComboSpellTime = GetGameTimer()
end
--print(predictinfo)
elseif ValidTarget(GetCurrentTarget()) and myHero:DistanceTo(GetCurrentTarget()) <= skills.Q.maxRange then
if not mainMenu.misc.disableStacks:Value() then
if wDatas[GetCurrentTarget().networkID] >= mainMenu.qconfig.qstacks:Value() then
CastSkillShot(0, GetOrigin(myHero))
end
else
CastSkillShot(0, GetOrigin(myHero))
end
end
end
function ComboE()
if not mainMenu.keyconfig.combo:Value() then return end
if QCastData.casting then return end
if isAttacking then return end
if not CanCast(_E) then return end
if not mainMenu.econfig.comboe:Value() then return end
--local EPredData = {delay = skills.E.delay, speed = skills.E.speed, width = skills.E.width, range = skills.E.range, radius = skills.E.radius}
local predictinfo = GetCircularAOEPrediction(GetCurrentTarget(), skills.E, GetOrigin(myHero))
local castpos = predictinfo.castPos
if predictinfo.hitChance >= .7 and ValidTarget(GetCurrentTarget()) and GetGameTimer() - LastComboSpellTime > 2 then
if wDatas[GetCurrentTarget().networkID] >= mainMenu.econfig.estacks:Value() then
CastSkillShot(_E, castpos.x, castpos.y, castpos.z)
LastComboSpellTime = GetGameTimer()
end
end
end
function ComboR()
if not mainMenu.keyconfig.combo:Value() then return end
if not CanCast(_R) then return end
if QCastData.casting then return end
if isAttacking then return end
if not ValidTarget(GetCurrentTarget()) then return end
if not ComboWillKill(GetCurrentTarget()) then return end
local predictinfo = GetPrediction(GetCurrentTarget(), skills.R, GetOrigin(myHero))
local castpos = predictinfo.castPos
if predictinfo.hitChance >= .7 and ValidTarget(GetCurrentTarget()) then
--if wDatas[GetCurrentTarget().networkID] >= mainMenu.econfig.estacks:Value() then
CastSkillShot(_R, castpos.x, castpos.y, castpos.z)
--end
end
end
-- SCRIPT LOGICS HARASS
function HarassQ()
if not mainMenu.keyconfig.harass:Value() then return end
if not CanCast(_Q) then return end
if isAttacking then return end
if not mainMenu.qconfig.harassq:Value() then return end
if QCastData.casting then
local timecasting = GetGameTimer() - QCastData.starttime
if timecasting < 1 then return end
local QPredData = {delay = skills.Q.delay, speed = skills.Q.speed, width = skills.Q.width, range = CalcQRange(timecasting)}
local predictinfo = GetLinearAOEPrediction(GetCurrentTarget(), QPredData, GetOrigin(myHero))
local castpos = predictinfo.castPos
if predictinfo.hitChance >= .7 and ValidTarget(GetCurrentTarget()) then
CastSkillShot2(0, castpos)
end
--print(predictinfo)
elseif ValidTarget(GetCurrentTarget()) then
CastSkillShot(0, GetOrigin(myHero))
end
end
function HarassE()
if not mainMenu.keyconfig.harass:Value() then return end
if not CanCast(_E) then return end
if isAttacking then return end
if not mainMenu.econfig.harasse:Value() then return end
local predictinfo = GetCircularAOEPrediction(GetCurrentTarget(), skills.E, GetOrigin(myHero))
local castpos = predictinfo.castPos
if predictinfo.hitChance >= .7 and ValidTarget(GetCurrentTarget()) then
CastSkillShot(_E, castpos.x, castpos.y, castpos.z)
end
end
-- SCRIPT LOGICS LANECLEAR
function ClearQ()
if not mainMenu.clearconfig.laneclearQ:Value() then return end
if mainMenu.keyconfig.clear:Value() then
if not isAttacking then
if LaneClearMode == 2 then
for i, minion in pairs(minionManager.objects) do
if ValidTarget(minion, skills.Q.range) and mainMenu.clearconfig.ShoveQ:Value() then
local vectorTo = Vector(GetOrigin(minion)) - Vector(GetOrigin(myHero))
local vectorLeft = vectorTo:perpendicular()
local vectorRight = vectorTo:perpendicular2()
local start = Vector(GetOrigin(myHero))
local minionsinrange = {}
for i, minion in pairs(minionManager.objects) do
if ValidTarget(minion, skills.Q.range) then
table.insert(minionsinrange, minion)
end
end
local timecasting
if QCastData.starttime then
timecasting = GetGameTimer() - QCastData.starttime
else
timecasting = .1
end
local minionshitbyQ = CountObjectsOnLineSegment(start, start + (vectorTo:normalized() * CalcQRange(timecasting)), skills.Q.width, minionsinrange, nil)
if minionshitbyQ >= mainMenu.clearconfig.QMinionsNumber:Value() then
if not QCastData.casting then
CastSkillShot(0, start + (vectorTo:normalized() * skills.Q.range))
elseif GetGameTimer() - QCastData.starttime > (mainMenu.clearconfig.QChargeTime:Value()/1000) then
CastSkillShot2(0, start + (vectorTo:normalized() * skills.Q.range))
end
end
end
end
end
end
end
end
function ClearE()
if not mainMenu.clearconfig.laneclearE:Value() then return end
if mainMenu.keyconfig.clear:Value() then
if QCastData.casting then return end
if not isAttacking then
if LaneClearMode == 2 then
for i, minion in pairs(minionManager.objects) do
if ValidTarget(minion, skills.E.range) and mainMenu.clearconfig.ShoveE:Value() then
if myHero.mana <= (myHero.maxMana /100 * mainMenu.clearconfig.ClearManaE:Value()) then return end
local minionsHit = {}
for i, creep in pairs(minionManager.objects) do
if ValidTarget(creep) and minion:DistanceTo(creep) <= skills.E.radius then
table.insert(minionsHit, creep)
end
end
if #minionsHit >= mainMenu.clearconfig.EMinionsNumber:Value() then
CastSkillShot(2, GetOrigin(minion))
end
end
end
end
end
end
end
-- SCRIPT LOGICS KILLSTEAL
function DoKS()
for _, enemy in pairs(GetEnemyHeroes()) do
if ValidTarget(enemy) and myHero:DistanceTo(enemy) <= skills.Q.maxRange then
if CanCast(_Q) and qDmg(enemy) * 1.6 > enemy.health then
if not QCastData.casting then
CastSkillShot(0, GetOrigin(myHero))
IsKSChannel = true
else
local timecasting = GetGameTimer() - QCastData.starttime
local QPredData = {delay = skills.Q.delay, speed = skills.Q.speed, width = skills.Q.width, range = CalcQRange(timecasting)}
local predictinfo = GetLinearAOEPrediction(enemy, QPredData, GetOrigin(myHero))
local castpos = predictinfo.castPos
if predictinfo.hitChance >= .7 and ValidTarget(enemy) and myHero:DistanceTo(enemy) > ((CalcQRange(timecasting) + 200) < skills.Q.maxRange and CalcQRange(timecasting) + 200 or skills.Q.maxRange) then
CastSkillShot2(0, castpos)
IsKSChannel = false
end
end
end
end
end
end
-- SCRIPT MISC LOGICS
function CheckRCast(pos)
local ES = Vector(pos) - Vector(myHero)
ES = ES:normalized() * skills.R.range
pos = myHero.pos + ES
local predictedPositions = {}
for i, v in pairs(GetEnemyHeroes()) do
if ValidTarget(v, skills.R.range) then
local ppos = GetPrediction(v, skills.R, GetOrigin(myHero))
table.insert(predictedPositions, ppos)
end
end
if #predictedPositions == 0 then return end
for i, v in pairs(predictedPositions) do
local projection, line, isonline = VectorPointProjectionOnLine(Vector(myHero.pos), Vector(pos), Vector(ppos))
if Vector(projection):dist(Vector(ppos)) > skills.R.width then
print("ult will miss")
return false
end
end
return true
end
-- GOS API CALLBACKS
OnUpdateBuff(function(unit, buff)
if buff.Name == "VarusQ" and unit.networkID == myHero.networkID then
QCastData.casting = true
QCastData.starttime = GetGameTimer()
elseif buff.Name:lower() == "varuswdebuff" and unit.team ~= myHero.team then
wDatas[unit.networkID] = buff.Count
end
end)
OnRemoveBuff(function(unit, buff)
if buff.Name == "VarusQ" and unit.networkID == myHero.networkID then
QCastData.casting = false
IsKSChannel = false
elseif buff.Name:lower() == "varuswdebuff" and unit.team ~= myHero.team then
wDatas[unit.networkID] = 0
end
end)
OnSpellCast(function(spell)
if spell.spellID == 3 then
if not CheckRCast(spell.castPos) then
BlockCast()
end
end
end)
OnProcessSpellAttack(function(unit, spell)
if unit == myHero and spell.name:find("Attack") then
--print(spell.name)
isAttacking = true
end
end)
OnProcessSpellComplete(function(unit, spell)
if unit == myHero and spell.name:find("Attack") then
isAttacking = false
end
end)
OnAttackCancel(function()
isAttacking = false
end)
OnObjectLoad(function(object)
if object.type == Obj_AI_Shop and object.team == myHero.team then
shop = object
end
end)
OnTick(function()
ComboQ()
HarassQ()
if not IsKSChannel and not QCastData.Casting then
ComboE()
ComboR()
HarassE()
end
DoKS()
ClearQ()
ClearE()
if mainMenu.keyconfig.combo:Value() then
Ghostblade()
end
if shop and myHero:DistanceTo(shop) <= 1000 and GetLevel(myHero) >= 9 then
BuyItem(items.trinket)
end
end)
OnDraw(function()
DrawQRange()
local textpos3d = GetOrigin(myHero)
local datas
if mainMenu.misc.drawPos:Value() == 1 then
datas = WorldToScreen(1, textpos3d)
elseif mainMenu.misc.drawPos:Value() == 2 then
datas = {x=100, y=100, flag=true}
elseif mainMenu.misc.drawPos:Value() == 3 then
datas = {x=1680, y=70, flag=true}
elseif mainMenu.misc.drawPos:Value() == 4 then
datas = {x=1680, y=770, flag=true}
end
if datas.flag == true and mainMenu.keyconfig.clear:Value() then
if LaneClearMode == 1 then
DrawText("Laneclear mode: aa clear", 24, datas.x, datas.y, GoS.White)
else
DrawText("Laneclear mode: shove", 24, datas.x, datas.y, GoS.White)
end
--DrawText("IsAttacking: " .. tostring(isAttacking), 24, datas.x, datas.y - 20, GoS.White)
end
for _, enemy in pairs(GetEnemyHeroes()) do
DrawDamageHealth(enemy)
if ComboWillKill(enemy) and IsVisible(enemy) then
local screenpos = WorldToScreen(0,GetOrigin(enemy).x,GetOrigin(enemy).y,GetOrigin(enemy).z)
DrawText("COMBO WILL KILL PLAYER", 14, screenpos.x + 20, screenpos.y - 20 , GoS.White)
end
end
end)
OnLoad(function()
vishandle = VisionHandler()
pred = PredictMain()
autolevel()
end)
OnWndMsg(function(Msg, Key)
if Msg == KEY_DOWN then
if not mainMenu.keyconfig.clear:Value() then return end
if Key == 38 then
LaneClearMode = 2
elseif Key == 40 then
LaneClearMode = 1
end
end
end)