View difference between Paste ID: G2byisQw and awgHedMW
SHOW: | | - or go back to the newest paste.
1
--[[
2
	Xin The Rapist v1.1
3
		
4
		]]
5
if myHero.charName ~= "XinZhao" then return end
6
7
local mousemoving = true
8
local waitDelay = 400
9
local scanAdditionalRange = 500
10
local nextTick = 0
11
12
local chall = nil 
13
14
local range = 650
15
local AArange = 0
16
17
local lastBasicAttack = 0
18
local swingDelay = (0.35 - (GetLatency()/1000))
19
local swing = 0
20
21
local targetSelected = true	
22
23
local ts
24
25
local ignite = nil
26
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
function OnLoad()
31
  
32
	XINConfig= scriptConfig("Xin The Rapist v1.1", "xintherapistv1.1")
33
	XINConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 88)
34
	XINConfig:addParam("scriptActive1", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 90)
35
  XINConfig:addParam("Alt", "Alternate", SCRIPT_PARAM_ONKEYDOWN, false, 17)
36
	XINConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
37
	XINConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
38
	XINConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
39
	XINConfig:addParam("autoAAFarm", "Auto Farm", SCRIPT_PARAM_ONKEYDOWN, false, 192)
40
	XINConfig:permaShow("autoAAFarm")
41
	ts = TargetSelector(TARGET_LOW_HP,range+150,DAMAGE_PHYSICAL)
42
	ts.name = XinZhao
43
	XINConfig:addTS(ts)
44
  enemyMinions = minionManager(MINION_ENEMY, range+150, player, MINION_SORT_HEALTH_ASC)
45
	if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
46
	elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end	
47
end
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 swing == 1 and os.clock() > lastBasicAttack + 0.5 then
79
		swing = 0
80
	end
81
  
82
  ts:update()
83
  
84
  
85
  --[[===================================== SPELLS!============================================]]--		
86
	
87
	QREADY = (myHero:CanUseSpell(_Q) == READY)
88
	WREADY = (myHero:CanUseSpell(_W) == READY)
89
	EREADY = (myHero:CanUseSpell(_E) == READY)
90
	RREADY = (myHero:CanUseSpell(_R) == READY)
91
  IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
92
  
93
  --[[===================================== ITEMS!=============================================]]--  
94
  
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
  BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
101
	TMATREADY = (TMATSlot ~= nil and myHero:CanUseSpell(TMATSlot) == READY)
102
  SotDREADY = (SotDSlot ~= nil and myHero:CanUseSpell(SotDSlot) == READY)
103
  YMGBREADY = (YMGBSlot ~= nil and myHero:CanUseSpell(YMGBSlot) == READY)
104
  ROREADY = (ROSlot ~= nil and myHero:CanUseSpell(ROSlot) == READY)
105
  ENTREADY = (ENTSlot ~= nil and myHero:CanUseSpell(ENTSlot) == READY)
106
  LOCKREADY = (LOCKSlot ~= nil and myHero:CanUseSpell(LOCKSlot) == READY)
107
  
108
  --[[=============================== Smart Ignite (See function.XinDmgCalculation towards the end of the script) ===============================]]--
109
  
110
  if (XINConfig.scriptActive or XINConfig.scriptActive1 or XINConfig.scriptActive2 or XINConfig.scriptActive3) and ts.target ~= nil and XINConfig.autoignite and IREADY then    
111
		local QWEDmg = XinDmgCalculation(ts.target)
112
		local IDmg = getDmg("IGNITE",ts.target,myHero)    
113
		if GetDistance(ts.target) < 600 and ts.target.health > QWEDmg and ts.target.health <= IDmg+QWEDmg then CastSpell(ignite, ts.target) end
114
	end
115
 
116
  --[[========================================================================================]]--  
117
  --[[===================================== UltActive ========================================]]--
118
  --[[========================================================================================]]--
119
  
120
  if RREADY and XINConfig.Alt == true then    
121
    for i = 1, heroManager.iCount, 1 do
122
      local hero = heroManager:getHero(i)
123
      if ValidTarget(hero) and GetDistance(hero) < 450 and hero.team ~= myHero.team then
124
        CastSpell(_R)        
125
      end
126
    end    
127
  end 
128
  
129
  --[[========================================================================================]]--  
130
  --[[===================================== scriptActive =====================================]]--
131
  --[[========================================================================================]]--
132
  
133
	if XINConfig.scriptActive and ts.target then
134
    
135
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
136
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
137
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
138
		if BRKREADY then CastSpell(BRKSlot, ts.target) end
139
    if ROREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(ROSlot) end
140
    if LOCKREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(LOCKSlot) end
141
		
142
    if EREADY and (GetDistance(ts.target) < range and GetDistance(ts.target) > AArange - 75) then
143
      myHero:Attack(ts.target)
144
			CastSpell(_E, ts.target)
145
		end         
146
		if swing == 0  then      
147
			if GetDistance(ts.target) < AArange + 250 then
148
        myHero:Attack(ts.target)
149
        if YMGBREADY and GetDistance(ts.target) > AArange then -- YMGB
150
          if ts.target.type == "obj_AI_Hero" then
151
            CastSpell(YMGBSlot)
152
          end
153
        end
154
      end
155
	  elseif swing == 1 then
156
      if QREADY == false and QREADY == false and TMATREADY == false and os.clock() - lastBasicAttack > swingDelay then
157
        if ts.target ~= nil then
158
          swing = 0
159
          if AAmove == true then
160
            player:MoveTo(ts.target.x, ts.target.z)
161
          end
162
          myHero:Attack(ts.target)        
163
        elseif ts.target == nil then
164
          swing = 0
165
        end
166
      end
167
      if WREADY and GetDistance(ts.target) < AArange then
168
        CastSpell(_W)
169
      end
170
      if EREADY and GetDistance(ts.target) < range and os.clock() - lastBasicAttack > swingDelay then
171
        myHero:Attack(ts.target)
172
        CastSpell(_E, ts.target)
173
        swing = 0  
174
      end
175
			if QREADY and os.clock() - lastBasicAttack > swingDelay then		
176
				CastSpell(_Q) 
177
				swing = 0        
178
			end
179
      if TMATREADY and GetDistance(ts.target) < 375 and QREADY == false and os.clock() - lastBasicAttack > swingDelay then
180
        CastSpell(TMATSlot)
181
        swing = 0
182
      end
183
      if YMGBREADY then -- YMGB
184
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
185
          CastSpell(YMGBSlot)
186
        end
187
      end
188
      if ENTREADY then -- YMGB
189
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
190
          CastSpell(ENTSlot)
191
        end
192
      end
193
      if SotDREADY then
194
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
195
          CastSpell(SotDSlot)
196
        end
197
      end      
198
		end
199
  end
200
  
201
	
202
  --[[========================================================================================]]--  
203
  --[[===================================== scriptActive1 ====================================]]--
204
  --[[========================================================================================]]--	
205
206
  if XINConfig.scriptActive1 and ts.target then
207
    
208
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
209
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
210
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
211
		if BRKREADY then CastSpell(BRKSlot, ts.target) end
212
    if ROREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(ROSlot) end
213
    if LOCKREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(LOCKSlot) end    
214
    
215
    if EREADY and (GetDistance(ts.target) < range and GetDistance(ts.target) > AArange - 75) then
216
      myHero:Attack(ts.target)
217
			CastSpell(_E, ts.target)
218
		end
219
    if swing == 0 then      
220
			if GetDistance(ts.target) < AArange + 250 then
221
        myHero:Attack(ts.target)
222
        if YMGBREADY and GetDistance(ts.target) > AArange then -- YMGB
223
          if ts.target.type == "obj_AI_Hero" then
224
            CastSpell(YMGBSlot)
225
          end
226
        end
227
      end
228
	  elseif swing == 1 then
229
      if QREADY == false and RREADY == false and QREADY == false and TMATREADY == false and os.clock() - lastBasicAttack > swingDelay then
230
        if ts.target ~= nil then
231
          swing = 0
232
          if AAmove == true then
233
            player:MoveTo(ts.target.x, ts.target.z)
234
          end
235
          myHero:Attack(ts.target)        
236
        elseif ts.target == nil then
237
          swing = 0
238
        end
239
      end
240
      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		
241
        CastSpell(_R)
242
        swing = 0  
243
      end
244
      if EREADY and RREADY == false and GetDistance(ts.target) < range and os.clock() - lastBasicAttack > swingDelay then
245
        myHero:Attack(ts.target)
246
        CastSpell(_E, ts.target)
247
        swing = 0  
248
      end
249
      if WREADY and GetDistance(ts.target) < AArange then
250
        CastSpell(_W)
251
      end      
252
			if QREADY and RREADY == false and os.clock() - lastBasicAttack > swingDelay then		
253
				CastSpell(_Q) 
254
				swing = 0        
255
			end
256
      if TMATREADY and GetDistance(ts.target) < 375 and QREADY == false and os.clock() - lastBasicAttack > swingDelay then
257
        CastSpell(TMATSlot)
258
        swing = 0
259
      end
260
      if YMGBREADY then -- YMGB
261
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
262
          CastSpell(YMGBSlot)
263
        end
264
      end
265
      if ENTREADY then -- YMGB
266
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
267
          CastSpell(ENTSlot)
268
        end
269
      end
270
      if SotDREADY then
271
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
272
          CastSpell(SotDSlot)
273
        end
274
      end 
275
		end
276
  end
277
278
  --[[========================================================================================]]--  
279
  --[[===================================== Autofarming ======================================]]--
280
  --[[========================================================================================]]--
281
  
282
	if XINConfig.autoAAFarm then
283
		enemyMinions:update()
284
    if mousemoving and GetTickCount() > nextTick then
285
      player:MoveTo(mousePos.x, mousePos.z)
286
    end						
287
    local tick = GetTickCount()
288
		for index, minion in pairs(enemyMinions.objects) do
289
      if minion and minion.dead == false then
290
        local myAA = getDmg("AD",minion,myHero)
291
        if minion and minion.health <= myAA and GetDistance(minion) <= (player.range + scanAdditionalRange) and GetTickCount() > nextTick then
292
          player:Attack(minion)
293
          nextTick = GetTickCount() + waitDelay
294
        end
295
			end
296
		end   
297
	end
298
	
299
end
300
301
function XinDmgCalculation(enemy)
302
  local hitdamage = getDmg("AD",enemy,myHero)
303
	local qdamage = getDmg("Q",enemy,myHero)*3
304
	local edamage = getDmg("E",enemy,myHero)
305
  local rdamage = getDmg("R",enemy,myHero)
306
	local combo5 = 0
307
  if GetDistance(enemy) < AArange + 100 then
308
    combo5 = hitdamage    
309
  end
310
	if QREADY and GetDistance(enemy) < AArange + 100 then
311
		combo5 = combo5 + qdamage + (hitdamage*2)
312
	end
313
	if EREADY and GetDistance(enemy) < range then
314
		combo5 = combo5 + edamage
315
	end
316
	return combo5
317
end
318
319
function OnDraw()
320
	if XINConfig.drawcircles and not myHero.dead then
321
    if EREADY then DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x992D3D) end
322
    if RREADY then DrawCircle(myHero.x, myHero.y, myHero.z, 450, 0x992D3D) end
323
		if ts.target ~= nil then
324
			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
325
		end
326
	end
327
end
328
function OnSendChat(msg)
329
	ts:OnSendChat(msg, "pri")
330
end
331
PrintChat(" >> Xin The Rapist v1.1 loaded!")