-
Notifications
You must be signed in to change notification settings - Fork 11
/
PussyIrelia.lua
1842 lines (1577 loc) · 65.9 KB
/
PussyIrelia.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 = {"Irelia"}
if not table.contains(Heroes, myHero.charName) then return end
require "DamageLib"
----------------------------------------------------
--| Checks |--
----------------------------------------------------
if not FileExist(COMMON_PATH .. "GamsteronPrediction.lua") then
DownloadFileAsync("https://raw.githubusercontent.com/gamsteron/GOS-EXT/master/Common/GamsteronPrediction.lua", COMMON_PATH .. "GamsteronPrediction.lua", function() end)
print("gamsteronPred. installed Press 2x F6")
return
end
if not FileExist(COMMON_PATH .. "PremiumPrediction.lua") then
DownloadFileAsync("https://raw.githubusercontent.com/Ark223/GoS-Scripts/master/PremiumPrediction.lua", COMMON_PATH .. "PremiumPrediction.lua", function() end)
print("PremiumPred. installed Press 2x F6")
return
end
if not FileExist(COMMON_PATH .. "GGPrediction.lua") then
DownloadFileAsync("https://raw.githubusercontent.com/gamsteron/GG/master/GGPrediction.lua", COMMON_PATH .. "GGPrediction.lua", function() end)
print("GGPrediction installed Press 2x F6")
return
end
local InfoBoxPos = false
if FileExist(COMMON_PATH .. "PussyBoxPos.lua") then
InfoBoxPos = true
require "PussyBoxPos"
end
----------------------------------------------------
--| Utils |--
----------------------------------------------------
local DrawSaved = false
local LoadPos = false
local Down = false
local UnLockBox = false
local DrawTime = false
local checkCount = 0
local heroes = false
local wClock = 0
local clock = os.clock
local Latency = Game.Latency
local ping = Latency() * 0.001
local foundAUnit = false
local _movementHistory = {}
local TEAM_ALLY = myHero.team
local TEAM_ENEMY = 300 - myHero.team
local TEAM_JUNGLE = 300
local wClock = 0
local _OnVision = {}
local sqrt = math.sqrt
local MathHuge = math.huge
local TableInsert = table.insert
local TableRemove = table.remove
local GameTimer = Game.Timer
local Allies, Enemies, Turrets, Units = {}, {}, {}, {}
local Orb
local DrawRect = Draw.Rect
local DrawCircle = Draw.Circle
local DrawColor = Draw.Color
local DrawText = Draw.Text
local ControlSetCursorPos = Control.SetCursorPos
local ControlKeyUp = Control.KeyUp
local ControlKeyDown = Control.KeyDown
local GameCanUseSpell = Game.CanUseSpell
local GameHeroCount = Game.HeroCount
local GameHero = Game.Hero
local GameMinionCount = Game.MinionCount
local GameMinion = Game.Minion
local GameTurretCount = Game.TurretCount
local GameTurret = Game.Turret
local GameIsChatOpen = Game.IsChatOpen
local castSpell = {state = 0, tick = GetTickCount(), casting = GetTickCount() - 1000, mouse = mousePos}
function LoadUnits()
for i = 1, GameHeroCount() do
local unit = GameHero(i); Units[i] = {unit = unit, spell = nil}
if unit.team ~= myHero.team then TableInsert(Enemies, unit)
elseif unit.team == myHero.team and unit ~= myHero then TableInsert(Allies, unit) end
end
for i = 1, Game.TurretCount() do
local turret = Game.Turret(i)
if turret and turret.isEnemy then TableInsert(Turrets, turret) end
end
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 IsValidCrap(unit)
if (unit and unit.isTargetable and unit.dead == false) then
return true;
end
return false;
end
local function Ready(spell)
return myHero:GetSpellData(spell).currentCd == 0 and myHero:GetSpellData(spell).level > 0 and myHero:GetSpellData(spell).mana <= myHero.mana and GameCanUseSpell(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 * dx + dz * dz
end
local function GetDistance(pos1, pos2)
return sqrt(GetDistanceSqr(pos1, pos2))
end
local function GetDistance2D(p1,p2)
return sqrt((p2.x - p1.x)*(p2.x - p1.x) + (p2.y - p1.y)*(p2.y - p1.y))
end
local function DistanceSquared(p1, p2)
local dx, dy = p2.x - p1.x, p2.y - p1.y
--print(math.floor((dx * dx + dy * dy)/10000))
return math.floor((dx * dx + dy * dy)/10000)
end
function GetTarget(range)
local EnemyHeroes = _G.SDK.ObjectManager:GetEnemyHeroes(range, false)
local target = _G.SDK.TargetSelector:GetTarget(EnemyHeroes)
return target
end
function GetMode()
if _G.SDK then
return
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_COMBO] and "Combo"
or
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_FLEE] and "Flee"
or
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_HARASS] and "Harass"
or
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LANECLEAR] and "LaneClear"
or
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_JUNGLECLEAR] and "LaneClear"
or
_G.SDK.Orbwalker.Modes[_G.SDK.ORBWALKER_MODE_LASTHIT] and "LastHit"
or nil
elseif _G.PremiumOrbwalker then
return _G.PremiumOrbwalker:GetMode()
end
return nil
end
local castSpell = {state = 0, tick = GetTickCount(), casting = 500, mouse = mousePos}
local function CastSpell(spell,pos,delay)
local delay = delay or 250
local ticker = GetTickCount()
if castSpell.state == 0 and ticker - castSpell.casting > delay + Game.Latency() and pos.pos:ToScreen().onScreen then
castSpell.state = 1
castSpell.mouse = mousePos
castSpell.tick = ticker
end
if castSpell.state == 1 then
if ticker - castSpell.tick < Game.Latency() and Game.Timer() - myHero:GetSpellData(_Q).castTime > delay/1000 then
Control.CastSpell(spell, pos)
castSpell.casting = ticker + delay
DelayAction(function()
if castSpell.state == 1 then
castSpell.state = 0
end
end,Game.Latency()/1000)
end
if ticker - castSpell.casting > Game.Latency() then
castSpell.state = 0
end
end
end
local function SetAttack(bool)
if _G.EOWLoaded then
EOW:SetAttacks(bool)
elseif _G.SDK then
_G.SDK.Orbwalker:SetAttack(bool)
elseif _G.PremiumOrbwalker then
_G.PremiumOrbwalker:SetAttack(bool)
else
GOS.BlockAttack = not bool
end
end
local function SetMovement(bool)
if _G.EOWLoaded then
EOW:SetMovements(bool)
elseif _G.SDK then
_G.SDK.Orbwalker:SetMovement(bool)
elseif _G.PremiumOrbwalker then
_G.PremiumOrbwalker:SetMovement(bool)
else
GOS.BlockMovement = not bool
end
end
local function GetEnemyHeroes()
local _EnemyHeroes = {}
for i = 1, Game.HeroCount() do
local unit = Game.Hero(i)
if unit.team ~= myHero.team then
table.insert(_EnemyHeroes, unit)
end
end
return _EnemyHeroes
end
local function GetEnemyTurret()
local _EnemyTurrets = {}
for i = 1, GameTurretCount() do
local turret = GameTurret(i)
if turret.isEnemy and GetDistance(myHero.pos, turret.pos) < 1500 and not turret.dead then
TableInsert(_EnemyTurrets, turret)
end
end
return _EnemyTurrets
end
local function GetEnemyCount(range, pos)
local pos = pos.pos
local count = 0
for i, hero in ipairs(GetEnemyHeroes()) do
local Range = range * range
if GetDistanceSqr(pos, hero.pos) < Range and IsValid(hero) then
count = count + 1
end
end
return count
end
local function GetMinionCount(range, pos)
local pos = pos.pos
local count = 0
for i = 1,Game.MinionCount() do
local hero = Game.Minion(i)
local Range = range * range
if hero.team ~= TEAM_ALLY and hero.dead == false and GetDistanceSqr(pos, hero.pos) < Range then
count = count + 1
end
end
return count
end
local function IsUnderTurret(unit)
for i, turret in ipairs(GetEnemyTurret()) do
local range = (turret.boundingRadius + 750 + unit.boundingRadius / 2)
if not turret.dead then
if turret.pos:DistanceTo(unit.pos) < range then
return true
end
end
end
return false
end
local function AllyMinionUnderTower()
for i = 1, GameMinionCount() do
local minion = GameMinion(i)
if minion.team == TEAM_ALLY and IsValid(minion) and IsUnderTurret(minion) and myHero.pos:DistanceTo(minion.pos) <= 750 then
return true
end
end
return false
end
local function HasBuff(unit, buffname)
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff.name == buffname and buff.count > 0 then
return true
end
end
return false
end
local function GetBuffData(unit, buffname)
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff.name == buffname and buff.count > 0 then
return buff
end
end
return {type = 0, name = "", startTime = 0, expireTime = 0, duration = 0, stacks = 0, count = 0}
end
local function IsRecalling(unit)
local buff = GetBuffData(unit, "recall")
if buff and buff.duration > 0 then
return true, GameTimer() - buff.startTime
end
return false
end
local function IsImmobileTarget(unit)
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff and (buff.type == 5 or buff.type == 11 or buff.type == 29 or buff.type == 24 or buff.type == 10 or buff.type == 22 or buff.type == 8 ) and buff.count > 0 then
return true
end
end
return false
end
local function ISMarked(range)
local count = 0
for i, target in ipairs(GetEnemyHeroes()) do
local Range = range*range
if target and GetDistanceSqr(myHero.pos, target.pos) <= Range and IsValid(target) and HasBuff(target, "ireliamark") then
count = count + 1
end
end
if count > 0 then
return true
end
return false
end
local function VectorPointProjectionOnLineSegment(v1, v2, v)
local cx, cy, ax, ay, bx, by = v.x, v.z, v1.x, v1.z, v2.x, v2.z
local rL = ((cx - ax) * (bx - ax) + (cy - ay) * (by - ay)) / ((bx - ax) ^ 2 + (by - ay) ^ 2)
local pointLine = { x = ax + rL * (bx - ax), y = ay + rL * (by - ay) }
local rS = rL < 0 and 0 or (rL > 1 and 1 or rL)
local isOnSegment = rS == rL
local pointSegment = isOnSegment and pointLine or { x = ax + rS * (bx - ax), y = ay + rS * (by - ay) }
return pointSegment, pointLine, isOnSegment
end
local function OnVision(unit)
_OnVision[unit.networkID] = _OnVision[unit.networkID] == nil and {state = unit.visible, tick = GetTickCount(), pos = unit.pos} or _OnVision[unit.networkID]
if _OnVision[unit.networkID].state == true and not unit.visible then
_OnVision[unit.networkID].state = false
_OnVision[unit.networkID].tick = GetTickCount()
end
if _OnVision[unit.networkID].state == false and unit.visible then
_OnVision[unit.networkID].state = true
_OnVision[unit.networkID].tick = GetTickCount()
end
return _OnVision[unit.networkID]
end
local _OnWaypoint = {}
local function OnWaypoint(unit)
if _OnWaypoint[unit.networkID] == nil then _OnWaypoint[unit.networkID] = {pos = unit.posTo , speed = unit.ms, time = GameTimer()} end
if _OnWaypoint[unit.networkID].pos ~= unit.posTo then
_OnWaypoint[unit.networkID] = {startPos = unit.pos, pos = unit.posTo , speed = unit.ms, time = GameTimer()}
DelayAction(function()
local time = (GameTimer() - _OnWaypoint[unit.networkID].time)
local speed = GetDistance2D(_OnWaypoint[unit.networkID].startPos,unit.pos)/(GameTimer() - _OnWaypoint[unit.networkID].time)
if speed > 1250 and time > 0 and unit.posTo == _OnWaypoint[unit.networkID].pos and GetDistance(unit.pos,_OnWaypoint[unit.networkID].pos) > 200 then
_OnWaypoint[unit.networkID].speed = GetDistance2D(_OnWaypoint[unit.networkID].startPos,unit.pos)/(GameTimer() - _OnWaypoint[unit.networkID].time)
end
end,0.05)
end
return _OnWaypoint[unit.networkID]
end
local function GetPred(unit,speed,delay)
local speed = speed or MathHuge
local delay = delay or 0.25
local unitSpeed = unit.ms
if OnWaypoint(unit).speed > unitSpeed then unitSpeed = OnWaypoint(unit).speed end
if OnVision(unit).state == false then
local unitPos = unit.pos + Vector(unit.pos,unit.posTo):Normalized() * ((GetTickCount() - OnVision(unit).tick)/1000 * unitSpeed)
local predPos = unitPos + Vector(unit.pos,unit.posTo):Normalized() * (unitSpeed * (delay + (GetDistance(myHero.pos,unitPos)/speed)))
if GetDistance(unit.pos,predPos) > GetDistance(unit.pos,unit.posTo) then predPos = unit.posTo end
return predPos
else
if unitSpeed > unit.ms then
local predPos = unit.pos + Vector(OnWaypoint(unit).startPos,unit.posTo):Normalized() * (unitSpeed * (delay + (GetDistance(myHero.pos,unit.pos)/speed)))
if GetDistance(unit.pos,predPos) > GetDistance(unit.pos,unit.posTo) then predPos = unit.posTo end
return predPos
elseif IsImmobileTarget(unit) then
return unit.pos
else
return unit:GetPrediction(speed,delay)
end
end
end
local function CalculateCollisionTime(startPos, endPos, unitPos, startTime, speed, delay, origin)
local pos = startPos:Extended(endPos, speed * (GameTimer() - delay - startTime))
return GetDistance(unitPos, pos) / speed
end
local function CalculateEndPos(startPos, placementPos, unitPos, range, radius, collision, type)
local range = range or 3000; local endPos = startPos:Extended(placementPos, range)
if type == "circular" or type == "rectangular" then
if range > 0 then if GetDistance(unitPos, placementPos) < range then endPos = placementPos end
else endPos = unitPos end
elseif collision then
for i = 1, GameMinionCount() do
local minion = GameMinion(i)
if minion and minion.team == myHero.team and minion.alive and GetDistance(minion.pos, startPos) < range then
local col = VectorPointProjectionOnLineSegment(startPos, placementPos, minion.pos)
if col and GetDistance(col, minion.pos) < (radius + minion.boundingRadius / 2) then
range = GetDistance(startPos, col); endPos = startPos:Extended(placementPos, range); break
end
end
end
end
return endPos, range
end
local function GetPathNodes(unit)
local nodes = {}
TableInsert(nodes, unit.pos)
if unit.pathing.hasMovePath then
for i = unit.pathing.pathIndex, unit.pathing.pathCount do
local path = unit:GetPath(i)
TableInsert(nodes, path)
end
end
return nodes
end
local function GetTargetMS(target)
local ms = target.ms
return ms
end
local function PredictUnitPosition(unit, delay)
local predictedPosition = unit.pos
local timeRemaining = delay
local pathNodes = GetPathNodes(unit)
for i = 1, #pathNodes -1 do
local nodeDistance = GetDistance(pathNodes[i], pathNodes[i +1])
local nodeTraversalTime = nodeDistance / GetTargetMS(unit)
if timeRemaining > nodeTraversalTime then
timeRemaining = timeRemaining - nodeTraversalTime
predictedPosition = pathNodes[i + 1]
else
local directionVector = (pathNodes[i+1] - pathNodes[i]):Normalized()
predictedPosition = pathNodes[i] + directionVector * GetTargetMS(unit) * timeRemaining
break;
end
end
return predictedPosition
end
local function GetLineTargetCount(source, Pos, delay, speed, width)
local Count = 0
for i = 1, GameMinionCount() do
local minion = GameMinion(i)
if minion and minion.team == TEAM_ENEMY and myHero.pos:DistanceTo(minion.pos) <= 1000 and IsValid(minion) then
local predictedPos = PredictUnitPosition(minion, delay+ GetDistance(source, minion.pos) / speed)
local proj1, pointLine, isOnSegment = VectorPointProjectionOnLineSegment(source, Pos, predictedPos)
if proj1 and isOnSegment and (GetDistanceSqr(predictedPos, proj1) <= (minion.boundingRadius + width) * (minion.boundingRadius + width)) then
Count = Count + 1
end
end
end
return Count
end
local function CheckDmgItems(itemID)
assert(type(itemID) == "number", "GetInventorySlotItem: wrong argument types (<number> expected)")
for _, j in pairs({ITEM_1, ITEM_2, ITEM_3, ITEM_4, ITEM_5, ITEM_6, ITEM_7}) do
if myHero:GetItemData(j).itemID == itemID then return j end
end
return nil
end
local function CheckHPPred(unit)
local ms = myHero.ms
local speed = (1500+ms)
local range = GetDistance(myHero.pos, unit.pos)/(1500+ms)
local DashTime = range / speed
if _G.SDK and _G.SDK.Orbwalker then
return _G.SDK.HealthPrediction:GetPrediction(unit, DashTime)
elseif _G.PremiumOrbwalker then
return _G.PremiumOrbwalker:GetHealthPrediction(unit, DashTime)
end
end
local function ConvertToHitChance(menuValue, hitChance)
return menuValue == 1 and _G.PremiumPrediction.HitChance.High(hitChance)
or menuValue == 2 and _G.PremiumPrediction.HitChance.VeryHigh(hitChance)
or _G.PremiumPrediction.HitChance.Immobile(hitChance)
end
local function MyHeroNotReady()
return myHero.dead or Game.IsChatOpen() or (_G.JustEvade and _G.JustEvade:Evading()) or (_G.ExtLibEvade and _G.ExtLibEvade.Evading) or IsRecalling(myHero)
end
local function ActiveModes()
local Mode = GetMode()
if Mode == "Combo" or
Mode == "Harass" or
Mode == "Clear" or
Mode == "LastHit" then
return true
end
return false
end
local function CalcExtraDmg2(unit)
local total = 0
local Passive = HasBuff(myHero, "ireliapassivestacksmax") --Irelia Passive
local BladeKing = CheckDmgItems(3153) --Blade of the ruined King
local Divine = CheckDmgItems(6632) --Divine Sunderer
local Sheen = CheckDmgItems(3057) --Sheen
local Black = CheckDmgItems(3071) --Black Cleaver
local Trinity = CheckDmgItems(3078) --Trinity Force
local Titanic = CheckDmgItems(3748) --T.Hydra
local LvL = myHero.levelData.lvl
if Passive then
total = total + CalcDamage(myHero, unit, 2, (7+ (3 * LvL)) + 0.20 * myHero.bonusDamage)
end
if BladeKing then
if unit.health*0.1 > 40 then
total = total + CalcDamage(myHero, unit, 1, 40)
else
total = total + CalcDamage(myHero, unit, 1, (unit.health*0.1))
end
end
if Titanic and myHero:GetSpellData(Titanic).currentCd == 0 then
total = total + CalcDamage(myHero, unit, 1, (myHero.maxHealth*0.01) + (5+myHero.maxHealth*0.015))
end
if Sheen and myHero:GetSpellData(Sheen).currentCd == 0 then
total = total + CalcDamage(myHero, unit, 1, myHero.baseDamage)
end
if Divine and myHero:GetSpellData(Divine).currentCd == 0 then
if unit.maxHealth*0.1 < 1.5*myHero.baseDamage then
total = total + CalcDamage(myHero, unit, 1, 1.5*myHero.baseDamage)
else
if unit.maxHealth*0.1 > 2.5*myHero.baseDamage then
total = total + CalcDamage(myHero, unit, 1, 2.5*myHero.baseDamage)
else
total = total + CalcDamage(myHero, unit, 1,unit.maxHealth*0.1)
end
end
end
if Trinity and myHero:GetSpellData(Trinity).currentCd == 0 then
total = total + CalcDamage(myHero, unit, 1, 2*myHero.baseDamage)
end
return total
end
local function CalcExtraDmg(unit, typ) -- typ 1 = minion / typ 2 = Enemy
local total = 0
local Passive = HasBuff(myHero, "ireliapassivestacksmax") --Irelia Passive
local RecurveBow = CheckDmgItems(1043) --Recurve Bow
local BladeKing = CheckDmgItems(3153) --Blade of the ruined King
local WitsEnd = CheckDmgItems(3091) --Wits End
local Titanic = CheckDmgItems(3748) --T.Hydra
local Divine = CheckDmgItems(6632) --Divine Sunderer
local Sheen = CheckDmgItems(3057) --Sheen
local Black = CheckDmgItems(3071) --Black Cleaver
local Trinity = CheckDmgItems(3078) --Trinity Force
local Eclipse = CheckDmgItems(6692) --Eclipse
local LvL = myHero.levelData.lvl
if Passive then
total = total + CalcDamage(myHero, unit, 2, (7+ (3 * LvL)) + 0.20 * myHero.bonusDamage)
end
if BladeKing then
if typ == 1 then
if unit.health*0.1 > 40 then
total = total + CalcDamage(myHero, unit, 1, 40)
else
total = total + CalcDamage(myHero, unit, 1, (unit.health*0.1))
end
else
total = total + CalcDamage(myHero, unit, 1, (unit.health*0.1) + (HasBuff(myHero, "3153speed") and CalcDamage(myHero, unit, 2, 40+6.47*LvL) or 0))
end
end
if WitsEnd and myHero:GetSpellData(WitsEnd).currentCd == 0 then
total = total + CalcDamage(myHero, unit, 2, 15 + (4.44 * LvL))
end
if RecurveBow and myHero:GetSpellData(RecurveBow).currentCd == 0 then
total = total + CalcDamage(myHero, unit, 1, 15)
end
if Titanic and myHero:GetSpellData(Titanic).currentCd == 0 then
total = total + CalcDamage(myHero, unit, 1, (myHero.maxHealth*0.01) + (5+myHero.maxHealth*0.015))
end
if Sheen and myHero:GetSpellData(Sheen).currentCd == 0 then
total = total + CalcDamage(myHero, unit, 1, myHero.baseDamage)
end
if Divine and myHero:GetSpellData(Divine).currentCd == 0 then
if typ == 1 then
if unit.maxHealth*0.1 < 1.5*myHero.baseDamage then
total = total + CalcDamage(myHero, unit, 1, 1.5*myHero.baseDamage)
else
if unit.maxHealth*0.1 > 2.5*myHero.baseDamage then
total = total + CalcDamage(myHero, unit, 1, 2.5*myHero.baseDamage)
else
total = total + CalcDamage(myHero, unit, 1, unit.maxHealth*0.1)
end
end
else
if unit.maxHealth*0.1 < 1.5*myHero.baseDamage then
total = total + CalcDamage(myHero, unit, 1, 1.5*myHero.baseDamage)
else
total = total + CalcDamage(myHero, unit, 1, unit.maxHealth*0.1)
end
end
end
if typ == 2 and Black then
local Buff = GetBuffData(unit, "3071blackcleavermainbuff")
if Buff.count == 6 then
total = total + CalcDamage(myHero, unit, 1, (unit.maxHealth-unit.health)*0.05)
end
end
if Trinity and myHero:GetSpellData(Trinity).currentCd == 0 then
total = total + CalcDamage(myHero, unit, 1, 2*myHero.baseDamage)
end
if typ == 2 and Eclipse and myHero:GetSpellData(Eclipse).currentCd > 6.5 then
total = total + CalcDamage(myHero, unit, 1, unit.maxHealth*0.06)
end
return total
end
----------------------------------------------------
--| Champion |--
----------------------------------------------------
class "Irelia"
local cpostime=0
local cpos = myHero.pos
local qminions = {}
local lastcheck=0
local lastqdelete=0
local dkmtick=0
local lastkdelete=0
local lastdkm=0
local endp = {}
local KillMinion
local RData = {Type = _G.SPELLTYPE_LINE, Delay = 0.4 + ping, Radius = 160, Range = 1000, Speed = 2000, Collision = false}
local RspellData = {speed = 2000, range = 1000, delay = 0.4 + ping, radius = 160, collision = {nil}, type = "linear"}
local PredLoaded = false
function Irelia:__init()
self.Window = {x = Game.Resolution().x * 0.5, y = Game.Resolution().y * 0.5}
self.AllowMove = nil
self.ButtonDown = false
self.DetectedMissiles = {}; self.DetectedSpells = {}; self.Target = nil; self.Timer = 0
self.charging = false
self:LoadMenu()
Callback.Add("Tick", function() self:Tick() end)
Callback.Add("Draw", function() self:Draw() end)
Callback.Add("WndMsg", function(...) self:OnWndMsg(...) end)
if not PredLoaded then
DelayAction(function()
if self.Menu.MiscSet.Pred.Change:Value() == 1 then
require('GamsteronPrediction')
PredLoaded = true
elseif self.Menu.MiscSet.Pred.Change:Value() == 2 then
require('PremiumPrediction')
PredLoaded = true
else
require('GGPrediction')
PredLoaded = true
end
end, 1)
end
end
function Irelia:IsOnButton(pt)
local x, y = self.Window.x, self.Window.y
return pt.x >= x + 72 and pt.x <= x + 169
and pt.y >= y + 127 and pt.y <= y + 143
end
function Irelia:IsInStatusBox(pt, pos)
if pos == 1 then
return pt.x >= self.Window.x and pt.x <= self.Window.x + 240
and pt.y >= self.Window.y and pt.y <= self.Window.y + 153
elseif pos == 2 then
return pt.x >= self.Window.x and pt.x <= self.Window.x + 240
and pt.y >= self.Window.y and pt.y <= self.Window.y + 20 and pt.y >= self.Window.y
elseif pos == 3 then
return pt.x >= self.Window.x and pt.x <= self.Window.x + 240
and pt.y >= self.Window.y and pt.y <= self.Window.y + 40 and pt.y >= self.Window.y + 20
elseif pos == 4 then
return pt.x >= self.Window.x and pt.x <= self.Window.x + 240
and pt.y >= self.Window.y and pt.y <= self.Window.y + 60 and pt.y >= self.Window.y + 40
elseif pos == 5 then
return pt.x >= self.Window.x and pt.x <= self.Window.x + 240
and pt.y >= self.Window.y and pt.y <= self.Window.y + 80 and pt.y >= self.Window.y + 60
elseif pos == 6 then
return pt.x >= self.Window.x and pt.x <= self.Window.x + 240
and pt.y >= self.Window.y and pt.y <= self.Window.y + 100 and pt.y >= self.Window.y + 80
elseif pos == 7 then
return pt.x >= self.Window.x and pt.x <= self.Window.x + 240
and pt.y >= self.Window.y and pt.y <= self.Window.y + 120 and pt.y >= self.Window.y + 100
end
end
function Irelia:OnWndMsg(msg, wParam)
if self.ButtonDown then return end
if self:IsOnButton(cursorPos) then
DelayAction(function()
Down = true
self.ButtonDown = true
end,0.3)
end
self.AllowMove = msg == 513 and wParam == 0 and self:IsInStatusBox(cursorPos, 1)
and {x = self.Window.x - cursorPos.x, y = self.Window.y - cursorPos.y} or nil
if msg ~= 256 then return end
end
local function HasBuffType(unit, type)
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff and buff.count > 0 and buff.type == type then
return true
end
end
return false
end
local function cantkill(unit,kill,ss,aa)
--set kill to true if you dont want to waste on undying/revive targets
--set ss to true if you dont want to cast on spellshield
--set aa to true if ability applies onhit (yone q, ez q etc)
for i = 0, unit.buffCount do
local buff = unit:GetBuff(i)
if buff.name:lower():find("kayler") and buff.count==1 then
return true
end
if buff.name:lower():find("undyingrage") and (unit.health<100 or kill) and buff.count==1 then
return true
end
if buff.name:lower():find("kindredrnodeathbuff") and (kill or (unit.health / unit.maxHealth)<0.11) and buff.count==1 then
return true
end
if buff.name:lower():find("chronoshift") and kill and buff.count==1 then
return true
end
if buff.name:lower():find("willrevive") and kill and buff.count==1 then
return true
end
--uncomment for cc stuff
if buff.name:lower():find("morganae") and ss and not aa and buff.count==1 then
return true
end
if (buff.name:lower():find("fioraw") or buff.name:lower():find("pantheone")) and buff.count==1 then
return true
end
if buff.name:lower():find("jaxcounterstrike") and aa and buff.count==1 then
return true
end
if buff.name:lower():find("nilahw") and aa and buff.count==1 then
return true
end
if buff.name:lower():find("shenwbuff") and aa and buff.count==1 then
return true
end
end
if HasBuffType(unit, 4) and ss then
return true
end
--if HasBuffType(myHero, 26) and aa then
--return true
--end
return false
end
function Irelia:LoadMenu()
--MainMenu
self.Menu = MenuElement({type = MENU, id = "Irelia", name = "PussyIrelia"})
self.Menu:MenuElement({name = " ", drop = {"Version 0.40"}})
self.Menu:MenuElement({type = MENU, id = "ComboSet", name = "Combo Settings"})
--ComboMenu
self.Menu.ComboSet:MenuElement({type = MENU, id = "Combo", name = "Combo Mode"})
self.Menu.ComboSet.Combo:MenuElement({name = " ", drop = {"E1, W, R, Q, E2, Q + (Q when kill / almost kill)"}})
self.Menu.ComboSet.Combo:MenuElement({id = "LogicQ", name = "Last[Q]Almost Kill or Kill", key = 0x61, value = false, toggle = true})
self.Menu.ComboSet.Combo:MenuElement({id = "UseQ", name = "[Q]", value = true})
self.Menu.ComboSet.Combo:MenuElement({id = "UseW", name = "[W]", value = false})
self.Menu.ComboSet.Combo:MenuElement({id = "UseE", name = "[E]", value = true})
self.Menu.ComboSet.Combo:MenuElement({id = "UseE1", name = "Cast E1 in 1v1 (at your feet))", value = true})
self.Menu.ComboSet.Combo:MenuElement({id = "UseR", name = "[R]Single Target if almost killable", value = false})
self.Menu.ComboSet.Combo:MenuElement({id = "UseRCount", name = "Auto[R] Multiple Enemys", value = true})
self.Menu.ComboSet.Combo:MenuElement({id = "RCount", name = "Multiple Enemys", value = 2, min = 2, max = 5, step = 1})
self.Menu.ComboSet.Combo:MenuElement({id = "Gap", name = "Gapclose [Q]", value = true})
self.Menu.ComboSet.Combo:MenuElement({id = "Stack", name = "Stack Passive near Target/Minion", value = true})
--BurstModeMenu
self.Menu.ComboSet:MenuElement({type = MENU, id = "Burst", name = "Burst Mode"})
self.Menu.ComboSet.Burst:MenuElement({name = " ", drop = {"If Burst Active then Combo Mode is Inactive"}})
self.Menu.ComboSet.Burst:MenuElement({id = "StartB", name = "Use Burst Mode", key = 0x62, value = true, toggle = true})
self.Menu.ComboSet.Burst:MenuElement({id = "Lvl", name = "Irelia Level to Start Burst", value = 6, min = 6, max = 18, step = 1})
self.Menu.ComboSet.Burst:MenuElement({id = "UseRCount", name = "Auto[R] Multiple Enemys", value = true})
self.Menu.ComboSet.Burst:MenuElement({id = "RCount", name = "Multiple Enemys", value = 2, min = 2, max = 5, step = 1})
self.Menu.ComboSet:MenuElement({type = MENU, id = "Ninja", name = "Ninja Mode"})
self.Menu.ComboSet.Ninja:MenuElement({id = "UseQ", name = "Q on all Marked Enemys", key = 0x63, value = true, toggle = true})
self.Menu:MenuElement({type = MENU, id = "ClearSet", name = "Clear Settings"})
--LaneClear Menu
self.Menu.ClearSet:MenuElement({type = MENU, id = "Clear", name = "Clear Mode"})
self.Menu.ClearSet.Clear:MenuElement({type = MENU, id = "Last", name = "LastHit"})
self.Menu.ClearSet.Clear.Last:MenuElement({id = "UseQ", name = "LastHit[Q]", value = true})
self.Menu.ClearSet.Clear:MenuElement({id = "Mana", name = "Min Mana", value = 40, min = 0, max = 100, identifier = "%"})
--JungleClear Menu
self.Menu.ClearSet:MenuElement({type = MENU, id = "JClear", name = "JungleClear Mode"})
self.Menu.ClearSet.JClear:MenuElement({id = "UseQ", name = "LastHit[Q]", value = true})
self.Menu.ClearSet.JClear:MenuElement({id = "UseW", name = "[W]", value = true})
self.Menu.ClearSet.JClear:MenuElement({id = "Mana", name = "Min Mana", value = 40, min = 0, max = 100, identifier = "%"})
--LastHitMode Menu
self.Menu.ClearSet:MenuElement({type = MENU, id = "LastHit", name = "LastHit Mode"})
self.Menu.ClearSet.LastHit:MenuElement({id = "UseQ", name = "LastHit[Q]", value = true})
self.Menu.ClearSet.LastHit:MenuElement({id = "Mana", name = "Min Mana", value = 40, min = 0, max = 100, identifier = "%"})
self.Menu.ClearSet.LastHit:MenuElement({id = "Active", name = "LastHit Key", key = string.byte("X")})
--HarassMenu
self.Menu:MenuElement({type = MENU, id = "Harass", name = "Harass Settings"})
self.Menu.Harass:MenuElement({id = "UseE", name = "[E]", value = true})
self.Menu:MenuElement({type = MENU, id = "MiscSet", name = "Misc Settings"})
self.Menu.MiscSet:MenuElement({type = MENU, id = "Flee", name = "Flee Mode"})
self.Menu.MiscSet.Flee:MenuElement({name = " ", drop = {"Default Hotkey = [A]"}})
self.Menu.MiscSet.Flee:MenuElement({id = "Q", name = "[Q]", value = true})
self.Menu.MiscSet.Flee:MenuElement({id = "Qcombo", name = "q to minions in combo", value = false,key=string.byte("A")})
self.Menu.MiscSet.Flee:MenuElement({id = "Q2", name = "[Q] even on non killable Minions", value = false})
self.Menu.MiscSet:MenuElement({type = MENU, id = "Rrange", name = "Ultimate Range setting"})
self.Menu.MiscSet.Rrange:MenuElement({id = "R", name = "Max Cast range [R]", value = 850, min = 0, max = 950, step = 10})
--Prediction
self.Menu.MiscSet:MenuElement({type = MENU, id = "Pred", name = "Prediction Mode"})
self.Menu.MiscSet.Pred:MenuElement({name = " ", drop = {"After change Prediction Typ press 2xF6"}})
self.Menu.MiscSet.Pred:MenuElement({id = "Change", name = "Change Prediction Typ", value = 3, drop = {"Gamsteron Prediction", "Premium Prediction", "GGPrediction"}})
self.Menu.MiscSet.Pred:MenuElement({id = "PredR", name = "Hitchance[R]", value = 2, drop = {"Normal", "High", "Immobile"}})
self.Menu.MiscSet.Pred:MenuElement({id = "PredW", name = "Hitchance[W]", value = 2, drop = {"Normal", "High", "Immobile"}})
self.Menu.MiscSet.Pred:MenuElement({id = "PredE", name = "Hitchance[E]", value = 2, drop = {"Normal", "High", "Immobile"}})
--Drawing
self.Menu.MiscSet:MenuElement({type = MENU, id = "Drawing", name = "Drawings Mode"})
self.Menu.MiscSet.Drawing:MenuElement({id = "DrawQ", name = "Draw [Q] Range", value = false})
self.Menu.MiscSet.Drawing:MenuElement({id = "DrawR", name = "Draw [R] Range", value = false})
self.Menu.MiscSet.Drawing:MenuElement({id = "DrawE", name = "Draw [E] Range", value = false})
self.Menu.MiscSet.Drawing:MenuElement({id = "DrawW", name = "Draw [W] Range", value = false})
self.Menu.MiscSet.Drawing:MenuElement({id = "DrawKM", name = "Draw killable minions", value = false})
self.Menu.MiscSet.Drawing:MenuElement({type = MENU, id = "XY", name = "Info Box Settings"})
self.Menu.MiscSet.Drawing.XY:MenuElement({id = "OnOff", name = "Draw Status Box", key = 0x67, value = true, toggle = true})
self.Menu.MiscSet.Drawing.XY:MenuElement({id = "Key", name = "Draw HotKey Info", value = true})
self.Menu.MiscSet.Drawing.XY:MenuElement({id = "Hide", name = "Hide Info Box if active Mode", value = true})
self.Menu.MiscSet.Drawing.XY:MenuElement({id = "T", name = "Status Box transparency", value = 120, min = 0, max = 223, step = 10})
end
function Irelia:Tick()
--print(GetMode())
self:CheckInfoBox()
if Control.IsKeyDown(0x69) then
self.ButtonDown = false
UnLockBox = true
end
if myHero:GetSpellData(_E).toggleState==0 then
for i = 1, Game.MissileCount() do
local missile = Game.Missile(i)
if missile and (missile.missileData.name == "IreliaEMissile") then
endp=Vector(missile.missileData.endPos.x,missile.missileData.endPos.y,missile.missileData.endPos.z)
end
end
end
if heroes == false then
for i, unit in pairs(Enemies) do
checkCount = checkCount + 1
end
if checkCount < 1 then
LoadUnits()
else
heroes = true
end
end
if MyHeroNotReady() then return end
local Mode = GetMode()
if Mode == "Flee" then
self:Flee()
end
if Mode == "Combo" then
if self.Menu.ComboSet.Ninja.UseQ:Value() then
self:Ninja()
end
if self.Menu.ComboSet.Burst.StartB:Value() and myHero.levelData.lvl <= self.Menu.ComboSet.Burst.Lvl:Value() then
self:Combo()
end
if not self.Menu.ComboSet.Burst.StartB:Value() then
self:Combo()
end
elseif Mode == "Harass" then
self:Harass()
elseif Mode == "LaneClear" then
self:JungleClear()
self:Clear()
elseif Mode == "LastHit" then
if self.Menu.ClearSet.LastHit.Active:Value() then
self:LastHit()
end
end
if self.Menu.MiscSet.Flee.Qcombo:Value()==true then
self:Flee()
end
local target = GetTarget(1100)
if target == {} then end
local wbuff = GetBuffData(myHero, "ireliawdefense")
if HasBuff(myHero, "ireliawdefense") and target and wbuff.duration<0.95 then
local QPrediction = GGPrediction:SpellPrediction({Type = GGPrediction.SPELLTYPE_LINE, Delay =0.06, Radius = 15, Range = 895, Speed = 5000, Collision = false})
QPrediction:GetPrediction(target, myHero)
if QPrediction:CanHit(1) then
Control.CastSpell(HK_W,QPrediction.CastPosition)
end
end