Guest User

Moones Combo Script

a guest
Jul 24th, 2015
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 245.66 KB | None | 0 0
  1. --<<Auto Chase + Spell/Item Combo, made by Moones>>
  2.  
  3. --[[ Use Ensage cracked! tinyurl.com/ensage ]]--
  4.  
  5. local currentVersion = 0.3
  6. local Beta = ""
  7.  
  8. require("libs.ScriptConfig")
  9. require("libs.Utils")
  10. require("libs.HeroInfo")
  11. require("libs.Animations2")
  12. require("libs.TargetFind")
  13. require("libs.SkillShot")
  14. require("libs.AbilityDamage")
  15. require("libs.DrawManager3D")
  16. require("libs.EasyHUD")
  17.  
  18. local config = ScriptConfig.new()
  19. config:SetParameter("Chase", "G", config.TYPE_HOTKEY)
  20. config:SetParameter("Retreat", "Z", config.TYPE_HOTKEY)
  21. config:SetParameter("Harras", "B", config.TYPE_HOTKEY)
  22. config:SetParameter("BlinkToggle", "H", config.TYPE_HOTKEY)
  23. config:SetParameter("StackKey", "J", config.TYPE_HOTKEY)
  24. config:SetParameter("KillSteal", false, config.TYPE_BOOL)
  25. config:SetParameter("TargetFindRange", 5000, config.TYPE_NUMBER)
  26. config:SetParameter("TargetClosestToMouse", false, config.TYPE_BOOL)
  27. config:SetParameter("TargetLowestHP", true, config.TYPE_BOOL)
  28. config:SetParameter("MoveToEnemyWhenLocked", false, config.TYPE_BOOL)
  29. config:SetParameter("AutoMoveToEnemy", false, config.TYPE_BOOL)
  30. config:SetParameter("VersionInfoPosX", 630, config.TYPE_NUMBER)
  31. config:SetParameter("VersionInfoPosY", 700, config.TYPE_NUMBER)
  32. config:SetParameter("AutoLock", true, config.TYPE_BOOL)
  33. config:SetParameter("ManualLock", true, config.TYPE_BOOL)
  34. config:SetParameter("UseBlink", true, config.TYPE_BOOL)
  35. config:SetParameter("UseEul", true, config.TYPE_BOOL)
  36. config:SetParameter("EMBERUseUlti", true, config.TYPE_BOOL)
  37. config:SetParameter("Combo1", 49, config.TYPE_HOTKEY)
  38. config:SetParameter("Combo2", 50, config.TYPE_HOTKEY)
  39. config:SetParameter("Combo3", 51, config.TYPE_HOTKEY)
  40. config:SetParameter("EnableComboKeys", false, config.TYPE_BOOL)
  41. config:Load()
  42.  
  43. local chasekey = config.Chase local blinktoggle = config.BlinkToggle local killsteal = config.KillSteal
  44. local reg = false local myhero = nil local victim = nil local myId = nil local attack = 0 local move = 0 local start = false local resettime = nil local type = nil local channelactive = false local mePosition local atr = nil
  45. local useblink = config.UseBlink local xposition = nil local monitor = client.screenSize.x/1600 local F14 = drawMgr:CreateFont("F14","Tahoma",13*monitor,800*monitor) local statusText = drawMgr:CreateText(10*monitor,580*monitor,99333580,"",F14) statusText.visible = false
  46. local targetlock = false local testX, tinfoHeroSize, tinfoHeroDown, txxB, txxG, rate, con, x_, y_ local click = {} local follow = 0 local indicate = {} local JungleCamps = {} local camp = nil local enemyHP = nil local trolltoggle = false local esstone = false
  47. local campSigns = {} local damageTable = {} local comboTable = {} local retreat = false local statusText2 = drawMgr:CreateText(0,0,-54619000,"",F14) statusText2.visible = false local harras = false local lastPrediction = nil local F12 = drawMgr:CreateFont("F12","Tahoma",12*monitor,800*monitor)
  48. local versionSign = drawMgr:CreateText(client.screenSize.x*config.VersionInfoPosX/1000,client.screenSize.y*config.VersionInfoPosY/1000,0x66FF33FF,"",F14) local infoSign = drawMgr:CreateText(client.screenSize.x*config.VersionInfoPosX/1000,(client.screenSize.y*config.VersionInfoPosY/1000)+20,-1,"",F12)
  49. local lastCastPrediction = nil local mySpells = nil local HUD = nil local sunstrikeButtonID, sunstrikeButton, coldsnapButtonID, coldsnapButton, chaosmeteorButtonID, chaosmeteorButton, tornadoButtonID, tornadoButton, empButton, empButtonID, forgespiritButtonID, forgespiritButton, icewallButton, icewallButtonID, alacrityButton, alacrityButtonID, ghostwalkButton, ghostwalkButtonID, blastButton, blastButtonID
  50. local KSSS = true local DSS = true local EStoMouse = false local textFont = drawMgr:CreateFont("textFont","Arial",14,400) local tuskSnowBall = false local buttons = {} local combo = 0 local comboready = false local directiontable = {} local PuckPosition = nil local LastCastedTable = {}
  51. local positionsTable = {}
  52.  
  53. local itemcomboTable = {
  54. { "item_soul_ring", false, nil, false, false, true },
  55. { "item_veil_of_discord", false, nil, false, false, true },
  56. { "item_cyclone", true, nil, false, false, true },
  57. { "item_rod_of_atos", true, nil, false, false, true },
  58. { "item_sheepstick", true, nil, false, false, true },
  59. { "item_orchid", true, nil, false, false, true },
  60. { "item_diffusal_blade", true, nil, false, false, true },
  61. { "item_diffusal_blade_2", true, nil, false, false, true },
  62. { "item_shivas_guard", true, 1000, nil, false, false, true },
  63. { "item_abyssal_blade", true, nil, false, true, true },
  64. { "item_solar_crest" },
  65. { "item_medallion_of_courage" },
  66. { "item_ethereal_blade", false, nil, false, false, true },
  67. { "item_dagon", false, nil, killsteal},
  68. { "item_dagon_2", false, nil, killsteal },
  69. { "item_dagon_3", false, nil, killsteal },
  70. { "item_dagon_4", false, nil, killsteal },
  71. { "item_dagon_5", false, nil, killsteal },
  72. { "item_urn_of_shadows" },
  73. { "item_blade_mail", true, 500, false, true, true },
  74. { "item_heavens_halberd", true, 500, false, false, true },
  75. { "item_mjollnir", false, 500, false, true, true },
  76. { "item_arcane_boots", false, nil, false, true, true },
  77. { "item_phase_boots", true, nil, false, true, true },
  78. { "item_refresher", false, nil, false, true },
  79. { "item_dust", false, 1050, false, true, true }
  80. }
  81.  
  82. local invokerCombo = {
  83. { {"invoker_cold_snap"}, {"invoker_ice_wall", 590, true, 1} },
  84. { {"invoker_tornado", "travel_distance", true, nil, false, "travel_speed"}, {"invoker_emp", nil, false, 2.9} },
  85. { {"invoker_forge_spirit", 700}, {"invoker_sun_strike", nil, false, 1.7}, {"invoker_chaos_meteor", nil, false, 1.3}, {"invoker_alacrity", nil, nil, nil, nil, nil, nil, nil, nil, nil, true} },
  86. { {"invoker_deafening_blast", "travel_distance", true, nil, false, "travel_speed"}, {"invoker_ghost_walk", nil, true} },
  87. { {"invoker_tornado", "travel_distance", true, nil, false, "travel_speed"}, {"invoker_emp", nil, false, 2.9}, {"invoker_chaos_meteor", nil, false, 1.3}, {"invoker_deafening_blast", "travel_distance", true, nil, false, "travel_speed"}, {"invoker_cold_snap"} },
  88. { {"invoker_tornado", "travel_distance", true, nil, false, "travel_speed"}, {"invoker_sun_strike", nil, false, 1.7}, {"invoker_chaos_meteor", nil, false, 1.3}, {"invoker_deafening_blast", "travel_distance", true, nil, false, "travel_speed"}, {"invoker_cold_snap"} },
  89. { {"invoker_cold_snap"}, {"invoker_chaos_meteor", nil, false, 1.3}, {"invoker_deafening_blast", "travel_distance", true, nil, false, "travel_speed"}, {"invoker_sun_strike", nil, false, 1.7} }
  90. }
  91.  
  92. local RubickSpellSteals = {}
  93. local RubickNoSpellSteals = {}
  94. RubickSpellSteals["batrider_firefly"] = 6
  95. RubickSpellSteals["lone_druid_spirit_bear"] = 10
  96. RubickSpellSteals["leshrac_split_earth"] = 6
  97. RubickSpellSteals["sniper_assassinate"] = 6
  98. RubickSpellSteals["windrunner_powershot"] = 3
  99. RubickSpellSteals["juggernaut_blade_fury"] = 6
  100. RubickSpellSteals["juggernaut_healing_ward"] = 4
  101. RubickSpellSteals["gyrocopter_flak_cannon"] = 4
  102. RubickSpellSteals["mirana_arrow"] = 10
  103. RubickSpellSteals["pudge_meat_hook"] = 10
  104. RubickSpellSteals["spirit_breaker_charge_of_darkness"] = 7
  105. RubickSpellSteals["slark_pounce"] = 6
  106. RubickSpellSteals["broodmother_spin_web"] = 5
  107. RubickSpellSteals["ursa_overpower"] = 7
  108. RubickNoSpellSteals["pudge_rot"] = true
  109.  
  110. function Key(msg, code)
  111. if client.chat or client.console or not PlayingGame() or client.paused then return end
  112. if msg == LBUTTON_DOWN and client.mouseScreenPosition.x > 300 then
  113. local me = entityList:GetMyHero()
  114. if not me then return end
  115. local enemies = entityList:GetEntities({type=LuaEntity.TYPE_HERO, team=me:GetEnemyTeam()})
  116. for i = 1, #enemies do
  117. local v = enemies[i]
  118. local id = v.playerId
  119. local x,y,h,w
  120. local button = indicate[id]
  121. if button then
  122. x,y,h,w = button.x,button.y,button.h,button.w
  123. else
  124. local xx = GetXX(v)
  125. x,y,h,w = xx-20+x_*id,0,x_,35*monitor
  126. indicate[id] = drawMgr:CreateRect(x,y,h,w,9911861800)
  127. indicate[id].visible = false
  128. end
  129. if IsMouseOnButton(x,y,h,w) then
  130. if victim and victim == v then
  131. victim = nil
  132. targetlock = false
  133. indicate[id].visible = false
  134. return true
  135. else
  136. victim = v
  137. targetlock = true
  138. enemyHP = victim.health
  139. indicate[id].visible = true
  140. for z = 1, 9 do
  141. local k = indicate[z]
  142. if k and k.visible and z ~= id then
  143. indicate[z].visible = false
  144. end
  145. end
  146. return true
  147. end
  148. end
  149. end
  150. if config.ManualLock then
  151. local targetFind = targetFind
  152. local mOver = targetFind:GetClosestToMouse(me,999999)
  153. if mOver and GetDistance2D(mOver, client.mousePosition) < 300 then
  154. if victim and victim == mOver then
  155. indicate[victim.playerId].visible = false
  156. victim = nil
  157. targetlock = false
  158. return false
  159. else
  160. victim = mOver
  161. indicate[victim.playerId].visible = false
  162. targetlock = true
  163. enemyHP = victim.health
  164. return false
  165. end
  166. elseif victim then
  167. indicate[victim.playerId].visible = false
  168. victim = nil
  169. targetlock = false
  170. return false
  171. end
  172. end
  173. elseif msg == KEY_UP then
  174. if code == blinktoggle then
  175. useblink = not useblink
  176. return true
  177. elseif code == config.Retreat then
  178. retreat = not retreat
  179. return true
  180. elseif code == config.Harras then
  181. harras = not harras
  182. return true
  183. elseif config.EnableComboKeys and buttons[1] then
  184. if code == config.Combo1 or code == config.Combo2 or code == config.Combo3 then
  185. local me = entityList:GetMyHero()
  186. local invoke, refresher = me:GetAbility(6), me:FindItem("item_refresher")
  187. if invoke.level < 4 then
  188. buttons[1].txt.text = "Need Invoke lvl 4!" Sleep(1000,"refbutton")
  189. elseif not me:AghanimState() then
  190. buttons[1].txt.text = "Need Aghanims!" Sleep(1000,"refbutton")
  191. elseif not refresher then
  192. buttons[1].txt.text = "Need Refresher!" Sleep(1000,"refbutton")
  193. elseif not refresher:CanBeCasted() and refresher.cd > 10 then
  194. buttons[1].txt.text = "Refresher is on cd!" Sleep(1000,"refbutton")
  195. elseif code == config.Combo1 then
  196. combo = 1
  197. comboready = false
  198. elseif code == config.Combo2 then
  199. combo = 2
  200. comboready = false
  201. elseif code == config.Combo3 then
  202. combo = 3
  203. comboready = false
  204. end
  205. end
  206. end
  207. end
  208. end
  209.  
  210. function buttonClick(b1,b2,t)
  211. if not t.visible and t.text ~= "Cancel" then return end
  212. if buttons[1] and t.text == buttons[1].txt.text then
  213. if buttons[5] and buttons[5].obj then
  214. buttons[5].obj.visible = false buttons[5].out.visible = false buttons[5].txt.visible = false
  215. end
  216. local me = entityList:GetMyHero()
  217. local invoke, refresher = me:GetAbility(6), me:FindItem("item_refresher")
  218. if invoke.level < 4 then
  219. buttons[1].txt.text = "Need Invoke lvl 4!" Sleep(1000,"refbutton")
  220. elseif not me:AghanimState() then
  221. buttons[1].txt.text = "Need Aghanims!" Sleep(1000,"refbutton")
  222. elseif not refresher then
  223. buttons[1].txt.text = "Need Refresher!" Sleep(1000,"refbutton")
  224. elseif not refresher:CanBeCasted() and refresher.cd > 10 then
  225. buttons[1].txt.text = "Refresher is on cd!" Sleep(1000,"refbutton")
  226. else
  227. if buttons[2].obj.visible then
  228. buttons[2].obj.visible = false buttons[2].out.visible = false buttons[2].txt.visible = false
  229. buttons[3].obj.visible = false buttons[3].out.visible = false buttons[3].txt.visible = false
  230. buttons[4].obj.visible = false buttons[4].out.visible = false buttons[4].txt.visible = false
  231. else
  232. buttons[2].obj.visible = true buttons[2].out.visible = true buttons[2].txt.visible = true
  233. buttons[3].obj.visible = true buttons[3].out.visible = true buttons[3].txt.visible = true
  234. buttons[4].obj.visible = true buttons[4].out.visible = true buttons[4].txt.visible = true
  235. end
  236. end
  237. elseif t.text == "Combo 1" then
  238. buttons[2].obj.visible = false buttons[2].out.visible = false buttons[2].txt.visible = false
  239. buttons[3].obj.visible = false buttons[3].out.visible = false buttons[3].txt.visible = false
  240. buttons[4].obj.visible = false buttons[4].out.visible = false buttons[4].txt.visible = false
  241. comboready = false
  242. combo = 1
  243. elseif t.text == "Combo 2" then
  244. buttons[2].obj.visible = false buttons[2].out.visible = false buttons[2].txt.visible = false
  245. buttons[3].obj.visible = false buttons[3].out.visible = false buttons[3].txt.visible = false
  246. buttons[4].obj.visible = false buttons[4].out.visible = false buttons[4].txt.visible = false
  247. comboready = false
  248. combo = 2
  249. elseif t.text == "Combo 3" then
  250. buttons[2].obj.visible = false buttons[2].out.visible = false buttons[2].txt.visible = false
  251. buttons[3].obj.visible = false buttons[3].out.visible = false buttons[3].txt.visible = false
  252. buttons[4].obj.visible = false buttons[4].out.visible = false buttons[4].txt.visible = false
  253. comboready = false
  254. combo = 3
  255. elseif t.text == "Cancel" then
  256. if buttons[2].obj.visible then
  257. buttons[2].obj.visible = false buttons[2].out.visible = false buttons[2].txt.visible = false
  258. buttons[3].obj.visible = false buttons[3].out.visible = false buttons[3].txt.visible = false
  259. buttons[4].obj.visible = false buttons[4].out.visible = false buttons[4].txt.visible = false
  260. comboready = false
  261. combo = 1
  262. else
  263. comboready = false
  264. combo = 0
  265. end
  266. end
  267. end
  268.  
  269. function Main(tick)
  270. if client.gameTime > 1 then
  271. versionSign.visible = false
  272. infoSign.visible = false
  273. else
  274. local up,ver,beta,info = Version()
  275. if up then
  276. if beta ~= "" then
  277. versionSign.text = "Your version of Moones's Combo Script is up-to-date! (v"..currentVersion.." "..Beta..")"
  278. else
  279. versionSign.text = "Your version of Moones's Combo Script is up-to-date! (v"..currentVersion..")"
  280. end
  281. versionSign.color = 0x66FF33FF
  282. if info then
  283. infoSign.text = info
  284. infoSign.visible = true
  285. end
  286. end
  287. if outdated then
  288. if beta ~= "" then
  289. versionSign.text = "Your version of Moones's Combo Script is OUTDATED (Yours: v"..currentVersion.." "..Beta.." Current: v"..ver.." "..beta..")"
  290. else
  291. versionSign.text = "Your version of Moones's Combo Script is OUTDATED (Yours: v"..currentVersion.." "..Beta.." Current: v"..ver..")"
  292. end
  293. versionSign.color = 0xFF6600FF
  294. if info then
  295. infoSign.text = info
  296. infoSign.visible = true
  297. end
  298. end
  299. versionSign.visible = true
  300. end
  301.  
  302. local client, PlayingGame = client, PlayingGame
  303. if not PlayingGame() or client.paused then return end
  304. local GetDistance2D = GetDistance2D
  305. local mathmax, tablesort, AbilityDamageGetDamage, AbilityDamageGetDmgType, Sleep, SleepCheck, SkillShotPredictedXYZ, SkillShotSkillShotXYZ = math.max, table.sort, AbilityDamage.GetDamage, AbilityDamage.GetDmgType, Sleep, SleepCheck, SkillShot.PredictedXYZ, SkillShot.SkillShotXYZ
  306. local tempmyhero, IsKeyDown, targetFind, entityList, SkillShotBlockableSkillShotXYZ, chainStun = myhero, IsKeyDown, targetFind, entityList, SkillShot.BlockableSkillShotXYZ, chainStun
  307. local me, player = entityList:GetMyHero(), entityList:GetMyPlayer()
  308. local mathfloor, mathceil, mathmin, mathsqrt, mathrad, mathabs, mathcos, mathsin = math.floor, math.ceil, math.min, math.sqrt, math.rad, math.abs, math.cos, math.sin
  309. local LuaEntity, LuaEntityAbility, LuaEntityHero, LuaEntityNPC = LuaEntity, LuaEntityAbility, LuaEntityHero, LuaEntityNPC
  310. local drawMgr, Animations, SkillShot = drawMgr, Animations, SkillShot
  311. local config, tostring, myId, gameTime = config, tostring, myId, client.gameTime
  312. local tempvictim, comboTable, tempattack, tempmove, temptype, itemcomboTable, tempdamageTable, invokerCombo = victim, comboTable, attack, move, type, itemcomboTable, damageTable, invokerCombo
  313. local abilities = me.abilities
  314.  
  315. local ID = me.classId if ID ~= myId then Close() end
  316. Animations.entities = {}
  317. local anientiCount = 0
  318. if me.alive then
  319. anientiCount = 0
  320. Animations.entities[1] = me
  321. end
  322.  
  323. if not mySpells then
  324. local l = #comboTable
  325. for i = 1, l do
  326. local table = comboTable[i]
  327. if table[1] == ID then
  328. mySpells = table
  329. end
  330. end
  331. end
  332.  
  333. function DoesHaveModifier(name) return(me:DoesHaveModifier(name)) end
  334. local KeyPressed = (IsKeyDown(chasekey) or IsKeyDown(config.Retreat) or IsKeyDown(config.Harras)) and not client.chat
  335.  
  336. if tempvictim then
  337. if KeyPressed then
  338. local name = tempvictim.name
  339. if retreat then
  340. if targetlock then
  341. statusText.text = "Retreating from "..client:Localize(name).." (LOCKED)"
  342. else
  343. statusText.text = "Retreating from "..client:Localize(name)
  344. end
  345. elseif harras then
  346. if targetlock then
  347. statusText.text = "Harrassing: "..client:Localize(name).." (LOCKED)"
  348. else
  349. statusText.text = "Harrassing: "..client:Localize(name)
  350. end
  351. else
  352. if targetlock then
  353. statusText.text = "Chasing: "..client:Localize(name).." (LOCKED)"
  354. else
  355. statusText.text = "Chasing: "..client:Localize(name)
  356. end
  357. end
  358. elseif resettime then
  359. local name = tempvictim.name
  360. if targetlock then
  361. statusText.text = "Locked on "..client:Localize(name).." ("..tostring(mathfloor(-(gameTime-resettime-6)))..")"
  362. else
  363. statusText.text = "AutoLocked on "..client:Localize(name).." ("..tostring(mathfloor(-(gameTime-resettime-6)))..")"
  364. end
  365. end
  366. statusText.visible = true
  367. local sizeX = (F14:GetTextSize(statusText.text).x)/2.5
  368. statusText.x = client.mouseScreenPosition.x-sizeX
  369. statusText.y = client.mouseScreenPosition.y-client.screenSize.x*0.01
  370. else
  371. retreat = nil
  372. resettime = nil
  373. if KeyPressed then
  374. statusText.visible = true
  375. if config.TargetLowestHP and not config.TargetClosestToMouse then
  376. statusText.text = "Looking for a lowest HP target in "..tostring(config.TargetFindRange).." range!"
  377. elseif not config.TargetLowestHP and config.TargetClosestToMouse then
  378. statusText.text = "Looking for a closest to mouse target in "..tostring(config.TargetFindRange).." range!"
  379. else
  380. statusText.text = "Looking for a target in "..tostring(config.TargetFindRange).." range!"
  381. end
  382. local sizeX = (F14:GetTextSize(statusText.text).x)/2.5
  383. statusText.x = client.mouseScreenPosition.x-sizeX
  384. statusText.y = client.mouseScreenPosition.y-client.screenSize.x*0.01
  385. else
  386. statusText.visible = false
  387. end
  388. end
  389. local enemies = nil
  390. local disruptor = entityList:GetEntities({classId=CDOTA_Unit_Hero_Disruptor,alive=true,visible=true})[1]
  391. if ID == CDOTA_Unit_Hero_Disruptor or disruptor then
  392. enemies = entityList:GetEntities({type=LuaEntity.TYPE_HERO,alive=true,visible=true,team=me:GetEnemyTeam()})
  393. for i = 1, #enemies do
  394. local v = enemies[i]
  395. if not positionsTable[v.handle] then positionsTable[v.handle] = {} end
  396. local time = gameTime
  397. if not positionsTable[v.handle][time] then
  398. positionsTable[v.handle][time] = v.position
  399. end
  400. for lasttime,pos in pairs(positionsTable[v.handle]) do
  401. if (time-lasttime) > 5 then positionsTable[v.handle][lasttime] = nil end
  402. end
  403. end
  404. end
  405. if ID == CDOTA_Unit_Hero_Rubick and SleepCheck("rubiiick") then
  406. enemies = entityList:GetEntities({type=LuaEntity.TYPE_HERO,alive=true,visible=true,team=me:GetEnemyTeam()})
  407. local a5 = me:GetAbility(5)
  408. local steal = me:FindSpell("rubick_spell_steal")
  409. local possibleSteal = nil
  410. local possibleStealfrom = nil
  411. local glimpse = me:FindSpell("disruptor_glimpse")
  412. for i = 1, #enemies do
  413. local v = enemies[i]
  414. if glimpse and not disruptor then
  415. if not positionsTable[v.handle] then positionsTable[v.handle] = {} end
  416. local time = gameTime
  417. if not positionsTable[v.handle][time] then
  418. positionsTable[v.handle][time] = v.position
  419. end
  420. for lasttime,pos in pairs(positionsTable[v.handle]) do
  421. if (time-lasttime) > 5 then positionsTable[v.handle][lasttime] = nil end
  422. end
  423. end
  424. anientiCount = anientiCount + 1
  425. Animations.entities[anientiCount] = v
  426. local abis = v.abilities
  427. for z = 1, #abis do
  428. local spell = abis[z]
  429. if not spell:IsBehaviourType(LuaEntityAbility.BEHAVIOR_PASSIVE) and spell.level > 0 then
  430. local octa = v:FindItem("item_octarine_core")
  431. local spellcd = spell:GetCooldown(spell.level)
  432. if octa then
  433. spellcd = spellcd*0.75
  434. end
  435. spellcd = spellcd-math.max(client.latency/1000,0.1)
  436. if spell.cd > spellcd and spell.cd > 0 then
  437. LastCastedTable[v.handle] = spell.name
  438. elseif spell.abilityPhase and (spell:FindCastPoint() - Animations.getDuration(spell)/1000) < (0.1+client.latency/1000+me:GetTurnTime(v)) then
  439. LastCastedTable[v.handle] = spell.name
  440. end
  441. end
  442. end
  443. if steal:CanBeCasted() and (a5.cd > 3 or a5.manacost > me.mana or a5.name == "rubick_empty1") then
  444. if LastCastedTable[v.handle] and a5.name ~= LastCastedTable[v.handle] and LastCastedTable[v.handle] ~= "invoker_invoke" then
  445. local stolenspell = v:FindSpell(LastCastedTable[v.handle])
  446. if not RubickNoSpellSteals[stolenspell.name] then
  447. if not possibleSteal or ((not RubickSpellSteals[possibleSteal.name] and RubickSpellSteals[stolenspell.name])
  448. or (RubickSpellSteals[possibleSteal.name] and RubickSpellSteals[stolenspell.name] and RubickSpellSteals[stolenspell.name] > RubickSpellSteals[possibleSteal.name])
  449. or (possibleSteal.abilityType ~= LuaEntityAbility.TYPE_ULTIMATE and stolenspell.abilityType == LuaEntityAbility.TYPE_ULTIMATE)
  450. or (not RubickSpellSteals[possibleSteal.name] and possibleSteal.manacost > stolenspell.manacost and possibleSteal:GetCooldown(possibleSteal.level) < stolenspell:GetCooldown(stolenspell.level))) then
  451. possibleSteal = stolenspell
  452. possibleStealfrom = v
  453. end
  454. end
  455. end
  456. end
  457. end
  458. if possibleStealfrom and ((not RubickSpellSteals[a5.name] and RubickSpellSteals[possibleSteal.name])
  459. or (RubickSpellSteals[a5.name] and RubickSpellSteals[possibleSteal.name] and RubickSpellSteals[possibleSteal.name] > RubickSpellSteals[a5.name])
  460. or (a5.abilityType ~= LuaEntityAbility.TYPE_ULTIMATE and possibleSteal.abilityType == LuaEntityAbility.TYPE_ULTIMATE)
  461. or (not RubickSpellSteals[possibleSteal.name] and a5.manacost > possibleSteal.manacost and a5:GetCooldown(a5.level) < possibleSteal:GetCooldown(possibleSteal.level))) then
  462. if GetDistance2D(possibleStealfrom,me) < steal.castRange+100 and me:CanCast() and not me:IsChanneling() and not me:IsInvisible() and not channelactive then
  463. me:CastAbility(steal,possibleStealfrom)
  464. Sleep(client.latency+me:GetTurnTime(possibleStealfrom)*1000+100,"casting")
  465. Sleep(250,"rubiiick")
  466. return
  467. end
  468. end
  469. end
  470. local sunstrike = me:FindSpell("invoker_sun_strike")
  471. if not me:IsInvisible() and not me:IsChanneling() and sunstrike and combo == 0 and SleepCheck("strike") then
  472. if not enemies then
  473. enemies = entityList:GetEntities({type=LuaEntity.TYPE_HERO,alive=true,visible=true,team=me:GetEnemyTeam()})
  474. end
  475. local Dmg = AbilityDamageGetDamage(sunstrike)
  476. local killable = nil
  477. for i = 1, #enemies do
  478. local v = enemies[i]
  479. if not directiontable[v.handle] then directiontable[v.handle] = {v.rotR, gameTime, 0}
  480. elseif mathabs(directiontable[v.handle][1]-v.rotR) < 0.5 then local time = gameTime - directiontable[v.handle][2] directiontable[v.handle] = {v.rotR, directiontable[v.handle][2], time}
  481. else directiontable[v.handle] = {v.rotR, gameTime, 0}
  482. end
  483. Dmg = v:DamageTaken(Dmg,DAMAGE_PURE,me)
  484. if directiontable[v.handle][3] > 3 and not v:IsIllusion() and ((KSSS and v.health <= Dmg) or (v.health < (v.maxHealth/2) and stunDuration(v) > (1.7 - 150/v.movespeed) and DSS and ((not v:IsInvul() and not v:DoesHaveModifier("modifier_invoker_tornado") and not v:DoesHaveModifier("modifier_eul_cyclone")) or chainStun(v,1.7+client.latency/1000+(1/Animations.maxCount)*0.5+me:GetTurnTime(v))))) then
  485. killable = v
  486. break
  487. end
  488. end
  489. if killable and killable.alive and killable.visible and (sunstrike:CanBeCasted() or ID == CDOTA_Unit_Hero_Invoker) and sunstrike.cd == 0 and sunstrike.manacost < me.mana and me:CanCast() then
  490. local delay = me:GetTurnTime(killable)*1000+client.latency+1700+(1/Animations.maxCount)*500
  491. if killable:IsHexed() then delay = delay/2 end
  492. local pred = SkillShotPredictedXYZ(killable,delay)
  493. if killable:IsStunned() or killable:IsRooted() then pred = killable.position end
  494. local position = nil
  495. local unitnum = 0
  496. local closest = nil
  497. local units = {}
  498. local unitsCount = 0
  499. local lanecreeps = entityList:GetEntities({classId=CDOTA_BaseNPC_Creep_Lane,team=me:GetEnemyTeam(),visible=true})
  500. local fam = entityList:GetEntities({classId=CDOTA_Unit_VisageFamiliar,team=me:GetEnemyTeam(),visible=true})
  501. local boar = entityList:GetEntities({classId=CDOTA_Unit_Hero_Beastmaster_Boar,team=me:GetEnemyTeam(),visible=true})
  502. local forg = entityList:GetEntities({classId=CDOTA_BaseNPC_Invoker_Forged_Spirit,team=me:GetEnemyTeam(),visible=true})
  503. for i = 1, #lanecreeps do local v = lanecreeps[i] if not v:IsInvul() and v.alive and v.spawned then unitsCount = unitsCount + 1 units[unitsCount] = v end end
  504. for i = 1, #fam do local v = fam[i] if not v:IsInvul() and v.alive then unitsCount = unitsCount + 1 units[unitsCount] = v end end
  505. for i = 1, #boar do local v = boar[i] if not v:IsInvul() and v.alive then unitsCount = unitsCount + 1 units[unitsCount] = v end end
  506. for i = 1, #forg do local v = forg[i] if not v:IsInvul() and v.alive then unitsCount = unitsCount + 1 units[unitsCount] = v end end
  507. for i = 1, #enemies do local v = enemies[i] if not v:IsInvul() and v.handle ~= killable.handle and v.alive then unitsCount = unitsCount + 1 units[unitsCount] = v end end
  508. for i = 1, unitsCount do
  509. local v = units[i]
  510. if GetDistance2D(v,pred) < 200 then
  511. if not position then
  512. position = v.position
  513. unitnum = 1
  514. else
  515. position = position + v.position
  516. unitnum = unitnum + 1
  517. end
  518. if not closest or GetDistance2D(v,pred) < GetDistance2D(closest,pred) then
  519. closest = v
  520. end
  521. end
  522. end
  523. if position then
  524. position = position/unitnum
  525. pred = (pred - position) * (200) / GetDistance2D(pred,position) + position
  526. end
  527. if pred then
  528. local invoked = false
  529. if sunstrike and not sunstrike:CanBeCasted() and sunstrike.cd == 0 and sunstrike.manacost < me.mana then
  530. prepareSpell("invoker_sun_strike",me)
  531. invoked = true
  532. end
  533. if sunstrike:CanBeCasted() or invoked then
  534. me:CastAbility(sunstrike,pred)
  535. Sleep(250,"strike")
  536. end
  537. end
  538. end
  539. end
  540.  
  541. if ID == CDOTA_Unit_Hero_EarthSpirit then
  542. if not HUD then
  543. local hudW = client.screenSize.x*0.18
  544. local hudH = client.screenSize.y*0.04
  545. HUD = EasyHUD.new(client.screenSize.x*0.39,client.screenSize.y*0.75,hudW,hudH,"Moones's Combo Script - Earth Spirit Menu",54619000,99333580,true,true)
  546. HUD:AddCheckbox(HUD.w*0.25,HUD.h*0.25,HUD.h*0.5,HUD.h*0.5,"Use Spells to mouse position",nil,EStoMouse);
  547. end
  548. EStoMouse = HUD:IsChecked(3)
  549. elseif ID == CDOTA_Unit_Hero_Invoker then
  550. if not HUD then
  551. local sizeX = (textFont:GetTextSize("Invoke Spells: ").x)+10
  552. local sizeY = (textFont:GetTextSize("Invoke Spells: ").y)*1.3
  553. local hudW = client.screenSize.x*0.18
  554. local hudH = client.screenSize.y*0.04
  555. local size1 = (textFont:GetTextSize("Refresher Combos").x)
  556. local size2 = (textFont:GetTextSize("Combo 1").x)
  557. if hudW < (sizeX+(sizeY)*10.6+sizeY*2.5+size1+size2+20) then hudW = (sizeX+(sizeY)*10.6+sizeY*2.5+size1+size2+20)*1.02 end
  558. if hudH < (sizeY*2+hudH*0.50) then hudH = (sizeY*2+hudH*0.50)*1.02 end
  559. HUD = EasyHUD.new(client.screenSize.x*0.39,client.screenSize.y*0.75,hudW,hudH,"Moones's Combo Script - Invoker Menu",54619000,99333580,true,true)
  560. local out
  561. HUD:AddText(HUD.w*0.02,HUD.h*0.25,'Invoke Spells: ')
  562. coldsnapButtonID, coldsnapButton, out, coldsnapButtonTEXT = HUD:AddButton(sizeX,HUD.h*0.25,sizeY,sizeY,0x000000ff,"",invokeColdsnap)
  563. coldsnapButton.textureId = drawMgr:GetTextureId("NyanUI/spellicons/invoker_cold_snap")
  564. ghostwalkButtonID, ghostwalkButton, out, ghostwalkButtonTEXT = HUD:AddButton(sizeX+(sizeY),HUD.h*0.25,sizeY,sizeY,0x000000ff,"",invokeGhostwalk)
  565. ghostwalkButton.textureId = drawMgr:GetTextureId("NyanUI/spellicons/invoker_ghost_walk")
  566. icewallButtonID, icewallButton, out, icewallButtonTEXT = HUD:AddButton(sizeX+(sizeY)*2,HUD.h*0.25,sizeY,sizeY,0x000000ff,"",invokeIcewall)
  567. icewallButton.textureId = drawMgr:GetTextureId("NyanUI/spellicons/invoker_ice_wall")
  568. empButtonID, empButton, out, empButtonTEXT = HUD:AddButton(sizeX+(sizeY)*3,HUD.h*0.25,sizeY,sizeY,0x000000ff,"",invokeEmp)
  569. empButton.textureId = drawMgr:GetTextureId("NyanUI/spellicons/invoker_emp")
  570. tornadoButtonID, tornadoButton, out, tornadoButtonTEXT = HUD:AddButton(sizeX+(sizeY)*4,HUD.h*0.25,sizeY,sizeY,0x000000ff,"",invokeTornado)
  571. tornadoButton.textureId = drawMgr:GetTextureId("NyanUI/spellicons/invoker_tornado")
  572. alacrityButtonID, alacrityButton, out, alacrityButtonTEXT = HUD:AddButton(sizeX+(sizeY)*5,HUD.h*0.25,sizeY,sizeY,0x000000ff,"",invokeAlacrity)
  573. alacrityButton.textureId = drawMgr:GetTextureId("NyanUI/spellicons/invoker_alacrity")
  574. sunstrikeButtonID, sunstrikeButton, out, sunstrikeButtonTEXT = HUD:AddButton(sizeX+(sizeY)*6,HUD.h*0.25,sizeY,sizeY,0x000000ff,"",invokeSunstrike)
  575. sunstrikeButton.textureId = drawMgr:GetTextureId("NyanUI/spellicons/invoker_sun_strike")
  576. forgespiritButtonID, forgespiritButton, out, forgespiritButtonTEXT = HUD:AddButton(sizeX+(sizeY)*7,HUD.h*0.25,sizeY,sizeY,0x000000ff,"",invokeForgespirit)
  577. forgespiritButton.textureId = drawMgr:GetTextureId("NyanUI/spellicons/invoker_forge_spirit")
  578. chaosmeteorButtonID, chaosmeteorButton, out, chaosmeteorButtonTEXT = HUD:AddButton(sizeX+(sizeY)*8,HUD.h*0.25,sizeY,sizeY,0x000000ff,"",invokeChaosmeteor)
  579. chaosmeteorButton.textureId = drawMgr:GetTextureId("NyanUI/spellicons/invoker_chaos_meteor")
  580. blastButtonID, blastButton, out, blastButtonTEXT = HUD:AddButton(sizeX+(sizeY)*9,HUD.h*0.25,sizeY,sizeY,0x000000ff,"",invokeBlast)
  581. blastButton.textureId = drawMgr:GetTextureId("NyanUI/spellicons/invoker_deafening_blast")
  582. HUD:AddCheckbox(HUD.w*0.02,HUD.h*0.4+sizeY,sizeY/1.5,sizeY/2,"Auto SunStrike KillSteal",nil,KSSS);
  583. local sizeKS = (textFont:GetTextSize("Auto SunStrike KillSteal").x)+sizeY+10
  584. HUD:AddCheckbox(HUD.w*0.02+sizeKS,sizeY+HUD.h*0.4,sizeY/1.5,sizeY/2,"Auto SunStrike on disabled enemy",nil,DSS);
  585. buttons[1] = {}
  586. buttons[5] = {}
  587. buttons[5].id, buttons[5].obj, buttons[5].out, buttons[5].txt = HUD:AddButton(sizeX+(sizeY)*10.55+size1+sizeY + 20,HUD.h*0.25,sizeY + size2,sizeY,0x60615FFF,"Cancel",buttonClick)
  588. buttons[2] = {}
  589. buttons[2].id, buttons[2].obj, buttons[2].out, buttons[2].txt = HUD:AddButton(sizeX+(sizeY)*10.55+size1+sizeY + 20,HUD.h*0.25,sizeY + size2,sizeY,0x4560ff,"Combo 1",buttonClick)
  590. buttons[2].obj.visible = false buttons[2].out.visible = false buttons[2].txt.visible = false
  591. buttons[2].desc = {}
  592. buttons[2].desc.id, buttons[2].desc.obj = HUD:AddText(sizeX+(sizeY)*10.55+size1+sizeY*2+size2 + 20,HUD.h*0.25 + sizeY/6,"Tornado->EMP->Meteor->Blast->Refresher Orb->Meteor->Blast->EMP->Snap")
  593. buttons[2].desc.obj.visible = false
  594. buttons[3] = {}
  595. buttons[3].id, buttons[3].obj, buttons[3].out, buttons[3].txt = HUD:AddButton(sizeX+(sizeY)*10.55+size1+sizeY + 20,HUD.h*0.25 - sizeY*0.95,sizeY + size2,sizeY,0x4560ff,"Combo 2",buttonClick)
  596. buttons[3].obj.visible = false buttons[3].out.visible = false buttons[3].txt.visible = false
  597. buttons[3].desc = {}
  598. buttons[3].desc.id, buttons[3].desc.obj = HUD:AddText(sizeX+(sizeY)*10.55+size1+sizeY*2+size2 + 20,HUD.h*0.25 - sizeY*0.95 + sizeY/6,"Tornado->SS->Meteor->Blast->Refresher Orb->Meteor->Blast->SS->Snap")
  599. buttons[3].desc.obj.visible = false
  600. buttons[4] = {}
  601. buttons[4].id, buttons[4].obj, buttons[4].out, buttons[4].txt = HUD:AddButton(sizeX+(sizeY)*10.55+size1+sizeY + 20,HUD.h*0.25 - sizeY*1.95,sizeY + size2,sizeY,0x4560ff,"Combo 3",buttonClick)
  602. buttons[4].obj.visible = false buttons[4].out.visible = false buttons[4].txt.visible = false
  603. buttons[4].desc = {}
  604. buttons[4].desc.id, buttons[4].desc.obj = HUD:AddText(sizeX+(sizeY)*10.55+size1+sizeY*2+size2 + 20,HUD.h*0.25 - sizeY*1.95 + sizeY/6,"Snap->Meteor->Blast->SS->Refresher Orb->Blast->SS->Meteor->Snap")
  605. buttons[4].desc.obj.visible = false
  606. buttons[1].id, buttons[1].obj, buttons[1].out, buttons[1].txt = HUD:AddButton(sizeX+(sizeY)*10.6,HUD.h*0.25,size1 + sizeY + 20,sizeY,0x196100ff,"Refresher Combos",buttonClick)
  607. else
  608. local invokemana, spell1, spell2 = me:GetAbility(6).manacost, me:GetAbility(4), me:GetAbility(5)
  609. local snapmana,empmana,tornadomana,ssmana,meteormana,blastmana,refmana = 100,125,150,175,200,200,375
  610. local tornado = me:FindSpell("invoker_tornado")
  611. local coldsnap = me:FindSpell("invoker_cold_snap")
  612. local refresher = me:FindItem("item_refresher")
  613. local dagon = me:FindDagon()
  614. if buttons[1] then
  615. if combo ~= 0 then
  616. if not buttons[5] or not buttons[5].obj then
  617. local sizeX = (textFont:GetTextSize("Invoke Spells: ").x)+10
  618. local sizeY = (textFont:GetTextSize("Invoke Spells: ").y)*1.3
  619. local size1 = (textFont:GetTextSize("Refresher Combos").x)
  620. local size2 = (textFont:GetTextSize("Combo 1").x)
  621. buttons[5] = {}
  622. buttons[5].id, buttons[5].obj, buttons[5].out, buttons[5].txt = HUD:AddButton(sizeX+(sizeY)*10.55+size1+sizeY + 20,HUD.h*0.25,sizeY + size2,sizeY,0x60615FFF,"Cancel",buttonClick)
  623. else
  624. buttons[5].obj.visible = true buttons[5].out.visible = true buttons[5].txt.visible = true
  625. end
  626. elseif buttons[5] and buttons[5].obj then
  627. buttons[5].obj.visible = false buttons[5].out.visible = false buttons[5].txt.visible = false
  628. end
  629. if combo == 0 and SleepCheck("refbutton") then
  630. buttons[1].txt.text = "Refresher Combos"
  631. elseif combo == 1 then
  632. mySpells = { CDOTA_Unit_Hero_Invoker, invokerCombo[5] }
  633. local manacost = tornadomana+empmana*2+meteormana*2+blastmana*2+refmana+invokemana*2
  634. if manacost > me.mana and not comboready then
  635. buttons[1].txt.text = "Need "..math.floor(manacost-me.mana).." more mana!" Sleep(1000,"refbutton") combo = 0
  636. elseif spell1.name == "invoker_emp" and spell2.name == "invoker_deafening_blast" and spell2.cd > 0 and refresher.cd > 0 then
  637. if SleepCheck("casting2") then prepareSpell("invoker_cold_snap",me) end
  638. elseif spell1.name == "invoker_cold_snap" and spell2.name == "invoker_emp" and spell1.cd > 0 and spell2.cd > 0 and refresher.cd > 0 and comboready then
  639. comboready = false combo = 0
  640. elseif spell1.name == "invoker_emp" and spell2.name == "invoker_tornado" and spell2.cd > 0 then
  641. if SleepCheck("casting2") then prepareSpell("invoker_chaos_meteor",me) end
  642. elseif spell1.name == "invoker_chaos_meteor" and spell2.name == "invoker_emp" and spell2.cd > 0 and tornado.cd > 0 then
  643. if SleepCheck("casting2") then prepareSpell("invoker_deafening_blast",me) end
  644. elseif (not dagon or not dagon:CanBeCasted()) and spell1.name == "invoker_deafening_blast" and spell2.name == "invoker_chaos_meteor" and spell2.cd > 0 and spell1.cd > 0 and refresher:CanBeCasted() and SleepCheck("refresher") then
  645. me:CastAbility(refresher)
  646. Sleep(500,"refresher")
  647. Sleep(100,"casting")
  648. return
  649. elseif spell1.name == "invoker_deafening_blast" and spell2.name == "invoker_chaos_meteor" and spell2.cd > 0 and spell1.cd > 0 and not refresher:CanBeCasted() then
  650. if SleepCheck("casting2") then prepareSpell("invoker_emp",me) end
  651. elseif (spell1.name ~= "invoker_emp" or spell2.name ~= "invoker_tornado") and not comboready then
  652. buttons[1].txt.text = "Preparing Combo 1"
  653. if (spell1.name ~= "invoker_emp" and spell2.name ~= "invoker_tornado" and spell1.name ~= "invoker_tornado") or (spell1.name ~= "invoker_emp" and spell2.name == "invoker_tornado") or (spell1.name == "invoker_emp" and spell2.name ~= "invoker_tornado") then
  654. if SleepCheck("casting2") then prepareSpell("invoker_tornado",me) end
  655. elseif spell1.name == "invoker_tornado" then
  656. if SleepCheck("casting2") then prepareSpell("invoker_emp",me) end
  657. end
  658. elseif (spell1.name ~= "invoker_emp" or spell2.name ~= "invoker_tornado") and not comboready then
  659. buttons[1].txt.text = "Preparing Combo 1"
  660. if (spell1.name ~= "invoker_emp" and spell2.name ~= "invoker_tornado" and spell1.name ~= "invoker_tornado") or (spell1.name ~= "invoker_emp" and spell2.name == "invoker_tornado") or (spell1.name == "invoker_emp" and spell2.name ~= "invoker_tornado") then
  661. if SleepCheck("casting2") then prepareSpell("invoker_tornado",me) end
  662. elseif spell1.name == "invoker_tornado" then
  663. if SleepCheck("casting2") then prepareSpell("invoker_emp",me) end
  664. end
  665. else
  666. if KeyPressed then
  667. buttons[1].txt.text = "Casting Combo 1!"
  668. else
  669. buttons[1].txt.text = "Combo 1 prepared!"
  670. comboready = true
  671. end
  672. end
  673. elseif combo == 2 then
  674. mySpells = { CDOTA_Unit_Hero_Invoker, invokerCombo[6] }
  675. local manacost = tornadomana+ssmana*2+meteormana*2+blastmana*2+refmana+invokemana*2
  676. if manacost > me.mana and not comboready then
  677. buttons[1].txt.text = "Need "..math.floor(manacost-me.mana).." more mana!" Sleep(1000,"refbutton") combo = 0
  678. elseif spell1.name == "invoker_sun_strike" and spell2.name == "invoker_deafening_blast" and spell2.cd > 0 and refresher.cd > 0 then
  679. if SleepCheck("casting2") then prepareSpell("invoker_cold_snap",me) end
  680. elseif spell1.name == "invoker_cold_snap" and spell2.name == "invoker_sun_strike" and spell1.cd > 0 and spell2.cd > 0 and refresher.cd > 0 and comboready then
  681. comboready = false combo = 0
  682. elseif spell1.name == "invoker_sun_strike" and spell2.name == "invoker_tornado" and spell2.cd > 0 then
  683. if SleepCheck("casting2") then prepareSpell("invoker_chaos_meteor",me) end
  684. elseif spell1.name == "invoker_chaos_meteor" and spell2.name == "invoker_sun_strike" and spell2.cd > 0 and tornado.cd > 0 then
  685. if SleepCheck("casting2") then prepareSpell("invoker_deafening_blast",me) end
  686. elseif (not dagon or not dagon:CanBeCasted()) and spell1.name == "invoker_deafening_blast" and spell2.name == "invoker_chaos_meteor" and spell2.cd > 0 and spell1.cd > 0 and refresher:CanBeCasted() and SleepCheck("refresher") then
  687. me:CastAbility(refresher)
  688. Sleep(500,"refresher")
  689. Sleep(100,"casting")
  690. return
  691. elseif spell1.name == "invoker_deafening_blast" and spell2.name == "invoker_chaos_meteor" and spell2.cd > 0 and spell1.cd > 0 and not refresher:CanBeCasted() then
  692. if SleepCheck("casting2") then prepareSpell("invoker_sun_strike",me) end
  693. elseif (spell1.name ~= "invoker_sun_strike" or spell2.name ~= "invoker_tornado") and not comboready then
  694. buttons[1].txt.text = "Preparing Combo 2"
  695. if (spell1.name ~= "invoker_sun_strike" and spell2.name ~= "invoker_tornado" and spell1.name ~= "invoker_tornado") or (spell1.name ~= "invoker_sun_strike" and spell2.name == "invoker_tornado") or (spell1.name == "invoker_sun_strike" and spell2.name ~= "invoker_tornado") then
  696. if SleepCheck("casting2") then prepareSpell("invoker_tornado",me) end
  697. elseif spell1.name == "invoker_tornado" then
  698. if SleepCheck("casting2") then prepareSpell("invoker_sun_strike",me) end
  699. end
  700. elseif (spell1.name ~= "invoker_sun_strike" or spell2.name ~= "invoker_tornado") and not comboready then
  701. buttons[1].txt.text = "Preparing Combo 2"
  702. if (spell1.name ~= "invoker_sun_strike" and spell2.name ~= "invoker_tornado" and spell1.name ~= "invoker_tornado") or (spell1.name ~= "invoker_sun_strike" and spell2.name == "invoker_tornado") or (spell1.name == "invoker_sun_strike" and spell2.name ~= "invoker_tornado") then
  703. if SleepCheck("casting2") then prepareSpell("invoker_tornado",me) end
  704. elseif spell1.name == "invoker_tornado" then
  705. if SleepCheck("casting2") then prepareSpell("invoker_sun_strike",me) end
  706. end
  707. else
  708. if KeyPressed then
  709. buttons[1].txt.text = "Casting Combo 2!"
  710. else
  711. buttons[1].txt.text = "Combo 2 prepared!"
  712. comboready = true
  713. end
  714. end
  715. elseif combo == 3 then
  716. mySpells = { CDOTA_Unit_Hero_Invoker, invokerCombo[7] }
  717. local manacost = snapmana+meteormana*2+ssmana*2+blastmana+refmana+invokemana*2
  718. if manacost > me.mana and not comboready then
  719. buttons[1].txt.text = "Need "..math.floor(manacost-me.mana).." more mana!" Sleep(1000,"refbutton") combo = 0
  720. elseif spell1.name == "invoker_cold_snap" and spell2.name == "invoker_chaos_meteor" and spell1.cd > 0 and spell2.cd > 0 and refresher.cd > 0 and comboready then
  721. comboready = false combo = 0
  722. elseif spell1.name == "invoker_chaos_meteor" and spell2.name == "invoker_cold_snap" and spell2.cd > 0 then
  723. if SleepCheck("casting2") then prepareSpell("invoker_deafening_blast",me) end
  724. elseif spell1.name == "invoker_chaos_meteor" and spell2.name == "invoker_sun_strike" and spell2.cd > 0 and not refresher:CanBeCasted() then
  725. if SleepCheck("casting2") then prepareSpell("invoker_cold_snap",me) end
  726. elseif spell1.name == "invoker_deafening_blast" and spell2.name == "invoker_chaos_meteor" and spell2.cd > 0 and coldsnap.cd > 0 then
  727. if SleepCheck("casting2") then prepareSpell("invoker_sun_strike",me) end
  728. elseif spell1.name == "invoker_sun_strike" and spell2.name == "invoker_deafening_blast" and spell2.cd > 0 and not refresher:CanBeCasted() then
  729. if SleepCheck("casting2") then prepareSpell("invoker_chaos_meteor",me) end
  730. elseif (not dagon or not dagon:CanBeCasted()) and spell1.name == "invoker_sun_strike" and spell2.name == "invoker_deafening_blast" and spell2.cd > 0 and spell1.cd > 0 and refresher:CanBeCasted() and SleepCheck("refresher") then
  731. me:CastAbility(refresher)
  732. Sleep(500,"refresher")
  733. Sleep(100,"casting")
  734. return
  735. elseif spell1.name == "invoker_deafening_blast" and spell2.name == "invoker_chaos_meteor" and spell2.cd > 0 and spell1.cd > 0 and not refresher:CanBeCasted() then
  736. if SleepCheck("casting2") then prepareSpell("invoker_chaos_meteor",me) end
  737. elseif (spell1.name ~= "invoker_chaos_meteor" or spell2.name ~= "invoker_cold_snap") and not comboready then
  738. buttons[1].txt.text = "Preparing Combo 3"
  739. if (spell1.name ~= "invoker_chaos_meteor" and spell2.name ~= "invoker_cold_snap" and spell1.name ~= "invoker_cold_snap") or (spell1.name ~= "invoker_chaos_meteor" and spell2.name == "invoker_cold_snap") or (spell1.name == "invoker_chaos_meteor" and spell2.name ~= "invoker_cold_snap") then
  740. if SleepCheck("casting2") then prepareSpell("invoker_cold_snap",me) end
  741. elseif spell1.name == "invoker_cold_snap" then
  742. if SleepCheck("casting2") then prepareSpell("invoker_chaos_meteor",me) end
  743. end
  744. elseif (spell1.name ~= "invoker_chaos_meteor" or spell2.name ~= "invoker_cold_snap") and not comboready then
  745. buttons[1].txt.text = "Preparing Combo 3"
  746. if (spell1.name ~= "invoker_chaos_meteor" and spell2.name ~= "invoker_cold_snap" and spell1.name ~= "invoker_cold_snap") or (spell1.name ~= "invoker_chaos_meteor" and spell2.name == "invoker_cold_snap") or (spell1.name == "invoker_chaos_meteor" and spell2.name ~= "invoker_cold_snap") then
  747. if SleepCheck("casting2") then prepareSpell("invoker_cold_snap",me) end
  748. elseif spell1.name == "invoker_cold_snap" then
  749. if SleepCheck("casting2") then prepareSpell("invoker_chaos_meteor",me) end
  750. end
  751. else
  752. if KeyPressed then
  753. buttons[1].txt.text = "Casting Combo 3!"
  754. else
  755. buttons[1].txt.text = "Combo 3 prepared!"
  756. comboready = true
  757. end
  758. end
  759. end
  760. end
  761. local mousePosition = client.mouseScreenPosition
  762. local hovered = false
  763. for i = 2, 4 do
  764. local v = buttons[i]
  765. local b = v.obj
  766. if b and b.visible and v.desc and IsInside(mousePosition.x,mousePosition.y,b.x,b.y,b.w,b.h) then
  767. buttons[i].desc.obj.visible = true
  768. hovered = true
  769. elseif b and v.desc then
  770. buttons[i].desc.obj.visible = false
  771. end
  772. if i == 2 then
  773. local manacost = tornadomana+empmana*2+meteormana*2+blastmana*2+refmana+invokemana*2
  774. if me.mana < manacost then
  775. buttons[i].obj.color = 0x60615FFF
  776. buttons[i].txt.color = 0x60615FFF
  777. buttons[i].desc.obj.text = "Need "..math.floor(manacost-me.mana).." more mana!"
  778. else
  779. buttons[i].desc.obj.text = "Tornado->EMP->Meteor->Blast->Refresher Orb->Meteor->Blast->EMP->Snap"
  780. buttons[i].obj.color = 0x4560ff
  781. buttons[i].txt.color = -1
  782. end
  783. elseif i == 3 then
  784. local manacost = tornadomana+ssmana*2+meteormana*2+blastmana*2+refmana+invokemana*2
  785. if me.mana < manacost then
  786. buttons[i].obj.color = 0x60615FFF
  787. buttons[i].txt.color = 0x60615FFF
  788. buttons[i].desc.obj.text = "Need "..math.floor(manacost-me.mana).." more mana!"
  789. else
  790. buttons[i].desc.obj.text = "Tornado->SS->Meteor->Blast->Refresher Orb->Meteor->Blast->SS->Snap"
  791. buttons[i].obj.color = 0x4560ff
  792. buttons[i].txt.color = -1
  793. end
  794. elseif i == 4 then
  795. local manacost = snapmana+meteormana*2+ssmana*2+blastmana+refmana+invokemana*2
  796. if me.mana < manacost then
  797. buttons[i].obj.color = 0x60615FFF
  798. buttons[i].txt.color = 0x60615FFF
  799. buttons[i].desc.obj.text = "Need "..math.floor(manacost-me.mana).." more mana!"
  800. else
  801. buttons[i].desc.obj.text = "Snap->Meteor->Blast->SS->Refresher Orb->Blast->SS->Meteor->Snap"
  802. buttons[i].obj.color = 0x4560ff
  803. buttons[i].txt.color = -1
  804. end
  805. end
  806. end
  807. if hovered then statusText.visible = false elseif KeyPressed then statusText.visible = true end
  808. end
  809.  
  810. KSSS = HUD:IsChecked(14)
  811. DSS = HUD:IsChecked(15)
  812. for i = 1, #abilities do
  813. local v = abilities[i]
  814. if v.name == "invoker_sun_strike" then
  815. if v.cd > 0 then
  816. local cd = mathfloor(v.cd)+1
  817. sunstrikeButtonTEXT.text = tostring(cd)
  818. if cd >= 10 then
  819. local sizeX = (textFont:GetTextSize(sunstrikeButtonTEXT.text).x)
  820. sunstrikeButtonTEXT.x = sunstrikeButton.x + sunstrikeButton.h/2 - sizeX/2
  821. else
  822. local sizeX = (textFont:GetTextSize(sunstrikeButtonTEXT.text).x)
  823. sunstrikeButtonTEXT.x = sunstrikeButton.x + sunstrikeButton.h/2 - sizeX/2
  824. end
  825. else
  826. sunstrikeButtonTEXT.text = ""
  827. end
  828. elseif v.name == "invoker_cold_snap" then
  829. if v.cd > 0 then
  830. local cd = mathfloor(v.cd)+1
  831. coldsnapButtonTEXT.text = tostring(cd)
  832. if cd >= 10 then
  833. local sizeX = (textFont:GetTextSize(coldsnapButtonTEXT.text).x)
  834. coldsnapButtonTEXT.x = coldsnapButton.x + coldsnapButton.h/2 - sizeX/2
  835. else
  836. local sizeX = (textFont:GetTextSize(coldsnapButtonTEXT.text).x)
  837. coldsnapButtonTEXT.x = coldsnapButton.x + coldsnapButton.h/2 - sizeX/2
  838. end
  839. else
  840. coldsnapButtonTEXT.text = ""
  841. end
  842. elseif v.name == "invoker_tornado" then
  843. if v.cd > 0 then
  844. local cd = mathfloor(v.cd)+1
  845. tornadoButtonTEXT.text = tostring(cd)
  846. if cd >= 10 then
  847. local sizeX = (textFont:GetTextSize(tornadoButtonTEXT.text).x)
  848. tornadoButtonTEXT.x = tornadoButton.x + tornadoButton.h/2 - sizeX/2
  849. else
  850. local sizeX = (textFont:GetTextSize(tornadoButtonTEXT.text).x)
  851. tornadoButtonTEXT.x = tornadoButton.x + tornadoButton.h/2 - sizeX/2
  852. end
  853. else
  854. tornadoButtonTEXT.text = ""
  855. end
  856. elseif v.name == "invoker_deafening_blast" then
  857. if v.cd > 0 then
  858. local cd = mathfloor(v.cd)+1
  859. blastButtonTEXT.text = tostring(cd)
  860. if cd >= 10 then
  861. local sizeX = (textFont:GetTextSize(blastButtonTEXT.text).x)
  862. blastButtonTEXT.x = blastButton.x + blastButton.h/2 - sizeX/2
  863. else
  864. local sizeX = (textFont:GetTextSize(blastButtonTEXT.text).x)
  865. blastButtonTEXT.x = blastButton.x + blastButton.h/2 - sizeX/2
  866. end
  867. else
  868. blastButtonTEXT.text = ""
  869. end
  870. elseif v.name == "invoker_forge_spirit" then
  871. if v.cd > 0 then
  872. local cd = mathfloor(v.cd)+1
  873. forgespiritButtonTEXT.text = tostring(cd)
  874. if cd >= 10 then
  875. local sizeX = (textFont:GetTextSize(forgespiritButtonTEXT.text).x)
  876. forgespiritButtonTEXT.x = forgespiritButton.x + forgespiritButton.h/2 - sizeX/2
  877. else
  878. local sizeX = (textFont:GetTextSize(forgespiritButtonTEXT.text).x)
  879. forgespiritButtonTEXT.x = forgespiritButton.x + forgespiritButton.h/2 - sizeX/2
  880. end
  881. else
  882. forgespiritButtonTEXT.text = ""
  883. end
  884. elseif v.name == "invoker_ice_wall" then
  885. if v.cd > 0 then
  886. local cd = mathfloor(v.cd)+1
  887. icewallButtonTEXT.text = tostring(cd)
  888. if cd >= 10 then
  889. local sizeX = (textFont:GetTextSize(icewallButtonTEXT.text).x)
  890. icewallButtonTEXT.x = icewallButton.x + icewallButton.h/2 - sizeX/2
  891. else
  892. local sizeX = (textFont:GetTextSize(icewallButtonTEXT.text).x)
  893. icewallButtonTEXT.x = icewallButton.x + icewallButton.h/2 - sizeX/2
  894. end
  895. else
  896. icewallButtonTEXT.text = ""
  897. end
  898. elseif v.name == "invoker_chaos_meteor" then
  899. if v.cd > 0 then
  900. local cd = mathfloor(v.cd)+1
  901. chaosmeteorButtonTEXT.text = tostring(cd)
  902. if cd >= 10 then
  903. local sizeX = (textFont:GetTextSize(chaosmeteorButtonTEXT.text).x)
  904. chaosmeteorButtonTEXT.x = chaosmeteorButton.x + chaosmeteorButton.h/2 - sizeX/2
  905. else
  906. local sizeX = (textFont:GetTextSize(chaosmeteorButtonTEXT.text).x)
  907. chaosmeteorButtonTEXT.x = chaosmeteorButton.x + chaosmeteorButton.h/2 - sizeX/2
  908. end
  909. else
  910. chaosmeteorButtonTEXT.text = ""
  911. end
  912. elseif v.name == "invoker_alacrity" then
  913. if v.cd > 0 then
  914. local cd = mathfloor(v.cd)+1
  915. alacrityButtonTEXT.text = tostring(cd)
  916. if cd >= 10 then
  917. local sizeX = (textFont:GetTextSize(alacrityButtonTEXT.text).x)
  918. alacrityButtonTEXT.x = alacrityButton.x + alacrityButton.h/2 - sizeX/2
  919. else
  920. local sizeX = (textFont:GetTextSize(alacrityButtonTEXT.text).x)
  921. alacrityButtonTEXT.x = alacrityButton.x + alacrityButton.h/2 - sizeX/2
  922. end
  923. else
  924. alacrityButtonTEXT.text = ""
  925. end
  926. elseif v.name == "invoker_emp" then
  927. if v.cd > 0 then
  928. local cd = mathfloor(v.cd)+1
  929. empButtonTEXT.text = tostring(cd)
  930. if cd >= 10 then
  931. local sizeX = (textFont:GetTextSize(empButtonTEXT.text).x)
  932. empButtonTEXT.x = empButton.x + empButton.h/2 - sizeX/2
  933. else
  934. local sizeX = (textFont:GetTextSize(empButtonTEXT.text).x)
  935. empButtonTEXT.x = empButton.x + empButton.h/2 - sizeX/2
  936. end
  937. else
  938. empButtonTEXT.text = ""
  939. end
  940. elseif v.name == "invoker_ghost_walk" then
  941. if v.cd > 0 then
  942. local cd = mathfloor(v.cd)+1
  943. ghostwalkButtonTEXT.text = tostring(cd)
  944. if cd >= 10 then
  945. local sizeX = (textFont:GetTextSize(ghostwalkButtonTEXT.text).x)
  946. ghostwalkButtonTEXT.x = ghostwalkButton.x + ghostwalkButton.h/2 - sizeX/2
  947. else
  948. local sizeX = (textFont:GetTextSize(ghostwalkButtonTEXT.text).x)
  949. ghostwalkButtonTEXT.x = ghostwalkButton.x + ghostwalkButton.h/2 - sizeX/2
  950. end
  951. else
  952. ghostwalkButtonTEXT.text = ""
  953. end
  954. end
  955. end
  956. end
  957.  
  958. if me.health < me.maxHealth*0.4 and not retreat and tempvictim then
  959. if not statusText2.visible then
  960. statusText2.text = "Hold "..string.char(config.Retreat).." to retreat!"
  961. local sizeX = (F14:GetTextSize(statusText2.text).x)/2
  962. statusText2.x = -sizeX
  963. statusText2.y = -60*monitor
  964. statusText2.entity = me
  965. statusText2.entityPosition = Vector(0,0,me.healthbarOffset)
  966. statusText2.visible = true
  967. end
  968. elseif statusText2.visible then
  969. statusText2.visible = false
  970. end
  971.  
  972. if not tempmyhero then
  973. myhero = MyHero(me)
  974. else
  975. local range = tempmyhero:GetAttackRange()
  976. if KeyPressed then
  977. if IsKeyDown(config.Retreat) then retreat = true combo = 0 else retreat = false end
  978. if IsKeyDown(config.Harras) then harras = true else harras = false end
  979. local CanMove, tempvictimVisible, tempvictimAlive = Animations.CanMove(me), (tempvictim and tempvictim.visible), (tempvictim and tempvictim.alive)
  980. local a1,a2,a3,a4,a5,a6 = abilities[1],abilities[2],abilities[3],abilities[4],abilities[5],abilities[6]
  981. if resettime then
  982. resettime = nil
  983. end
  984.  
  985. if not tempvictim or ((not tempvictim.alive or tempvictim.health < 0) and (not targetlock or tempvictim.visible)) then
  986. if tempvictim then
  987. indicate[tempvictim.playerId].visible = false
  988. end
  989. victim = nil
  990. tempvictim = nil
  991. targetlock = false
  992. enemyHP = nil
  993. end
  994.  
  995. local victimdistance = 999999
  996. if SleepCheck("blink") then
  997. mePosition = me.position
  998. end
  999. if tempvictim then victimdistance = GetDistance2D(mePosition,tempvictim) end
  1000. local blink = me:FindItem("item_blink") or me:FindSpell("antimage_blink") or me:FindSpell("queenofpain_blink")
  1001.  
  1002. if not targetlock and (CanMove or not start or (not tempvictim or victimdistance > mathmax(range+50,500) or not tempvictimAlive or tempvictim.health < 0)) then
  1003. start = true
  1004. local type = "phys"
  1005. if ID == CDOTA_Unit_Hero_Invoker or ID == CDOTA_Unit_Hero_EarthSpirit or ID == CDOTA_Unit_Hero_Lina or ID == CDOTA_Unit_Hero_Lion or ID == CDOTA_Unit_Hero_Zuus or ID == CDOTA_Unit_Hero_Tinker then type = "magic" end
  1006. local lowestHP = targetFind:GetLowestEHP(config.TargetFindRange, type)
  1007. if config.TargetLowestHP and lowestHP and (not tempvictim or ((tempvictim.creep or (GetDistance2D(me,tempvictim) > 600 and tempvictimVisible) or not tempvictimAlive or tempvictim.health < 0 or (lowestHP.health < tempvictim.health and tempvictimVisible)) and GetDistance2D(tempvictim,me) > range+100)) and SleepCheck("victim") then
  1008. victim = lowestHP
  1009. enemyHP = victim.health
  1010. end
  1011. tempvictim = victim
  1012. if (config.TargetClosestToMouse and tempvictim and GetDistance2D(tempvictim,me) > range+100 and tempvictimVisible) or (config.TargetClosestToMouse and not config.TargetLowestHP) or (tempvictim and (GetDistance2D(tempvictim,me) > range+100 or not tempvictimVisible)) then
  1013. local closest = targetFind:GetClosestToMouse(me,config.TargetFindRange)
  1014. if closest and (config.TargetClosestToMouse or (GetDistance2D(me,closest) < GetDistance2D(me,tempvictim) and GetDistance2D(me,tempvictim) > range+100 and (not blink or (not blink:CanBeCasted() and blink.cd > 3)))) then
  1015. victim = closest
  1016. enemyHP = victim.health
  1017. end
  1018. end
  1019. tempvictim = victim
  1020. end
  1021.  
  1022. if tempvictim then
  1023. anientiCount = 2
  1024. Animations.entities[2] = tempvictim
  1025. if indicate[tempvictim.playerId] then
  1026. if not indicate[tempvictim.playerId].visible then
  1027. indicate[tempvictim.playerId].visible = true
  1028. end
  1029. else
  1030. local xx = GetXX(tempvictim)
  1031. x,y,h,w = xx-20+x_*tempvictim.playerId,0,x_,35*monitor
  1032. indicate[tempvictim.playerId] = drawMgr:CreateRect(x,y,h,w,9911861800)
  1033. end
  1034. for i = 1, 9 do
  1035. local v = indicate[i]
  1036. if v and v.visible and i ~= tempvictim.playerId then
  1037. indicate[i].visible = false
  1038. end
  1039. end
  1040. end
  1041.  
  1042. if tempvictim and enemyHP and tempvictim.health < enemyHP then enemyHP = tempvictim.health end
  1043. if tempvictim and enemyHP and SleepCheck("casting") and tempvictim.health > enemyHP+200 then enemyHP = tempvictim.health end
  1044. if not enemyHP and tempvictim then enemyHP = tempvictim.health end
  1045. if me:IsChanneling() then channelactive = true end
  1046. if SleepCheck("casting") and not me:IsChanneling() then channelactive = false end
  1047. local PudgeRot = me:FindSpell("pudge_rot")
  1048. if me:CanCast() and PudgeRot then
  1049. if PudgeRot and PudgeRot:CanBeCasted() then
  1050. if SleepCheck("rot2") and tempvictim and (victimdistance <= 350 or (tempvictim and tempvictim:DoesHaveModifier("modifier_pudge_meat_hook"))) and tempvictimVisible and tempvictimAlive and tempvictim.hero and not me:DoesHaveModifier("modifier_pudge_rot") and not tempvictim:DoesHaveModifier("modifier_pudge_rot") then
  1051. me:SafeCastAbility(PudgeRot)
  1052. Sleep(2000,"rot")
  1053. Sleep(300,"rot2")
  1054. return
  1055. elseif SleepCheck("rot") and (not tempvictim or not tempvictimAlive or not tempvictimVisible or victimdistance > 350) and me:DoesHaveModifier("modifier_pudge_rot") then
  1056. me:SafeCastAbility(PudgeRot)
  1057. Sleep(500,"rot")
  1058. return
  1059. end
  1060. end
  1061. end
  1062. if me:DoesHaveModifier("modifier_item_armlet_unholy_strength") and SleepCheck("item_armlet") and me:CanCast() then
  1063. if (not tempvictim or victimdistance > 500 or not tempvictimVisible) and not retreat then
  1064. me:CastItem("item_armlet")
  1065. if tempvictim then
  1066. local delay = mathmin(Animations.GetAttackTime(tempvictim)*1000 + Animations.getBackswingTime(tempvictim)*1000, 500)
  1067. Sleep(Animations.GetAttackTime(tempvictim)*1000 + Animations.getBackswingTime(tempvictim)*1000,"item_armlet")
  1068. else
  1069. Sleep(1000,"item_armlet")
  1070. end
  1071. return
  1072. elseif (tempvictim or retreat) and me.health < 250 and ((Animations.CanMove(tempvictim) or ((not tempvictim or victimdistance > tempvictim.attackRange+100 or not tempvictimVisible) and (not Animations.isAttacking(tempvictim) or tempvictim:GetTurnTime(me) > 0)) or me.health <= me:DamageTaken((tempvictim.dmgMax+tempvictim.dmgMin)/2, DAMAGE_PHYS, tempvictim)) or retreat) then
  1073. me:CastItem("item_armlet")
  1074. me:CastItem("item_armlet")
  1075. if tempvictim then
  1076. local delay = mathmin(Animations.GetAttackTime(tempvictim)*1000 + Animations.getBackswingTime(tempvictim)*1000, 500)
  1077. Sleep(Animations.GetAttackTime(tempvictim)*1000 + Animations.getBackswingTime(tempvictim)*1000,"item_armlet")
  1078. else
  1079. Sleep(1000,"item_armlet")
  1080. end
  1081. return
  1082. end
  1083. end
  1084. if me:DoesHaveModifier("modifier_tusk_snowball_movement") or tuskSnowBall then
  1085. local closeAllies = entityList:GetEntities(function (v) return (v.hero or v.classId == CDOTA_BaseNPC_Invoker_Forged_Spirit or v.classId == CDOTA_Unit_SpiritBear or v.classId == CDOTA_BaseNPC_Warlock_Golem or v.classId == CDOTA_Unit_Broodmother_Spiderling) and v.GetDistance2D and v.alive and v.visible and v.team == me.team and v ~= me and not v:IsAttackImmune() and not v:IsInvul() and GetDistance2D(me,v) < 500 and not v:DoesHaveModifier("modifier_tusk_snowball_movement_friendly") end)
  1086. if #closeAllies > 0 then
  1087. for i = 1, #closeAllies do
  1088. local v = closeAllies[i]
  1089. if v and not v:IsAttackImmune() and not v:IsInvul() and SleepCheck(v.handle.."tusk") and SleepCheck("tusk") then
  1090. me:Attack(v)
  1091. Sleep(100,v.handle.."tusk")
  1092. Sleep(25,"tusk")
  1093. return
  1094. end
  1095. end
  1096. else
  1097. tuskSnowBall = false
  1098. end
  1099. end
  1100. if ID == CDOTA_Unit_Hero_SpiritBreaker or ID == CDOTA_Unit_Hero_Rubick then
  1101. local charge = a1
  1102. if ID == CDOTA_Unit_Hero_Rubick then charge = a4 end
  1103. if charge and charge.abilityPhase and SleepCheck("charge") then
  1104. Sleep(1000,"charge")
  1105. end
  1106. end
  1107. local glimpsePos = false
  1108. if disruptor then
  1109. local glimpse = disruptor:FindSpell("disruptor_glimpse")
  1110. local gcd = glimpse:GetCooldown(glimpse.level)
  1111. gcd = gcd - 1.8 - client.latency/1000
  1112. if glimpse.cd > gcd then glimpsePos = true else glimpsePos = false end
  1113. end
  1114. if tempvictim and (tempvictim:DoesHaveModifier("modifier_kunkka_x_marks_the_spot") or glimpsePos) then
  1115. if not xposition then
  1116. if glimpsePos then
  1117. if positionsTable[tempvictim.handle] then
  1118. local pos = positionsTable[tempvictim.handle]
  1119. local time = gameTime-4
  1120. local closest = nil
  1121. local closesttime = nil
  1122. for i,v in pairs(pos) do
  1123. if not closest or math.abs(time-i) < closesttime then
  1124. closest = v
  1125. closesttime = math.abs(time-i)
  1126. end
  1127. end
  1128. if closest then xposition = closest end
  1129. end
  1130. else
  1131. xposition = tempvictim.position
  1132. end
  1133. end
  1134. elseif xposition and SleepCheck("kunkka_x_marks_the_spot") and not glimpsePos and SleepCheck("disruptor_glimpse") and not a3.abilityPhase and a3.name ~= "kunkka_return" then xposition = nil end
  1135. if ID == CDOTA_Unit_Hero_Kunkka and tempvictim then
  1136. local torrent = a1
  1137. local x_mark = a3
  1138. if x_mark.name == "kunkka_return" or xposition then
  1139. if xposition and torrent.cd ~= 0 and mathfloor(torrent.cd*10) == 90 + mathfloor((client.latency/100)) and SleepCheck("casting2") and me:CanCast() then
  1140. me:CastAbility(x_mark)
  1141. Sleep(200+client.latency, "casting2")
  1142. Sleep(200+client.latency, "casting")
  1143. return
  1144. end
  1145. local ship = a4
  1146. if torrent.cd ~= 0 and SleepCheck("casting") and ship:CanBeCasted() and me:CanCast() and xposition and GetDistance2D(me,xposition) > 750 then
  1147. me:CastAbility(ship, xposition)
  1148. local Dmg
  1149. if tempdamageTable[ship.name] then
  1150. Dmg = tempdamageTable[ship.name][1]
  1151. Dmg = tempvictim:DamageTaken(Dmg,DAMAGE_MAGC,me)
  1152. enemyHP = enemyHP - Dmg
  1153. end
  1154. Sleep(ship:FindCastPoint()*1000+me:GetTurnTime(xposition)*1000,"casting")
  1155. Sleep(ship:FindCastPoint()*1000+me:GetTurnTime(xposition)*1000,"moving")
  1156. Sleep(6000,"stun")
  1157. return
  1158. end
  1159. elseif xposition and SleepCheck("kunkka_x_marks_the_spot") and not x_mark.abilityPhase then
  1160. xposition = nil
  1161. end
  1162. end
  1163. if me:IsChanneling() or channelactive then
  1164. local glimmer_cape = me:FindItem("item_glimmer_cape")
  1165. if glimmer_cape and glimmer_cape:CanBeCasted() and SleepCheck("glim") then
  1166. me:CastAbility(glimmer_cape,me)
  1167. Sleep(200,"glim")
  1168. end
  1169. return
  1170. end
  1171. local quas, wex, exort, spell1, spell2
  1172. local prediction
  1173. if tempvictim and tempvictimVisible then
  1174. prediction = SkillShotPredictedXYZ(tempvictim,500+client.latency)
  1175. elseif tempvictim then prediction = SkillShot.BlindSkillShotXYZ(me,tempvictim,1100,0.5+client.latency/1000) end
  1176. if not prediction and tempvictim and tempvictimVisible then prediction = tempvictim.position end
  1177. local movespeed
  1178. if tempvictim then movespeed = tempvictim.movespeed end
  1179. if tempvictim and tempvictim.visible then
  1180. if tempvictim.activity == LuaEntityNPC.ACTIVITY_MOVE then
  1181. local pred = SkillShot.PredictedXYZ(tempvictim,1000)
  1182. if pred then
  1183. movespeed = GetDistance2D(tempvictim,pred)
  1184. end
  1185. end
  1186. end
  1187. local facing
  1188. if tempvictim then
  1189. facing = ((mathmax(mathabs(FindAngleR(me) - mathrad(FindAngleBetween(me, tempvictim))) - 0.20, 0)) == 0)
  1190. end
  1191. if me:DoesHaveModifier("modifier_wisp_spirits") and tempvictim then
  1192. local spirits = entityList:GetEntities({classId=CDOTA_Wisp_Spirit,alive=true,team=me.team,visible=true})
  1193. tablesort(spirits, function (a,b) return a.handle > b.handle end)
  1194. local spirit = nil
  1195. for i = 1, #spirits do
  1196. local v = spirits[i]
  1197. if GetDistance2D(me,v) < 900 then spirit = v break end
  1198. end
  1199. if spirit then
  1200. local spiritsin = me:FindSpell("wisp_spirits_in")
  1201. local spiritsout = me:FindSpell("wisp_spirits_out")
  1202. local mepred = SkillShotPredictedXYZ(me,client.latency)
  1203. local vicpred = SkillShotPredictedXYZ(tempvictim,client.latency)
  1204. if not tempvictimVisible then vicpred = SkillShot.BlindSkillShotXYZ(me,tempvictim,1100,client.latency/1000) end
  1205. local dist = GetDistance2D(spirit,me)
  1206. local vicdist = GetDistance2D(mepred,vicpred)
  1207. if mathabs(dist-vicdist) < 100 then
  1208. if spiritsin.toggled and SleepCheck("in") then me:SafeCastAbility(spiritsin) Sleep(250,"in")
  1209. elseif spiritsout.toggled and SleepCheck("out") then me:SafeCastAbility(spiritsout) Sleep(250,"out") end
  1210. elseif dist > vicdist and SleepCheck("in") and not spiritsin.toggled then me:SafeCastAbility(spiritsin) Sleep(250,"in")
  1211. elseif dist < vicdist and SleepCheck("out") and not spiritsout.toggled then me:SafeCastAbility(spiritsout) Sleep(250,"out") end
  1212. end
  1213. end
  1214.  
  1215. if ID == CDOTA_Unit_Hero_Pudge and a1.abilityPhase and (not tempvictim or not tempvictimAlive) then
  1216. me:Stop()
  1217. end
  1218.  
  1219. if prediction then
  1220. if not lastPrediction then lastPrediction = {prediction, tempvictim.rotR}
  1221. elseif not tempvictim:DoesHaveModifier("modifier_eul_cyclone") and not tempvictim:DoesHaveModifier("modifier_invoker_tornado") then
  1222. if ID == CDOTA_Unit_Hero_Pudge and not SleepCheck("pudge_meat_hook") then
  1223. local hook = a1
  1224. if hook.abilityPhase and ((GetDistance2D(lastPrediction[1],prediction) > mathabs(GetDistance2D(tempvictim,lastPrediction[1])-150) and mathabs((tempvictim.rotR) - lastPrediction[2]) > 0.5) or SkillShot.__GetBlock(me.position,lastPrediction[1],tempvictim,100,true)) then
  1225. me:Stop()
  1226. end
  1227. elseif ID == CDOTA_Unit_Hero_Mirana and not SleepCheck("mirana_arrow") then
  1228. local arrow = a2
  1229. if arrow.abilityPhase and ((GetDistance2D(lastPrediction[1],prediction) > mathabs(GetDistance2D(tempvictim,lastPrediction[1])-115) and mathabs((tempvictim.rotR) - lastPrediction[2]) > 0.3) or SkillShot.__GetBlock(me.position,lastPrediction[1],tempvictim,115,false)) then
  1230. me:Stop()
  1231. end
  1232. elseif ID == CDOTA_Unit_Hero_Rattletrap and not SleepCheck("rattletrap_hookshot") then
  1233. local hookshot = a4
  1234. if hookshot.abilityPhase and ((GetDistance2D(lastPrediction[1],prediction) > mathabs(GetDistance2D(tempvictim,lastPrediction[1])-125) and mathabs((tempvictim.rotR) - lastPrediction[2]) > 0.3) or SkillShot.__GetBlock(me.position,lastPrediction[1],tempvictim,125,true)) then
  1235. me:Stop()
  1236. end
  1237. elseif ID == CDOTA_Unit_Hero_Lina and not SleepCheck("lina_light_strike_array") then
  1238. local LightStrike = a2
  1239. if LightStrike.abilityPhase and GetDistance2D(lastPrediction[1],prediction) > mathabs(GetDistance2D(tempvictim,lastPrediction[1])+112) then
  1240. me:Stop()
  1241. end
  1242. elseif ID == CDOTA_Unit_Hero_Leshrac and not SleepCheck("leshrac_split_earth") then
  1243. local SplitEarth = a1
  1244. local radius = SplitEarth:GetSpecialData("radius")
  1245. if SplitEarth.abilityPhase and GetDistance2D(lastPrediction[1],prediction) > radius+50 then
  1246. me:Stop()
  1247. end
  1248. elseif ID == CDOTA_Unit_Hero_Sniper and not SleepCheck("sniper_shrapnel") then
  1249. local shrapnel = a1
  1250. local radius = shrapnel:GetSpecialData("radius")
  1251. if shrapnel.abilityPhase and GetDistance2D(lastPrediction[1],prediction) > mathabs(GetDistance2D(tempvictim,lastPrediction[1])-radius/2) then
  1252. me:Stop()
  1253. end
  1254. elseif ID == CDOTA_Unit_Hero_Kunkka and not SleepCheck("kunkka_torrent") and not xposition then
  1255. local torrent = a1
  1256. if torrent.abilityPhase and GetDistance2D(lastPrediction[1],prediction) > mathabs(GetDistance2D(tempvictim,lastPrediction[1])) then
  1257. me:Stop()
  1258. end
  1259. elseif ID == CDOTA_Unit_Hero_Nevermore then
  1260. if not SleepCheck("nevermore_shadowraze1") then
  1261. local raze = a1
  1262. if raze.abilityPhase and (GetDistance2D(lastPrediction[1],tempvictim) > 275 or me:GetTurnTime(lastPrediction[1]) > 0.01) then
  1263. me:Stop()
  1264. end
  1265. elseif not SleepCheck("nevermore_shadowraze2") then
  1266. local raze = a2
  1267. if raze.abilityPhase and (GetDistance2D(lastPrediction[1],tempvictim) > 275 or me:GetTurnTime(lastPrediction[1]) > 0.01) then
  1268. me:Stop()
  1269. end
  1270. elseif not SleepCheck("nevermore_shadowraze3") then
  1271. local raze = a3
  1272. if raze.abilityPhase and (GetDistance2D(lastPrediction[1],tempvictim) > 275 or me:GetTurnTime(lastPrediction[1]) > 0.01) then
  1273. me:Stop()
  1274. end
  1275. end
  1276. end
  1277. end
  1278. end
  1279. local closestTrap = nil
  1280. local meld, refraction
  1281. local meDmg = 0
  1282. if tempvictim then meDmg = tempvictim:DamageTaken((me.dmgMin + me.dmgMax)/2,DAMAGE_PHYS,me) end
  1283. if ID == CDOTA_Unit_Hero_TemplarAssassin or ID == CDOTA_Unit_Hero_Rubick then
  1284. if ID == CDOTA_Unit_Hero_TemplarAssassin then
  1285. meld,refraction = a2,a1
  1286. else
  1287. meld,refraction = me:FindSpell("templar_assassin_meld"), me:FindSpell("templar_assassin_refraction")
  1288. end
  1289. local traps = entityList:GetEntities({classId=CDOTA_BaseNPC_Additive,alive=true,team=me.team,visible=true})
  1290. for i = 1, #traps do
  1291. local v = traps[i]
  1292. local spell = v:GetAbility(1)
  1293. if (spell and spell.name == "templar_assassin_self_trap" and spell:CanBeCasted()) then
  1294. if not closestTrap or GetDistance2D(closestTrap, tempvictim) > GetDistance2D(v, tempvictim) then
  1295. if GetDistance2D(v, tempvictim) <= 400 then
  1296. closestTrap = v
  1297. end
  1298. if closestTrap and GetDistance2D(closestTrap, tempvictim) > 400 then
  1299. closestTrap = nil
  1300. end
  1301. end
  1302. end
  1303. end
  1304. local trap = a5
  1305. if ID == CDOTA_Unit_Hero_Rubick then trap = me:FindSpell("templar_assassin_psionic_trap") end
  1306. if trap and tempvictim and (not harras or victimdistance < range+100) and tempvictim.hero and CanBeSlowed(tempvictim) and (tempvictim and tempvictim:CanMove() and tempvictim.activity == LuaEntityNPC.ACTIVITY_MOVE) and (meDmg*2 < enemyHP or victimdistance > range) then
  1307. local trapslow = tempvictim:FindModifier("modifier_templar_assassin_trap_slow")
  1308. if (tempvictim:CanMove() and (not trapslow or trapslow.remainingTime <= (trap:FindCastPoint()*1.5 + client.latency/1000))) and chainStun(tempvictim,trap:FindCastPoint()+client.latency/1000) then
  1309. if (closestTrap and GetDistance2D(closestTrap, tempvictim) <= 400) and SleepCheck("trap2") then
  1310. local boom = closestTrap:GetAbility(1)
  1311. if boom:CanBeCasted() then
  1312. closestTrap:SafeCastAbility(boom)
  1313. Sleep(trap:FindCastPoint()*1000 + 200 + client.latency, "trap2")
  1314. Sleep(trap:FindCastPoint()*1000 + 200 + client.latency, "trap")
  1315. end
  1316. elseif not ((blink and blink:CanBeCasted()) and (prediction and GetDistance2D(prediction,me) > 500 and GetDistance2D(prediction,me) > range+50 and GetDistance2D(prediction,me) < 1700)) and (not a2 or not a2:CanBeCasted() or victimdistance > range+100) and me:CanCast() and victimdistance <= trap.castRange+375 and (not trapslow or trapslow.remainingTime <= (trap:FindCastPoint()*1.5)) and SleepCheck("trap") and trap:CanBeCasted() and chainStun(tempvictim,trap:FindCastPoint()+client.latency/1000) and SleepCheck("casting") and (not meld or not meld:CanBeCasted() or GetDistance2D(me,prediction)+50 > range) then
  1317. local prediction = SkillShotPredictedXYZ(tempvictim,me:GetTurnTime(tempvictim)*1000+trap:FindCastPoint()*2000+client.latency)
  1318. local pos
  1319. if tempvictimVisible then
  1320. pos = prediction
  1321. me:SafeCastAbility(trap, prediction)
  1322. else
  1323. local blind = SkillShot.BlindSkillShotXYZ(me,tempvictim,1100,trap:FindCastPoint()+client.latency/1000)
  1324. if blind then
  1325. pos = blind
  1326. me:SafeCastAbility(trap, blind)
  1327. else
  1328. pos = Vector(tempvictim.position.x + (movespeed * (trap:FindCastPoint() + client.latency/1000) + 100) * mathcos(tempvictim.rotR), tempvictim.position.y + (movespeed * (trap:FindCastPoint() + client.latency/1000) + 100) * mathsin(tempvictim.rotR), tempvictim.position.z)
  1329. me:SafeCastAbility(trap, pos)
  1330. end
  1331. end
  1332. Sleep(trap:FindCastPoint()*1000 + me:GetTurnTime(pos)*1000 + 100, "casting")
  1333. Sleep(trap:FindCastPoint()*1000 + me:GetTurnTime(pos)*1000, "moving")
  1334. Sleep(trap:FindCastPoint()*1000 + 200 + client.latency, "trap")
  1335. return
  1336. end
  1337. end
  1338. end
  1339. end
  1340. if ID == CDOTA_Unit_Hero_Brewmaster or ID == CDOTA_Unit_Hero_Rubick then
  1341. local ulti = a4
  1342. if ID == CDOTA_Unit_Hero_Rubick then ulti = me:FindSpell("brewmaster_primal_split") end
  1343. if ulti and ulti.cd > 0 then
  1344. local dur = ulti:GetSpecialData("duration")
  1345. if ulti.cd+dur > ulti:GetCooldown(ulti.level) then
  1346. local splits = entityList:GetEntities(function (ent) return (ent.classId == CDOTA_Unit_Brewmaster_PrimalEarth or ent.classId == CDOTA_Unit_Brewmaster_PrimalFire or ent.classId == CDOTA_Unit_Brewmaster_PrimalStorm) and ent.controllable and ent.alive end)
  1347. local BrewmasterComboTable = {
  1348. { CDOTA_Unit_Brewmaster_PrimalEarth, {{ 1, nil, true}, { 4, "radius", true }} },
  1349. { CDOTA_Unit_Brewmaster_PrimalStorm, {{ 4, nil, true}, { 1 }, { 3, 650 }} }
  1350. }
  1351. local l = #BrewmasterComboTable
  1352. for z = 1, #splits do
  1353. local split = splits[z]
  1354. anientiCount = anientiCount + 1
  1355. Animations.entities[anientiCount] = split
  1356. local hand = split.handle
  1357. if tempvictim and tempvictim.hero and tempvictimVisible then
  1358. for i = 1, l do
  1359. local table = BrewmasterComboTable[i]
  1360. if table[1] == split.classId then
  1361. local t2 = table[2]
  1362. local l2 = #t2
  1363. for i = 1, l2 do
  1364. local data = t2[i]
  1365. local slot = data[1] or data
  1366. if slot then
  1367. local spell
  1368. if GetType(slot) == "string" then
  1369. spell = split:FindSpell(slot)
  1370. else
  1371. spell = split:GetAbility(slot)
  1372. end
  1373. if spell and spell:CanBeCasted() then
  1374. local speed = spell:GetSpecialData("speed",spell.level)
  1375. local range = spell.castRange
  1376. if data[2] then
  1377. distance = data[2]
  1378. end
  1379. local victimdistance = GetDistance2D(split,tempvictim)
  1380. if distance then
  1381. if GetType(distance) == "string" then
  1382. distance = spell:GetSpecialData(distance,spell.level)
  1383. end
  1384. end
  1385. local delay = spell:FindCastPoint()*1000
  1386. local delay2 = delay/1000 + client.latency/1000
  1387. local prediction = SkillShotPredictedXYZ(tempvictim,mathmax(delay, 100)+client.latency)
  1388. if speed then delay2 = delay2 + (mathmin(range-50, GetDistance2D(split,prediction))/speed) end
  1389. local cast = nil
  1390. if SleepCheck(hand.."casting") and SleepCheck(hand..""..spell.name) and (not data[3] or chainStun(tempvictim, delay2)) then
  1391. if spell:IsBehaviourType(LuaEntityAbility.BEHAVIOR_UNIT_TARGET) then
  1392. if spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALLIED) and not DoesHaveModifier("modifier_"..spell.name) and not DoesHaveModifier("modifier_"..spell.name.."_debuff") and not spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALL) then
  1393. cast = split:SafeCastAbility(spell,split)
  1394. elseif (spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ENEMY) or spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_CUSTOM) or spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALL)) and not tempvictim:IsInvul() and not tempvictim:DoesHaveModifier("modifier_eul_cyclone") and not tempvictim:DoesHaveModifier("modifier_invoker_tornado") and not tempvictim:DoesHaveModifier("modifier_brewmaster_storm_cyclone") and victimdistance < mathmax(spell.castRange+500, 1000) and not tempvictim:DoesHaveModifier("modifier_"..spell.name) and not tempvictim:DoesHaveModifier("modifier_"..spell.name.."_debuff") then
  1395. cast = split:SafeCastAbility(spell,tempvictim)
  1396. delay = delay + split:GetTurnTime(tempvictim)*1000 + (mathmax(victimdistance-50-range,0)/split.movespeed)*1000
  1397. end
  1398. elseif spell:IsBehaviourType(LuaEntityAbility.BEHAVIOR_NO_TARGET) and tempvictimVisible and not tempvictim:DoesHaveModifier("modifier_"..spell.name)
  1399. and (spell.name ~= "brewmaster_storm_wind_walk" or GetDistance2D(split,prediction) < distance) and (spell.name ~= "brewmaster_thunder_clap" or (prediction and GetDistance2D(split,prediction) < distance)) and not tempvictim:DoesHaveModifier("modifier_"..spell.name.."_debuff") and not DoesHaveModifier("modifier_"..spell.name) and not DoesHaveModifier("modifier_"..spell.name.."_debuff") then
  1400. cast = split:SafeCastAbility(spell)
  1401. elseif spell:IsBehaviourType(LuaEntityAbility.BEHAVIOR_POINT) or spell:IsBehaviourType(LuaEntityAbility.BEHAVIOR_AOE) then
  1402. if spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALLIED) and not spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ENEMY) then
  1403. cast = split:SafeCastAbility(spell,split)
  1404. else
  1405. delay = delay + split:GetTurnTime(tempvictim)*1000
  1406. local delay2 = delay + client.latency
  1407. if data[2] then delay2 = delay2 + data[2]*1000 end
  1408. local speed = spell:GetSpecialData("speed")
  1409. local prediction
  1410. if not speed then
  1411. prediction = SkillShotPredictedXYZ(tempvictim,delay2)
  1412. else
  1413. prediction = SkillShotSkillShotXYZ(mePosition,tempvictim,delay2,speed)
  1414. end
  1415. if prediction and GetDistance2D(prediction,mePosition) < spell.castRange+150 then
  1416. delay = delay + (mathmax(GetDistance2D(prediction,mePosition)-50-spell.castRange,0)/split.movespeed)*1000
  1417. cast = split:SafeCastAbility(spell,prediction)
  1418. end
  1419. end
  1420. end
  1421.  
  1422. if cast then
  1423. if tempdamageTable[spell.name] then
  1424. local Dmg = tempdamageTable[spell.name][1]
  1425. Dmg = tempvictim:DamageTaken(Dmg,DAMAGE_MAGC,me)
  1426. enemyHP = enemyHP - Dmg
  1427. end
  1428. if data[3] then Sleep(delay+300+client.latency,"stun") end
  1429. Sleep(delay,hand.."casting")
  1430. Sleep(delay,hand.."moving")
  1431. Sleep(delay+client.latency+100, hand..""..spell.name)
  1432. end
  1433. end
  1434. end
  1435. end
  1436. end
  1437. end
  1438. end
  1439. end
  1440.  
  1441. if not retreat and tempvictim and not Animations.CanMove(split) and GetDistance2D(split,tempvictim) <= mathmax(split.attackRange*2+50,500) and not tempvictim:IsInvul() and split:CanAttack() and not tempvictim:IsAttackImmune() and not tempvictim:DoesHaveModifier("modifier_bane_nightmare") then
  1442. if SleepCheck(hand.."moving") and SleepCheck(hand.."attack") then
  1443. if not tempvictim:IsInvul() and not tempvictim:IsAttackImmune() and not tempvictim:DoesHaveModifier("modifier_bane_nightmare") then
  1444. split:Attack(tempvictim)
  1445. if GetDistance2D(split,tempvictim) < split.attackRange+50 then
  1446. enemyHP = enemyHP - tempvictim:DamageTaken((split.dmgMin + split.dmgMax)/2,DAMAGE_PHYS,split)
  1447. end
  1448. else
  1449. split:Follow(tempvictim)
  1450. end
  1451. Sleep(Animations.GetAttackTime(split)*1000,hand.."attack")
  1452. end
  1453. elseif not targetlock and SleepCheck(hand.."moving") and SleepCheck(hand.."move") then
  1454. local mPos = client.mousePosition
  1455. if retreat or (((not tempvictim or (GetDistance2D(split,mPos) > 300 and tempvictimVisible and GetDistance2D(tempvictim,split) < 1000))) and (not tempvictim or (tempvictimVisible and GetDistance2D(tempvictim,split) < 1000))) then
  1456. split:Move(mPos)
  1457. elseif prediction and GetDistance2D(prediction,split) < split.attackRange and (GetDistance2D(split,tempvictim)-range)/movespeed > Animations.getBackswingTime(split) then
  1458. if not tempvictim:IsInvul() and split:CanAttack() and not tempvictim:IsAttackImmune() and not tempvictim:DoesHaveModifier("modifier_bane_nightmare") and (not tempvictim:CanMove() or GetDistance2D(split,prediction)-100 < GetDistance2D(split,tempvictim)) then
  1459. split:Attack(tempvictim)
  1460. else
  1461. split:Move(mPos)
  1462. end
  1463. else
  1464. split:Follow(tempvictim)
  1465. end
  1466. Sleep(Animations.getBackswingTime(split)*1000,hand.."move")
  1467. end
  1468. end
  1469. return
  1470. end
  1471. end
  1472. end
  1473. local entities = {}
  1474. local spider,boar,forg,familiars,bear,necorwarriors,spirit,sigil,treants = {},{},{},{},nil,{},nil,nil,{}
  1475. if ID == CDOTA_Unit_Hero_Broodmother or ID == CDOTA_Unit_Hero_Rubick then
  1476. spider = entityList:GetEntities({classId=CDOTA_Unit_Broodmother_Spiderling,alive=true,visible=true,team=me.team})
  1477. elseif ID == CDOTA_Unit_Hero_Beastmaster or ID == CDOTA_Unit_Hero_Rubick then
  1478. boar = entityList:GetEntities({classId=CDOTA_Unit_Hero_Beastmaster_Beasts,alive=true,visible=true,team=me.team})
  1479. elseif ID == CDOTA_Unit_Hero_Invoker or ID == CDOTA_Unit_Hero_Rubick then
  1480. forg = entityList:GetEntities({classId=CDOTA_BaseNPC_Invoker_Forged_Spirit,alive=true,visible=true,team=me.team})
  1481. elseif ID == CDOTA_Unit_Hero_Visage or ID == CDOTA_Unit_Hero_Rubick then
  1482. familiars = entityList:GetEntities({classId=CDOTA_Unit_VisageFamiliar,alive=true,visible=true,team=me.team})
  1483. elseif ID == CDOTA_Unit_Hero_LoneDruid or ID == CDOTA_Unit_Hero_Rubick then
  1484. bear = entityList:GetEntities({classId=CDOTA_Unit_SpiritBear,alive=true,team=me.team})[1]
  1485. elseif ID == CDOTA_Unit_Hero_Tusk or ID == CDOTA_Unit_Hero_Rubick then
  1486. sigil = entityList:GetEntities({classId=CDOTA_BaseNPC_Tusk_Sigil,alive=true,team=me.team})[1]
  1487. elseif ID == CDOTA_Unit_Hero_Furion or ID == CDOTA_Unit_Hero_Rubick then
  1488. treants = entityList:GetEntities({classId=CDOTA_BaseNPC_Creep,alive = true, visible = true, team = me.team})
  1489. end
  1490. local tornado = entityList:GetEntities(function (v) return (v.name == "npc_dota_enraged_wildkin_tornado" and v.alive and v.visible and v.team == me.team and v.controllable) end)[1]
  1491. local heroes = entityList:GetEntities({type=LuaEntity.TYPE_HERO,alive=true,visible=true,illusion=true,team=me.team})
  1492. local neutral = entityList:GetEntities({classId=CDOTA_BaseNPC_Creep_Neutral,alive=true,visible=true,team=me.team})
  1493. if me:FindItem("item_necronomicon_2") or me:FindItem("item_necronomicon_1") or me:FindItem("item_necronomicon_3") then
  1494. necorwarriors = entityList:GetEntities(function (v) return ((v.name == "npc_dota_necronomicon_archer_1" or v.name == "npc_dota_necronomicon_archer_2" or v.name == "npc_dota_necronomicon_archer_3" or v.name == "npc_dota_necronomicon_warrior_1" or
  1495. v.name == "npc_dota_necronomicon_warrior_2" or v.name == "npc_dota_necronomicon_warrior_3") and v.alive and v.visible and v.team == me.team and v.controllable) end)
  1496. end
  1497. local entitiesCount = 0
  1498. for i = 1, #heroes do local v = heroes[i] if v.controllable and v:IsIllusion() then entitiesCount = entitiesCount + 1 entities[entitiesCount] = v end end
  1499. for i = 1, #necorwarriors do local v = necorwarriors[i] if v.controllable then entitiesCount = entitiesCount + 1 entities[entitiesCount] = v end end
  1500. for i = 1, #spider do local v = spider[i] if v.controllable then entitiesCount = entitiesCount + 1 entities[entitiesCount] = v end end
  1501. for i = 1, #boar do local v = boar[i] if v.controllable then entitiesCount = entitiesCount + 1 entities[entitiesCount] = v end end
  1502. for i = 1, #forg do local v = forg[i] if v.controllable then entitiesCount = entitiesCount + 1 entities[entitiesCount] = v end end
  1503. for i = 1, #neutral do local v = neutral[i] if v.controllable then entitiesCount = entitiesCount + 1 entities[entitiesCount] = v end end
  1504. for i = 1, #familiars do local v = familiars[i] if v.controllable then entitiesCount = entitiesCount + 1 entities[entitiesCount] = v end end
  1505. if bear then entitiesCount = entitiesCount + 1 entities[entitiesCount] = bear end
  1506. if sigil then entitiesCount = entitiesCount + 1 entities[entitiesCount] = sigil end
  1507. if tornado then entitiesCount = entitiesCount + 1 entities[entitiesCount] = tornado end
  1508. if #entities > 0 then
  1509. local l = #itemcomboTable
  1510. for i = 1, #entities do
  1511. local v = entities[i]
  1512. if v.classId ~= CDOTA_Unit_Elder_Titan_AncestralSpirit and v.name ~= "npc_dota_enraged_wildkin_tornado" and v.classId ~= CDOTA_BaseNPC_Tusk_Sigil then
  1513. anientiCount = anientiCount + 1
  1514. Animations.entities[anientiCount] = v
  1515. end
  1516. local hand = v.handle
  1517. if v.classId == CDOTA_Unit_SpiritBear and tempvictim then
  1518. for i = 1, l do
  1519. local data = itemcomboTable[i]
  1520. local itemname = data[1] or data
  1521. local item = v:FindItem(itemname)
  1522. if item and item:CanBeCasted() then
  1523. if not tempdamageTable[itemname] then
  1524. damageTable[itemname] = {AbilityDamageGetDamage(item)}
  1525. tempdamageTable = damageTable
  1526. end
  1527. local Dmg = tempdamageTable[itemname][1]
  1528. local type = AbilityDamageGetDmgType(item)
  1529. if Dmg then
  1530. Dmg = tempvictim:DamageTaken(Dmg,type,v)
  1531. end
  1532. local go = true
  1533. if itemname == "item_phase_boots" then Dmg = nil end
  1534. if itemname == "item_dust" and not CanGoInvis(tempvictim) then go = false end
  1535. if (itemname == "item_diffusal_blade" or itemname == "item_diffusal_blade_2") then
  1536. if not ( tempvictim:DoesHaveModifier("modifier_ghost_state") or tempvictim:DoesHaveModifier("modifier_item_ethereal_blade_slow") or tempvictim:DoesHaveModifier("modifier_omninight_guardian_angel")) then
  1537. go = false
  1538. end
  1539. end
  1540. if itemname == "item_arcane_boots" and (v.maxMana - v.mana) < 135 then go = false end
  1541. if (not tempvictim:IsMagicImmune() or type == DAMAGE_PHYS) and not tempvictim:DoesHaveModifier("modifier_"..itemname) and not tempvictim:DoesHaveModifier("modifier_"..itemname.."_debuff") and go and
  1542. SleepCheck(itemname) and (not data[2] or chainStun(tempvictim,0) or (itemname == "item_blade_mail" and chainStun(tempvictim,0,"modifier_axe_berserkers_call"))) and
  1543. (not Dmg or data[2] or Dmg/4 < enemyHP or GetDistance2D(v,tempvictim) > v.attackRange+300) and ((GetDistance2D(v,tempvictim) > v.attackRange+300) or (Dmg and Dmg > 0) or ((not Dmg or Dmg < 1) and enemyHP > 100) or itemname == "item_phase_boots") then
  1544. local cast
  1545. local delay = 0
  1546. if item:IsBehaviourType(LuaEntityAbility.BEHAVIOR_UNIT_TARGET) and go then
  1547. if ((item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALLIED) and not item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ENEMY) and not item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALL))) then
  1548. cast = v:SafeCastAbility(item,v)
  1549. elseif (item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ENEMY) or item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_CUSTOM) or item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALL)) and not tempvictim:IsInvul() and not tempvictim:DoesHaveModifier("modifier_eul_cyclone") and not tempvictim:DoesHaveModifier("modifier_brewmaster_storm_cyclone") and not tempvictim:DoesHaveModifier("modifier_invoker_tornado") and victimdistance < mathmax(item.castRange+50, 500) then
  1550. cast = v:SafeCastAbility(item,tempvictim)
  1551. delay = delay + v:GetTurnTime(tempvictim)*1000
  1552. end
  1553. elseif item:IsBehaviourType(LuaEntityAbility.BEHAVIOR_NO_TARGET) and (not data[3] or GetDistance2D(v,tempvictim) < data[3]) then
  1554. cast = v:SafeCastAbility(item)
  1555. elseif item:IsBehaviourType(LuaEntityAbility.BEHAVIOR_POINT) or item:IsBehaviourType(LuaEntityAbility.BEHAVIOR_AOE) then
  1556. if item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALLIED) and not item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ENEMY) then
  1557. cast = v:SafeCastAbility(item,v)
  1558. else
  1559. delay = delay + v:GetTurnTime(tempvictim)*1000
  1560. local delay2 = delay + client.latency
  1561. if data[2] then delay2 = delay2 + data[2]*1000 end
  1562. local speed = item:GetSpecialData("speed")
  1563. local prediction
  1564. if not speed then
  1565. prediction = SkillShotPredictedXYZ(tempvictim,delay2)
  1566. else
  1567. prediction = SkillShotSkillShotXYZ(mePosition,tempvictim,delay2,speed)
  1568. end
  1569. if prediction and GetDistance2D(prediction,mePosition) < item.castRange+150 then
  1570. delay = delay + (mathmax(GetDistance2D(prediction,mePosition)-50-item.castRange,0)/v.movespeed)*1000
  1571. cast = v:SafeCastAbility(item,prediction)
  1572. end
  1573. end
  1574. end
  1575. if cast then
  1576. Sleep(delay+client.latency+100, itemname)
  1577. if Dmg then
  1578. enemyHP = enemyHP - Dmg
  1579. end
  1580. return
  1581. end
  1582. end
  1583. end
  1584. end
  1585. end
  1586. if v:CanCast() and not v:IsChanneling() then
  1587. local abs = v.abilities
  1588. for i = 1, #abs do
  1589. local abi = abs[i]
  1590. if abi:CanBeCasted() and SleepCheck(abi.name) then
  1591. local name = abi.name
  1592. if tempvictim and (name == "necronomicon_archer_mana_burn" or name == "satyr_trickster_purge" or name == "satyr_soulstealer_mana_burn" or name == "satyr_hellcaller_shockwave" or name == "harpy_storm_chain_lightning" or ((name == "mud_golem_hurl_boulder" or name == "dark_troll_warlord_ensnare") and chainStun(tempvictim,abi:FindCastPoint()+(100/Animations.maxCount)*0.001 - ((client.latency/1000)/(1 + (1 - 1/Animations.maxCount)))+v:GetTurnTime(tempvictim)+client.latency*0.01))) then
  1593. v:CastAbility(abi,tempvictim)
  1594. Sleep(abi:FindCastPoint()*1000+v:GetTurnTime(tempvictim)*1000+client.latency,hand.."moving")
  1595. Sleep(600,name)
  1596. if name == "dark_troll_warlord_ensnare" then
  1597. Sleep(abi:FindCastPoint()*1000+client.latency+1000+v:GetTurnTime(tempvictim)*1000,"stun")
  1598. elseif name == "mud_golem_hurl_boulder" then
  1599. Sleep(abi:FindCastPoint()*1000+client.latency+GetDistance2D(v,tempvictim)/800+200+v:GetTurnTime(tempvictim)*1000,"stun")
  1600. end
  1601. elseif tempvictim and name == "enraged_wildkin_tornado" and prediction and GetDistance2D(v,tempvictim) < abi.castRange+100 then
  1602. v:CastAbility(abi,prediction)
  1603. Sleep(abi:FindCastPoint()*1000+v:GetTurnTime(tempvictim)*1000+client.latency+200,hand.."moving")
  1604. Sleep(600,name)
  1605. elseif name == "ogre_magi_frost_armor" then
  1606. local allies = entityList:GetEntities(function (x) return (x.hero and x.alive and not x:IsIllusion() and GetDistance2D(v,x) < 1000 and not x:DoesHaveModifier("modifier_ogre_magi_frost_armor")) end)
  1607. local ally = nil
  1608. if #allies > 0 then
  1609. tablesort(allies, function(a,b) return a.health < b.health end)
  1610. ally = allies[1]
  1611. end
  1612. if ally then
  1613. v:CastAbility(abi,ally)
  1614. Sleep(abi:FindCastPoint()*1000+v:GetTurnTime(ally)*1000+client.latency+500,hand.."moving")
  1615. Sleep(600,name)
  1616. end
  1617. elseif tempvictim and (name == "polar_furbolg_ursa_warrior_thunder_clap" or name == "centaur_khan_war_stomp" or name == "big_thunder_lizard_slam") and chainStun(tempvictim,abi:FindCastPoint()+(100/Animations.maxCount)*0.01 - ((client.latency/1000)/(1 + (1 - 1/Animations.maxCount)))+client.latency*0.001) then
  1618. local radius = abi:GetSpecialData("radius")
  1619. if prediction and GetDistance2D(v,prediction) < radius-50 then
  1620. v:CastAbility(abi)
  1621. Sleep(abi:FindCastPoint()*1000+client.latency,hand.."moving")
  1622. Sleep(600,name)
  1623. if name == "centaur_khan_war_stomp" then
  1624. Sleep(abi:FindCastPoint()*1000+client.latency+1000,"stun")
  1625. end
  1626. elseif SleepCheck(hand.."moving") and prediction then
  1627. v:Move(prediction)
  1628. Sleep(200,hand.."moving")
  1629. end
  1630. elseif tempvictim and name == "visage_summon_familiars_stone_form" then
  1631. if chainStun(tempvictim,0.5+client.latency*0.001+(100/Animations.maxCount)*0.01 - ((client.latency/1000)/(1 + (1 - 1/Animations.maxCount)))) then
  1632. local asd = v:FindModifier("modifier_visage_summon_familiars_damage_charge")
  1633. if (not asd or not asd.stacks or asd.stacks == 0) or retreat or v.health < 8 or tempvictim:IsAttackImmune() then
  1634. local radius = abi:GetSpecialData("stun_radius")
  1635. local prediction = SkillShotPredictedXYZ(tempvictim,500+client.latency+(100/Animations.maxCount)*100 - ((client.latency/1000)/(1 + (1 - 1/Animations.maxCount)))*1000)
  1636. if prediction and GetDistance2D(v,prediction) < radius-50 then
  1637. v:CastAbility(abi)
  1638. Sleep(500+client.latency,hand.."moving")
  1639. Sleep(600,name)
  1640. Sleep(500+client.latency+1000,"stun")
  1641. elseif SleepCheck(hand.."moving") and prediction then
  1642. v:Move(prediction)
  1643. Sleep(200,hand.."moving")
  1644. end
  1645. end
  1646. elseif SleepCheck(hand.."moving") and GetDistance2D(v,tempvictim) > 25 then
  1647. v:Move(tempvictim.position)
  1648. Sleep(200,hand.."moving")
  1649. end
  1650. elseif tempvictim and name == "elder_titan_echo_stomp_spirit" and chainStun(tempvictim,abi:FindCastPoint()+client.latency*0.001+abi:GetChannelTime(abi.level)) then
  1651. local radius = abi:GetSpecialData("radius")
  1652. if GetDistance2D(v,tempvictim) < radius then
  1653. v:CastAbility(abi)
  1654. Sleep(abi:FindCastPoint()*1000+client.latency,hand.."moving")
  1655. Sleep(600,name)
  1656. Sleep(500,"casting")
  1657. channelactive = true
  1658. end
  1659. elseif tempvictim and name == "big_thunder_lizard_frenzy" and GetDistance2D(tempvictim,v) <= 700 then
  1660. v:CastAbility(abi)
  1661. Sleep(abi:FindCastPoint()*1000+client.latency,hand.."moving")
  1662. Sleep(600,name)
  1663. end
  1664. end
  1665. end
  1666. end
  1667. if v.classId ~= CDOTA_Unit_Elder_Titan_AncestralSpirit and v.name ~= "npc_dota_enraged_wildkin_tornado" and v.classId ~= CDOTA_BaseNPC_Tusk_Sigil and not v:IsChanneling() then
  1668. if Animations.GetAttackTime(v) > 0 and tempvictim and not Animations.CanMove(v) and GetDistance2D(v,tempvictim) <= mathmax(v.attackRange*2+50,700) and not tempvictim:IsInvul() and v:CanAttack() and not tempvictim:IsAttackImmune() and not tempvictim:DoesHaveModifier("modifier_bane_nightmare") then
  1669. if SleepCheck(hand.."moving") and SleepCheck(hand.."attack") then
  1670. if not tempvictim:IsInvul() and not tempvictim:IsAttackImmune() and not tempvictim:DoesHaveModifier("modifier_bane_nightmare") then
  1671. v:Attack(tempvictim)
  1672. if GetDistance2D(v,tempvictim) < v.attackRange+50 then
  1673. enemyHP = enemyHP - tempvictim:DamageTaken((v.dmgMin + v.dmgMax)/2,DAMAGE_PHYS,v)
  1674. end
  1675. else
  1676. v:Follow(tempvictim)
  1677. end
  1678. Sleep(Animations.GetAttackTime(v)*1000,hand.."attack")
  1679. end
  1680. elseif Animations.GetAttackTime(v) > 0 and SleepCheck(hand.."moving") and SleepCheck(hand.."move") then
  1681. local mPos = client.mousePosition
  1682. if retreat or (((not tempvictim or ((GetDistance2D(v,mPos) > 300 or GetDistance2D(mPos, tempvictim) > 300) and tempvictimVisible and GetDistance2D(tempvictim,v) < 1000))) and (not tempvictim or (tempvictimVisible and GetDistance2D(tempvictim,v) < 1000)) and (not tempvictim or v:GetTurnTime(mPos)*2 < Animations.getBackswingTime(v))) then
  1683. v:Move(mPos)
  1684. elseif prediction and GetDistance2D(prediction,v) < v.attackRange and tempvictim and (GetDistance2D(v,tempvictim)-v.attackRange)/v.movespeed > Animations.getBackswingTime(v) then
  1685. v:Move(mPos)
  1686. elseif tempvictim then
  1687. v:Follow(tempvictim)
  1688. end
  1689. Sleep(math.abs(Animations.getBackswingTime(v))*1000,hand.."move")
  1690. elseif tempvictim and SleepCheck(hand.."moving") and SleepCheck(hand.."attack") and not tempvictim:IsInvul() and v:CanAttack() and not tempvictim:IsAttackImmune() and not tempvictim:DoesHaveModifier("modifier_bane_nightmare") then
  1691. v:Attack(tempvictim)
  1692. Sleep(200,hand.."attack")
  1693. end
  1694. elseif SleepCheck(hand.."moving") and (v.name == "npc_dota_enraged_wildkin_tornado" or v.classId == CDOTA_BaseNPC_Tusk_Sigil) then
  1695. if tempvictim and prediction then
  1696. local prev = SelectUnit(v)
  1697. entityList:GetMyPlayer():Move(prediction)
  1698. SelectBack(prev)
  1699. Sleep(500,hand.."moving")
  1700. end
  1701. end
  1702. end
  1703. end
  1704. if ID == CDOTA_Unit_Hero_Invoker then
  1705. quas, wex, exort, spell1, spell2, invoke = a1, a2, a3, a4, a5, a6
  1706. if (not me:IsInvisible() or me.visibleToEnemy) and combo == 0 then
  1707.  
  1708. local build = {{wex, 2}, {quas, 1}, {exort, 3}}
  1709. tablesort(build, function(a,b) return a[1].level > b[1].level end)
  1710. local spells = {}
  1711. local spellsCount = 0
  1712. local orbSpells = invokerCombo[build[1][2]]
  1713. local cyclone = me:FindItem("item_cyclone")
  1714. local tornado = me:FindItem("invoker_tornado")
  1715. local octa = me:FindItem("item_octarine_core")
  1716. function test(name) return((name ~= "invoker_tornado" or wex.level > 3) and (not harras or ((me:FindSpell(name).manacost+invoke.manacost) < me.mana*0.2 and victimdistance < range+100)) and (name ~= "invoker_chaos_meteor" or exort.level > 3 or (tempvictim and (tempvictim:IsStunned() or tempvictim:IsRooted() or movespeed < 200))) and (name ~= "invoker_ice_wall" or quas.level > 3) and (name ~= "invoker_emp" or wex.level > 3 or build[1][1] == wex) and (name ~= "invoker_sun_strike" or (exort.level > 3 and (tempvictim and (tempvictim:IsStunned() or tempvictim:IsRooted() or (cyclone and cyclone:CanBeCasted()) or (tornado and tornado:CanBeCasted()) or tempvictim:DoesHaveModifier("modifier_eul_cyclone") or tempvictim:DoesHaveModifier("modifier_invoker_tornado") or movespeed < 200 or enemyHP < 500)))) and (name ~= "invoker_ice_wall" or (name == "invoker_ice_wall" and tempvictim and (facing or GetDistance2D(me,prediction) < 450))) and (name ~= "invoker_alacrity" or (not retreat and wex.level > 3 and exort.level > 3)) and (name ~= "invoker_emp" or not retreat) and (name ~= "invoker_chaos_meteor" or not retreat) and (name ~= "invoker_tornado" or (name == "invoker_tornado" or not tempvictim or (not tempvictim:DoesHaveModifier("modifier_invoker_chaos_meteor_burn") and not tempvictim:DoesHaveModifier("modifier_invoker_ice_wall_slow_debuff") and not tempvictim:DoesHaveModifier("modifier_invoker_ice_wall_slow_aura"))))) end
  1717. local canInvoke = ((spell2.cd > 3 or (tempvictim and spell2.cd ~= 0)) or spell2.name == "invoker_ghost_walk" or (retreat and spell2.name == "invoker_alacrity") or (spell2.name == "invoker_ice_wall" and victimdistance > 700))
  1718.  
  1719.  
  1720. if retreat and wex.level > 0 and quas.level > 0 and SleepCheck("casting2") then
  1721. prepareSpell("invoker_ghost_walk", me)
  1722. end
  1723.  
  1724. if me:AghanimState() and quas.level > 5 then
  1725. local spell2cd = spell2:GetCooldown(spell2.level)
  1726. if octa then
  1727. spell2cd = spell2cd*0.75
  1728. end
  1729. spell2cd = spell2cd-7
  1730. if spell1.name == "invoker_chaos_meteor" and spell2.name == "invoker_tornado" and tempvictim and spell2 and spell2.cd > spell2cd and canInvoke and wex.level > 0 and SleepCheck("casting2") then
  1731. prepareSpell("invoker_emp", me)
  1732. end
  1733. if spell1.name == "invoker_emp" and spell2.name == "invoker_tornado" and tempvictim and spell2 and spell2.cd > spell2cd and canInvoke and wex.level > 0 and SleepCheck("casting2") then
  1734. prepareSpell("invoker_chaos_meteor", me)
  1735. end
  1736. if (spell1.name == "invoker_emp" or spell1.name == "invoker_chaos_meteor") and spell2 and spell2.cd > spell2cd and (spell2.name == "invoker_emp" or spell2.name == "invoker_chaos_meteor") and canInvoke and wex.level > 0 and quas.level > 0 and SleepCheck("casting2") then
  1737. prepareSpell("invoker_deafening_blast", me)
  1738. end
  1739. elseif (((spell1.name == "invoker_tornado" or spell1.name == "invoker_emp") and (spell2.name == "invoker_tornado" or spell2.name == "invoker_emp"))) and tempvictim and canInvoke and quas.level > 0 and SleepCheck("casting2") then
  1740. prepareSpell("invoker_cold_snap", me)
  1741. end
  1742.  
  1743. if (spell1.name == "invoker_cold_snap" or spell2.name == "invoker_cold_snap") and tempvictim and canInvoke and wex.level > exort.level and wex.level > 0 and exort.level > 0 and SleepCheck("casting2") then
  1744. local snap = me:FindSpell("invoker_cold_snap")
  1745. local spell2cd = snap:GetCooldown(snap.level)
  1746. if octa then
  1747. spell2cd = spell2cd*0.75
  1748. end
  1749. spell2cd = spell2cd-3
  1750. if snap and snap.cd > spell2cd then
  1751. prepareSpell("invoker_alacrity", me)
  1752. end
  1753. end
  1754.  
  1755. if victimdistance > range+50 and (not blink or blink.cd > 5) then
  1756. local sunstrike = me:FindSpell("invoker_sun_strike")
  1757. local Dmg = AbilityDamageGetDamage(sunstrike)
  1758. if sunstrike and spell1 ~= sunstrike and spell2 ~= sunstrike and sunstrike.cd and sunstrike.cd == 0 and sunstrike.manacost and sunstrike.manacost < me.mana and Dmg and enemyHP and Dmg >= enemyHP then
  1759. prepareSpell("invoker_sun_strike", me)
  1760. end
  1761. end
  1762.  
  1763. if (((spell1.name == "invoker_sun_strike" or spell1.name == "invoker_chaos_meteor") and (spell2.name == "invoker_sun_strike" or spell2.name == "invoker_chaos_meteor")) or
  1764. ((spell1.name == "invoker_tornado" or spell1.name == "invoker_chaos_meteor") and (spell2.name == "invoker_tornado" or spell2.name == "invoker_chaos_meteor")) or
  1765. ((spell1.name == "invoker_tornado" or spell1.name == "invoker_emp") and (spell2.name == "invoker_tornado" or spell2.name == "invoker_emp")) or retreat) and canInvoke and wex.level > 0 and quas.level > 0 and SleepCheck("casting2") then
  1766. local spell2cd = spell2:GetCooldown(spell2.level)
  1767. if octa then
  1768. spell2cd = spell2cd*0.75
  1769. end
  1770. spell2cd = spell2cd-7
  1771. if spell2 and spell2.cd > spell2cd then
  1772. prepareSpell("invoker_deafening_blast", me)
  1773. end
  1774. end
  1775.  
  1776. if tempvictim and tempvictim:DoesHaveModifier("modifier_invoker_tornado") and canInvoke and wex.level > 0 and exort.level > 0 and SleepCheck("casting2") then
  1777. prepareSpell("invoker_chaos_meteor", me)
  1778. end
  1779.  
  1780. if (((spell1.name == "invoker_tornado" or spell1.name == "invoker_ghost_walk") and (spell2.name == "invoker_tornado" or spell2.name == "invoker_ghost_walk"))) and tempvictim and tempvictim:DoesHaveModifier("modifier_invoker_tornado") and canInvoke and wex.level > 0 and SleepCheck("casting2") then
  1781. prepareSpell("invoker_emp", me)
  1782. end
  1783.  
  1784. for i = 1,#orbSpells do
  1785. local spell = orbSpells[i]
  1786. local ent = me:FindSpell(spell[1])
  1787. if ent then
  1788. if ent:CanBeCasted() and (ent == spell1 or ent == spell2) then
  1789. spellsCount = spellsCount + 1
  1790. spells[spellsCount] = spell
  1791. elseif ent.cd == 0 and ent.manacost+invoke.manacost < me.mana and (ent ~= spell1 and ent ~= spell2) and (canInvoke or spell1.name == "invoker_empty1" or spell1.name == "invoker_empty2" or spell2.name == "invoker_empty1" or spell2.name == "invoker_empty2") and SleepCheck("casting2") and test(ent.name) then
  1792. prepareSpell(ent.name, me)
  1793. end
  1794. end
  1795. end
  1796. orbSpells = invokerCombo[build[2][2]]
  1797. for i = 1,#orbSpells do
  1798. local spell = orbSpells[i]
  1799. local ent = me:FindSpell(spell[1])
  1800. if ent then
  1801. if ent:CanBeCasted() and (ent == spell1 or ent == spell2) then
  1802. spellsCount = spellsCount + 1
  1803. spells[spellsCount] = spell
  1804. elseif ent.cd == 0 and ent.manacost+invoke.manacost < me.mana and (ent ~= spell1 and ent ~= spell2) and (canInvoke or spell1.name == "invoker_empty1" or spell1.name == "invoker_empty2" or spell2.name == "invoker_empty1" or spell2.name == "invoker_empty2") and SleepCheck("casting2") and test(ent.name) then
  1805. prepareSpell(ent.name, me)
  1806. end
  1807. end
  1808. end
  1809. if build[3][1].level > 0 then
  1810. orbSpells = invokerCombo[build[3][2]]
  1811. for i = 1,#orbSpells do
  1812. local spell = orbSpells[i]
  1813. local ent = me:FindSpell(spell[1])
  1814. if ent then
  1815. if ent:CanBeCasted() and (ent == spell1 or ent == spell2) then
  1816. spellsCount = spellsCount + 1
  1817. spells[spellsCount] = spell
  1818. elseif ent.cd == 0 and ent.manacost+invoke.manacost < me.mana and (ent ~= spell1 and ent ~= spell2) and (canInvoke or spell1.name == "invoker_empty1" or spell1.name == "invoker_empty2" or spell2.name == "invoker_empty1" or spell2.name == "invoker_empty2") and SleepCheck("casting2") and test(ent.name) then
  1819. prepareSpell(ent.name, me)
  1820. end
  1821. end
  1822. end
  1823. end
  1824. if quas.level > 0 and wex.level > 0 and exort.level > 0 then
  1825. spellsCount = spellsCount + 1
  1826. spells[spellsCount] = invokerCombo[4][1]
  1827. end
  1828. if retreat and quas.level > 0 and wex.level > 0 then
  1829. spellsCount = spellsCount + 1
  1830. spells[spellsCount] = invokerCombo[4][2]
  1831. end
  1832. for i = 1, spellsCount do
  1833. local data = spells[i]
  1834. local spell = data[1]
  1835. if spell == "invoker_tornado" and spellsCount > 1 then
  1836. if quas.level > 3 then
  1837. spells[i] = spells[1]
  1838. spells[1] = data
  1839. else
  1840. spells[i] = spells[2]
  1841. spells[2] = data
  1842. end
  1843. end
  1844. end
  1845. mySpells = { CDOTA_Unit_Hero_Invoker, spells }
  1846. end
  1847. end
  1848.  
  1849. if ID == CDOTA_Unit_Hero_EmberSpirit and tempvictim then
  1850. local chains = a1
  1851. if chains and chains:CanBeCasted() and not SleepCheck("ember_spirit_sleight_of_fist") and GetDistance2D(mePosition,tempvictim) < 500 and SleepCheck(chains.name) then
  1852. me:CastAbility(chains)
  1853. Sleep(500,chains.name)
  1854. return
  1855. end
  1856. end
  1857. if tempvictim and tempvictim.hero and (not me:IsInvisible() or (a2.name == "templar_assassin_meld" and a2:CanBeCasted() and victimdistance < range)) and ((enemyHP > 0 and enemyHP > meDmg*2) or victimdistance > range+200) and me.alive and tempvictimAlive then
  1858. local CanCast = me:CanCast()
  1859. local al = #abilities
  1860. local items = me.items
  1861. local il = #items
  1862. local manaboots = me:FindItem("item_arcane_boots")
  1863. if tempvictim and tempvictimVisible and tempvictimAlive and blink and SleepCheck("blink") and GetDistance2D(prediction,me) > 500 and GetDistance2D(prediction,me) > range+50 and GetDistance2D(prediction,me) < 1700 and not me:IsStunned() and blink:CanBeCasted() and useblink and SleepCheck("casting") then
  1864. local distance = blink:GetSpecialData("blink_range")
  1865. local blinkPos = prediction
  1866. if retreat then
  1867. blinkPos = client.mousePosition
  1868. end
  1869. if GetDistance2D(prediction,me) > distance or retreat then
  1870. blinkPos = (blinkPos - me.position) * (distance-1) / GetDistance2D(blinkPos,me) + me.position
  1871. end
  1872. if me:SafeCastAbility(blink,blinkPos) then
  1873. Sleep(me:GetTurnTime(blinkPos)*1000+client.latency+400,"blink")
  1874. Sleep(me:GetTurnTime(blinkPos)*1000+client.latency+100,"casting")
  1875. Sleep(me:GetTurnTime(blinkPos)*1000+client.latency,"moving")
  1876. mePosition = blinkPos
  1877. return
  1878. end
  1879. end
  1880. local dagon = me:FindDagon()
  1881. local ethereal = me:FindItem("item_ethereal_blade")
  1882. if SleepCheck("casting") and not me:IsStunned() and tempvictimVisible and (not meld or (not me:DoesHaveModifier("modifier_templar_assassin_meld") or SleepCheck("moving"))) then
  1883. local l = #itemcomboTable
  1884. for i = 1, l do
  1885. local data = itemcomboTable[i]
  1886. local itemname = data[1] or data
  1887. local item = me:FindItem(itemname)
  1888. if item and item:CanBeCasted() then
  1889. local mainatr = 0
  1890. if itemname == "item_ethereal_blade" then
  1891. if not atr then atr = me.primaryAttribute end
  1892. local atr = atr
  1893. if atr == LuaEntityHero.ATTRIBUTE_STRENGTH then mainatr = me.strengthTotal
  1894. elseif atr == LuaEntityHero.ATTRIBUTE_AGILITY then mainatr = me.agilityTotal
  1895. elseif atr == LuaEntityHero.ATTRIBUTE_INTELLIGENCE then mainatr = me.intellectTotal
  1896. end
  1897. end
  1898. if not tempdamageTable[itemname] or (itemname == "item_ethereal_blade" and tempdamageTable[itemname][2] ~= mainatr) then
  1899. damageTable[itemname] = {AbilityDamageGetDamage(item), mainatr}
  1900. tempdamageTable = damageTable
  1901. end
  1902. local Dmg = tempdamageTable[itemname][1]
  1903. if itemname == "item_urn_of_shadows" then Dmg = 100 end
  1904. local type = AbilityDamageGetDmgType(item)
  1905. if Dmg then
  1906. Dmg = tempvictim:DamageTaken(Dmg,type,me)
  1907. end
  1908. local go = true
  1909. if itemname == "item_refresher" or (itemname == "item_cyclone" and ID == CDOTA_Unit_Hero_Tinker) then
  1910. for z = 1, al do
  1911. local ab = abilities[z]
  1912. if ab.name ~= "tinker_march_of_the_machines" and ab.name ~= "tinker_rearm" and ab.name ~= "invoker_alacrity" and ab.name ~= "invoker_forge_spirit" and ab.name ~= "invoker_ice_wall" and ab.name ~= "invoker_ghost_walk" and ab.name ~= "invoker_cold_snap" and ab.name ~= "invoker_quas" and ab.name ~= "invoker_exort" and ab.name ~= "invoker_wex" and ab.name ~= "invoker_invoke" and ab.level > 0 and ab.cd == 0 and not ab:IsBehaviourType(LuaEntityAbility.BEHAVIOR_PASSIVE) then
  1913. go = false
  1914. break
  1915. end
  1916. end
  1917. for z = 1, il do
  1918. local ab = items[z]
  1919. if ab.name ~= "item_blink" and ab.name ~= "item_travel_boots" and ab.name ~= itemname and ab.name ~= "item_travel_boots_2" and ab.name ~= "item_tpscroll" and ab.abilityData.itemCost > 1000 and ab:CanBeCasted() then
  1920. go = false
  1921. break
  1922. end
  1923. end
  1924. end
  1925. if itemname == "item_cyclone" then
  1926. if not config.UseEul then go = false end
  1927. for z = 1, al do
  1928. local ab = abilities[z]
  1929. local abcd = ab:GetCooldown(ab.level)
  1930. local octa = me:FindItem("item_octarine_core")
  1931. if octa then
  1932. abcd = abcd*0.75
  1933. end
  1934. abcd = abcd-3
  1935. local dmg
  1936. if tempdamageTable[ab.name] then
  1937. dmg = tempdamageTable[ab.name][1]
  1938. end
  1939. if (ab.cd > abcd) and ab.cd ~= 0 and dmg and dmg > 0 then go = false end
  1940. end
  1941. if combo ~= 0 then go = false end
  1942. end
  1943.  
  1944. if itemname ~= "item_veil_of_discord" and itemname ~= "item_soul_ring" and itemname ~= "item_arcane_boots" then
  1945. local spell1,spell2 = a4,a5
  1946. if (spell1.name == "invoker_tornado" and spell1:CanBeCasted()) or (spell2.name == "invoker_tornado" and spell2:CanBeCasted()) then
  1947. go = false
  1948. end
  1949. end
  1950.  
  1951. if (item == dagon or item == ethereal) and ID ~= CDOTA_Unit_Hero_Tinker and ((a4 and a4.name == "necrolyte_reapers_scythe" and a4:CanBeCasted()) or (data[4] and Dmg < enemyHP and not tempvictim:DoesHaveModifier("modifier_item_ethereal_blade_slow") and not tempvictim:DoesHaveModifier("modifier_necrolyte_reapers_scythe"))) then
  1952. go = false
  1953. end
  1954. if itemname == "item_phase_boots" then Dmg = nil end
  1955. if itemname == "item_force_staff" and not me:DoesHaveModifier("modifier_batrider_flaming_lasso_self") then go = false end
  1956. if itemname == "item_dust" and not CanGoInvis(tempvictim) then go = false end
  1957. if (itemname == "item_diffusal_blade" or itemname == "item_diffusal_blade_2") then
  1958. if not (tempvictim:DoesHaveModifier("modifier_ghost_state") or tempvictim:DoesHaveModifier("modifier_item_ethereal_blade_slow") or tempvictim:DoesHaveModifier("modifier_omninight_guardian_angel")) then
  1959. go = false
  1960. end
  1961. end
  1962. if itemname == "item_arcane_boots" and (me.maxMana - me.mana) < 135 then go = false end
  1963. local coldfeet
  1964. if ID == CDOTA_Unit_Hero_AncientApparition then
  1965. coldfeet = a1
  1966. end
  1967. if ID == CDOTA_Unit_Hero_Rubick then coldfeet = me:FindSpell("ancient_apparition_cold_feet") end
  1968.  
  1969. if itemname == "item_cyclone" then
  1970. delay = 500
  1971. if xposition then
  1972. go = false
  1973. end
  1974. if coldfeet and coldfeet:CanBeCasted() then
  1975. go = false
  1976. end
  1977. if ID == CDOTA_Unit_Hero_Skywrath_Mage then
  1978. local mfcd = a4:GetCooldown(a4.level)
  1979. local octa = me:FindItem("item_octarine_core")
  1980. if octa then
  1981. mfcd = mfcd*0.75
  1982. end
  1983. mfcd = mfcd-3
  1984. if a4 and a4.cd > mfcd then go = false end
  1985. end
  1986. if ID == CDOTA_Unit_Hero_Invoker then
  1987. local emp = me:FindSpell("invoker_emp")
  1988. local empcd = emp:GetCooldown(emp.level)
  1989. local blast = me:FindSpell("invoker_deafening_blast")
  1990. local blastcd = blast:GetCooldown(blast.level)
  1991. local meteor = me:FindSpell("invoker_chaos_meteor")
  1992. local meteorcd = meteor:GetCooldown(meteor.level)
  1993. local sunstrike = me:FindSpell("invoker_sun_strike")
  1994. local sunstrikecd = sunstrike:GetCooldown(sunstrike.level)
  1995. local octa = me:FindItem("item_octarine_core")
  1996. local spell1,spell2 = a4,a5
  1997. if (spell1.name == "invoker_tornado" and spell1:CanBeCasted()) or (spell2.name == "invoker_tornado" and spell2:CanBeCasted()) then
  1998. go = false
  1999. end
  2000. if octa then
  2001. empcd = empcd*0.75
  2002. blastcd = blastcd*0.75
  2003. meteorcd = meteorcd*0.75
  2004. sunstrikecd = sunstrikecd*0.75
  2005. end
  2006. empcd = empcd-3
  2007. blastcd = blastcd-3
  2008. meteorcd = meteorcd-5
  2009. sunstrikecd = sunstrikecd-3
  2010. if (emp and emp.cd > empcd) or (blast and blast.cd > blastcd) or (meteor and meteor.cd > meteorcd) or (sunstrike and sunstrike.cd > sunstrikecd) then
  2011. go = false
  2012. end
  2013. end
  2014. if (ID == CDOTA_Unit_Hero_Pudge and (tempvictim:DoesHaveModifier("modifier_pudge_rot") or (a4 and a4:CanBeCasted() and victimdistance < 400) or (a1 and a1:CanBeCasted() and victimdistance+100 > item.castRange))) or tempvictim:DoesHaveModifier("modifier_invoker_chaos_meteor_burn") or tempvictim:DoesHaveModifier("modifier_invoker_cold_snap") or tempvictim:DoesHaveModifier("modifier_invoker_ice_wall_slow_debuff") or tempvictim:DoesHaveModifier("modifier_invoker_ice_wall_slow_aura") or not tempvictim:CanMove() or tempvictim:DoesHaveModifier("modifier_pudge_meat_hook") or tempvictim:IsHexed() or tempvictim:IsDisarmed() or tempvictim:IsSilenced() or movespeed < 250 or tempvictim:IsRooted() or tempvictim:DoesHaveModifier("modifier_ghost_state") or tempvictim:DoesHaveModifier("modifier_item_ethereal_blade_slow") then go = false end
  2015. end
  2016. if ID == CDOTA_Unit_Hero_Invoker then
  2017. local tornado = me:FindSpell("invoker_tornado")
  2018. local tornadocd = tornado:GetCooldown(tornado.level)
  2019. if octa then
  2020. tornadocd = tornadocd*0.75
  2021. end
  2022. tornadocd = tornadocd-((GetDistance2D(me,tempvictim))/1000+client.latency/1000)
  2023. if tornado and tornado.cd > tornadocd then
  2024. go = false
  2025. end
  2026. end
  2027. local d = 0
  2028. if itemname == "item_shivas_guard" then
  2029. d = GetDistance2D(me,tempvictim)/350
  2030. end
  2031. if (not tempvictim:IsMagicImmune() or type == DAMAGE_PHYS or data[5]) and not tempvictim:DoesHaveModifier("modifier_"..itemname.."_debuff") and
  2032. (go and (itemname ~= "item_refresher" or (item.manacost*2 < me.mana or (manaboots and item.manacost*2 < (me.mana+135))))) and
  2033. SleepCheck(itemname) and ((not data[2] and not tempvictim:IsInvul() and not tempvictim:DoesHaveModifier("modifier_invoker_tornado") and not tempvictim:DoesHaveModifier("modifier_eul_cyclone")) or chainStun(tempvictim,client.latency*0.001+d+(100/Animations.maxCount)*0.01 - ((client.latency/1000)/(1 + (1 - 1/Animations.maxCount)))) or (itemname == "item_blade_mail" and chainStun(tempvictim,0,"modifier_axe_berserkers_call"))) and (not retreat or (Dmg and Dmg > enemyHP) or data[6] or data[3]) and
  2034. (not Dmg or data[2] or Dmg/4 < enemyHP or victimdistance > range) and ((victimdistance > range) or (Dmg and Dmg > 0) or ((not Dmg or Dmg < 1) and enemyHP > 100) or itemname == "item_phase_boots")
  2035. and ((not me:DoesHaveModifier("modifier_spirit_breaker_charge_of_darkness") and SleepCheck("charge")) or itemname == "item_armlet") then
  2036. local cast
  2037. local delay = 0
  2038. if itemname == "item_cyclone" then
  2039. delay = 500
  2040. if xposition then
  2041. go = false
  2042. end
  2043. if coldfeet and coldfeet:CanBeCasted() then
  2044. go = false
  2045. end
  2046. if ID == CDOTA_Unit_Hero_Invoker then
  2047. local emp = me:FindSpell("invoker_emp")
  2048. local empcd = emp:GetCooldown(emp.level)
  2049. local blast = me:FindSpell("invoker_deafening_blast")
  2050. local blastcd = blast:GetCooldown(blast.level)
  2051. local meteor = me:FindSpell("invoker_chaos_meteor")
  2052. local meteorcd = meteor:GetCooldown(meteor.level)
  2053. local sunstrike = me:FindSpell("invoker_sun_strike")
  2054. local sunstrikecd = sunstrike:GetCooldown(sunstrike.level)
  2055. local octa = me:FindItem("item_octarine_core")
  2056. local spell1,spell2 = a4,a5
  2057. if (spell1.name == "invoker_tornado" and spell1:CanBeCasted()) or (spell2.name == "invoker_tornado" and spell2:CanBeCasted()) then
  2058. go = false
  2059. end
  2060. if octa then
  2061. empcd = empcd*0.75
  2062. blastcd = blastcd*0.75
  2063. meteorcd = meteorcd*0.75
  2064. sunstrikecd = sunstrikecd*0.75
  2065. end
  2066. empcd = empcd-3
  2067. blastcd = blastcd-3
  2068. meteorcd = meteorcd-5
  2069. sunstrikecd = sunstrikecd-3
  2070. if (emp and emp.cd > empcd) or (blast and blast.cd > blastcd) or (meteor and meteor.cd > meteorcd) or (sunstrike and sunstrike.cd > sunstrikecd) then
  2071. go = false
  2072. end
  2073. end
  2074. if ID == CDOTA_Unit_Hero_Pudge then
  2075. local hook = me:FindSpell("pudge_meat_hook")
  2076. local hookcd = hook:GetCooldown(hook.level)
  2077. local octa = me:FindItem("item_octarine_core")
  2078. if octa then
  2079. hookcd = hookcd*0.75
  2080. end
  2081. hookcd = hookcd - 2
  2082. if (hook and hook.cd > hookcd) then go = false end
  2083. end
  2084. if ID == CDOTA_Unit_Hero_Mirana then
  2085. local arrow = me:FindSpell("mirana_arrow")
  2086. local arrowcd = arrow:GetCooldown(arrow.level)
  2087. local octa = me:FindItem("item_octarine_core")
  2088. if octa then
  2089. arrowcd = arrowcd*0.75
  2090. end
  2091. arrowcd = arrowcd - 5
  2092. if (arrow and arrow.cd > arrowcd) or (arrow:CanBeCasted() and victimdistance+100 > item.castRange) then go = false end
  2093. end
  2094. if (ID == CDOTA_Unit_Hero_Pudge and (tempvictim:DoesHaveModifier("modifier_pudge_rot") or (a4 and a4:CanBeCasted() and victimdistance < 400) or (a1 and a1:CanBeCasted() and victimdistance+100 > item.castRange))) or tempvictim:DoesHaveModifier("modifier_invoker_chaos_meteor_burn") or tempvictim:DoesHaveModifier("modifier_invoker_cold_snap") or tempvictim:DoesHaveModifier("modifier_invoker_ice_wall_slow_debuff") or tempvictim:DoesHaveModifier("modifier_invoker_ice_wall_slow_aura") or not tempvictim:CanMove() or tempvictim:DoesHaveModifier("modifier_pudge_meat_hook") or tempvictim:IsHexed() or tempvictim:IsDisarmed() or tempvictim:IsSilenced() or tempvictim:IsRooted() or tempvictim:DoesHaveModifier("modifier_ghost_state") or tempvictim:DoesHaveModifier("modifier_item_ethereal_blade_slow") then go = false end
  2095. end
  2096. if dagon and itemname == dagon.name and ((not SleepCheck("stuneth") and ethereal) or (ethereal and ethereal:CanBeCasted())) then go = false end
  2097. if item:IsBehaviourType(LuaEntityAbility.BEHAVIOR_UNIT_TARGET) and go then
  2098. if ((item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALLIED) and not item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ENEMY) and not item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALL)) or itemname == "item_force_staff") then
  2099. cast = me:SafeCastAbility(item,me)
  2100. elseif (item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ENEMY) or item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_CUSTOM) or item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALL)) and not tempvictim:IsInvul() and not tempvictim:DoesHaveModifier("modifier_eul_cyclone") and not tempvictim:DoesHaveModifier("modifier_brewmaster_storm_cyclone") and not tempvictim:DoesHaveModifier("modifier_invoker_tornado") and (not retreat or victimdistance < item.castRange+50) then
  2101. cast = me:SafeCastAbility(item,tempvictim)
  2102. delay = delay + me:GetTurnTime(tempvictim)*1000
  2103. end
  2104. elseif item:IsBehaviourType(LuaEntityAbility.BEHAVIOR_NO_TARGET) and (not data[3] or victimdistance-50 < data[3]) and (itemname ~= "item_armlet" or not me:DoesHaveModifier("modifier_item_armlet_unholy_strength")) then
  2105. cast = me:SafeCastAbility(item)
  2106. elseif item:IsBehaviourType(LuaEntityAbility.BEHAVIOR_POINT) or item:IsBehaviourType(LuaEntityAbility.BEHAVIOR_AOE) then
  2107. if item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALLIED) and not item:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ENEMY) then
  2108. cast = me:SafeCastAbility(item,me)
  2109. else
  2110. delay = delay + me:GetTurnTime(tempvictim)*1000
  2111. local delay2 = delay + client.latency
  2112. if data[2] then delay2 = delay2 + data[2]*1000 end
  2113. local speed = item:GetSpecialData("speed")
  2114. local prediction
  2115. if not speed then
  2116. prediction = SkillShotPredictedXYZ(tempvictim,delay2)
  2117. else
  2118. prediction = SkillShotSkillShotXYZ(mePosition,tempvictim,delay2,speed)
  2119. end
  2120. if prediction then
  2121. cast = me:SafeCastAbility(item,prediction)
  2122. end
  2123. end
  2124. end
  2125. if cast then
  2126. if itemname == "item_cyclone" then
  2127. Sleep(200, itemname)
  2128. Sleep(200, "casting")
  2129. else
  2130. Sleep(mathmax(delay,200), itemname)
  2131. end
  2132. if victimdistance < item.castRange+50 or (data[3] and victimdistance-50 < data[3]) then
  2133. Sleep(delay+client.latency,"casting")
  2134. if itemname == "item_ethereal_blade" then Sleep(delay+(mathmin(item.castRange-100,victimdistance-100)/item:GetSpecialData("projectile_speed"))*1000, "stuneth")
  2135. elseif itemname == "item_cyclone" then Sleep(500, "stun") end
  2136. if Dmg then
  2137. enemyHP = enemyHP - Dmg
  2138. end
  2139. return
  2140. end
  2141. if itemname == "item_cyclone" then return end
  2142. end
  2143. end
  2144. end
  2145. end
  2146. end
  2147. if ID == CDOTA_Unit_Hero_EarthSpirit then
  2148. if not a3:CanBeCasted() or SleepCheck("esstone") then esstone = false end
  2149. end
  2150. if mySpells and SleepCheck("casting") and CanCast and not me:DoesHaveModifier("modifier_batrider_flaming_lasso_self") and not me:DoesHaveModifier("modifier_spirit_breaker_charge_of_darkness") and SleepCheck("charge") then
  2151. local t2 = mySpells[2]
  2152. local l2 = #t2
  2153. for i = 1, l2 do
  2154. local data = t2[i]
  2155. local slot = data[1] or data
  2156. if slot then
  2157. local spell
  2158. if GetType(slot) == "string" then
  2159. spell = me:FindSpell(slot)
  2160. else
  2161. spell = abilities[slot]
  2162. end
  2163. if spell and (spell.name == "troll_warlord_whirling_axes_melee" or spell.name == "troll_warlord_whirling_axes_ranged") then
  2164. if ((spell.cd == 0 and not spell:CanBeCasted() and me.mana >= spell.manacost) or trolltoggle) and SleepCheck("toggle") and (victimdistance < spell.castRange or (victimdistance < 450)) then
  2165. me:ToggleSpell(a1.name)
  2166. Sleep(200+client.latency,"toggle")
  2167. Sleep(client.latency,"casting")
  2168. trolltoggle = false
  2169. return
  2170. end
  2171. end
  2172. if spell and spell:CanBeCasted() and (not meld or CanMove or (meld:CanBeCasted() and spell == meld) or victimdistance > range+50) then
  2173. local distance = nil
  2174. local delay = mathmax(spell:FindCastPoint()*1000, 50)
  2175. if spell.name == "templar_assassin_refraction" then delay = 0 end
  2176. if data[2] then
  2177. distance = data[2]
  2178. end
  2179. if distance then
  2180. if GetType(distance) == "string" then
  2181. if spell.name == "invoker_tornado" then
  2182. distance = spell:GetSpecialData(distance,wex.level)
  2183. elseif spell.name == "invoker_deafening_blast" then
  2184. distance = spell:GetSpecialData(distance,wex.level)
  2185. else
  2186. distance = spell:GetSpecialData(distance,spell.level)
  2187. end
  2188. end
  2189. end
  2190. local prediction
  2191. if tempvictimVisible then
  2192. prediction = SkillShotPredictedXYZ(tempvictim,mathmax(delay, 100)+client.latency)
  2193. else
  2194. prediction = SkillShot.BlindSkillShotXYZ(me,tempvictim,1100,mathmax(delay, 100)/1000+client.latency/1000)
  2195. end
  2196. local add = 0
  2197. if data[4] then add = data[4] end
  2198. if GetType(add) == "string" then
  2199. add = spell:GetSpecialData(add,spell.level)
  2200. end
  2201. if me:DoesHaveModifier("modifier_ember_spirit_fire_remnant") and spell.name == "ember_spirit_sleight_of_fist" then go = false end
  2202. local go = true
  2203. if spell.name == "tinker_rearm" then
  2204. for i = 1, al do
  2205. local ab = abilities[i]
  2206. if ab.name ~= "tinker_march_of_the_machines" and ab.name ~= "tinker_rearm" and ab:CanBeCasted() and not ab:IsBehaviourType(LuaEntityAbility.BEHAVIOR_PASSIVE) then
  2207. go = false
  2208. break
  2209. end
  2210. end
  2211. for i = 1, il do
  2212. local ab = items[i]
  2213. if ab.name ~= "item_blink" and ab.name ~= "item_travel_boots" and ab.name ~= "item_refresher" and ab.name ~= "item_travel_boots_2" and ab.name ~= "item_tpscroll" and ab.abilityData.itemCost > 1000 and ab:CanBeCasted() then
  2214. go = false
  2215. break
  2216. end
  2217. end
  2218. end
  2219. local castRange = spell.castRange
  2220. if spell.name == "phoenix_icarus_dive" then castRange = 1400 end
  2221. local octa = me:FindItem("item_octarine_core")
  2222. if spell.name == "invoker_tornado" then
  2223. castRange = distance
  2224. local emp = me:FindSpell("invoker_emp")
  2225. local empcd = emp:GetCooldown(emp.level)
  2226. local blast = me:FindSpell("invoker_deafening_blast")
  2227. local blastcd = blast:GetCooldown(blast.level)
  2228. local meteor = me:FindSpell("invoker_chaos_meteor")
  2229. local meteorcd = meteor:GetCooldown(meteor.level)
  2230. local sunstrike = me:FindSpell("invoker_sun_strike")
  2231. local sunstrikecd = sunstrike:GetCooldown(sunstrike.level)
  2232. if octa then
  2233. empcd = empcd*0.75
  2234. blastcd = blastcd*0.75
  2235. meteorcd = meteorcd*0.75
  2236. sunstrikecd = sunstrikecd*0.75
  2237. end
  2238. empcd = empcd-3
  2239. blastcd = blastcd-3
  2240. meteorcd = meteorcd-5
  2241. sunstrikecd = sunstrikecd-3
  2242. if (blink and blink:CanBeCasted()) or tempvictim:IsSilenced() or tempvictim:IsRooted() or tempvictim:IsStunned() or tempvictim:DoesHaveModifier("modifier_ghost_state") or tempvictim:DoesHaveModifier("modifier_item_ethereal_blade_slow") or tempvictim:DoesHaveModifier("modifier_invoker_chaos_meteor_burn") or tempvictim:DoesHaveModifier("modifier_invoker_cold_snap") or tempvictim:DoesHaveModifier("modifier_invoker_ice_wall_slow_debuff") or tempvictim:DoesHaveModifier("modifier_invoker_ice_wall_slow_aura") or (emp and emp.cd > empcd and quas.level > 3) or (blast and blast.cd > blastcd) or (meteor and meteor.cd > meteorcd) or (sunstrike and sunstrike.cd > sunstrikecd) then
  2243. go = false
  2244. end
  2245. end
  2246. if spell.name == "lone_druid_true_form" and retreat then go = false end
  2247. if spell.name == "invoker_cold_snap" then
  2248. local tornado = me:FindSpell("invoker_tornado")
  2249. local tornadocd = tornado:GetCooldown(tornado.level)
  2250. if octa then
  2251. tornadocd = tornadocd*0.75
  2252. end
  2253. tornadocd = tornadocd-3
  2254. if tornado and tornado.cd > tornadocd then go = false end
  2255. end
  2256. if spell.name == "pugna_decrepify" then
  2257. local blast = a1
  2258. if blast and blast:CanBeCasted() then
  2259. go = false
  2260. end
  2261. end
  2262. if ID == CDOTA_Unit_Hero_Invoker and spell.name ~= "invoker_tornado" then
  2263. local tornado = me:FindSpell("invoker_tornado")
  2264. local tornadocd = tornado:GetCooldown(tornado.level)
  2265. if octa then
  2266. tornadocd = tornadocd*0.75
  2267. end
  2268. if spell.name == "invoker_emp" then tornadocd = tornadocd-((GetDistance2D(me,tempvictim)-350)/1000)
  2269. else tornadocd = tornadocd-((GetDistance2D(me,tempvictim))/1000+client.latency/1000) end
  2270. if tornado and tornado.cd > tornadocd then
  2271. go = false
  2272. end
  2273. end
  2274. if spell.name == "shadow_shaman_ether_shock" and (a2:CanBeCasted() or (a3:CanBeCasted() and spell.manacost+a3.manacost > me.mana)) then go = false end
  2275. if castRange < 1 then castRange = 9999999 end
  2276. if spell.name == "earth_spirit_boulder_smash" then
  2277. local grip = a3
  2278. if grip and grip:CanBeCasted() then
  2279. castRange = 1200
  2280. end
  2281. end
  2282. if spell.name == "earth_spirit_rolling_boulder" then castRange = 1200 if not a1:CanBeCasted() and a4:CanBeCasted() then castRange = 3000 end end
  2283. if spell.name == "slark_pounce" then castRange = 700 end
  2284. if not tempdamageTable[spell.name] or tempdamageTable[spell.name][2] ~= spell.level or (me:AghanimState() and not tempdamageTable[spell.name][3]) then
  2285. damageTable[spell.name] = {AbilityDamageGetDamage(spell), spell.level, me:AghanimState()}
  2286. tempdamageTable = damageTable
  2287. end
  2288. local Dmg = tempdamageTable[spell.name][1]
  2289. if ID == CDOTA_Unit_Hero_Invoker then Dmg = AbilityDamageGetDamage(spell) end
  2290. if spell.name == "visage_soul_assumption" then
  2291. local modif = me:FindModifier("modifier_visage_soul_assumption")
  2292. if modif then
  2293. Dmg = 20
  2294. if modif.stacks > 0 then
  2295. Dmg = Dmg + modif.stacks*65
  2296. end
  2297. end
  2298. end
  2299. if spell.name == "necrolyte_reapers_scythe" then
  2300. if dagon and dagon:CanBeCasted() then
  2301. if tempdamageTable[dagon.name] then
  2302. Dmg = Dmg*(tempvictim.maxHealth - (enemyHP - tempvictim:DamageTaken(tempdamageTable[dagon.name][1],DAMAGE_MAGC,me))) + tempvictim:DamageTaken(tempdamageTable[dagon.name][1],DAMAGE_MAGC,me)
  2303. else
  2304. Dmg = Dmg*(tempvictim.maxHealth - (enemyHP - tempvictim:DamageTaken(AbilityDamageGetDamage(dagon),DAMAGE_MAGC,me))) + tempvictim:DamageTaken(AbilityDamageGetDamage(dagon),DAMAGE_MAGC,me)
  2305. end
  2306. elseif Dagon and Dagon:CanBeCasted() and ethereal and etherel:CanBeCasted() then
  2307. if tempdamageTable[dagon.name] and tempdamageTable[ethereal.name] then
  2308. Dmg = Dmg*(tempvictim.maxHealth - (enemyHP - tempvictim:DamageTaken(tempdamageTable[dagon.name][1],DAMAGE_MAGC,me) - tempvictim:DamageTaken(tempdamageTable[ethereal.name][1],DAMAGE_MAGC,me))) + tempvictim:DamageTaken(tempdamageTable[ethereal.name][1],DAMAGE_MAGC,me) + tempvictim:DamageTaken(tempdamageTable[dagon.name][1],DAMAGE_MAGC,me)
  2309. else
  2310. Dmg = Dmg*(tempvictim.maxHealth - (enemyHP - tempvictim:DamageTaken(AbilityDamageGetDamage(dagon),DAMAGE_MAGC,me) - tempvictim:DamageTaken(AbilityDamageGetDamage(ethereal),DAMAGE_MAGC,me))) + tempvictim:DamageTaken(AbilityDamageGetDamage(ethereal),DAMAGE_MAGC,me) + tempvictim:DamageTaken(AbilityDamageGetDamage(dagon),DAMAGE_MAGC,me)
  2311. end
  2312. else
  2313. Dmg = Dmg*(tempvictim.maxHealth - enemyHP)
  2314. end
  2315. if ethereal and ethereal:CanBeCasted() then
  2316. Dmg = Dmg*1.4
  2317. end
  2318. end
  2319. local type = AbilityDamageGetDmgType(spell)
  2320. if spell.name == "antimage_mana_void" then
  2321. local missingMana = (tempvictim.maxMana - tempvictim.mana)
  2322. Dmg = missingMana*Dmg
  2323. if missingMana > tempvictim.maxMana*0.1 and tempvictim:DamageTaken(Dmg,type,me) < tempvictim.health then
  2324. go = false
  2325. end
  2326. end
  2327. if ID == CDOTA_Unit_Hero_StormSpirit then
  2328. local Overload = me:DoesHaveModifier("modifier_storm_spirit_overload")
  2329. local pull = a2
  2330. if Overload and not CanMove and victimdistance < range+50 then
  2331. go = false
  2332. end
  2333. if spell.name == "storm_spirit_ball_lightning" and (victimdistance < range+50 and (me.mana < (me.maxMana*0.6) or (pull and pull:CanBeCasted()))) or me:DoesHaveModifier("modifier_storm_spirit_ball_lightning") then
  2334. go = false
  2335. end
  2336. if spell.name == "storm_spirit_static_remnant" and victimdistance > range+50 then
  2337. go = false
  2338. end
  2339. end
  2340. if spell.name == "storm_spirit_ball_lightning" and ID == CDOTA_Unit_Hero_Rubick and victimdistance < range+50 then
  2341. go = false
  2342. end
  2343. if spell.name == "leshrac_pulse_nova" and me:DoesHaveModifier("modifier_leshrac_pulse_nova") then go = false end
  2344. if spell.name == "leshrac_split_earth" and a3 and a3:CanBeCasted() and (not (tempvictim:IsStunned() or tempvictim:IsRooted() or tempvictim:IsHexed() or not tempvictim:CanMove() or tempvictim:IsInvul()) and not Animations.isAttacking(tempvictim) and tempvictim.activity ~= LuaEntityNPC.ACTIVITY_IDLE) then go = false end
  2345. if spell.name == "invoker_emp" then
  2346. if tempvictim.mana < Dmg then
  2347. Dmg = tempvictim.mana
  2348. end
  2349. Dmg = Dmg/2
  2350. if tempvictim.mana < 100 and combo ~= 1 then
  2351. go = false
  2352. end
  2353. end
  2354. if spell.name == "tusk_walrus_kick" then
  2355. local base = entityList:GetEntities({classId = CDOTA_Unit_Fountain,team = me.team})[1]
  2356. if not retreat then go = false end
  2357. if GetDistance2D(me,base) > GetDistance2D(base,tempvictim) then go = true end
  2358. end
  2359. if spell.name == "phoenix_sun_ray" then
  2360. Dmg = Dmg + tempvictim.maxHealth*(spell:GetSpecialData("hp_perc_dmg",spell.level)/100)
  2361. end
  2362. if Dmg and tempvictim then
  2363. Dmg = tempvictim:DamageTaken(Dmg,type,me)
  2364. end
  2365. if ID == CDOTA_Unit_Hero_Zuus then
  2366. local staticF = a3
  2367. if staticF and staticF.level > 0 and victimdistance < 1250 then
  2368. Dmg = Dmg + tempvictim:DamageTaken(((staticF:GetSpecialData("damage_health_pct",staticF.level)/100)*enemyHP),DAMAGE_MAGC,me)
  2369. end
  2370. end
  2371. if spell.name == "necrolyte_reapers_scythe" and not (tempvictim and tempvictim:DoesHaveModifier("modifier_item_ethereal_blade_slow")) and enemyHP > Dmg then
  2372. go = false
  2373. end
  2374. local channel = spell:GetChannelTime(spell.level) or 0
  2375. if spell.name == "bane_fiends_grip" then channel = 0 end
  2376. local speed = spell:GetSpecialData("speed", spell.level)
  2377. if data[6] then
  2378. speed = spell:GetSpecialData(data[6], spell.level)
  2379. end
  2380. if spell.name == "earth_spirit_rolling_boulder" then speed = 800 if not a1:CanBeCasted() and a4:CanBeCasted() then speed = 1600 end end
  2381. if spell.name == "invoker_cold_snap" then
  2382. local tornado = me:FindSpell("invoker_tornado")
  2383. local tornadocd = tornado:GetCooldown(tornado.level)
  2384. if octa then
  2385. tornadocd = tornadocd*0.75
  2386. end
  2387. tornadocd = tornadocd-((GetDistance2D(me,tempvictim))/1000+client.latency/1000)
  2388. if tornado and tornado.cd > tornadocd then
  2389. go = false
  2390. end
  2391. end
  2392. if spell.name == "morphling_adaptive_strike" or spell.name == "morphling_waveform" then
  2393. local eth = me:FindItem("item_ethereal_blade")
  2394. if eth and eth:CanBeCasted() then
  2395. go = false
  2396. end
  2397. end
  2398. if spell.name == "shadow_demon_demonic_purge" and a1 and a1:CanBeCasted() and victimdistance <= a1.castRange+100 then go = false end
  2399. if (retreat or harras) and (delay > 600 or channel > 0) then
  2400. go = false
  2401. end
  2402. if spell.name == "ember_spirit_activate_fire_remnant" then
  2403. local remnants = entityList:GetEntities(function (v) return (v.classId == CDOTA_BaseNPC_Additive and v.team == me.team and v.alive == true and v.name == "npc_dota_ember_spirit_remnant" and GetDistance2D(v,tempvictim) < 700) end)
  2404. if #remnants <= 0 then go = false end
  2405. end
  2406. if spell.name == "earth_spirit_geomagnetic_grip" or spell.name == "earth_spirit_rolling_boulder" then
  2407. local smash = a1
  2408. if smash:CanBeCasted() and not smash.abilityPhase and a4:CanBeCasted() then go = false end
  2409. end
  2410. local raze1, raze2, raze3
  2411. if ID == CDOTA_Unit_Hero_Nevermore then
  2412. raze1, raze2, raze3 = SkillShot.InFront(me,200), SkillShot.InFront(me,450), SkillShot.InFront(me,700)
  2413. end
  2414. if spell.name == "disruptor_glimpse" then
  2415. local pos = positionsTable[tempvictim.handle]
  2416. local time = gameTime-4
  2417. local closest = nil
  2418. local closesttime = nil
  2419. for i,v in pairs(pos) do
  2420. if not closest or math.abs(time-i) < closesttime then
  2421. closest = v
  2422. closesttime = math.abs(time-i)
  2423. end
  2424. end
  2425. if GetDistance2D(tempvictim,closest) < 500 or GetDistance2D(me,closest) > victimdistance then go = false end
  2426. local a3cd = a3:GetCooldown(a3.level)
  2427. a3cd = a3cd - 3.800
  2428. if a3.cd > a3cd then go = false end
  2429. if not tempvictim:DoesHaveModifier("modifier_disruptor_thunder_strike") and a1:CanBeCasted() and victimdistance < a1.castRange+200 and not me.visibleToEnemy then go = false end
  2430. end
  2431. if spell.name == "rubick_spell_steal" and a5 and (a5:CanBeCasted() or (a5.cd < 5 and a5.manacost < me.mana)) and a5.name ~= "rubick_empty1" then go = false end
  2432. local speeddist = 0
  2433. local radius = distance or 100
  2434. if distance then radius = distance end
  2435. if spell.name == "ember_spirit_fire_remnant" then speed = me.movespeed*2.5 if not config.EMBERUseUlti then go = false end end
  2436. if speed then speeddist = math.abs(victimdistance-100)/speed end
  2437. if ID == CDOTA_Unit_Hero_Lion and spell.name ~= "lion_voodoo" and a2 and a2:CanBeCasted() then go = false end
  2438. if ID == CDOTA_Unit_Hero_ShadowShaman and spell.name ~= "shadow_shaman_voodoo" and a2 and a2:CanBeCasted() then go = false end
  2439. if spell.name == "lion_impale" then speeddist = (victimdistance)/speed end
  2440. if spell.name == "kunkka_torrent" and (a3:CanBeCasted() or a3.cd < 3) and a3.name == "kunkka_x_marks_the_spot" then go = false end
  2441. if spell.name == "shadow_shaman_shackles" then channel = 0 end
  2442. if spell.name == "windrunner_powershot" and ((a1 and enemyHP > Dmg and (a1:CanBeCasted() or a1.cd < 3 or not chainStun(tempvictim,delay*0.001 + (100/Animations.maxCount)*0.001 + client.latency*0.001 + add + channel + me:GetTurnTime(tempvictim),nil,true) or chainStun(tempvictim,delay*0.001 + (100/Animations.maxCount)*0.001 + client.latency*0.001 + add + me:GetTurnTime(tempvictim),nil,true)))) then go = false end
  2443. if spell.name == "kunkka_ghostship" then
  2444. if a3:CanBeCasted() and a3.name ~= "kunkka_return" then go = false end
  2445. if a3.name == "kunkka_return" and not xposition then xposition = tempvictim.position end
  2446. end
  2447. if spell.name == "visage_soul_assumption" then
  2448. local modif = me:FindModifier("modifier_visage_soul_assumption")
  2449. if not modif or (modif.stacks ~= spell.level+2 and Dmg < enemyHP) then
  2450. go = false
  2451. end
  2452. end
  2453. if spell.name == "disruptor_thunder_strike" and xposition and victimdistance > castRange then
  2454. go = false
  2455. end
  2456. if spell.name == "gyrocopter_flak_cannon" then
  2457. local closeEnemies = entityList:GetEntities(function (v) return (v.hero and not v:IsIllusion() and v.alive and v.team ~= me.team and v ~= tempvictim and GetDistance2D(me,v) < 1000) end)
  2458. if #closeEnemies < 1 then
  2459. go = false
  2460. end
  2461. end
  2462. if spell.name == "dark_seer_ion_shell" then
  2463. local closeEnemies = entityList:GetEntities(function (v) return (v.hero and v.alive and v ~= tempvictim and not v:DoesHaveModifier("modifier_dark_seer_ion_shell") and GetDistance2D(tempvictim,v) < 350) end)
  2464. if #closeEnemies < 1 then
  2465. go = false
  2466. else
  2467. tablesort(closeEnemies, function (a,b) return GetDistance2D(a,tempvictim) < GetDistance2D(b,tempvictim) end)
  2468. local closest = closeEnemies[1]
  2469. if closest then
  2470. me:CastAbility(spell,closest) Sleep(300, "dark_seer_ion_shell") Sleep(delay, "casting") return
  2471. end
  2472. end
  2473. end
  2474. if spell.name == "dark_seer_surge" then
  2475. local closeEnemies = entityList:GetEntities(function (v) return (v.hero and v.alive and v.team == me.team and v ~= tempvictim and GetDistance2D(tempvictim,v) < 1000) end)
  2476. if #closeEnemies < 1 then
  2477. go = false
  2478. else
  2479. tablesort(closeEnemies, function (a,b) return GetDistance2D(a,tempvictim) < GetDistance2D(b,tempvictim) end)
  2480. local closest = closeEnemies[1]
  2481. if closest then
  2482. me:CastAbility(spell,closest) Sleep(300, "dark_seer_ion_shell") Sleep(delay, "casting") return
  2483. end
  2484. end
  2485. end
  2486. if spell.name == "dark_seer_wall_of_replica" then
  2487. local closeEnemies = entityList:GetEntities(function (v) return (v.hero and not v:IsIllusion() and v.alive and v.team ~= me.team and v ~= tempvictim and GetDistance2D(tempvictim,v) < 700) end)
  2488. if #closeEnemies < 3 then
  2489. go = false
  2490. end
  2491. end
  2492. if spell.name == "terrorblade_sunder" and SleepCheck("terrorblade_sunder") then
  2493. local myPercent = me.health/me.maxHealth
  2494. local possibleEnemies = entityList:GetEntities(function (v) return (v.hero and v.alive and GetDistance2D(me,v) < castRange+50 and v.health/v.maxHealth > (myPercent+0.3)) end)
  2495. if myPercent > 0.5 then go = false
  2496. elseif #possibleEnemies > 0 then
  2497. local maxHP = nil
  2498. for i = 1, #possibleEnemies do
  2499. local v = possibleEnemies[i]
  2500. if not maxHP or maxHP.health/maxHP.maxHealth < v.health/v.maxHealth then
  2501. maxHP = v
  2502. end
  2503. end
  2504. if maxHP then me:CastAbility(spell,maxHP) Sleep(300, "terrorblade_sunder") Sleep(delay, "casting") return
  2505. else go = false end
  2506. else
  2507. go = false
  2508. end
  2509. end
  2510. if spell.name == "warlock_fatal_bonds" then
  2511. local closeUnits = entityList:GetEntities(function (v) return ((v.hero or v.creep) and v.team ~= me.team and v.alive and v ~= tempvictim and GetDistance2D(tempvictim,v) < 700) end)
  2512. if #closeUnits < 2 then go = false
  2513. elseif #closeUnits > 0 and victimdistance > castRange then
  2514. tablesort(closeUnits, function (a,b) return GetDistance2D(a,me) < GetDistance2D(b,me) end)
  2515. local closest = closeUnits[1]
  2516. if closest and GetDistance2D(closest,me) < victimdistance then
  2517. me:CastAbility(spell,closest) Sleep(300, "warlock_fatal_bonds") Sleep(delay, "casting") return
  2518. end
  2519. end
  2520. end
  2521. if spell.name == "winter_wyvern_splinter_blast" then
  2522. local closeUnits = entityList:GetEntities(function (v) return ((v.hero or v.creep) and v.team ~= me.team and v.alive and v ~= tempvictim and GetDistance2D(tempvictim,v) < 500) end)
  2523. if #closeUnits < 1 then go = false
  2524. elseif #closeUnits > 0 then
  2525. tablesort(closeUnits, function (a,b) return GetDistance2D(a,tempvictim) < GetDistance2D(b,tempvictim) end)
  2526. local closest = closeUnits[1]
  2527. if closest then
  2528. me:CastAbility(spell,closest) Sleep(300, "winter_wyvern_splinter_blast") Sleep(delay, "casting") return
  2529. end
  2530. end
  2531. end
  2532. if spell.name == "puck_ethereal_jaunt" then
  2533. local orb = FindEntity(entityList:GetEntities({classId=CDOTA_BaseNPC}),me,800,nil)
  2534. if not orb then go = false
  2535. elseif (GetDistance2D(tempvictim,orb) > 225 or GetDistance2D(me,orb)+200 < victimdistance) and GetDistance2D(PuckPosition,orb) < 1500 and (not retreat or GetDistance2D(PuckPosition,orb) < 1500) then go = false end
  2536. end
  2537. if spell.name == "undying_tombstone" then
  2538. local closeEnemies = entityList:GetEntities(function (v) return (v.hero and not v:IsIllusion() and v.alive and v.team ~= me.team and v ~= tempvictim and GetDistance2D(me,v) < 700) end)
  2539. if #closeEnemies < 2 then
  2540. go = false
  2541. end
  2542. end
  2543. if spell.name == "earthshaker_echo_slam" then
  2544. local closeUnits = entityList:GetEntities(function (v) return ((v.hero or v.creep) and v.team ~= me.team and v.alive and v ~= tempvictim and GetDistance2D(me,v) < 600) end)
  2545. if #closeEnemies < 2 then
  2546. go = false
  2547. end
  2548. end
  2549. if spell.name == "undying_soul_rip" then
  2550. local closeUnits = entityList:GetEntities(function (v) return ((v.hero or v.creep) and v.alive and v ~= tempvictim and GetDistance2D(me,v) < 1000) end)
  2551. if #closeUnits < 3 then
  2552. go = false
  2553. end
  2554. end
  2555. local cast = nil
  2556. local chanab = me:GetChanneledAbility()
  2557. local chaindelay = delay*0.001 + (100/Animations.maxCount)*0.01 - ((client.latency/1000)/(1 + (1 - 1/Animations.maxCount))) + client.latency*0.001 + add + channel + speeddist + me:GetTurnTime(tempvictim)
  2558. if spell.name == "phoenix_sun_ray" and me:DoesHaveModifier("modifier_phoenix_icarus_dive") then go = false end
  2559. if (not spell.abilityPhase or spell:FindCastPoint() <= 0) and not chanab and tempvictim and (not harras or (spell.manacost < me.mana*0.2 and victimdistance < range+100)) and (not tempvictim:IsMagicImmune() or type == DAMAGE_PHYS or data[10]) and go and SleepCheck(spell.name) and ((not data[3] and not tempvictim:IsInvul() and (ID == CDOTA_Unit_Hero_Invoker or SleepCheck("stuneth")) and ((not tempvictim:DoesHaveModifier("modifier_invoker_tornado") and not tempvictim:DoesHaveModifier("modifier_eul_cyclone")) or spell.name == "invoker_emp")) or (chainStun(tempvictim,chaindelay) and (spell.name ~= "earth_spirit_rolling_boulder" or victimdistance < 400))) and
  2560. (not Dmg or data[3] or Dmg/6 < enemyHP or spell.name == "invoker_sun_strike" or spell.name == "ember_spirit_activate_fire_remnant" or (victimdistance > (range+(me.movespeed*(delay/1000))) and victimdistance < castRange+radius) or spell.name == "axe_culling_blade" or spell.name == "legion_commander_duel") and (spell.name ~= "sniper_assassinate" or (victimdistance > range+100 and enemyHP < Dmg)) and (spell.name ~= "shadow_shaman_mass_serpent_ward" or (victimdistance > 100)) and (not data[5] or Dmg >= tempvictim.health) and ((victimdistance > (range+200+(me.movespeed*(delay/1000))) or (Dmg and Dmg > 0) or (not Dmg or Dmg < 1))) and (not retreat or (Dmg and enemyHP and Dmg > enemyHP) or not data[11] or (data[3] and not data[11])) then
  2561. if spell.name == "shadow_shaman_shackles" then channel = spell:GetChannelTime(spell.level) end
  2562. if spell.name == "bane_fiends_grip" then channel = spell:GetChannelTime(spell.level) end
  2563. if spell:IsBehaviourType(LuaEntityAbility.BEHAVIOR_UNIT_TARGET) and spell.name ~= "magnataur_shockwave" and spell.name ~= "lion_impale" and tempvictimVisible and (spell.name ~= "earth_spirit_boulder_smash" or not a4:CanBeCasted()) and spell.name ~= "earth_spirit_geomagnetic_grip" then
  2564. lastCastPrediction = nil
  2565. if not me:IsMagicImmune() and spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALLIED) and not DoesHaveModifier("modifier_"..spell.name) and not DoesHaveModifier("modifier_"..spell.name.."_debuff") and not spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALL) and spell.name ~= "bloodseeker_bloodrage" then
  2566. cast = me:SafeCastAbility(spell,me)
  2567. elseif (spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ENEMY) or spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_CUSTOM) or spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALL)) and not tempvictim:IsInvul() and not tempvictim:DoesHaveModifier("modifier_eul_cyclone") and not tempvictim:DoesHaveModifier("modifier_invoker_tornado") and (victimdistance < mathmax(castRange+500, 1000) or spell.name == "kunkka_x_marks_the_spot") and (not retreat or victimdistance < castRange+50) and ((not tempvictim:DoesHaveModifier("modifier_"..spell.name) and not tempvictim:DoesHaveModifier("modifier_"..spell.name.."_debuff")) or spell.name == "bristleback_viscous_nasal_goo" or spell.name == "disruptor_glimpse") then
  2568. if spell.name == "earth_spirit_boulder_smash" then
  2569. local remn = entityList:GetEntities({classId = CDOTA_Unit_Earth_Spirit_Stone})
  2570. local found = false
  2571. for i = 1, #remn do
  2572. local v = remn[i]
  2573. local calc1 = (mathfloor(mathsqrt((tempvictim.position.x-v.position.x)^2 + (tempvictim.position.y-v.position.y)^2)))
  2574. local calc2 = (mathfloor(mathsqrt((me.position.x-v.position.x)^2 + (me.position.y-v.position.y)^2)))
  2575. local calc4 = (mathfloor(mathsqrt((me.position.x-tempvictim.position.x)^2 + (me.position.y-tempvictim.position.y)^2)))
  2576. if calc1 < calc4 and calc2 < calc4 and GetDistance2D(me,v) < 300 then
  2577. found = true
  2578. esstone = true
  2579. cast = me:SafeCastAbility(spell,tempvictim)
  2580. Sleep(me:GetTurnTime(tempvictim)*1000, "casting")
  2581. Sleep(me:GetTurnTime(prediction)*1000+spell:FindCastPoint()*1000+((victimdistance+500)/speed)*1000+client.latency+200, "esstone")
  2582. Sleep(me:GetTurnTime(prediction)*1000+client.latency+client.latency+spell:FindCastPoint()*1000, "moving")
  2583. Sleep(me:GetTurnTime(tempvictim)*1000+spell:FindCastPoint()*1000+client.latency,spell.name)
  2584. return
  2585. end
  2586. end
  2587. local base = entityList:GetEntities({classId = CDOTA_Unit_Fountain,team = me.team})[1]
  2588. if not found and victimdistance < 300 and GetDistance2D(me,base)+50 > GetDistance2D(tempvictim,base) then
  2589. cast = me:SafeCastAbility(spell,tempvictim)
  2590. Sleep(me:GetTurnTime(tempvictim)*1000, "casting")
  2591. Sleep(me:GetTurnTime(prediction)*1000+client.latency+client.latency+spell:FindCastPoint()*1000, "moving")
  2592. Sleep(me:GetTurnTime(tempvictim)*1000+spell:FindCastPoint()*1000+client.latency,spell.name)
  2593. return
  2594. end
  2595. else
  2596. cast = me:SafeCastAbility(spell,tempvictim)
  2597. delay = delay + me:GetTurnTime(tempvictim)*1000
  2598. if spell.name == "spirit_breaker_charge_of_darkness" then Sleep(delay + me:GetTurnTime(tempvictim)*1000 + 1000, "charge") end
  2599. end
  2600. end
  2601. elseif ((spell:IsBehaviourType(LuaEntityAbility.BEHAVIOR_NO_TARGET) and spell.name ~= "slark_pounce" and spell.name ~= "nevermore_shadowraze1" and spell.name ~= "nevermore_shadowraze2" and spell.name ~= "nevermore_shadowraze3") or (spell.name == "invoker_deafening_blast" and quas.level == 7 and wex.level == 7 and exort.level == 7)) and tempvictimVisible and
  2602. ((not tempvictim:DoesHaveModifier("modifier_"..spell.name) and (spell.name ~= "tinker_heat_seeking_missile" or not tempvictim:DoesHaveModifier("modifier_eul_cyclone")) and not tempvictim:DoesHaveModifier("modifier_"..spell.name.."_debuff") and not DoesHaveModifier("modifier_"..spell.name)) or spell.name == "bristleback_quill_spray") and tempvictimVisible and not DoesHaveModifier("modifier_"..spell.name.."_debuff") then
  2603. lastCastPrediction = nil
  2604. if spell.name == "invoker_ice_wall" and prediction and (GetDistance2D(me,prediction)-50) > 200 and (GetDistance2D(me,prediction)-50) < 610 then
  2605. local mepred = SkillShotPredictedXYZ(me,client.latency+100)
  2606. if not facing then
  2607. mepred = (me.position - tempvictim.position) * 50 / GetDistance2D(me,tempvictim) + tempvictim.position
  2608. end
  2609. local v = {prediction.x-mepred.x,prediction.y-mepred.y}
  2610. local mathacos = math.acos
  2611. local a = mathacos(175/GetDistance2D(prediction,mepred))
  2612. local vec1, vec2 = nil, nil
  2613. if a ~= nil then
  2614. local x1 = rotateX(v[1],v[2],a)
  2615. local y1 = rotateY(v[1],v[2],a)
  2616. if x1 and y1 then
  2617. local k = {x1*50/mathsqrt((x1*x1)+(y1*y1)),y1*50/mathsqrt((x1*x1)+(y1*y1))}
  2618. vec1 = Vector(k[1]+mepred.x,k[2]+mepred.y,mepred.z)
  2619. end
  2620. end
  2621. if not vec1 then vec1 = vec2 end
  2622. if vec1 and vec2 and me:GetTurnTime(vec2) < me:GetTurnTime(vec1) then
  2623. vec1 = vec2
  2624. end
  2625. if vec1 and GetDistance2D(me,vec1) > 0 then
  2626. me:Move(mepred)
  2627. me:Move(vec1,true)
  2628. cast = me:SafeCastAbility(spell,true)
  2629. Sleep((GetDistance2D(me,vec1)/me.movespeed)*1000+me:GetTurnTime(vec1)*1000+500, "casting")
  2630. Sleep((GetDistance2D(me,vec1)/me.movespeed)*1000+me:GetTurnTime(vec1)*1000+500, "moving")
  2631. return
  2632. end
  2633. elseif (spell.name ~= "templar_assassin_meld" or (not retreat and not CanMove and GetDistance2D(mePosition,SkillShotPredictedXYZ(tempvictim,client.latency+spell:FindCastPoint()*1000+me:GetTurnTime(tempvictim)*1000)) <= range+50)) then
  2634. if spell.name ~= "invoker_ice_wall" or (retreat or facing) then
  2635. local prediction = SkillShotSkillShotXYZ(mePosition,tempvictim,delay,999999)
  2636. if prediction and (not distance or GetDistance2D(prediction,mePosition) < distance or a2.name == "elder_titan_return_spirit") then
  2637. cast = me:SafeCastAbility(spell)
  2638. end
  2639. end
  2640. if spell.name == "templar_assassin_meld" then
  2641. me:Attack(tempvictim)
  2642. delay = delay + me:GetTurnTime(tempvictim)*1000 + Animations.GetAttackTime(me)*1000
  2643. Sleep(delay + me:GetTurnTime(tempvictim)*1000 + Animations.GetAttackTime(me)*1000 + client.latency, "casting")
  2644. end
  2645. end
  2646. elseif spell:IsBehaviourType(LuaEntityAbility.BEHAVIOR_POINT) or spell:IsBehaviourType(LuaEntityAbility.BEHAVIOR_AOE) or spell.name == "slark_pounce" or (spell.name == "nevermore_shadowraze1" and prediction and GetDistance2D(prediction,raze1) < 250) or (spell.name == "nevermore_shadowraze2" and prediction and GetDistance2D(prediction,raze2) < 250) or (spell.name == "nevermore_shadowraze3" and prediction and GetDistance2D(prediction,raze3) < 250) then
  2647. if not me:IsMagicImmune() and spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ALLIED) and not spell:IsTargetTeam(LuaEntityAbility.TARGET_TEAM_ENEMY) and spell.name ~= "earth_spirit_geomagnetic_grip" then
  2648. lastCastPrediction = nil
  2649. cast = me:SafeCastAbility(spell,me.position)
  2650. elseif ((prediction and tempvictimAlive and (GetDistance2D(prediction,mePosition) < castRange+radius or (xposition and GetDistance2D(xposition,me) < castRange+radius))) or (spell.name == "earth_spirit_rolling_boulder" and retreat)) then
  2651. delay = delay + me:GetTurnTime(tempvictim)*1000
  2652. local delay2 = delay + client.latency + channel*1000 + (100/Animations.maxCount) - ((client.latency/1000)/(1 + (1 - 1/Animations.maxCount)))*1000
  2653. if data[4] then delay2 = delay2 + data[4]*1000 end
  2654. local prediction
  2655. if not speed or speed == 0 then speed = 9999999 end
  2656. if tempvictimVisible then
  2657. if data[7] then
  2658. local radius = spell:GetSpecialData(data[8], spell.level)
  2659. prediction = SkillShotBlockableSkillShotXYZ(mePosition,tempvictim,speed,delay2,radius,data[9])
  2660. if prediction then
  2661. prediction = SkillShotBlockableSkillShotXYZ(mePosition,tempvictim,speed,delay2+me:GetTurnTime(prediction)*1000,radius,data[9])
  2662. end
  2663. else
  2664. prediction = SkillShotSkillShotXYZ(mePosition,tempvictim,delay2,speed)
  2665. if prediction then
  2666. prediction = SkillShotSkillShotXYZ(mePosition,tempvictim,delay2+me:GetTurnTime(prediction)*1000,speed)
  2667. end
  2668. end
  2669. else
  2670. if data[7] then
  2671. local radius = spell:GetSpecialData(data[8], spell.level)
  2672. prediction = SkillShot.BlockableBlindSkillShotXYZ(me,tempvictim,speed,delay2/1000,radius,data[9])
  2673. else
  2674. prediction = SkillShot.BlindSkillShotXYZ(me,tempvictim,speed,delay2/1000)
  2675. end
  2676. end
  2677. if spell.name == "rubick_telekinesis_land" then prediction = me.position end
  2678. if xposition then prediction = xposition end
  2679. if prediction or (spell.name == "earth_spirit_rolling_boulder" and retreat) then
  2680. local preddist = 0
  2681. if prediction then preddist = GetDistance2D(prediction,mePosition) end
  2682. if spell.name == "storm_spirit_ball_lightning" then
  2683. local pull = a2
  2684. local manaReq = (15 + me.maxMana*0.07 + ((preddist*0.01)*(12+(me.maxMana*0.0075))))
  2685. if me.mana < manaReq then
  2686. go = false
  2687. elseif pull and pull:CanBeCasted() and (me.mana-pull.manacost) < manaReq then
  2688. go = false
  2689. end
  2690. end
  2691. if spell.name == "ember_spirit_fire_remnant" then
  2692. if me.mana < 150 or (victimdistance < 500 and not retreat) then go = false end
  2693. if retreat then prediction = client.mousePosition
  2694. prediction = (prediction - me.position) * 1500 / GetDistance2D(prediction,me) + me.position
  2695. else
  2696. local ulti = me:FindSpell("ember_spirit_activate_fire_remnant")
  2697. if not tempdamageTable["ember_spirit_activate_fire_remnant"] or tempdamageTable["ember_spirit_activate_fire_remnant"][2] ~= ulti.level then
  2698. damageTable["ember_spirit_activate_fire_remnant"] = {AbilityDamageGetDamage(ulti), ulti.level, me:AghanimState()}
  2699. tempdamageTable = damageTable
  2700. end
  2701. local ultiDamage = tempdamageTable["ember_spirit_activate_fire_remnant"][1]
  2702. ultiDamage = tempvictim:DamageTaken(ultiDamage,DAMAGE_MAGC,me)
  2703. if me.mana < 260 and enemyHP > ultiDamage then go = false end
  2704. if ((me.mana > 650 and enemyHP < ultiDamage*3) or (me.mana > 300 and enemyHP < ultiDamage*2)) and (tempvictim:IsStunned() or tempvictim:IsRooted()) and victimdistance < 500 and speed > 500 then delay = 0 go = true
  2705. else
  2706. local remnants = entityList:GetEntities({classId=CDOTA_BaseNPC_Additive, team=me.team, alive=true})
  2707. for i = 1, #remnants do
  2708. local v = remnants[i]
  2709. if GetDistance2D(v,prediction) < 500 then
  2710. go = false
  2711. end
  2712. end
  2713. delay = delay + (victimdistance/speed)*1000 - (victimdistance/1300)*1000 end
  2714. end
  2715. end
  2716. if preddist < castRange+radius then
  2717. if preddist > castRange then
  2718. if ID == CDOTA_Unit_Hero_EmberSpirit then
  2719. prediction = (prediction - mePosition) * ((castRange+300) - (radius/2)) / preddist + mePosition
  2720. elseif spell.name ~= "tusk_ice_shards" then
  2721. prediction = (prediction - mePosition) * (castRange-100) / preddist + mePosition
  2722. end
  2723. end
  2724. if ID == CDOTA_Unit_Hero_Invoker then
  2725. local tornado = me:FindSpell("invoker_tornado")
  2726. if tornado then
  2727. local tornadocd = tornado:GetCooldown(tornado.level)
  2728. if octa then
  2729. tornadocd = tornadocd*0.75
  2730. end
  2731. tornadocd = tornadocd-((GetDistance2D(me,tempvictim))/1000+client.latency/1000)-0.1
  2732. if tornado and (tornado.cd > tornadocd or tornado:CanBeCasted()) then
  2733. prediction = tempvictim.position
  2734. end
  2735. end
  2736. end
  2737. if spell.name == "tusk_ice_shards" then
  2738. prediction = (prediction - tempvictim.position) * (GetDistance2D(prediction,tempvictim)+200) / GetDistance2D(prediction,tempvictim) + tempvictim.position
  2739. elseif spell.name == "earthshaker_fissure" then
  2740. prediction = (prediction - tempvictim.position) * (GetDistance2D(prediction,tempvictim)+225) / GetDistance2D(prediction,tempvictim) + tempvictim.position
  2741. end
  2742. if spell.name == "invoker_emp" and GetDistance2D(prediction,tempvictim) > 675 then
  2743. prediction = (prediction - tempvictim.position) * (GetDistance2D(prediction,tempvictim)/2) / GetDistance2D(prediction,tempvictim) + tempvictim.position
  2744. if combo ~= 0 and combo ~= 3 then prediction = client.mousePosition end
  2745. end
  2746. if ID == CDOTA_Unit_Hero_Rubick and spell.name ~= "rubick_telekinesis_land" then
  2747. if tempvictim:DoesHaveModifier("modifier_rubick_telekinesis") then
  2748. prediction = (mePosition - tempvictim.position) * (math.min(victimdistance,275)) / GetDistance2D(me,tempvictim.position) + tempvictim.position
  2749. end
  2750. end
  2751. if spell.name == "invoker_sun_strike" then
  2752. local spell1,spell2 = a4, a5
  2753. if (not chainStun(tempvictim, delay2, nil, true) and not tempvictim:IsStunned() and not tempvictim:IsRooted() and not tempvictim:DoesHaveModifier("modifier_eul_cyclone") and not tempvictim:IsHexed() and not tempvictim:DoesHaveModifier("modifier_invoker_tornado")) and enemyHP > Dmg then
  2754. go = false
  2755. end
  2756. if GetDistance2D(prediction,tempvictim) > 50 and ((((spell1.name == "invoker_cold_snap" and spell1:CanBeCasted()) or (spell2.name == "invoker_cold_snap" and spell2:CanBeCasted()))) or tempvictim:DoesHaveModifier("modifier_invoker_ice_wall_slow_debuff") or tempvictim:DoesHaveModifier("modifier_invoker_cold_snap") or tempvictim:DoesHaveModifier("modifier_invoker_cold_snap_freeze")) then
  2757. if victimdistance < range/1.5 then
  2758. prediction = (prediction - tempvictim.position) * (GetDistance2D(prediction,tempvictim)/2) / GetDistance2D(prediction,tempvictim) + tempvictim.position
  2759. else
  2760. prediction = (prediction - tempvictim.position) * (GetDistance2D(prediction,tempvictim)/1.5) / GetDistance2D(prediction,tempvictim) + tempvictim.position
  2761. end
  2762. go = true
  2763. end
  2764. local blast = me:FindSpell("invoker_deafening_blast")
  2765. if blast then
  2766. local blastcd = blast:GetCooldown(blast.level)
  2767. if octa then
  2768. blastcd = blastcd*0.75
  2769. end
  2770. blastcd = blastcd-((GetDistance2D(me,tempvictim)+100)/1100+client.latency/1000)
  2771. if blast and (blast.cd > blastcd or blast:CanBeCasted() or tempvictim:DoesHaveModifier("modifier_invoker_deafening_blast_knockback")) then
  2772. if tempvictim:DoesHaveModifier("modifier_invoker_deafening_blast_knockback") then
  2773. prediction = (tempvictim.position - me.position) * (GetDistance2D(tempvictim,me)+100) / GetDistance2D(tempvictim,me) + me.position
  2774. elseif GetDistance2D(tempvictim,prediction) > 50 then
  2775. prediction = (prediction - me.position) * (GetDistance2D(prediction,me)+200) / GetDistance2D(prediction,me) + me.position
  2776. else
  2777. prediction = (tempvictim.position - me.position) * (GetDistance2D(tempvictim,me)+200) / GetDistance2D(tempvictim,me) + me.position
  2778. end
  2779. end
  2780. end
  2781. end
  2782. if spell.name == "invoker_chaos_meteor" then
  2783. local spell1,spell2 = a4, a5
  2784. if ((not chainStun(tempvictim, delay2, nil, true) and combo == 0) and not tempvictim:IsStunned() and not tempvictim:IsHexed() and not tempvictim:IsRooted() and not tempvictim:DoesHaveModifier("modifier_eul_cyclone") and not tempvictim:DoesHaveModifier("modifier_invoker_tornado")) and (enemyHP > Dmg/4 or victimdistance > 500) then
  2785. go = false
  2786. end
  2787. if GetDistance2D(prediction,tempvictim) > 50 and ((((spell1.name == "invoker_cold_snap" and spell1:CanBeCasted()) or (spell2.name == "invoker_cold_snap" and spell2:CanBeCasted())) and victimdistance < range/1.5) or tempvictim:DoesHaveModifier("modifier_invoker_ice_wall_slow_debuff") or tempvictim:DoesHaveModifier("modifier_invoker_cold_snap")) then
  2788. prediction = (prediction - tempvictim.position) * (GetDistance2D(prediction,tempvictim)/2) / GetDistance2D(prediction,tempvictim) + tempvictim.position
  2789. go = true
  2790. end
  2791. if combo ~= 0 and combo ~= 3 then prediction = client.mousePosition end
  2792. if comb == 3 then
  2793. local blast = me:FindSpell("invoker_deafening_blast")
  2794. local blastcd = blast:GetCooldown(blast.level)
  2795. if octa then
  2796. blastcd = blastcd*0.75
  2797. end
  2798. blastcd = blastcd-((GetDistance2D(me,tempvictim)+100)/1100+client.latency/1000)
  2799. if blast and (blast.cd > blastcd or blast:CanBeCasted() or tempvictim:DoesHaveModifier("modifier_invoker_deafening_blast_knockback")) then
  2800. if tempvictim:DoesHaveModifier("modifier_invoker_deafening_blast_knockback") then
  2801. prediction = (tempvictim.position - me.position) * (GetDistance2D(tempvictim,me)+50) / GetDistance2D(tempvictim,me) + me.position
  2802. elseif GetDistance2D(tempvictim,prediction) > 50 then
  2803. prediction = (prediction - me.position) * (GetDistance2D(prediction,me)+100) / GetDistance2D(prediction,me) + me.position
  2804. else
  2805. prediction = (tempvictim.position - me.position) * (GetDistance2D(tempvictim,me)+100) / GetDistance2D(tempvictim,me) + me.position
  2806. end
  2807. end
  2808. end
  2809. end
  2810. if spell.name == "dark_seer_vacuum" then
  2811. local closeEnemies = entityList:GetEntities(function (v) return (v.hero and not v:IsIllusion() and v.alive and v.team ~= me.team and v ~= tempvictim and GetDistance2D(tempvictim,SkillShotPredictedXYZ(v,delay)) < radius*2+50) end)
  2812. if #closeEnemies > 0 then
  2813. local avpos = nil
  2814. for i = 1, #closeEnemies do
  2815. if not avpos then avpos = SkillShotPredictedXYZ(closeEnemies[i],delay)
  2816. else avpos = avpos + SkillShotPredictedXYZ(closeEnemies[i],delay) end
  2817. end
  2818. avpos = avpos/#closeEnemies
  2819. prediction = (prediction + avpos)/2
  2820. else
  2821. prediction = (mePosition - prediction) * (radius/2-200) / GetDistance2D(me,prediction) + prediction
  2822. end
  2823. end
  2824. if spell.name == "skywrath_mage_mystic_flare" then
  2825. if (not chainStun(tempvictim, delay2, nil, true) and (not tempvictim:IsStunned() and not tempvictim:IsHexed() and not tempvictim:IsRooted()) and enemyHP > Dmg and not tempvictim:DoesHaveModifier("modifier_skywrath_mage_concussive_shot_slow")) or tempvictim:DoesHaveModifier("modifier_eul_cyclone") or tempvictim:DoesHaveModifier("modifier_invoker_tornado") then
  2826. go = false
  2827. end
  2828. end
  2829. if spell.name == "puck_illusory_orb" and retreat then prediction = client.mousePosition end
  2830. if spell.name == "invoker_tornado" and combo ~= 0 and combo ~= 3 then prediction = client.mousePosition end
  2831. if spell.name == "ember_spirit_sleight_of_fist" and prediction then
  2832. local position = nil
  2833. local unitnum = 0
  2834. local closest = nil
  2835. if a1 and a1:CanBeCasted() and enemyHP > Dmg then
  2836. local units = {}
  2837. local unitsCount = 0
  2838. local lanecreeps = entityList:GetEntities({classId=CDOTA_BaseNPC_Creep_Lane,team=me:GetEnemyTeam(),visible=true})
  2839. local fam = entityList:GetEntities({classId=CDOTA_Unit_VisageFamiliar,team=me:GetEnemyTeam(),visible=true})
  2840. local boar = entityList:GetEntities({classId=CDOTA_Unit_Hero_Beastmaster_Boar,team=me:GetEnemyTeam(),visible=true})
  2841. local forg = entityList:GetEntities({classId=CDOTA_BaseNPC_Invoker_Forged_Spirit,team=me:GetEnemyTeam(),visible=true})
  2842. for i = 1, #lanecreeps do local v = lanecreeps[i] if not v:IsInvul() and v.alive and v.spawned then unitsCount = unitsCount + 1 units[unitsCount] = v end end
  2843. for i = 1, #fam do local v = fam[i] if not v:IsInvul() and v.alive and not v:IsAttackImmune() then unitsCount = unitsCount + 1 units[unitsCount] = v end end
  2844. for i = 1, #boar do local v = boar[i] if not v:IsInvul() and v.alive and not v:IsAttackImmune() then unitsCount = unitsCount + 1 units[unitsCount] = v end end
  2845. for i = 1, #forg do local v = forg[i] if not v:IsInvul() and v.alive and not v:IsAttackImmune() then unitsCount = unitsCount + 1 units[unitsCount] = v end end
  2846. for i = 1, unitsCount do
  2847. local v = units[i]
  2848. if GetDistance2D(v,prediction) < (radius/2)+300 then
  2849. if not position then
  2850. position = v.position
  2851. unitnum = 1
  2852. else
  2853. position = position + v.position
  2854. unitnum = unitnum + 1
  2855. end
  2856. if not closest or GetDistance2D(v,prediction) < GetDistance2D(closest,prediction) then
  2857. closest = v
  2858. end
  2859. end
  2860. end
  2861. end
  2862. if closest then
  2863. prediction = (prediction - closest.position) * (GetDistance2D(closest,prediction)+200+(radius/2)) / GetDistance2D(prediction,closest) + closest.position
  2864. end
  2865. if GetDistance2D(tempvictim,prediction) > ((radius/2)+200) then
  2866. prediction = (prediction - mePosition) * (castRange+200) / GetDistance2D(me,prediction) + mePosition
  2867. end
  2868. end
  2869. if ((prediction and GetDistance2D(prediction,mePosition) < castRange+100) or (spell.name == "earth_spirit_rolling_boulder" and retreat)) and go then
  2870. if spell.name ~= "slark_pounce" and spell.name ~= "nevermore_shadowraze1" and spell.name ~= "nevermore_shadowraze2" and spell.name ~= "nevermore_shadowraze3" and spell.name ~= "earth_spirit_boulder_smash" then
  2871. if spell.name == "earth_spirit_rolling_boulder" then
  2872. local smash = a1
  2873. local smashcd = smash:GetCooldown(smash.level)
  2874. if octa then
  2875. smashcd = smashcd*0.75
  2876. end
  2877. smashcd = smashcd-2
  2878. if smash and (smash.cd > smashcd or smash.abilityPhase) and tempvictimVisible then
  2879. prediction = SkillShotSkillShotXYZ(mePosition,tempvictim,0.00001,1600)
  2880. end
  2881. if retreat or EStoMouse then
  2882. prediction = client.mousePosition
  2883. end
  2884. local remn = entityList:GetEntities({classId = CDOTA_Unit_Earth_Spirit_Stone})
  2885. local found = false
  2886. for i = 1, #remn do
  2887. local v = remn[i]
  2888. local calc1 = (mathfloor(mathsqrt((prediction.x-v.position.x)^2 + (prediction.y-v.position.y)^2)))
  2889. local calc2 = (mathfloor(mathsqrt((me.position.x-v.position.x)^2 + (me.position.y-v.position.y)^2)))
  2890. local calc4 = (mathfloor(mathsqrt((me.position.x-prediction.x)^2 + (me.position.y-prediction.y)^2)))
  2891. if calc1 < calc4 and calc2 < calc4 and GetDistance2D(me,v) < 360 then
  2892. found = true
  2893. cast = me:SafeCastAbility(spell,prediction)
  2894. Sleep(spell:FindCastPoint()*1000+600,"moving")
  2895. Sleep(spell:FindCastPoint()*1000+600,spell.name)
  2896. return
  2897. end
  2898. end
  2899. if not found and (victimdistance > 800 or retreat) then
  2900. local stone = a4
  2901. if stone and stone:CanBeCasted() and SleepCheck("stone") then
  2902. local vector = (prediction - me.position) * 200 / GetDistance2D(prediction,me) + me.position
  2903. me:CastAbility(stone, vector)
  2904. cast = me:SafeCastAbility(spell,prediction)
  2905. Sleep(spell:FindCastPoint()*1000+600,"moving")
  2906. Sleep(spell:FindCastPoint()*1000+600,spell.name)
  2907. Sleep(100+client.latency,"stone")
  2908. return
  2909. end
  2910. elseif not found then
  2911. cast = me:SafeCastAbility(spell,prediction)
  2912. Sleep(spell:FindCastPoint()*1000+600,"moving")
  2913. Sleep(spell:FindCastPoint()*1000+600,spell.name)
  2914. return
  2915. end
  2916. end
  2917. if spell.name == "earth_spirit_geomagnetic_grip" then
  2918. local remn = entityList:GetEntities({classId = CDOTA_Unit_Earth_Spirit_Stone, alive=true, visible = true})
  2919. local found = nil
  2920. for i = 1, #remn do
  2921. local v = remn[i]
  2922. if not found and GetDistance2D(tempvictim,v) < 300 and GetDistance2D(me,tempvictim) <= GetDistance2D(me,v) then
  2923. found = v
  2924. end
  2925. if GetDistance2D(me,v) < castRange+50 then
  2926. local calc1 = (mathfloor(mathsqrt((v.position.x-tempvictim.position.x)^2 + (v.position.y-tempvictim.position.y)^2)))
  2927. local calc2 = (mathfloor(mathsqrt((me.position.x-tempvictim.position.x)^2 + (me.position.y-tempvictim.position.y)^2)))
  2928. local calc4 = (mathfloor(mathsqrt((me.position.x-v.position.x)^2 + (me.position.y-v.position.y)^2)))
  2929. if GetDistance2D(me,v) <= (GetDistance2D(me,tempvictim)+GetDistance2D(tempvictim,v)) and GetDistance2D(me,v)+500 > (GetDistance2D(me,tempvictim)+GetDistance2D(tempvictim,v)) then
  2930. found = v
  2931. end
  2932. if not found and calc1 < calc4 and calc2 < calc4 and GetDistance2D(me,v) < castRange+50 then
  2933. found = v
  2934. end
  2935. end
  2936. end
  2937. local smash = a1
  2938. if found or esstone then
  2939. if found then
  2940. local vec = (found.position - me.position) * (GetDistance2D(found,me)+client.latency*1.2) / GetDistance2D(found,me) + me.position
  2941. cast = me:SafeCastAbility(spell,vec)
  2942. cast = me:SafeCastAbility(spell,found.position)
  2943. end
  2944. lastCastPrediction = tempvictim.position
  2945. elseif GetDistance2D(prediction,me) < castRange+50 then
  2946. local stone = a4
  2947. if stone and stone:CanBeCasted() and SleepCheck("stone") then
  2948. me:CastAbility(stone, prediction)
  2949. cast = me:SafeCastAbility(spell,prediction)
  2950. lastCastPrediction = prediction
  2951. Sleep(100+client.latency,"stone")
  2952. end
  2953. end
  2954. elseif spell.name ~= "kunkka_ghostship" or GetDistance2D(me,prediction) > 750 then
  2955. if spell.name == "magnataur_skewer" then
  2956. prediction = (prediction - me.position) * 1400 / GetDistance2D(prediction,me) + me.position
  2957. end
  2958. lastPrediction = {prediction, tempvictim.rotR}
  2959. lastCastPrediction = prediction
  2960. cast = me:SafeCastAbility(spell,prediction)
  2961. delay = delay + (mathmax(GetDistance2D(prediction,mePosition)-50-castRange,0)/me.movespeed)*1000
  2962. if spell.name == "ancient_apparition_ice_blast" then delay = delay + (mathmax(GetDistance2D(prediction,mePosition)-50,0)/speed)*1000 end
  2963. if spell.name == "ember_spirit_sleight_of_fist" then
  2964. delay = me:GetTurnTime(prediction)*1000
  2965. end
  2966. end
  2967. elseif ((spell.name ~= "nevermore_shadowraze1" and spell.name ~= "nevermore_shadowraze2" and spell.name ~= "nevermore_shadowraze3") or (not retreat or Dmg > enemyHP)) and (meDmg < Dmg or victimdistance > range+100 or ID == CDOTA_Unit_Hero_EarthSpirit) then
  2968. if not speed or speed == 0 then speed = 9999999 end
  2969. if ID == CDOTA_Unit_Hero_EarthSpirit then
  2970. if not tempvictimVisible then
  2971. prediction = SkillShot.BlindSkillShotXYZ(me,tempvictim,speed,me:GetTurnTime(prediction)+client.latency/1000+(100/Animations.maxCount)/1000 - ((client.latency/1000)/(1 + (1 - 1/Animations.maxCount))))
  2972. else
  2973. prediction = SkillShotSkillShotXYZ(mePosition,tempvictim,me:GetTurnTime(prediction)*1000+client.latency+(100/Animations.maxCount) - ((client.latency/1000)/(1 + (1 - 1/Animations.maxCount)))*1000,speed)
  2974. end
  2975. elseif not tempvictimVisible then
  2976. prediction = SkillShot.BlindSkillShotXYZ(me,tempvictim,speed,me:GetTurnTime(prediction)+client.latency/1000+(100/me.movespeed)+(100/Animations.maxCount)/1000 - ((client.latency/1000)/(1 + (1 - 1/Animations.maxCount))))
  2977. else
  2978. prediction = SkillShotSkillShotXYZ(mePosition,tempvictim,me:GetTurnTime(prediction)*1000+client.latency+(100/me.movespeed)*1000+(100/Animations.maxCount) - ((client.latency/1000)/(1 + (1 - 1/Animations.maxCount)))*1000,speed)
  2979. end
  2980. if spell.name == "slark_pounce" and retreat then
  2981. prediction = client.mousePosition
  2982. end
  2983. if SleepCheck("movetoprediction") and prediction and (spell.name ~= "earth_spirit_boulder_smash" or a4:CanBeCasted()) and (GetDistance2D(me,prediction) < castRange+100 or (distance and GetDistance2D(me,prediction) < distance+100)) then
  2984. local vector = prediction
  2985. if GetDistance2D(me,vector) < 200 then
  2986. vector = (me.position - vector) * 500 / GetDistance2D(me.position,vector) + vector
  2987. end
  2988. if victimdistance < 150 then me:Attack(tempvictim)
  2989. else me:Move(vector) end
  2990. Sleep(me:GetTurnTime(prediction)*1000+client.latency+delay, "moving")
  2991. Sleep(200, "movetoprediction")
  2992. end
  2993. if prediction and ((mathmax(mathabs(FindAngleR(me) - mathrad(FindAngleBetween(me, prediction))) - 0.40, 0)) == 0 or spell.name == "earth_spirit_boulder_smash") and (spell.name ~= "slark_pounce" or ((mathmax(mathabs(FindAngleR(me) - mathrad(FindAngleBetween(me, prediction))) - 0.10, 0)) == 0)) then
  2994. if spell.name == "earth_spirit_boulder_smash" then
  2995. if EStoMouse and not retreat then prediction = client.mousePosition end
  2996. local stone = a4
  2997. local remn = entityList:GetEntities({classId = CDOTA_Unit_Earth_Spirit_Stone})
  2998. local found = false
  2999. local foundStone = nil
  3000. for i = 1, #remn do
  3001. local v = remn[i]
  3002. local calc1 = (mathfloor(mathsqrt((tempvictim.position.x-v.position.x)^2 + (tempvictim.position.y-v.position.y)^2)))
  3003. local calc2 = (mathfloor(mathsqrt((me.position.x-v.position.x)^2 + (me.position.y-v.position.y)^2)))
  3004. local calc4 = (mathfloor(mathsqrt((me.position.x-tempvictim.position.x)^2 + (me.position.y-tempvictim.position.y)^2)))
  3005. if calc1 < calc4 and calc2 < calc4 and GetDistance2D(me,v) < 300 then
  3006. found = true
  3007. foundStone = v
  3008. end
  3009. end
  3010. if (stone and stone:CanBeCasted()) or found then
  3011. esstone = true
  3012. if not found and SleepCheck("stone") then
  3013. local vector = (prediction - me.position) * 200 / GetDistance2D(prediction,me) + me.position
  3014. me:CastAbility(stone, vector)
  3015. Sleep(100+client.latency,"stone")
  3016. end
  3017. cast = me:SafeCastAbility(spell,prediction)
  3018. if foundStone then
  3019. Sleep(me:GetTurnTime(prediction)*1000+spell:FindCastPoint()*1000, "casting")
  3020. else
  3021. Sleep(me:GetTurnTime(prediction)*1000+spell:FindCastPoint()*1000, "casting")
  3022. end
  3023. Sleep(me:GetTurnTime(prediction)*1000+spell:FindCastPoint()*1000+((GetDistance2D(me,prediction))/speed)*1000+client.latency+1000, "esstone")
  3024. Sleep(me:GetTurnTime(prediction)*1000+spell:FindCastPoint()*1000+client.latency, spell.name)
  3025. Sleep(me:GetTurnTime(prediction)*1000+client.latency+client.latency+spell:FindCastPoint()*1000, "moving")
  3026. return
  3027. end
  3028. else
  3029. lastPrediction = {prediction, tempvictim.rotR}
  3030. cast = me:SafeCastAbility(spell)
  3031. end
  3032. if cast then
  3033. Sleep(me:GetTurnTime(prediction)*1000+client.latency+spell:FindCastPoint()*1000, "casting")
  3034. Sleep(me:GetTurnTime(prediction)*1000+client.latency+2000, spell.name)
  3035. return
  3036. end
  3037. end
  3038. return
  3039. end
  3040. end
  3041. end
  3042. end
  3043. end
  3044. end
  3045. end
  3046. if cast then
  3047. if spell.name == "batrider_flaming_lasso" then delay = delay + 200 end
  3048. if spell.name == "invoker_ghost_walk" then Sleep(1000, "casting") Sleep(1000, "casting2") Sleep(1000, "casting3") end
  3049. if spell.name == "invoker_sun_strike" then Sleep(delay+100,"moving") end
  3050. if spell.name ~= "ancient_apparition_ice_blast" and spell.name ~= "pudge_meat_hook" then
  3051. if spell.name ~= "ember_spirit_sleight_of_fist" then
  3052. Sleep(delay-spell:FindCastPoint()*1000+client.latency,"moving")
  3053. else
  3054. mePosition = tempvictim.position
  3055. Sleep(spell:FindCastPoint()*1000+client.latency+300,"blink")
  3056. Sleep(spell:FindCastPoint()*1000+client.latency+300,"moving")
  3057. end
  3058. end
  3059. if spell.name == "riki_blink_strike" then Sleep(delay+client.latency+Animations.GetAttackTime(me)*1000+Animations.getBackswingTime(me)*1000, spell.name) end
  3060. if spell.name == "earth_spirit_geomagnetic_grip" then Sleep(100, spell.name) return end
  3061. if spell.name == "leshrac_pulse_nova" then Sleep(500, spell.name) return end
  3062. if spell.name == "kunkka_torrent" then Sleep(500,spell.name) end
  3063. if channel and channel > 0 then if victimdistance < castRange+150 or (distance and victimdistance < distance+150) or (lastCastPrediction and GetDistance2D(mePosition,lastCastPrediction) < castRange+150) then channelactive = true delay = delay + 600 if spell.name ~= "pudge_dismember" then Sleep(delay + channel*1000 + 200, spell.name) end end
  3064. elseif data[3] and spell.name ~= "ember_spirit_fire_remnant" and spell.name ~= "ancient_apparition_cold_feet" and spell.name ~= "invoker_emp" and spell.name ~= "ursa_earthshock" and spell.name ~= "earth_spirit_boulder_smash" and spell.name ~= "earth_spirit_geomagnetic_grip" and spell.name ~= "earth_spirit_rolling_boulder" and spell.name ~= "kunkka_torrent" then Sleep(delay+mathmax(add,0.4)*1000+client.latency,"stun") end
  3065. if spell.name == "ember_spirit_fire_remnant" then
  3066. local ultiDamage = tempdamageTable["ember_spirit_activate_fire_remnant"][1]
  3067. ultiDamage = tempvictim:DamageTaken(ultiDamage,DAMAGE_MAGC,me)
  3068. if me.mana > 650 and enemyHP < ultiDamage*3 and (tempvictim:IsStunned() or tempvictim:IsRooted()) and victimdistance < 500 and speed > 500 then delay = 0
  3069. else
  3070. Sleep(delay + (victimdistance/speed)*1000, spell.name) end
  3071. elseif spell.name == "kunkka_x_marks_the_spot" then
  3072. Sleep(1000, spell.name)
  3073. elseif spell.name == "rubick_telekinesis_land" then
  3074. Sleep(1000, spell.name)
  3075. elseif spell.name ~= "pudge_dismember" then
  3076. Sleep(delay, spell.name)
  3077. end
  3078. if spell.name == "troll_warlord_whirling_axes_ranged" then
  3079. local melee = me:FindSpell("troll_warlord_whirling_axes_melee")
  3080. if melee.cd > 0 then
  3081. trolltoggle = true
  3082. end
  3083. end
  3084. if spell.name == "phoenix_launch_fire_spirit" then Sleep(2000,spell.name) end
  3085. if spell.name == "phoenix_icarus_dive" then Sleep(1000,"phoenix_icarus_dive_stop") Sleep(1000,"phoenix_sun_ray") end
  3086. if spell.name ~= "ember_spirit_sleight_of_fist" and spell.name ~= "earth_spirit_geomagnetic_grip" then
  3087. if victimdistance < castRange+150 or (distance and victimdistance < distance+150) or (lastCastPrediction and GetDistance2D(mePosition,lastCastPrediction) < castRange+150) then
  3088. if spell.name == "tusk_snowball" then tuskSnowBall = true end
  3089. if spell.name == "windrunner_shackleshot" and a2 and a2:CanBeCasted() then Sleep(delay+((victimdistance)/speed)*1000+750+client.latency,"stun") Sleep(delay+((victimdistance)/speed)*1000+500,"casting") end
  3090. if spell.name == "invoker_tornado" then Sleep(delay+((victimdistance)/speed)*1000+200,"stun") end
  3091. if spell.name == "kunkka_x_marks_the_spot" then Sleep(1000, spell.name) Sleep(delay+client.latency+200, "stun") end
  3092. if spell.name == "rattletrap_hookshot" then Sleep(delay+((victimdistance-50)/speed)*1000+mathmax(client.latency,1000),"blink") end
  3093. if ID ~= CDOTA_Unit_Hero_Pudge then
  3094. Sleep(delay+client.latency,"casting")
  3095. end
  3096. if spell.name == "puck_illusory_orb" then Sleep(3000, "blink") PuckPosition = me.position end
  3097. if Dmg then
  3098. if spell.name ~= "invoker_ice_wall" then
  3099. enemyHP = enemyHP - Dmg
  3100. else
  3101. enemyHP = enemyHP - Dmg/2
  3102. end
  3103. end
  3104. return
  3105. end
  3106. end
  3107. end
  3108. end
  3109. end
  3110. end
  3111. end
  3112. end
  3113.  
  3114. if me:IsChanneling() or (tempvictim and (tempvictim:DoesHaveModifier("modifier_pudge_meat_hook") or a4.abilityPhase) and ID == CDOTA_Unit_Hero_Pudge) then return end
  3115.  
  3116. if not me:DoesHaveModifier("modifier_phoenix_sun_ray") and (not retreat or (tempvictim and meDmg > enemyHP and victimdistance < range)) and not me:DoesHaveModifier("modifier_spirit_breaker_charge_of_darkness") and SleepCheck("charge") and me.alive and not CanMove and not me:DoesHaveModifier("modifier_batrider_flaming_lasso_self") and tempvictim and victimdistance <= mathmax(range*2+50,500) and tempvictimVisible and not tempvictim:IsInvul() and me:CanAttack() and not tempvictim:IsAttackImmune() and not tempvictim:DoesHaveModifier("modifier_bane_nightmare") then
  3117. if tick > tempattack and SleepCheck("moving") then
  3118. if (not meld or not meld:CanBeCasted() or me:DoesHaveModifier("modifier_templar_assassin_meld") or enemyHP < meDmg) and (not a1 or a1.name ~= "mirana_starfall" or not a1:CanBeCasted() or enemyHP < meDmg) and not tempvictim:IsInvul() and not tempvictim:IsAttackImmune() and not tempvictim:DoesHaveModifier("modifier_bane_nightmare") then
  3119. if ID == CDOTA_Unit_Hero_Invoker and exort and exort.level > 0 and SleepCheck("casting3") then
  3120. if not me:IsInvisible() and setOrbs("exort", me) then
  3121. Sleep(250,"casting3")
  3122. end
  3123. end
  3124. if (not me:DoesHaveModifier("modifier_bloodseeker_rupture") or victimdistance <= range) then
  3125. if not me:DoesHaveModifier("modifier_item_armlet_unholy_strength") and SleepCheck("item_armlet") and (not me:DoesHaveModifier("modifier_huskar_life_break_charge") and (ID ~= CDOTA_Unit_Hero_Huskar or not a4.abilityPhase)) then
  3126. local armlet = me:FindItem("item_armlet")
  3127. if armlet then
  3128. me:CastItem("item_armlet")
  3129. Sleep(client.latency+100,"item_armlet")
  3130. return
  3131. end
  3132. end
  3133. if xposition then
  3134. if GetDistance2D(xposition,me) > 700 then me:Move(xposition)
  3135. end
  3136. elseif me:DoesHaveModifier("modifier_gyrocopter_flak_cannon") and victimdistance > range+100 then
  3137. local closeUnits = entityList:GetEntities(function (v) return ((v.hero or v.creep) and v.alive and v.team ~= me.team and v ~= tempvictim and GetDistance2D(me,v) < range) end)
  3138. if #closeUnits > 0 then
  3139. me:AttackMove(SkillShot.InFront(me,500))
  3140. else
  3141. myhero:Hit(tempvictim,me)
  3142. end
  3143. elseif ID == CDOTA_Unit_Hero_Kunkka and a2.cd == 0 then
  3144. local closeUnits = entityList:GetEntities(function (v) return ((v.hero or v.creep) and v.alive and v.team ~= me.team and v ~= tempvictim and GetDistance2D(me,v) < range) end)
  3145. if #closeUnits > 0 then
  3146. local attackableUnit = nil
  3147. for i = 1, #closeUnits do
  3148. local v = closeUnits[i]
  3149. local calc1 = (mathfloor(mathsqrt((tempvictim.position.x-v.position.x)^2 + (tempvictim.position.y-v.position.y)^2)))
  3150. local calc2 = (mathfloor(mathsqrt((me.position.x-v.position.x)^2 + (me.position.y-v.position.y)^2)))
  3151. local calc4 = (mathfloor(mathsqrt((me.position.x-tempvictim.position.x)^2 + (me.position.y-tempvictim.position.y)^2)))
  3152. if calc1 < calc4 and calc2 < calc4 and GetDistance2D(me,v) < 300 then
  3153. attackableUnit = v
  3154. end
  3155. end
  3156. if attackableUnit then
  3157. me:Attack(attackableUnit)
  3158. else
  3159. myhero:Hit(tempvictim,me)
  3160. end
  3161. else
  3162. myhero:Hit(tempvictim,me)
  3163. end
  3164. else
  3165. myhero:Hit(tempvictim,me)
  3166. end
  3167. else
  3168. player:HoldPosition()
  3169. end
  3170. if victimdistance <= range+50 and SleepCheck("casting") then
  3171. enemyHP = enemyHP - meDmg
  3172. Sleep(Animations.GetAttackTime(me)*1000+client.latency+me:GetTurnTime(tempvictim)*1000,"casting")
  3173. end
  3174. elseif not me:DoesHaveModifier("modifier_templar_assassin_meld") or not meld then
  3175. if not me:DoesHaveModifier("modifier_bloodseeker_rupture") then
  3176. me:Follow(tempvictim)
  3177. else
  3178. player:HoldPosition()
  3179. end
  3180. end
  3181. attack = tick + Animations.maxCount + client.latency
  3182. type = nil
  3183. end
  3184. elseif not me:DoesHaveModifier("modifier_spirit_breaker_charge_of_darkness") and SleepCheck("charge") and me.alive and not me:DoesHaveModifier("modifier_bloodseeker_rupture") and tick > tempmove and SleepCheck("moving") and (SleepCheck("casting") or ID ~= CDOTA_Unit_Hero_TemplarAssassin) and (not meld or not me:DoesHaveModifier("modifier_templar_assassin_meld") or SleepCheck("casting")) then
  3185. local mPos = client.mousePosition
  3186. if ID == CDOTA_Unit_Hero_Invoker and quas and quas.level > 0 and SleepCheck("casting3") and ((not tempvictim and (me.maxHealth-me.health) > 100) or ((not wex or wex.level == 0) and (not exort or exort.level == 0))) and not retreat then
  3187. if not me:IsInvisible() and setOrbs("quas", me) then
  3188. Sleep(250, "casting3")
  3189. end
  3190. elseif exort and exort.level > 0 and SleepCheck("casting3") and (not wex or wex.level == 0) then
  3191. if not me:IsInvisible() and setOrbs("exort", me) then
  3192. Sleep(250, "casting3")
  3193. end
  3194. elseif wex and wex.level > 0 and SleepCheck("casting3") then
  3195. if not me:IsInvisible() and setOrbs("wex", me) then
  3196. Sleep(250, "casting3")
  3197. end
  3198. end
  3199. if xposition or ((not targetlock and config.MoveToEnemyWhenLocked) or retreat) or ((((not tempvictim or (GetDistance2D(me,mPos) > 300 and GetDistance2D(tempvictim,mPos) > 300 and tempvictimVisible and GetDistance2D(tempvictim,me) < 1000 and (me:GetTurnTime(mPos)*2 < Animations.getBackswingTime(me) or me.activity ~= LuaEntityNPC.ACTIVITY_MOVE))) or (temptype and temptype == 1)) and (not tempvictim or (tempvictimVisible and GetDistance2D(tempvictim,me) < 1000)))) then
  3200. me:Move(mPos)
  3201. type = 1
  3202. elseif (config.AutoMoveToEnemy or not tempvictimVisible or (prediction and GetDistance2D(me,prediction) > range and GetDistance2D(prediction,tempvictim) > 100) or GetDistance2D(me,tempvictim) > 1000) and GetDistance2D(me,mPos) > 100 then
  3203. me:Follow(tempvictim)
  3204. follow = tick + 6000
  3205. end
  3206. move = tick + Animations.maxCount + client.latency
  3207. start = false
  3208. end
  3209. else
  3210. if victim then
  3211. if config.AutoLock or targetlock then
  3212. if not resettime then
  3213. resettime = gameTime
  3214. elseif (gameTime - resettime) >= 6 then
  3215. indicate[victim.playerId].visible = false
  3216. victim = nil
  3217. resettime = nil
  3218. targetlock = false
  3219. end
  3220. start = false
  3221. else
  3222. indicate[victim.playerId].visible = false
  3223. victim = nil
  3224. resettime = nil
  3225. targetlock = false
  3226. end
  3227. end
  3228. end
  3229. local neutrals = entityList:GetEntities({team=LuaEntity.TEAM_NEUTRAL})
  3230. local allies = entityList:GetEntities({type = LuaEntity.TYPE_HERO, team = me.team, alive=true})
  3231. local drawMgr3D = drawMgr3D
  3232. local tempJungleCamps = JungleCamps
  3233. for i = 1, #tempJungleCamps do
  3234. local camp = tempJungleCamps[i]
  3235. local block = false
  3236. local farmed = true
  3237. for k = 1, #neutrals do
  3238. local ent = neutrals[k]
  3239. if ent.health and ent.alive and ent.spawned and GetDistance2D(ent,camp.position) < 800 then
  3240. farmed = false
  3241. JungleCamps[camp.id].farmed = false
  3242. tempJungleCamps = JungleCamps
  3243. end
  3244. end
  3245. for m = 1, #allies do
  3246. local v = allies[m]
  3247. if GetDistance2D(v,camp.position) < 500 and v.alive then
  3248. block = true
  3249. end
  3250. if farmed and GetDistance2D(v,camp.position) < 500 then
  3251. JungleCamps[camp.id].farmed = true
  3252. tempJungleCamps = JungleCamps
  3253. end
  3254. if GetDistance2D(v,camp.position) < 300 then
  3255. JungleCamps[camp.id].visible = v.visibleToEnemy
  3256. tempJungleCamps = JungleCamps
  3257. end
  3258. end
  3259. if gameTime < 30 then
  3260. JungleCamps[camp.id].farmed = true
  3261. tempJungleCamps = JungleCamps
  3262. end
  3263. if (gameTime % 60 > 0.5 and gameTime % 60 < 2) or (gameTime > 30 and gameTime < 32) then
  3264. if camp.farmed then
  3265. if not block then
  3266. JungleCamps[camp.id].farmed = false
  3267. tempJungleCamps = JungleCamps
  3268. end
  3269. end
  3270. if camp.stacking then
  3271. JungleCamps[camp.id].stacking = false
  3272. tempJungleCamps = JungleCamps
  3273. end
  3274. end
  3275. if camp.visible then
  3276. if (gameTime - camp.visTime) > 30 then
  3277. JungleCamps[camp.id].visible = false
  3278. tempJungleCamps = JungleCamps
  3279. end
  3280. end
  3281. if not campSigns[camp.id] then
  3282. campSigns[camp.id] = drawMgr3D:CreateText(camp.position, Vector(0,0,0), Vector2D(0,0), 0x66FF33FF, "Camp Available!", F14)
  3283. else
  3284. campSigns[camp.id].drawObj.visible = client:ScreenPosition(camp.position);
  3285. if tempJungleCamps[camp.id].farmed then
  3286. campSigns[camp.id].drawObj.text = "Camp farmed!"
  3287. campSigns[camp.id].drawObj.color = 0xFF6600FF
  3288. elseif tempJungleCamps[camp.id].visible then
  3289. campSigns[camp.id].drawObj.text = "Camp visible!"
  3290. campSigns[camp.id].drawObj.color = 0xFFFF00FF
  3291. else
  3292. campSigns[camp.id].drawObj.text = "Camp available!"
  3293. campSigns[camp.id].drawObj.color = 0x66FF33FF
  3294. end
  3295. end
  3296. end
  3297. if IsKeyDown(config.StackKey) and not client.chat then
  3298. local selected = player.selection[1]
  3299. if not camp then
  3300. camp = getClosestCamp(selected)
  3301. end
  3302. local creeptohit = nil
  3303. local creepsnear = {}
  3304. local creepscount = 0
  3305. if camp then
  3306. for i = 1, #neutrals do
  3307. local creep = neutrals[i]
  3308. if creep.visible and creep.spawned and GetDistance2D(creep,selected) <= 1200 and (GetDistance2D(camp.position,selected) <= 1000 or (creep.visible and GetDistance2D(creep,camp.position) < 1200)) then
  3309. creepscount = creepscount + 1
  3310. creepsnear[creepscount] = creep
  3311. if not creeptohit or GetDistance2D(selected, creep) < GetDistance2D(selected, creeptohit) then
  3312. creeptohit = creep
  3313. end
  3314. end
  3315. end
  3316. local stackDuration = 0
  3317. local moveTime = nil
  3318. if creeptohit and creeptohit.alive then
  3319. stackDuration = mathmin((GetDistance2D(creeptohit,camp.stackPosition)+(creepscount*45))/mathmin(creeptohit.movespeed,selected.movespeed), 9)
  3320. if creeptohit:IsRanged() and creepscount <= 4 then
  3321. stackDuration = mathmin((GetDistance2D(creeptohit,camp.stackPosition)+creeptohit.attackRange+(creepscount*45))/mathmin(creeptohit.movespeed,selected.movespeed), 9)
  3322. end
  3323. moveTime = 50 - (GetDistance2D(selected,camp.position)+50)/selected.movespeed
  3324. if selected:IsRanged() then
  3325. if heroInfo[selected.name] and heroInfo[selected.name].projectileSpeed then
  3326. moveTime = 50 - (range-50)/heroInfo[selected.name].projectileSpeed - Animations.GetAttackTime(selected) - selected:GetTurnTime(camp.position) - mathmax(((GetDistance2D(creeptohit,selected)-50)-range),0)/selected.movespeed
  3327. else
  3328. moveTime = 50 - (range-50)/700 - Animations.GetAttackTime(selected) - selected:GetTurnTime(camp.position) - mathmax(((GetDistance2D(creeptohit,selected)-50)-range),0)/selected.movespeed
  3329. end
  3330. end
  3331. if stackDuration > 0 then
  3332. moveTime = 60 - stackDuration - (GetDistance2D(selected,creeptohit.position)+50)/selected.movespeed
  3333. if selected:IsRanged() then
  3334. if heroInfo[selected.name] and heroInfo[selected.name].projectileSpeed then
  3335. moveTime = 60 - stackDuration - (range-50)/heroInfo[selected.name].projectileSpeed - Animations.GetAttackTime(selected) - selected:GetTurnTime(camp.position) - mathmax(((GetDistance2D(creeptohit,selected)-50)-range),0)/selected.movespeed
  3336. else
  3337. moveTime = 60 - stackDuration - (range-50)/700 - Animations.GetAttackTime(selected) - selected:GetTurnTime(camp.position) - mathmax(((GetDistance2D(creeptohit,selected)-50)-range),0)/selected.movespeed
  3338. end
  3339. end
  3340. end
  3341. end
  3342. if SleepCheck("stack") and SleepCheck("-move") then
  3343. if not moveTime or gameTime % 60 < moveTime or gameTime % 60 > 59 then
  3344. if GetDistance2D(selected,camp.waitPosition) > 50 then
  3345. selected:Move(camp.waitPosition)
  3346. end
  3347. elseif (not creeptohit or not creeptohit.visible) then
  3348. if GetDistance2D(selected,camp.position) > 50 then
  3349. selected:Move(camp.position)
  3350. end
  3351. end
  3352. Sleep(750,"-move")
  3353. end
  3354. if moveTime and gameTime % 60 > moveTime then
  3355. if creeptohit and creeptohit.alive then
  3356. if SleepCheck("-moveStack") and (gameTime % 60 > (60 - stackDuration) and gameTime % 60 < 57) and GetDistance2D(creeptohit,selected) < 1000 then
  3357. local pos = (camp.stackPosition - creeptohit.position) * (GetDistance2D(camp.stackPosition,creeptohit) + creeptohit.attackRange) / GetDistance2D(camp.stackPosition,creeptohit) + camp.stackPosition
  3358. selected:Move(pos)
  3359. Sleep((GetDistance2D(selected,pos)/selected.movespeed)*1000,"-moveStack")
  3360. Sleep((59 - (gameTime % 60))*1000,"stack")
  3361. elseif SleepCheck("stack") and SleepCheck("-attack") then
  3362. if selected:IsRanged() then
  3363. if not Animations.CanMove(selected) then
  3364. selected:Attack(creeptohit)
  3365. Sleep(Animations.GetAttackTime(selected)*1000+(mathmax(((GetDistance2D(creeptohit,selected)-50)-range),0)/selected.movespeed)*1000+selected:GetTurnTime(camp.position)*1000,"-attack")
  3366. else
  3367. selected:Move(camp.stackPosition)
  3368. Sleep(5000,"-attack")
  3369. end
  3370. else
  3371. local pos = (creeptohit.position - selected.position) * (-200) / GetDistance2D(selected,creeptohit) + creeptohit.position
  3372. selected:Move(pos)
  3373. selected:Move(camp.stackPosition,true)
  3374. Sleep(5000,"-attack")
  3375. end
  3376. end
  3377. end
  3378. end
  3379. end
  3380. else
  3381. camp = nil
  3382. end
  3383. end
  3384. end
  3385.  
  3386. function invokeSunstrike(button, button2, text)
  3387. local me = entityList:GetMyHero()
  3388. prepareSpell("invoker_sun_strike",me)
  3389. return true
  3390. end
  3391.  
  3392. function invokeColdsnap(button, button2, text)
  3393. local me = entityList:GetMyHero()
  3394. prepareSpell("invoker_cold_snap",me)
  3395. return true
  3396. end
  3397.  
  3398. function invokeGhostwalk(button, button2, text)
  3399. local me = entityList:GetMyHero()
  3400. prepareSpell("invoker_ghost_walk",me)
  3401. return true
  3402. end
  3403.  
  3404. function invokeIcewall(button, button2, text)
  3405. local me = entityList:GetMyHero()
  3406. prepareSpell("invoker_ice_wall",me)
  3407. return true
  3408. end
  3409.  
  3410. function invokeEmp(button, button2, text)
  3411. local me = entityList:GetMyHero()
  3412. prepareSpell("invoker_emp",me)
  3413. return true
  3414. end
  3415.  
  3416. function invokeChaosmeteor(button, button2, text)
  3417. local me = entityList:GetMyHero()
  3418. prepareSpell("invoker_chaos_meteor",me)
  3419. return true
  3420. end
  3421.  
  3422. function invokeTornado(button, button2, text)
  3423. local me = entityList:GetMyHero()
  3424. prepareSpell("invoker_tornado",me)
  3425. return true
  3426. end
  3427.  
  3428. function invokeAlacrity(button, button2, text)
  3429. local me = entityList:GetMyHero()
  3430. prepareSpell("invoker_alacrity",me)
  3431. return true
  3432. end
  3433.  
  3434. function invokeBlast(button, button2, text)
  3435. local me = entityList:GetMyHero()
  3436. prepareSpell("invoker_deafening_blast",me)
  3437. return true
  3438. end
  3439.  
  3440. function invokeForgespirit(button, button2, text)
  3441. local me = entityList:GetMyHero()
  3442. prepareSpell("invoker_forge_spirit",me)
  3443. return true
  3444. end
  3445.  
  3446. function chainStun(target, delay, except, onlychain)
  3447. local chain = false
  3448. local stunned = false
  3449. local modifiers_table = {"modifier_shadow_demon_disruption", "modifier_obsidian_destroyer_astral_imprisonment_prison",
  3450. "modifier_eul_cyclone", "modifier_invoker_tornado", "modifier_bane_nightmare", "modifier_shadow_shaman_shackles",
  3451. "modifier_crystal_maiden_frostbite", "modifier_ember_spirit_searing_chains", "modifier_axe_berserkers_call",
  3452. "modifier_lone_druid_spirit_bear_entangle_effect", "modifier_meepo_earthbind", "modifier_naga_siren_ensnare",
  3453. "modifier_storm_spirit_electric_vortex_pull", "modifier_treant_overgrowth", "modifier_cyclone",
  3454. "modifier_sheepstick_debuff", "modifier_shadow_shaman_voodoo", "modifier_lion_voodoo", "modifier_brewmaster_storm_cyclone",
  3455. "modifier_puck_phase_shift", "modifier_dark_troll_warlord_ensnare" , "modifier_invoker_deafening_blast_knockback"}
  3456. local modifiers = target.modifiers
  3457. local length = #modifiers_table
  3458. table.sort(modifiers, function (a,b) return a.remainingTime > b.remainingTime end)
  3459. for i = 1, #modifiers do
  3460. local m = modifiers[i]
  3461. for z = 1, length do
  3462. local k = modifiers_table[z]
  3463. if m and (m.stunDebuff or m.name == k) and (not except or m.name ~= except) and m.name ~= "modifier_invoker_cold_snap" then
  3464. stunned = true
  3465. local remainingTime = m.remainingTime
  3466. if m.name == "modifier_eul_cyclone" or m.name == "modifier_invoker_tornado" then remainingTime = m.remainingTime+0.07 end
  3467. if remainingTime > 0 and remainingTime <= delay then
  3468. chain = true
  3469. else
  3470. chain = false
  3471. end
  3472. end
  3473. end
  3474. end
  3475. return (((not (stunned or target:IsStunned() or target:IsRooted() or not target:CanMove() or target:IsHexed()) or chain) and SleepCheck("stun") and not onlychain) or (onlychain and chain))
  3476. end
  3477.  
  3478. function stunDuration(target)
  3479. local modifiers_table = {"modifier_shadow_demon_disruption", "modifier_obsidian_destroyer_astral_imprisonment_prison",
  3480. "modifier_eul_cyclone", "modifier_invoker_tornado", "modifier_bane_nightmare", "modifier_shadow_shaman_shackles",
  3481. "modifier_crystal_maiden_frostbite", "modifier_ember_spirit_searing_chains", "modifier_axe_berserkers_call",
  3482. "modifier_lone_druid_spirit_bear_entangle_effect", "modifier_meepo_earthbind", "modifier_naga_siren_ensnare",
  3483. "modifier_storm_spirit_electric_vortex_pull", "modifier_treant_overgrowth", "modifier_cyclone",
  3484. "modifier_sheepstick_debuff", "modifier_shadow_shaman_voodoo", "modifier_lion_voodoo", "modifier_brewmaster_storm_cyclone",
  3485. "modifier_puck_phase_shift", "modifier_dark_troll_warlord_ensnare" , "modifier_invoker_deafening_blast_knockback"}
  3486. local modifiers = target.modifiers
  3487. local length = #modifiers_table
  3488. table.sort(modifiers, function (a,b) return a.remainingTime > b.remainingTime end)
  3489. for i = 1, #modifiers do
  3490. local m = modifiers[i]
  3491. for z = 1, length do
  3492. local k = modifiers_table[z]
  3493. if m and (m.stunDebuff or m.name == k) and m.name ~= "modifier_invoker_cold_snap" then
  3494. local remainingTime = m.remainingTime
  3495. if m.name == "modifier_eul_cyclone" then remainingTime = m.remainingTime+0.07 end
  3496. return remainingTime
  3497. end
  3498. end
  3499. end
  3500. if target:IsChanneling() then
  3501. local ab = target:GetChanneledAbility()
  3502. return ab:GetChannelTime(ab.level) - ab.channelTime
  3503. end
  3504. local abilities = target.abilities
  3505. for i = 1, #abilities do
  3506. local v = abilities[i]
  3507. if v.abilityPhase then
  3508. return v:FindCastPoint()
  3509. end
  3510. end
  3511. return 0
  3512. end
  3513.  
  3514. class 'MyHero'
  3515.  
  3516. function MyHero:__init(heroEntity)
  3517. self.heroEntity = heroEntity
  3518. local name = heroEntity.name
  3519. if not heroInfo[name] then
  3520. return nil
  3521. end
  3522. end
  3523.  
  3524. function MyHero:GetAttackRange()
  3525. local bonus = 0
  3526. if self.heroEntity.classId == CDOTA_Unit_Hero_TemplarAssassin then
  3527. local psy = self.heroEntity:GetAbility(3)
  3528. psyrange = {60,120,180,240}
  3529. if psy and psy.level > 0 then
  3530. bonus = psyrange[psy.level]
  3531. end
  3532. elseif self.heroEntity.classId == CDOTA_Unit_Hero_Sniper then
  3533. local aim = self.heroEntity:GetAbility(3)
  3534. aimrange = {100,200,300,400}
  3535. if aim and aim.level > 0 then
  3536. bonus = aimrange[aim.level]
  3537. end
  3538. elseif self.heroEntity.classId == CDOTA_Unit_Hero_Enchantress then
  3539. if enablemodifiers then
  3540. local impetus = self.heroEntity:GetAbility(4)
  3541. if impetus.level > 0 and self.heroEntity:AghanimState() then
  3542. bonus = 190
  3543. end
  3544. end
  3545. elseif self.heroEntity.classId == CDOTA_Unit_Hero_LoneDruid then
  3546. local lonetrue = self.heroEntity:FindSpell("lone_druid_true_form")
  3547. if self.heroEntity.attackRange < 130 and (not (lonetrue and lonetrue.level > 0) or not self.heroEntity:DoesHaveModifier("modifier_lone_druid_true_form")) then
  3548. bonus = 423
  3549. end
  3550. end
  3551. local winter = self.heroEntity:FindSpell("winter_wyvern_arctic_burn")
  3552. if winter and winter.level > 0 and self.heroEntity:DoesHaveModifier("modifier_winter_wyvern_arctic_burn") then
  3553. bonus = winter:GetSpecialData("attack_range_bonus")
  3554. end
  3555. local dragon = self.heroEntity:FindSpell("dragon_knight_elder_dragon_form")
  3556. if dragon and dragon.level > 0 and self.heroEntity:DoesHaveModifier("modifier_dragon_knight_dragon_form") then
  3557. bonus = 372
  3558. end
  3559. local terrormorph = self.heroEntity:FindSpell("terrorblade_metamorphosis")
  3560. if terrormorph and terrormorph.level > 0 and self.heroEntity:DoesHaveModifier("modifier_terrorblade_metamorphosis") then
  3561. bonus = 422
  3562. end
  3563. return self.heroEntity.attackRange + bonus
  3564. end
  3565.  
  3566. function MyHero:Hit(target)
  3567. if target and target.team ~= self.heroEntity.team then
  3568. if target and target.hero then
  3569. if self.heroEntity.classId == CDOTA_Unit_Hero_Clinkz then
  3570. local searinga = self.heroEntity:GetAbility(2)
  3571. if searinga.level > 0 and self.heroEntity.mana > 10 then
  3572. self.heroEntity:SafeCastAbility(searinga, target)
  3573. else self.heroEntity:Attack(target) end
  3574. elseif self.heroEntity.classId == CDOTA_Unit_Hero_DrowRanger and not target:IsMagicImmune() then
  3575. local frost = self.heroEntity:GetAbility(1)
  3576. if frost.level > 0 and self.heroEntity.mana > 12 then
  3577. self.heroEntity:SafeCastAbility(frost, target)
  3578. else self.heroEntity:Attack(target) end
  3579. elseif self.heroEntity.classId == CDOTA_Unit_Hero_Viper and not target:IsMagicImmune() then
  3580. local poison = self.heroEntity:GetAbility(1)
  3581. if poison.level > 0 and self.heroEntity.mana > 21 then
  3582. self.heroEntity:SafeCastAbility(poison, target)
  3583. else self.heroEntity:Attack(target) end
  3584. elseif self.heroEntity.classId == CDOTA_Unit_Hero_Huskar and not target:IsMagicImmune() then
  3585. local burning = self.heroEntity:GetAbility(2)
  3586. if burning.level > 0 and self.heroEntity.health > 15 then
  3587. self.heroEntity:SafeCastAbility(burning, target)
  3588. else self.heroEntity:Attack(target) end
  3589. elseif self.heroEntity.classId == CDOTA_Unit_Hero_Silencer and not target:IsMagicImmune() then
  3590. local glaives = self.heroEntity:GetAbility(2)
  3591. if glaives.level > 0 and self.heroEntity.mana > 15 then
  3592. self.heroEntity:SafeCastAbility(glaives, target)
  3593. else self.heroEntity:Attack(target) end
  3594. elseif self.heroEntity.classId == CDOTA_Unit_Hero_Jakiro and not target:IsMagicImmune() then
  3595. local liquid = self.heroEntity:GetAbility(3)
  3596. if liquid.level > 0 and liquid:CanBeCasted() then
  3597. self.heroEntity:SafeCastAbility(liquid, target)
  3598. else self.heroEntity:Attack(target) end
  3599. elseif self.heroEntity.classId == CDOTA_Unit_Hero_Obsidian_Destroyer and not target:IsMagicImmune() then
  3600. local arcane = self.heroEntity:GetAbility(1)
  3601. if arcane.level > 0 and self.heroEntity.mana > 100 then
  3602. self.heroEntity:SafeCastAbility(arcane, target)
  3603. else self.heroEntity:Attack(target) end
  3604. elseif self.heroEntity.classId == CDOTA_Unit_Hero_Enchantress and not target:IsMagicImmune() then
  3605. local impetus = self.heroEntity:GetAbility(4)
  3606. local impemana = {55,60,65}
  3607. if impetus.level > 0 and self.heroEntity.mana > impemana[impetus.level] then
  3608. self.heroEntity:SafeCastAbility(impetus, target)
  3609. else self.heroEntity:Attack(target) end
  3610. else
  3611. self.heroEntity:Attack(target)
  3612. end
  3613. else
  3614. self.heroEntity:Attack(target)
  3615. end
  3616. end
  3617. end
  3618.  
  3619. function max(t, fn)
  3620. if #t == 0 then return nil, nil end
  3621. local key, value = 1, t[1]
  3622. for i = 2, #t do
  3623. if fn(value, t[i]) then
  3624. key, value = i, t[i]
  3625. end
  3626. end
  3627. return key, value
  3628. end
  3629.  
  3630. function prepareSpell(name,me)
  3631. local abilities = me.abilities
  3632. local spell = me:FindSpell(name)
  3633. local quas, wex, exort, invoke, spell1 = abilities[1], abilities[2], abilities[3], abilities[6], abilities[4]
  3634. if not invoke:CanBeCasted() or not me:CanCast() or spell1.cd <= spell.cd then return end
  3635. if name == "invoker_cold_snap" and quas.level > 0 then
  3636. me:CastAbility(quas) me:CastAbility(quas) me:CastAbility(quas)
  3637. me:CastAbility(invoke)
  3638. Sleep(100+client.latency, "casting")
  3639. Sleep(200+client.latency, "casting2")
  3640. return true
  3641. elseif name == "invoker_ice_wall" and quas.level > 0 and exort.level > 0 then
  3642. me:CastAbility(quas) me:CastAbility(quas) me:CastAbility(exort)
  3643. me:CastAbility(invoke)
  3644. Sleep(100+client.latency, "casting")
  3645. Sleep(200+client.latency, "casting2")
  3646. return true
  3647. elseif name == "invoker_forge_spirit" and quas.level > 0 and exort.level > 0 then
  3648. me:CastAbility(quas) me:CastAbility(exort) me:CastAbility(exort)
  3649. me:CastAbility(invoke)
  3650. Sleep(100+client.latency, "casting")
  3651. Sleep(200+client.latency, "casting2")
  3652. return true
  3653. elseif name == "invoker_sun_strike" and exort.level > 0 then
  3654. me:CastAbility(exort) me:CastAbility(exort) me:CastAbility(exort)
  3655. me:CastAbility(invoke)
  3656. Sleep(100+client.latency, "casting")
  3657. Sleep(200+client.latency, "casting2")
  3658. return true
  3659. elseif name == "invoker_chaos_meteor" and exort.level > 0 and wex.level > 0 then
  3660. me:CastAbility(exort) me:CastAbility(exort) me:CastAbility(wex)
  3661. me:CastAbility(invoke)
  3662. Sleep(100+client.latency, "casting")
  3663. Sleep(200+client.latency, "casting2")
  3664. return true
  3665. elseif name == "invoker_deafening_blast" and quas.level > 0 and exort.level > 0 and wex.level > 0 then
  3666. me:CastAbility(quas) me:CastAbility(wex) me:CastAbility(exort)
  3667. me:CastAbility(invoke)
  3668. Sleep(100+client.latency, "casting")
  3669. Sleep(200+client.latency, "casting2")
  3670. return true
  3671. elseif name == "invoker_alacrity" and exort.level > 0 and wex.level > 0 then
  3672. me:CastAbility(wex) me:CastAbility(wex) me:CastAbility(exort)
  3673. me:CastAbility(invoke)
  3674. Sleep(100+client.latency, "casting")
  3675. Sleep(200+client.latency, "casting2")
  3676. return true
  3677. elseif name == "invoker_tornado" and quas.level > 0 and wex.level > 0 then
  3678. me:CastAbility(quas) me:CastAbility(wex) me:CastAbility(wex)
  3679. me:CastAbility(invoke)
  3680. Sleep(100+client.latency, "casting")
  3681. Sleep(200+client.latency, "casting2")
  3682. return true
  3683. elseif name == "invoker_emp" and wex.level > 0 then
  3684. me:CastAbility(wex) me:CastAbility(wex) me:CastAbility(wex)
  3685. me:CastAbility(invoke)
  3686. Sleep(100+client.latency, "casting")
  3687. Sleep(200+client.latency, "casting2")
  3688. return true
  3689. elseif name == "invoker_ghost_walk" and wex.level > 0 and quas.level > 0 then
  3690. me:CastAbility(wex) me:CastAbility(quas) me:CastAbility(quas)
  3691. me:CastAbility(invoke)
  3692. if SleepCheck("casting3") then
  3693. if not me:IsInvisible() and setOrbs("wex", me) then
  3694. Sleep(250, "casting3")
  3695. end
  3696. end
  3697. Sleep(100+client.latency, "casting")
  3698. Sleep(200+client.latency, "casting2")
  3699. return true
  3700. end
  3701. end
  3702.  
  3703. function setOrbs(orb, me)
  3704. local modif = me.modifiers
  3705. local count = 0
  3706. local spell = me:FindSpell("invoker_"..orb)
  3707. for i = 1, #modif do
  3708. local mod = modif[i]
  3709. if mod.name == "modifier_invoker_"..orb.."_instance" then
  3710. count = count + 1
  3711. end
  3712. end
  3713. if me:IsInvisible() then return false end
  3714. if count == 0 then
  3715. me:CastAbility(spell) me:CastAbility(spell) me:CastAbility(spell)
  3716. return true
  3717. elseif count == 1 then
  3718. me:CastAbility(spell) me:CastAbility(spell)
  3719. return true
  3720. elseif count == 2 then
  3721. me:CastAbility(spell)
  3722. return true
  3723. end
  3724. return false
  3725. end
  3726.  
  3727. function getBlockPositions(target,rotR,unit)
  3728. local rotR1,rotR2 = -rotR,(-3-rotR)
  3729. local infront = Vector(target.position.x+unit.movespeed*math.cos(rotR), target.position.y+unit.movespeed*math.sin(rotR), target.position.z)
  3730. local behind = Vector(target.position.x+(-unit.movespeed/2)*math.cos(rotR), target.position.y+(-unit.movespeed/2)*math.sin(rotR), target.position.z)
  3731. return Vector(infront.x+90*math.cos(rotR1), infront.y+90*math.sin(rotR1), infront.z),
  3732. Vector(infront.x+90*math.cos(rotR2), infront.y+90*math.sin(rotR2), infront.z),
  3733. Vector(behind.x+120*math.cos(rotR1), behind.y+120*math.sin(rotR1), behind.z),
  3734. Vector(behind.x+120*math.cos(rotR2), behind.y+120*math.sin(rotR2), behind.z),infront
  3735. end
  3736.  
  3737. function getClosestCamp(me)
  3738. local closest = nil
  3739. local tempJungleCamps = JungleCamps
  3740. local mouPos = client.mousePosition
  3741. for i = 1, #tempJungleCamps do
  3742. local camp = tempJungleCamps[i]
  3743. if not closest or GetDistance2D(mouPos,camp.position) < GetDistance2D(mouPos,closest.position) then
  3744. closest = camp
  3745. end
  3746. end
  3747. return closest
  3748. end
  3749.  
  3750. function CanGoInvis(hero)
  3751. local invis = hero:FindSpell("bounty_hunter_wind_walk") or hero:FindSpell("clinkz_skeleton_walk") or hero:FindItem("item_invis_sword") or hero:FindItem("item_silver_edge") or hero:FindItem("item_glimmer_cape") or hero:FindItem("item_moon_shard")
  3752. local riki = hero:FindSpell("riki_permanent_invisibility")
  3753. return (invis and invis:CanBeCasted()) or riki
  3754. end
  3755.  
  3756. function CanBeSlowed(target)
  3757. return not target:IsMagicImmune() and not target:IsInvul() and not target:DoesHaveModifier("modifier_rune_haste") and not target:DoesHaveModifier("modifier_lycan_shapeshift") and not target:DoesHaveModifier("modifier_centaur_stampede")
  3758. end
  3759.  
  3760. function rotateX(x,y,angle)
  3761. return x*math.cos(angle) - y*math.sin(angle)
  3762. end
  3763.  
  3764. function rotateY(x,y,angle)
  3765. return y*math.cos(angle) + x*math.sin(angle)
  3766. end
  3767.  
  3768. function GetXX(ent)
  3769. local team = ent.team
  3770. if team == 2 then
  3771. return client.screenSize.x/txxG + 1
  3772. elseif team == 3 then
  3773. return client.screenSize.x/txxB
  3774. end
  3775. end
  3776.  
  3777. function IsMouseOnButton(x,y,h,w)
  3778. local mx = client.mouseScreenPosition.x
  3779. local my = client.mouseScreenPosition.y
  3780. return mx > x and mx <= x + w and my > y and my <= y + h
  3781. end
  3782.  
  3783. function Version()
  3784. local file = io.open(SCRIPT_PATH.."/MoonesComboScript_Version.lua", "r")
  3785. local ver = nil
  3786. if file then
  3787. ver = file:read("*number")
  3788. file:read("*line")
  3789. beta = file:read("*line")
  3790. info = file:read("*line")
  3791. file:close()
  3792. end
  3793. if ver then
  3794. local bcheck = ""..beta
  3795. if ver == currentVersion and bcheck == Beta then
  3796. outdated = false
  3797. return true,ver,beta,info
  3798. elseif ver > currentVersion or bcheck ~= Beta then
  3799. outdated = true
  3800. return false,ver,beta,info
  3801. end
  3802. else
  3803. versionSign.text = "You didn't download version info file from Moones' repository. Please do so to keep the script updated."
  3804. versionSign.color = -1
  3805. return false
  3806. end
  3807. end
  3808.  
  3809. function FindEntity(cast,me,dayvision,m1)
  3810. for i = 1, #cast do
  3811. local z = cast[i]
  3812. if (not dayvision or z.dayVision == dayvision) and (not m1 or z:DoesHaveModifier(m1)) then
  3813. return z
  3814. end
  3815. end
  3816. return nil
  3817. end
  3818.  
  3819. function Load()
  3820.  
  3821. local up,ver,beta,info = Version()
  3822. if up then
  3823. if beta ~= "" then
  3824. versionSign.text = "Your version of Moones's Combo Script is up-to-date! (v"..currentVersion.." "..Beta..")"
  3825. else
  3826. versionSign.text = "Your version of Moones's Combo Script is up-to-date! (v"..currentVersion..")"
  3827. end
  3828. versionSign.color = 0x66FF33FF
  3829. if info then
  3830. infoSign.text = info
  3831. infoSign.visible = true
  3832. end
  3833. end
  3834. if outdated then
  3835. if beta ~= "" then
  3836. versionSign.text = "Your version of Moones's Combo Script is OUTDATED (Yours: v"..currentVersion.." "..Beta.." Current: v"..ver.." "..beta.."), send me email to moones@email.cz to get current one!"
  3837. else
  3838. versionSign.text = "Your version of Moones's Combo Script is OUTDATED (Yours: v"..currentVersion.." "..Beta.." Current: v"..ver.."), send me email to moones@email.cz to get current one!"
  3839. end
  3840. versionSign.color = 0xFF6600FF
  3841. if info then
  3842. infoSign.text = info
  3843. infoSign.visible = true
  3844. end
  3845. end
  3846. versionSign.visible = true
  3847.  
  3848. if PlayingGame() then
  3849. local me = entityList:GetMyHero()
  3850. if not me then
  3851. script:Disable()
  3852. else
  3853. local mathfloor = math.floor
  3854. if mathfloor(client.screenRatio*100) == 177 then testX = 1600 tinfoHeroSize = 55 tinfoHeroDown = 25.714 txxB = 2.535 txxG = 3.485
  3855. elseif mathfloor(client.screenRatio*100) == 166 then testX = 1280 tinfoHeroSize = 47.1 tinfoHeroDown = 25.714 txxB = 2.558 txxG = 3.62
  3856. elseif mathfloor(client.screenRatio*100) == 160 then testX = 1280 tinfoHeroSize = 48.5 tinfoHeroDown = 25.714 txxB = 2.579 txxG = 3.74
  3857. elseif mathfloor(client.screenRatio*100) == 133 then testX = 1024 tinfoHeroSize = 47 tinfoHeroDown = 25.714 txxB = 2.78 txxG = 4.63
  3858. elseif mathfloor(client.screenRatio*100) == 125 then testX = 1280 tinfoHeroSize = 58 tinfoHeroDown = 25.714 tinfoHeroSS = 23 txxB = 2.747 txxG = 4.54
  3859. else testX = 1600 tinfoHeroSize = 55 tinfoHeroDown = 25.714 tinfoHeroSS = 22 txxB = 2.535 txxG = 3.485 end
  3860. rate = client.screenSize.x/testX
  3861. con = rate
  3862. if rate < 1 then rate = 1 end
  3863. x_ = tinfoHeroSize*(con)
  3864. y_ = client.screenSize.y/tinfoHeroDown
  3865. monitor = client.screenSize.x/1600
  3866. atr = nil
  3867. statusText.visible = false
  3868. myhero = nil
  3869. reg = true
  3870. victim = nil
  3871. if HUD and (HUD:IsClosed() or HUD:IsMinimized()) and me.classId == CDOTA_Unit_Hero_Invoker then
  3872. HUD:Open()
  3873. end
  3874. start = false
  3875. useblink = config.UseBlink
  3876. myId = me.classId
  3877. sleep = 0
  3878. xposition = nil
  3879. comboready = false
  3880. lastCastPrediction = nil
  3881. resettime = nil
  3882. targetlock = false
  3883. type = nil
  3884. enemyHP = nil
  3885. mySpells = nil
  3886. retreat = false
  3887. lastPrediction = nil
  3888. combo = 0
  3889. esstone = false
  3890. harras = false
  3891. trolltoggle = false
  3892. JungleCamps = {
  3893. {position = Vector(-1131,-4044,127), stackPosition = Vector(-2498.94,-3517.86,128), waitPosition = Vector(-1401.69,-3791.52,128), team = 2, id = 1, farmed = false, lvlReq = 8, visible = false, visTime = 0, stacking = false},
  3894. {position = Vector(-366,-2945,127), stackPosition = Vector(-534.219,-1795.27,128), waitPosition = Vector(-408,-2731,127), team = 2, id = 2, farmed = false, lvlReq = 3, visible = false, visTime = 0, stacking = false},
  3895. {position = Vector(1606.45,-3433.36,256), stackPosition = Vector(1325.19,-5108.22,256), waitPosition = Vector(1541.87,-4265.38,256), team = 2, id = 3, farmed = false, lvlReq = 8, visible = false, visTime = 0, stacking = false},
  3896. {position = Vector(3126,-3439,256), stackPosition = Vector(4410.49,-3985,256), waitPosition = Vector(3231,-3807,256), team = 2, id = 4, farmed = false, lvlReq = 3, visible = false, visTime = 0, stacking = false},
  3897. {position = Vector(3031.03,-4480.06,256), stackPosition = Vector(1368.66,-5279.04,256), waitPosition = Vector(3030,-4975,256), team = 2, id = 5, farmed = false, lvlReq = 1, visible = false, visTime = 0, stacking = false},
  3898. {position = Vector(-2991,191,256), stackPosition = Vector(-3351,-1798,205), waitPosition = Vector(-2684,-23,256), team = 2, id = 6, farmed = false, lvlReq = 12, visible = false, visTime = 0, ancients = true, stacking = false},
  3899. {position = Vector(1167,3295,256), stackPosition = Vector(570.86,4515.96,256), waitPosition = Vector(1011,3656,256), team = 3, id = 7, farmed = false, lvlReq = 8, visible = false, visTime = 0, stacking = false},
  3900. {position = Vector(-244,3629,256), stackPosition = Vector(-1170.27,4581.59,256), waitPosition = Vector(-523,4041,256), team = 3, id = 8, farmed = false, lvlReq = 3, visible = false, visTime = 0, stacking = false},
  3901. {position = Vector(-1588,2697,127), stackPosition = Vector(-1302,3689.41,136.411), waitPosition = Vector(-1491,2986,127), team = 3, id = 9, farmed = false, lvlReq = 3, visible = false, visTime = 0, stacking = false},
  3902. {position = Vector(-3157.74,4475.46,256), stackPosition = Vector(-3296.1,5508.48,256), waitPosition = Vector(-3086,4924,256), team = 3, id = 10, farmed = false, lvlReq = 1, visible = false, visTime = 0, stacking = false},
  3903. {position = Vector(-4382,3612,256), stackPosition = Vector(-3026.54,3819.69,132.345), waitPosition = Vector(-3995,3984,256), team = 3, id = 11, farmed = false, lvlReq = 8, visible = false, visTime = 0, stacking = false},
  3904. {position = Vector(4026,-709.943,128), stackPosition = Vector(2636,-1017,127), waitPosition = Vector(3583,-736,127), team = 3, id = 12, farmed = false, lvlReq = 12, visible = false, visTime = 0, ancients = true, stacking = false}
  3905. }
  3906. camp = nil
  3907. tuskSnowBall = false
  3908. positionsTable = {}
  3909. PuckPosition = nil
  3910. directiontable = {}
  3911. LastCastedTable = {}
  3912. indicate = {}
  3913. damageTable = {}
  3914. comboTable = {
  3915. { CDOTA_Unit_Hero_Ursa, {{ 1, "shock_radius", true}, { 2, nil, false, nil, false, nil, false, nil, nil, true, true }, { 5, 350, false, nil, false, nil, false, nil, nil, true }} },
  3916. { CDOTA_Unit_Hero_Bloodseeker, {{ 4, nil, false, nil, false, nil, false, nil, nil, true }, { 2 , nil, false, 2.6}, { 1, nil, false, nil, false, nil, false, nil, nil, true, true }} },
  3917. { CDOTA_Unit_Hero_Lina, {{ 2, nil, true , 0.5}, { 1, nil, true, nil, false, "dragon_slave_speed", nil, nil, nil, nil, true }, { 4, nil, false, nil, killsteal, nil, nil, nil, nil, nil, true }} },
  3918. { CDOTA_Unit_Hero_Zuus, {{ 2, nil, true }, { 1, nil, nil, nil, nil, nil, nil, nil, nil, nil, true }, { 4, nil, true, -0.1, killsteal, nil, nil, nil, nil, nil, true }} },
  3919. { CDOTA_Unit_Hero_Tinker, {{ 2 , "radius"}, { 1 }, { 4, nil, nil, nil, nil, nil, nil, nil, nil, nil, true }} },
  3920. { CDOTA_Unit_Hero_Lion, {{ 1, 450, true }, { 2, nil, true }, { 4, nil, false, nil, killsteal, nil, nil, nil, nil, nil, true }} },
  3921. { CDOTA_Unit_Hero_ShadowShaman, {{ 2, nil, true }, { 3, nil, true, nil, nil, nil, nil, nil, nil, nil, true }, { 1, nil, nil, nil, nil, nil, nil, nil, nil, nil, true }, { 4 }} },
  3922. { CDOTA_Unit_Hero_Axe, {{ 1, "radius", true }, { 2 }, { 4, nil, false, nil, true, nil, false, nil, nil, true }} },
  3923. { CDOTA_Unit_Hero_Necrolyte, {{ 1, "area_of_effect" }, { 4 }} },
  3924. { CDOTA_Unit_Hero_PhantomAssassin, {{ 1, nil, true, nil, false, "dagger_speed" }, { 2, nil, nil, nil, nil, nil, nil, nil, nil, nil, true }} },
  3925. { CDOTA_Unit_Hero_Pudge, {{ 1, nil, true, nil, false, "hook_speed", true, "hook_width", true, true }, { 4, nil, true, nil, nil, nil, nil, nil, nil, true, true }} },
  3926. { CDOTA_Unit_Hero_Earthshaker, {{ 4, 625, true}, { 2, 350, true }, { 1, nil, true, -0.1 }} },
  3927. { CDOTA_Unit_Hero_Skywrath_Mage, {{ 2, "launch_radius", true }, { 3 }, { 4, nil, false, 0.2 }, { 1 }} },
  3928. { CDOTA_Unit_Hero_Leshrac, {{ 1, nil, true, 0.35}, { 2, "radius" }, { 3, nil, true }, { 4, "radius" }} },
  3929. { CDOTA_Unit_Hero_Windrunner, {{ 1, nil, true, nil, false, "arrow_speed" }, { 2, nil, true, nil, false, "arrow_speed" }} },
  3930. { CDOTA_Unit_Hero_Rattletrap, {{ 4, nil, true, nil, false, nil, true, "latch_radius", true, true }, { 1, "radius", true, 0.7 }, { 3 }, { 2, 125, true, 0.1 }} },
  3931. { CDOTA_Unit_Hero_Ogre_Magi, {{ 4, nil, true }, { 1, nil, true }, { 2, nil, true, nil, false, "projectile_speed" }, { 3 }} },
  3932. { CDOTA_Unit_Hero_Kunkka, {{ "kunkka_x_marks_the_spot", nil, false, 0.1 }, { 1, nil, true, 1.7 }, { 4, nil, false, nil, false, "ghostship_speed" }} },
  3933. { CDOTA_Unit_Hero_Slardar, {{ 2, "crush_radius", true}, { 1, nil, true }, { 4 }} },
  3934. { CDOTA_Unit_Hero_Bane, {{ "bane_nightmare", nil, true, 1 }, { 4, nil, true}, { "bane_enfeeble" , nil, true }, { 2, nil, true }} },
  3935. { CDOTA_Unit_Hero_Bristleback, {{ 1 }, { 2, "radius", false, nil, false, nil, false, nil, nil, true }} },
  3936. { CDOTA_Unit_Hero_Centaur, {{ 1, "radius" }, { 2 }} },
  3937. { CDOTA_Unit_Hero_Clinkz, {{ 1, 630 }} },
  3938. { CDOTA_Unit_Hero_CrystalMaiden, {{ 1, nil, true, -0.1 }, { 2, nil, true }} },
  3939. { CDOTA_Unit_Hero_DeathProphet, {{ 1, nil, true }, { 2, nil, true, -0.1 }} },
  3940. { CDOTA_Unit_Hero_DoomBringer, {{ 2, "radius" }, { 4, nil, true }, { 3, nil, true}} },
  3941. { CDOTA_Unit_Hero_DragonKnight, {{ 2, nil, true }, { 1, nil, true }} },
  3942. { CDOTA_Unit_Hero_DrowRanger, {{ 2, nil, true, nil, false, "wave_speed" }} },
  3943. { CDOTA_Unit_Hero_Furion, {{ 1, nil, true, -0.1 }} },
  3944. { CDOTA_Unit_Hero_Huskar, {{ 4, nil, false, nil, false, "charge_speed" }} },
  3945. { CDOTA_Unit_Hero_Jakiro, {{ 2, nil, true, 0.5 }, { 1, nil, true }} },
  3946. { CDOTA_Unit_Hero_Lich, {{ 1, nil, true }, { 2 }} },
  3947. { CDOTA_Unit_Hero_Life_Stealer, {{ 3, nil, true }} },
  3948. { CDOTA_Unit_Hero_Luna, {{ 1, nil, true }} },
  3949. { CDOTA_Unit_Hero_Mirana, {{ 2, nil, true, nil, false, "arrow_speed", true, "arrow_width", "ally" }, { 1, 400 }} },
  3950. { CDOTA_Unit_Hero_Morphling, {{ 1 }, { 2, nil, true, nil, false, "projectile_speed" }} },
  3951. { CDOTA_Unit_Hero_NightStalker, {{ 1, nil, true }, { 2, nil, true}} },
  3952. { CDOTA_Unit_Hero_Nyx_Assassin, {{ 1, nil, true }, { 2 }} },
  3953. { CDOTA_Unit_Hero_QueenOfPain, {{ 1, nil, true, nil, false, "projectile_speed" }, { 3 , "area_of_effect" }, { 4, nil, true, nil, false, "speed" }} },
  3954. { CDOTA_Unit_Hero_Razor, {{ 2 }, { 1, "radius" }} },
  3955. { CDOTA_Unit_Hero_Riki, {{ 1, nil, true, -0.1 }, { 4 }} },
  3956. { CDOTA_Unit_Hero_Sniper, {{ 1, "radius", true, 1.4 }, { 4, nil, false, nil, true }} },
  3957. { CDOTA_Unit_Hero_SpiritBreaker, {{ 1, nil, true, nil, false, "movement_speed" }, { 4, nil, true }} },
  3958. { CDOTA_Unit_Hero_Sven, {{ "sven_storm_bolt", nil, true, nil, false, "bolt_speed" }} },
  3959. { CDOTA_Unit_Hero_Tidehunter, {{ 1, nil, true, nil, false, "projectile_speed" }, { 3, "radius"}} },
  3960. { CDOTA_Unit_Hero_Tiny, {{ 1, nil, true, 0.5 }, { 2 }} },
  3961. { CDOTA_Unit_Hero_Invoker, {} },
  3962. { CDOTA_Unit_Hero_TemplarAssassin, {{ 2, nil, nil, nil, nil, nil, nil, nil, nil, nil, true }, { 1 }} },
  3963. { CDOTA_Unit_Hero_Abaddon, {{ 2 }, { 1 }} },
  3964. { CDOTA_Unit_Hero_AncientApparition, {{ 1, nil, true, 4 }, { 2, nil, true }, { "ancient_apparition_ice_blast", nil, true, 2.01}, { "ancient_apparition_ice_blast_release" }} },
  3965. { CDOTA_Unit_Hero_AntiMage, {{ 4, nil, false, nil, true }} },
  3966. { CDOTA_Unit_Hero_Batrider, {{ 4, nil, true, "duration", false, nil, false, nil, nil, true }, { 1, nil, false, 0.2 }, { 2, nil, true, 0.3 }} },
  3967. { CDOTA_Unit_Hero_Beastmaster, {{ "beastmaster_primal_roar", nil, true }, { 1, nil, true }, { "beastmaster_call_of_the_wild_boar", nil, true }} },
  3968. { CDOTA_Unit_Hero_BountyHunter, {{ 4 }, { 1, nil, true, nil, true }} },
  3969. { CDOTA_Unit_Hero_Broodmother, {{ 1 }} },
  3970. { CDOTA_Unit_Hero_ChaosKnight, {{ 2, nil, true, nil, nil, nil, nil, nil, nil, nil, true }, { 1, nil, true }} },
  3971. { CDOTA_Unit_Hero_Elder_Titan, {{ "elder_titan_ancestral_spirit", nil, true }, { 1, "radius", true }, { "elder_titan_earth_splitter" }} },
  3972. { CDOTA_Unit_Hero_Enchantress, {{ 2, nil, true }} },
  3973. { CDOTA_Unit_Hero_Enigma, {{ 1, nil, true}, { 3 }} },
  3974. { CDOTA_Unit_Hero_Legion_Commander, {{ 2 }, { 1, nil, true }, { 4 }} },
  3975. { CDOTA_Unit_Hero_Magnataur, {{ 1, nil, nil, nil, nil, "shock_speed" }, { 3, nil, true, nil, nil, "skewer_speed" }} },
  3976. { CDOTA_Unit_Hero_Medusa, {{ 1 }} },
  3977. { CDOTA_Unit_Hero_Naga_Siren, {{ 2, nil, true, nil, false, "net_speed", nil, nil, nil, true }, { 3, "radius" }} },
  3978. { CDOTA_Unit_Hero_Omniknight, {{ 1, "radius" }, { 2 }} },
  3979. { CDOTA_Unit_Hero_Pugna, {{ 1, nil, true }, { 2, nil, true }} },
  3980. { CDOTA_Unit_Hero_Shadow_Demon, {{ 5, nil, true}, { 1, nil, true }, { 2 }, { 3 }} },
  3981. { CDOTA_Unit_Hero_SkeletonKing, {{ 1, nil, true, nil, false, "blast_speed" }} },
  3982. { CDOTA_Unit_Hero_Spectre, {{ 1 }} },
  3983. { CDOTA_Unit_Hero_VengefulSpirit, {{ 1, nil, true, nil, false, "magic_missile_speed"}, { 2 }} },
  3984. { CDOTA_Unit_Hero_Venomancer, {{ 1, nil, true }, { 3 }} },
  3985. { CDOTA_Unit_Hero_Brewmaster, {{ 1, "radius", true }, { 2, nil, true }} },
  3986. { CDOTA_Unit_Hero_StormSpirit, {{ 4, nil, true, nil, false, "ball_lightning_move_speed" }, { 2, nil, true }, { 1 }} },
  3987. { CDOTA_Unit_Hero_EmberSpirit, {{ "ember_spirit_fire_remnant" }, { "ember_spirit_activate_fire_remnant" }, { 2, "radius"}, { 1, "radius", true }, { 3, "radius"}} },
  3988. { CDOTA_Unit_Hero_Slark, {{ 1, "radius"}, { 2, "pounce_radius", true, nil, false, "pounce_speed" }} },
  3989. { CDOTA_Unit_Hero_Nevermore, {{ 1, "shadowraze_range"}, { 2, "shadowraze_range"}, { 3, "shadowraze_range"}} },
  3990. { CDOTA_Unit_Hero_Weaver, {{ 1, "radius"}, { 2 }} },
  3991. { CDOTA_Unit_Hero_TrollWarlord, {{ "troll_warlord_whirling_axes_ranged", nil, true, nil, false, "axe_speed"}, { "troll_warlord_whirling_axes_melee", "max_range" }} },
  3992. { CDOTA_Unit_Hero_EarthSpirit, {{ 1, nil, true }, { 3, nil, false }, { 2, nil, false, 0.6 }} },
  3993. { CDOTA_Unit_Hero_LoneDruid, {{ "lone_druid_rabid" }, { "lone_druid_true_form_battle_cry", 700 }} },
  3994. { CDOTA_Unit_Hero_Wisp, {{ "wisp_spirits", 1300 }} },
  3995. { CDOTA_Unit_Hero_Chen, {{ "chen_penitence" }, { "chen_test_of_faith" }} },
  3996. { CDOTA_Unit_Hero_Phoenix, {{ 1, nil, true }, { 2, nil, true, nil, nil, "spirit_speed" }, { "phoenix_sun_ray", nil, false, nil, true }, { "phoenix_sun_ray_toggle_move" }} },
  3997. { CDOTA_Unit_Hero_Tusk, {{ 2, nil, true, nil, false, "snowball_speed" }, { "tusk_ice_shards", nil, true, nil, false, "shard_speed" }, { 3, nil, true }, { "tusk_walrus_punch", nil, false }, { "tusk_walrus_kick", nil, true }} },
  3998. { CDOTA_Unit_Hero_Visage, {{ 1, nil, true }, { 2 }} },
  3999. { CDOTA_Unit_Hero_Gyrocopter, {{ 2, nil, true, 3, false, "speed" }, { 1, "radius" }, { 3, "radius" }} },
  4000. { CDOTA_Unit_Hero_Undying, {{ 1 }, { 2 }, { 3, "radius" }} },
  4001. { CDOTA_Unit_Hero_Terrorblade, {{ 4 }, { 1, nil, true }, { 3 }, { 2 }} },
  4002. { CDOTA_Unit_Hero_Puck, {{ "puck_waning_rift", "radius", true }, { "puck_illusory_orb", nil, false, nil, false, "orb_speed" }, { "puck_ethereal_jaunt" }} },
  4003. { CDOTA_Unit_Hero_Treant, {{ 2, nil, true }} },
  4004. { CDOTA_Unit_Hero_PhantomLancer, {{ 1, nil, true, nil, false, "lance_speed" }} },
  4005. { CDOTA_Unit_Hero_Silencer, {{ 3, nil, true, 4 }, { 2 }} },
  4006. { CDOTA_Unit_Hero_Disruptor, {{ "disruptor_kinetic_field", nil, true, 1.2 }, { 1 }, { "disruptor_glimpse", nil, true }} },
  4007. { CDOTA_Unit_Hero_KeeperOfTheLight, {{ "keeper_of_the_light_illuminate" }, { "keeper_of_the_light_spirit_form_illuminate" }, { "keeper_of_the_light_mana_leak", nil, true }, { "keeper_of_the_light_blinding_light", nil, true }} },
  4008. { CDOTA_Unit_Hero_Oracle, {{ 1, nil, true, nil, false, "bolt_speed" }, { "oracle_purifying_flames", nil, false, nil, true }} },
  4009. { CDOTA_Unit_Hero_SandKing, {{ 1, nil, true, nil, false, "burrow_speed" }} },
  4010. { CDOTA_Unit_Hero_Warlock, {{ 1 }, { 2 }} },
  4011. { CDOTA_Unit_Hero_DarkSeer, {{ 1, "radius", true }, { 4 }, { 2 }, { 3, nil, true }} },
  4012. { CDOTA_Unit_Hero_Winter_Wyvern, {{ 2 }} },
  4013. { CDOTA_Unit_Hero_Rubick, {{ 1, nil, true }, { "rubick_telekinesis_land" }, { "ursa_earthshock", "shock_radius", true},
  4014. { "ursa_overpower", nil, false, nil, false, nil, false, nil, nil, true, true },
  4015. { "ursa_enrage", 350, false, nil, false, nil, false, nil, nil, true },
  4016. { "bloodseeker_rupture", nil, false, nil, false, nil, false, nil, nil, true },
  4017. { "bloodseeker_blood_bath" , nil, false, 2.6},
  4018. { "bloodseeker_bloodrage", nil, false, nil, false, nil, false, nil, nil, true, true },
  4019. { "lina_light_strike_array", nil, true , 0.5},
  4020. { "lina_dragon_slave", nil, true, nil, false, "dragon_slave_speed", nil, nil, nil, nil, true },
  4021. { "lina_laguna_blade", nil, false, nil, killsteal, nil, nil, nil, nil, nil, true },
  4022. { "zuus_lightning_bolt", nil, true },
  4023. { "zuus_arc_lightning", nil, nil, nil, nil, nil, nil, nil, nil, nil, true },
  4024. { "zuus_thundergods_wrath", nil, true, -0.1, killsteal, nil, nil, nil, nil, nil, true },
  4025. { "tinker_heat_seeking_missile" , "radius"},
  4026. { "tinker_laser" },
  4027. { "tinker_rearm", nil, nil, nil, nil, nil, nil, nil, nil, nil, true },
  4028. { "lion_voodoo", 450, true },
  4029. { "lion_impale", nil, true },
  4030. { "lion_finger_of_death", nil, false, nil, killsteal, nil, nil, nil, nil, nil, true },
  4031. { "shadow_shaman_voodoo", nil, true },
  4032. { "shadow_shaman_shackles", nil, true, nil, nil, nil, nil, nil, nil, nil, true },
  4033. { "shadow_shaman_ether_shock", nil, nil, nil, nil, nil, nil, nil, nil, nil, true },
  4034. { "shadow_shaman_mass_serpent_ward" },
  4035. { "axe_berserkers_call", "radius", true },
  4036. { "axe_battle_hunger" },
  4037. { "axe_culling_blade", nil, false, nil, true, nil, false, nil, nil, true },
  4038. { "necrolyte_death_pulse", "area_of_effect" },
  4039. { "necrolyte_reapers_scythe" },
  4040. { "phantom_assassin_stifling_dagger", nil, true, nil, false, "dagger_speed" },
  4041. { "phantom_assassin_phantom_strike", nil, nil, nil, nil, nil, nil, nil, nil, nil, true },
  4042. { "pudge_meat_hook", nil, true, nil, false, "hook_speed", true, "hook_width", true, true },
  4043. { "pudge_dismember", nil, true, nil, nil, nil, nil, nil, nil, true, true },
  4044. { "earthshaker_echo_slam", 625, true},
  4045. { "earthshaker_enchant_totem", 350, true },
  4046. { "earthshaker_fissure", nil, true, -0.1 },
  4047. { "skywrath_mage_concussive_shot", "launch_radius", true },
  4048. { "skywrath_mage_ancient_seal" },
  4049. { "skywrath_mage_mystic_flare", nil, false, 0.2 },
  4050. { "skywrath_mage_ancient_seal" },
  4051. { "leshrac_split_earth", nil, true, 0.35},
  4052. { "leshrac_diabolic_edict", "radius" },
  4053. { "leshrac_lightning_storm", nil, true },
  4054. { "leshrac_pulse_nova", "radius" },
  4055. { "windrunner_shackleshot", nil, true, nil, false, "arrow_speed" },
  4056. { "windrunner_powershot", nil, true, nil, false, "arrow_speed" },
  4057. { "rattletrap_hookshot", nil, true, nil, false, nil, true, "latch_radius", true, true },
  4058. { "rattletrap_battery_assault", "radius", true, 0.7 },
  4059. { "rattletrap_rocket_flare" },
  4060. { "rattletrap_power_cogs", 125, true, 0.1 },
  4061. { "ogre_magi_unrefined_fireblast", nil, true },
  4062. { "ogre_magi_fireblast", nil, true },
  4063. { "ogre_magi_ignite", nil, true, nil, false, "projectile_speed" },
  4064. { "ogre_magi_bloodlust" },
  4065. { "kunkka_x_marks_the_spot", nil, false, 0.1 },
  4066. { "kunkka_torrent", nil, true, 1.7 },
  4067. { "kunkka_ghostship", nil, false, nil, false, "ghostship_speed" },
  4068. { "slardar_slithereen_crush", "crush_radius", true},
  4069. { "slardar_sprint", nil, true },
  4070. { "slardar_amplify_damage" },
  4071. { "bane_nightmare", nil, true, 1 },
  4072. { "bane_fiends_grip", nil, true},
  4073. { "bane_enfeeble" , nil, true },
  4074. { "bane_brain_sap", nil, true },
  4075. { "bristleback_viscous_nasal_goo" },
  4076. { "bristleback_quill_spray", "radius", false, nil, false, nil, false, nil, nil, true },
  4077. { "centaur_hoof_stomp", "radius", true },
  4078. { "centaur_double_edge" },
  4079. { "clinkz_strafe", 630 },
  4080. { "crystal_maiden_freezing_field", nil, true, -0.1 },
  4081. { "crystal_maiden_frostbite", nil, true },
  4082. { "death_prophet_carrion_swarm", nil, true },
  4083. { "death_prophet_silence", nil, true, -0.1 },
  4084. { "doom_bringer_scorched_earth", "radius" },
  4085. { "doom_bringer_doom", nil, true },
  4086. { "doom_bringer_lvl_death", nil, true},
  4087. { "dragon_knight_dragon_tail", nil, true },
  4088. { "dragon_knight_breathe_fire", nil, true },
  4089. { "drow_ranger_wave_of_silence", nil, true, nil, false, "wave_speed" },
  4090. { "furion_sprout", nil, true, -0.1 },
  4091. { "huskar_life_break", nil, false, nil, false, "charge_speed" },
  4092. { "jakiro_ice_path", nil, true, 0.5 },
  4093. { "jakiro_dual_breath", nil, true },
  4094. { "lich_frost_nova", nil, true },
  4095. { "lich_frost_armor" },
  4096. { "life_stealer_open_wounds", nil, true },
  4097. { "luna_lucent_beam", nil, true },
  4098. { "mirana_arrow", nil, true, nil, false, "arrow_speed", true, "arrow_width", "ally" },
  4099. { "mirana_starfall", 400 },
  4100. { "morphling_waveform" },
  4101. { "morphling_adaptive_strike", nil, true, nil, false, "projectile_speed" },
  4102. { "night_stalker_void", nil, true },
  4103. { "night_stalker_crippling_fear", nil, true },
  4104. { "nyx_assassin_impale", nil, true },
  4105. { "nyx_assassin_mana_burn" },
  4106. { "queenofpain_shadow_strike", nil, true, nil, false, "projectile_speed" },
  4107. { "queenofpain_scream_of_pain" , "area_of_effect" },
  4108. { "queenofpain_sonic_wave", nil, true, nil, false, "speed" },
  4109. { "razor_static_link" },
  4110. { "razor_plasma_field", "radius" },
  4111. { "riki_smoke_screen", nil, true, -0.1 },
  4112. { "riki_blink_strike" },
  4113. { "sniper_shrapnel", "radius", true, 1.4 },
  4114. { "sniper_assassinate", nil, false, nil, true },
  4115. { "spirit_breaker_charge_of_darkness", nil, true, nil, false, "movement_speed" },
  4116. { "spirit_breaker_nether_strike", nil, true },
  4117. { "sven_storm_bolt", nil, true, nil, false, "bolt_speed" },
  4118. { "tidehunter_gush", nil, true, nil, false, "projectile_speed" },
  4119. { "tidehunter_anchor_smash", "radius" },
  4120. { "tiny_avalanche", nil, true, 0.5 },
  4121. { "tiny_toss" },
  4122. { "invoker_cold_snap"}, {"invoker_ice_wall", 590, true, 1},
  4123. { "invoker_tornado", "travel_distance", true, nil, false, "travel_speed"}, {"invoker_emp", nil, false, 2.9},
  4124. { "invoker_forge_spirit", 700}, {"invoker_sun_strike", nil, false, 1.7}, {"invoker_chaos_meteor", nil, false, 1.3}, {"invoker_alacrity", nil, nil, nil, nil, nil, nil, nil, nil, nil, true},
  4125. { "invoker_deafening_blast", "travel_distance", true, nil, false, "travel_speed"}, {"invoker_ghost_walk", nil, true},
  4126. { "templar_assassin_meld", nil, nil, nil, nil, nil, nil, nil, nil, nil, true },
  4127. { "templar_assassin_refraction" },
  4128. { "abaddon_aphotic_shield" }, { "abaddon_death_coil" },
  4129. { "ancient_apparition_cold_feet", nil, true, 4 },
  4130. { "ancient_apparition_ice_vortex", nil, true },
  4131. { "ancient_apparition_ice_blast", nil, true, 2.01},
  4132. { "ancient_apparition_ice_blast_release" },
  4133. { "antimage_mana_void", nil, false, nil, true },
  4134. { "batrider_flaming_lasso", nil, true, "duration", false, nil, false, nil, nil, true },
  4135. { "batrider_sticky_napalm", nil, false, 0.2 },
  4136. { "batrider_flamebreak", nil, true, 0.3 },
  4137. { "beastmaster_primal_roar", nil, true },
  4138. { "beastmaster_wild_axes", nil, true },
  4139. { "beastmaster_call_of_the_wild_boar", nil, true },
  4140. { "bounty_hunter_track" },
  4141. { "bounty_hunter_shuriken_toss", nil, true, nil, true },
  4142. { "broodmother_spawn_spiderlings" },
  4143. { "chaos_knight_chaos_strike", nil, true, nil, nil, nil, nil, nil, nil, nil, true },
  4144. { "chaos_knight_chaos_bolt", nil, true },
  4145. { "elder_titan_ancestral_spirit", nil, true },
  4146. { "elder_titan_echo_stomp", "radius", true },
  4147. { "elder_titan_earth_splitter" },
  4148. { "enchantress_enchant", nil, true },
  4149. { "enigma_malefice", nil, true},
  4150. { "enigma_midnight_pulse" },
  4151. { "legion_commander_press_the_attack" },
  4152. { "legion_commander_overwhelming_odds", nil, true },
  4153. { "legion_commander_duel" },
  4154. { "magnataur_shockwave", nil, nil, nil, nil, "shock_speed" },
  4155. { "magnataur_skewer", nil, true, nil, nil, "skewer_speed" },
  4156. { "medusa_mystic_snake" },
  4157. { "naga_siren_ensnare", nil, true, nil, false, "net_speed", nil, nil, nil, true },
  4158. { "naga_siren_rip_tide", "radius" },
  4159. { "omniknight_purification" },
  4160. { "omniknight_repel" },
  4161. { "pugna_nether_blast", nil, true },
  4162. { "pugna_decrepify", nil, true },
  4163. { "shadow_demon_demonic_purge", nil, true},
  4164. { "shadow_demon_disruption", nil, true },
  4165. { "shadow_demon_soul_catcher" },
  4166. { "shadow_demon_shadow_poison" },
  4167. { "skeleton_king_hellfire_blast", nil, true, nil, false, "blast_speed" },
  4168. { "spectre_spectral_dagger" },
  4169. { "vengefulspirit_magic_missile", nil, true, nil, false, "magic_missile_speed"},
  4170. { "vengefulspirit_wave_of_terror" },
  4171. { "venomancer_venomous_gale", nil, true },
  4172. { "venomancer_plague_ward" },
  4173. { "brewmaster_thunder_clap", "radius", true },
  4174. { "brewmaster_drunken_haze", nil, true },
  4175. { "storm_spirit_ball_lightning", nil, true, nil, false, "ball_lightning_move_speed" },
  4176. { "storm_spirit_electric_vortex", nil, true },
  4177. { "storm_spirit_static_remnant" },
  4178. { "ember_spirit_fire_remnant" },
  4179. { "ember_spirit_activate_fire_remnant" },
  4180. { "ember_spirit_sleight_of_fist", "radius"},
  4181. { "ember_spirit_searing_chains", "radius", true },
  4182. { "ember_spirit_flame_guard", "radius" },
  4183. { "slark_dark_pact", "radius"},
  4184. { "slark_pounce", "pounce_radius", true, nil, false, "pounce_speed" },
  4185. { "nevermore_shadowraze1", "shadowraze_range" },
  4186. { "nevermore_shadowraze2", "shadowraze_range" },
  4187. { "nevermore_shadowraze3", "shadowraze_range" },
  4188. { "weaver_the_swarm", "radius"},
  4189. { "weaver_shukuchi" },
  4190. { "troll_warlord_whirling_axes_ranged", nil, true, nil, false, "axe_speed"},
  4191. { "troll_warlord_whirling_axes_melee", "max_range" },
  4192. { "earth_spirit_boulder_smash", nil, true },
  4193. { "earth_spirit_geomagnetic_grip", nil, false },
  4194. { "earth_spirit_rolling_boulder", nil, false, 0.6 },
  4195. { "lone_druid_rabid" }, { "lone_druid_true_form_battle_cry", 700 },
  4196. { "wisp_spirits", 1300 },
  4197. { "chen_penitence" }, { "chen_test_of_faith" },
  4198. { "phoenix_icarus_dive", nil, true },
  4199. { "phoenix_icarus_dive_stop" },
  4200. { "phoenix_fire_spirits", nil, true, nil, nil, "spirit_speed" },
  4201. { "phoenix_sun_ray", nil, false, nil, true },
  4202. { "phoenix_sun_ray_toggle_move" },
  4203. { "tusk_snowball", nil, true, nil, false, "snowball_speed" },
  4204. { "tusk_ice_shards", nil, true, nil, false, "shard_speed" },
  4205. { "tusk_frozen_sigil", nil, true },
  4206. { "tusk_walrus_punch", nil, false },
  4207. { "tusk_walrus_kick", nil, true },
  4208. { "visage_grave_chill", nil, true },
  4209. { "visage_soul_assumption" },
  4210. { "gyrocopter_homing_missile" , nil, true, 3, false, "speed" }, { "gyrocopter_rocket_barrage", "radius" },
  4211. { "gyrocopter_flak_cannon", "radius" },
  4212. { "undying_decay" },
  4213. { "undying_soul_rip" },
  4214. { "undying_tombstone", "radius" },
  4215. { "terrorblade_sunder" },
  4216. { "terrorblade_reflection", nil, true },
  4217. { "terrorblade_metamorphosis" },
  4218. { "terrorblade_conjure_image" },
  4219. { "puck_waning_rift", "radius", true },
  4220. { "puck_illusory_orb", nil, false, nil, false, "orb_speed" },
  4221. { "puck_ethereal_jaunt" },
  4222. { "treant_leech_seed", nil, true },
  4223. { "phantom_lancer_spirit_lance", nil, true, nil, false, "lance_speed" },
  4224. { "silencer_last_word", nil, true, 4 },
  4225. { "silencer_curse_of_the_silent" },
  4226. { "disruptor_kinetic_field", nil, true, 1.2 },
  4227. { "disruptor_thunder_strike" },
  4228. { "disruptor_glimpse", nil, true },
  4229. { "keeper_of_the_light_illuminate" },
  4230. { "keeper_of_the_light_spirit_form_illuminate" },
  4231. { "keeper_of_the_light_mana_leak", nil, true },
  4232. { "keeper_of_the_light_blinding_light", nil, true },
  4233. { "oracle_fortunes_end", nil, true, nil, false, "bolt_speed" },
  4234. { "oracle_purifying_flames", nil, false, nil, true },
  4235. { "sandking_burrowstrike", nil, true, nil, false, "burrow_speed" },
  4236. { "warlock_fatal_bonds" },
  4237. { "warlock_shadow_word" },
  4238. { "dark_seer_vacuum", "radius", true },
  4239. { "dark_seer_wall_of_replica" },
  4240. { "dark_seer_ion_shell" },
  4241. { "dark_seer_surge", nil, true },
  4242. { "winter_wyvern_splinter_blast" }, { 3 }} }
  4243. }
  4244. script:RegisterEvent(EVENT_FRAME, Main)
  4245. script:RegisterEvent(EVENT_KEY, Key)
  4246. script:UnregisterEvent(Load)
  4247. end
  4248. end
  4249. end
  4250.  
  4251. function Close()
  4252. statusText.visible = false
  4253. myhero = nil
  4254. atr = nil
  4255. victim = nil
  4256. myId = nil
  4257. start = false
  4258. resettime = nil
  4259. damageTable = {}
  4260. indicate = {}
  4261. type = nil
  4262. targetlock = false
  4263. tuskSnowBall = false
  4264. if HUD then
  4265. HUD:Close()
  4266. HUD = nil
  4267. buttons = {}
  4268. end
  4269. collectgarbage("collect")
  4270. if reg then
  4271. script:UnregisterEvent(Main)
  4272. script:UnregisterEvent(Key)
  4273. script:RegisterEvent(EVENT_TICK, Load)
  4274. reg = false
  4275. end
  4276. end
  4277.  
  4278. script:RegisterEvent(EVENT_CLOSE, Close)
  4279. script:RegisterEvent(EVENT_TICK, Load)
Add Comment
Please, Sign In to add comment