forked from TheShaunyboi/FF15
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spellblocker.lua
239 lines (216 loc) · 6.44 KB
/
spellblocker.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
require "FF15Menu"
require "utils"
local spells
local SpellBlocker =
setmetatable(
{},
{
__call = function(self, ...)
local result = setmetatable({}, {__index = self})
result:__init(...)
return result
end
}
)
local activeSpells = {}
function SpellBlocker:__init(menu)
self.menu = menu:sub("spellblocker", "Spell Blocker")
self.shouldBlock = false
local enemies = {}
for i, enemy in ipairs(ObjectManager:GetEnemyHeroes()) do
enemies[enemy.charName] = true
end
local ordered = {}
for spellName, spell in pairs(spells) do
ordered[#ordered+1] = {spellName, spell}
end
table.sort(ordered, function(a, b) return a[1] < b[1] end)
for i = 1, #ordered do
local spellName, spellData = ordered[i][1], ordered[i][2]
if enemies[spellData.charName] then
self.menu:checkbox(spellName, spellName, true)
activeSpells[spellName] = spellData
end
end
AddEvent(
Events.OnTick,
function()
self:OnTick()
end
)
end
function SpellBlocker:OnTick()
end
--[[Spell Types
autoAttack
name
missile
name
spell
name
speed
dash
delay
buff
stacks
condition
all
end
unit
self
enemy
name
]]
spells = {
["Aatrox P Deathbringer Stance"] = {
charName = "Aatrox",
check = {type = "autoAttack", name = "AatroxPassiveAttack"}
},
["Aatrox W Infernal Chains"] = {
charName = "Aatrox",
check = {type = "buff", condition = "end", unit = "self", name = "aatroxwchains"}
},
["Alistar W Headbutt"] = {
charName = "Alistar",
check = {type = "spell", name = "Headbutt", speed = "dash"}
},
["Alistar E Trample"] = {
charName = "Alistar",
check = {
{type = "autoAttack", name = {"AlistarBasicAttack", "AlistarBasicAttack2"}},
{type = "buff", condition = "all", unit = "enemy", name = "AlistarE"}
}
},
["Anivia E Frostbite (Double)"] = {
charName = "Anivia",
check = {
{type = "missile", name = "Frostbite"},
{type = "buff", condition = "all", unit = "self", name = "aniviaiced"}
}
},
["Annie Q Disintegrate (Stun)"] = {
charName = "Annie",
check = {
{type = "missile", name = "AnnieQ"},
{type = "buff", condition = "all", unit = "self", name = "anniepassiveprimed"}
}
},
["Blitzcrank E Power Fist"] = {
charName = "Blitzcrank",
check = {type = "autoAttack", name = "PowerFistAttack"}
},
["Brand P Blaze"] = {
charName = "Brand",
check = {type = "buff", condition = "end", unit = "self", name = "BrandAblazeDetonateMarker"}
},
["Braum P Concussive"] = {
charName = "Braum",
check = {
{type = "autoAttack"},
{type = "buff", condition = "all", unit = "self", name = "BraumMark"}
}
},
["Caitlyn P Headshot"] = {
charName = "Caitlyn",
check = {type = "missile", name = "CaitlynHeadshotMissile"}
},
["Caitlyn R Ace in the Hole"] = {
charName = "Caitlyn",
check = {type = "missile", name = "CaitlynAceintheHole"}
},
["Camille Q Precision Protocol"] = {
charName = "Camille",
check = {type = "autoAttack", name = "CamilleQAttackEmpowered"}
},
["Cho'Gath R Feast"] = {
charName = "Chogath",
check = {type = "spell", name = "Feast"}
},
["Darius R Noxian Guillotine"] = {
charName = "Darius",
check = {type = "spell", name = "DariusExecute"}
},
["Diana P Moonsilver Blade"] = {
charName = "Diana",
check = {type = "autoAttack", name = "DianaBasicAttack3"}
},
["Dr Mundo E Masochism"] = {
charName = "DrMundo",
check = {type = "autoAttack", name = "MasoChismAtttack"}
},
["Ekko P Z-Drive Resonance"] = {
charName = "Ekko",
check = {type = "autoAttack", name = "DianaBasicAttack3"}
},
["Ekko E Phase Dive"] = {
charName = "Ekko",
check = {type = "spell", name = "EkkoEAttack"}
},
["Elise Human Q Neurotoxin"] = {
charName = "Elise",
check = {type = "missile", name = "EliseHumanQ"}
},
["Elise Spider Q Venomous Bite"] = {
charName = "Elise",
check = {type = "spell", name = "EliseSpiderQCast"}
},
["Fiddlesticks Q Terrify"] = {
charName = "Fiddlesticks",
check = {type = "spell", name = "Terrify"}
},
["Fiddlesticks E Dark Wind"] = {
charName = "Fiddlesticks",
check = {type = "missile", name = "FiddleSticksDarkWindMissile"}
},
["Fiora E Bladework (Second)"] = {
charName = "Fiora",
check = {
{type = "autoAttack", name = {"FioraBasicAttack", "FioraBasicAttack2"}},
{type = "buff", condition = "all", unit = "self", name = "fiorae2"}
}
},
["Fizz R Chum the Waters (Emerge)"] = {
charName = "Fizz",
check = {type = "buff", condition = "end", unit = "self", name = "fizzrbomb"}
},
["Garen Q Decisive Strike"] = {
charName = "Garen",
check = {type = "spell", name = "GarenQAttack"}
},
["Garen R Demacian Justice"] = {
charName = "Garen",
check = {type = "spell", name = "GarenR"}
},
--Gnar
--Gragas
["Hecarim E Drunken Rage"] = {
charName = "Hecarim",
check = {type = "autoAttack", name = "HecarimRampAttack"}
},
["Illaoi W Harsh Lesson"] = {
charName = "Illaoi",
check = {type = "autoAttack", name = "IllaoiWAttack"}
},
["Irelia Q Bladesurge (Reset)"] = {
charName = "Irelia",
check = {
{type = "spell", name = "IreliaQ", speed = "dash"},
{type = "buff", condition = "all", unit = "self", name = "ireliamark"}
}
},
--Ivern
["Janna W Zephyr"] = {
charName = "Janna",
check = {type = "missile", name = "SowTheWind"}
},
}
local function HasBuff(unit, buffName, isEnd)
local buffs = enemy.buffManager.buffs
for i = 1, #buffs do
local buff = buffs[i]
if not isEnd or (buff.name == buffName and buff.remainingTime < 0.05 + NetClient.ping / 1000) then
return true
end
end
end
return SpellBlocker