View difference between Paste ID: P95GaFYQ and AWm2JvmW
SHOW: | | - or go back to the newest paste.
1
--[[
2-
	Xin The Rapist
2+
	Xin The Rapist v1.1
3
		
4
		]]
5
if myHero.charName ~= "XinZhao" then return end
6
7-
require "AllClass"
7+
local mousemoving = true
8
local waitDelay = 400
9-
--[[		Code		]]
9+
10-
local mousemoving = true 
10+
11-
local movedelay = 0
11+
12-
local unitScanDelay = 0
12+
local chall = nil 
13-
local waitDelay = 300
13+
14
local range = 650
15-
local units = {}
15+
local AArange = 0
16-
local oldDelayTick = 0
16+
17-
local unitScanTick = 0
17+
18-
local holding = 0
18+
local swingDelay = (0.35 - (GetLatency()/1000))
19-
local animPlayedTick = nil
19+
20
21
local targetSelected = true	
22-
local lasthiton = true
22+
23
local ts
24
25
local ignite = nil
26
27-
local AArange = 325
27+
local YMGBSlot, TMATSlot, SotDSlot, BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot, ROSlot, ENTSlot, LOCKSlot = nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
28
local QREADY, WREADY, EREADY, RREADY, YMGBREADY, TMATREADY, SotDREADY, BRKREADY, DFGREADY, HXGREADY, BWCREADY, ROREADY, ENTREADY, LOCKREADY = false, false, false, false, false, false, false, false, false, false, false, false, false, false
29
30-
local swingDelay = 0.15
30+
31
  
32
	XINConfig= scriptConfig("Xin The Rapist v1.1", "xintherapistv1.1")
33-
-- Active
33+
34-
-- draw
34+
35
  XINConfig:addParam("Alt", "Alternate", SCRIPT_PARAM_ONKEYDOWN, false, 17)
36
	XINConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
37-
-- ts
37+
38
	XINConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
39-
--
39+
40
	XINConfig:permaShow("autoAAFarm")
41-
local BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil, nil
41+
42-
local QREADY, WREADY, EREADY, RREADY, BRKREADY, DFGREADY, HXGREADY, BWCREADY = false, false, false, false, false, false, false, false
42+
43
	XINConfig:addTS(ts)
44
  enemyMinions = minionManager(MINION_ENEMY, range+150, player, MINION_SORT_HEALTH_ASC)
45-
	XINConfig= scriptConfig("Xin The Rapist", "xintherapist")
45+
46
	elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end	
47
end
48-
	XINConfig:addParam("scriptActive2", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 67)	
48+
49
	function OnProcessSpell(unit, spell)
50
		if unit.isMe and (spell.name:find("Attack") ~= nil) then
51
			swing = 1
52
			lastBasicAttack = os.clock()
53
		end
54
	end
55
  
56
  function OnCreateObj(obj)
57
    if obj ~= nil and (obj.name:find("xen_ziou_intimidate") ~= nil) then
58
      chall = obj      
59
    end
60
  end
61
 
62
  function OnDeleteObj(obj)
63
    if obj ~= nil and (obj.name:find("xen_ziou_intimidate") ~= nil) then
64
      chall = nil 
65
    end
66
  end
67
68
69
70
function OnTick()
71
  
72
  AArange = (myHero.range + (GetDistance(myHero.minBBox, myHero.maxBBox)/2))
73
    
74
	if myHero.dead then
75
		return
76
	end
77
	
78-
	if ignite ~= nil and myHero:CanUseSpell(ignite) == READY then
78+
79-
		if IREADY then
79+
80-
			local ignitedmg = 0	
80+
81-
			for j = 1, heroManager.iCount, 1 do
81+
82-
				local enemyhero = heroManager:getHero(j)
82+
  ts:update()
83-
				if ValidTarget(enemyhero,600) then
83+
84-
					ignitedmg = 50 + 20 * myHero.level
84+
85-
					if enemyhero.health <= (ignitedmg - 50) then
85+
  --[[===================================== SPELLS!============================================]]--		
86-
						CastSpell(ignite, enemyhero)
86+
87-
					end
87+
88-
				end
88+
89
	EREADY = (myHero:CanUseSpell(_E) == READY)
90
	RREADY = (myHero:CanUseSpell(_R) == READY)
91
  IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
92
  
93-
	ts:update()
93+
  --[[===================================== ITEMS!=============================================]]--  
94
  
95-
	BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
95+
  YMGBSlot, TMATSlot, SotDSlot, BRKSlot, DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot, ROSlot, ENTSlot, LOCKSlot = GetInventorySlotItem(3142), GetInventorySlotItem(3077) or GetInventorySlotItem(3074) , GetInventorySlotItem(3131), GetInventorySlotItem(3153), GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100), GetInventorySlotItem(3143), GetInventorySlotItem(3184), GetInventorySlotItem(3190)
96
	
97
  DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
98
	HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
99
	BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
100-
	DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
100+
	TMATREADY = (TMATSlot ~= nil and myHero:CanUseSpell(TMATSlot) == READY)
101
  SotDREADY = (SotDSlot ~= nil and myHero:CanUseSpell(SotDSlot) == READY)
102
  YMGBREADY = (YMGBSlot ~= nil and myHero:CanUseSpell(YMGBSlot) == READY)
103-
	BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
103+
  ROREADY = (ROSlot ~= nil and myHero:CanUseSpell(ROSlot) == READY)
104-
	IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
104+
  ENTREADY = (ENTSlot ~= nil and myHero:CanUseSpell(ENTSlot) == READY)
105
  LOCKREADY = (LOCKSlot ~= nil and myHero:CanUseSpell(LOCKSlot) == READY)
106
  
107
  --[[=============================== Smart Ignite (See function.XinDmgCalculation towards the end of the script) ===============================]]--
108
  
109-
	if XINConfig.scriptActive and ts.target ~= nil then		
109+
  if (XINConfig.scriptActive or XINConfig.scriptActive1 or XINConfig.scriptActive2 or XINConfig.scriptActive3) and ts.target ~= nil and XINConfig.autoignite and IREADY then    
110
		local QWEDmg = XinDmgCalculation(ts.target)
111
		local IDmg = getDmg("IGNITE",ts.target,myHero)    
112
		if GetDistance(ts.target) < 600 and ts.target.health > QWEDmg and ts.target.health <= IDmg+QWEDmg then CastSpell(ignite, ts.target) end
113
	end
114-
				
114+
 
115-
		if swing == 0  then
115+
  --[[========================================================================================]]--  
116-
			if GetDistance(ts.target) < range then
116+
  --[[===================================== UltActive ========================================]]--
117
  --[[========================================================================================]]--
118
  
119-
			if EREADY and GetDistance(ts.target) < range then		
119+
  if RREADY and XINConfig.Alt == true then    
120-
				CastSpell(_E, ts.target)
120+
    for i = 1, heroManager.iCount, 1 do
121
      local hero = heroManager:getHero(i)
122-
	elseif swing == 1 then
122+
      if ValidTarget(hero) and GetDistance(hero) < 350 and hero.team ~= myHero.team then
123-
      if WREADY and GetDistance(ts.target) < AArange and not EREADY then
123+
        CastSpell(_R)        
124
      end
125
    end    
126
  end 
127
  
128-
				swing = 0							
128+
  --[[========================================================================================]]--  
129-
			end		
129+
  --[[===================================== scriptActive =====================================]]--
130
  --[[========================================================================================]]--
131
  
132
	if XINConfig.scriptActive and ts.target then
133
    
134-
	if XINConfig.scriptActive1 and ts.target ~= nil then				
134+
135
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
136
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
137
		if BRKREADY then CastSpell(BRKSlot, ts.target) end
138-
		if BRKREADY then CastSpell(BRKSlot, ts.target) end				
138+
    if ROREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(ROSlot) end
139-
		if swing == 0  then
139+
    if LOCKREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(LOCKSlot) end
140-
			if GetDistance(ts.target) < range then
140+
141
    if EREADY and (GetDistance(ts.target) < range and GetDistance(ts.target) > AArange) then
142
      myHero:Attack(ts.target)
143-
	elseif swing == 1 then
143+
			CastSpell(_E, ts.target)
144
		end         
145
		if swing == 0  then      
146
			if GetDistance(ts.target) < AArange + 250 then
147
        myHero:Attack(ts.target)
148
        if YMGBREADY and GetDistance(ts.target) > AArange then -- YMGB
149-
				swing = 0							
149+
          if ts.target.type == "obj_AI_Hero" then
150-
			end		
150+
            CastSpell(YMGBSlot)
151
          end
152
        end
153
      end
154
	  elseif swing == 1 then
155-
	if XINConfig.scriptActive2 and ts.target ~= nil then
155+
      if QREADY == false and QREADY == false and TMATREADY == false and os.clock() - lastBasicAttack > swingDelay then
156
        if ts.target ~= nil then
157
          swing = 0
158
          if AAmove == true then
159-
		if BRKREADY then CastSpell(BRKSlot, ts.target) end				
159+
            player:MoveTo(ts.target.x, ts.target.z)
160-
		if swing == 0  then
160+
          end
161-
			if GetDistance(ts.target) < range then
161+
          myHero:Attack(ts.target)        
162
        elseif ts.target == nil then
163
          swing = 0
164-
			if EREADY and GetDistance(ts.target) < range then		
164+
        end
165-
				CastSpell(_E, ts.target)
165+
166
      if WREADY and GetDistance(ts.target) < AArange then
167-
	elseif swing == 1 then
167+
168-
      if RREADY and os.clock() - lastBasicAttack > swingDelay then
168+
169
      if EREADY and GetDistance(ts.target) < range and os.clock() - lastBasicAttack > swingDelay then
170
        myHero:Attack(ts.target)
171-
  elseif WREADY and GetDistance(ts.target) < AArange and not RREADY then
171+
        CastSpell(_E, ts.target)
172
        swing = 0  
173
      end
174-
			if QREADY and not RREADY and os.clock() - lastBasicAttack > swingDelay then		
174+
175
				CastSpell(_Q) 
176-
				swing = 0							
176+
				swing = 0        
177-
			end		
177+
178
      if TMATREADY and GetDistance(ts.target) < 375 and QREADY == false and os.clock() - lastBasicAttack > swingDelay then
179-
	end	
179+
        CastSpell(TMATSlot)
180
        swing = 0
181
      end
182-
		if mousemoving and GetTickCount() > nextTick then
182+
      if YMGBREADY then -- YMGB
183-
			player:MoveTo(mousePos.x, mousePos.z)
183+
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
184
          CastSpell(YMGBSlot)
185-
						
185+
        end
186-
		local tick = GetTickCount()
186+
187-
		if lasthiton then
187+
      if ENTREADY then -- YMGB
188-
		unitScanTick = tick
188+
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
189-
			for i = 1, objManager.maxObjects, 1 do
189+
          CastSpell(ENTSlot)
190-
				local object = objManager:getObject(i)
190+
        end
191-
				if object ~= nil and object.team ~= player.team and object.type == "obj_AI_Minion" and string.find(object.charName,"Minion") then
191+
192-
					if not object.dead and GetDistance(object,player) <= (player.range + scanAdditionalRange) then
192+
      if SotDREADY then
193-
						if units[object.name] == nil then
193+
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
194-
							units[object.name] = { obj = object, markTick = 0 }
194+
          CastSpell(SotDSlot)
195-
						end
195+
        end
196-
					else
196+
      end      
197-
						units[object.name] = nil
197+
198-
					end
198+
  end
199-
				end
199+
200
	
201
  --[[========================================================================================]]--  
202-
		for i, unit in pairs(units) do
202+
  --[[===================================== scriptActive1 ====================================]]--
203-
			if unit.obj == nil or unit.obj.dead or GetDistance(player,unit.obj) > (player.range + scanAdditionalRange) then
203+
  --[[========================================================================================]]--	
204-
				units[i] = nil
204+
205-
			else
205+
  if XINConfig.scriptActive1 and ts.target then
206-
				if unit.obj.health <= (myHero:CalcDamage(unit.obj,myHero.totalDamage)) then -- 
206+
    
207-
					if lasthiton and GetTickCount() > nextTick then
207+
208-
						player:Attack(unit.obj) ---PrintChat("ATTACKING")
208+
209-
						nextTick = GetTickCount() + waitDelay	
209+
210-
						return
210+
211-
					end 
211+
    if ROREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(ROSlot) end
212-
				end
212+
    if LOCKREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(LOCKSlot) end    
213-
			end     
213+
    
214
    if EREADY and (GetDistance(ts.target) < range and GetDistance(ts.target) > AArange) then
215-
	end	
215+
      myHero:Attack(ts.target)
216
			CastSpell(_E, ts.target)
217
		end
218
    if swing == 0 then      
219
			if GetDistance(ts.target) < AArange + 250 then
220-
		if EREADY then DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x992D3D)end
220+
221
        if YMGBREADY and GetDistance(ts.target) > AArange then -- YMGB
222-
			for j=0, 10 do DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00) end
222+
          if ts.target.type == "obj_AI_Hero" then
223
            CastSpell(YMGBSlot)
224
          end
225-
	SC__OnDraw()
225+
        end
226
      end
227-
function OnWndMsg(msg,key)
227+
	  elseif swing == 1 then
228-
	SC__OnWndMsg(msg,key)
228+
      if QREADY == false and RREADY == false and QREADY == false and TMATREADY == false and os.clock() - lastBasicAttack > swingDelay then
229
        if ts.target ~= nil then
230
          swing = 0
231-
	TargetSelector__OnSendChat(msg)
231+
          if AAmove == true then
232
            player:MoveTo(ts.target.x, ts.target.z)
233
          end
234-
PrintChat(" >> Xin The Rapist loaded!")
234+
          myHero:Attack(ts.target)        
235
        elseif ts.target == nil then
236
          swing = 0
237
        end
238
      end
239
      if RREADY and GetDistance(ts.target) < 350 and chall ~= nil and chall.x == ts.target.x and chall.z == ts.target.z and os.clock() - lastBasicAttack > swingDelay then		
240
        CastSpell(_R)
241
        swing = 0  
242
      end
243
      if EREADY and RREADY == false and GetDistance(ts.target) < range and os.clock() - lastBasicAttack > swingDelay then
244
        myHero:Attack(ts.target)
245
        CastSpell(_E, ts.target)
246
        swing = 0  
247
      end
248
      if WREADY and GetDistance(ts.target) < AArange then
249
        CastSpell(_W)
250
      end      
251
			if QREADY and RREADY == false and os.clock() - lastBasicAttack > swingDelay then		
252
				CastSpell(_Q) 
253
				swing = 0        
254
			end
255
      if TMATREADY and GetDistance(ts.target) < 375 and QREADY == false and os.clock() - lastBasicAttack > swingDelay then
256
        CastSpell(TMATSlot)
257
        swing = 0
258
      end
259
      if YMGBREADY then -- YMGB
260
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
261
          CastSpell(YMGBSlot)
262
        end
263
      end
264
      if ENTREADY then -- YMGB
265
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
266
          CastSpell(ENTSlot)
267
        end
268
      end
269
      if SotDREADY then
270
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
271
          CastSpell(SotDSlot)
272
        end
273
      end 
274
		end
275
  end
276
277
  --[[========================================================================================]]--  
278
  --[[===================================== Autofarming ======================================]]--
279
  --[[========================================================================================]]--
280
  
281
	if XINConfig.autoAAFarm then
282
		enemyMinions:update()
283
    if mousemoving and GetTickCount() > nextTick then
284
      player:MoveTo(mousePos.x, mousePos.z)
285
    end						
286
    local tick = GetTickCount()
287
		for index, minion in pairs(enemyMinions.objects) do
288
      if minion and minion.dead == false then
289
        local myAA = getDmg("AD",minion,myHero)
290
        if minion and minion.health <= myAA and GetDistance(minion) <= (player.range + scanAdditionalRange) and GetTickCount() > nextTick then
291
          player:Attack(minion)
292
          nextTick = GetTickCount() + waitDelay
293
        end
294
			end
295
		end   
296
	end
297
	
298
end
299
300
function XinDmgCalculation(enemy)
301
  local hitdamage = getDmg("AD",enemy,myHero)
302
	local qdamage = getDmg("Q",enemy,myHero)*3
303
	local edamage = getDmg("E",enemy,myHero)
304
  local rdamage = getDmg("R",enemy,myHero)
305
	local combo5 = 0
306
  if GetDistance(enemy) < AArange + 100 then
307
    combo5 = hitdamage    
308
  end
309
	if QREADY and GetDistance(enemy) < AArange + 100 then
310
		combo5 = combo5 + qdamage + (hitdamage*2)
311
	end
312
	if EREADY and GetDistance(enemy) < range then
313
		combo5 = combo5 + edamage
314
	end
315
	return combo5
316
end
317
318
function OnDraw()
319
	if XINConfig.drawcircles and not myHero.dead then
320
    if EREADY then DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x992D3D) end
321
		if ts.target ~= nil then
322
			for j=0, 1 do DrawCircle(ts.target.x, ts.target.y, ts.target.z, (GetDistance(ts.target.minBBox, ts.target.maxBBox)/2) + j*1, 0x00FF00) end
323
		end
324
	end
325
end
326
function OnSendChat(msg)
327
	ts:OnSendChat(msg, "pri")
328
end
329
PrintChat(" >> Xin The Rapist v1.1 loaded!")