Repository navigation
Expand file tree
/
Copy pathVelkoz.lua
More file actions
1610 lines (1441 loc) · 59.2 KB
/
Copy pathVelkoz.lua
File metadata and controls
1610 lines (1441 loc) · 59.2 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
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
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
local version = "1.18"
--[[
Velkoz, The Geometry Nightmare
by Dienofail
Changelog
v0.01 - release
v0.02 - Hotfixes to W and etc. Turned autoupdate on.
v0.03 - more hotfixes
v0.04 - Q fixes
v0.05 - Few more fixes
v0.06 - Battlecast skin particles added. If it doesn't work, revert back to normal skin.
v0.07 - Added Harass Options
v0.08 - Added R packet block option (will block R packets while R is casting), lowered W max range, and made fixes for W farm. Split Q farm added. Added max distance slider for Q splits
v1.00 - Added additional hit chance slider for initial Q split casts (will not affect normal non-collision casts). Added Double Q code checks. Added Mancusizz orbwalker and ignite KS. Should be usable standalone now.
v1.01 - E delay fixes. Should now cast more often and feel more responsive
v1.02 - updated with correct Q split speeds
v1.03 - Draw R kill text and kalman filter implemented, added AOE skill shot position for VPrediction v2.34
v1.04 - Fixed ignite KS.
v1.05 - Added better R killtext. Added drawing Q split calculations to Q draw (red -> not detonating, blue -> detonating). Added secondary Q split algorithm. Added Q split target locking
v1.06 - Fixed debug info
v1.07 - Fixed critical error in Q angle collision calculations. Also lowered debug font.
v1.08 - Added some buffer distance to Q projectile, should now detonate more often and faster. Let me know what you think of accuracy vs 1.07.
v1.09 - Some minor fixes to split Q calculations.
v1.10 - Small bug fixes to farm calculations
v1.11 - Added E dashes
v1.12 - Fixed E and Q range
v1.13 - Added option to disable autoattacks. Added toggle mode.
v1.14 - Fixed compatibility with VPred 2.404
v1.15 - ???
v1.16 - Fixed R autolock packet changes
v1.17 - 4.13 Fixes + adjustments
v1.18 - 4.18 R packet fixes
Todo:
]]--
--Start Honda7 credit
if myHero.charName ~= "Velkoz" then return end
require 'VPrediction'
local autoupdateenabled = true
local UPDATE_SCRIPT_NAME = "Velkoz"
local UPDATE_HOST = "raw.github.com"
local UPDATE_PATH = "/Dienofail/BoL/master/Velkoz.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, 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.."?nocache"..myHero.charName..os.clock(), 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
--End Honda7 credit
--Start Vadash Credit
class 'Kalman' -- {
function Kalman:__init()
self.current_state_estimate = 0
self.current_prob_estimate = 0
self.Q = 1
self.R = 15
end
function Kalman:STEP(control_vector, measurement_vector)
local predicted_state_estimate = self.current_state_estimate + control_vector
local predicted_prob_estimate = self.current_prob_estimate + self.Q
local innovation = measurement_vector - predicted_state_estimate
local innovation_covariance = predicted_prob_estimate + self.R
local kalman_gain = predicted_prob_estimate / innovation_covariance
self.current_state_estimate = predicted_state_estimate + kalman_gain * innovation
self.current_prob_estimate = (1 - kalman_gain) * predicted_prob_estimate
return self.current_state_estimate
end
--[[ Velocities ]]
local kalmanFilters = {}
local velocityTimers = {}
local oldPosx = {}
local oldPosz = {}
local oldTick = {}
local velocity = {}
local lastboost = {}
local velocity_TO = 10
local CONVERSATION_FACTOR = 975
local MS_MIN = 500
local MS_MEDIUM = 750
--End Vadash Credit
local VP = VPrediction()
local OriginalCastVector1 = nil
local OriginalCastVector2 = nil
local RotatedUnitVector1 = nil
local RotatedUnitVector2 = nil
local RotatedVector1 = nil
local RotatedVector2 = nil
local QObject = nil
local QEndObject = nil
local ToRotateVector = nil
local isPressedR = false
local BlockQ = false
local ignite = nil
local igniteReady = nil
local QAdditionalDistance = 435
local SpellQ = {Range = 1050, Speed = 1300, Delay = 0.066, Width = 50}
local SpellW = {Range = 1050, Speed = 1700, Delay = 0.064, Width = 80}
local SpellE = {Range = 850, Speed = 1500, Delay = 0.333, Width = 120}
local SpellR = {Range = 1550, Speed = 20000, Delay = 0.250, Width = 50}
local QSplitSpeed = 2100
local InitialTarget = nil
local LastPacketSend = 0
local LastPacketBlock = false
initDone = false
local buffer = false
target = nil
local DoubleCast = false
local StoredPosition = nil
local QStartPos = nil
local DeflectedPosition = nil
local pointLine, pointSegment = nil, nil
local current_distance = nil
local EndPos1, EndPos2 = nil, nil
local SplitQPosition, SplitQHitChance = nil, nil
local pointSegment2, pointLine2, isOnSegment2 = nil, nil, nil
local pointSegment3, pointLine3, isOnSegment3 = nil, nil, nil
local AngleTable = nil
local VectorTable = nil
local VectorTable2 = nil
local CheckPoint = nil
local DoubleQTarget = nil
local lastAnimation = nil
local lastAttack = 0
local lastAttackCD = 0
local ignite
local lastWindUpTime = 0
local eneplayeres = {}
local lastdistance = nil
local LastUnitVector1 = nil
local LastUnitVector2 = nil
local LastDetonateTime = nil
local detonate1 = false
local Qlocktarget = nil
local detonate2 = false
-- if VIP_USER then
-- AdvancedCallback:bind('OnSendPacket', function(packet) OnSendPacket(packet) end)
-- AdvancedCallback:bind('OnLoseBuff', function(unit, buff) OnLoseBuff(unit, buff) end)
-- AdvancedCallback:bind('OnCreateObj', function(unit, buff) OnCreateObj(unit, buff) end)
-- AdvancedCallback:bind('OnDeleteObj', function(unit, buff) OnDeleteObj(unit, buff) end)
-- end
function OnLoad()
Menu()
Init()
-- ts = TargetSelector(TARGET_NEAR_MOUSE, 1500, DAMAGE_MAGICAL)
-- ts.name = "Vel'Koz"
-- Config:addTS(ts)
-- EnemyMinions = minionManager(MINION_ENEMY, 1200, myHero, MINION_SORT_MAXHEALTH_DEC)
-- JungleMinions = minionManager(MINION_JUNGLE, 1200, myHero, MINION_SORT_MAXHEALTH_DEC)
if VP.version < 2.404 then
print('You need latest version of VPREDICTION (2.404 or above) for this script to function')
end
end
function Init()
--print('Init called')
--Start Vadash Credit
for i = 1, heroManager.iCount do
local hero = heroManager:GetHero(i)
if hero.team ~= player.team then
table.insert(eneplayeres, hero)
kalmanFilters[hero.networkID] = Kalman()
velocityTimers[hero.networkID] = 0
oldPosx[hero.networkID] = 0
oldPosz[hero.networkID] = 0
oldTick[hero.networkID] = 0
velocity[hero.networkID] = 0
lastboost[hero.networkID] = 0
end
end
--End Vadash Credit
ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, 1200, DAMAGE_MAGICAL)
ts2 = TargetSelector(TARGET_LESS_CAST_PRIORITY, 1600, DAMAGE_MAGICAL)
ts3 = TargetSelector(TARGET_NEAR_MOUSE, 1550, DAMAGE_MAGICAL)
ts.name = "Vel'Koz main"
ts2.name = "Q SPLITTING"
ts3.name = "R TARGETTING"
Config:addTS(ts3)
Config:addTS(ts2)
Config:addTS(ts)
EnemyMinions = minionManager(MINION_ENEMY, 1200, myHero, MINION_SORT_MAXHEALTH_DEC)
JungleMinions = minionManager(MINION_JUNGLE, 1200, myHero, MINION_SORT_MAXHEALTH_DEC)
initDone = true
print('Dienofail Velkoz ' .. tostring(version) .. ' loaded!')
end
function OnWndMsg(msg,key)
if key == string.byte("Q") and msg == KEY_DOWN and QObject ~= nil and QObject then
-- mark Q key is release
if Config.Extras.Debug then
print('Q key override enabled')
end
Cast2ndQPacket(myHero)
end
end
function Menu()
Config = scriptConfig("Velkoz", "velkoz")
Config:addParam("Combo", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, string.byte('C'))
Config:addParam("Harass", "Harass (PRESS)", SCRIPT_PARAM_ONKEYDOWN, false, string.byte('T'))
Config:addParam("Harass2", "Harass (TOGGLE)", SCRIPT_PARAM_ONKEYTOGGLE, false, string.byte('Y'))
Config:addParam("Farm", "Farm", SCRIPT_PARAM_ONKEYDOWN, false, string.byte('V'))
--Config:addParam("ManualQSplit", "QSplit", SCRIPT_PARAM_ONKEYDOWN, false, string.byte('T'))
Config:addParam("TrackR", "Track R ON/OFF", SCRIPT_PARAM_ONOFF, true)
Config:addSubMenu("Combo options", "ComboSub")
Config:addSubMenu("Harass options", "HarassSub")
Config:addSubMenu("Farm", "FarmSub")
Config:addSubMenu("Extra Config", "Extras")
Config:addSubMenu("Draw", "Draw")
--Combo options
Config.ComboSub:addParam("useQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
Config.ComboSub:addParam("useW", "Use W", SCRIPT_PARAM_ONOFF, true)
Config.ComboSub:addParam("useE", "Use E", SCRIPT_PARAM_ONOFF, true)
Config.ComboSub:addParam("Orbwalk", "Orbwalk", SCRIPT_PARAM_ONOFF, true)
Config.ComboSub:addParam("Autoattack", "Autoattack in Orbwalk", SCRIPT_PARAM_ONOFF, true)
--Farm
Config.FarmSub:addParam("useQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
Config.FarmSub:addParam("useW", "Use W", SCRIPT_PARAM_ONOFF, true)
Config.FarmSub:addParam("useE", "Use E", SCRIPT_PARAM_ONOFF, true)
--Harass
Config.HarassSub:addParam("UseWHarass", "Use W", SCRIPT_PARAM_ONOFF, true)
Config.HarassSub:addParam("Orbwalk", "Orbwalk", SCRIPT_PARAM_ONOFF, true)
Config.HarassSub:addParam("Autoattack", "Autoattack in Orbwalk", SCRIPT_PARAM_ONOFF, true)
--Draw
Config.Draw:addParam("DrawQ", "Draw Q Prediction", SCRIPT_PARAM_ONOFF, true)
Config.Draw:addParam("DrawQ2", "Draw Q Angle Prediction", SCRIPT_PARAM_ONOFF, true)
Config.Draw:addParam("DrawW", "Draw W Range", SCRIPT_PARAM_ONOFF, false)
Config.Draw:addParam("DrawE", "Draw E Range", SCRIPT_PARAM_ONOFF, false)
Config.Draw:addParam("DrawR", "Draw R Range", SCRIPT_PARAM_ONOFF, false)
Config.Draw:addParam("DrawTarget", "Draw Target Range", SCRIPT_PARAM_ONOFF, true)
Config.Draw:addParam("DrawRDamage", "Draw R Damage Counter", SCRIPT_PARAM_ONOFF, true)
--Extras
Config.Extras:addParam("Debug", "Debug", SCRIPT_PARAM_ONOFF, false)
Config.Extras:addParam("DetonateQ", "Auto Detonate Q", SCRIPT_PARAM_ONOFF, true)
Config.Extras:addParam("SplitQ", "Calculate Q splitting", SCRIPT_PARAM_ONOFF, true)
Config.Extras:addParam("SplitQMode", "Check Min Q First", SCRIPT_PARAM_ONOFF, false)
Config.Extras:addParam("SplitQDistance", "Split Q Extra Distance", SCRIPT_PARAM_SLICE, 700, 100, 900, 0)
Config.Extras:addParam("SplitQMinimumDistance", "Split Q Minimum Distance", SCRIPT_PARAM_SLICE, 250, 200, 900, 0)
Config.Extras:addParam("SplitQMaximumDistance", "Split Q Maximum Distance To Check", SCRIPT_PARAM_SLICE, 1000, 500, 1100, 0)
Config.Extras:addParam("SplitQDelay", "Split Q Delay (miliseconds)", SCRIPT_PARAM_SLICE, 66, 50, 350, 0)
Config.Extras:addParam("CheckAngle", "Attempt to Check Angles", SCRIPT_PARAM_ONOFF, true)
Config.Extras:addParam("CheckAngleOnly", "Only use Check Angles Prediction", SCRIPT_PARAM_ONOFF, false)
Config.Extras:addParam("MaxAngle", "Max Angle for Q Check", SCRIPT_PARAM_SLICE, 30, 1, 90, 0)
Config.Extras:addParam("AngleIncrement", "Increment Angle Degree", SCRIPT_PARAM_SLICE, 5, 1, 90, 0)
Config.Extras:addParam("DoubleQ", "Attempt multiple target Q checks (WILL LAG)", SCRIPT_PARAM_ONOFF, true)
Config.Extras:addParam("DoubleQDistance", "Multiple Q check distance interval", SCRIPT_PARAM_SLICE, 50, 1, 300, 0)
Config.Extras:addParam("FocusRTarget", "Focus Initial R Target", SCRIPT_PARAM_ONOFF, true)
Config.Extras:addParam("MinHitchance", "Minimum Hit Chance", SCRIPT_PARAM_SLICE, 1, 0, 5, 0)
Config.Extras:addParam("MinSplitQHitchance", "Minimum Initial Split Q Hit Chance", SCRIPT_PARAM_SLICE, 2, 0, 5, 0)
Config.Extras:addParam("RDelay", "R Delay", SCRIPT_PARAM_SLICE, 100, 0, 500, 0)
Config.Extras:addParam("BlockR", "Block packets during R cast", SCRIPT_PARAM_ONOFF, false)
Config.Extras:addParam("EGapClosers", "E Gap Closers", SCRIPT_PARAM_ONOFF, true)
Config:permaShow("Combo")
Config:permaShow("Farm")
Config:permaShow("Harass")
Config:permaShow("Harass2")
end
function OnTick()
--print(initDone)
UpdateSpeed()
UpdateVector()
Check()
CurrentTick = GetTickCount()
--Cast2ndR()
if initDone then
ts:update()
ts2:update()
ts3:update()
EnemyMinions:update()
JungleMinions:update()
target = ts.target
if not target then target = nil end
target2 = ts2.target
target3 = ts3.target
if not target2 then
target2 = nil
Best_Position = nil
DoubleQTarget = nil
Qlocktarget = nil
--BlockQ = false
end
if Config.Extras.DoubleQ and QObject ~= nil and Config.Extras.DetonateQ and target2 ~= nil and DoubleQTarget ~= nil then
SplitQ(target2)
SplitQ(DoubleQTarget)
elseif Qlocktarget ~= nil and QObject ~= nil and Config.Extras.DetonateQ then
SplitQ(Qlocktarget)
elseif target ~= nil and QObject ~= nil and Config.Extras.DetonateQ then
SplitQ(target)
elseif target2 ~= nil and Config.Extras.DetonateQ and QObject ~= nil then
SplitQ(target2)
else
LastDetonateTime = nil
LastUnitVector1 = nil
LastUnitVector2 = nil
detonate2 = false
detonate1 = false
EndPos1 = nil
EndPos2 = nil
end
if target2 ~= nil and Config.Extras.SplitQ and Config.Extras.CheckAngle and Config.Extras.DrawQ2 and not BlockQ then
DeflectedPosition = CalculateDeflectedCastPosition(target2)
end
-- if Config.Extras.Debug and target ~= nil then
-- print(target.charName)
-- end
-- ContinueR(mousePos)
if Config.Combo then
if ValidTarget(target) then
Combo(target)
elseif ValidTarget(target2) then
CastQ(target2)
end
end
if (Config.Harass or Config.Harass2) and ValidTarget(target) then
if ValidTarget(target) then
Harass(target)
elseif ValidTarget(target2) then
CastQHarass(target2)
end
end
if Config.Farm then
Farm()
end
if Config.Combo and Config.ComboSub.Orbwalk and Config.ComboSub.Autoattack then
if target and ValidTarget(target) and GetDistance(target) < 560 then
OrbWalking(target)
else
moveToCursor()
end
end
if Config.Harass and Config.HarassSub.Orbwalk then
if target and ValidTarget(target) and GetDistance(target) < 560 and Config.HarassSub.Autoattack then
OrbWalking(target)
else
moveToCursor()
end
end
if Config.Extras.EGapClosers then
CheckDashes()
end
end
IgniteKS()
end
function OnProcessSpell(unit, spell)
if unit.isMe and spell.name == 'VelkozQ' then
BlockQ = true
--LastPacketBlock = false
end
-- if unit.isMe and spell.name == 'velkozqsplitactive' then
-- BlockQ = false
-- end
-- if unit.isMe and spell.name == 'VelkozR' then
-- isPressedR = true
-- end
if unit.isMe then
if spell.name:lower():find("attack") then
lastAttack = GetTickCount() - GetLatency()/2
lastWindUpTime = spell.windUpTime*1000
lastAttackCD = spell.animationTime*1000
end
end
end
function Combo(Target)
if Target ~= nil and ValidTarget(Target, 1500) then
if EReady and Config.ComboSub.useE then
CastE(Target)
elseif WReady and Config.ComboSub.useW then
CastW(Target)
elseif QReady and Config.ComboSub.useQ then
CastQ(Target)
-- elseif RReady and Config.ComboSub.useR then
-- --CastRCombo(Target)
-- end
end
end
end
function Harass(Target)
if Target ~= nil and ValidTarget(Target, 1500) then
if WReady and Config.HarassSub.UseWHarass then
CastW(Target)
elseif QReady then
CastQHarass(Target)
-- elseif RReady and Config.ComboSub.useR then
-- --CastRCombo(Target)
-- end
end
end
end
function Farm()
if Config.FarmSub.useQ then
FarmQ()
end
if Config.FarmSub.useW then
FarmW()
end
if Config.FarmSub.useE then
FarmE()
end
end
function CastQ(Target)
if not Config.Extras.SplitQ and not BlockQ and HaveMediumVelocity(Target, 600) then
local CastPosition, HitChance, Position = VP:GetLineCastPosition(Target, SpellQ.Delay, SpellQ.Width, SpellQ.Range, SpellQ.Speed, myHero, true)
if CastPosition ~= nil and HitChance ~= nil and GetDistance(CastPosition, myHero) < SpellQ.Range and HitChance >= Config.Extras.MinHitchance and QReady then
CastSpell(_Q, CastPosition.x, CastPosition.z)
end
elseif not BlockQ and HaveMediumVelocity(Target, 600) then
local Best_Position = CalculateBestInitialCastPosition(Target)
if Best_Position ~= nil then
CastSpell(_Q, Best_Position.x, Best_Position.z)
Qlocktarget = Target
end
end
end
function CastQHarass(Target)
if not Config.Extras.SplitQ and not BlockQ and HaveLowVelocity(Target, 750) then
local CastPosition, HitChance, Position = VP:GetLineCastPosition(Target, SpellQ.Delay, SpellQ.Width, SpellQ.Range, SpellQ.Speed, myHero, true)
if CastPosition ~= nil and HitChance ~= nil and GetDistance(CastPosition, myHero) < SpellQ.Range and HitChance >= Config.Extras.MinHitchance and QReady then
CastSpell(_Q, CastPosition.x, CastPosition.z)
end
elseif not BlockQ and HaveLowVelocity(Target, 750) then
local Best_Position = CalculateBestInitialCastPosition(Target)
if Best_Position ~= nil then
CastSpell(_Q, Best_Position.x, Best_Position.z)
end
end
end
function CastW(Target)
local CastPosition, HitChance, Position = VP:GetLineCastPosition(Target, SpellW.Delay, SpellW.Width, SpellW.Range, SpellW.Speed, myHero, false)
if CastPosition ~= nil and HitChance ~= nil and GetDistance(CastPosition, myHero) < SpellW.Range and HitChance >= Config.Extras.MinHitchance and WReady then
CastSpell(_W, CastPosition.x, CastPosition.z)
end
end
function CastE(Target)
local CastPosition, HitChance, Position = VP:GetCircularAOECastPosition(Target, SpellE.Delay, SpellE.Width, SpellE.Range, SpellE.Speed, myHero)
if CastPosition ~= nil and HitChance ~= nil and GetDistance(CastPosition, myHero) < SpellE.Range and HitChance >= Config.Extras.MinHitchance and EReady then
CastSpell(_E, CastPosition.x, CastPosition.z)
end
end
function CastRCombo(Target)
local CastPosition, HitChance, Position = VP:GetLineCastPosition(Target, 1, SpellR.Width, SpellR.Range, SpellR.Speed, myHero, false)
if HitChance ~= nil and CastPosition ~= nil and ValidTarget(Target) and GetDistance(Target, myHero) < 1500 and not isPressedR and HitChance > 1 then
Cast1stR(Target)
InitialTarget = Target
end
-- elseif isPressedR then
-- if Target ~= InitialTarget and GetDistance(InitialTarget, myHero) < 1500 and Config.Extras.FocusRTarget then
-- Cast2ndR(InitialTarget)
-- elseif GetDistance(Target, myHero) < 1500 then
-- Cast2ndR(Target)
-- else
-- Cast2ndR(mousePos)
-- end
-- end
end
function ContinueR(Target)
-- if Config.Extras.Debug then
-- print('Continuing R')
-- end
--Cast2ndR()
-- if ValidTarget(Target) and ValidTarget(InitialTarget) and Target ~= InitialTarget and GetDistance(InitialTarget, myHero) < 1500 and Config.Extras.FocusRTarget then
-- Cast2ndR(InitialTarget)
-- if Config.Extras.Debug then
-- print('Continuing R initial target')
-- end
-- elseif GetDistance(Target, myHero) < 1500 thenm
-- Cast2ndR(Target)
-- if Config.Extras.Debug then
-- print('Continuing R 2nd target')
-- end
-- else
-- Cast2ndR(mousePos)
-- if Config.Extras.Debug then
-- print('Continuing R mouse pos')
-- end
-- end
end
function UpdateVector()
if QObject ~= nil and QEndObject ~= nil then
-- if Config.Extras.Debug then
-- print('Update Vector called!')
-- end
OriginalCastVector1 = (Vector(QEndObject) - QStartPos):normalized()
-- if Config.Extras.Debug then
-- print(OriginalCastVector1)
-- end
current_distance = GetDistance(QObject, QEndObject)
OriginalCastVector2 = Vector(QObject) + OriginalCastVector1*(current_distance+50)
RotatedUnitVector1 = OriginalCastVector1:perpendicular()
RotatedUnitVector2 = OriginalCastVector1:perpendicular2()
RotatedVector1 = Vector(QObject) + RotatedUnitVector1 * Config.Extras.SplitQDistance
RotatedVector2 = Vector(QObject) + RotatedUnitVector2 * Config.Extras.SplitQDistance
end
end
--Credit Honda7
function DrawLine(From, To, Color)
DrawLine3D(From.x, From.y, From.z, To.x, To.y, To.z, 1, Color)
end
function Cast1stR(Target)
if GetDistance(Target, myHero) < SpellR.Range and not isPressedR and buffer == false then
CastSpell(_R, Target.x, Target.z)
buffer = true
DelayAction(function() buffer = false end, 0.5)
if Config.Extras.Debug then
print('Cast1stRCalled')
end
end
end
function CalculateDeflectedCastPosition(Target)
local tempdelay = GetDistance(Target)/SpellQ.Speed
local PredictedPos3, PredictedHitChance3 = VP:GetPredictedPos(Target, 0.300+tempdelay, math.huge, myHero, false)
if PredictedPos3 ~= nil and PredictedHitChance3 ~= nil then
local pointSegment1, pointLine1, isOnSegment1 = VectorPointProjectionOnLineSegment(Vector(Target), Vector(PredictedPos3), Vector(myHero))
if Config.Extras.Debug then
--print(pointSegment1)
--print(pointLine)
--print(isOnSegment)
--print(GetDistance(pointLine))
end
local myHeroPoint = { x = myHero.x, y = myHero.z}
local newpointSegment1 = {x = pointSegment1.x, y = myHero.y, z = pointSegment1.y}
local newpointLine1 = {x = pointLine1.x, y= myHero.y, z = pointLine1.y}
local predictedpoint = {x = PredictedPos3.x, y = PredictedPos3.z}
local refactored_newpointline = Vector(myHero) + Vector(Vector(newpointLine1) - Vector(myHero)):normalized()*SpellQ.Range
local collision1 = VP:CheckMinionCollision(myHero, newpointLine1, (GetDistance(myHero, newpointSegment1)/SpellQ.Speed) + SpellQ.Delay, SpellQ.Width, GetDistance(myHero, newpointSegment1), SpellQ.Speed, myHero, false)
local collision2 = VP:CheckMinionCollision(myHero, newpointSegment1, (GetDistance(PredictedPos3, newpointSegment1)/QSplitSpeed) + SpellQ.Delay + (GetDistance(myHero, newpointSegment1)/SpellQ.Speed), SpellQ.Width, GetDistance(PredictedPos3, newpointSegment1), QSplitSpeed, newpointSegment1, false)
if not collision1 and not collision2 and pointSegment1.x and PredictedHitChance3 >= Config.Extras.MinHitchance and Config.Extras.SplitQMode and GetDistance(PredictedPos3, newpointLine1) < Config.Extras.SplitQDistance and GetDistance(myHero, newpointLine1) < SpellQ.Range and GetDistance(myHero, newpointLine1) >= Config.Extras.SplitQMinimumDistance then
pointSegment, pointLine, isOnSegment = newpointSegment1, newpointLine1, isOnSegment1
if Config.Extras.Debug then
--print('Case 2 returned value')
end
return refactored_newpointline
--return nil
else
pointSegment, pointLine, isOnSegment = nil, nil, nil
if Config.Extras.Debug then
--print('Case 3 called')
end
if Config.Extras.CheckAngle and Config.Extras.MaxAngle > 0 and Config.Extras.AngleIncrement > 0 and PredictedHitChance3 >= Config.Extras.MinSplitQHitchance then
local iter = math.ceil(Config.Extras.MaxAngle/Config.Extras.AngleIncrement)
for i= 1, iter do
if Config.Extras.Debug then
--print(i*Config.Extras.AngleIncrement*0.0174532925)
end
table.insert(AngleTable, i*Config.Extras.AngleIncrement*0.0174532925)
table.insert(AngleTable, 2*math.pi - i*Config.Extras.AngleIncrement*0.0174532925)
end
ToRotateVector = Vector(Vector(PredictedPos3) - Vector(myHero)):normalized()*SpellQ.Range
if Config.Extras.Debug then
--print('Rotated vector generated')
--print(ToRotateVector)
end
if ToRotateVector ~= nil then
for idx, val in ipairs(AngleTable) do
if Config.Extras.Debug then
--print('Rotating at ' .. tostring(val))
end
local ToInsertVector = ToRotateVector:rotated(val, 0.001, val)
--CheckPoint = Vector(myHero) + Vector(ToInsertVector)
table.insert(VectorTable2, ToInsertVector)
-- if Config.Extras.Debug then
-- print('insertvector is' .. tostring(ToInsertVector.x) .. "\t" .. tostring(ToInsertVector.z))
-- print(#VectorTable2)
-- print(ToRotateVector:angle(ToInsertVector))
-- end
if idx == 3 then
CheckPoint = Vector(myHero) + Vector(ToInsertVector)
-- if Config.Extras.Debug then
-- print('insertvector is' .. tostring(ToInsertVector.x) .. "\t" .. tostring(ToInsertVector.z))
-- print(#VectorTable2)
-- print(ToRotateVector:angle(ToInsertVector))
-- end
--return CheckPoint
end
TempSegment, TempLine, TempIsOnSegment = VectorPointProjectionOnLineSegment(Vector(myHero), Vector(Vector(myHero) + ToInsertVector), Vector(PredictedPos3))
local TempSegment3D = {x=TempSegment.x, y=myHero.y, z=TempSegment.y}
local TempLine3D = {x=TempLine.x, y=myHero.y, z=TempLine.y}
-- local myherotemppos = {x=myHero.x, y=myHero.z}
-- local enemytemppos = {x=Target.x, y=Target.z}
-- local pushvector1 = Vector(myHero)
-- local pushvector2 = {x=TempSegment.x - myHero.x, y=myHero.y, z=TempSegment.y - myHero.z}
-- local topush = {pushvector1, pushvector2}
-- -- if Config.Extras.Debug then
-- -- print('Pushing to Vector table' .. tostring(topush[1].x))
-- -- print(#VectorTable)
-- -- end
-- table.insert(VectorTable, topush)
-- if Config.Extras.Debug then
-- print(' TempSegment3D is' .. tostring(TempSegment3D.x) .. "\t" .. tostring(TempSegment3D.z))
-- -- print(#VectorTable2)
-- -- print(ToRotateVector:angle(ToInsertVector))
-- end
refactored_TempSegment3D = Vector(myHero) + Vector(Vector(TempSegment3D) - Vector(myHero)):normalized()*SpellQ.Range
if TempIsOnSegment and TempSegment3D ~= nil and TempLine3D ~= nil then
if TempIsOnSegment then
local newdelay = (GetDistance(myHero, TempSegment3D)/SpellQ.Speed) + (GetDistance(TempSegment3D, PredictedPos3))/SpellQ.Speed + Config.Extras.SplitQDelay/1000 + SpellQ.Delay
local col1 = VP:CheckMinionCollision(myHero, TempSegment3D, SpellQ.Delay, SpellQ.Width, GetDistance(myHero, TempSegment3D), SpellQ.Speed, myHero, false)
local col2 = VP:CheckMinionCollision(myHero, PredictedPos3, (GetDistance(myHero, TempSegment3D)/SpellQ.Speed) + Config.Extras.SplitQDelay/1000 + SpellQ.Delay, SpellQ.Width, Config.Extras.SplitQDistance, QSplitSpeed, TempSegment3D, false)
if Config.Extras.Debug then
--print(' TempSegment3D is' .. tostring(col1) .. "\t" .. tostring(col2) .. "\t" .. tostring(newdelay))
--print('Refactored TempSegment3D ' .. tostring(GetDistance(refactored_TempSegment3D)))
-- print(#VectorTable2)
-- print(ToRotateVector:angle(ToInsertVector))
end
if not col1 and not col2 and GetDistance(TempSegment3D) > Config.Extras.SplitQMinimumDistance and GetDistance(TempSegment3D, PredictedPos3) < Config.Extras.SplitQDistance and GetDistance(TempSegment3D, myHero) < Config.Extras.SplitQMaximumDistance then
if Config.Extras.Debug then
--print('Case 3 returned')
end
return refactored_TempSegment3D
-- local placeholder2, hitchance2, pos2 = VP:GetPredictedPos(Target, newdelay, math.huge, myHero, false)
-- local TempPos43D = {x=pos2.x, y=myHero.y, z=pos2.y}
-- if hitchance2 >= Config.Extras.MinHitchance then
-- local TempSegment2, TempLine2, TempIsOnSegment2 = VectorPointProjectionOnLineSegment(Vector(myHero), Vector(pos2), Vector(refactored_TempSegment3D))
-- local TempSegment23D = {x=TempSegment2.x, y=myHero.y, z=TempSegment2.y}
-- if TempSegment23D ~= nil and GetDistance(TempSegment23D, myHero) < SpellQ.Range and GetDistance(pos2, TempSegment23D) < Config.Extras.SplitQMinimumDistance then
-- return TempSegment23D
-- end
-- end
end
end
end
end
end
end
end
-- return nil
end
-- local col1 = VP:CheckMinionCollision(pointSegment, 0.400, SpellQ.Width, Config.Extras.SplitQDistance, SpellQ.Speed, myHero)
-- local col2 = VP:CheckMinionCollision(pointLine, 0.400, SpellQ.Width, Config.Extras.SplitQDistance, SpellQ.Speed, myHero)
-- local col3 = VP:CheckMinionCollision(pointSegment, 0.600, SpellQ.Width, Config.Extras.SplitQDistance, SpellQ.Speed, pointLine)
-- if Config.Extras.Debug then
-- print(col1)
-- print(col2)
-- print(col3)
-- end
-- if isOnSegment ~= nil and pointSegment ~= nil and isOnSegment and GetDistance(pointSegment) < SpellQ.range and col1 == false and PredictedHitChance >= Config.Extras.MinHitchance then
-- ShouldCastPosition = Vector(myHero) + SpellQ.Range * (Vector(pointSegment) - Vector(myHero)):normalized()
-- StoredPosition = ShouldCastPosition
-- if Config.Extras.Debug then
-- print('Single Q 2nd case found (segment)')
-- end
-- return ShouldCastPosition
-- elseif not isOnSegment and pointLine and GetDistance(pointLine, myHero) < SpellQ.range and col2 == false and col3 == false then
-- ShouldCastPosition = Vector(myHero) + SpellQ.Range * (Vector(pointLine) - Vector(myHero)):normalized()
-- StoredPosition = ShouldCastPosition
-- if Config.Extras.Debug then
-- print('Single Q 2nd case found (line)')
-- end
-- return ShouldCastPosition
-- else
-- return nil
-- end
end
function CheckQWillHit(startvec, endvec, Target, mode)
local qpointSegment, qpointLine, qIsOnSegment = VectorPointProjectionOnLineSegment(Vector(startvec), Vector(endvec), Vector(Target))
if qpointSegment ~= nil and qpointSegment.x and qIsOnSegment then
local qpointSegment3D = {x=qpointSegment.x, y=Target.y, z=qpointSegment.y}
if GetDistance(Target,qpointSegment3D) < 45 + VP:GetHitBox(Target) then
if mode then
return true
else
return qpointSegment3D
end
end
else
if mode then
return false
else
return nil
end
end
end
function CalculateDoubleQPosition(Target)
local ShouldCastPosition= nil
local Enemies = GetEnemyHeroes()
local tocheckpairs = {}
if Config.Extras.DoubleQ then
for index, value in ipairs(Enemies) do
if value.networkID ~= Target.networkID and GetDistance(Target, value) < 2*Config.Extras.SplitQDistance+150 then
-- local Throwaway, CollisionChance = VP:GetPredictedPos(value, 0.600, math.huge, Target, true) --check to see if line connecting the two will have minion collision
-- if CollisionChance >= Config.Extras.MinSplitQHitchance then
table.insert(tocheckpairs, value)
if Config.Extras.Debug then
--print('Double Q champion inserted')
end
--end
end
end
for _, champion in ipairs(tocheckpairs) do
if Config.Extras.Debug then
--print(champion.charName)
end
local current_distance = Config.Extras.SplitQMinimumDistance
while current_distance < SpellQ.Range do
local current_delay = current_distance/SpellQ.Speed + SpellQ.Delay + Config.Extras.SplitQDelay/1000
local enemyPos1, enemyHitchance1 = VP:GetPredictedPos(Target, current_delay, math.huge, myHero, false)
local enemyPos2, enemyHitchance2 = VP:GetPredictedPos(champion, current_delay, math.huge, myHero, false)
if enemyPos1 ~= nil and enemyPos2 ~= nil and enemyHitchance1 ~= nil and enemyHitchance2 ~= nil and GetDistance(enemyPos1) < 1400 and GetDistance(enemyPos2) < 1400 then
local fromposition = Vector(enemyPos1):center(Vector(enemyPos2))
local fromposition_refactored = Vector(myHero) + Vector(Vector(fromposition) - Vector(myHero)):normalized()*SpellQ.Range
if Config.Extras.Debug then
--print(fromposition_refactored)
end
local col = VP:CheckMinionCollision(myHero, fromposition, SpellQ.Delay, SpellQ.Width, GetDistance(myHero, fromposition), SpellQ.Speed, myHero, false)
if not col then
local ExtendedQVector = Vector(Vector(fromposition) - Vector(myHero)):normalized()
local EnemyQUnitVector1 = ExtendedQVector:perpendicular()
local EnemyQUnitVector2 = ExtendedQVector:perpendicular2()
local EnemyQVector1 = Vector(fromposition) + EnemyQUnitVector1*Config.Extras.SplitQDistance
local EnemyQVector2 = Vector(fromposition) + EnemyQUnitVector2*Config.Extras.SplitQDistance
local col2 = VP:CheckMinionCollision(myHero, EnemyQVector1, SpellQ.Delay + Config.Extras.SplitQDelay/1000 + (GetDistance(myHero,fromposition)/SpellQ.Speed), SpellQ.Width, GetDistance(EnemyQVector1, fromposition), QSplitSpeed, fromposition, false)
local col3 = VP:CheckMinionCollision(myHero, EnemyQVector2, SpellQ.Delay + Config.Extras.SplitQDelay/1000 + (GetDistance(myHero,fromposition)/SpellQ.Speed), SpellQ.Width, GetDistance(EnemyQVector2, fromposition), QSplitSpeed, fromposition, false)
if not col2 and not col3 then
if (CheckQWillHit(fromposition, EnemyQVector1, Target, true) or CheckQWillHit(fromposition, EnemyQVector1, champion, true)) and (CheckQWillHit(fromposition, EnemyQVector2, Target, true) or CheckQWillHit(fromposition, EnemyQVector2, champion, true)) then
local fromposition_refactored = Vector(myHero) + Vector(Vector(fromposition) - Vector(myHero)):normalized()*SpellQ.Range
DoubleQTarget = champion
if Config.Extras.Debug then
--print('Double Q champion returned with ' .. tostring(champion.charName))
end
return fromposition_refactored
end
end
end
end
-- local Pos1, HitChance1 = VP:GetPredictedPos(Target, current_delay, math.huge, fromposition, true)
-- local Pos2, HitChance2 = VP:GetPredictedPos(champion, current_delay, math.huge, fromposition, true)
-- if Config.Extras.Debug then
-- print('Double Q Pos Generated at ' .. tostring(Pos1) .. "\t" .. tostring(Pos2) .. "\n")
-- end
-- if HitChance1 >= Config.Extras.MinHitchance and HitChance1 >= Config.Extras.MinHitchance and Pos1 ~= nil and Pos2 ~= nil and GetDistance(Pos1) < SpellQ.Range and GetDistance(Pos2) < SpellQ.Range then
-- local pointSegment, pointLine, isOnSegment = VectorPointProjectionOnLineSegment(Vector(Pos1), Vector(Pos2), Vector(myHero))
-- if isOnSegment and GetDistance(isOnSegment) < SpellQ.Range then
-- ShouldCastPosition = Vector(myHero) + SpellQ.Range * (Vector(pointSegment) - Vector(myHero)):normalized()
-- if Config.Extras.Debug then
-- print('Double Q ShouldCastPositionfound')
-- end
-- DoubleCast = true
-- StoredPosition = ShouldCastPosition
-- return ShouldCastPosition
-- end
-- end
current_distance = current_distance + Config.Extras.DoubleQDistance
end
end
end
return nil
end
function CalculateBestInitialCastPosition(Target)
local ShouldCastPosition= nil
local Enemies = GetEnemyHeroes()
local tocheckpairs = {}
if Config.Extras.SplitQ then
--Trivial Case - Target lies with no collision -> and within Q range
-- if Config.Extras.Debug then
-- print('Single Q called')
-- end
if Config.Extras.DoubleQ then
ShouldCastPosition = CalculateDoubleQPosition(Target)
if ShouldCastPosition ~= nil then
return ShouldCastPosition
end
end
local CastPosition, HitChance, Position = VP:GetLineCastPosition(Target, SpellQ.Delay, SpellQ.Width, SpellQ.Range, SpellQ.Speed, myHero, true)
if HitChance >= Config.Extras.MinHitchance and not Config.Extras.CheckAngleOnly then
ShouldCastPosition = Vector(myHero) + SpellQ.Range * (Vector(CastPosition) - Vector(myHero)):normalized()
DoubleCast = false
StoredPosition = nil
if Config.Extras.Debug then
print('Single Q trivial case found')
end
return ShouldCastPosition
else
--Easiest case: Find predicted vector -> cast at orthogonal point on infinite line
local PredictedPos2 = CalculateDeflectedCastPosition(Target)
--ShouldCastPosition = Vector(myHero) + SpellQ.Range*(Vector(PredictedPos2) - Vector(myHero)):normalized()
StoredPosition = PredictedPos2
return PredictedPos2
end
end
return nil
end
function SplitQ(Target)
Throwaway, SplitQHitChance, SplitQPosition = VP:GetLineCastPosition(Target, Config.Extras.SplitQDelay/1000, 45, Config.Extras.SplitQDistance, QSplitSpeed, QObject, true)
if SplitQHitChance >= 0 and SplitQPosition ~= nil then
EndPos1 = Vector(RotatedVector1)
EndPos2 = Vector(RotatedVector2)
pointSegment2, pointLine2, isOnSegment2 = VectorPointProjectionOnLineSegment(Vector(QObject), Vector(EndPos1), Vector(SplitQPosition))
pointSegment3, pointLine3, isOnSegment3 = VectorPointProjectionOnLineSegment(Vector(QObject), Vector(EndPos2), Vector(SplitQPosition))
local newPos = {x=SplitQPosition.x, y=SplitQPosition.z}
if Config.Extras.Debug then
-- print(GetDistance(newPos, pointSegment2))
-- print(GetDistance(newPos, pointSegment3))
end
-- if isOnSegment2 then
-- if lastdistance == nil then
-- lastdistance = GetDistance(newPos, pointSegment2)
-- elseif GetDistance(newPos, pointSegment2) - lastdistance < 55 then
-- lastdistance = GetDistance(newPos, pointSegment2)
-- else
-- Cast2ndQPacket(Target)
-- if Config.Extras.Debug then
-- print('Failsafe Split Q 1')
-- end
-- end
-- elseif isOnSegment3 then
-- if lastdistance == nil then
-- lastdistance = GetDistance(newPos, pointSegment3)
-- elseif GetDistance(newPos, pointSegment2) - lastdistance < 55 then
-- lastdistance = GetDistance(newPos, pointSegment3)
-- else
-- Cast2ndQPacket(Target)
-- if Config.Extras.Debug then
-- print('Faile Split Q 1')
-- end
-- end
-- end
if isOnSegment2 and GetDistance(newPos, pointSegment2) < 50 + VP:GetHitBox(Target) then
Cast2ndQPacket(Target)
detonate1 = true
BlockQ = false
CastSpell(_Q)
if Config.Extras.Debug then
print('Split Q 1')
end
elseif isOnSegment3 and GetDistance(newPos, pointSegment3) < 50 + VP:GetHitBox(Target) then
Cast2ndQPacket(Target)
detonate2 = true
BlockQ = false
CastSpell(_Q)
if Config.Extras.Debug then
print('Split Q 2')
end
end
if isOnSegment2 then
local current_unit_vector1 = Vector(Vector(newPos) - Vector(pointSegment2)):normalized()
if LastUnitVector1 ~= nil then
if Config.Extras.Debug then
print('Angle1 is ' ..LastUnitVector2:angle(current_unit_vector1))
end
if LastUnitVector1:angle(current_unit_vector1) > math.pi/3 then
Cast2ndQPacket(Target)
detonate1 = true
BlockQ = false
CastSpell(_Q)
if Config.Extras.Debug then
print('Split Q 3')
end
else
LastUnitVector1 = current_unit_vector1
end
else
LastUnitVector1 = current_unit_vector1
end
elseif isOnSegment3 then
local current_unit_vector2 = Vector(Vector(newPos) - Vector(pointSegment3)):normalized()
if LastUnitVector2 ~= nil then
if Config.Extras.Debug then
print('Angle2 is ' ..LastUnitVector2:angle(current_unit_vector2))
end
if LastUnitVector2:angle(current_unit_vector2) > math.pi/3 then
Cast2ndQPacket(Target)
detonate2 = true
BlockQ = false
CastSpell(_Q)
if Config.Extras.Debug then
print('Split Q 4')
end
else
LastUnitVector2 = current_unit_vector2
end
else
LastUnitVector2 = current_unit_vector2
end
end
end
end
--Farm Stuff--
--Start Credit Honda7
function FarmW()
if WReady and #EnemyMinions.objects > 0 then
local WPos = GetBestWPositionFarm()
if WPos then
CastSpell(_W, WPos.x, WPos.z)
end
end
end
function FarmE()
if EReady and #EnemyMinions.objects > 0 then
local EPos = GetBestEPositionFarm()