forked from saladinaazir/gosext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevX-AIOviktor.lua
4482 lines (3638 loc) · 158 KB
/
devX-AIOviktor.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
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 Heroes = {"Swain","RekSai","Elise","Syndra","Gangplank","Gnar","Zeri","LeeSin","Qiyana","Karthus","Rengar", "Soraka", "Mordekaiser","Nidalee","Ziggs","Kindred","Viktor"}
if not table.contains(Heroes, myHero.charName) then
print("DevX AIO does not support " .. myHero.charName)
return
end
require "DamageLib"
require "MapPositionGOS"
require "GGPrediction"
require "PremiumPrediction"
if not _G.SDK then
print("GGOrbwalker is not enabled. DevX-AIO will exit")
return
end
-------------------------------------------------
-- Variables
------------
-- Spell data for GGPrediction
-- Reference variables
local GameTurret = Game.Turret
local GameTurretCount = Game.TurretCount
local GameHeroCount = Game.HeroCount
local GameHero = Game.Hero
local GameMinionCount = Game.MinionCount
local GameMinion = Game.Minion
local GameObjectCount = Game.ObjectCount
local GameObject = Game.Object
local TableInsert = _G.table.insert
local orbwalker = _G.SDK.Orbwalker
local HealthPrediction = _G.SDK.HealthPrediction
--------------------------------------------------
-- General Functions
--------------------
local function isSpellReady(spell)
return myHero:GetSpellData(spell).currentCd == 0 and myHero:GetSpellData(spell).level > 0 and Game.CanUseSpell(spell) == 0
end
local function getDistanceSqr(Pos1, Pos2)
local Pos2 = Pos2 or myHero.pos
local dx = Pos1.x - Pos2.x
local dz = (Pos1.z or Pos1.y) - (Pos2.z or Pos2.y)
return dx^2 + dz^2
end
local function getDistance(Pos1, Pos2)
return math.sqrt(getDistanceSqr(Pos1, Pos2))
end
local function getEnemyHeroes()
local EnemyHeroes = {}
for i = 1, Game.HeroCount() do
local Hero = Game.Hero(i)
if Hero.isEnemy and not Hero.dead then
table.insert(EnemyHeroes, Hero)
end
end
return EnemyHeroes
end
local function isValid(unit)
if (unit and unit.valid and unit.isTargetable and unit.alive and unit.visible and unit.networkID and unit.pathing and unit.health > 0) then
return true;
end
return false;
end
local function getEnemyHeroesWithinDistanceOfUnit(location, distance)
local EnemyHeroes = {}
for i = 1, Game.HeroCount() do
local Hero = Game.Hero(i)
if Hero.isEnemy and not Hero.dead and Hero.pos:DistanceTo(location) < distance then
table.insert(EnemyHeroes, Hero)
end
end
return EnemyHeroes
end
local function getAllyHeroesWithinDistanceOfUnit(location, distance)
local Allies = {}
for i = 1, Game.HeroCount() do
local Hero = Game.Hero(i)
if not Hero.isEnemy and not Hero.dead and Hero.pos:DistanceTo(location) < distance then
table.insert(Allies, Hero)
end
end
return Allies
end
local function getEnemyMinionsWithinDistanceOfLocation(location, distance)
local EnemyMinions = {}
for i = 1, Game.MinionCount() do
local minion = Game.Minion(i)
if minion and minion.isEnemy and not minion.dead and minion.pos:DistanceTo(location) < distance then
table.insert(EnemyMinions, minion)
end
end
return EnemyMinions
end
local function getAOEMinion(maxRange, abilityRadius)
local bestCount = 0
local bestPosition = nil
for i = 1, GameMinionCount() do
local minion1 = GameMinion(i)
local count = 0
if minion1 and not minion1.dead and minion1.isEnemy and myHero.pos:DistanceTo(minion1.pos) < maxRange then
local count = #getEnemyMinionsWithinDistanceOfLocation(minion1.pos, abilityRadius)
if count > bestCount then
bestCount = count
bestPosition = minion1.pos
end
end
end
return bestPosition, bestCount
end
local function getWardSlot()
local WardKey = {[ITEM_1] = HK_ITEM_1, [ITEM_2] = HK_ITEM_2,[ITEM_3] = HK_ITEM_3, [ITEM_4] = HK_ITEM_4, [ITEM_5] = HK_ITEM_5, [ITEM_6] = HK_ITEM_6, [ITEM_7] = HK_ITEM_7}
-- 2055 pink ward, 3340 normal
for slot = ITEM_1, ITEM_7 do
if myHero:GetItemData(slot).itemID and myHero:GetItemData(slot).itemID == 3340 and myHero:GetSpellData(slot).ammo > 0 then
return slot, WardKey[slot]
end
end
for slot = ITEM_1, ITEM_7 do
if myHero:GetItemData(slot).itemID and myHero:GetItemData(slot).itemID == 2055 then
return slot, WardKey[slot]
end
end
return nil, nil
end
local function getFlashSlot()
if myHero:GetSpellData(SUMMONER_1).name:find("Flash") and isSpellReady(SUMMONER_1) then
return SUMMONER_1, HK_SUMMONER_1
elseif myHero:GetSpellData(SUMMONER_2).name:find("Flash") and isSpellReady(SUMMONER_2) then
return SUMMONER_2, HK_SUMMONER_2
end
return nil, nil
end
local function ClosestPointOnLineSegment(p, p1, p2)
local px = p.x
local pz = p.z
local ax = p1.x
local az = p1.z
local bx = p2.x
local bz = p2.z
local bxax = bx - ax
local bzaz = bz - az
local t = ((px - ax) * bxax + (pz - az) * bzaz) / (bxax * bxax + bzaz * bzaz)
if (t < 0) then
return p1, false
end
if (t > 1) then
return p2, false
end
return {x = ax + t * bxax, z = az + t * bzaz}, true
end
local function getEnemyHeroesWithinDistance(distance)
return getEnemyHeroesWithinDistanceOfUnit(myHero.pos, distance)
end
local function doesMyChampionHaveBuff(buffName)
for i = 0, myHero.buffCount do
local buff = myHero:GetBuff(i)
if buff.name == buffName and buff.count > 0 then
return true
end
end
return false
end
local function getChampionBuffCount(buffName)
for i = 0, myHero.buffCount do
local buff = myHero:GetBuff(i)
if buff.name == buffName then
return buff.count
end
end
return -1
end
local function printChampionBuffs(champ)
for i = 0, champ.buffCount do
local buff = champ:GetBuff(i)
if buff.count > 0 then
print(string.format("%s - stacks: %f count %f",buff.name, buff.stacks, buff.count))
end
end
end
local function doesThisChampionHaveBuff(target, buffName)
if not target then
return false
end
for i = 0, target.buffCount do
local buff = target:GetBuff(i)
if buff.name == buffName and buff.count > 0 then
return true
end
end
return false
end
local function isTargetImmobile(target)
local buffTypeList = {5, 8, 12, 22, 23, 25, 30, 35}
for i = 0, target.buffCount do
local buff = target:GetBuff(i)
for _, buffType in pairs(buffTypeList) do
if buff.type == buffType and buff.count > 0 then
return true, buff.duration
end
end
end
return false, 0
end
local function castSpell(spellData, hotkey, target)
local pred = GGPrediction:SpellPrediction(spellData)
pred:GetPrediction(target, myHero)
if pred:CanHit(GGPrediction.HITCHANCE_NORMAL) then
if myHero.pos:DistanceTo(pred.CastPosition) <= spellData.Range + 15 then
Control.CastSpell(hotkey, pred.CastPosition)
end
end
end
local function castSpellHigh(spellData, hotkey, target)
local pred = GGPrediction:SpellPrediction(spellData)
pred:GetPrediction(target, myHero)
if pred:CanHit(GGPrediction.HITCHANCE_HIGH) then
Control.CastSpell(hotkey, pred.CastPosition)
end
end
local function castSpellExtended(spellData, hotkey, target, extendAmount)
local pred = GGPrediction:SpellPrediction(spellData)
pred:GetPrediction(target, myHero)
if pred:CanHit(GGPrediction.HITCHANCE_NORMAL) then
local castPos = Vector(pred.CastPosition):Extended(Vector(myHero.pos), extendAmount)
Control.CastSpell(hotkey, castPos)
end
end
local function isBeingAttackedByTower()
for i = 1, GameTurretCount() do
local turret = GameTurret(i)
if turret.isEnemy and not turret.dead and not turret.isImmortal then
if turret.targetID == myHero.networkID then
return true
end
end
end
return false
end
local function getTowerDamage()
local minutes = Game.Timer() / 60
return 9 * math.floor(minutes - 1.5) + 170
end
-- credit to pussy qiyana
local function Rotate(startPos, endPos, height, theta)
local dx, dy = endPos.x - startPos.x, endPos.z - startPos.z
local px, py = dx * math.cos(theta) - dy * math.sin(theta), dx * math.sin(theta) + dy * math.cos(theta)
return Vector(px + startPos.x, height, py + startPos.z)
end
-- credit to pussy qiyana
local function FindClosestWall(mode)
local startPos, mPos, height = Vector(myHero.pos), Vector(mousePos), myHero.pos.y
for i = 100, 2000, 100 do -- search range
local endPos = startPos:Extended(mPos, i)
for j = 20, 360, 20 do -- angle step
local testPos = Rotate(startPos, endPos, height, math.rad(j))
if testPos:ToScreen().onScreen then
if MapPosition:inWall(testPos) then
return testPos
end
end
end
end
return nil
end
local function ClosestPointOnLineSegment(p, p1, p2)
local px = p.x
local pz = p.z
local ax = p1.x
local az = p1.z
local bx = p2.x
local bz = p2.z
local bxax = bx - ax
local bzaz = bz - az
local t = ((px - ax) * bxax + (pz - az) * bzaz) / (bxax * bxax + bzaz * bzaz)
if (t < 0) then
return p1, false
end
if (t > 1) then
return p2, false
end
return {x = ax + t * bxax, z = az + t * bzaz}, true
end
local _nextVectorCast = Game.Timer()
local _nextSpellCast = Game.Timer()
local _vectorMousePos = mousePos
function VectorCast(startPos, endPos, hotkey)
if _nextSpellCast > Game.Timer() then return end
if _nextVectorCast > Game.Timer() then return end
_nextVectorCast = Game.Timer() + 2
_nextSpellCast = Game.Timer() + .25
_vectorMousePos = mousePos
Control.SetCursorPos(startPos)
orbwalker:SetMovement(false)
orbwalker:SetAttack(false)
DelayAction(function()Control.KeyDown(hotkey) end,.05)
DelayAction(function()Control.SetCursorPos(endPos) end,.1)
DelayAction(function()
Control.KeyUp(hotkey)
orbwalker:SetMovement(true)
orbwalker:SetAttack(true)
end,.15)
DelayAction(function()Control.SetCursorPos(_vectorMousePos) end,.15)
end
--------------------------------------------------
-- Swain
--------------
class "Swain"
local qSpellData = {Type = GGPrediction.SPELLTYPE_LINE, Delay = 0.25, Width = 100, Range = 750, Speed = 5000, Collision = false}
local eSpellData = {Type = GGPrediction.SPELLTYPE_LINE, Delay = 0.075, Width = 60, Range = 850, Speed = 935, Collision = false}
local wSpellData = {Type = GGPrediction.SPELLTYPE_CIRCLE, Delay = 1, Radius = 100, Range = 5500, Speed = 935, Collision = false}
function Swain:__init()
print("devX-Swain Loaded")
self:LoadMenu()
Callback.Add("Draw", function() self:Draw() end)
Callback.Add("Tick", function() self:onTickEvent() end)
end
--
-- Menu
function Swain:LoadMenu() --MainMenu
self.Menu = MenuElement({type = MENU, id = "devSwain", name = "devSwain v1.0"})
-- ComboMenu
self.Menu:MenuElement({type = MENU, id = "Combo", name = "Combo Mode"})
self.Menu.Combo:MenuElement({id = "UseQ", name = "[Q]", value = true})
self.Menu.Combo:MenuElement({id = "UseE", name = "[E]", value = true})
self.Menu:MenuElement({type = MENU, id = "Harass", name = "Harass Mode"})
self.Menu.Harass:MenuElement({id = "UseQ", name = "[Q]", value = true, toggle = true, key = string.byte("T")})
-- Auto Menu
self.Menu:MenuElement({type = MENU, id = "Auto", name = "Auto"})
self.Menu.Auto:MenuElement{{id="PullRoot", name="Pull rooted enemies", value = true}}
self.Menu.Auto:MenuElement({id = "W", name = "Use W on Root", value = true})
self.Menu:MenuElement({type = MENU, id = "Draw", name = "Draw"})
self.Menu.Draw:MenuElement({id = "Q", name = "[Q] Range", value = true})
self.Menu.Draw:MenuElement({id = "E", name = "[E] Range", value = true})
end
function Swain:Draw()
if myHero.dead then return end
if self.Menu.Draw.Q:Value() then
Draw.Circle(myHero, qSpellData.Range, 1, Draw.Color(225, 225, 0, 10))
end
if self.Menu.Draw.E:Value() then
Draw.Circle(myHero, eSpellData.Range, 1, Draw.Color(225, 0, 0, 10))
end
end
--------------------------------------------------
-- Callbacks
------------
function Swain:onTickEvent()
wSpellData.Range = myHero:GetSpellData(_W).range
if isSpellReady(_W) then
self:rootCheck()
end
if _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_COMBO] then
self:Combo()
end
if _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_HARASS] then
self:Harass()
end
end
----------------------------------------------------
-- Combat Functions
---------------------
function Swain:rootCheck()
local enemies = getEnemyHeroes()
for i, enemy in pairs(enemies) do
if isValid(enemy) and not enemy.dead then
local distance = getDistance(myHero.pos, enemy.pos)
local isImmobile, duration = isTargetImmobile(enemy)
if isSpellReady(_W) and self.Menu.Auto.W:Value() and distance < wSpellData.Range and isImmobile then
local enemyPos = enemy.pos:ToMM()
Control.CastSpell(HK_W, enemyPos.x, enemyPos.y)
end
if distance < 1125 and doesThisChampionHaveBuff(enemy, "swaineroot") then
castSpellExtended(eSpellData, HK_E, enemy, -200)
end
end
end
end
----------------------------------------------------
-- Combat Modes
---------------------
function Swain:Combo()
local target = _G.SDK.TargetSelector:GetTarget(1200, _G.SDK.DAMAGE_TYPE_MAGICAL);
if target then
local distance = getDistance(myHero.pos, target.pos)
if isSpellReady(_E) and self.Menu.Combo.UseE:Value() then
if distance < eSpellData.Range + 100 then
castSpellExtended(eSpellData, HK_E, target, -200)
end
end
if isSpellReady(_Q) and self.Menu.Combo.UseQ:Value() then
if distance < qSpellData.Range + 100 then
castSpell(qSpellData, HK_Q, target)
end
end
end
end
function Swain:Harass()
local target = _G.SDK.TargetSelector:GetTarget(1000, _G.SDK.DAMAGE_TYPE_MAGICAL);
if target then
if isSpellReady(_Q) and self.Menu.Harass.UseQ:Value() then
local distance = getDistance(myHero.pos, target.pos)
if distance < qSpellData.Range + 100 then
castSpell(qSpellData, HK_Q, target)
end
end
end
end
----------------------------------------------------
-- RekSai
---------------------
class "RekSai"
local QspellData = {Type = GGPrediction.SPELLTYPE_LINE, Delay = 0.3, Speed = 4000, Range = 1625, Radius = 60, Collision = true, CollisionTypes = {GGPrediction.COLLISION_MINION}}
local isTunnelling = false
local isUnderground = false
function RekSai:__init()
print("devX-RekSai Loaded")
self:LoadMenu()
Callback.Add("Draw", function() self:Draw() end)
Callback.Add("Tick", function() self:onTickEvent() end)
orbwalker:OnPostAttack(function(...) self:onPostAttack(...) end)
end
--
-- Menu
function RekSai:LoadMenu() --MainMenu
self.Menu = MenuElement({type = MENU, id = "devRekSai", name = "devX-Reksai v1.0"})
-- ComboMenu
self.Menu:MenuElement({type = MENU, id = "Combo", name = "Combo Mode"})
self.Menu.Combo:MenuElement({id = "AttackReset", name = "Use Q&E on Attack Reset", value = true})
self.Menu.Combo:MenuElement({id = "UseQ", name = "[Q]", value = true})
self.Menu.Combo:MenuElement({id = "UseE", name = "[E]", value = true})
self.Menu.Combo:MenuElement({id = "UseW", name = "[W] to unburrow", value = true})
self.Menu:MenuElement({type = MENU, id = "Harass", name = "Harass Mode"})
-- Auto Menu
self.Menu:MenuElement({type = MENU, id = "Auto", name = "Auto"})
self.Menu:MenuElement({type = MENU, id = "Draw", name = "Draw"})
self.Menu.Draw:MenuElement({id = "Q", name = "Underground [Q] Range", value = true})
end
function RekSai:Draw()
if myHero.dead then return end
if self.Menu.Draw.Q:Value() then
Draw.Circle(myHero, QspellData.Range, 1, Draw.Color(225, 225, 0, 10))
end
end
--------------------------------------------------
-- Callbacks
------------
function RekSai:onPostAttack(args)
if self.Menu.Combo.AttackReset:Value() then
local target = orbwalker:GetTarget();
if isSpellReady(_Q) and target and self.Menu.Combo.UseQ:Value() then
Control.CastSpell(HK_Q, target)
Control.Attack(target)
return
end
if isSpellReady(_E) and target and self.Menu.Combo.UseE:Value() and not (myHero.mana > 80 and myHero.mana < 90) then
local distance = getDistance(myHero.pos, target.pos)
if distance < 350 then
Control.CastSpell(HK_E, target)
end
end
end
end
function RekSai:onTickEvent()
self:updateBuffs()
if _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_COMBO] and not isInTunnelling then
self:Combo()
end
end
----------------------------------------------------
-- Combat Functions
---------------------
function RekSai:updateBuffs()
-- Check if currently burrowed
if doesMyChampionHaveBuff("RekSaiW") then
isUnderground = true
else
isUnderground = false
end
-- Check if currently tunnelling
if doesMyChampionHaveBuff("reksaitunneltime2") or doesMyChampionHaveBuff("RekSaiEBurrowed") then
isInTunnelling = true
else
isInTunnelling = false
end
end
----------------------------------------------------
-- Combat Modes
---------------------
function RekSai:Combo()
local target = _G.SDK.TargetSelector:GetTarget(1600, _G.SDK.DAMAGE_TYPE_MAGICAL);
if isUnderground and target then
local distance = getDistance(myHero.pos, target.pos)
if isSpellReady(_Q) and myHero.pos:DistanceTo(target.pos) < 1600 and self.Menu.Combo.UseQ:Value() then
castSpell(QspellData, HK_Q, target)
end
if distance < 285 and isSpellReady(_W) and self.Menu.Combo.UseW:Value() then
Control.CastSpell(HK_W)
end
elseif not self.Menu.Combo.AttackReset:Value() and target then
target = _G.SDK.TargetSelector:GetTarget(500, _G.SDK.DAMAGE_TYPE_MAGICAL)
if isSpellReady(_Q) and target and self.Menu.Combo.UseQ:Value() then
Control.CastSpell(HK_Q, target)
Control.Attack(target)
return
end
if isSpellReady(_E) and target and self.Menu.Combo.UseE:Value() and not (myHero.mana > 80 and myHero.mana < 90) then
local distance = getDistance(myHero.pos, target.pos)
if distance < 350 then
Control.CastSpell(HK_E, target)
end
end
end
end
function UltimateMode()
if isSpellReady(_R) then
for i, enemy in pairs(enemies) do
if isValid(enemy) and not enemy.dead then
if doesThisChampionHaveBuff(enemy, "reksairprey") then
local distance = getDistance(myHero.pos, enemy.pos)
end
end
end
end
end
function RekSai:Harass()
end
class "Elise"
function Elise:__init()
print("DevX-Elise Loaded")
self:LoadMenu()
self.eSpellData = {Type = GGPrediction.SPELLTYPE_LINE, Delay = 0.3, Speed = 1600, Range = 1075, Radius = 55, Width=55, Collision = true, CollisionTypes = {GGPrediction.COLLISION_MINION}}
Callback.Add("Draw", function() self:Draw() end)
Callback.Add("Tick", function() self:onTickEvent() end)
orbwalker:OnPostAttack(function(...) self:onPostAttack(...) end )
end
function Elise:LoadMenu() --MainMenu
self.Menu = MenuElement({type = MENU, id = "devElise", name = "DevX-Elise v1.0"})
self.Menu:MenuElement({type = MENU, id = "ELogic", name = "Rappel Logic"})
self.Menu.ELogic:MenuElement({TYPE = _G.SPACE, name = "Auto Rappel will be active if being attacked by a tower that can kill"})
self.Menu.ELogic:MenuElement({id = "HP", name = "Percent HP", value = 25, min = 0, max = 100})
self.Menu:MenuElement({id = "AttackReset", name = "Use Attack Resets and Spacing", value = true, toggle = true})
self.Menu:MenuElement({id = "Clear", name = "Lane / JG Clear - Use Abilities", value = true, toggle = true, key = string.byte("T")})
end
function Elise:Draw()
if myHero.dead then return end
end
--------------------------------------------------
-- Callbacks
------------
function Elise:onPostAttack(args)
if not self.Menu.AttackReset:Value() then return end
if not self.Menu.Clear:Value() and (orbwalker.Modes[_G.SDK.ORBWALKER_MODE_JUNGLECLEAR] or orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LANECLEAR]) then
return
end
local target = orbwalker:GetTarget();
if target then
if self.isInSpiderForm then
if isSpellReady(_W) then
Control.CastSpell(HK_W, target)
orbwalker:__OnAutoAttackReset()
return
end
if isSpellReady(_Q) then
Control.CastSpell(HK_Q, target)
end
end
end
end
function Elise:onTickEvent()
self:updateBuffs()
self:autoRappel()
if orbwalker.Modes[_G.SDK.ORBWALKER_MODE_COMBO] then
self:Combo()
end
if self.Menu.Clear:Value() and (orbwalker.Modes[_G.SDK.ORBWALKER_MODE_JUNGLECLEAR] or orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LANECLEAR]) then
self:Clear()
end
end
----------------------------------------------------
-- Combat Functions
---------------------
function Elise:updateBuffs()
self.isInSpiderForm = doesMyChampionHaveBuff("EliseR")
self.isRapelled = myHero:GetSpellData(_Q).name == "EliseSpideElnitial"
end
function Elise:autoRappel()
if self.isRapelled then return end
local shouldRappel = false
if isBeingAttackedByTower() then
local towerDamage = getTowerDamage()
if towerDamage >= myHero.health then
shouldRappel = true
end
end
local percentHp = myHero.health / myHero.maxHealth
if percentHp < self.Menu.ELogic.HP:Value() / 100 and #getEnemyHeroesWithinDistance(800) >= 1 then
shouldRappel = true
end
if shouldRappel then
if self.isInSpiderForm then
Control.CastSpell(HK_E)
else
Control.CastSpell(HK_R)
Control.CastSpell(HK_E)
end
end
end
----------------------------------------------------
-- Combat Modes
---------------------
function Elise:Combo()
local target = orbwalker:GetTarget(1200, _G.SDK.DAMAGE_TYPE_MAGICAL)
if target then
if not self.isInSpiderForm then
if isSpellReady(_E) and myHero.pos:DistanceTo(target.pos) <= 1075 then
castSpell(self.eSpellData, HK_E, target)
end
if orbwalker:CanAttack(target) then
Control.Attack(target)
end
if isSpellReady(_Q) and myHero.pos:DistanceTo(target.pos) <= 750 then
Control.CastSpell(HK_Q, target)
print("Cast Qx")
end
if isSpellReady(_W) and myHero.pos:DistanceTo(target.pos) <= 950 then
Control.CastSpell(HK_W, target)
print("Cast W")
end
if isSpellReady(_R) and not isSpellReady(_Q) and not isSpellReady(_W) then
Control.CastSpell(HK_R)
if myHero.pos:DistanceTo(target.pos) >= 300 then
Control.CastSpell(HK_Q)
print("Casting Q2")
end
self.isInSpiderForm = true
end
end
if self.isInSpiderForm then
if isSpellReady(_Q) then
Control.CastSpell(HK_Q, target)
print("Casting Q")
end
if not self.Menu.AttackReset:Value() then
if isSpellReady(_W) then
Control.CastSpell(HK_W, target)
orbwalker:__OnAutoAttackReset()
end
end
end
end
end
function Elise:Clear()
local target = orbwalker:GetTarget()
if target then
if not self.isInSpiderForm then
if isSpellReady(_Q) and myHero.pos:DistanceTo(target.pos) <= 475 then
Control.CastSpell(HK_Q, target)
end
if isSpellReady(_W) and myHero.pos:DistanceTo(target.pos) <= 950 then
Control.CastSpell(HK_W, target)
end
if isSpellReady(_R) and not isSpellReady(_Q) and not isSpellReady(_W) then
Control.CastSpell(HK_R)
self.isInSpiderForm = true
end
end
if self.isInSpiderForm then
if isSpellReady(_Q) and myHero.pos:DistanceTo(target.pos) <= 475 then
Control.CastSpell(HK_Q, target)
end
if not self.Menu.AttackReset:Value() then
if isSpellReady(_W) then
Control.CastSpell(HK_W, target)
end
end
end
end
end
--------------------------------------------------
-- Syndra
--------------
class "Syndra"
function Syndra:__init()
print("devX-Syndra Loaded")
self:LoadMenu()
self.qSpellData = {Type = GGPrediction.SPELLTYPE_CIRCLE, Delay = 0.65, Radius = 180, Range = 800, Speed = math.huge, Collision = false}
self.wSpellData = {Type = GGPrediction.SPELLTYPE_CIRCLE, Delay = 0.25, Radius = 200, Range = 925, Speed = 1450, Collision = false}
Callback.Add("Draw", function() self:Draw() end)
Callback.Add("Tick", function() self:onTickEvent() end)
end
--
-- Menu
function Syndra:LoadMenu() --MainMenu
self.Menu = MenuElement({type = MENU, id = "devSyndra", name = "DevX Syndra v1.0"})
-- ComboMenu
self.Menu:MenuElement({type = MENU, id = "BlockR", name = "Ultimate Blacklist"})
DelayAction(function()
for i, Hero in pairs(getEnemyHeroes()) do
self.Menu.BlockR:MenuElement({id = Hero.charName, name = "Block Ult on: "..Hero.charName, value = false})
end
end,0.2)
self.Menu:MenuElement({id = "Clear", name = "Q Clear", value = true, toggle = true, key = string.byte("T")})
self.Menu:MenuElement({id = "WHarrass", name = "W Harass", value = true, toggle = true, key = string.byte("G")})
self.Menu:MenuElement({id = "AntiMelee", name = "Anti-Melee Range", value = 365, min = 0, max = 500, step = 1})
self.Menu:MenuElement({id = "DrawAntiMelee", name = "Draw Anti-Melee Range", value = true, toggle = true})
end
function Syndra:Draw()
local hero2d = myHero.pos2D
if self.Menu.Clear:Value() then
Draw.Text("Lane Clear Enabled [T]", 15, hero2d.x - 30, hero2d.y + 30, Draw.Color(255, 0, 255, 0))
else
Draw.Text("Lane Clear Disabled [T]", 15, hero2d.x - 30, hero2d.y + 30, Draw.Color(255, 255, 0, 0))
end
if self.Menu.WHarrass:Value() then
Draw.Text("W Harass Enabled [G]", 15, hero2d.x - 30, hero2d.y + 50, Draw.Color(255, 0, 255, 0))
else
Draw.Text("W Harass Disabled [G]", 15, hero2d.x - 30, hero2d.y + 50, Draw.Color(255, 255, 0, 0))
end
if self.Menu.DrawAntiMelee:Value() then
Draw.Circle(myHero.pos, self.Menu.AntiMelee:Value(), 1, Draw.Color(255, 0, 0, 10))
end
end
--------------------------------------------------
-- Callbacks
------------
function Syndra:onTickEvent()
if isSpellReady(_Q) then
self:AutoQ()
end
self:AutoUlt()
self:AntiMelee()
if _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_COMBO] then
self:Combo()
end
if _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_HARASS] then
self:Harass()
end
if _G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LANECLEAR] and self.Menu.Clear:Value() then
self:LaneClear()
end
end
----------------------------------------------------
-- Combat Functions
---------------------
function Syndra:castQE(target)
local pos = myHero.pos + (target.pos - myHero.pos):Normalized() * 690
self.isInEQ = true
Control.CastSpell(HK_E, target.pos)
orbwalker:SetMovement(false)
DelayAction(
function ()
Control.CastSpell(HK_Q, pos)
orbwalker:SetMovement(true)
self.isInEQ = false
end, 0.2
)
end
function Syndra:castEQ(target, distance)
local castPosition = myHero.pos + (target.pos - myHero.pos):Normalized() * math.min(distance*9/10, 750)
Control.CastSpell(HK_Q, castPosition)
orbwalker:SetMovement(false)
self.isInEQ = true
DelayAction(function()
Control.CastSpell(HK_E, target.pos)
self.isInEQ = false
orbwalker:SetMovement(true)
end,0.22)
end
function Syndra:castW(wObject, target)
Control.CastSpell(HK_W, wObject)
self.isInW = true
DelayAction(function()
castSpell(self.wSpellData, HK_W, target)
self.isInW = false
end
, 0.05)
end
----------------------------------------------------
-- Other Functions
---------------------
function Syndra:getWObject()
for i = 1, GameObjectCount() do
local gameObj = GameObject(i)
if gameObj and gameObj.name == "Seed" and not gameObj.dead then
local distance = myHero.pos:DistanceTo(gameObj.pos)
if distance < 900 then
return gameObj
end
end
end
for i = 1, GameMinionCount() do
local minion = GameMinion(i)
if minion and minion.isEnemy and not minion.dead and minion.pos:To2D().onScreen then
local distance = myHero.pos:DistanceTo(minion.pos)
if distance < 900 then
return minion
end
end
end
return nil
end
function Syndra:getEObject(targetPosition)
for i = 1, GameObjectCount() do
local gameObj = GameObject(i)
if gameObj and gameObj.name == "Seed" and not gameObj.dead then
local spellLine = ClosestPointOnLineSegment(gameObj.pos, myHero.pos, targetPosition)
local distance = myHero.pos:DistanceTo(gameObj.pos)
if distance < 700 and gameObj.pos:DistanceTo(spellLine) < 67 then
return gameObj
end
end
end
return nil
end
function Syndra:getRDamage(target)
return getdmg("R", target, myHero, 2) * myHero:GetSpellData(_R).ammo
end
function Syndra:getQDamage(target)
if myHero:GetSpellData(_Q).level > 0 and myHero:GetSpellData(_Q).level < 5 then
return getdmg("Q", target, myHero)
elseif myHero:GetSpellData(_Q).level == 5 then
return getdmg("Q", target, myHero) + (getdmg("Q", target, myHero)*0.25)