View difference between Paste ID: rZs8zWFx and 481k6bLa
SHOW: | | - or go back to the newest paste.
1
--[[
2
	-Full combo: Items -> Q -> W -> E -> R
3
	-Supports Deathfire Grasp, Bilgewater Cutlass, Hextech Gunblade, Sheen, Trinity, Lich Bane, Ignite, Iceborn, Liandrys and Blackfire
4
	-Target configuration, Press shift to configure
5
	
6
	By burn, based on Trus sbtw annie script, modded by xkjtx
7
]]
8
if myHero.charName ~= "Annie" then return end
9
--[[local LIB_PATH = debug.getinfo(1).source:sub(debug.getinfo(1).source:find(".*\\")):sub(2).."Common/"-- <<
10
local AllClassFile = LIB_PATH.."AllClass.lua"
11
local spellDmgFile = LIB_PATH.."spellDmg.lua"
12
if file_exists(AllClassFile) then require "AllClass" end
13
if file_exists(spellDmgFile) then require "spellDmg" end]]-- << removed becasue its not needed any more >> --
14
--mecMethod = 2 --> 2 will hit our target and maybe other people, 1 will hit a  lot of people and maybe also our target (not guarantee this last)
15
scriptActive = false
16
stunReadyFlag = false
17
existTibbers = false
18
ultiRange = 600         
19
ultiRadius = 230  
20
range = 620
21
tranges = 650
22
killable = {}
23
local startAttackSpeed = 0.625
24
local lastBasicAttack = 0
25
local swingDelay = 0.15
26
local swing = 0
27
local calculationenemy = 1
28
local waittxt = {}
29
local ts
30
local ignite = nil
31
local player = GetMyHero()
32
function OnLoad()
33
	--PrintChat(">> Annie Combo v1.0 loaded!")
34
    if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
35
    elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2
36
    else ignite = nil
37
    end
38
	AnnieConfig = scriptConfig("Annie Combo", "anniecombo")
39
	AnnieConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32) -- Space bar
40
	AnnieConfig:addParam("harass", "Harass Enemy", SCRIPT_PARAM_ONKEYDOWN, false, 83) -- S
41
	AnnieConfig:addParam("autofarmQ", "Auto farm Q", SCRIPT_PARAM_ONKEYTOGGLE, false, 88) -- X
42
	AnnieConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
43
	AnnieConfig:addParam("useE", "Use E", SCRIPT_PARAM_ONOFF, true)
44
	AnnieConfig:permaShow("scriptActive")
45
	AnnieConfig:permaShow("harass")
46-
	ts = TargetSelector(TARGET_NEAR_MOUSE,tranges,DAMAGE_MAGIC--[[,false]]) -- << you can focus target by selecting(with Lmouse) >> -- 
46+
47
	ts = TargetSelector(TARGET_NEAR_MOUSE,tranges,DAMAGE_MAGIC) -- << you can focus target by selecting(with Lmouse) >> -- 
48
	ts.name = "Annie"
49
	AnnieConfig:addTS(ts)
50
	lastBasicAttack = os.clock()
51
end
52
function OnProcessSpell(unit, spell)
53-
	if ts.target ~= nil then
53+
	if unit.isMe and (spell.name:find("Attack") ~= nil) then
54-
		if os.clock() > lastBasicAttack + 0.5 then
54+
		swing = 1
55
		lastBasicAttack = os.clock()
56
	end
57
end
58
function OnTick()
59
	if myHero.dead then return end
60
	ts:update()
61
	if ts.target ~= nil and not myHero.dead then
62
		AttackDelay = (1000/(myHero.attackSpeed/(1/startAttackSpeed)))/1000
63
		if swing == 1 and os.clock() > lastBasicAttack + AttackDelay then
64
			swing = 0
65
		end 
66
		if AnnieConfig.harass or AnnieConfig.scriptActive then
67
			if GetDistance(ts.target) <= range and swing == 0 then
68
				myHero:Attack(ts.target)
69
			end
70
		end
71
	end
72
	--if existTibbers then
73
        --PrintChat("Tibers ALIVE!")
74
    --end   
75
	--if existTibbers == false then
76
        --PrintChat("NO tibers!")
77
    --end   
78
	DFGSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3128), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
79
	IcebornSlot, LiandrysSlot, BlackfireSlot = GetInventorySlotItem(3025), GetInventorySlotItem(3151), GetInventorySlotItem(3188)	
80
	QREADY = (myHero:CanUseSpell(_Q) == READY)
81
	WREADY = (myHero:CanUseSpell(_W) == READY)
82
	EREADY = (myHero:CanUseSpell(_E) == READY)
83
	RREADY = (myHero:CanUseSpell(_R) == READY)
84
	DFGREADY = (DFGSlot ~= nil and myHero:CanUseSpell(DFGSlot) == READY)
85
	HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
86
	BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
87
	IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
88
	DmgCalculation()
89
	if AnnieConfig.autofarmQ and QREADY then
90
		local myQ = math.floor((myHero:GetSpellData(_Q).level-1)*40 + 85 + myHero.ap * .7)
91
		for k = 1, objManager.maxObjects do
92
		local minionObjectI = objManager:GetObject(k)
93
			if minionObjectI ~= nil and string.find(minionObjectI.name,"Minion_") == 1 and minionObjectI.team ~= myHero.team and minionObjectI.dead == false then
94
				if myHero:GetDistance(minionObjectI) <= range and minionObjectI.health <= myHero:CalcMagicDamage(minionObjectI, myQ)then	
95
					CastSpell(_Q, minionObjectI)
96
				end
97
			end
98
		end		
99
	end
100
	if AnnieConfig.harass and ts.target then
101
		if QREADY and GetDistance(ts.target) <= range then CastSpell(_Q, ts.target) end
102
		if WREADY and GetDistance(ts.target) < range then CastSpell(_W, ts.target.x, ts.target.z) end
103
	end
104
	if AnnieConfig.scriptActive and ts.target then
105
		if DFGREADY then CastSpell(DFGSlot, ts.target) end
106
		if HXGREADY then CastSpell(HXGSlot, ts.target) end
107
		if BWCREADY then CastSpell(BWCSlot, ts.target) end
108
		if stunReadyFlag then
109
			if player:CanUseSpell(_R) == READY and myHero:GetDistance(ts.target) < 650 then
110
                --[[if mecMethod == 1 then
111
                    spellPos = FindGroupCenterFromNearestEnemies(ultiRadius,ultiRange)
112
                elseif mecMethod == 2 then
113
                    spellPos = FindGroupCenterNearTarget(ts.target,ultiRadius,ultiRange)
114
                end]]
115
                if ts.target ~= nil then
116
                    --CastSpell(_R, spellPos.center.x, spellPos.center.z)
117
                --else
118
                    CastSpell(_R, ts.target.x, ts.target.z)
119
                end
120
            end
121
		end    
122
		if QREADY and GetDistance(ts.target) <= range then CastSpell(_Q, ts.target) end  
123
		if stunReadyFlag then
124
			if player:CanUseSpell(_R) == READY and myHero:GetDistance(ts.target) < 650 then
125
                --[[if mecMethod == 1 then
126
                    spellPos = FindGroupCenterFromNearestEnemies(ultiRadius,ultiRange)
127
                elseif mecMethod == 2 then
128
                    spellPos = FindGroupCenterNearTarget(ts.target,ultiRadius,ultiRange)
129
                end]]
130
                if ts.target ~= nil then
131
                    --CastSpell(_R, spellPos.center.x, spellPos.center.z)
132
                --else
133
                    CastSpell(_R, ts.target.x, ts.target.z)
134
                end
135
            end
136
		end  
137
		if WREADY and GetDistance(ts.target) < range then CastSpell(_W, ts.target.x, ts.target.z) end
138
		if EREADY and AnnieConfig.useE and not stunReadyFlag then CastSpell(_E) end	
139
		if player:CanUseSpell(_R) == READY and myHero:GetDistance(ts.target) < 650 then
140
                	if ts.target ~= nil then
141-
         end
141+
                    		CastSpell(_R, ts.target.x, ts.target.z)
142
			end
143-
		if myHero:GetDistance(ts.target) < 650 and existTibbers then
143+
         	end
144
		 
145
		if myHero:GetDistance(ts.target) < 750 and existTibbers then
146
			CastSpell(_R,ts.target)
147
		end
148
		 
149
	end
150
end
151
152
function OnCreateObj(object)
153
	if object.name == "StunReady.troy" then stunReadyFlag = true end
154
	if object.name == "BearFire_foot.troy" then existTibbers = true end
155
end
156
157
function OnDeleteObj(object)
158
	if object.name == "StunReady.troy" then stunReadyFlag = false end
159
	if object.name == "BearFire_foot.troy" then existTibbers = false end	
160-
function OnWndMsg(msg,key)
160+
161-
	--SC__OnWndMsg(msg,key)
161+
162
function OnSendChat(msg)
163
	ts:OnSendChat(msg, "pri")
164
end
165-
	--TargetSelector__OnSendChat(msg)
165+
166
function DmgCalculation()
167
		local enemy = heroManager:GetHero(calculationenemy)
168
		if ValidTarget(enemy) then
169
			local dfgdamage, hxgdamage, bwcdamage, ignitedamage, Sheendamage, Trinitydamage, LichBanedamage  = 0, 0, 0, 0, 0, 0, 0
170
			local qdamage = getDmg("Q",enemy,myHero)
171
			local wdamage = getDmg("W",enemy,myHero)
172
			local rdamage = getDmg("R",enemy,myHero)
173
			local dfgdamage = (DFGSlot and getDmg("DFG",enemy,myHero) or 0)
174
			local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
175
			local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
176
			local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
177
			local onhitdmg = (SheenSlot and getDmg("SHEEN",enemy,myHero) or 0)+(TrinitySlot and getDmg("TRINITY",enemy,myHero) or 0)+(LichBaneSlot and getDmg("LICHBANE",enemy,myHero) or 0)+(IcebornSlot and getDmg("ICEBORN",enemy,myHero) or 0)							
178
			local onspelldamage = (LiandrysSlot and getDmg("LIANDRYS",enemy,myHero) or 0)+(BlackfireSlot and getDmg("BLACKFIRE",enemy,myHero) or 0)
179
			local combo1 = onspelldamage
180
			local combo2 = onhitdmg + qdamage + wdamage + rdamage + dfgdamage + hxgdamage + bwcdamage + ignitedamage + onspelldamage
181
			if QREADY then
182
				combo1 = combo1 + qdamage
183
			end
184
			if WREADY then
185
				combo1 = combo1 + wdamage
186
			end
187
			if (RREADY and not existTibbers) then
188
				combo1 = combo1 + rdamage
189
			end		
190
			if HXGREADY then               
191
				combo1 = combo1 + hxgdamage    
192
			end
193
			if BWCREADY then
194
				combo1 = combo1 + bwcdamage
195
			end
196
			if DFGREADY then        
197
				combo1 = combo1*1.2 + dfgdamage            
198
			end			
199
			if IREADY then
200
				combo1 = combo1 + ignitedamage 
201
			end
202
			combo1 = combo1 + onhitdmg
203
			if combo1 >= enemy.health then killable[calculationenemy] = 1
204
			elseif combo2 >= enemy.health then killable[calculationenemy] = 2
205
			else killable[calculationenemy] = 0 end
206
		end	
207
		if calculationenemy == 1 then
208
			calculationenemy = heroManager.iCount
209
		else 
210
			calculationenemy = calculationenemy-1
211
		end
212
end
213
214
function OnDraw()
215
	if AnnieConfig.drawcircles and not myHero.dead then
216
		DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x990099)
217
		if ts.target ~= nil then
218
			for j=0, 5 do
219
				DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
220
			end
221
		end
222
		for i=1, heroManager.iCount do
223
			local enemydraw = heroManager:GetHero(i)
224
			if ValidTarget(enemydraw) then
225
				if killable[i] == 2 then
226
					for j=0, 20 do
227
						DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
228
					end
229
					PrintFloatText(enemydraw,0,"Skills are not available")
230
				elseif killable[i] == 1 then
231
					for j=0, 10 do
232
						DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
233
						DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
234
						DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
235
					end
236
					PrintFloatText(enemydraw,0,"Kill him!")
237
				end
238
			end
239
		end
240
	end
241
end