Advertisement
kam726

klokje prodiction

Apr 4th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.45 KB | None | 0 0
  1. class("ProdictManager")
  2. ProdictManager.instance = ""
  3. function ProdictManager.__init(A0_0)
  4. local L1_1, L2_2, L3_3, L4_4
  5. A0_0.WayPointManager = L1_1
  6. A0_0.status = 0
  7. A0_0.allies = false
  8. A0_0.ewrgwergwew = "2"
  9. A0_0.spells = L1_1
  10. A0_0.heroes = L1_1
  11. for L4_4 = 1, L2_2.iCount do
  12. A0_0.heroes[heroManager:GetHero(L4_4).networkID] = {
  13. dash = {},
  14. pull = {},
  15. root = {},
  16. vision = heroManager:GetHero(L4_4).visible and 0 or 20000
  17. }
  18. end
  19. function L4_4(A0_5, A1_6)
  20. A0_0:OnDash(A0_5, A1_6)
  21. end
  22. L1_1(L2_2, L3_3, L4_4)
  23. function L4_4(A0_7)
  24. A0_0:OnLoseVision(A0_7)
  25. end
  26. L1_1(L2_2, L3_3, L4_4)
  27. function L4_4(A0_8)
  28. A0_0:OnGainVision(A0_8)
  29. end
  30. L1_1(L2_2, L3_3, L4_4)
  31. function L4_4(A0_9, A1_10)
  32. A0_0:OnGainBuff(A0_9, A1_10)
  33. end
  34. L1_1(L2_2, L3_3, L4_4)
  35. function L4_4(A0_11, A1_12)
  36. A0_0:OnLoseBuff(A0_11, A1_12)
  37. end
  38. L1_1(L2_2, L3_3, L4_4)
  39. function L4_4(A0_13, A1_14)
  40. A0_0:OnUpdateBuff(A0_13, A1_14)
  41. end
  42. L1_1(L2_2, L3_3, L4_4)
  43. L1_1(L2_2)
  44. L1_1(L2_2)
  45. L4_4 = "USERNAME"
  46. L4_4 = os
  47. L4_4 = L4_4.getenv
  48. L4_4 = L4_4("COMPUTERNAME")
  49. L4_4 = "%s+"
  50. L4_4 = ","
  51. L4_4 = "?hwid="
  52. L4_4 = L4_4 .. L1_1 .. "&name=" .. GetUser()
  53. L2_2(L3_3, L4_4, function(A0_15)
  54. A0_0:FinishRegister(A0_15)
  55. end)
  56. L4_4 = "Status/prodiction/version.php"
  57. L2_2(L3_3, L4_4, function(A0_16)
  58. A0_0:Version(A0_16)
  59. end)
  60. end
  61. function ProdictManager.Version(A0_17, A1_18)
  62. local L2_19, L3_20
  63. L2_19 = A0_17.ewrgwergwew
  64. if A1_18 ~= L2_19 then
  65. L2_19 = print
  66. L3_20 = "<font color='#FF0000'>There is a new version of Prodiction. Auto Update. Don't F9 till done...</font>"
  67. L2_19(L3_20)
  68. L2_19 = "http://www.imklokje.com/Status/prodiction/Prodiction.lua"
  69. L3_20 = BOL_PATH
  70. L3_20 = L3_20 .. "Scripts\\Common\\Prodiction.lua"
  71. DownloadFile(L2_19, L3_20, function()
  72. if FileExist(L3_20) then
  73. PrintChat("<font color='#00AAFF'> Prodiction is Updated, Reload script for new version.</font>")
  74. end
  75. end)
  76. else
  77. end
  78. end
  79. function ProdictManager.FinishRegister(A0_21, A1_22)
  80. inputstr = A1_22
  81. sep = ":"
  82. if sep == nil then
  83. sep = "%s"
  84. end
  85. t = {}
  86. i = 1
  87. for _FORV_5_ in string.gmatch(inputstr, "([^" .. sep .. "]+)") do
  88. t[i] = _FORV_5_
  89. i = i + 1
  90. end
  91. if t and #t >= 1 and t[1] then
  92. if t[1] == "Succes" then
  93. print("<font color='#AAFF00'>" .. A1_22 .. "</font>")
  94. A0_21.allies = true
  95. A0_21.status = 1
  96. elseif t[1] == "Error" then
  97. print("<font color='#FF0000'>" .. A1_22 .. "</font>")
  98. elseif t[1] == "Vip User" then
  99. print("<font color='#AAFF00'>" .. A1_22 .. "</font>")
  100. end
  101. end
  102. end
  103. function ProdictManager.GetInstance()
  104. local L0_23
  105. L0_23 = ProdictManager
  106. L0_23 = L0_23.instance
  107. if L0_23 == "" then
  108. L0_23 = ProdictManager
  109. L0_23.instance = ProdictManager()
  110. end
  111. L0_23 = ProdictManager
  112. L0_23 = L0_23.instance
  113. return L0_23
  114. end
  115. function ProdictManager.GetTarget(A0_24)
  116. if not ProdictManager.GetInstance().heroes[A0_24] then
  117. ProdictManager.GetInstance().heroes[A0_24] = {
  118. dash = {},
  119. pull = {},
  120. root = {},
  121. vision = 0
  122. }
  123. end
  124. return ProdictManager.GetInstance().heroes[A0_24]
  125. end
  126. function ProdictManager.OnTick(A0_25)
  127. local L1_26, L2_27, L3_28, L4_29, L5_30, L6_31, L7_32, L8_33, L9_34
  128. if not L1_26 then
  129. return L1_26
  130. end
  131. for L4_29, L5_30 in L1_26(L2_27) do
  132. for L9_34, _FORV_10_ in L6_31(L7_32) do
  133. if _FORV_10_ <= GetGameTimer() then
  134. table.remove(L5_30.dash, L9_34)
  135. end
  136. end
  137. end
  138. end
  139. function ProdictManager.OnDash(A0_35, A1_36, A2_37)
  140. if not A0_35.allies then
  141. return false
  142. end
  143. if A1_36 and A0_35.heroes[A1_36.networkID] then
  144. table.insert(A0_35.heroes[A1_36.networkID].dash, A2_37.endT)
  145. end
  146. end
  147. function ProdictManager.OnLoseVision(A0_38, A1_39)
  148. local L2_40, L3_41
  149. if A1_39 then
  150. L2_40 = A0_38.heroes
  151. L3_41 = A1_39.networkID
  152. L2_40 = L2_40[L3_41]
  153. if L2_40 then
  154. L2_40 = A0_38.heroes
  155. L3_41 = A1_39.networkID
  156. L2_40 = L2_40[L3_41]
  157. L2_40.vision = 20000
  158. end
  159. end
  160. end
  161. function ProdictManager.OnGainVision(A0_42, A1_43)
  162. local L2_44
  163. if A1_43 then
  164. L2_44 = A0_42.heroes
  165. L2_44 = L2_44[A1_43.networkID]
  166. if L2_44 then
  167. L2_44 = A0_42.heroes
  168. L2_44 = L2_44[A1_43.networkID]
  169. L2_44.vision = GetGameTimer()
  170. end
  171. end
  172. end
  173. function ProdictManager.OnGainBuff(A0_45, A1_46, A2_47)
  174. local L3_48, L4_49, L5_50
  175. L3_48 = A0_45.allies
  176. if not L3_48 then
  177. L3_48 = false
  178. return L3_48
  179. end
  180. if A1_46 then
  181. L3_48 = A0_45.heroes
  182. L4_49 = A1_46.networkID
  183. L3_48 = L3_48[L4_49]
  184. if L3_48 then
  185. L3_48 = A2_47.type
  186. L4_49 = BUFF_STUN
  187. if L3_48 ~= L4_49 then
  188. L3_48 = A2_47.type
  189. L4_49 = BUFF_ROOT
  190. if L3_48 ~= L4_49 then
  191. L3_48 = A2_47.type
  192. L4_49 = BUFF_KNOCKUP
  193. if L3_48 ~= L4_49 then
  194. L3_48 = A2_47.type
  195. L4_49 = BUFF_SUPPRESS
  196. if L3_48 ~= L4_49 then
  197. L3_48 = A2_47.name
  198. if L3_48 ~= "zhonyasringshield" then
  199. L3_48 = A2_47.name
  200. end
  201. end
  202. end
  203. end
  204. else
  205. if L3_48 == "lissandrarself" then
  206. L3_48 = A0_45.heroes
  207. L4_49 = A1_46.networkID
  208. L3_48 = L3_48[L4_49]
  209. L3_48 = L3_48.root
  210. L4_49 = A2_47.slot
  211. L5_50 = A2_47.endT
  212. L3_48[L4_49] = L5_50
  213. end
  214. else
  215. L3_48 = A2_47.type
  216. L4_49 = BUFF_KNOCKBACK
  217. if L3_48 == L4_49 then
  218. L3_48 = A0_45.heroes
  219. L4_49 = A1_46.networkID
  220. L3_48 = L3_48[L4_49]
  221. L3_48 = L3_48.pull
  222. L4_49 = A2_47.slot
  223. L5_50 = A2_47.endT
  224. L3_48[L4_49] = L5_50
  225. end
  226. end
  227. end
  228. end
  229. end
  230. function ProdictManager.OnUpdateBuff(A0_51, A1_52, A2_53)
  231. local L3_54, L4_55, L5_56
  232. L3_54 = A0_51.allies
  233. if not L3_54 then
  234. L3_54 = false
  235. return L3_54
  236. end
  237. if A1_52 then
  238. L3_54 = A0_51.heroes
  239. L4_55 = A1_52.networkID
  240. L3_54 = L3_54[L4_55]
  241. if L3_54 then
  242. L3_54 = A0_51.heroes
  243. L4_55 = A1_52.networkID
  244. L3_54 = L3_54[L4_55]
  245. L3_54 = L3_54.root
  246. L4_55 = A2_53.slot
  247. L3_54 = L3_54[L4_55]
  248. if L3_54 ~= nil then
  249. L3_54 = A0_51.heroes
  250. L4_55 = A1_52.networkID
  251. L3_54 = L3_54[L4_55]
  252. L3_54 = L3_54.root
  253. L4_55 = A2_53.slot
  254. L5_56 = A2_53.endT
  255. L3_54[L4_55] = L5_56
  256. else
  257. L3_54 = A0_51.heroes
  258. L4_55 = A1_52.networkID
  259. L3_54 = L3_54[L4_55]
  260. L3_54 = L3_54.pull
  261. L4_55 = A2_53.slot
  262. L3_54 = L3_54[L4_55]
  263. if L3_54 ~= nil then
  264. L3_54 = A0_51.heroes
  265. L4_55 = A1_52.networkID
  266. L3_54 = L3_54[L4_55]
  267. L3_54 = L3_54.pull
  268. L4_55 = A2_53.slot
  269. L5_56 = A2_53.endT
  270. L3_54[L4_55] = L5_56
  271. end
  272. end
  273. end
  274. end
  275. end
  276. function ProdictManager.OnLoseBuff(A0_57, A1_58, A2_59)
  277. local L3_60, L4_61
  278. L3_60 = A0_57.allies
  279. if not L3_60 then
  280. L3_60 = false
  281. return L3_60
  282. end
  283. if A1_58 then
  284. L3_60 = A0_57.heroes
  285. L4_61 = A1_58.networkID
  286. L3_60 = L3_60[L4_61]
  287. if L3_60 then
  288. L3_60 = A0_57.heroes
  289. L4_61 = A1_58.networkID
  290. L3_60 = L3_60[L4_61]
  291. L3_60 = L3_60.root
  292. L4_61 = A2_59.slot
  293. L3_60[L4_61] = nil
  294. L3_60 = A0_57.heroes
  295. L4_61 = A1_58.networkID
  296. L3_60 = L3_60[L4_61]
  297. L3_60 = L3_60.pull
  298. L4_61 = A2_59.slot
  299. L3_60[L4_61] = nil
  300. end
  301. end
  302. end
  303. function ProdictManager.AddProdictionObject(A0_62, A1_63, A2_64, A3_65, A4_66, A5_67, A6_68, A7_69, A8_70)
  304. local L9_71
  305. L9_71 = Prodict
  306. L9_71 = L9_71(A1_63, A2_64, A3_65, A4_66, A5_67, A6_68, A7_69, A8_70)
  307. table.insert(A0_62.spells, L9_71)
  308. return L9_71
  309. end
  310. class("Prodict")
  311. function Prodict.__init(A0_72, A1_73, A2_74, A3_75, A4_76, A5_77, A6_78, A7_79, A8_80)
  312. local L9_81, L10_82
  313. L9_81 = {}
  314. L9_81.Name = A1_73
  315. L10_82 = fromPos
  316. L10_82 = L10_82 or myHero
  317. L9_81.Source = L10_82
  318. if A2_74 then
  319. L10_82 = A2_74 ^ 2
  320. else
  321. L10_82 = L10_82 or 20000
  322. end
  323. L9_81.RangeSqr = L10_82
  324. L10_82 = A3_75 or 20000
  325. L9_81.Speed = L10_82
  326. L10_82 = A4_76 or 0
  327. L9_81.Delay = L10_82
  328. L9_81.Width = A5_77
  329. A0_72.Spell = L9_81
  330. L9_81 = {}
  331. A0_72.enemys = L9_81
  332. A0_72.enable = true
  333. L9_81 = A8_80 or true
  334. A0_72.offAfterCast = L9_81
  335. A0_72.callback = A7_79
  336. end
  337. function Prodict.EnableTarget(A0_83, A1_84, A2_85, A3_86)
  338. A2_85 = A2_85 or true
  339. A0_83.Spell.Source = A3_86 or myHero
  340. if A0_83.enemys[A1_84.networkID] == nil then
  341. A0_83.enemys[A1_84.networkID] = TProdiction(A1_84, A2_85, A0_83)
  342. else
  343. A0_83.enemys[A1_84.networkID]:Enable(A2_85)
  344. end
  345. end
  346. function Prodict.CanNotMissMode(A0_87, A1_88, A2_89)
  347. if A2_89 == nil then
  348. for _FORV_6_, _FORV_7_ in pairs(A0_87.enemys) do
  349. A0_87.enemys[_FORV_7_.networkID]:CanNotMissMode(A1_88)
  350. end
  351. else
  352. if A0_87.enemys[A2_89.networkID] == nil then
  353. A0_87.enemys[A2_89.networkID] = TProdiction(A2_89, false, A0_87)
  354. end
  355. A0_87.enemys[A2_89.networkID]:CanNotMissMode(A1_88)
  356. end
  357. end
  358. function Prodict.GetPrediction(A0_90, A1_91, A2_92)
  359. local L3_93, L4_94, L5_95, L6_96, L7_97, L8_98, L9_99
  360. if A2_92 then
  361. L3_93 = A0_90.Spell
  362. L3_93 = L3_93.Speed
  363. L3_93 = L3_93 * A2_92
  364. elseif not L3_93 then
  365. L3_93 = A0_90.Spell
  366. L3_93 = L3_93.Speed
  367. end
  368. if A2_92 then
  369. L4_94 = A2_92 - 1
  370. L4_94 = L4_94 / 3
  371. L4_94 = L4_94 + 1
  372. else
  373. L4_94 = L4_94 or 1
  374. end
  375. if L4_94 then
  376. L5_95 = A0_90.Spell
  377. L5_95 = L5_95.Delay
  378. L5_95 = L5_95 / L4_94
  379. elseif not L5_95 then
  380. L5_95 = A0_90.Spell
  381. L5_95 = L5_95.Delay
  382. end
  383. L6_96 = ProdictManager
  384. L6_96 = L6_96.GetInstance
  385. L6_96 = L6_96()
  386. L6_96 = L6_96.WayPointManager
  387. L7_97 = L6_96
  388. L6_96 = L6_96.GetSimulatedWayPoints
  389. L8_98 = A1_91
  390. L9_99 = GetLatency
  391. L9_99 = L9_99()
  392. L9_99 = L9_99 / 2
  393. L9_99 = L9_99 / 1000
  394. L9_99 = L5_95 + L9_99
  395. L6_96 = L6_96(L7_97, L8_98, L9_99)
  396. L7_97, L8_98 = nil, nil
  397. L9_99 = assert
  398. L9_99(L3_93 > 0 and L5_95 >= 0, "TargetPredictionVIP:GetPrediction : SpellDelay must be >=0 and SpellSpeed must be >0")
  399. L9_99 = #L6_96
  400. if L9_99 == 1 or L3_93 == 20000 then
  401. L9_99 = {}
  402. L9_99.x = L6_96[1].x
  403. L9_99.y = A1_91.y
  404. L9_99.z = L6_96[1].y
  405. L7_97 = L9_99
  406. L9_99 = GetDistance
  407. L9_99 = L9_99(L6_96[1], A0_90.Spell.Source)
  408. L8_98 = L9_99 / L3_93
  409. else
  410. L9_99 = 0
  411. for _FORV_13_ = 1, #L6_96 - 1 do
  412. if L9_99 <= ((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) - math.sqrt((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (L3_93 * L3_93 - 1) + A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + 2 * ((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))) * ((A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))) + (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (L3_93 * L3_93 - A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))))) / (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) - L3_93 * L3_93) and L9_99 + GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) / A1_91.ms >= ((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) - math.sqrt((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (L3_93 * L3_93 - 1) + A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + 2 * ((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))) * ((A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))) + (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (L3_93 * L3_93 - A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))))) / (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) - L3_93 * L3_93) then
  413. L8_98, L7_97 = ((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) - math.sqrt((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (L3_93 * L3_93 - 1) + A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + 2 * ((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))) * ((A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))) + (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (L3_93 * L3_93 - A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))))) / (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) - L3_93 * L3_93), {
  414. x = L6_96[_FORV_13_].x + ((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) - math.sqrt((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (L3_93 * L3_93 - 1) + A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + 2 * ((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))) * ((A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))) + (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (L3_93 * L3_93 - A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))))) / (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) - L3_93 * L3_93) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])),
  415. y = A1_91.y,
  416. z = L6_96[_FORV_13_].y + ((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) - math.sqrt((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (L3_93 * L3_93 - 1) + A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + 2 * ((A0_90.Spell.Source.z - L6_96[_FORV_13_].y) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))) * ((A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))) + (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (A0_90.Spell.Source.x - L6_96[_FORV_13_].x) * (L3_93 * L3_93 - A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))))) / (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) + A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) * (A1_91.ms * (L6_96[_FORV_13_ + 1].x - L6_96[_FORV_13_].x) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1])) - L3_93 * L3_93) * (A1_91.ms * (L6_96[_FORV_13_ + 1].y - L6_96[_FORV_13_].y) / GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]))
  417. }
  418. break
  419. end
  420. if _FORV_13_ == #L6_96 - 1 then
  421. L8_98, L7_97 = L9_99 + GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) / A1_91.ms, {
  422. x = L6_96[_FORV_13_ + 1].x,
  423. y = A1_91.y,
  424. z = L6_96[_FORV_13_ + 1].y
  425. }
  426. end
  427. L9_99 = L9_99 + GetDistance(L6_96[_FORV_13_], L6_96[_FORV_13_ + 1]) / A1_91.ms
  428. end
  429. end
  430. if L7_97 then
  431. L9_99 = A0_90.Spell
  432. L9_99 = L9_99.RangeSqr
  433. if L9_99 >= GetDistanceSqr(L7_97, A0_90.Spell.Source) then
  434. L9_99 = L7_97
  435. return L9_99, L8_98
  436. end
  437. end
  438. end
  439. class("TProdiction")
  440. function TProdiction.__init(A0_100, A1_101, A2_102, A3_103)
  441. A0_100.target = A1_101
  442. A0_100.enable = A2_102
  443. A0_100.enableTime = GetGameTimer()
  444. A0_100.prodict = A3_103
  445. A0_100.canNotMiss = false
  446. AdvancedCallback:bind("OnDash", function(A0_104, A1_105)
  447. A0_100:OnDash(A0_104, A1_105)
  448. end)
  449. AdvancedCallback:bind("OnGainBuff", function(A0_106, A1_107)
  450. A0_100:OnGainBuff(A0_106, A1_107)
  451. end)
  452. AddTickCallback(function()
  453. A0_100:OnTick()
  454. end)
  455. AddRecvPacketCallback(function(A0_108)
  456. A0_100:OnRecvPacket(A0_108)
  457. end)
  458. end
  459. function TProdiction.CanNotMissMode(A0_109, A1_110)
  460. A0_109.canNotMiss = A1_110
  461. end
  462. function TProdiction.Enable(A0_111, A1_112)
  463. A0_111.enable = A1_112
  464. A0_111.enableTime = GetGameTimer()
  465. end
  466. function TProdiction.OnDash(A0_113, A1_114, A2_115)
  467. if not ProdictManager.GetInstance().allies then
  468. return false
  469. end
  470. if not A0_113.canNotMiss and not A0_113.enable then
  471. return
  472. end
  473. if A1_114.networkID == A0_113.target.networkID then
  474. distance = GetDistance(A2_115.endPos, A0_113.prodict.Spell.Source)
  475. if distance * distance <= A0_113.prodict.Spell.RangeSqr then
  476. duration = distance / A0_113.prodict.Spell.Speed
  477. if A0_113.prodict.Spell.Delay + duration - 0.45 < A2_115.duration then
  478. wait = A2_115.duration - (duration + A0_113.prodict.Spell.Delay)
  479. if wait <= 0 then
  480. A0_113.prodict.callback(A0_113.target, A2_115.endPos, A0_113.prodict.Spell)
  481. else
  482. DelayAction(function(A0_116)
  483. A0_113.prodict.callback(A0_113.target, A0_116, A0_113.prodict.Spell)
  484. end, wait, {
  485. A2_115.endPos
  486. })
  487. end
  488. end
  489. end
  490. end
  491. end
  492. function TProdiction.OnGainBuff(A0_117, A1_118, A2_119)
  493. if not ProdictManager.GetInstance().allies then
  494. return false
  495. end
  496. if not A0_117.canNotMiss and not A0_117.enable then
  497. return
  498. end
  499. if A1_118 and A1_118.networkID == A0_117.target.networkID and (A2_119.name == "zhonyasringshield" or A2_119.name == "lissandrarself" or A2_119.type == BUFF_STUN or A2_119.type == BUFF_ROOT or A2_119.type == BUFF_KNOCKUP or A2_119.type == BUFF_SUPPRESS) then
  500. distance = GetDistance(A1_118, A0_117.prodict.Spell.Source)
  501. if distance * distance <= A0_117.prodict.Spell.RangeSqr then
  502. duration = distance / A0_117.prodict.Spell.Speed
  503. if A0_117.prodict.Spell.Delay + duration - 0.45 < A2_119.duration then
  504. wait = A2_119.duration - (duration + A0_117.prodict.Spell.Delay)
  505. if wait <= 0 then
  506. A0_117.prodict.callback(A0_117.target, A1_118, A0_117.prodict.Spell)
  507. else
  508. DelayAction(function(A0_120)
  509. A0_117.prodict.callback(A0_117.target, A0_120, A0_117.prodict.Spell)
  510. end, wait, {A1_118})
  511. end
  512. end
  513. end
  514. end
  515. end
  516. function TProdiction.OnRecvPacket(A0_121, A1_122)
  517. local L2_123, L3_124, L4_125, L5_126, L6_127, L7_128
  518. L2_123 = A0_121.enable
  519. if not L2_123 then
  520. return
  521. end
  522. L2_123 = A1_122.header
  523. if L2_123 == L3_124 then
  524. L2_123 = Packet
  525. L2_123 = L2_123(L3_124)
  526. if L3_124 == L4_125 then
  527. L6_127 = L2_123
  528. L7_128 = "wayPoints"
  529. L7_128 = L5_126(L6_127, L7_128)
  530. L3_124(L4_125, L5_126, L6_127, L7_128, L5_126(L6_127, L7_128))
  531. end
  532. else
  533. L2_123 = A1_122.header
  534. if L2_123 == L3_124 then
  535. L2_123 = Packet
  536. L2_123 = L2_123(L3_124)
  537. L6_127 = "wayPoints"
  538. L7_128 = L4_125(L5_126, L6_127)
  539. for L6_127, L7_128 in L3_124(L4_125, L5_126, L6_127, L7_128, L4_125(L5_126, L6_127)) do
  540. if L6_127 == A0_121.target.networkID then
  541. A0_121:OnNewWayPoints(L7_128)
  542. end
  543. end
  544. end
  545. end
  546. end
  547. function TProdiction.OnNewWayPoints(A0_129, A1_130)
  548. local L2_131, L3_132, L4_133, L5_134
  549. L2_131 = A0_129.prodict
  550. L2_131 = L2_131.Spell
  551. L2_131 = L2_131.Source
  552. if L2_131 ~= nil then
  553. L2_131 = ProdictManager
  554. L2_131 = L2_131.GetInstance
  555. L2_131 = L2_131()
  556. L2_131 = L2_131.WayPointManager
  557. L3_132 = L2_131
  558. L2_131 = L2_131.GetWayPointChangeRate
  559. L4_133 = A0_129.target
  560. L5_134 = 1
  561. L2_131 = L2_131(L3_132, L4_133, L5_134)
  562. L3_132 = ProdictManager
  563. L3_132 = L3_132.GetInstance
  564. L3_132 = L3_132()
  565. L3_132 = L3_132.WayPointManager
  566. L4_133 = L3_132
  567. L3_132 = L3_132.GetWayPoints
  568. L5_134 = A0_129.target
  569. L3_132 = L3_132(L4_133, L5_134)
  570. if L2_131 ~= 1 or L2_131 ~= 2 then
  571. L4_133 = L2_131 - 2
  572. if L4_133 < 0 then
  573. L2_131 = 0
  574. end
  575. L4_133 = L2_131 * 0.25
  576. L4_133 = 1 + L4_133
  577. L5_134 = #L3_132
  578. if L5_134 > 1 then
  579. L5_134 = GetDistance
  580. L5_134 = L5_134(L3_132[#L3_132], A0_129.target)
  581. if L5_134 < 300 then
  582. L5_134 = 0
  583. if 0 < L2_131 - 4 then
  584. L5_134 = L2_131 - 4
  585. end
  586. L4_133 = L4_133 + L5_134
  587. end
  588. end
  589. L5_134 = A0_129.prodict
  590. L5_134 = L5_134.GetPrediction
  591. L5_134 = L5_134(L5_134, A0_129.target, L4_133)
  592. if L5_134 ~= nil and not IsWall(D3DXVECTOR3(L5_134.x, A0_129.target.y, L5_134.z)) and A0_129:IsValid() and A0_129.enable and A0_129.prodict.enable then
  593. A0_129.prodict.callback(A0_129.target, L5_134, A0_129.prodict.Spell)
  594. if A0_129.prodict.offAfterCast then
  595. A0_129.enable = false
  596. end
  597. end
  598. end
  599. end
  600. end
  601. function TProdiction.IsValid(A0_135)
  602. if A0_135.target and A0_135.target.valid and A0_135.target.visible and A0_135.target.bInvulnerable == 0 and A0_135.target.bTargetable and A0_135.target.type == myHero.type and GetGameTimer() - ProdictManager.GetTarget(A0_135.target.networkID).vision > 0.125 then
  603. for _FORV_5_, _FORV_6_ in pairs(ProdictManager.GetTarget(A0_135.target.networkID).pull) do
  604. return false
  605. end
  606. for _FORV_5_, _FORV_6_ in pairs(ProdictManager.GetTarget(A0_135.target.networkID).dash) do
  607. return false
  608. end
  609. return true
  610. else
  611. return false
  612. end
  613. end
  614. function TProdiction.OnTick(A0_136)
  615. if A0_136.enable and A0_136:IsValid() then
  616. for _FORV_5_, _FORV_6_ in pairs(ProdictManager.GetTarget(A0_136.target.networkID).root) do
  617. if _FORV_6_ > GetGameTimer() + GetDistance(A0_136.target, A0_136.prodict.Spell.Source) / A0_136.prodict.Spell.Speed and GetDistanceSqr(A0_136.target, A0_136.prodict.Spell.Source) <= A0_136.prodict.Spell.RangeSqr and A0_136.enable and A0_136.prodict.enable then
  618. A0_136.prodict.callback(A0_136.target, A0_136.target, A0_136.prodict.Spell)
  619. if A0_136.prodict.offAfterCast then
  620. A0_136.enable = false
  621. end
  622. end
  623. end
  624. if #ProdictManager.GetInstance().WayPointManager:GetWayPoints(A0_136.target) <= 1 and A0_136.enable and A0_136.prodict.enable then
  625. A0_136.prodict.callback(A0_136.target, A0_136.target, A0_136.prodict.Spell)
  626. end
  627. end
  628. if A0_136.enableTime + 0.3 < GetGameTimer() then
  629. A0_136.enable = false
  630. end
  631. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement