Advertisement
Cloudhax23

Untitled

Aug 13th, 2015
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.50 KB | None | 0 0
  1. local _b = 2
  2. if GetMyHero().charName ~= "Gangplank" then
  3. return
  4. end
  5. require("HPrediction")
  6. require("VPrediction")
  7. local ab, bb, cb, db
  8. local _c = 630
  9. ab = TargetSelector(TARGET_LOW_HP_PRIORITY, _c)
  10. bb = TargetSelector(TARGET_LOW_HP_PRIORITY, 1400)
  11. db = TargetSelector(TARGET_LOW_HP_PRIORITY, 100000000)
  12. cb = TargetSelector(TARGET_LOW_HP_PRIORITY, 300)
  13. COLOR_WHITE, COLOR_GREEN, COLOR_RED, COLOR_YELLOW, COLOR_TRANS_WHITE = ARGB(255, 255, 255, 255), ARGB(255, 0, 255, 0), ARGB(255, 255, 0, 0), ARGB(255, 255, 255, 0), ARGB(170, 255, 255, 255)
  14. COLOR_TRANS_GREEN, COLOR_TRANS_RED, COLOR_TRANS_YELLOW = ARGB(150, 0, 255, 0), ARGB(150, 255, 0, 0), ARGB(150, 255, 255, 0)
  15. Recalling = false
  16. local ac = {
  17. [5] = true,
  18. [8] = true,
  19. [11] = true,
  20. [21] = true,
  21. [22] = true,
  22. [24] = true,
  23. [25] = true,
  24. [28] = true
  25. }
  26. local bc = {
  27. [10] = true
  28. }
  29. local cc = {
  30. [7] = true
  31. }
  32. function OnLoad()
  33. local dc = tonumber(GetWebResult("raw.github.com", "/barasia283/Main/master/Captain%20Gameplank.rev"))
  34. HPred = HPrediction()
  35. VP = VPrediction()
  36. HP_E = HPSkillshot({
  37. type = "DelayCircle",
  38. delay = 1,
  39. range = 1345,
  40. radius = 345,
  41. speed = 1200
  42. })
  43. HP_R = HPSkillshot({
  44. type = "DelayCircle",
  45. delay = 3,
  46. range = 100000000,
  47. radius = 150,
  48. speed = 0
  49. })
  50. enemyTable = GetEnemyHeroes()
  51. if 0 < #enemyTable then
  52. if #enemyTable == 1 then
  53. menucharsettinge = {"c1"}
  54. elseif #enemyTable == 2 then
  55. menucharsettinge = {"c1", "c2"}
  56. elseif #enemyTable == 3 then
  57. menucharsettinge = {
  58. "c1",
  59. "c2",
  60. "c3"
  61. }
  62. elseif #enemyTable == 4 then
  63. menucharsettinge = {
  64. "c1",
  65. "c2",
  66. "c3",
  67. "c4"
  68. }
  69. elseif #enemyTable == 5 then
  70. menucharsettinge = {
  71. "c1",
  72. "c2",
  73. "c3",
  74. "c4",
  75. "c5"
  76. }
  77. end
  78. else
  79. menucharsettinge = {}
  80. end
  81. menucc = {
  82. "hard",
  83. "slow",
  84. "silence"
  85. }
  86. menucolors = {
  87. "WHITE",
  88. "GREEN",
  89. "RED",
  90. "YELLOW",
  91. "BLUE",
  92. "CYAN",
  93. "MAGENTA"
  94. }
  95. menuexecutioner = {
  96. "1",
  97. "2",
  98. "3"
  99. }
  100. menucolorsval = {
  101. RGB(255, 255, 255),
  102. RGB(0, 255, 0),
  103. RGB(255, 0, 0),
  104. RGB(255, 255, 0),
  105. RGB(0, 0, 255),
  106. RGB(0, 255, 255),
  107. RGB(255, 0, 255)
  108. }
  109. barreltable = {}
  110. lastAttack, lastWindUpTime, lastAttackCD, qlastWindUpTime = 0, 0, 0, 0
  111. sheenbuff = false
  112. autoeflag = false
  113. lastsheenbuff = 0
  114. lastautoe = 0
  115. lastmove = 0
  116. automoveflag = false
  117. sheenbuffcheck = false
  118. frozenfistbuffcheck = false
  119. lichbanebuffcheck = false
  120. muramanabuffcheck = false
  121. Menu = scriptConfig("Captain Gameplank", "")
  122. Menu:addParam("trinityflag", "Have Trinity Force", SCRIPT_PARAM_ONOFF, false)
  123. Menu.trinityflag = false
  124. ab.name = "Q TS"
  125. Menu:addTS(ab)
  126. bb.name = "E TS"
  127. Menu:addTS(bb)
  128. Menu:addSubMenu("W Settings", "AutoW2")
  129. Menu.AutoW2:addParam("AutoW", "Auto W when Low HP", SCRIPT_PARAM_ONOFF, true)
  130. Menu.AutoW2:addParam("percenthp", "What % to W", SCRIPT_PARAM_SLICE, 20, 0, 100, 0)
  131. for _d, ad in pairs(menucharsettinge) do
  132. local bd = enemyTable[_d]
  133. Menu.AutoW2:addSubMenu("W CC from:" .. bd.charName, ad)
  134. for cd, dd in pairs(menucc) do
  135. Menu.AutoW2[ad]:addParam(dd, bd.charName .. "|AutoW|" .. dd, SCRIPT_PARAM_ONOFF, false)
  136. end
  137. end
  138. Menu:addSubMenu("Combo", "Combo")
  139. Menu.Combo:addDynamicParam("modeswitch", "Auto Combo", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  140. Menu.Combo:addDynamicParam("FarmQ", "Farm Q Minions", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("A"))
  141. Menu.Combo:addDynamicParam("CastE", "Cast Kegs", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("C"))
  142. Menu.Combo:addDynamicParam("HarasQ", "Harass Q", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("Z"))
  143. Menu.Combo:addDynamicParam("DBarrel", "Detonate Barrel", SCRIPT_PARAM_ONKEYDOWN, false, string.byte("X"))
  144. Menu:addSubMenu("KS Option", "KS")
  145. Menu.KS:addParam("AutoQ", "KS Q", SCRIPT_PARAM_ONOFF, true)
  146. Menu.KS:addParam("AutoR", "KS R", SCRIPT_PARAM_ONOFF, true)
  147. Menu:addSubMenu("Drawings", "Drawrange")
  148. Menu.Drawrange:addParam("Drawrange", "Draw Players Ranges", SCRIPT_PARAM_ONOFF, true)
  149. Menu.Drawrange:addParam("Drawrangecolor", "Players Ranges Color", SCRIPT_PARAM_LIST, 1, menucolors)
  150. Menu.Drawrange:addParam("Drawkeg", "Draw Kegs", SCRIPT_PARAM_ONOFF, true)
  151. Menu.Drawrange:addParam("Drawkegcolor", "Players Kegs Color", SCRIPT_PARAM_LIST, 2, menucolors)
  152. Menu.Drawrange:addParam("Drawkegcursor", "Draw Keg Cursor", SCRIPT_PARAM_ONOFF, true)
  153. Menu.Drawrange:addParam("Drawkegcursorcolor", "Keg Cursor Color", SCRIPT_PARAM_LIST, 3, menucolors)
  154. Menu.Drawrange:addParam("Drawpred", "Draw Predictions", SCRIPT_PARAM_ONOFF, true)
  155. Menu.Drawrange:addParam("Drawcalcm", "Draw Damage Calc Minions", SCRIPT_PARAM_ONOFF, true)
  156. Menu.Drawrange:addParam("Drawcalcc", "Draw Damage Calc Champ", SCRIPT_PARAM_ONOFF, true)
  157. Menu:addSubMenu("Masteries", "masteries")
  158. Menu.masteries:addParam("doSword", "Double-Edged Sword", SCRIPT_PARAM_ONOFF, false)
  159. Menu.masteries:addParam("butcher", "Butcher", SCRIPT_PARAM_ONOFF, false)
  160. Menu.masteries:addParam("havoc", "Havoc", SCRIPT_PARAM_ONOFF, false)
  161. Menu.masteries:addParam("executioner", "Executioner", SCRIPT_PARAM_ONOFF, false)
  162. Menu.masteries:addParam("executionerlevel", "Executioner Level", SCRIPT_PARAM_LIST, 1, menuexecutioner)
  163. Menu.Combo:permaShow("FarmQ")
  164. Menu.Combo:permaShow("HarasQ")
  165. Menu.Combo:permaShow("CastE")
  166. Menu.Combo:permaShow("DBarrel")
  167. Menu.Combo:permaShow("modeswitch")
  168. if dc > _b then
  169. PrintChat("<font color='#00FFFF'>>>Captain Gameplank V1." .. _b .. " by Barasia283</font>")
  170. PrintChat("<font color='#00FFFF'> There is a new update available: V1." .. dc .. " Please download from the thread.</font>")
  171. else
  172. PrintChat("<font color='#00FFFF'>>>Captain Gameplank V1." .. _b .. " by Barasia283</font>")
  173. end
  174. end
  175. function OnTick()
  176. updatebarrels()
  177. if os.clock() > lastsheenbuff + 1.5 and sheenbuffcheck == true then
  178. sheenbuff = true
  179. end
  180. if os.clock() > lastautoe + 2 then
  181. autoeflag = true
  182. end
  183. if os.clock() > lastmove + 0.2 then
  184. automoveflag = true
  185. end
  186. ab:update()
  187. bb:update()
  188. cb:update()
  189. db:update()
  190. if bb.target ~= nil then
  191. EPos, EHitChance = HPred:GetPredict(HP_E, bb.target, myHero)
  192. else
  193. EQPos = {
  194. x = 0,
  195. y = 0,
  196. z = 0
  197. }
  198. end
  199. AutoE()
  200. autodetonatebarrel()
  201. AutoW()
  202. AutoQ()
  203. AutoR()
  204. HarasQ()
  205. CastE()
  206. FarmQ()
  207. detonatebarrel()
  208. OrbWalk()
  209. end
  210. function CastE()
  211. if Menu.Combo.CastE and myHero:CanUseSpell(_E) == READY then
  212. local dc
  213. local _d = 200
  214. for bd, cd in ipairs(enemyTable) do
  215. local dd = castpredictbarrelto1enemy(cd)
  216. if _d > GetDistance(dd, mousePos) and dd ~= nil and cd.dead == false then
  217. _d = GetDistance(dd, mousePos)
  218. dc = dd
  219. end
  220. end
  221. if dc ~= nil and GetDistance(dc, player) < 1000 then
  222. CastSpell(_E, dc.x, dc.z)
  223. end
  224. local ad = getclosestbarreltomouse()
  225. if GetDistance(ad, player) < 1000 then
  226. myHero:MoveTo(ad.x, ad.z)
  227. end
  228. CastSpell(_E, ad.x, ad.z)
  229. end
  230. end
  231. function AutoE()
  232. if Menu.Combo.modeswitch and myHero:CanUseSpell(_E) == READY and bb.target ~= nil then
  233. local dc, _d, ad = getclosestbarreltotarget(bb.target)
  234. if dc ~= nil and _d == false and ad == true and autoeflag == true and GetDistance(dc, player) < 1000 then
  235. CastSpell(_E, dc.x, dc.z)
  236. lastautoe = os.clock()
  237. autoeflag = false
  238. end
  239. end
  240. end
  241. function detonatelinkedbarrel(dc, _d)
  242. local ad = dc
  243. if ad ~= nil then
  244. for bd, cd in ipairs(barreltable) do
  245. if cd == ad and #cd.link ~= 0 then
  246. for dd, __a in ipairs(cd.link) do
  247. for a_a, b_a in pairs(enemyTable) do
  248. if GetDistance(__a, b_a) < 345 and b_a.dead == false then
  249. return true
  250. end
  251. end
  252. end
  253. end
  254. end
  255. end
  256. end
  257. function autodetonatebarrel()
  258. if Menu.Combo.modeswitch then
  259. local dc = getclosest1hpbarreltome()
  260. for _d, ad in pairs(enemyTable) do
  261. if dc ~= nil and ad ~= nil and GetDistance(dc, ad) < 345 and ad.dead == false then
  262. if myHero:CanUseSpell(_Q) == READY then
  263. CastSpell(_Q, dc)
  264. end
  265. if GetDistance(dc) < 120 then
  266. myHero:Attack(dc)
  267. end
  268. elseif dc ~= nil and #dc.link ~= 0 and ad ~= nil and ad.dead == false then
  269. for bd, cd in ipairs(dc.link) do
  270. if GetDistance(cd, ad) < 345 or detonatelinkedbarrel(cd, dc) then
  271. if myHero:CanUseSpell(_Q) == READY then
  272. CastSpell(_Q, dc)
  273. end
  274. if GetDistance(dc) < 120 then
  275. myHero:Attack(dc)
  276. end
  277. end
  278. end
  279. end
  280. end
  281. end
  282. end
  283. function detonatebarrel()
  284. if Menu.Combo.DBarrel then
  285. local dc = getclosest1hpbarreltome()
  286. if dc ~= nil then
  287. if myHero:CanUseSpell(_Q) == READY then
  288. CastSpell(_Q, dc)
  289. end
  290. if GetDistance(dc) < 120 then
  291. myHero:Attack(dc)
  292. end
  293. end
  294. end
  295. end
  296. function AutoQ()
  297. if Menu.KS.AutoQ and myHero:CanUseSpell(_Q) == READY then
  298. for dc, _d in pairs(enemyTable) do
  299. local ad = getdamagemodchamps(_d)
  300. local bd = getDmg("Q", _d, GetMyHero()) + getDmg("AD", _d, GetMyHero()) + checkonhitdmg(_d, GetMyHero())
  301. bd = bd * ad
  302. if bd >= _d.health and ValidTarget(_d, 620) then
  303. CastSpell(_Q, _d)
  304. end
  305. end
  306. end
  307. end
  308. function AutoR()
  309. if Menu.KS.AutoR and TargetHaveBuff("GangplankRUpgrade2", player) == true and myHero:CanUseSpell(_R) == READY then
  310. for dc, _d in pairs(enemyTable) do
  311. if _d ~= nil then
  312. local ad = getdamagemodchamps(_d)
  313. local bd = player:GetSpellData(_R).level * 60 + 90 + player.ap * 0.3 + 2 * myHero:CalcMagicDamage(_d, player:GetSpellData(_R).level * 20 + 30 + player.ap * 0.1)
  314. bd = bd * ad
  315. if bd >= _d.health and _d.dead == false and _d.visible == true then
  316. local cd = castpredictrenemy(_d)
  317. CastSpell(_R, cd.x, cd.z)
  318. end
  319. end
  320. end
  321. end
  322. end
  323. function HarasQ()
  324. if Menu.Combo.HarasQ and myHero:CanUseSpell(_Q) == READY and ab.target ~= nil and ValidTarget(ab.target, 620) then
  325. CastSpell(_Q, ab.target)
  326. end
  327. end
  328. function AutoW()
  329. if Menu.AutoW2.AutoW and not Recalling and myHero:CanUseSpell(_W) == READY and myHero.health < myHero.maxHealth * (Menu.AutoW2.percenthp * 0.01) then
  330. CastSpell(_W)
  331. end
  332. end
  333. function FarmQ()
  334. if Menu.Combo.FarmQ and myHero:CanUseSpell(_Q) == READY then
  335. local dc = 1
  336. if Menu.masteries.doSword then
  337. dc = dc + 0.02
  338. end
  339. if Menu.masteries.havoc then
  340. dc = dc + 0.03
  341. end
  342. for _d, ad in pairs(minionManager(MINION_ENEMY, 620, player, MINION_SORT_HEALTH_ASC).objects) do
  343. local bd = getDmg("Q", ad, GetMyHero()) + getDmg("AD", ad, GetMyHero()) + 1 * checkonhitdmg(ad, GetMyHero())
  344. bd = math.floor(bd * dc)
  345. if Menu.masteries.butcher then
  346. bd = bd + 2
  347. end
  348. local cd = ad.health
  349. if bd >= cd and ad.name ~= "barrel" then
  350. CastSpell(_Q, ad)
  351. end
  352. end
  353. end
  354. end
  355. function OnCreateObj(dc)
  356. end
  357. function OnDeleteObj(dc)
  358. if GetDistance(GetMyHero(), dc) < 80 then
  359. end
  360. if (dc.name:find("enrage_buf.troy") or dc.name:find("bluehands_buf.troy") or dc.name:find("purplehands_buf.troy")) and GetDistance(GetMyHero(), dc) < 50 then
  361. sheenbuff = false
  362. lastsheenbuff = os.clock()
  363. end
  364. end
  365. function OnApplyBuff(dc, _d, ad)
  366. if _d == myHero and ad.name == "sheen" then
  367. sheenbuff = true
  368. sheenbuffcheck = true
  369. end
  370. if _d == myHero and ad.name == "itemfrozenfist" then
  371. sheenbuff = true
  372. sheenbuffcheck = true
  373. frozenfistbuffcheck = true
  374. end
  375. if _d == myHero and ad.name == "lichbane" then
  376. sheenbuff = true
  377. sheenbuffcheck = true
  378. lichbanebuffcheck = true
  379. end
  380. if _d == myHero and ad.name == "Muramana" then
  381. muramanabuffcheck = true
  382. end
  383. if _d == myHero then
  384. end
  385. if _d.name == "Barrel" and ad.name == "gangplankebarrelactive" and dc.isMe then
  386. local bd = _d
  387. bd.ctime = os.clock()
  388. bd.timeto1 = 0
  389. bd.link = {}
  390. bd.endtime = os.clock() + 60
  391. table.insert(barreltable, bd)
  392. end
  393. if _d.name == "Barrel" and ad.name == "gangplankebarrellink" then
  394. DelayAction(function()
  395. addbarrellink(dc, _d)
  396. end, 0.1)
  397. DelayAction(function()
  398. addbarrellink(_d, dc)
  399. end, 0.1)
  400. end
  401. if enemyTable[1] ~= nil and dc == enemyTable[1] and _d == myHero then
  402. for bd, cd in pairs(menucc) do
  403. if Menu.AutoW2.c1[cd] then
  404. if cd == "hard" and ac[ad.type] then
  405. CastSpell(_W)
  406. elseif cd == "slow" and bc[ad.type] then
  407. CastSpell(_W)
  408. elseif cd == "silence" and cc[ad.type] then
  409. CastSpell(_W)
  410. end
  411. end
  412. end
  413. end
  414. if enemyTable[2] ~= nil and dc == enemyTable[2] and _d == myHero then
  415. for bd, cd in pairs(menucc) do
  416. if Menu.AutoW2.c2[cd] then
  417. if cd == "hard" and ac[ad.type] then
  418. CastSpell(_W)
  419. elseif cd == "slow" and bc[ad.type] then
  420. CastSpell(_W)
  421. elseif cd == "silence" and cc[ad.type] then
  422. CastSpell(_W)
  423. end
  424. end
  425. end
  426. end
  427. if enemyTable[3] ~= nil and dc == enemyTable[3] and _d == myHero then
  428. for bd, cd in pairs(menucc) do
  429. if Menu.AutoW2.c3[cd] then
  430. if cd == "hard" and ac[ad.type] then
  431. CastSpell(_W)
  432. elseif cd == "slow" and bc[ad.type] then
  433. CastSpell(_W)
  434. elseif cd == "silence" and cc[ad.type] then
  435. CastSpell(_W)
  436. end
  437. end
  438. end
  439. end
  440. if enemyTable[4] ~= nil and dc == enemyTable[4] and _d == myHero then
  441. for bd, cd in pairs(menucc) do
  442. if Menu.AutoW2.c4[cd] then
  443. if cd == "hard" and ac[ad.type] then
  444. CastSpell(_W)
  445. elseif cd == "slow" and bc[ad.type] then
  446. CastSpell(_W)
  447. elseif cd == "silence" and cc[ad.type] then
  448. CastSpell(_W)
  449. end
  450. end
  451. end
  452. end
  453. if enemyTable[5] ~= nil and dc == enemyTable[5] and _d == myHero then
  454. for bd, cd in pairs(menucc) do
  455. if Menu.AutoW2.c5[cd] then
  456. if cd == "hard" and ac[ad.type] then
  457. CastSpell(_W)
  458. elseif cd == "slow" and bc[ad.type] then
  459. CastSpell(_W)
  460. elseif cd == "silence" and cc[ad.type] then
  461. CastSpell(_W)
  462. end
  463. end
  464. end
  465. end
  466. end
  467. function OnRemoveBuff(dc, _d)
  468. if dc == myHero and (_d.name == "sheen" or _d.name == "itemfrozenfist" or _d.name == "lichbane") then
  469. sheenbuff = false
  470. lastsheenbuff = os.clock()
  471. end
  472. if dc == myHero and _d.name == "Muramana" then
  473. muramanabuffcheck = false
  474. end
  475. end
  476. function addbarrellink(dc, _d)
  477. for ad, bd in pairs(barreltable) do
  478. if bd.networkID == _d.networkID then
  479. table.insert(bd.link, dc)
  480. end
  481. end
  482. end
  483. function updatebarrels()
  484. for dc, _d in ipairs(barreltable) do
  485. if _d.health == 0 then
  486. table.remove(barreltable, dc)
  487. dc = dc - 1
  488. elseif _d.health > 0 then
  489. local ad = 0
  490. if player.level < 7 then
  491. ad = 2
  492. elseif player.level < 13 and player.level >= 7 then
  493. ad = 1
  494. elseif player.level >= 13 then
  495. ad = 0.5
  496. end
  497. local bd = _d.ctime + 2 * ad - os.clock()
  498. local cd = math.max(math.ceil(bd / ad + 1), 1)
  499. if cd > _d.health then
  500. bd = bd - ad
  501. _d.timeto1 = bd
  502. else
  503. _d.timeto1 = bd
  504. end
  505. end
  506. end
  507. end
  508. function getclosestbarreltomouse()
  509. local dc = mousePos
  510. local _d = 1000
  511. for ad, bd in ipairs(barreltable) do
  512. if _d > GetDistance(bd, mousePos) and GetDistance(bd, mousePos) > 345 and bd ~= nil then
  513. _d = GetDistance(bd, mousePos)
  514. local cd = Vector(bd.x, bd.y, bd.z)
  515. local dd = Vector(mousePos.x, mousePos.y, mousePos.z)
  516. local __a = (dd - cd):normalized()
  517. local a_a = cd + __a * 685
  518. dc = a_a
  519. end
  520. end
  521. return dc
  522. end
  523. function getclosestbarreltotarget(dc)
  524. local _d = dc
  525. local ad, bd
  526. if EPos ~= nil and EHitChance >= 0 then
  527. ad = EPos
  528. else
  529. ad = dc
  530. end
  531. local cd = false
  532. local dd = false
  533. local __a = 1035
  534. for a_a, b_a in ipairs(barreltable) do
  535. if GetDistance(b_a, ad) < 345 then
  536. cd = true
  537. end
  538. if __a > GetDistance(b_a, ad) and GetDistance(b_a, ad) > 345 and b_a ~= nil and cd == false then
  539. if b_a.timeto1 < qlastWindUpTime + GetDistance(b_a, player) / 2500 + 0.5 and GetDistance(b_a, player) < 650 and GetDistance(b_a, player) > 125 and myHero:CanUseSpell(_Q) == READY then
  540. __a = GetDistance(b_a, ad)
  541. bd = b_a
  542. dd = true
  543. elseif b_a.timeto1 < lastWindUpTime + 0.5 and GetDistance(b_a, player) < 120 then
  544. __a = GetDistance(b_a, ad)
  545. bd = b_a
  546. dd = true
  547. end
  548. end
  549. end
  550. if bd ~= nil then
  551. local a_a = 0
  552. if __a > 345 and __a < 685 then
  553. a_a = math.max(__a, 500)
  554. elseif __a > 685 then
  555. a_a = 685
  556. end
  557. local b_a = Vector(bd.x, bd.y, bd.z)
  558. local c_a = Vector(ad.x, ad.y, ad.z)
  559. local d_a = (c_a - b_a):normalized()
  560. local _aa = b_a + d_a * a_a
  561. _d = _aa
  562. end
  563. return _d, cd, dd
  564. end
  565. function getclosest1hpbarreltome()
  566. local dc
  567. local _d = 650
  568. for ad, bd in ipairs(barreltable) do
  569. if _d > GetDistance(bd, player) and bd ~= nil then
  570. if bd.timeto1 < qlastWindUpTime + GetDistance(bd, player) / 2500 and _d > GetDistance(bd, player) and GetDistance(bd, player) > 125 then
  571. _d = GetDistance(bd, player)
  572. dc = bd
  573. elseif bd.timeto1 < lastAttackCD and GetDistance(bd, player) < 125 then
  574. _d = GetDistance(bd, player)
  575. dc = bd
  576. end
  577. end
  578. end
  579. return dc
  580. end
  581. function drawpredictbarrelto1enemy(dc)
  582. local _d = 0
  583. if player.level < 7 then
  584. _d = 4.3
  585. elseif player.level < 13 and player.level >= 7 then
  586. _d = 2.3
  587. elseif player.level >= 13 then
  588. _d = 1.3
  589. end
  590. local ad, bd, cd = VP:GetCircularCastPosition(dc, _d, 10, 1345)
  591. DrawLine3D(dc.x, dc.y, dc.z, ad.x, ad.y, ad.z, 1, COLOR_RED, true)
  592. DrawCircle3D(ad.x, ad.y, ad.z, 20, 1, COLOR_YELLOW)
  593. end
  594. function castpredictbarrelto1enemy(dc)
  595. local _d = 0
  596. if player.level < 7 then
  597. _d = 4.5
  598. elseif player.level < 13 and player.level >= 7 then
  599. _d = 2.5
  600. elseif player.level >= 13 then
  601. _d = 1.5
  602. end
  603. local ad, bd, cd = VP:GetCircularCastPosition(dc, _d, 10, 1345)
  604. return ad
  605. end
  606. function castpredictrenemy(dc)
  607. local _d, ad, bd = VP:GetCircularCastPosition(dc, 1.2, 200, 100000000)
  608. return _d
  609. end
  610. function drawpredictrenemy(dc)
  611. local _d = castpredictrenemy(dc)
  612. DrawLine3D(dc.x, dc.y, dc.z, _d.x, _d.y, _d.z, 1, COLOR_RED, true)
  613. DrawCircle3D(_d.x, _d.y, _d.z, 20, 1, COLOR_RED)
  614. end
  615. function OnProcessSpell(dc, _d)
  616. local ad = _d.name
  617. local bd = _d.startPos
  618. local cd = _d.endPos
  619. if _d.name:lower():find("gangplankqproceed") and dc.isMe then
  620. qlastWindUpTime = _d.windUpTime
  621. end
  622. if _d.name:lower():find("attack") and dc.isMe then
  623. lastAttack = os.clock()
  624. lastWindUpTime = _d.windUpTime
  625. lastAttackCD = _d.animationTime
  626. end
  627. end
  628. function customCalcDamage(dc, _d, ad, bd, cd)
  629. local dd = cd
  630. local __a = dc.armorPen or 0
  631. local a_a = dc.armorPenPercent or 0
  632. local b_a = 0
  633. local c_a = 0
  634. local d_a = 0
  635. c_a = dd - ad
  636. if c_a > 0 then
  637. d_a = c_a * (1 - bd) * (1 - a_a) - __a
  638. if d_a < 0 then
  639. d_a = 0
  640. end
  641. else
  642. d_a = c_a
  643. end
  644. if d_a > 0 then
  645. b_a = _d * (100 / (100 + d_a))
  646. else
  647. b_a = _d * (2 - 100 / (100 - d_a))
  648. end
  649. return b_a
  650. end
  651. function OnDraw()
  652. if Menu.Drawrange.Drawrange then
  653. DrawCircle3D(myHero.x, myHero.y, myHero.z, 620, 1, menucolorsval[Menu.Drawrange.Drawrangecolor])
  654. DrawCircle3D(myHero.x, myHero.y, myHero.z, 1000, 1, menucolorsval[Menu.Drawrange.Drawrangecolor])
  655. end
  656. if Menu.Drawrange.Drawkegcursor then
  657. local dc = getclosestbarreltomouse()
  658. if dc ~= nil then
  659. DrawCircle3D(dc.x, dc.y, dc.z, 345, 1, menucolorsval[Menu.Drawrange.Drawkegcursorcolor])
  660. end
  661. end
  662. if Menu.Drawrange.Drawpred then
  663. if ValidTarget(bb.target, 1345) and EPos ~= nil then
  664. DrawLine3D(bb.target.x, bb.target.y, bb.target.z, EPos.x, EPos.y, EPos.z, 1, COLOR_RED, true)
  665. end
  666. for dc, _d in ipairs(enemyTable) do
  667. if _d == nil then
  668. return
  669. end
  670. if _d.dead == false and _d.visible == true then
  671. drawpredictbarrelto1enemy(_d)
  672. if TargetHaveBuff("GangplankRUpgrade2", player) == true and myHero:CanUseSpell(_R) == READY then
  673. drawpredictrenemy(_d)
  674. end
  675. end
  676. end
  677. if bb.target ~= nil then
  678. local dc, _d, ad = getclosestbarreltotarget(bb.target)
  679. if dc ~= nil and _d == false and ad == true then
  680. DrawCircle3D(dc.x, dc.y, dc.z, 345, 1, COLOR_YELLOW)
  681. end
  682. end
  683. end
  684. if Menu.Drawrange.Drawcalcm then
  685. miniondraw()
  686. end
  687. if Menu.Drawrange.Drawcalcc then
  688. champdraw()
  689. end
  690. if Menu.Drawrange.Drawkeg then
  691. for dc, _d in ipairs(barreltable) do
  692. DrawCircle3D(_d.x, _d.y, _d.z, 345, 1, menucolorsval[Menu.Drawrange.Drawkegcolor])
  693. DrawText3D("Hp:" .. _d.health, _d.x, _d.y, _d.z + 200, 18, menucolorsval[Menu.Drawrange.Drawkegcolor], true)
  694. if _d.timeto1 > 0 then
  695. DrawText3D("T-1:" .. round(_d.timeto1, 1), _d.x, _d.y, _d.z + 260, 18, menucolorsval[Menu.Drawrange.Drawkegcolor], true)
  696. else
  697. DrawText3D("T:" .. round(_d.endtime - os.clock(), 0), _d.x, _d.y, _d.z + 260, 18, menucolorsval[Menu.Drawrange.Drawkegcolor], true)
  698. end
  699. if #_d.link ~= 0 then
  700. for ad, bd in ipairs(_d.link) do
  701. local cd = bd
  702. if cd.health > 0 then
  703. DrawLine3D(_d.x, _d.y, _d.z, cd.x, cd.y, cd.z, 1, COLOR_TRANS_WHITE)
  704. DrawCircle3D(cd.x, cd.y, cd.z, 20, 1, COLOR_YELLOW)
  705. end
  706. end
  707. end
  708. end
  709. end
  710. end
  711. function round(dc, _d)
  712. local ad = 10 ^ (_d or 0)
  713. return math.floor(dc * ad + 0.5) / ad
  714. end
  715. function checkonhitdmg(dc, _d)
  716. local ad = 3042
  717. local bd = 3057
  718. local cd = 3334
  719. local dd = 3356
  720. local __a = 3025
  721. local a_a = 0
  722. local b_a = 0
  723. local c_a = GetInventoryHaveItem(ad)
  724. local d_a = GetInventoryHaveItem(bd)
  725. local _aa = GetInventoryHaveItem(cd)
  726. local aaa = GetInventoryHaveItem(dd)
  727. local baa = GetInventoryHaveItem(__a)
  728. if muramanabuffcheck == true then
  729. a_a = a_a + getDmg("MURAMANA", dc, _d)
  730. end
  731. if sheenbuff and sheenbuffcheck then
  732. b_a = getDmg("SHEEN", dc, _d)
  733. end
  734. if sheenbuff and frozenfistbuffcheck then
  735. b_a = getDmg("ICEBORN", dc, _d)
  736. end
  737. if sheenbuff and (_aa or Menu.trinityflag) then
  738. b_a = getDmg("TRINITY", dc, _d)
  739. end
  740. if sheenbuff and lichbanebuffcheck then
  741. b_a = getDmg("LICHBANE", dc, _d)
  742. end
  743. a_a = a_a + b_a
  744. return a_a
  745. end
  746. function miniondraw()
  747. for dc, _d in pairs(minionManager(MINION_ENEMY, 2000, player, MINION_SORT_HEALTH_ASC).objects) do
  748. local ad = getDmg("AD", _d, GetMyHero())
  749. local bd = myHero:CalcDamage(_d, 25 * player:GetSpellData(_Q).level - 5 + player.totalDamage)
  750. local cd = checkonhitdmg(_d, player)
  751. DrawMobIndicators(_d, bd, cd)
  752. end
  753. end
  754. function champdraw()
  755. for dc, _d in pairs(enemyTable) do
  756. local ad = myHero:CalcDamage(_d, 25 * player:GetSpellData(_Q).level - 5 + player.totalDamage)
  757. local bd = checkonhitdmg(_d, player)
  758. DrawChampIndicators(_d, ad, bd)
  759. end
  760. end
  761. function DrawChampIndicators(dc, _d, ad)
  762. local bd, cd, dd = GetHpBarInfoChamp(dc)
  763. local __a = myHero:CalcDamage(dc, myHero.totalDamage)
  764. local a_a = _d
  765. local b_a = _d + ad
  766. local c_a = player:GetSpellData(_R).level * 60 + 90 + player.ap * 0.3 + 2 * myHero:CalcMagicDamage(dc, player:GetSpellData(_R).level * 20 + 30 + player.ap * 0.1)
  767. local d_a = getdamagemodchamps(dc)
  768. __a = math.floor(__a * d_a)
  769. a_a = math.floor(a_a * d_a)
  770. b_a = math.floor(b_a * d_a)
  771. c_a = math.floor(c_a * d_a)
  772. local _aa = __a / dc.maxHealth * cd
  773. local aaa = a_a / dc.maxHealth * cd
  774. local baa = b_a / dc.maxHealth * cd
  775. local caa = c_a / dc.maxHealth * cd
  776. local daa = dc.health / dc.maxHealth * cd
  777. local _ba = bd.x + _aa
  778. local aba = bd.x + aaa
  779. local bba = bd.x + baa
  780. local cba = bd.x + caa
  781. if dc.dead == false and dc.visible == true then
  782. if cba < bd.x + daa and TargetHaveBuff("GangplankRUpgrade2", player) == true and myHero:CanUseSpell(_R) == READY then
  783. DrawLine(cba, bd.y - 1, cba, bd.y + dd, 1, 4294967295)
  784. end
  785. if _ba < bd.x + daa then
  786. DrawLine(_ba, bd.y - 1, _ba, bd.y + dd, 1, 4287137928)
  787. end
  788. if aba < bd.x + daa then
  789. DrawLine(aba, bd.y - 1, aba, bd.y + dd, 1, 4294967040)
  790. end
  791. if bba < bd.x + daa and sheenbuffcheck == true then
  792. DrawLine(bba, bd.y - 1, bba, bd.y + dd, 1, 4294901760)
  793. end
  794. end
  795. local dba = math.ceil(dc.health / __a)
  796. local _ca
  797. if __a >= dc.health then
  798. _ca = 4287137928
  799. elseif a_a >= dc.health and __a < dc.health then
  800. _ca = 4294967040
  801. elseif b_a >= dc.health and a_a < dc.health then
  802. _ca = 4294901760
  803. elseif TargetHaveBuff("GangplankRUpgrade2", player) == true and myHero:CanUseSpell(_R) == READY and c_a > dc.health then
  804. _ca = 4294967295
  805. end
  806. if _ca ~= nil and dc.dead == false and dc.visible == true then
  807. DrawOutlineRectangle(bd.x - 1, bd.y - 1, cd + 1, dd + 1, _ca)
  808. end
  809. if dc.dead == false and dc.visible == true then
  810. DrawText(tostring(dba), 14, bd.x - 1, bd.y - 13, __a >= dc.health and 4278255360 or 4278255615)
  811. end
  812. end
  813. function DrawMobIndicators(dc, _d, ad)
  814. local bd, cd, dd = GetHpBarInfo(dc)
  815. local __a = myHero:CalcDamage(dc, myHero.totalDamage)
  816. local a_a = _d
  817. local b_a = _d + ad
  818. local c_a = 1
  819. if Menu.masteries.doSword then
  820. c_a = c_a + 0.02
  821. end
  822. if Menu.masteries.havoc then
  823. c_a = c_a + 0.03
  824. end
  825. __a = math.floor(__a * c_a)
  826. if Menu.masteries.butcher then
  827. __a = __a + 2
  828. end
  829. local d_a = __a / dc.maxHealth * cd
  830. local _aa = a_a / dc.maxHealth * cd
  831. local aaa = b_a / dc.maxHealth * cd
  832. local baa = dc.health / dc.maxHealth * cd
  833. local caa = bd.x + d_a
  834. local daa = bd.x + _aa
  835. local _ba = bd.x + aaa
  836. if caa < bd.x + baa then
  837. DrawLine(caa, bd.y - 1, caa, bd.y + dd, 1, 4287137928)
  838. end
  839. if daa < bd.x + baa then
  840. DrawLine(daa, bd.y - 1, daa, bd.y + dd, 1, 4294967040)
  841. end
  842. if _ba < bd.x + baa and sheenbuffcheck == true then
  843. DrawLine(_ba, bd.y - 1, _ba, bd.y + dd, 1, 4294901760)
  844. end
  845. local aba = math.ceil(dc.health / __a)
  846. local bba
  847. if __a >= dc.health then
  848. bba = 4278255360
  849. elseif a_a >= dc.health and __a < dc.health then
  850. bba = 4294967040
  851. elseif b_a >= dc.health and a_a < dc.health then
  852. bba = 4294901760
  853. end
  854. if bba ~= nil and dc.dead == false and dc.visible == true then
  855. DrawOutlineRectangle(bd.x - 1, bd.y - 1, cd + 1, dd + 1, bba)
  856. end
  857. if dc.dead == false and dc.visible == true then
  858. DrawText(tostring(aba), 14, bd.x - 1, bd.y - 13, __a >= dc.health and 4278255360 or 4278255615)
  859. end
  860. end
  861. function GetHpBarInfo(dc)
  862. local _d = GetUnitHPBarPos(dc)
  863. local ad = 62
  864. local bd = 4
  865. _d.x = _d.x - 31
  866. _d.y = _d.y - 2
  867. return _d, ad, bd
  868. end
  869. function GetHpBarInfoChamp(dc)
  870. local _d = GetUnitHPBarPos(dc)
  871. local ad = GetUnitHPBarOffset(dc)
  872. local bd = 104
  873. local cd = 8
  874. local dd = {XinZhao = 3.5}
  875. local __a = dd[dc.charName] or 0
  876. _d.x = _d.x - 66 + ad.x * 150
  877. _d.y = _d.y - 2 + __a + ad.y * 50
  878. return _d, bd, cd
  879. end
  880. function DrawOutlineRectangle(dc, _d, ad, bd, cd)
  881. local dd = dc - 1
  882. local __a = dc + ad
  883. local a_a = _d - 1
  884. local b_a = _d + bd
  885. DrawLine(dd, a_a, __a, a_a, 1, cd)
  886. DrawLine(dd, a_a, dd, b_a, 1, cd)
  887. DrawLine(__a, a_a, __a, b_a + 1, 1, cd)
  888. DrawLine(dd, b_a, __a, b_a, 1, cd)
  889. end
  890. function getdamagemodchamps(dc)
  891. local _d = 1
  892. if Menu.masteries.doSword then
  893. _d = _d + 0.02
  894. end
  895. if Menu.masteries.havoc then
  896. _d = _d + 0.03
  897. end
  898. if Menu.masteries.executioner and dc.health / dc.maxHealth < Menu.masteries.executionerlevel * 0.15 + 0.05 then
  899. _d = _d + 0.05
  900. end
  901. return _d
  902. end
  903. function OrbWalk()
  904. if Menu.Combo.modeswitch and timeToShoot() and cb.target ~= nil then
  905. player:Attack(cb.target)
  906. elseif heroCanMove() and Menu.Combo.modeswitch and automoveflag == true and GetDistance(mousePos) > 200 then
  907. player:MoveTo(mousePos.x, mousePos.z)
  908. lastmove = os.clock()
  909. automoveflag = false
  910. end
  911. end
  912. function heroCanMove()
  913. return os.clock() > lastAttack + lastWindUpTime + 0.05
  914. end
  915. function timeToShoot()
  916. return os.clock() > lastAttack + lastAttackCD
  917. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement