Advertisement
Guest User

Untitled

a guest
Dec 19th, 2012
1,894
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.07 KB | None | 0 0
  1. --[[
  2. Olaf Combo by burn
  3.  
  4. -Full combo: Items -> Q -> E -> W
  5. -Supports BRK, Bilgewater Cutlass, Hextech Gunblade, Sheen, Trinity, Lich Bane and Ignite & new items S3
  6. -Mark killable target with a combo
  7. -Target configuration, Press shift to configure
  8. -Auto ignite killable enemy ON/OFF option in ingame menu
  9. -Better Q prediction
  10. -Harass mode *
  11. -Autofarm *
  12. -Auto pick axe *
  13.  
  14. Explanation of the marks:
  15.  
  16. Green circle: Marks the current target to which you will do the combo
  17. Blue circle: Mark a target that can be killed with a combo, if all the skills were available
  18. Red circle: Mark a target that can be killed using; Items + 5 hits + Q x2 + E x2 + ignite
  19. 2 Red circles: Mark a target that can be killed using; Items + 2 hits + Q + E + ignite
  20. 3 Red circles: Mark a target that can be killed using; E + ignite
  21. ]]
  22. if myHero.charName ~= "Olaf" then return end
  23. --[[ Code ]]
  24. local thickness = 10 --For Draw Part (circles)
  25. local range = 1000 -- Q
  26. local rangeE = 325 -- E
  27. local tick = nil
  28. local Ehurt = false
  29. local mousemoving = true
  30. local nextTick = 0
  31. local lasthiton = true
  32. local unitScanTick = 0
  33. local scanAdditionalRange = 450
  34. local waitDelay = 300
  35. local units = {}
  36. pickingaxe = false
  37. axepos = nil
  38. -- better Q prediction
  39. local delay = 360
  40. local qspeed = 1.50
  41. local travelDuration = 600
  42. -- draw
  43. local waittxt = {}
  44. local calculationenemy = 1
  45. local floattext = {"Skills are not available","Able to fight","Killable","Murder him!"}
  46. local killable = {}
  47. -- ts
  48. local ts
  49. --
  50. local ignite = nil
  51. local BRKSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = nil, nil, nil, nil, nil, nil
  52. local QREADY, WREADY, EREADY, RREADY, HXGREADY, BWCREADY, IREADY = false, false, false, false, false, false, false
  53.  
  54. function OnLoad()
  55. PrintChat(">> Olaf Combo 1.1 loaded!")
  56. OlafConfig = scriptConfig("Olaf Combo 1.1", "Olafcombo")
  57. OlafConfig:addParam("scriptActive", "Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  58. OlafConfig:addParam("harass", "Harass with Q", SCRIPT_PARAM_ONKEYDOWN, false, 88) --x
  59. OlafConfig:addParam("drawcircles", "Draw Circles", SCRIPT_PARAM_ONOFF, true)
  60. OlafConfig:addParam("drawtext", "Draw Text", SCRIPT_PARAM_ONOFF, true)
  61. OlafConfig:addParam("autoignite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
  62. OlafConfig:addParam("autopickAxe", "Auto Pick Axe", SCRIPT_PARAM_ONOFF, true)
  63. OlafConfig:addParam("autoFarm", "Auto Farm", SCRIPT_PARAM_ONKEYTOGGLE, false, 67) --c
  64. OlafConfig:permaShow("scriptActive")
  65. OlafConfig:permaShow("autoFarm")
  66. ts = TargetSelector(TARGET_LOW_HP,range,DAMAGE_PHYSICAL)
  67. ts.name = "Olaf"
  68. OlafConfig:addTS(ts)
  69. if myHero:GetSpellData(SUMMONER_1).name:find("SummonerDot") then ignite = SUMMONER_1
  70. elseif myHero:GetSpellData(SUMMONER_2).name:find("SummonerDot") then ignite = SUMMONER_2 end
  71. for i=1, heroManager.iCount do waittxt[i] = i*3 end
  72. end
  73.  
  74. function OnTick()
  75. if myHero.dead then return end
  76. ts:update()
  77. if ts.target ~= nil then
  78. travelDuration = (delay + GetDistance(myHero, ts.target)/qspeed)
  79. end
  80. ts:SetPrediction(travelDuration)
  81. Prediction__OnTick()
  82. if ts.target ~= nil and myHero:CanUseSpell(_Q) == READY then predic = ts.nextPosition end
  83. BRKSlot, HXGSlot, BWCSlot, SheenSlot, TrinitySlot, LichBaneSlot = GetInventorySlotItem(3153), GetInventorySlotItem(3146), GetInventorySlotItem(3144), GetInventorySlotItem(3057), GetInventorySlotItem(3078), GetInventorySlotItem(3100)
  84. YomumusGhostbladeSlot = GetInventorySlotItem(3142)
  85. EXECSlot = GetInventorySlotItem(3123)
  86. RANOSlot = GetInventorySlotItem(3143)
  87. QREADY = (myHero:CanUseSpell(_Q) == READY)
  88. WREADY = (myHero:CanUseSpell(_W) == READY)
  89. EREADY = (myHero:CanUseSpell(_E) == READY)
  90. HXGREADY = (HXGSlot ~= nil and myHero:CanUseSpell(HXGSlot) == READY)
  91. BWCREADY = (BWCSlot ~= nil and myHero:CanUseSpell(BWCSlot) == READY)
  92. BRKREADY = (BRKSlot ~= nil and myHero:CanUseSpell(BRKSlot) == READY)
  93. IREADY = (ignite ~= nil and myHero:CanUseSpell(ignite) == READY)
  94. YomumusGhostbladeReady = (YomumusGhostbladeSlot ~= nil and myHero:CanUseSpell(YomumusGhostbladeSlot) == READY)
  95. EXECReady = (EXECSlot ~= nil and myHero:CanUseSpell(EXECSlot) == READY)
  96. RANOReady = (RANOSlot ~= nil and myHero:CanUseSpell(RANOSlot) == READY)
  97. if tick == nil or GetTickCount()-tick > 100 then
  98. tick = GetTickCount()
  99. OlafDmgCalculation()
  100. end
  101.  
  102. if OlafConfig.harass and ts.target then
  103. if predic ~= nil and QREADY and GetDistance(ts.target) < range then
  104. CastSpell(_Q, predic.x, predic.z)
  105. end
  106. end
  107.  
  108. if OlafConfig.scriptActive and ts.target then
  109. --check next olaf HP
  110. local SpellDataE = myHero:GetSpellData(_E)
  111. local hpCost = (40+24*SpellDataE.level) --cost of HP to cast our E
  112. if (myHero.health - hpCost) < 100 then
  113. Ehurt = true
  114. else
  115. Ehurt = false
  116. end
  117. -- end check
  118. if HXGREADY then CastSpell(HXGSlot, ts.target) end
  119. if BWCREADY then CastSpell(BWCSlot, ts.target) end
  120. if BRKREADY then CastSpell(BRKSlot, ts.target) end
  121. if YomumusGhostbladeReady then CastSpell(YomumusGhostbladeSlot, ts.target) end
  122. if EXECReady then CastSpell(EXECSlot, ts.target) end
  123. if RANOReady then CastSpell(RANOSlot, ts.target) end
  124. if OlafConfig.autopickAxe and axepos and not QREADY and GetDistance(myHero, axepos) <= 365 then
  125. pickingaxe = true
  126. myHero:MoveTo(tonumber(axepos.x), tonumber(axepos.z))
  127. end
  128. if OlafConfig.autopickAxe and axepos and not QREADY and GetDistance(myHero, axepos) > 365 then
  129. pickingaxe = false
  130. end
  131. if QREADY then pickingaxe = false end
  132. if predic ~= nil and QREADY and GetDistance(ts.target) < range then
  133. CastSpell(_Q, predic.x, predic.z)
  134. end
  135. if EREADY and not Ehurt and GetDistance(ts.target) <= rangeE then CastSpell(_E, ts.target) end
  136. -- check if our E will kill our target, even if we will get less of 100hp
  137. local edmg = getDmg("E",ts.target,myHero)
  138. if EREADY and GetDistance(ts.target) <= rangeE and ts.target.health <= edmg then CastSpell(_E, ts.target) end
  139. -- end check
  140. if WREADY and GetDistance(ts.target) < 200 then CastSpell(_W) end
  141. if not pickingaxe then myHero:Attack(ts.target) end
  142. end
  143.  
  144. if OlafConfig.autoFarm then
  145. if mousemoving and GetTickCount() > nextTick then
  146. player:MoveTo(mousePos.x, mousePos.z)
  147. end
  148. local tick = GetTickCount()
  149. if lasthiton then
  150. unitScanTick = tick
  151. for i = 1, objManager.maxObjects, 1 do
  152. local object = objManager:getObject(i)
  153. if object ~= nil and object.team ~= player.team and object.type == "obj_AI_Minion" and string.find(object.charName,"Minion") then
  154. if not object.dead and GetDistance(object,player) <= (player.range + scanAdditionalRange) then
  155. if units[object.name] == nil then
  156. units[object.name] = { obj = object, markTick = 0 }
  157. end
  158. else
  159. units[object.name] = nil
  160. end
  161. end
  162. end
  163. end
  164. for i, unit in pairs(units) do
  165. if unit.obj == nil or unit.obj.dead or GetDistance(player,unit.obj) > (player.range + scanAdditionalRange) then
  166. units[i] = nil
  167. else
  168. if unit.obj.health <= (myHero:CalcDamage(unit.obj,myHero.totalDamage)) then --
  169. if lasthiton and GetTickCount() > nextTick then
  170. player:Attack(unit.obj)
  171. nextTick = GetTickCount() + waitDelay
  172. return
  173. end
  174. end
  175. end
  176. end
  177. end
  178.  
  179. if OlafConfig.autoignite then
  180. local ignitedmg = 0
  181. if IREADY then
  182. for j = 1, heroManager.iCount, 1 do
  183. local enemyhero = heroManager:getHero(j)
  184. if ValidTarget(enemyhero) then
  185. ignitedmg = 50 + 20 * myHero.level
  186. if enemyhero ~= nil and enemyhero.team ~= myHero.team and not enemyhero.dead and enemyhero.visible and GetDistance(enemyhero) <= 600 and enemyhero.health <= ignitedmg then
  187. CastSpell(ignite, enemyhero)
  188. end
  189. end
  190. end
  191. end
  192. end
  193. end
  194. function OlafDmgCalculation()
  195. local enemy = heroManager:GetHero(calculationenemy)
  196. if ValidTarget(enemy) then
  197. local hxgdamage, bwcdamage, ignitedamage, Sheendamage, Trinitydamage, LichBanedamage = 0, 0, 0, 0, 0, 0
  198. local qdamage = getDmg("Q",enemy,myHero)
  199. local edamage = getDmg("E",enemy,myHero)
  200. local hitdamage = getDmg("AD",enemy,myHero)
  201. local hxgdamage = (HXGSlot and getDmg("HXG",enemy,myHero) or 0)
  202. local bwcdamage = (BWCSlot and getDmg("BWC",enemy,myHero) or 0)
  203. local ignitedamage = (ignite and getDmg("IGNITE",enemy,myHero) or 0)
  204. local Sheendamage = (SheenSlot and getDmg("SHEEN",enemy,myHero) or 0)
  205. local Trinitydamage = (TrinitySlot and getDmg("TRINITY",enemy,myHero) or 0)
  206. local LichBanedamage = (LichBaneSlot and getDmg("LICHBANE",enemy,myHero) or 0)
  207. local combo1 = hitdamage*5 + qdamage*2 + edamage*2 + Sheendamage + Trinitydamage + LichBanedamage --0 cd
  208. local combo2 = hitdamage*5 + Sheendamage + Trinitydamage + LichBanedamage
  209. local combo3 = hitdamage*2 + Sheendamage + Trinitydamage + LichBanedamage
  210. local combo4 = 0
  211.  
  212. if QREADY then
  213. combo2 = combo2 + qdamage*2
  214. combo3 = combo3 + qdamage
  215. end
  216. if EREADY then
  217. combo2 = combo2 + edamage*2
  218. combo3 = combo3 + edamage
  219. combo4 = combo4 + edamage
  220. end
  221. if HXGREADY then
  222. combo1 = combo1 + hxgdamage
  223. combo2 = combo2 + hxgdamage
  224. combo3 = combo3 + hxgdamage
  225. combo4 = combo4 + hxgdamage
  226. end
  227. if BWCREADY then
  228. combo1 = combo1 + bwcdamage
  229. combo2 = combo2 + bwcdamage
  230. combo3 = combo3 + bwcdamage
  231. combo4 = combo4 + bwcdamage
  232. end
  233. if IREADY then
  234. combo1 = combo1 + ignitedamage
  235. combo2 = combo2 + ignitedamage
  236. combo3 = combo3 + ignitedamage
  237. combo4 = combo4 + ignitedamage
  238. end
  239. if combo4 >= enemy.health then killable[calculationenemy] = 4
  240. elseif combo3 >= enemy.health then killable[calculationenemy] = 3
  241. elseif combo2 >= enemy.health then killable[calculationenemy] = 2
  242. elseif combo1 >= enemy.health then killable[calculationenemy] = 1
  243. else killable[calculationenemy] = 0 end
  244. end
  245. if calculationenemy == 1 then calculationenemy = heroManager.iCount
  246. else calculationenemy = calculationenemy-1 end
  247. end
  248.  
  249. function OnDraw()
  250. if OlafConfig.drawcircles and not myHero.dead then
  251. DrawCircle(myHero.x, myHero.y, myHero.z, range, 0x00CCFF)
  252. DrawCircle(myHero.x, myHero.y, myHero.z, rangeE, 0x9933CC)
  253. if ts.target ~= nil then
  254. for j=0, 10 do
  255. DrawCircle(ts.target.x, ts.target.y, ts.target.z, 40 + j*1.5, 0x00FF00)
  256. end
  257. end
  258. end
  259. for i=1, heroManager.iCount do
  260. local enemydraw = heroManager:GetHero(i)
  261. if ValidTarget(enemydraw) then
  262. if OlafConfig.drawcircles then
  263. if killable[i] == 1 then
  264. for j=0, thickness do
  265. DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0x0000FF)
  266. end
  267. elseif killable[i] == 2 then
  268. for j=0, thickness do
  269. DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  270. end
  271. elseif killable[i] == 3 then
  272. for j=0, thickness do
  273. DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  274. DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  275. end
  276. elseif killable[i] == 4 then
  277. for j=0, thickness do
  278. DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 80 + j*1.5, 0xFF0000)
  279. DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 110 + j*1.5, 0xFF0000)
  280. DrawCircle(enemydraw.x, enemydraw.y, enemydraw.z, 140 + j*1.5, 0xFF0000)
  281. end
  282. end
  283. end
  284. if OlafConfig.drawtext and waittxt[i] == 1 and killable[i] ~= 0 then
  285. PrintFloatText(enemydraw,0,floattext[killable[i]])
  286. end
  287. end
  288. if waittxt[i] == 1 then waittxt[i] = 30
  289. else waittxt[i] = waittxt[i]-1 end
  290. end
  291. SC__OnDraw()
  292. end
  293. function OnWndMsg(msg,key)
  294. SC__OnWndMsg(msg,key)
  295. end
  296. function OnSendChat(msg)
  297. TargetSelector__OnSendChat(msg)
  298. ts:OnSendChat(msg, "pri")
  299. end
  300.  
  301. function OnCreateObj(object)
  302. if myHero.dead then return end
  303. if object ~= nil and object.name ~= nil and object.name == "olaf_axe_totem_team_id_green.troy" and object.x ~= nil and object.z ~= nil then
  304. axepos = object
  305. end
  306. end
  307.  
  308. function OnDeleteObj(object)
  309. if object ~= nil and object.name ~= nil and object.name == "olaf_axe_totem_team_id_green.troy" and object.x ~= nil and object.z ~= nil then
  310. axepos = nil
  311. pickingaxe = false
  312. end
  313. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement