View difference between Paste ID: hQQDp3uC and NWXQurDj
SHOW: | | - or go back to the newest paste.
1
--[[
2
	Nidalee the Rapist
3
]]
4
if myHero.charName ~= "Nidalee" then return end
5
6
require "AllClass"
7
 
8
--[[		Code		]]
9
local mousemoving = true 
10
local movedelay = 0
11
local unitScanDelay = 0
12
local waitDelay = 300
13
local scanAdditionalRange = 500
14
local units = {}
15
local oldDelayTick = 0
16
local unitScanTick = 0
17
local holding = 0
18
local animPlayedTick = nil
19
local nextTick = 0
20
21
local AxePos = nil
22
23
local lasthiton = true
24
25
local lastdirection = 0
26
27
local range = 1400
28
29
local wrange = 1000
30
31
local AArange = 275
32
local lastBasicAttack = 0
33
local swingDelay = 0.1
34
local rangedSwingDelay = 0.05
35
local swing = 0
36
local tick = nil
37
-- Active
38
-- draw
39
40
local targetSelected = true	
41
-- ts
42
local ts
43
--
44
local ignite = nil
45
local BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil, nil
46
local QREADY, WREADY, EREADY, RREADY, BRKREADY, DFGREADY, HXGREADY, BWCREADY = false, false, false, false, false, false, false, false
47
48
function OnLoad()
49
	NIDConfig= scriptConfig("Nidalee the Rapist", "nidaleetherapist")
50
	NIDConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
51
	NIDConfig:addParam("scriptActive1", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 67)	
52
  NIDConfig:addParam("scriptActive2", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 88)
53
	NIDConfig:addParam("harass", "Harass", SCRIPT_PARAM_ONKEYDOWN, false, 84)
54
  NIDConfig:addParam("DASH", "Dash", SCRIPT_PARAM_ONKEYDOWN, false, 90)
55
	NIDConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
56
	NIDConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
57
	NIDConfig:addParam("drawprediction", "Draw Prediction", SCRIPT_PARAM_ONOFF, false)
58
	NIDConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
59
	NIDConfig:addParam("autoAAFarm", "Auto Farm", SCRIPT_PARAM_ONKEYDOWN, false, 192)
60
  NIDConfig:permaShow("autoAAFarm")
61
	ts = TargetSelector(TARGET_LOW_HP,range+250,DAMAGE_MAGIC)
62
	ts.name = "Nidalee"
63
	NIDConfig:addTS(ts)
64
	if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
65
	elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end	
66
end
67
68
69
70
	function OnProcessSpell(unit, spell)
71
		if unit.isMe and (spell.name:find("Attack") ~= nil) then
72
			swing = 1
73
			lastBasicAttack = os.clock()
74
		end
75
	end
76
77
78
79
function OnTick()
80
  
81
  ts:update()
82
	if myHero.dead then
83
		return
84
	end
85
  
86
  
87
    
88
  if myHero:GetSpellData(_Q).name == "JavelinToss" or myHero:GetSpellData(_W).name == "Bushwhack" or myHero:GetSpellData(_E).name == "PrimalSurge" then
89
    HUMAN = true
90
    COUGAR = false
91
	end
92
  
93
  if myHero:GetSpellData(_Q).name == "Takedown" or myHero:GetSpellData(_W).name == "Pounce" or myHero:GetSpellData(_E).name == "Swipe" then
94
    COUGAR = true
95
    HUMAN = false
96
	end
97
	
98
	if swing == 1 and os.clock() > lastBasicAttack + 0.5 then
99
		swing = 0
100
	end
101
102
	if ignite ~= nil and myHero:CanUseSpell(ignite) == READY then
103
		if IREADY then
104
			local ignitedmg = 0	
105
			for j = 1, heroManager.iCount, 1 do
106
				local enemyhero = heroManager:getHero(j)
107
				if ValidTarget(enemyhero,600) then
108
					ignitedmg = 50 + 20 * myHero.level
109
					if enemyhero.health <= (ignitedmg - 50) then
110
						CastSpell(ignite, enemyhero)
111
					end
112
				end
113
			end
114
		end
115
	end
116
117
	BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
118
	QREADY = (myHero:CanUseSpell(_Q) == READY)
119
	WREADY = (myHero:CanUseSpell(_W) == READY)
120
	EREADY = (myHero:CanUseSpell(_E) == READY)
121
	RREADY = (myHero:CanUseSpell(_R) == READY)
122
	DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
123
	HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
124
	BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
125
	BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
126
	IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
127
128
129
---------------------------------------------------------------- Combos Etc---------------------------------------------------------------------------------
130
	if ts.target == nil then
131
    ts:update()
132
  end
133
  
134
  if ts.target ~= nil then
135
    Prediction__OnTick()
136
  end
137
138
	if NIDConfig.harass and ts.target ~= nil then
139
    if HUMAN and not COUGAR then	
140
      if QREADY then
141
        QtravelDuration = (GetDistance(myHero, ts.nextPosition) / 1.2) + 290
142
        ts:SetPrediction(QtravelDuration)  
143
        if GetDistance(ts.target)<range and GetDistance(ts.nextPosition) < range and not GetMinionCollision(myHero,ts.nextPosition, 150) then
144
          CastSpell(_Q, ts.nextPosition.x, ts.nextPosition.z)
145
        end
146
      end
147
    end
148
    if COUGAR and not HUMAN then
149
      CastSpell(_R)
150
    end
151-
		Prediction__OnTick()
151+
152
 
153
154
 
155
  if HUMAN and NIDConfig.scriptActive and ts.target ~= nil and not COUGAR then
156
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
157
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
158
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
159
		if BRKREADY then CastSpell(BRKSlot, ts.target) end
160
		if QREADY then
161
      QtravelDuration = (GetDistance(myHero, ts.nextPosition) / 1.2) + 270
162
      ts:SetPrediction(QtravelDuration)  
163
      if HUMAN and GetDistance(ts.target) < range and GetDistance(ts.nextPosition) < range and not GetMinionCollision(myHero,ts.nextPosition, 150) then
164
        CastSpell(_Q, ts.nextPosition.x, ts.nextPosition.z)
165
      end
166
    end		
167
		if swing == 0  then
168
			if GetDistance(ts.target) < AArange then
169
        myHero:Attack(ts.target)
170
      end
171
    end
172
  end
173
  
174
  
175
  
176
  if COUGAR and NIDConfig.scriptActive and ts.target ~= nil and not HUMAN then			
177
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
178
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
179
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
180
		if BRKREADY then CastSpell(BRKSlot, ts.target) end		
181
    if swing == 0 then
182
      if GetDistance(ts.target) < myHero.range + 300 then
183
        myHero:Attack(ts.target)
184
      end      
185
			if WREADY and GetDistance(ts.target) < myHero.range + 300 then				
186
				myHero:Attack(ts.target)
187
				if GetTickCount()-lastdirection >= 500 then
188
					local absposxy = math.min(math.abs(ts.target.x-myHero.x),math.abs(ts.target.y-myHero.y))
189
					myHero:MoveTo(myHero.x+(ts.target.x-myHero.x)*100/absposxy,myHero.z+(ts.target.z-myHero.z)*100/absposxy)
190
					lastdirection = GetTickCount()
191
        elseif GetTickCount()-lastdirection >= 100 then
192
					CastSpell(_W, ts.target.x,ts.target.z)
193
				end				
194
			end      
195
    elseif swing == 1 then
196
      if EREADY and GetDistance(ts.target) < myHero.range + 200 and os.clock() - lastBasicAttack > swingDelay then				
197
        if GetTickCount()-lastdirection >= 500 then
198
          local absposxy = math.min(math.abs(ts.target.x-myHero.x),math.abs(ts.target.y-myHero.y))
199
          myHero:MoveTo(myHero.x+(ts.target.x-myHero.x)*100/absposxy,myHero.z+(ts.target.z-myHero.z)*100/absposxy)
200
          lastdirection = GetTickCount()
201
        elseif GetTickCount()-lastdirection >= 100 then
202
          CastSpell(_E, ts.target.x,ts.target.z)
203
          swing = 0
204
        end
205
      elseif QREADY and not EREADY and os.clock() - lastBasicAttack > swingDelay then
206
        CastSpell(_Q)
207
        swing = 0			
208
      end
209
    end
210
  end
211
  
212
  
213
  
214
  if HUMAN and NIDConfig.scriptActive1 and ts.target ~= nil and not COUGAR then			
215
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
216
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
217
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
218
		if BRKREADY then CastSpell(BRKSlot, ts.target) end		
219
		if swing == 0  then
220
			if GetDistance(ts.target) < AArange then
221
        myHero:Attack(ts.target)
222
      end
223
    elseif swing == 1 then
224
      if EREADY and os.clock() - lastBasicAttack > rangedSwingDelay then
225
				CastSpell(_E, myHero)
226
				swing = 0
227
			end		   
228
    end
229
  end
230
  
231
  
232
  
233
  if COUGAR and NIDConfig.scriptActive1 and ts.target ~= nil and not HUMAN then		
234
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
235
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
236
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
237
		if BRKREADY then CastSpell(BRKSlot, ts.target) end		
238
    if swing == 0 then
239
      if GetDistance(ts.target) < myHero.range + 300 then
240
        myHero:Attack(ts.target)
241
      end
242
    elseif swing == 1 then
243
      if EREADY and GetDistance(ts.target) < myHero.range + 200 and os.clock() - lastBasicAttack > swingDelay then			
244
        if GetTickCount()-lastdirection >= 500 then
245
          local absposxy = math.min(math.abs(ts.target.x-myHero.x),math.abs(ts.target.y-myHero.y))
246
          myHero:MoveTo(myHero.x+(ts.target.x-myHero.x)*100/absposxy,myHero.z+(ts.target.z-myHero.z)*100/absposxy)
247
          lastdirection = GetTickCount()
248
        elseif GetTickCount()-lastdirection >= 100 then
249
          CastSpell(_E, ts.target.x,ts.target.z)
250
          swing = 0
251
        end	
252
      elseif QREADY and not EREADY and os.clock() - lastBasicAttack > swingDelay then
253
        CastSpell(_Q)
254
        swing = 0			
255
      end
256
    end
257-
  if HUMAN and NIDConfig.scriptActive2 and not COUGAR then    
257+
258-
    if ts.target ~= nil then
258+
259-
      Prediction__OnTick()
259+
260
  
261
  if NIDConfig.scriptActive2 then
262
    if COUGAR and ts.target ~= nil and not HUMAN then
263-
      if BRKREADY then CastSpell(BRKSlot, ts.target) end
263+
264-
      if WREADY then
264+
265-
        WtravelDuration = 270+350
265+
266-
        ts:SetPrediction(WtravelDuration)   
266+
      if BRKREADY then CastSpell(BRKSlot, ts.target) end		
267-
        if GetDistance(ts.target) < wrange and GetDistance(ts.nextPosition) < wrange then
267+
      if swing == 0 then
268-
          CastSpell(_W, ts.nextPosition.x, ts.nextPosition.z)
268+
        if GetDistance(ts.target) < myHero.range + 300 then
269
          myHero:Attack(ts.target)
270-
      end		
270+
        end      
271-
      if swing == 0  then
271+
        if WREADY and GetDistance(ts.target) < myHero.range + 300 then				
272-
        if GetDistance(ts.target) < myHero.range + 200 then
272+
273
          if GetTickCount()-lastdirection >= 500 then
274
            local absposxy = math.min(math.abs(ts.target.x-myHero.x),math.abs(ts.target.y-myHero.y))
275
            myHero:MoveTo(myHero.x+(ts.target.x-myHero.x)*100/absposxy,myHero.z+(ts.target.z-myHero.z)*100/absposxy)
276-
        if EREADY and os.clock() - lastBasicAttack > rangedSwingDelay then
276+
            lastdirection = GetTickCount()
277-
          CastSpell(_E, myHero)
277+
          elseif GetTickCount()-lastdirection >= 100 then
278
            CastSpell(_W, ts.target.x,ts.target.z)
279-
        end		   
279+
          end				
280
        end      
281-
    elseif ts.target == nil then
281+
282-
      if WREADY then
282+
        if EREADY and GetDistance(ts.target) < myHero.range + 200 and os.clock() - lastBasicAttack > swingDelay then				
283-
        CastSpell(_W,mousePos.x,mousePos.z)
283+
          if GetTickCount()-lastdirection >= 500 then
284
            local absposxy = math.min(math.abs(ts.target.x-myHero.x),math.abs(ts.target.y-myHero.y))
285
            myHero:MoveTo(myHero.x+(ts.target.x-myHero.x)*100/absposxy,myHero.z+(ts.target.z-myHero.z)*100/absposxy)
286
            lastdirection = GetTickCount()
287
          elseif GetTickCount()-lastdirection >= 100 then
288
            CastSpell(_E, ts.target.x,ts.target.z)
289
            swing = 0
290-
  if COUGAR and NIDConfig.scriptActive2 and not HUMAN then		
290+
          end
291
        elseif QREADY and not EREADY and os.clock() - lastBasicAttack > swingDelay then
292
          CastSpell(_Q)
293
          swing = 0			
294
        end
295-
    if swing == 0 then   
295+
296-
			if WREADY then				
296+
297
    if HUMAN and not COUGAR then
298
				CastSpell(_E)
299
        CastSpell(_R)
300
		end
301
  end
302
  
303
  
304
  
305-
    elseif swing == 1 then      
305+
306-
      if EREADY and os.clock() - lastBasicAttack > swingDelay then				
306+
307
		if COUGAR and not HUMAN then
308
			if WREADY then
309
        if GetTickCount()-lastdirection >= 500 then
310
          local absposxy = math.min(math.abs(mousePos.x-myHero.x),math.abs(mousePos.y-myHero.y))
311
          myHero:MoveTo(myHero.x+(mousePos.x-myHero.x)*100/absposxy,myHero.z+(mousePos.z-myHero.z)*100/absposxy)
312-
          CastSpell(_E)
312+
313
        elseif GetTickCount()-lastdirection >= 100 then
314
          CastSpell(_W)
315
        end
316
      end
317
    end
318
		if HUMAN and not COUGAR then
319
				CastSpell(_R)
320
		end	
321
	end
322
  
323
  
324
325
	if NIDConfig.autoAAFarm then
326
		if mousemoving and GetTickCount() > nextTick then
327
			player:MoveTo(mousePos.x, mousePos.z)
328
		end
329
						
330
		local tick = GetTickCount()
331
		if lasthiton then
332
		unitScanTick = tick
333
			for i = 1, objManager.maxObjects, 1 do
334
				local object = objManager:getObject(i)
335
				if object ~= nil and object.team ~= player.team and object.type == "obj_AI_Minion" and string.find(object.charName,"Minion") then
336
					if not object.dead and GetDistance(object,player) <= (player.range + scanAdditionalRange) then
337
						if units[object.name] == nil then
338
							units[object.name] = { obj = object, markTick = 0 }
339
						end
340
					else
341
						units[object.name] = nil
342
					end
343
				end
344
			end
345
		end
346
		for i, unit in pairs(units) do
347
			if unit.obj == nil or unit.obj.dead or GetDistance(player,unit.obj) > (player.range + scanAdditionalRange) then
348
				units[i] = nil
349
			else
350
				if unit.obj.health <= (myHero:CalcDamage(unit.obj,myHero.totalDamage)) then -- 
351
					if lasthiton and GetTickCount() > nextTick then
352
						player:Attack(unit.obj) ---PrintChat("ATTACKING")
353
						nextTick = GetTickCount() + waitDelay	
354
						return
355
					end 
356
				end
357
			end     
358
		end
359
	end	
360
	
361
end
362
function OnDraw()
363
	if NIDConfig.drawcircles and not myHero.dead then
364
    if HUMAN and not COUGAR then
365
      DrawCircle(myHero.x, myHero.y, myHero.z, myHero.range+150, 0x992D3D)
366
      if QREADY then DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x992D3D)end
367
      if WREADY then DrawCircle(myHero.x, myHero.y, myHero.z, wrange, 0xFFFFFF)end
368
    end
369
    if COUGAR and not HUMAN then
370
      DrawCircle(myHero.x, myHero.y, myHero.z, myHero.range+150, 0x992D3D)
371
      if WREADY then DrawCircle(myHero.x, myHero.y, myHero.z, myHero.range+300, 0xFFFFFF)end
372
    end
373
		if ts.target ~= nil then
374
			for j=0, 10 do DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00) end
375
		end
376
	end  
377
	if ts.target ~= nil and NIDConfig.drawprediction then
378
		DrawCircle(ts.nextPosition.x, ts.target.y, ts.nextPosition.z, 200, 0x0000FF)
379
	end
380
	SC__OnDraw()
381
end
382
function OnWndMsg(msg,key)
383
	SC__OnWndMsg(msg,key)
384
end
385
function OnSendChat(msg)
386
	TargetSelector__OnSendChat(msg)
387
	ts:OnSendChat(msg, "pri")
388
end
389
PrintChat(" >> Nidalee the Rapist!")