-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJarvanIV - The Emporer.lua
398 lines (303 loc) · 13.6 KB
/
JarvanIV - The Emporer.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
if myHero.charName ~= "JarvanIV" then return end
-- Made by MuMuHey
-- Updated 19.04.2015 - V 2.1 Fixed Ranges
--[[ More infos soooooon
]]--
--[[ Auto Update ]]
local sversion = "2.1"
local AUTOUPDATE = true
local UPDATE_HOST = "raw.github.com"
local UPDATE_PATH = "/MuMuHay/BoL-Script/master/JarvanIV - The Emporer.lua".."?rand="..math.random(1,10000)
local UPDATE_FILE_PATH = SCRIPT_PATH..GetCurrentEnv().FILE_NAME
local UPDATE_URL = "https://"..UPDATE_HOST..UPDATE_PATH
function AutoupdaterMsg(msg) print("<font color=\"#6699ff\"><b>JarvanIV - The Emporer:</b></font> <font color=\"#FFFFFF\">"..msg..".</font>") end
if AUTOUPDATE then
local ServerData = GetWebResult(UPDATE_HOST, "/MuMuHay/BoL-Script/master/version/JarvanIV - The Emporer.version")
if ServerData then
ServerVersion = type(tonumber(ServerData)) == "number" and tonumber(ServerData) or nil
if ServerVersion then
if tonumber(sversion) < ServerVersion then
AutoupdaterMsg("New version available"..ServerVersion)
AutoupdaterMsg("Updating, please don't press F9")
DelayAction(function() DownloadFile(UPDATE_URL, UPDATE_FILE_PATH, function () AutoupdaterMsg("Successfully updated. ("..sversion.." => "..ServerVersion.."), press F9 twice to load the updated version.") end) end, 3)
else
AutoupdaterMsg("You have got the latest version ("..ServerVersion..")")
end
end
else
AutoupdaterMsg("Error downloading version info")
end
end
require 'VPrediction'
require 'SOW'
------------ Globals --------------
local VP = nil
local ts
local Menu
local Qready, Wready, Eready, Rready = false, false, false ,false
------------ Globals end ------------
-- ############################################################### Callbacks start ###############################################################
function OnLoad()
EnemyMinions = minionManager(MINION_ENEMY, 700, myHero, MINION_SORT_MAXHEALTH_DEC)
jungleMinions = minionManager(MINION_JUNGLE, 700, myHero, MINION_SORT_MAXHEALTH_DEC)
setupVars()
ts = TargetSelector(TARGET_LESS_CAST, 900, DAMAGE_PHYSICAL)
Menu = scriptConfig ("JarvanIV The Emporer", "JarvanIV")
VP = VPrediction()
Orbwalker = SOW(VP)
Menu:addSubMenu ("[JarvanIV - Orbwalker]", "SOWorb")
Orbwalker:LoadToMenu(Menu.SOWorb)
Menu:addSubMenu ("[Combo]", "Combo")
Menu.Combo:addParam("combo", "SWBT", SCRIPT_PARAM_ONKEYDOWN, false, 32)
Menu.Combo:addParam("comboEQ", "Use Q+E in SWBT", SCRIPT_PARAM_ONOFF, true)
Menu.Combo:addParam("comboSaveEQ", "Saves EQ for Combo", SCRIPT_PARAM_ONOFF, false)
Menu.Combo:addParam("comboW", "Use W", SCRIPT_PARAM_ONOFF, true)
Menu.Combo:addParam("comboR", "Use R", SCRIPT_PARAM_ONOFF, true)
Menu.Combo:addParam("RHealth", "Use R at % Health of Enemy", SCRIPT_PARAM_SLICE, 50, 0, 100, 0)
Menu:addSubMenu("[Harass]", "Harass")
Menu.Harass:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
Menu.Harass:addParam("autoharass", "Auto-Harass", SCRIPT_PARAM_ONKEYTOGGLE, false, string.byte("Y"))
Menu.Harass:addParam("ahMana", "Auto-Harass if mana is over %", SCRIPT_PARAM_SLICE, 20, 0, 100, 0)
Menu:addSubMenu("[Laneclear]", "LaneClear")
Menu.LaneClear:addParam("laneClear", "Laneclear with spells", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("N"))
Menu.LaneClear:addParam("laneclearQ", "Use Q in Laneclear", SCRIPT_PARAM_ONOFF, true)
Menu.LaneClear:addParam("laneclearE", "Use E in Laneclear", SCRIPT_PARAM_ONOFF, true)
Menu.LaneClear:addParam("lclrMana", "Use Spells if mana is over %", SCRIPT_PARAM_SLICE, 20, 0, 100, 0)
Menu:addSubMenu("[JungleClear]", "JungleClear")
Menu.JungleClear:addParam("jungleclear", "Jungleclear with spells", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("N"))
Menu.JungleClear:addParam("jungleclearQ", "Use Q in Jungleclear", SCRIPT_PARAM_ONOFF, true)
Menu.JungleClear:addParam("jungleclearE", "Use E in Jungleclear", SCRIPT_PARAM_ONOFF, true)
Menu.JungleClear:addParam("jungleclearW", "Use W in Jungleclear", SCRIPT_PARAM_ONOFF, true)
Menu.JungleClear:addParam("jungleclearMana", "Use Spells if mana is over %", SCRIPT_PARAM_SLICE, 20, 0, 100, 0)
Menu:addSubMenu("[Extras]", "Ext")
Menu.Ext:addParam("EQcommand", "EQ Escape Key", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("G"))
Menu:addSubMenu("[Drawings]", "drawings")
Menu.drawings:addParam("drawCircleAA", "Draw AA Range", SCRIPT_PARAM_ONOFF, true)
Menu.drawings:addParam("drawCircleEQ", "Draw EQ Range", SCRIPT_PARAM_ONOFF, true)
Menu.drawings:addParam("drawCircleR", "Draw R Range", SCRIPT_PARAM_ONOFF, true)
Menu:addSubMenu("[Ult Blacklist]", "ultb")
for i, enemy in pairs(GetEnemyHeroes()) do
Menu.ultb:addParam(enemy.charName, "Use ult on: "..enemy.charName, SCRIPT_PARAM_ONOFF, true)
end
Menu:addSubMenu("[Target Selector]", "targetSelector")
Menu.targetSelector:addTS(ts)
ts.name = "Focus"
Menu.Combo:permaShow("combo")
Menu.Harass:permaShow("autoharass")
print("<font color = \"#33CCCC\">JarvanIV - The Emporer</font> <font color = \"#fff8e7\">MuMuHey GL HF. If you like the Script like it on Scriptstatus and on the Topic <3</font>")
end
function setupVars()
AARange = 175
Qrange = 700
Qwidth = 70
Qspeed = math.huge
Qdelay = 0.5
Wrange = 300
Wwidth = 300
Wspeed = nil
Wdelay = 0.5
Erange = 830
Ewidth = 75
Espeed = math.huge
Edelay = 0.5
Rrange = 650
Rwidth = 325
Rspeed = nil
Rdelay = 0.5
end
function spellchecker()
Qready = (myHero:CanUseSpell(_Q) == READY)
Wready = (myHero:CanUseSpell(_W) == READY)
Eready = (myHero:CanUseSpell(_E) == READY)
Rready = (myHero:CanUseSpell(_R) == READY)
end
function ManaCheck(unit, ManaValue)
if unit.mana < (unit.maxMana * (ManaValue/100))
then return true
else
return false
end
end
function HealthCheck(unit, HealthValue)
if unit.health < (unit.maxHealth * (HealthValue/100))
then return true
else
return false
end
end
function CountEnemies(range, unit)
local Enemies = 0
for _, enemy in ipairs(GetEnemyHeroes()) do
if ValidTarget(enemy) and GetDistance(enemy, unit) < (range or math.huge) then
Enemies = Enemies + 1
end
end
return Enemies
end
function OnTick()
if myHero.dead then return end
EnemyMinions:update()
jungleMinions:update()
spellchecker()
ts:update()
if Menu.Ext.EQcommand then
mousePosEQ()
end
if Menu.Combo.combo then
JarvanCombo()
end
if Menu.Harass.harass then
useHarass()
end
if Menu.Harass.autoharass then
useAutoHarass()
end
if Menu.LaneClear.laneclearQ and Menu.LaneClear.laneClear then
lclr()
end
if Menu.JungleClear.jungleclear then
JungleClear()
end
if UltActive then
if CountEnemyHeroInRange(Rwidth) == 0 then
CastSpell(_R)
end
end
end
function JarvanCombo()
if Menu.Combo.comboEQ then
ComboEQ()
end
if Menu.Combo.comboW then
ComboW()
end
if Menu.Combo.comboR then
ComboR()
end
end
function lclr()
if jungleMinion == nil then
for i, minion in pairs(EnemyMinions.objects) do
if minion ~= nil and ValidTarget(minion, 700) then
local CastPosition, HitChance, Position = VP:GetLineCastPosition(minion, 0.5, 70, 700, 1000, myHero, false)
if HitChance >= 2 and Qready and GetDistance(CastPosition) < 700 and ManaCheck(myHero, Menu.LaneClear.lclrMana) == false then
CastSpell(_Q, CastPosition.x, CastPosition.z)
end
CastSpell(_E, minion.x, minion.z)
end
end
end
end
function useHarass()
for i, target in pairs(GetEnemyHeroes()) do
local CastPosition, HitChance, Position = VP:GetLineCastPosition(target, 0.5, 70, 700, 1000, myHero, false)
if target ~= nil and Qready and ValidTarget(target) and HitChance >= 2 and GetDistance(CastPosition) < 700 then
CastSpell(_Q, CastPosition.x, CastPosition.z)
end
end
end
function useAutoHarass()
for i, target in pairs(GetEnemyHeroes()) do
local CastPosition, HitChance, Position = VP:GetLineCastPosition(target, 0.5, 70, 700, 1000, myHero, false)
if target ~= nil and Qready and ValidTarget(target) and HitChance >= 2 and GetDistance(CastPosition) < Qrange and ManaCheck(myHero, Menu.Harass.ahMana) == false then
CastSpell(_Q, CastPosition.x, CastPosition.z)
end
end
end
function ComboR()
local target = ts.target
if Menu.Combo.combo then
for i, target in pairs(GetEnemyHeroes()) do
if target ~= nil and ValidTarget(target, Rrange) and not ultActive then
if HealthCheck(target, Menu.Combo.RHealth) == true and blCheck(target) then
CastSpell(_R, target)
end
end
end
end
end
function ComboW()
if CountEnemyHeroInRange(280) >= 1 then
CastSpell(_W)
end
end
function ComboEQ()
if Menu.Combo.combo then
if Menu.Combo.comboSaveEQ then
for i, target in pairs(GetEnemyHeroes()) do
local CastPosition, HitChance, Position = VP:GetCircularCastPosition(target, 0.5, 70, 800, 1000)
if target ~= nil and Qready and Eready and ValidTarget(target) and HitChance >= 2 and GetDistance(CastPosition) < 800 then
CastSpell(_E, CastPosition.x, CastPosition.z)
CastSpell(_Q, CastPosition.x, CastPosition.z)
end
end
else
for i, target in pairs(GetEnemyHeroes()) do
local CastPosition, HitChance, CastPosition = VP:GetCircularCastPosition(target, 0.5, 70, 800, 1000)
if target ~= nil and ValidTarget(target) and HitChance >= 2 and GetDistance(CastPosition) < 800 then
CastSpell(_E, CastPosition.x, CastPosition.z)
CastSpell(_Q, CastPosition.x, CastPosition.z)
end
end
end
end
end
function JungleClear()
for i, jungleMinion in pairs(jungleMinions.objects) do
if jungleMinion ~= nil then
if Eready and Qready and Menu.JungleClear.jungleclearQ and Menu.JungleClear.jungleclearE and ManaCheck(myHero, Menu.JungleClear.jungleclearMana) == false then
if ValidTarget(jungleMinion, Erange) then
CastSpell(_E, jungleMinion.x, jungleMinion.z)
CastSpell(_Q, jungleMinion.x, jungleMinion.z)
end
else
if Menu.JungleClear.jungleclearQ and ManaCheck(myHero, Menu.JungleClear.jungleclearMana) == false and ValidTarget(jungleMinion, Qrange) and Qready then
CastSpell(_Q, jungleMinion.x, jungleMinion.z)
end
if Menu.JungleClear.jungleclearE and ManaCheck(myHero, Menu.JungleClear.jungleclearMana) == false and ValidTarget(jungleMinion, Erange) and Eready then
CastSpell(_E, jungleMinion)
end
end
if Menu.JungleClear.jungleclearW and ManaCheck(myHero, Menu.JungleClear.jungleclearMana) == false and ValidTarget(jungleMinion, Wrange) and Wready then
CastSpell(_W)
end
end
end
end
function mousePosEQ()
if Eready and Qready then
CastSpell(_E, mousePos.x, mousePos.z)
CastSpell(_Q, mousePos.x, mousePos.z)
end
myHero:MoveTo(mousePos.x, mousePos.z)
end
function OnDraw()
if myHero.dead then return end
if Menu.drawings.drawCircleEQ then
DrawCircle(myHero.x, myHero.y, myHero.z, 800, 0x111111)
end
if Menu.drawings.drawCircleAA then
DrawCircle(myHero.x, myHero.y, myHero.z, 250, ARGB(255, 0, 0, 80))
end
if Menu.drawings.drawCircleR then
DrawCircle(myHero.x, myHero.y, myHero.z, 650, 0x111111)
end
end
function blCheck(target)
if target ~= nil and Menu.ultb[target.charName] then
return true
else
return false
end
end
function OnCreateObj(obj)
if obj.name:find("JarvanCataclysm_tar.troy") then
ultActive = true
end
end
function OnDeleteObj(obj)
if obj.name:find("JarvanCataclysm_tar.troy") then
ultActive = false
end
end
assert(load(Base64Decode("G0x1YVIAAQQEBAgAGZMNChoKAAAAAAAAAAAAAQIKAAAABgBAAEFAAAAdQAABBkBAAGUAAAAKQACBBkBAAGVAAAAKQICBHwCAAAQAAAAEBgAAAGNsYXNzAAQNAAAAU2NyaXB0U3RhdHVzAAQHAAAAX19pbml0AAQLAAAAU2VuZFVwZGF0ZQACAAAAAgAAAAgAAAACAAotAAAAhkBAAMaAQAAGwUAABwFBAkFBAQAdgQABRsFAAEcBwQKBgQEAXYEAAYbBQACHAUEDwcEBAJ2BAAHGwUAAxwHBAwECAgDdgQABBsJAAAcCQQRBQgIAHYIAARYBAgLdAAABnYAAAAqAAIAKQACFhgBDAMHAAgCdgAABCoCAhQqAw4aGAEQAx8BCAMfAwwHdAIAAnYAAAAqAgIeMQEQAAYEEAJ1AgAGGwEQA5QAAAJ1AAAEfAIAAFAAAAAQFAAAAaHdpZAAEDQAAAEJhc2U2NEVuY29kZQAECQAAAHRvc3RyaW5nAAQDAAAAb3MABAcAAABnZXRlbnYABBUAAABQUk9DRVNTT1JfSURFTlRJRklFUgAECQAAAFVTRVJ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