forked from Pickonme/BoL_Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutoZhonyas.lua
More file actions
35 lines (31 loc) · 911 Bytes
/
Copy pathAutoZhonyas.lua
File metadata and controls
35 lines (31 loc) · 911 Bytes
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
local ZSlot, ZReady = nil, nil
local ZUseTick = nil
local BuffTable = {
["Zed"] = {spellName = "zedultexecute", onApply = false},
["Vladimir"] = {spellName = "vladimirhemoplaguedebuff", onApply = false},
["Fizz"] = {spellName = "fizzmarinerdoombomb", onApply = true}
}
function OnLoad()
PrintChat("<font color='#CCCCCC'>>> Auto Zhonyas by PQMailer loaded <<</font>")
end
function OnTick()
ZSlot = GetInventorySlotItem(3157)
ZReady = (ZSlot~= nil and myHero:CanUseSpell(ZSlot) == READY)
if ZReady and (ZUseTick ~= nil and GetTickCount() > ZUseTick) then
CastSpell(ZSlot)
ZUseTick = nil
end
end
function OnGainBuff(unit, buff)
if unit.isMe and buff and ZReady then
for _, Buff in pairs(BuffTable) do
if Buff.spellName == buff.name then
if Buff.onApply then
ZUseTick = GetTickCount()
else
ZUseTick = GetTickCount() + (buff.duration*1000 - 2500)
end
end
end
end
end