View difference between Paste ID: 4Afxp9ar and P95GaFYQ
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
	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
  ROREADY = (ROSlot ~= nil and myHero:CanUseSpell(ROSlot) == 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 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
 
115
  --[[========================================================================================]]--  
116
  --[[===================================== UltActive ========================================]]--
117
  --[[========================================================================================]]--
118
  
119
  if RREADY and XINConfig.Alt == true then    
120
    for i = 1, heroManager.iCount, 1 do
121
      local hero = heroManager:getHero(i)
122-
      if ValidTarget(hero) and GetDistance(hero) < 350 and hero.team ~= myHero.team then
122+
      if ValidTarget(hero) and GetDistance(hero) < 450 and hero.team ~= myHero.team then
123
        CastSpell(_R)        
124
      end
125
    end    
126
  end 
127
  
128
  --[[========================================================================================]]--  
129
  --[[===================================== scriptActive =====================================]]--
130
  --[[========================================================================================]]--
131
  
132
	if XINConfig.scriptActive and ts.target then
133
    
134
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
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 ROREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(ROSlot) end
139
    if LOCKREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(LOCKSlot) end
140
		
141
    if EREADY and (GetDistance(ts.target) < range and GetDistance(ts.target) > AArange) then
142
      myHero:Attack(ts.target)
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
          if ts.target.type == "obj_AI_Hero" then
150
            CastSpell(YMGBSlot)
151
          end
152
        end
153
      end
154
	  elseif swing == 1 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
            player:MoveTo(ts.target.x, ts.target.z)
160
          end
161
          myHero:Attack(ts.target)        
162
        elseif ts.target == nil then
163
          swing = 0
164
        end
165
      end
166
      if WREADY and GetDistance(ts.target) < AArange then
167
        CastSpell(_W)
168
      end
169
      if EREADY and GetDistance(ts.target) < range and os.clock() - lastBasicAttack > swingDelay then
170
        myHero:Attack(ts.target)
171
        CastSpell(_E, ts.target)
172
        swing = 0  
173
      end
174
			if QREADY and os.clock() - lastBasicAttack > swingDelay then		
175
				CastSpell(_Q) 
176
				swing = 0        
177
			end
178
      if TMATREADY and GetDistance(ts.target) < 375 and QREADY == false and os.clock() - lastBasicAttack > swingDelay then
179
        CastSpell(TMATSlot)
180
        swing = 0
181
      end
182
      if YMGBREADY then -- YMGB
183
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
184
          CastSpell(YMGBSlot)
185
        end
186
      end
187
      if ENTREADY then -- YMGB
188
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
189
          CastSpell(ENTSlot)
190
        end
191
      end
192
      if SotDREADY then
193
        if ts.target.type == "obj_AI_Hero" and GetDistance(ts.target) < 400 then
194
          CastSpell(SotDSlot)
195
        end
196
      end      
197
		end
198
  end
199
  
200
	
201
  --[[========================================================================================]]--  
202
  --[[===================================== scriptActive1 ====================================]]--
203
  --[[========================================================================================]]--	
204
205
  if XINConfig.scriptActive1 and ts.target then
206
    
207
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
208
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
209
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
210
		if BRKREADY then CastSpell(BRKSlot, ts.target) end
211
    if ROREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(ROSlot) end
212
    if LOCKREADY and GetDistance(ts.target) <= 485 and ts.target.type == "obj_AI_Hero" then CastSpell(LOCKSlot) end    
213
    
214
    if EREADY and (GetDistance(ts.target) < range and GetDistance(ts.target) > AArange) then
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
        myHero:Attack(ts.target)
221
        if YMGBREADY and GetDistance(ts.target) > AArange then -- YMGB
222
          if ts.target.type == "obj_AI_Hero" then
223
            CastSpell(YMGBSlot)
224
          end
225
        end
226
      end
227
	  elseif swing == 1 then
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
          if AAmove == true then
232
            player:MoveTo(ts.target.x, ts.target.z)
233
          end
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 RREADY then DrawCircle(myHero.x, myHero.y, myHero.z, 450, 0x992D3D) end
322
		if ts.target ~= nil then
323
			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
324
		end
325
	end
326
end
327
function OnSendChat(msg)
328
	ts:OnSendChat(msg, "pri")
329
end
330
PrintChat(" >> Xin The Rapist v1.1 loaded!")