forked from sirxkilller/PiSeries
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPiNidalee.lua
More file actions
416 lines (350 loc) · 12.4 KB
/
Copy pathPiNidalee.lua
File metadata and controls
416 lines (350 loc) · 12.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
-- PiNidalee - simple as f***
local version = "1.07"
local AUTOUPDATE = true
if myHero.charName ~= "Nidalee" then return end
require 'VPrediction'
require 'Prodiction'
require 'SOW'
local UPDATE_NAME = "PiNidalee"
local UPDATE_HOST = "raw.github.com"
local UPDATE_PATH = "/RankedFire/PiSeries/master/PiNidalee.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>"..UPDATE_NAME..":</b></font> <font color=\"#FFFFFF\">"..msg..".</font>") end
if AUTOUPDATE then
local ServerData = GetWebResult(UPDATE_HOST, UPDATE_PATH, "", 5)
if ServerData then
local ServerVersion = string.match(ServerData, "local version = \"%d+.%d+\"")
ServerVersion = string.match(ServerVersion and ServerVersion or "", "%d+.%d+")
if ServerVersion then
ServerVersion = tonumber(ServerVersion)
if tonumber(version) < ServerVersion then
AutoupdaterMsg("New version available"..ServerVersion)
AutoupdaterMsg("Updating, please don't press F9")
DownloadFile(UPDATE_URL, UPDATE_FILE_PATH, function () AutoupdaterMsg("Successfully updated. ("..version.." => "..ServerVersion.."), press F9 twice to load the updated version.") end)
else
AutoupdaterMsg("You have got the latest version ("..ServerVersion..")")
end
end
else
AutoupdaterMsg("Error downloading version info")
end
end
local scriptName = "PiNidalee"
local VP = nil
local Prodict = nil
local menu = nil
local target = nil
local SpellQ = {}
local SpellW = {}
local SpellE = {}
local PiSetUp = false
local QReady,WReady,EReady,RReady = nil,nil,nil,nil
local ignite, igniteReady = nil, false
function setupMenu()
menu = scriptConfig("PiNidalee", "PiNidalee")
menu:addSubMenu("Orbwalking", "orbwalking")
OW:LoadToMenu(menu.orbwalking)
menu:addSubMenu("Prediction","pred")
menu.pred:addParam("Prodiction","PROdiction",SCRIPT_PARAM_ONOFF, true)
menu:addSubMenu("Combo and Keybindings", "combo")
menu.combo:addParam("active","Combo active",SCRIPT_PARAM_ONKEYDOWN, false, 32)
menu.combo:addParam("jump","Jump",SCRIPT_PARAM_ONKEYDOWN, false, string.byte("Z"))
menu.combo:addParam("Heal","Heal",SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
menu.combo:addParam("sep", "", SCRIPT_PARAM_INFO, "")
menu.combo:addParam("useQ", "Use Q - Normal Form", SCRIPT_PARAM_ONOFF, true)
menu.combo:addParam("useQ2", "Use Q - Cougar Form", SCRIPT_PARAM_ONOFF, true)
menu.combo:addParam("useW", "Use W - Cougar Form", SCRIPT_PARAM_ONOFF, true)
menu.combo:addParam("useE", "Use E - Cougar Form", SCRIPT_PARAM_ONOFF, true)
menu:addSubMenu("Harass", "harass")
menu.harass:addParam("active", "Harass active" , SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
menu.harass:addParam("sep", "", SCRIPT_PARAM_INFO, "")
menu.harass:addParam("useQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
menu.harass:addParam("mana", "Don't harass if mana < %", SCRIPT_PARAM_SLICE, 0, 0, 100)
menu:addSubMenu("Heal","Heal")
menu.Heal:addParam("sep", "Mode Settings",SCRIPT_PARAM_INFO,"")
menu.Heal:addParam("HealA","Heal Mode",7,3,{ "HP MODE", "NEAR MOUSE", "PRIOTIZED MODE"})
menu.Heal:addParam("sep", "Priority Settings",SCRIPT_PARAM_INFO,"")
menu.Heal:addSubMenu("Ally Priority","Priority")
menu.Heal:addParam("Auto","Auto Heal",SCRIPT_PARAM_ONOFF,false)
menu.Heal:addParam("sep","Health & Mana Settings",SCRIPT_PARAM_INFO,"")
menu.Heal:addParam("AHealth","Minimum Health Percentage to Heal",4,60,0,100,0)
menu.Heal:addParam("AMana","Minimum Mana Percentage to Heal",4,60,0,100,0)
for i = 1, heroManager.iCount do
local hero = heroManager:GetHero(i)
if hero.team == myHero.team then
if hero == myHero then
menu.Heal.Priority:addParam(hero.charName,hero.charName,4,1,1,5,0)
else
menu.Heal.Priority:addParam(hero.charName,hero.charName,4,2,1,5,0)
end
end
end
menu:addSubMenu("Killsteal", "KS")
menu.KS:addParam("active", "Turn KS on", SCRIPT_PARAM_ONOFF, true)
menu.KS:addParam("sep", "", SCRIPT_PARAM_INFO, "")
menu.KS:addParam("useQ", "Use Q", SCRIPT_PARAM_ONOFF, true)
menu.KS:addParam("useIG", "Use IGNITE", SCRIPT_PARAM_ONOFF, true)
menu:addSubMenu("Smart Functions", "extra")
menu.extra:addParam("smart", "Smart changing of R", SCRIPT_PARAM_ONOFF, true)
menu:addSubMenu("Drawings", "Draw")
menu.Draw:addParam("DrawTarget", "Draw Target", SCRIPT_PARAM_ONOFF, true)
menu.Draw:addParam("DrawQ", "Draw Q", SCRIPT_PARAM_ONOFF, true)
menu.Draw:addParam("DrawW", "Draw W if Cougar", SCRIPT_PARAM_ONOFF, true)
menu.Draw:addParam("DrawE", "Draw E if Cougar", SCRIPT_PARAM_ONOFF, true)
menu.combo:permaShow("active")
menu.combo:permaShow("jump")
menu.combo:permaShow("Heal")
menu.combo:permaShow("useQ")
menu.combo:permaShow("useQ2")
menu.combo:permaShow("useW")
menu.combo:permaShow("useE")
menu.harass:permaShow("active")
menu.KS:permaShow("active")
menu.extra:permaShow("smart")
menu.Draw:permaShow("DrawTarget")
menu.Draw:permaShow("DrawQ")
menu.Draw:permaShow("DrawW")
menu.Draw:permaShow("DrawE")
end
function OnLoad()
PiSet()
end
function notisCougar()
if myHero:GetSpellData(_Q).name == "JavelinToss" then
SpellQ = {Speed = 1600, Range = 1250, Delay = 0.1, Width = 30}
SpellW = {Range = 900, Delay = 0.90}
SpellE = {Range = 600}
return true
elseif myHero:GetSpellData(_Q).name == "Takedown" then
SpellQ = {Range = 150}
SpellW = {Range = 450, Speed = math.huge, Delay = 0.275, Width = 200}
SpellE = {range = 150, Speed = math.huge, Delay = 0.25, Width = 250}
return false
end
end
function PiSet()
-- intializing Libs
VP = VPrediction()
OW = SOW(VP)
Prodict = ProdictManager.GetInstance()
-- Menu
setupMenu()
-- selfwritten functions
notisCougar()
ProFunc()
LoadCheck()
-- TS
ts = TargetSelector(TARGET_LESS_CAST_PRIORITY, SpellQ.Range, DAMAGE_MAGICAL)
ts.name = "Nidalee"
menu:addTS(ts)
-- Simple chat func by Pain thank you
printMessage = function(message) print("<font color=\"#00A300\"><b>"..scriptName.."</b></font> <font color=\"#FFFFFF\">"..message.."</font>") end
printMessage('PiNidalee ' .. tostring(version) .. ' loaded!')
-- end the setup
PiSetUp = true
end
function OnTick()
OW:EnableAttacks()
if PiSetUp then
target = ts.target
ts:update()
AddTickCallback(KS)
KillSteal()
friend = GrabAlly(SpellE.Range)
OW:ForceTarget(target)
notisCougar()
Checks()
if menu.harass.active then harass() end
if menu.combo.active then combo() end
if menu.combo.jump and not notisCougar() and WReady then
CastSpell(_W,mousePos.x,mousePos.z)
elseif menu.combo.jump and notisCougar() and RReady then
CastSpell(_R)
CastSpell(_W,mousePos.x,mousePos.z)
end
if notisCougar() and friend ~= nil then
if menu.Heal.Auto then
if (myHero.mana/myHero.maxMana * 100 > menu.Heal.AMana) and (friend.health/friend.maxHealth * 100 < menu.Heal.AHealth) then
CastSpell(_E,friend)
end
end
elseif menu.combo.Heal and notisCougar() then
CastSpell(_E,myHero)
end
end
end
function combo()
OW:DisableAttacks()
if not notisCougar() then OW:EnableAttacks() end
if notisCougar() and target and QReady and menu.combo.useQ then CastQ(target) end
if notisCougar() and not QReady and target and menu.extra.smart then
if target and GetDistance(target) <= 450 then
CastSpell(_R)
end
end
if not notisCougar() and target then
if menu.combo.useW and WReady then
CastW(target)
end
if menu.combo.useE and target and EReady then
CastE(target)
end
if menu.combo.useQ2 and target and QReady then
CastQ(target)
end
if not notisCougar() and not EReady and not QReady and not WReady and target and GetDistance(target) < 1250 and menu.extra.smart then
CastSpell(_R)
end
end
if not QReady and notisCougar() then OW:EnableAttacks() end
end
function harass()
if menu.harass.mana > (player.mana / player.maxMana) * 100 then return end
if notisCougar() and target and QReady and menu.harass.useQ then CastQ(target) end
end
function GrabAlly(range)
if menu.Heal.HealA == 1 then
return LowestAlly(range)
elseif menu.Heal.HealA == 2 then
return NearMouseAlly(range)
elseif menu.Heal.HealA == 3 then
return PrioritizedAlly(range)
end
end
function LowestAlly(range)
for i = 1, heroManager.iCount do
hero = heroManager:GetHero(i)
if hero.team == myHero.team and not hero.dead and GetDistance(myHero,hero) <= range then
if heroTarget == nil then
heroTarget = hero
elseif hero.health/hero.maxHealth < heroTarget.health/heroTarget.maxHealth then
heroTarget = hero
end
end
end
return heroTarget
end
function NearMouseAlly(range)
for i = 1, heroManager.iCount do
hero = heroManager:GetHero(i)
if heroTarget == nil then return end
if hero.team == myHero.team and not hero.dead and GetDistance(myHero,hero) <= range then
if heroTarget == nil then
heroTarget = hero
elseif GetDistance(myHero,hero) < GetDistance(myHero,heroTarget) then
heroTarget = hero
end
end
end
return heroTarget
end
function PrioritizedAlly(range)
for i = 1, heroManager.iCount do
hero = heroManager:GetHero(i)
if heroTarget == nil then return end
if hero.team == myHero.team and not hero.dead and GetDistance(myHero,hero) <= range then
if heroTarget == nil then
heroTarget = hero
elseif menu.Heal.Priority[hero.charName] < menu.Heal.Priority[heroTarget] then
heroTarget = hero
end
end
end
return heroTarget
end
function ProFunc()
for I = 1, heroManager.iCount do
local hero = heroManager:GetHero(I)
if hero.team ~= myHero.team then
Prodict:AddProdictionObject(_Q, SpellQ.Range, SpellQ.Speed, SpellQ.Delay, SpellQ.Width, myHero, CastQ):CanNotMissMode(true, hero)
end
end
end
function KillSteal()
if menu.KS.active then
local Enemies = GetEnemyHeroes()
for i, enemy in pairs(Enemies) do
if ValidTarget(enemy, 900) and not enemy.dead and GetDistance(enemy) < 900 and QReady or EReady then
if getDmg("Q", enemy, myHero) > enemy.health and GetDistance(enemy) < SpellQ.Range and menu.KS.useQ then
CastQ(enemy)
end
if getDmg("E", enemy, myHero) > enemy.health and GetDistance(enemy) < SpellE.Range and menu.KS.useE then
CastE(enemy)
end
end
end
end
IgniteKS()
end
function CastQ(Target)
if menu.pred.Prodiction and ValidTarget(Target,SpellQ.Range) then
local pos, info = Prodiction.GetPrediction(Target, SpellQ.Range, SpellQ.Speed, SpellQ.Delay, SpellQ.Width)
if pos and not info.mCollision() and notisCougar() then
CastSpell(_Q, pos.x, pos.z)
elseif pos and not notisCougar() then
CastSpell(_Q, pos.x, pos.z)
end
end
end
function CastW(Target)
if menu.pred.Prodiction and ValidTarget(Target,SpellW.Range) then
local pos, info = Prodiction.GetPrediction(Target, SpellW.Range, SpellW.Speed, SpellW.Delay, SpellW.Width)
if pos then
CastSpell(_W, pos.x, pos.z)
end
end
end
function CastE(Target)
if menu.pred.Prodiction and ValidTarget(Target,SpellE.Range) and not notisCougar() then
local pos, info = Prodiction.GetPrediction(Target, SpellE.Range, SpellE.Speed, SpellE.Delay, SpellE.Width)
if pos then
CastSpell(_E, pos.x, pos.z)
end
end
end
function IgniteKS()
if menu.KS.useIG then
if igniteReady then
local Enemies = GetEnemyHeroes()
for idx,val in ipairs(Enemies) do
if ValidTarget(val, 600) then
if getDmg("IGNITE", val, myHero) > val.health and GetDistance(val) <= 600 then
CastSpell(ignite, val)
end
end
end
end
end
end
function LoadCheck()
-- thanks to dieno
if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then
ignite = SUMMONER_1
elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then
ignite = SUMMONER_2
end
igniteReady = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
end
function Checks()
QReady = (myHero:CanUseSpell(_Q) == READY)
WReady = (myHero:CanUseSpell(_W) == READY)
EReady = (myHero:CanUseSpell(_E) == READY)
RReady = (myHero:CanUseSpell(_R) == READY)
end
function OnDraw()
if menu.Draw.DrawTarget then
if target ~= nil then
DrawCircle3D(target.x, target.y, target.z, VP:GetHitBox(target), 1, ARGB(255, 255, 0, 0))
end
end
if menu.Draw.DrawQ then
DrawCircle3D(myHero.x, myHero.y, myHero.z, SpellQ.Range, 1, ARGB(255, 0, 255, 255))
end
if menu.Draw.DrawW and not notisCougar() then
DrawCircle3D(myHero.x, myHero.y, myHero.z, SpellW.Range, 1, ARGB(255, 0, 255, 255))
end
if menu.Draw.DrawE and not notisCougar() then
DrawCircle3D(myHero.x, myHero.y, myHero.z, SpellE.Range, 1, ARGB(255, 0, 255, 255))
end
end