forked from Pickonme/BoL_Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAwareness.lua
More file actions
734 lines (613 loc) · 23.4 KB
/
Copy pathAwareness.lua
File metadata and controls
734 lines (613 loc) · 23.4 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
--[[ Credits: eXtragoZ: Ward Prediction; bortrik: Baron check; Vice Versa: Possible Position; Manciuszz: Incoming Enemy Marks; Swaggot: EnemyJunglerPosition idea; Apple: jungle mobs; Manciuszz for predators vision idea/some script parts; Klokje: ImLib ]]--
-- Delay to buff left time
--[[
Known Bugs: Wrong Buff Time if owner changes
Should be fixed but untested: Don't draw ss circles if recalled
ToDo: Combine with hidden objects
FIX: Buff Timer
FIX: Recall minimap
ADD: ImLib
FIX: Unique Colors
ADD: OnTheFly Message
ADD: Baron/Dragon Ping x 3
ADD: Fallback ping on enemymark
FIX: Turret Range
ADD: Turret Colors
ADD: Minion vision
ADD: Option to disable turrets per team
ADD: Re from death enemys TEST line 490, maybe 2nd function better idk
IMPRV: removed snidremove
ADD: SS Pings
]]--
--[[
0.1.1
FIX: Death SS
0.1.2
FIX: Jungler SS
0.1.3
IMPRV: Submenus
]]--
require "MapPosition"
require "ImLib"
if GetGame().map.index ~= 1 then return end
local VisionList = {}
local MissTable = {}
local VisionListLastTick = 0
local MissRefreshLastTick = 0
local MissWarningLastTick = 0
local BuffCheckLastTick = 0
local BuffAnnounceLastTick = {
["baron"] = 0,
["red_enemy"] = 0,
["red_ally"] = 0,
["blue_enemy"] = 0,
["blue_ally"] = 0
}
local ImportantVisionLastTick = 0
local ImportantAttackLastTick = 0
local Delay = 1000
local MissWarningDelay = 60000
local EnemyTable = {}
local LaneTable = {}
local TurretTable = {}
local TurretLifeCheckLastTick = 0
local WardTable = {}
local ItemSlot = {ITEM_1, ITEM_2, ITEM_3, ITEM_4, ITEM_5, ITEM_6}
local RecallTable = {}
local DeathTable = {}
local FatCircleTable = {}
local NPCTable = {}
local EnemyJungler = nil
local JungleCamps = {
["Worm12.1.1"] = true,
["Dragon6.1.1"] = true,
["AncientGolem1.1.1"] = true,
["AncientGolem7.1.1"] = true,
["LizardElder4.1.1"] = true,
["LizardElder10.1.1"] = true
}
local MinionTable = {}
function OnLoad()
Config = scriptConfig("Awareness", "awareness")
Config:addSubMenu("General", "general")
Config.general:addParam("SSTime", "Min. Time to count as missing", SCRIPT_PARAM_SLICE, 5, 1, 20, 0)
Config.general:addParam("MIAAnnounce", "Announce missing enemies", SCRIPT_PARAM_ONOFF, true)
if VIP_USER then
Config.general:addParam("MIAPingSS", "Ping SS enemies", SCRIPT_PARAM_ONOFF, true)
Config.general:addParam("MIAPingSSOwn", "Ping own lane only", SCRIPT_PARAM_ONOFF, true)
end
Config.general:addParam("MIAPingRE", "Ping RE enemies", SCRIPT_PARAM_ONOFF, true)
Config.general:addParam("MIAWarn", "Warn on multiple MIA's", SCRIPT_PARAM_ONOFF, true)
Config.general:addParam("WardTrack", "Track Wards", SCRIPT_PARAM_ONOFF, true)
Config.general:addParam("BuffCheck", "Track Buffs", SCRIPT_PARAM_ONOFF, true)
Config.general:addParam("VisionCheck", "Announce missing Baron/Dragon vision", SCRIPT_PARAM_ONOFF, true)
Config.general:addParam("AttackCheck", "Announce Baron/Dragon/Buffs losing life", SCRIPT_PARAM_ONOFF, true)
Config.general:addParam("TurretCheck", "Announce Turrets losing life", SCRIPT_PARAM_ONOFF, true)
Config:addSubMenu("Draw", "draw")
Config.draw:addParam("drawTurretRangeEnemy", "Draw Turret Range (Enemy)", SCRIPT_PARAM_ONOFF, true)
Config.draw:addParam("drawTurretRangeAlly", "Draw Turret Range (Ally)", SCRIPT_PARAM_ONOFF, false)
Config.draw:addParam("drawVisionRangePlayer", "Draw Player Vision Range", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("G"))
Config.draw:addParam("drawVisionRangeMinion", "Draw Minion Vision Range", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("H"))
Config.draw:addParam("MinionVisionRadius", "Radius for Minion Vision", SCRIPT_PARAM_SLICE, 100, 100, 200, 0)
Config.draw:addParam("drawEnemyMark", "Mark Incoming Enemies", SCRIPT_PARAM_ONOFF, true)
Config.draw:addParam("drawRecall", "Draw recalling Enemies", SCRIPT_PARAM_ONOFF, true)
Config.draw:addParam("drawPossiblePosition", "Draw possible position on minimap", SCRIPT_PARAM_ONOFF, true)
Config.draw:addParam("drawJunglerPosition", "Show last jungler position", SCRIPT_PARAM_ONOFF, true)
Config.draw:permaShow("drawVisionRangePlayer")
Config.draw:permaShow("drawVisionRangeMinion")
EnemyTable = GetEnemyHeroes()
CreateVisionList()
CreateTurretTable()
CreateWardTable()
CreateNPCTable()
CreateMinionTable()
GetEnemyJungler()
PrintChat("Awareness loaded")
end
function OnTick()
RefreshVisionList()
TrackMissingEnemys()
if Config.general.MIAWarn then AutoWarning() end
if Config.general.BuffCheck then BuffChecks() end
if Config.general.WardTrack then RefreshWardTableAndAnnounce() end
if Config.general.VisionCheck then ImportantVisionCheck() end
if Config.general.AttackCheck then ImportantAttackCheck() end
if Config.general.TurretCheck then TurretLifeCheck() end
end
function OnDraw()
DrawVision()
if Config.draw.drawRecall then DrawRecall() end
if Config.draw.drawEnemyMark then DrawEnemyMark() end
if Config.draw.drawPossiblePosition then DrawPossiblePosition() end
if Config.draw.drawJunglerPosition then DrawJunglerPosition() end
end
function OnProcessSpell(obj, spell)
if obj and obj.valid and obj.team ~= myHero.team and (spell.name == "Recall" or spell.name == "RecallImproved" or spell.name == "OdinRecall") then
table.insert(RecallTable, {["obj"] = obj, ["timestamp"] = GetTickCount(), ["announced"] = false})
VisionList[obj.networkID]["recallTick"] = GetTickCount()
end
end
function OnCreateObj(obj)
if obj and obj.type == "obj_AI_Minion" and obj.name and JungleCamps[obj.name] then
table.insert(NPCTable, {["obj"] = obj, ["lastannounceattack"] = 0, ["lastannouncevision"] = 0})
end
if obj and obj.type == "obj_AI_Minion" and (obj.name:find((myHero.team == TEAM_BLUE and "T200" or "T100")) or obj.name:find((myHero.team == TEAM_BLUE and "Red" or "Blue"))) then
table.insert(MinionTable, obj)
end
end
function OnDeleteObj(obj)
if obj and obj.type == "obj_AI_Minion" and obj.name and JungleCamps[obj.name] then
for i=1, #NPCTable do
local NPC = NPCTable[i]["obj"]
if NPC.name == obj.name then
table.remove(NPCTable, i)
end
end
end
if obj and obj.type == "obj_AI_Minion" and #MinionTable > 0 then
for i=1, #MinionTable do
local Minion = MinionTable[i]
if Minion and Minion.name and obj.name:find(Minion.name) then
table.remove(MinionTable, i)
end
end
end
end
function DrawVision()
if #TurretTable > 0 and (Config.draw.drawTurretRangeEnemy or Config.draw.drawTurretRangeAlly) then
for i=1, #TurretTable do
local Turret = TurretTable[i]["obj"]
if Turret ~= nil and Turret.health <= 0 then
table.remove(TurretTable, i)
break
end
if myHero:GetDistance(Turret) <= 2000 and Turret.valid then
if (Turret.team == myHero.team and not Config.draw.drawTurretRangeAlly) or (Turret.team ~= myHero.team and not Config.draw.drawTurretRangeEnemy) then
break
end
DrawCircle(Turret.x, Turret.y, Turret.z, TurretTable[i]["range"], TurretTable[i]["color"])
end
end
end
if Config.draw.drawVisionRangePlayer then
for i=1, #EnemyTable do
local Enemy = EnemyTable[i]
if myHero:GetDistance(Enemy) <= 2000 and Enemy.valid and Enemy.visible and not Enemy.dead then
DrawCircle(Enemy.x, Enemy.y, Enemy.z, 1400, ColorARGB.White:ToARGB())
end
end
end
if Config.draw.drawVisionRangeMinion then
DrawCircle(mousePos.x, mousePos.y, mousePos.z, Config.draw.MinionVisionRadius, ColorARGB.LightSeaGreen:ToARGB())
for i=1, #MinionTable do
local Minion = MinionTable[i]
if GetDistance(Minion, mousePos) <= Config.draw.MinionVisionRadius and Minion.valid and Minion.visible and not Minion.dead then
DrawCircle(Minion.x, Minion.y, Minion.z, 1200, ColorARGB.White:ToARGB())
end
end
end
end
function DrawRecall()
if #RecallTable == 0 then return end
for i=1, #RecallTable do
local Unit = RecallTable[i]["obj"]
if GetTickCount() > RecallTable[i]["timestamp"] + 8000 then
table.remove(RecallTable, i)
break
end
if Unit.valid then
if not RecallTable[i]["announced"] then
Message.AddMassage("Recall: "..Unit.charName.." "..GetLane(Unit), ColorARGB.Lime)
RecallTable[i]["announced"] = true
end
DrawCircleMinimap(Unit.x, Unit.y, Unit.z, 1000, 2, ColorARGB.Lime:ToARGB())
end
end
end
function DrawEnemyMark()
if #FatCircleTable == 0 then return end
for i=1, #FatCircleTable do
local Enemy = FatCircleTable[i]["obj"]
if GetTickCount() > FatCircleTable[i]["timestamp"] + 5000 then
table.remove(FatCircleTable, i)
break
end
if Enemy.valid and myHero:GetDistance(Enemy) < 2000 then
if not FatCircleTable[i]["announced"] then
Message.AddMassage("Enemy: "..Enemy.charName, ColorARGB.Red)
for i=1, 2 do
PingSignal(PING_FALLBACK, Enemy.x, Enemy.y, Enemy.z, 2)
end
FatCircleTable[i]["announced"] = true
end
for j=1, 10 do
DrawCircle(Enemy.x, Enemy.y, Enemy.z, 1250+j*0.25, ColorARGB.Red:ToARGB())
end
end
end
end
function DrawPossiblePosition()
for i=1, #EnemyTable do
local Enemy = EnemyTable[i]
if GetTickCount()-VisionList[Enemy.networkID]["timestamp"] >= 15000 or VisionList[Enemy.networkID]["recallTick"] ~= 0 or Enemy.visible then
break
end
local Distance = ((GetTickCount()-VisionList[Enemy.networkID]["timestamp"])/1000)*Enemy.ms
if Enemy.valid and not Enemy.dead then
if Distance <= 5000 then
DrawCircleMinimap(VisionList[Enemy.networkID]["x"], VisionList[Enemy.networkID]["y"], VisionList[Enemy.networkID]["z"], Distance, 2, ColorARGB.White:ToARGB())
else
DrawCircleMinimap(VisionList[Enemy.networkID]["x"], VisionList[Enemy.networkID]["y"], VisionList[Enemy.networkID]["z"], 5000, 2, ColorARGB.Magenta:ToARGB())
end
end
end
end
function DrawJunglerPosition()
if EnemyJungler == nil then return end
if EnemyJungler.dead then
DrawText("Jungler: Dead", 45, 750, 850, ColorARGB.White:ToARGB())
elseif EnemyJungler.visible then
DrawText("Jungler: "..tostring(GetLane(EnemyJungler)), 45, 750, 850, ColorARGB.Green:ToARGB())
else
DrawText("Jungler: "..tostring(VisionList[EnemyJungler.networkID]["lane"]), 45, 750, 850, ColorARGB.Red:ToARGB())
end
end
function CreateTurretTable()
for i=1, objManager.maxObjects do
local obj = objManager:getObject(i)
if obj and obj.valid and obj.type == "obj_AI_Turret" then
local Range = ((obj.name == "Turret_OrderTurretShrine_A" or obj.name == "Turret_ChaosTurretShrine_A") and 1050 or 950)
local Color = (obj.team == myHero.team and ColorARGB.Green:ToARGB() or ColorARGB.Red:ToARGB())
local ColorStatic = (obj.team == myHero.team and ColorARGB.Green or ColorARGB.Red)
table.insert(TurretTable, {["obj"] = obj, ["range"] = Range, ["color"] = Color, ["colorstatic"] = ColorStatic, ["lasthealth"] = obj.health, ["lastannounce"] = 0})
end
end
end
function BuffChecks()
local CurrentTick = GetTickCount()
if CurrentTick < BuffCheckLastTick + Delay then return end
for i=1,heroManager.iCount,1 do
local Unit = heroManager:getHero(i)
if Unit.isMe then
break
end
for j=1,Unit.buffCount do
local Buff = Unit:getBuff(j)
if Buff.valid and Buff.name == "exaltedwithbaronnashor" and CurrentTick > BuffAnnounceLastTick["baron"] + 300000 then
Announce("Baron respawn: "..(math.floor(Buff.startT/60) + 7)..":"..math.floor(Buff.startT/60), 1)
BuffAnnounceLastTick["baron"] = CurrentTick
end
if Buff.valid and Buff.name == "blessingofthelizardelder" then
if Unit.team ~= myHero.team then
if CurrentTick > BuffAnnounceLastTick["red_enemy"] + 180000 then
Announce("Red respawn (maybe enemy): "..math.floor((Buff.startT/60) + 5)..":"..math.floor(Buff.startT/60), 1)
BuffAnnounceLastTick["red_enemy"] = CurrentTick
end
else
if CurrentTick > BuffAnnounceLastTick["red_ally"] + 180000 then
Announce("Red respawn (maybe ally): "..math.floor((Buff.startT/60) + 5)..":"..math.floor(Buff.startT/60), 1)
BuffAnnounceLastTick["red_ally"] = CurrentTick
end
end
end
if Buff.valid and Buff.name == "crestoftheancientgolem" then
if Unit.team ~= myHero.team then
if CurrentTick > BuffAnnounceLastTick["blue_enemy"] + 180000 then
Announce("Blue respawn (maybe enemy): "..math.floor((Buff.startT/60) + 5)..":"..math.floor(Buff.startT/60), 1)
BuffAnnounceLastTick["blue_enemy"] = CurrentTick
end
else
if CurrentTick > BuffAnnounceLastTick["blue_ally"] + 180000 then
Announce("Blue respawn (maybe ally): "..math.floor((Buff.startT/60) + 5)..":"..math.floor(Buff.startT/60), 1)
BuffAnnounceLastTick["blue_ally"] = CurrentTick
end
end
end
end
end
BaronCheckLastTick = CurrentTick
end
function CreateWardTable()
for i=1, heroManager.iCount do
local Unit = heroManager:GetHero(i)
WardTable[Unit.networkID] = {
[1] = {["sight"] = 0, ["vision"] = 0},
[2] = {["sight"] = 0, ["vision"] = 0}
}
end
end
function RefreshWardTableAndAnnounce()
for i=1, heroManager.iCount do
local Unit = heroManager:GetHero(i)
local Color = (Unit.team == myHero.team and "#0095FF" or "#FF0000")
WardTable[Unit.networkID][1]["sight"] = 0
WardTable[Unit.networkID][1]["vision"] = 0
for j=1, 6 do
local Item = Unit:getItem(ItemSlot[j])
if Item and Item.id == 2044 then
WardTable[Unit.networkID][1]["sight"] = WardTable[Unit.networkID][1]["sight"] + Item.stacks
end
if Item and Item.id == 2043 then
WardTable[Unit.networkID][1]["vision"] = WardTable[Unit.networkID][1]["vision"] + Item.stacks
end
end
if WardTable[Unit.networkID][2]["sight"] > WardTable[Unit.networkID][1]["sight"] then
Announce("<font color='"..Color.."'>"..Unit.charName.."</font><font color='#CCCCCC'> used "..WardTable[Unit.networkID][2]["sight"]-WardTable[Unit.networkID][1]["sight"].." </font><font color='#CCCCCC'>Sight Ward(s)</font>", 3)
end
if WardTable[Unit.networkID][2]["sight"] < WardTable[Unit.networkID][1]["sight"] then
Announce("<font color='"..Color.."'>"..Unit.charName.."</font><font color='#CCCCCC'> bought "..WardTable[Unit.networkID][1]["sight"]-WardTable[Unit.networkID][2]["sight"].." </font><font color='#CCCCCC'>Sight Ward(s)</font>", 3)
end
if WardTable[Unit.networkID][2]["vision"] > WardTable[Unit.networkID][1]["vision"] then
Announce("<font color='"..Color.."'>"..Unit.charName.."</font><font color='#CCCCCC'> used "..WardTable[Unit.networkID][2]["vision"]-WardTable[Unit.networkID][1]["vision"].." </font><font color='#CCCCCC'>Vision Ward(s)</font>", 3)
end
if WardTable[Unit.networkID][2]["vision"] < WardTable[Unit.networkID][1]["vision"] then
Announce("<font color='"..Color.."'>"..Unit.charName.."</font><font color='#CCCCCC'> bought "..WardTable[Unit.networkID][1]["vision"]-WardTable[Unit.networkID][2]["vision"].." </font><font color='#CCCCCC'>Vision Ward(s)</font>", 3)
end
WardTable[Unit.networkID][2]["vision"] = WardTable[Unit.networkID][1]["vision"]
WardTable[Unit.networkID][2]["sight"] = WardTable[Unit.networkID][1]["sight"]
end
end
function CreateVisionList()
for i=1, #EnemyTable do
local Enemy = EnemyTable[i]
VisionList[Enemy.networkID] = {
["visible"] = false,
["timestamp"] = 0,
["x"] = 0,
["y"] = 0,
["z"] = 0,
["announced"] = false,
["lane"] = nil,
["recallTick"] = 0
}
end
end
function RefreshVisionList()
local CurrentTick = GetTickCount()
if CurrentTick < VisionListLastTick + Delay then return end
for i=1, #EnemyTable do
local Enemy = EnemyTable[i]
if Enemy.visible then
VisionList[Enemy.networkID]["visible"] = true
VisionList[Enemy.networkID]["timestamp"] = CurrentTick
VisionList[Enemy.networkID]["x"] = Enemy.x
VisionList[Enemy.networkID]["y"] = Enemy.y
VisionList[Enemy.networkID]["z"] = Enemy.z
VisionList[Enemy.networkID]["lane"] = GetLane(Enemy)
if CurrentTick-VisionList[Enemy.networkID]["recallTick"] >= 10000 then
VisionList[Enemy.networkID]["recallTick"] = 0
end
else
if not Enemy.dead then
VisionList[Enemy.networkID]["visible"] = false
end
end
end
VisionListLastTick = CurrentTick
end
function TrackMissingEnemys()
local CurrentTick = GetTickCount()
if CurrentTick < MissRefreshLastTick + Delay then return end
for i=1, #EnemyTable do
local Enemy = EnemyTable[i]
if GetTickCount() > VisionList[Enemy.networkID]["timestamp"] + Config.general.SSTime*1000 and VisionList[Enemy.networkID]["timestamp"] ~= 0 and VisionList[Enemy.networkID]["announced"] == false then
if Config.general.MIAAnnounce and not Enemy.dead and not (EnemyJungler and Enemy.networkID == EnemyJungler.networkID) then
Message.AddMassage("Miss: "..Enemy.charName.." "..VisionList[Enemy.networkID]["lane"], ColorARGB.Red)
if Config.general.MIAPingSS then
if Config.general.MIAPingSSOwn then
if VisionList[Enemy.networkID]["lane"] == GetLane(myHero) then
PingSignalC(VisionList[Enemy.networkID]["x"], VisionList[Enemy.networkID]["z"], Enemy.networkID, 1)
end
else
PingSignalC(VisionList[Enemy.networkID]["x"], VisionList[Enemy.networkID]["z"], Enemy.networkID, 1)
end
end
end
table.insert(MissTable, Enemy)
VisionList[Enemy.networkID]["announced"] = true
end
end
if #MissTable > 0 then
for i=1, #MissTable do
local Enemy = MissTable[i]
if Enemy and Enemy.dead then
table.insert(DeathTable, Enemy)
VisionList[Enemy.networkID]["lane"] = "Dead"
table.remove(MissTable, i)
break
end
if Enemy and Enemy.visible then
Message.AddMassage("Re: "..Enemy.charName.." "..GetLane(Enemy), ColorARGB.White)
if Config.general.MIAPingRE then
PingSignal(0, Enemy.x, Enemy.y, Enemy.z, PING_NORMAL)
end
table.insert(FatCircleTable, {["obj"] = Enemy, ["timestamp"] = CurrentTick, ["announced"] = false})
table.remove(MissTable, i)
VisionList[Enemy.networkID]["announced"] = false
end
end
end
if #DeathTable > 0 then
for i=1, #DeathTable do
local Enemy = DeathTable[i]
if Enemy and Enemy.visible then
Message.AddMassage("Alive and Re: "..Enemy.charName.." "..GetLane(Enemy), ColorARGB.White)
if Config.general.MIAPingRE then
PingSignal(0, Enemy.x, Enemy.y, Enemy.z, PING_NORMAL)
end
table.remove(DeathTable, i)
VisionList[Enemy.networkID]["announced"] = false
end
end
end
MissRefreshLastTick = CurrentTick
end
function AutoWarning()
local CurrentTick = GetTickCount()
if CurrentTick < MissWarningLastTick + MissWarningDelay then return end
if #MissTable >= 2 then
Message.AddMassage(#MissTable.." Enemies missing!", ColorARGB.Red)
MissWarningLastTick = CurrentTick
end
end
function CreateNPCTable()
for i=1, objManager.maxObjects do
local obj = objManager:getObject(i)
if obj and obj.type == "obj_AI_Minion" and obj.name and JungleCamps[obj.name] then
table.insert(NPCTable, {["obj"] = obj, ["lastannounceattack"] = 0, ["lastannouncevision"] = 0})
end
end
end
function CreateMinionTable()
for i=1, objManager.maxObjects do
local obj = objManager:getObject(i)
if obj and obj.type == "obj_AI_Minion" and obj.team ~= myHero.team and not obj.dead then
table.insert(MinionTable, obj)
end
end
end
function GetRealNPCName(obj)
if not obj.name then return nil end
if obj.name == "Worm12.1.1" then
return "Baron"
elseif obj.name == "Dragon6.1.1" then
return "Dragon"
elseif obj.name == "LizardElder4.1.1" then
return "Red (Team Blue)"
elseif obj.name == "LizardElder10.1.1" then
return "Red (Team Red)"
elseif obj.name == "AncientGolem1.1.1" then
return "Blue (Team Blue)"
elseif obj.name == "AncientGolem7.1.1" then
return "Blue (Team Red)"
end
end
function ImportantVisionCheck()
local CurrentTick = GetTickCount()
if CurrentTick < ImportantVisionLastTick + Delay then return end
for i=1, #NPCTable do
local NPC = NPCTable[i]["obj"]
if NPC and not NPC.visible and (NPC.name == "Worm12.1.1" or NPC.name == "Dragon6.1.1") and CurrentTick > NPCTable[i]["lastannouncevision"] + 120000 then
if #MissTable >= 4 then
Announce(#MissTable.." Enemys missing and no "..GetRealNPCName(NPC).." vision", 2)
Message.AddMassage(#MissTable.." Enemys missing and no "..GetRealNPCName(NPC).." vision", ColorARGB.Red)
NPCTable[i]["lastannouncevision"] = CurrentTick
break
end
if GetTickCount() > GetGame().tick + 900000 then
Announce("You have no "..GetRealNPCName(NPC).." vision", 1)
Message.AddMassage("You have no "..GetRealNPCName(NPC).." vision", ColorARGB.White)
NPCTable[i]["lastannouncevision"] = CurrentTick
break
end
end
end
ImportantVisionLastTick = CurrentTick
end
function ImportantAttackCheck()
local CurrentTick = GetTickCount()
if CurrentTick < ImportantAttackLastTick + Delay then return end
for i=1, #NPCTable do
local NPC = NPCTable[i]["obj"]
if NPC and NPC.valid and NPC.visible then
if NPC.health < NPC.maxHealth and CurrentTick > NPCTable[i]["lastannounceattack"] + 180000 then
Announce(GetRealNPCName(NPC).." gets attacked", 2)
Message.AddMassage(GetRealNPCName(NPC).." gets attacked", ColorARGB.Red)
for i=1, 2 do
PingSignal(0, NPC.x, NPC.y, NPC.z, PING_NORMAL)
end
NPCTable[i]["lastannounceattack"] = CurrentTick
end
end
end
ImportantAttackLastTick = CurrentTick
end
function TurretLifeCheck()
local CurrentTick = GetTickCount()
if CurrentTick < TurretLifeCheckLastTick + Delay then return end
for i=1, #TurretTable do
local Turret = TurretTable[i]["obj"]
if Turret.valid and Turret.health < TurretTable[i]["lasthealth"] and CurrentTick > TurretTable[i]["lastannounce"] + 120000 and myHero:GetDistance(Turret) >= 3000 then
if Turret.health/Turret.maxHealth <= 0.2 then
Announce("A Turret on "..GetLane(Turret).." Lane goes down", 2)
Message.AddMassage("A Turret on "..GetLane(Turret).." Lane goes down", TurretTable[i]["colorstatic"])
for i=1, 2 do
PingSignal(0, Turret.x, Turret.y, Turret.z, PING_NORMAL)
end
else
Message.AddMassage("A Turret on "..GetLane(Turret).." Lane gets attacked", TurretTable[i]["colorstatic"])
end
TurretTable[i]["lastannounce"] = CurrentTick
end
end
TurretLifeCheckLastTick = CurrentTick
end
function GetLane(unit)
if not unit then return nil end
local Position = nil
if MapPosition:onTopLane(unit) then
Position = "Top"
elseif MapPosition:onMidLane(unit) then
Position = "Mid"
elseif MapPosition:onBotLane(unit) then
Position = "Bot"
elseif MapPosition:inOuterJungle(unit) then
Position = "Outer Jungle"
elseif MapPosition:inInnerJungle(unit) then
Position = "Inner Jungle"
elseif MapPosition:inOuterRiver(unit) then
Position = "Outer River"
elseif MapPosition:inInnerRiver(unit) then
Position = "Inner River"
elseif MapPosition:inLeftBase(unit) then
Position = "Blue Base"
elseif MapPosition:inRightBase(unit) then
Position = "Purple Base"
end
if Position ~= nil then
return Position
else
return nil
end
end
function GetEnemyJungler()
for i=1, #EnemyTable do
local Enemy = EnemyTable[i]
if Enemy.valid and (Enemy:GetSpellData(SUMMONER_1).name:find("Smite") or Enemy:GetSpellData(SUMMONER_2).name:find("Smite")) then
EnemyJungler = Enemy
end
end
if EnemyJungler == nil then
for i=1, #EnemyTable do
local Enemy = EnemyTable[i]
if Enemy.valid and (Enemy.charName == "Nunu" or Enemy.charName == "Chogath") then
EnemyJungler = Enemy
end
end
end
end
function Announce(message, state)
local state = state or 1
if message then
if state == 1 then
PrintChat(tostring("<font color='#CCCCCC'>"..message.."</font>"))
elseif state == 2 then
PrintChat(tostring("<font color='#FF0000'>"..message.."</font>"))
elseif state == 3 then
PrintChat(tostring(message))
end
end
end
function PingSignalC(x, z, nid, ptype)
if not VIP_USER then return end
local ptype = (ptype == 1 and 179 or 05)
local packet = CLoLPacket(0x56)
packet:Encode4(0)
packet:EncodeF(x)
packet:EncodeF(z)
packet:EncodeF(nid)
packet:Encode2(ptype)
packet.dwArg1 = 1
packet.dwArg2 = 0
SendPacket(packet)
end