Repository navigation
Expand file tree
/
Copy pathVarus.lua
More file actions
694 lines (609 loc) · 22.1 KB
/
Copy pathVarus.lua
File metadata and controls
694 lines (609 loc) · 22.1 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
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
local version = "0.12"
--[[
Free Varus!
by Dienofail and Kain, with assistance from Andreluis034
Changelog:
v0.01 - release
v0.02 - Now uses DFG along with ult (manual and auto)
v0.03 - Bug fixes to E closest enemy. Changed default map for E closest enemy as well
v0.04 - small fixes
v0.05 - Github
v0.06 - fixes to Q stuck. Should get stuck far less often during combo (ditto on other modes)
v0.07 - Github
v0.08 - Separate W stack slider for combo and harass
v0.09 - Fixed 2nd E cast packet
v0.1 - Updated packets for 4.18
v0.11 - Added SoW and improved Q casting somewhat
v0.12 - small fixes
]]
if myHero.charName ~= "Varus" then return end
require 'VPrediction'
--Honda7
local autoupdateenabled = true
local UPDATE_SCRIPT_NAME = "Varus"
local UPDATE_HOST = "raw.github.com"
local UPDATE_PATH = "/Dienofail/BoL/master/Varus.lua"
local UPDATE_FILE_PATH = SCRIPT_PATH..GetCurrentEnv().FILE_NAME
local UPDATE_URL = "https://"..UPDATE_HOST..UPDATE_PATH
local ServerData
if autoupdateenabled then
GetAsyncWebResult(UPDATE_HOST, UPDATE_PATH.."?rand="..math.random(1,1000), function(d) ServerData = d end)
function update()
if ServerData ~= nil then
local ServerVersion
local send, tmp, sstart = nil, string.find(ServerData, "local version = \"")
if sstart then
send, tmp = string.find(ServerData, "\"", sstart+1)
end
if send then
ServerVersion = tonumber(string.sub(ServerData, sstart+1, send-1))
end
if ServerVersion ~= nil and tonumber(ServerVersion) ~= nil and tonumber(ServerVersion) > tonumber(version) then
DownloadFile(UPDATE_URL.."?rand="..math.random(1,1000), UPDATE_FILE_PATH, function () print("<font color=\"#FF0000\"><b>"..UPDATE_SCRIPT_NAME..":</b> successfully updated. Reload (double F9) Please. ("..version.." => "..ServerVersion..")</font>") end)
elseif ServerVersion then
print("<font color=\"#FF0000\"><b>"..UPDATE_SCRIPT_NAME..":</b> You have got the latest version: <u><b>"..ServerVersion.."</b></u></font>")
end
ServerData = nil
end
end
AddTickCallback(update)
end
local enemyTable
local HKX = string.byte("X")
local HKZ = string.byte("Y")
local HKC = string.byte("C")
local HKT = string.byte("T")
local KeySlowE = string.byte("Z")
local CurrentMS = myHero.ms
local CurrentAS = myHero.attackSpeed
--local Skills, Keys, Items, Data, Jungle, Helper, MyHero, Minions, Crosshair, Orbwalker = AutoCarry.Helper:GetClasses()
--Crosshair:SetSkillCrosshairRange(2000)
PrintChat('Simple Varus by Dienofal and Kain loading')
--if AutoCarry.Skills then IsSACReborn = true else IsSACReborn = false end
--if IsSACReborn then AutoCarry.Skills:DisableAll() end
--PrintChat('Debug1')
local qmaxRange = 1600
local qminRange = 850
local qWidth = 55
local qSpeed = 1900
local qDelay = 500
local qChargeTime = 1500
local eRange = 1000
local eCastTime = 0.251
local eWidth = 240
local eDelay = 0.251
local eSpeed = 1500
local qRadius = 55
local eSpeed = 1400
local QREADY = false
local WREADY = false
local EREADY = false
local RREADY = false
local MovePoint = nil
local BlockQ = false
local time_difference = 0
local CurrentRange = 0
local isPressedQ = false
local Qstartcasttime = 0
local Qcasttime = 0
local ProcStacks = {}
local rRange = 800
local Qlastcast = 0
local Qdifftime = 0
local force2Q
local loaded = false
local dfgSlot, dfgReady = nil, false
local Menu = nil
local MMAloaded = false
local SACloaded = false
local SowLoaded = false
--SkillE = AutoCarry.Skills:NewSkill(false, _E, 1000, "Varus E", AutoCarry.SPELL_LINEAR, 0, false, false, 1.500, 266, 270, false)
--SkillR = AutoCarry.Skills:NewSkill(false, _R, 1200, "Varus R", AutoCarry.SPELL_LINEAR, 0, false, false, 1.950, 251, 100, false)
--PrintChat('Debug2')
--ignite = ((myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") and SUMMONER_1) or (myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") and SUMMONER_2) or nil)
--PrintChat('Debug3')
function OnLoad()
Menu()
VP = VPrediction()
enemyTable = GetEnemyHeroes()
--Crosshair:SetSkillCrosshairRange(1600)
for i, enemy in pairs(enemyTable) do
ProcStacks[enemy.networkID] = 0
end
if _G.MMA_Loaded then
loaded = true
else
DelayAction(checkOrbwalker, 10)
end
end
function checkOrbwalker()
if _G.MMA_Loaded ~= nil and _G.MMA_Loaded then
MMAloaded = true
print('MMA detected')
elseif _G.AutoCarry then
SACloaded = true
Skills, Keys, Items, Data, Jungle, Helper, MyHero, Minions, Crosshair, Orbwalker = AutoCarry.Helper:GetClasses()
print('SAC detected')
elseif FileExist(LIB_PATH .."SOW.lua") then
require "SOW"
SOWi = SOW(VP)
SowLoaded = true
--SOWi:RegisterAfterAttackCallback(AutoAttackReset)
print('SOW loaded')
DelayAction(function()
print('Adding SoW to menu')
Menu:addSubMenu("Orbwalker", "SOWiorb")
SOWi:LoadToMenu(Menu.SOWiorb)
end, 10)
else
print('Please use SAC, MMA, or SOW for your orbwalker')
end
loaded = true
end
-- To make sure no error because SAC takes 9001 years to load
function delayed()
PrintChat("Simple Varus Script now fully loaded with SAC")
loaded = true
SACloaded = true
Skills, Keys, Items, Data, Jungle, Helper, MyHero, Minions, Crosshair, Orbwalker = AutoCarry.Helper:GetClasses()
end
function OnTick()
--print(Qdifftime)
Checks()
UpdateQCasttime()
CheckQCastTime()
CurrentRange = ConvertQCastTime(Qcasttime)
-- if TargetHaveBuff("varuswdebuff", Target) then
-- print('Target have buff is functioning on ' .. tostring(Target.charName))
-- end
if Menu.combo.combo and ValidTarget(Target) then
if Menu.wsettings.PrioritizeQ then
if not isPressedQ and Menu.combo.useQ then
Cast1stQTarget(Target)
elseif Menu.combo.useQ then
Cast2ndQTarget(Target)
end
if (not QREADY or not Menu.combo.useQ) and Menu.combo.useE then
CastE(Target)
end
else
CastE(Target)
if not isPressedQ and Menu.combo.useQ then
Cast1stQTarget(Target)
elseif Menu.combo.useQ then
Cast2ndQTarget(Target)
end
end
if Menu.combo.useR and ProcStacks[Target.networkID] > 2 then
CastR(Target)
end
end
if isPressedQ and Menu.qsettings.CastQManual then
Send2ndQPacket(mousePos.x, mousePos.z)
end
--Credit to Chancey/Smart Nerdy
if Menu.qsettings.CastQHarass then
local closestchamp = nil
--print('Cast Q harass called')
for _, champ in pairs(enemyTable) do
if closestchamp and closestchamp.valid and champ and champ.valid then
if GetDistance(champ, mousePos) < GetDistance(closestchamp, mousePos) then
closestchamp = champ
end
else
closestchamp = champ
end
end
if ValidTarget(closestchamp) and GetDistance(closestchamp, myHero) < 1600 and QREADY then
--print(closestchamp.name)
if not isPressedQ then
Cast1stQTargetManual(closestchamp)
else
if Menu.qsettings.MaxRangeManualQ then
if CurrentRange >= 1550 then
Cast2ndQTargetManual(closestchamp)
end
else
Cast2ndQTargetManual(closestchamp)
end
end
end
end
--Slow E
if Menu.esettings.SlowE then
SlowClosestEnemy()
end
if Menu.rsettings.CastRManual then
--print('Cast R Manual called')
for _, champ in pairs(enemyTable) do
if closestchamp and closestchamp.valid and champ and champ.valid then
if GetDistance(champ, mousePos) < GetDistance(closestchamp, mousePos) then
closestchamp = champ
end
else
closestchamp = champ
end
end
if ValidTarget(closestchamp) and GetDistance(closestchamp, myHero) < rRange and RREADY then
--print(closestchamp.name)
CastR(closestchamp)
end
end
if isPressedQ == false then force2Q = false end
if force2Q == true and isPressedQ then
if Target then
Cast2ndQTargetManual(Target)
else
Send2ndQPacket(mousePos.x, mousePos.z)
end
end
end
--Credits to Kain
function SlowClosestEnemy()
local closestEnemy = FindClosestEnemy()
if closestEnemy == nil then return end
if EREADY and ValidTarget(closestEnemy, eRange) then
local AOECastPosition, MainTargetHitChance, nTargets = VP:GetCircularAOECastPosition(closestEnemy, 0.5, (eWidth/2), eRange, 1500, myHero)
CastSpell(_E, AOECastPosition.x, AOECastPosition.z)
end
end
function FindClosestEnemy()
local closestchamp = nil
for _, champ in pairs(enemyTable) do
if closestchamp and closestchamp.valid and champ and champ.valid then
if GetDistance(champ, mousePos) < GetDistance(closestchamp, mousePos) then
closestchamp = champ
end
else
closestchamp = champ
end
end
return closestchamp
end
function EnemyCount(point, range)
local count = 0
for _, enemy in pairs(enemyTable) do
if enemy and not enemy.dead and GetDistance(point, enemy) <= range then
count = count + 1
end
end
return count
end
---End Credits to Kain
--Credit to mtmoon
function OnWndMsg(msg,key)
if key == string.byte("Q") and msg == KEY_UP then
-- mark Q key is release
force2Q = true
end
end
function OnDraw()
--DrawText3D("Current isPressedQ status is " .. tostring(isPressedQ), myHero.x, myHero.y, myHero.z, 25, ARGB(255,255,0,0), true)
if isPressedQ then
DrawCircle(myHero.x,myHero.y,myHero.z, CurrentRange, ARGB(255,255,0,0))
--DrawCircle(QCastPosition.x,QCastPosition.y,QCastPosition.z, qRadius, ARGB(255,0,255,0))
end
if Menu.wsettings.DrawStacks then
for i, enemy in pairs(enemyTable) do
if ValidTarget(enemy, eRange) then
if ProcStacks[enemy.networkID] > 0 then
-- DrawCircle(enemy.x, enemy.y, enemy.z, (60+(20 * ProcStacks[enemy.networkID])), 0xFF0000)
if ProcStacks[enemy.networkID] == 1 then
DrawText3D("1", enemy.x, enemy.y, enemy.z, 35, ARGB(255,255,0,0), true)
elseif ProcStacks[enemy.networkID] == 2 then
DrawText3D("2", enemy.x, enemy.y, enemy.z, 35, ARGB(255,255,0,0), true)
elseif ProcStacks[enemy.networkID] == 3 then
DrawText3D("3", enemy.x, enemy.y, enemy.z, 35, ARGB(255,255,0,0), true)
end
end
end
end
end
end
function CheckQCastTime()
if GetTickCount() - Qstartcasttime > 1450 then
Qcasttime = 1450
end
if GetTickCount()- Qstartcasttime > 5000 then
Qcasttime = 0
isPressedQ = false
end
end
function ConvertQCastTime()
local range = 0
if isPressedQ then
--PrintChat("Q is being updated!")
range = 850
if Qcasttime >= 1450 then
range = 1600
end
if Qcasttime > 0 and Qcasttime < 1450 then
--PrintChat("Middle calculation being done!")
range = (Qcasttime / 2000)*1150 + 850
--PrintChat("middle calculation result " .. tostring(range))
end
return range
else
return 0
end
end
function UpdateQCasttime()
if isPressedQ then
Qcasttime = GetTickCount() - Qstartcasttime
end
if not isPressedQ then
Qcasttime = 0
end
end
function IsMyManaLow()
if myHero.mana < (myHero.maxMana * ( Menu.ManaManager / 100)) then
return true
else
return false
end
end
function OnGainBuff(unit, buff)
if unit.isMe and (buff.name == 'varusqlaunch'or buff.name == 'VarusQ' or buff.name == 'varusqlaunchsound') then
--PrintChat("Gained")
isPressedQ = true
Qstartcasttime = GetTickCount()
if SACloaded then
MyHero:AttacksEnabled(false)
end
end
if buff.name == 'varuswdebuff' and unit.team ~= myHero.team then
ProcStacks[unit.networkID] = 1
end
end
function OnUpdateBuff(unit, buff)
if buff.name == 'varuswdebuff' then
ProcStacks[unit.networkID] = buff.stack
end
end
function OnLoseBuff(unit, buff)
if unit.isMe and buff.name == 'VarusQ' then
--PrintChat("Lost")
isPressedQ = false
Qcasttime = 0
if SACloaded then
MyHero:AttacksEnabled(true)
elseif MMAloaded then
_G.MMA_ResetAutoAttack()
end
Qlastcast = GetTickCount()
end
if buff.name == 'varuswdebuff' and unit.team ~= myHero.team then
ProcStacks[unit.networkID] = 0
end
end
function OnSendPacket(packet)
-- New handler for SAC: Reborn
local p = Packet(packet)
--if p:get("spellId") == SkillE.spellKey and not (AutoCarry.MainMenu.AutoCarry or AutoCarry.MainMenu.LaneClear or AutoCarry.MainMenu.MixedMode or AutoCarry.PluginMenu.esettings.SlowE) then
--p:block()
--end
if packet.header == 0xE5 or packet.header == 0xE6 and isPressedQ then --and Cast then -- 2nd cast of channel spells packet2
packet.pos = 5
spelltype = packet:Decode1()
if spelltype == 0x80 then -- 0x80 == Q
packet.pos = 1
packet:Block()
--PrintChat("Packet blocked")
end
end
if packet.header == 0x9A and isPressedQ then --and Cast then -- 2nd cast of channel spells packet2
packet:Block()
end
end
function Cast1stQTarget(Target)
if QREADY and ValidTarget(Target) and GetDistance(myHero, Target) < 1700 and not isPressedQ and ProcStacks[Target.networkID] >= Menu.wsettings.CarryMinWForQ then
local CastPosition, HitChance, Position = VP:GetLineCastPosition(Target, 0.500, qWidth, 1600, qSpeed, myHero)
if HitChance > 0 then
Packet("S_CAST", {spellId = _Q, x = CastPosition.x, y = CastPosition.z}):send()
if SACloaded then
MyHero:AttacksEnabled(false)
end
isPressedQ = true
end
end
end
function Cast1stQTargetManual(Target)
if QREADY and ValidTarget(Target) and GetDistance(myHero, Target) < 1700 and not isPressedQ then
local CastPosition, HitChance, Position = VP:GetLineCastPosition(Target, 0.500, qWidth, 1600, qSpeed, myHero)
if HitChance > 0 and CastPosition ~= nil then
Packet("S_CAST", {spellId = _Q, x = CastPosition.x, y = CastPosition.z}):send()
if SACloaded then
MyHero:AttacksEnabled(false)
end
isPressedQ = true
end
end
end
function Cast2ndQTargetManual(Target)
if QREADY and ValidTarget(Target) and GetDistance(myHero, Target) < 1700 and isPressedQ and Qcasttime > Menu.qsettings.QBuffer then
QCastPosition, QHitChance, QPosition = VP:GetLineCastPosition(Target, 0.250, qWidth, CurrentRange, qSpeed, myHero)
to_move_position = myHero + (Vector(QCastPosition) - myHero):normalized()*60
to_move_position = {x = to_move_position.x, z = to_move_position.z}
--print(to_move_position)
if QCastPosition ~= nil and QHitChance > 1 and GetDistance(QCastPosition, myHero) < CurrentRange then
myHero:MoveTo(to_move_position.x, to_move_position.z)
--print('Move 1 to called at ' .. tostring(to_move_position))
Send2ndQPacket(QCastPosition.x, QCastPosition.z)
if SACloaded then
MyHero:AttacksEnabled(true)
elseif MMAloaded then
_G.MMA_ResetAutoAttack()
end
--print('Move 3 to called at ' .. tostring(to_move_position))
end
end
end
function Cast2ndQTarget(Target)
if Target ~= nil and QREADY and ValidTarget(Target) and GetDistance(myHero, Target) < 1700 and isPressedQ and Qcasttime > Menu.qsettings.QBuffer then
QCastPosition, QHitChance, QPosition = VP:GetLineCastPosition(Target, 0.250, qWidth, CurrentRange, qSpeed, myHero)
--to_move_position = myHero + (Vector(QCastPosition) - myHero):normalized()*60
--print(to_move_position)
if (QCastPosition == nil or QHitChance == nil) and not CheckQPosition(QCastPosition, Target) then
return
end
to_move_position = myHero + (Vector(QCastPosition) - myHero):normalized()*60
to_move_position = {x = to_move_position.x, z = to_move_position.z}
if QHitChance > 1 and GetDistance(QCastPosition, myHero) < CurrentRange then
myHero:MoveTo(to_move_position.x, to_move_position.z)
--print('Move 1 to called at ' .. tostring(to_move_position))
Send2ndQPacket(QCastPosition.x, QCastPosition.z)
if SACloaded then
MyHero:AttacksEnabled(true)
elseif MMAloaded then
_G.MMA_ResetAutoAttack()
end
elseif Qcasttime > Menu.qsettings.QMaxBuffer/2 and QHitChance > 0 and GetDistance(QCastPosition, myHero) < CurrentRange then
myHero:MoveTo(to_move_position.x, to_move_position.z)
Send2ndQPacket(QCastPosition.x, QCastPosition.z)
if SACloaded then
MyHero:AttacksEnabled(true)
elseif MMAloaded then
_G.MMA_ResetAutoAttack()
end
--print('Move 2 to called at ' .. tostring(to_move_position))
elseif Qcasttime > Menu.qsettings.QMaxBuffer and GetDistance(QCastPosition, myHero) < CurrentRange then
myHero:MoveTo(to_move_position.x, to_move_position.z)
Send2ndQPacket(QCastPosition.x, QCastPosition.z)
if SACloaded then
MyHero:AttacksEnabled(true)
elseif MMAloaded then
_G.MMA_ResetAutoAttack()
end
--print('Move 3 to called at ' .. tostring(to_move_position))
elseif CurrentRange > GetDistance(Target) + 50 and CurrentRange > GetDistance(QCastPosition) + 50 and Qcasttime > Menu.qsettings.QMaxBuffer/4 then
myHero:MoveTo(to_move_position.x, to_move_position.z)
Send2ndQPacket(QCastPosition.x, QCastPosition.z)
if SACloaded then
MyHero:AttacksEnabled(true)
elseif MMAloaded then
_G.MMA_ResetAutoAttack()
end
end
end
end
function CastE(Target)
--print('CastE called')
if EREADY and ValidTarget(Target) and ProcStacks[Target.networkID] >= Menu.wsettings.CarryMinWForE and GetTickCount() - Qlastcast > 500 then
local AOECastPosition, MainTargetHitChance, nTargets = VP:GetCircularAOECastPosition(Target, 0.5, (eWidth/2), eRange, 1500, myHero)
CastSpell(_E, AOECastPosition.x, AOECastPosition.z)
end
end
function CastR(Target)
if RREADY and Target and not Target.dead and ValidTarget(Target, rRange) then
CastDFG(Target)
local CastPosition, HitChance, Position = VP:GetLineCastPosition(Target, 0.5, 100, 800, 1500, myHero, false)
if HitChance < 2 then return end
CastSpell(_R, CastPosition.x, CastPosition.z)
end
end
function Send2ndQPacket(xpos, zpos)
--PrintChat("Packet Called!")
packet = CLoLPacket(0xE6)
packet:EncodeF(myHero.networkID)
packet:Encode1(190)
packet:Encode1(0)
packet:EncodeF(xpos)
packet:EncodeF(myHero.y)
packet:EncodeF(zpos)
packet.dwArg1 = 1
packet.dwArg2 = 0
SendPacket(packet)
--PrintChat("Packet Sent!")
--nID, spell, x, y, z
end
function CheckQPosition(targetPosition, Target)
if targetPosition == nil or Target == nil then
return false
else
local toTargetVector = Vector(Vector(Target) - Vector(myHero)):normalized()
local toPositionVector = Vector(Vector(Position) - Vector(myHero)):normalized()
if toPositionVector:angle(toTargetVector) > math.pi/2 or toPositionVector:angle(toTargetVector) < -math.pi/2 then
return false
else
return true
end
end
end
function GetCustomTarget()
ts:update()
ts2:update()
if _G.MMA_Target and _G.MMA_Target.type == myHero.type then return _G.MMA_Target end
if _G.AutoCarry and _G.AutoCarry.Crosshair and _G.AutoCarry.Attack_Crosshair and _G.AutoCarry.Attack_Crosshair.target and _G.AutoCarry.Attack_Crosshair.target.type == myHero.type then return _G.AutoCarry.Attack_Crosshair.target end
if ts.target ~= nil then
return ts.target
else
return ts2.target
end
end
function Checks()
QREADY = (myHero:CanUseSpell(_Q) == READY)
WREADY = (myHero:CanUseSpell(_W) == READY)
EREADY = (myHero:CanUseSpell(_E) == READY)
RREADY = (myHero:CanUseSpell(_R) == READY)
IGNITEReady = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then
ignite = SUMMONER_1
elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then
ignite = SUMMONER_2
end
if loaded then
-- if _G.MMA_Loaded then
-- Target = _G.MMA_Target
-- else Target = AutoCarry.Crosshair:GetTarget()
-- end
Target = GetCustomTarget()
end
dfgSlot = GetInventorySlotItem(3128)
dfgReady = (dfgSlot ~= nil and myHero:CanUseSpell(dfgSlot) == READY)
end
function CalculateBonusQ(minion)
local bonusDamage = getDmg("W", minion, myHero)
--print('Bonus W damage called, with bonus damage of ' .. tostring(bonusDamage))
if bonusDamage ~= nil then
return bonusDamage
end
end
function CastDFG(Target)
if Target ~= nil and dfgReady and GetDistance(Target) < 750 then
CastSpell(dfgSlot, Target)
end
end
function Menu()
Menu = scriptConfig("Varus", "Varus")
Menu:addSubMenu("Combo Settings", "combo")
Menu.combo:addParam("combo", "Combo key", SCRIPT_PARAM_ONKEYDOWN, false, 32)
Menu.combo:addParam("useQ", "Use (Q)", SCRIPT_PARAM_ONOFF, true)
--Menu.combo:addParam("useW", "Use (W)", SCRIPT_PARAM_ONOFF, true)
Menu.combo:addParam("useE", "Use (E)", SCRIPT_PARAM_ONOFF, true)
Menu.combo:addParam("useR", "Use (R)", SCRIPT_PARAM_ONOFF, false)
--Menu:addParam("LastHitE", "Smart Last hit with E", SCRIPT_PARAM_ONOFF, true) -- MMA Last hit with E Not ImplementedW
--Menu:addParam("LastHitMinimumMinions", "Min minions for E last hit", SCRIPT_PARAM_SLICE, 2, 1, 10, 0) -- minion slider, MMA Not Implemented
Menu:addSubMenu("Q Settings", "qsettings")
Menu.qsettings:addParam("CastQManual","Cancel Q to mouse cursor", SCRIPT_PARAM_ONKEYDOWN, false, HKX)
Menu.qsettings:addParam("CastQHarass","Cast Q to target near mouse cursor", SCRIPT_PARAM_ONKEYDOWN, false, HKT)
Menu.qsettings:addParam("MaxRangeManualQ", "Max Range Only for Manual Q", SCRIPT_PARAM_ONOFF, true)
Menu.qsettings:addParam("QBuffer", "Q minimum time buffer", SCRIPT_PARAM_SLICE, 100, 0, 500, 0)
Menu.qsettings:addParam("QMaxBuffer", "Q maximum time buffer", SCRIPT_PARAM_SLICE, 1450, 500, 1450, 0)
Menu:addSubMenu("W Settings", "wsettings")
Menu.wsettings:addParam("CarryMinWForQ", "Min W to Q", SCRIPT_PARAM_SLICE, 3, 0, 3, 0) -- W stacks to Q
Menu.wsettings:addParam("CarryMinWForE", "Min W to E", SCRIPT_PARAM_SLICE, 2, 0, 3, 0) -- W stacks to E
Menu.wsettings:addParam("PrioritizeQ", "Priotize Q", SCRIPT_PARAM_ONOFF, true) -- W stacks to E
Menu.wsettings:addParam("DrawStacks", "Draw Blighted Quiver Stacks", SCRIPT_PARAM_ONOFF, true)
Menu:addSubMenu("E Settings", "esettings")
Menu.esettings:addParam("SlowE", "Slow nearest enemy with E", SCRIPT_PARAM_ONKEYDOWN, false, KeySlowE)
Menu:addSubMenu("R Settings", "rsettings")
Menu.rsettings:addParam("CastRManual","Cast R to target near mouse cursor", SCRIPT_PARAM_ONKEYDOWN, false, HKZ)
Menu.rsettings:addParam("LastRbounces", "Min R bounces", SCRIPT_PARAM_SLICE, 0, 0, 3, 0)
Menu:addParam("ManaManager", "Mana Manager", SCRIPT_PARAM_SLICE, 0, 0, 100, 0)
ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, 600, DAMAGE_PHYSICAL)
ts2 = TargetSelector(TARGET_LESS_CAST_PRIORITY, 1400, DAMAGE_PHYSICAL)
ts.name = "Ranged Main"
ts2.name = "Ranged Q"
Menu:addTS(ts2)
Menu:addTS(ts)
end