Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.15 KB | None | 0 0
  1. local version = "1.08"
  2.  
  3. --[[
  4. Cassiopeia - Deadly Cadence
  5. Author: Draconis
  6. Version: 1.08
  7. Copyright 2014
  8.  
  9. Dependency: Standalone
  10. --]]
  11.  
  12. if myHero.charName ~= "Cassiopeia" then return end
  13.  
  14. _G.UseUpdater = true
  15.  
  16. local REQUIRED_LIBS = {
  17. ["SxOrbwalk"] = "https://raw.githubusercontent.com/Superx321/BoL/master/common/SxOrbWalk.lua",
  18. ["VPrediction"] = "https://raw.githubusercontent.com/Hellsing/BoL/master/common/VPrediction.lua",
  19. }
  20.  
  21. local DOWNLOADING_LIBS, DOWNLOAD_COUNT = false, 0
  22.  
  23. function AfterDownload()
  24. DOWNLOAD_COUNT = DOWNLOAD_COUNT - 1
  25. if DOWNLOAD_COUNT == 0 then
  26. DOWNLOADING_LIBS = false
  27. print("<b><font color=\"#6699FF\">Cassiopeia - Deadly Cadence:</font></b> <font color=\"#FFFFFF\">Required libraries downloaded successfully, please reload (double F9).</font>")
  28. end
  29. end
  30.  
  31. for DOWNLOAD_LIB_NAME, DOWNLOAD_LIB_URL in pairs(REQUIRED_LIBS) do
  32. if FileExist(LIB_PATH .. DOWNLOAD_LIB_NAME .. ".lua") then
  33. require(DOWNLOAD_LIB_NAME)
  34. else
  35. DOWNLOADING_LIBS = true
  36. DOWNLOAD_COUNT = DOWNLOAD_COUNT + 1
  37. DownloadFile(DOWNLOAD_LIB_URL, LIB_PATH .. DOWNLOAD_LIB_NAME..".lua", AfterDownload)
  38. end
  39. end
  40.  
  41. if DOWNLOADING_LIBS then return end
  42.  
  43. local UPDATE_NAME = "Cassiopeia - Deadly Cadence"
  44. local UPDATE_HOST = "raw.github.com"
  45. local UPDATE_PATH = "/DraconisBoL/BoL/master/Cassiopeia%20-%20Deadly%20Cadence.lua" .. "?rand=" .. math.random(1, 10000)
  46. local UPDATE_FILE_PATH = SCRIPT_PATH..GetCurrentEnv().FILE_NAME
  47. local UPDATE_URL = "http://"..UPDATE_HOST..UPDATE_PATH
  48.  
  49. function AutoupdaterMsg(msg) print("<b><font color=\"#6699FF\">"..UPDATE_NAME..":</font></b> <font color=\"#FFFFFF\">"..msg..".</font>") end
  50. if _G.UseUpdater then
  51. local ServerData = GetWebResult(UPDATE_HOST, UPDATE_PATH)
  52. if ServerData then
  53. local ServerVersion = string.match(ServerData, "local version = \"%d+.%d+\"")
  54. ServerVersion = string.match(ServerVersion and ServerVersion or "", "%d+.%d+")
  55. if ServerVersion then
  56. ServerVersion = tonumber(ServerVersion)
  57. if tonumber(version) < ServerVersion then
  58. AutoupdaterMsg("New version available "..ServerVersion)
  59. AutoupdaterMsg("Updating, please don't press F9")
  60. DownloadFile(UPDATE_URL, UPDATE_FILE_PATH, function () AutoupdaterMsg("Successfully updated. ("..version.." => "..ServerVersion.."), press F9 twice to load the updated version.") end)
  61. else
  62. AutoupdaterMsg("You have got the latest version ("..ServerVersion..")")
  63. end
  64. end
  65. else
  66. AutoupdaterMsg("Error downloading version info")
  67. end
  68. end
  69.  
  70. ------------------------------------------------------
  71. -- Callbacks
  72. ------------------------------------------------------
  73.  
  74. function OnLoad()
  75. print("<b><font color=\"#6699FF\">Cassiopeia - Deadly Cadence:</font></b> <font color=\"#FFFFFF\">Good luck and have fun!</font>")
  76. Variables()
  77. Menu()
  78. PriorityOnLoad()
  79. end
  80.  
  81. function OnTick()
  82. ComboKey = Settings.combo.comboKey
  83. HarassKey = Settings.harass.harassKey
  84. HarassToggle = Settings.harass.harassToggle
  85. JungleClearKey = Settings.jungle.jungleKey
  86. LaneClearKey = Settings.lane.laneKey
  87. FarmKey = Settings.farm.farmKey
  88.  
  89. if ComboKey then
  90. Combo(Target)
  91. end
  92.  
  93. if HarassKey or HarassToggle then
  94. Harass(Target)
  95. end
  96.  
  97. if FarmKey and Settings.farm.farmE then
  98. CastAutoE()
  99. end
  100. if JungleClearKey then
  101. JungleClear()
  102. end
  103.  
  104. if LaneClearKey then
  105. LaneClear()
  106. end
  107.  
  108. if Settings.ks.killSteal then
  109. KillSteal()
  110. end
  111.  
  112. Checks()
  113.  
  114. CastAutoR()
  115. end
  116.  
  117. function OnDraw()
  118. if not myHero.dead and not Settings.drawing.mDraw then
  119. if SkillQ.ready and Settings.drawing.qDraw then
  120. DrawCircle(myHero.x, myHero.y, myHero.z, SkillQ.range, RGB(Settings.drawing.qColor[2], Settings.drawing.qColor[3], Settings.drawing.qColor[4]))
  121. end
  122. if SkillW.ready and Settings.drawing.wDraw then
  123. DrawCircle(myHero.x, myHero.y, myHero.z, SkillW.range, RGB(Settings.drawing.wColor[2], Settings.drawing.wColor[3], Settings.drawing.wColor[4]))
  124. end
  125. if SkillE.ready and Settings.drawing.eDraw then
  126. DrawCircle(myHero.x, myHero.y, myHero.z, SkillE.range, RGB(Settings.drawing.eColor[2], Settings.drawing.eColor[3], Settings.drawing.eColor[4]))
  127. end
  128. if SkillR.ready and Settings.drawing.rDraw then
  129. DrawCircle(myHero.x, myHero.y, myHero.z, SkillR.range, RGB(Settings.drawing.rColor[2], Settings.drawing.rColor[3], Settings.drawing.rColor[4]))
  130. end
  131.  
  132. if Settings.drawing.myHero then
  133. DrawCircle(myHero.x, myHero.y, myHero.z, TrueRange(), RGB(Settings.drawing.myColor[2], Settings.drawing.myColor[3], Settings.drawing.myColor[4]))
  134. end
  135.  
  136. if Settings.drawing.Target and Target ~= nil then
  137. DrawCircle(Target.x, Target.y, Target.z, 80, ARGB(255, 10, 255, 10))
  138. end
  139. end
  140. end
  141.  
  142. ------------------------------------------------------
  143. -- Functions
  144. ------------------------------------------------------
  145.  
  146. function Combo(unit)
  147. if ValidTarget(unit) and unit ~= nil and unit.type == myHero.type then
  148. if Settings.combo.comboItems then
  149. UseItems(unit)
  150. end
  151.  
  152. CastR(unit)
  153. CastQ(unit)
  154. CastW(unit)
  155. CastE(unit)
  156. end
  157. end
  158.  
  159. function Harass(unit)
  160. if ValidTarget(unit) and unit ~= nil and unit.type == myHero.type and not IsMyManaLow("Harass") then
  161. if Settings.harass.useW then CastW(unit) end
  162. if Settings.harass.useQ then CastQ(unit) end
  163. if Settings.harass.useE then CastE(unit) end
  164. end
  165. end
  166.  
  167. function LaneClear()
  168. enemyMinions:update()
  169. if LaneClearKey and not IsMyManaLow("LaneClear") then
  170. for i, minion in pairs(enemyMinions.objects) do
  171. if ValidTarget(minion) and minion ~= nil then
  172. if Settings.lane.laneQ and GetDistance(minion) <= SkillQ.range and SkillQ.ready then
  173. local BestPos, BestHit = GetBestCircularFarmPosition(SkillQ.range, SkillQ.width, enemyMinions.objects)
  174. if BestPos ~= nil then
  175. CastSpell(_Q, BestPos.x, BestPos.z)
  176. end
  177. end
  178.  
  179. if Settings.lane.laneW and GetDistance(minion) <= SkillW.range and SkillW.ready then
  180. local BestPos, BestHit = GetBestCircularFarmPosition(SkillW.range, SkillW.width, enemyMinions.objects)
  181. if BestPos ~= nil then
  182. CastSpell(_W, BestPos.x, BestPos.z)
  183. end
  184. end
  185.  
  186. if Settings.lane.laneE and GetDistance(minion) <= SkillE.range and SkillE.ready then
  187. if isPoisoned(minion) then
  188. CastSpell(_E, minion)
  189. end
  190. end
  191. end
  192. end
  193. end
  194. end
  195.  
  196. function JungleClear()
  197. if Settings.jungle.jungleKey and not IsMyManaLow("JungleClear") then
  198. local JungleMob = GetJungleMob()
  199.  
  200. if JungleMob ~= nil then
  201. if Settings.jungle.jungleQ and GetDistance(JungleMob) <= SkillQ.range and SkillQ.ready then
  202. CastSpell(_Q, JungleMob.x, JungleMob.z)
  203. end
  204. if Settings.jungle.jungleW and GetDistance(JungleMob) <= SkillW.range and SkillW.ready then
  205. CastSpell(_W, JungleMob.x, JungleMob.z)
  206. end
  207. if Settings.jungle.jungleE and GetDistance(JungleMob) <= SkillE.range and SkillE.ready then
  208. if isPoisoned(JungleMob) then
  209. CastSpell(_E, JungleMob)
  210. end
  211. end
  212. end
  213. end
  214. end
  215.  
  216. function CastQ(unit)
  217. if unit ~= nil and GetDistance(unit) <= SkillQ.range and SkillQ.ready then
  218. local AOECastPosition, MainTargetHitChance, nTargets = VP:GetCircularAOECastPosition(unit, SkillQ.delay, SkillQ.width, SkillQ.range, SkillQ.speed, myHero)
  219.  
  220. if MainTargetHitChance >= 2 then
  221. CastSpell(_Q, AOECastPosition.x, AOECastPosition.z)
  222. end
  223. end
  224. end
  225.  
  226. function CastW(unit)
  227. if unit ~= nil and GetDistance(unit) <= SkillW.range and SkillW.ready then
  228. if Settings.combo.useW and TargetHaveBuff("cassiopeianoxiousblastpoison", unit) then return end
  229.  
  230. local AOECastPosition, MainTargetHitChance, nTargets = VP:GetCircularAOECastPosition(unit, SkillW.delay, SkillW.width, SkillW.range, SkillW.speed, myHero)
  231.  
  232. if MainTargetHitChance >= 2 then
  233. CastSpell(_W, AOECastPosition.x, AOECastPosition.z)
  234. end
  235. end
  236. end
  237.  
  238. function CastE(unit)
  239. if unit ~= nil and SkillE.ready and GetDistance(unit) <= SkillE.range then
  240. if isPoisoned(unit) then
  241. if VIP_USER and Settings.misc.packets then
  242. Packet("S_CAST", {spellId = _E, targetNetworkId = unit.networkID}):send()
  243. else
  244. CastSpell(_E, unit)
  245. end
  246. end
  247. end
  248. end
  249.  
  250. function CastAutoE()
  251. enemyMinions:update()
  252. if FarmKey and not IsMyManaLow("Farm") then
  253. for i, minion in pairs(enemyMinions.objects) do
  254. if ValidTarget(minion) and minion ~= nil then
  255. local eDmg = getDmg("E", minion, myHero)
  256. if GetDistance(minion) <= SkillE.range and minion.health <= eDmg and SkillE.ready then
  257. if isPoisoned(minion) then
  258. CastSpell(_E, minion)
  259. end
  260. end
  261. end
  262. end
  263. end
  264. end
  265.  
  266. function CastR(unit)
  267. if Settings.combo.useR == 1 then return end
  268.  
  269. if unit ~= nil and GetDistance(unit) <= SkillR.range and SkillR.ready and isBothFacing(myHero, unit, 160) then
  270. local ComboDamage = getDmg("Q", unit, myHero) + getDmg("Q", unit, myHero) + getDmg("W", unit, myHero) + getDmg("E", unit, myHero) + getDmg("E", unit, myHero) + getDmg("R", unit, myHero)
  271. local mainCastPosition, mainHitChance, maxHit = VP:GetConeAOECastPosition(unit, SkillR.delay, SkillR.angle, SkillR.range, SkillR.speed, myHero)
  272.  
  273. if mainHitChance >= 2 and unit.health < ComboDamage then
  274. if Settings.combo.useR == 2 and maxHit >= 1 then
  275. CastSpell(_R, mainCastPosition.x, mainCastPosition.z)
  276. elseif Settings.combo.useR == 3 and maxHit >= 2 then
  277. CastSpell(_R, mainCastPosition.x, mainCastPosition.z)
  278. elseif Settings.combo.useR == 4 and maxHit >= 3 then
  279. CastSpell(_R, mainCastPosition.x, mainCastPosition.z)
  280. elseif Settings.combo.useR == 5 and maxHit >= 4 then
  281. CastSpell(_R, mainCastPosition.x, mainCastPosition.z)
  282. end
  283. end
  284. end
  285. end
  286.  
  287. function CastAutoR()
  288. if Settings.combo.useAutoR == 1 then return end
  289.  
  290. for _, enemy in ipairs(GetEnemyHeroes()) do
  291. if ValidTarget(enemy) and enemy.visible and GetDistance(enemy) <= SkillR.range and SkillR.ready and isBothFacing(myHero, enemy, 160) then
  292. local mainCastPosition, mainHitChance, maxHit = VP:GetConeAOECastPosition(enemy, SkillR.delay, SkillR.angle, SkillR.range, SkillR.speed, myHero)
  293.  
  294. if mainHitChance >= 2 then
  295. if Settings.combo.useAutoR == 2 and maxHit >= 1 then
  296. CastSpell(_R, mainCastPosition.x, mainCastPosition.z)
  297. elseif Settings.combo.useAutoR == 3 and maxHit >= 2 then
  298. CastSpell(_R, mainCastPosition.x, mainCastPosition.z)
  299. elseif Settings.combo.useAutoR == 4 and maxHit >= 3 then
  300. CastSpell(_R, mainCastPosition.x, mainCastPosition.z)
  301. elseif Settings.combo.useAutoR == 5 and maxHit >= 4 then
  302. CastSpell(_R, mainCastPosition.x, mainCastPosition.z)
  303. end
  304. end
  305. end
  306. end
  307. end
  308.  
  309. function KillSteal()
  310. for _, enemy in ipairs(GetEnemyHeroes()) do
  311. if ValidTarget(enemy) and enemy.visible then
  312. local qDmg = getDmg("Q", enemy, myHero)
  313. local eDmg = getDmg("E", enemy, myHero)
  314. local rDmg = getDmg("R", enemy, myHero)
  315.  
  316. if enemy.health <= qDmg and GetDistance(enemy) <= SkillQ.range then
  317. CastQ(enemy)
  318. elseif enemy.health <= eDmg and GetDistance(enemy) <= SkillE.range then
  319. CastE(enemy)
  320. elseif Settings.ks.kSR and enemy.health <= rDmg and GetDistance(enemy) <= SkillR.range and SkillR.ready then
  321. CastSpell(_R, enemy.x, enemy.z)
  322. end
  323.  
  324. if Settings.ks.autoIgnite then
  325. AutoIgnite(enemy)
  326. end
  327. end
  328. end
  329. end
  330.  
  331. function AutoIgnite(unit)
  332. if ValidTarget(unit, Ignite.range) and unit.health <= 50 + (20 * myHero.level) then
  333. if Ignite.ready then
  334. CastSpell(Ignite.slot, unit)
  335. end
  336. end
  337. end
  338.  
  339. ------------------------------------------------------
  340. -- Checks, menu & stuff
  341. ------------------------------------------------------
  342.  
  343. function Checks()
  344. SkillQ.ready = (myHero:CanUseSpell(_Q) == READY)
  345. SkillW.ready = (myHero:CanUseSpell(_W) == READY)
  346. SkillE.ready = (myHero:CanUseSpell(_E) == READY)
  347. SkillR.ready = (myHero:CanUseSpell(_R) == READY)
  348.  
  349. Ignite.ready = (Ignite.slot ~= nil and myHero:CanUseSpell(Ignite.slot) == READY)
  350.  
  351. TargetSelector:update()
  352. Target = GetCustomTarget()
  353. SxOrb:ForceTarget(Target)
  354.  
  355. if Settings.drawing.lfc.lfc then _G.DrawCircle = DrawCircle2 else _G.DrawCircle = _G.oldDrawCircle end
  356. end
  357.  
  358. function IsMyManaLow(mode)
  359. if mode == "Harass" then
  360. if myHero.mana < (myHero.maxMana * ( Settings.harass.harassMana / 100)) then
  361. return true
  362. else
  363. return false
  364. end
  365. elseif mode == "Farm" then
  366. if myHero.mana < (myHero.maxMana * ( Settings.farm.farmMana / 100)) then
  367. return true
  368. else
  369. return false
  370. end
  371. elseif mode == "LaneClear" then
  372. if myHero.mana < (myHero.maxMana * ( Settings.lane.laneMana / 100)) then
  373. return true
  374. else
  375. return false
  376. end
  377. elseif mode == "JungleClear" then
  378. if myHero.mana < (myHero.maxMana * ( Settings.jungle.jungleMana / 100)) then
  379. return true
  380. else
  381. return false
  382. end
  383. end
  384. end
  385.  
  386. function Menu()
  387. Settings = scriptConfig("Cassiopeia - Deadly Cadence "..version.."", "DraconisCassio")
  388.  
  389. Settings:addSubMenu("["..myHero.charName.."] - Combo Settings", "combo")
  390. Settings.combo:addParam("comboKey", "Combo Key", SCRIPT_PARAM_ONKEYDOWN, false, 32)
  391. Settings.combo:addParam("useR", "Use "..SkillR.name.." (R) in Combo", SCRIPT_PARAM_LIST, 2, { "No", ">1 targets", ">2 targets", ">3 targets", ">4 targets" })
  392. Settings.combo:addParam("useAutoR", "Use "..SkillR.name.." (R) auto if", SCRIPT_PARAM_LIST, 3, { "No", ">1 targets", ">2 targets", ">3 targets", ">4 targets" })
  393. Settings.combo:addParam("useW", "Use "..SkillW.name.." (W) only if Q misses", SCRIPT_PARAM_ONOFF, true)
  394. Settings.combo:addParam("comboItems", "Use Items in Combo", SCRIPT_PARAM_ONOFF, true)
  395. Settings.combo:permaShow("comboKey")
  396.  
  397. Settings:addSubMenu("["..myHero.charName.."] - Harass Settings", "harass")
  398. Settings.harass:addParam("harassKey", "Harass Key", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("C"))
  399. Settings.harass:addParam("harassToggle", "Harass Toggle", SCRIPT_PARAM_ONKEYTOGGLE, false, GetKey("A"))
  400. Settings.harass:addParam("useQ", "Use "..SkillQ.name.." (Q) in Harass", SCRIPT_PARAM_ONOFF, true)
  401. Settings.harass:addParam("useW", "Use "..SkillW.name.." (W) in Harass", SCRIPT_PARAM_ONOFF, true)
  402. Settings.harass:addParam("useE", "Use "..SkillE.name.." (E) in Harass", SCRIPT_PARAM_ONOFF, true)
  403. Settings.harass:addParam("harassMana", "Min. Mana Percent: ", SCRIPT_PARAM_SLICE, 50, 0, 100, 0)
  404. Settings.harass:permaShow("harassKey")
  405. Settings.harass:permaShow("harassToggle")
  406.  
  407. Settings:addSubMenu("["..myHero.charName.."] - Farm Settings", "farm")
  408. Settings.farm:addParam("farmKey", "Farm Key", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("X"))
  409. Settings.farm:addParam("farmE", "Farm with "..SkillE.name.." (E)", SCRIPT_PARAM_ONOFF, true)
  410. Settings.farm:addParam("farmMana", "Min. Mana Percent: ", SCRIPT_PARAM_SLICE, 50, 0, 100, 0)
  411. Settings.farm:permaShow("farmKey")
  412.  
  413. Settings:addSubMenu("["..myHero.charName.."] - Lane Clear Settings", "lane")
  414. Settings.lane:addParam("laneKey", "Lane Clear Key", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("V"))
  415. Settings.lane:addParam("laneQ", "Clear with "..SkillQ.name.." (Q)", SCRIPT_PARAM_ONOFF, true)
  416. Settings.lane:addParam("laneW", "Clear with "..SkillW.name.." (W)", SCRIPT_PARAM_ONOFF, true)
  417. Settings.lane:addParam("laneE", "Clear with "..SkillE.name.." (E)", SCRIPT_PARAM_ONOFF, true)
  418. Settings.lane:addParam("laneMana", "Min. Mana Percent: ", SCRIPT_PARAM_SLICE, 50, 0, 100, 0)
  419. Settings.lane:permaShow("laneKey")
  420.  
  421. Settings:addSubMenu("["..myHero.charName.."] - Jungle Clear Settings", "jungle")
  422. Settings.jungle:addParam("jungleKey", "Jungle Clear Key", SCRIPT_PARAM_ONKEYDOWN, false, GetKey("V"))
  423. Settings.jungle:addParam("jungleQ", "Clear with "..SkillQ.name.." (Q)", SCRIPT_PARAM_ONOFF, true)
  424. Settings.jungle:addParam("jungleW", "Clear with "..SkillW.name.." (W)", SCRIPT_PARAM_ONOFF, true)
  425. Settings.jungle:addParam("jungleE", "Clear with "..SkillE.name.." (E)", SCRIPT_PARAM_ONOFF, true)
  426. Settings.jungle:addParam("jungleMana", "Min. Mana Percent: ", SCRIPT_PARAM_SLICE, 50, 0, 100, 0)
  427. Settings.jungle:permaShow("jungleKey")
  428.  
  429. Settings:addSubMenu("["..myHero.charName.."] - KillSteal Settings", "ks")
  430. Settings.ks:addParam("killSteal", "Use Smart Kill Steal", SCRIPT_PARAM_ONOFF, true)
  431. Settings.ks:addParam("kSR", "Use "..SkillR.name.." (R)", SCRIPT_PARAM_ONOFF, true)
  432. Settings.ks:addParam("autoIgnite", "Auto Ignite", SCRIPT_PARAM_ONOFF, true)
  433. Settings.ks:permaShow("killSteal")
  434.  
  435. Settings:addSubMenu("["..myHero.charName.."] - Draw Settings", "drawing")
  436. Settings.drawing:addParam("mDraw", "Disable All Range Draws", SCRIPT_PARAM_ONOFF, false)
  437. Settings.drawing:addParam("Target", "Draw Circle on Target", SCRIPT_PARAM_ONOFF, true)
  438. Settings.drawing:addParam("Text", "Draw Text on Target", SCRIPT_PARAM_ONOFF, true)
  439. Settings.drawing:addParam("myHero", "Draw My Range", SCRIPT_PARAM_ONOFF, true)
  440. Settings.drawing:addParam("myColor", "Draw My Range Color", SCRIPT_PARAM_COLOR, {255, 74, 26, 255})
  441. Settings.drawing:addParam("qDraw", "Draw "..SkillQ.name.." (Q) Range", SCRIPT_PARAM_ONOFF, true)
  442. Settings.drawing:addParam("qColor", "Draw "..SkillQ.name.." (Q) Color", SCRIPT_PARAM_COLOR, {255, 74, 26, 255})
  443. Settings.drawing:addParam("wDraw", "Draw "..SkillW.name.." (W) Range", SCRIPT_PARAM_ONOFF, true)
  444. Settings.drawing:addParam("wColor", "Draw "..SkillW.name.." (W) Color", SCRIPT_PARAM_COLOR, {255, 74, 26, 255})
  445. Settings.drawing:addParam("eDraw", "Draw "..SkillE.name.." (E) Range", SCRIPT_PARAM_ONOFF, true)
  446. Settings.drawing:addParam("eColor", "Draw "..SkillE.name.." (E) Color", SCRIPT_PARAM_COLOR, {255, 74, 26, 255})
  447. Settings.drawing:addParam("rDraw", "Draw "..SkillR.name.." (R) Range", SCRIPT_PARAM_ONOFF, true)
  448. Settings.drawing:addParam("rColor", "Draw "..SkillR.name.." (R) Color", SCRIPT_PARAM_COLOR, {255, 74, 26, 255})
  449.  
  450. Settings.drawing:addSubMenu("Lag Free Circles", "lfc")
  451. Settings.drawing.lfc:addParam("lfc", "Lag Free Circles", SCRIPT_PARAM_ONOFF, false)
  452. Settings.drawing.lfc:addParam("CL", "Quality", 4, 75, 75, 2000, 0)
  453. Settings.drawing.lfc:addParam("Width", "Width", 4, 1, 1, 10, 0)
  454.  
  455. Settings:addSubMenu("["..myHero.charName.."] - Misc Settings", "misc")
  456. Settings.misc:addParam("packets", "Cast spells using Packets", SCRIPT_PARAM_ONOFF, true)
  457.  
  458.  
  459. Settings:addSubMenu("["..myHero.charName.."] - Orbwalking Settings", "Orbwalking")
  460. SxOrb:LoadToMenu(Settings.Orbwalking)
  461.  
  462. TargetSelector = TargetSelector(TARGET_LESS_CAST_PRIORITY, SkillQ.range, DAMAGE_MAGIC, true)
  463. TargetSelector.name = "Cassiopeia"
  464. Settings:addTS(TargetSelector)
  465. end
  466.  
  467. function Variables()
  468. SkillQ = { name = "Noxious Blast", range = 850, delay = 0.6, speed = math.huge, width = 80, ready = false }
  469. SkillW = { name = "Miasma", range = 850, delay = 0.375, speed = math.huge, width = 80, ready = false }
  470. SkillE = { name = "Twin Fang", range = 700, delay = nil, speed = nil, width = nil, ready = false }
  471. SkillR = { name = "Petrifying Gaze", range = 750, delay = 0.5, speed = math.huge, angle = 80, ready = false }
  472. Ignite = { name = "summonerdot", range = 600, slot = nil }
  473.  
  474. enemyMinions = minionManager(MINION_ENEMY, SkillR.range, myHero, MINION_SORT_HEALTH_ASC)
  475.  
  476. VP = VPrediction()
  477.  
  478. JungleMobs = {}
  479. JungleFocusMobs = {}
  480.  
  481. if myHero:GetSpellData(SUMMONER_1).name:find(Ignite.name) then
  482. Ignite.slot = SUMMONER_1
  483. elseif myHero:GetSpellData(SUMMONER_2).name:find(Ignite.name) then
  484. Ignite.slot = SUMMONER_2
  485. end
  486.  
  487. if GetGame().map.shortName == "twistedTreeline" then
  488. TwistedTreeline = true
  489. else
  490. TwistedTreeline = false
  491. end
  492.  
  493. _G.oldDrawCircle = rawget(_G, 'DrawCircle')
  494. _G.DrawCircle = DrawCircle2
  495.  
  496. priorityTable = {
  497. AP = {
  498. "Annie", "Ahri", "Akali", "Anivia", "Annie", "Brand", "Cassiopeia", "Diana", "Evelynn", "FiddleSticks", "Fizz", "Gragas", "Heimerdinger", "Karthus",
  499. "Kassadin", "Katarina", "Kayle", "Kennen", "Leblanc", "Lissandra", "Lux", "Malzahar", "Mordekaiser", "Morgana", "Nidalee", "Orianna",
  500. "Ryze", "Sion", "Swain", "Syndra", "Teemo", "TwistedFate", "Veigar", "Viktor", "Vladimir", "Xerath", "Ziggs", "Zyra", "Velkoz"
  501. },
  502.  
  503. Support = {
  504. "Alistar", "Blitzcrank", "Janna", "Karma", "Leona", "Lulu", "Nami", "Nunu", "Sona", "Soraka", "Taric", "Thresh", "Zilean", "Braum"
  505. },
  506.  
  507. Tank = {
  508. "Amumu", "Chogath", "DrMundo", "Galio", "Hecarim", "Malphite", "Maokai", "Nasus", "Rammus", "Sejuani", "Nautilus", "Shen", "Singed", "Skarner", "Volibear",
  509. "Warwick", "Yorick", "Zac"
  510. },
  511.  
  512. AD_Carry = {
  513. "Ashe", "Caitlyn", "Corki", "Draven", "Ezreal", "Graves", "Jayce", "Jinx", "KogMaw", "Lucian", "MasterYi", "MissFortune", "Pantheon", "Quinn", "Shaco", "Sivir",
  514. "Talon","Tryndamere", "Tristana", "Twitch", "Urgot", "Varus", "Vayne", "Yasuo", "Zed"
  515. },
  516.  
  517. Bruiser = {
  518. "Aatrox", "Darius", "Elise", "Fiora", "Gangplank", "Garen", "Irelia", "JarvanIV", "Jax", "Khazix", "LeeSin", "Nocturne", "Olaf", "Poppy",
  519. "Renekton", "Rengar", "Riven", "Rumble", "Shyvana", "Trundle", "Udyr", "Vi", "MonkeyKing", "XinZhao"
  520. }
  521. }
  522.  
  523. Items = {
  524. BRK = { id = 3153, range = 450, reqTarget = true, slot = nil },
  525. BWC = { id = 3144, range = 400, reqTarget = true, slot = nil },
  526. DFG = { id = 3128, range = 750, reqTarget = true, slot = nil },
  527. HGB = { id = 3146, range = 400, reqTarget = true, slot = nil },
  528. RSH = { id = 3074, range = 350, reqTarget = false, slot = nil },
  529. STD = { id = 3131, range = 350, reqTarget = false, slot = nil },
  530. TMT = { id = 3077, range = 350, reqTarget = false, slot = nil },
  531. YGB = { id = 3142, range = 350, reqTarget = false, slot = nil },
  532. BFT = { id = 3188, range = 750, reqTarget = true, slot = nil },
  533. RND = { id = 3143, range = 275, reqTarget = false, slot = nil }
  534. }
  535.  
  536. if not TwistedTreeline then
  537. JungleMobNames = {
  538. ["SRU_MurkwolfMini2.1.3"] = true,
  539. ["SRU_MurkwolfMini2.1.2"] = true,
  540. ["SRU_MurkwolfMini8.1.3"] = true,
  541. ["SRU_MurkwolfMini8.1.2"] = true,
  542. ["SRU_BlueMini1.1.2"] = true,
  543. ["SRU_BlueMini7.1.2"] = true,
  544. ["SRU_BlueMini21.1.3"] = true,
  545. ["SRU_BlueMini27.1.3"] = true,
  546. ["SRU_RedMini10.1.2"] = true,
  547. ["SRU_RedMini10.1.3"] = true,
  548. ["SRU_RedMini4.1.2"] = true,
  549. ["SRU_RedMini4.1.3"] = true,
  550. ["SRU_KrugMini11.1.1"] = true,
  551. ["SRU_KrugMini5.1.1"] = true,
  552. ["SRU_RazorbeakMini9.1.2"] = true,
  553. ["SRU_RazorbeakMini9.1.3"] = true,
  554. ["SRU_RazorbeakMini9.1.4"] = true,
  555. ["SRU_RazorbeakMini3.1.2"] = true,
  556. ["SRU_RazorbeakMini3.1.3"] = true,
  557. ["SRU_RazorbeakMini3.1.4"] = true
  558. }
  559.  
  560. FocusJungleNames = {
  561. ["SRU_Blue1.1.1"] = true,
  562. ["SRU_Blue7.1.1"] = true,
  563. ["SRU_Murkwolf2.1.1"] = true,
  564. ["SRU_Murkwolf8.1.1"] = true,
  565. ["SRU_Gromp13.1.1"] = true,
  566. ["SRU_Gromp14.1.1"] = true,
  567. ["Sru_Crab16.1.1"] = true,
  568. ["Sru_Crab15.1.1"] = true,
  569. ["SRU_Red10.1.1"] = true,
  570. ["SRU_Red4.1.1"] = true,
  571. ["SRU_Krug11.1.2"] = true,
  572. ["SRU_Krug5.1.2"] = true,
  573. ["SRU_Razorbeak9.1.1"] = true,
  574. ["SRU_Razorbeak3.1.1"] = true,
  575. ["SRU_Dragon6.1.1"] = true,
  576. ["SRU_Baron12.1.1"] = true
  577. }
  578. else
  579. FocusJungleNames = {
  580. ["TT_NWraith1.1.1"] = true,
  581. ["TT_NGolem2.1.1"] = true,
  582. ["TT_NWolf3.1.1"] = true,
  583. ["TT_NWraith4.1.1"] = true,
  584. ["TT_NGolem5.1.1"] = true,
  585. ["TT_NWolf6.1.1"] = true,
  586. ["TT_Spiderboss8.1.1"] = true
  587. }
  588. JungleMobNames = {
  589. ["TT_NWraith21.1.2"] = true,
  590. ["TT_NWraith21.1.3"] = true,
  591. ["TT_NGolem22.1.2"] = true,
  592. ["TT_NWolf23.1.2"] = true,
  593. ["TT_NWolf23.1.3"] = true,
  594. ["TT_NWraith24.1.2"] = true,
  595. ["TT_NWraith24.1.3"] = true,
  596. ["TT_NGolem25.1.1"] = true,
  597. ["TT_NWolf26.1.2"] = true,
  598. ["TT_NWolf26.1.3"] = true
  599. }
  600. end
  601.  
  602. for i = 0, objManager.maxObjects do
  603. local object = objManager:getObject(i)
  604. if object and object.valid and not object.dead then
  605. if FocusJungleNames[object.name] then
  606. JungleFocusMobs[#JungleFocusMobs+1] = object
  607. elseif JungleMobNames[object.name] then
  608. JungleMobs[#JungleMobs+1] = object
  609. end
  610. end
  611. end
  612. end
  613.  
  614. function SetPriority(table, hero, priority)
  615. for i=1, #table, 1 do
  616. if hero.charName:find(table[i]) ~= nil then
  617. TS_SetHeroPriority(priority, hero.charName)
  618. end
  619. end
  620. end
  621.  
  622. function arrangePrioritys()
  623. for i, enemy in ipairs(GetEnemyHeroes()) do
  624. SetPriority(priorityTable.AD_Carry, enemy, 1)
  625. SetPriority(priorityTable.AP, enemy, 2)
  626. SetPriority(priorityTable.Support, enemy, 3)
  627. SetPriority(priorityTable.Bruiser, enemy, 4)
  628. SetPriority(priorityTable.Tank, enemy, 5)
  629. end
  630. end
  631.  
  632. function arrangePrioritysTT()
  633. for i, enemy in ipairs(GetEnemyHeroes()) do
  634. SetPriority(priorityTable.AD_Carry, enemy, 1)
  635. SetPriority(priorityTable.AP, enemy, 1)
  636. SetPriority(priorityTable.Support, enemy, 2)
  637. SetPriority(priorityTable.Bruiser, enemy, 2)
  638. SetPriority(priorityTable.Tank, enemy, 3)
  639. end
  640. end
  641.  
  642. function UseItems(unit)
  643. if unit ~= nil then
  644. for _, item in pairs(Items) do
  645. item.slot = GetInventorySlotItem(item.id)
  646. if item.slot ~= nil then
  647. if item.reqTarget and GetDistance(unit) < item.range then
  648. CastSpell(item.slot, unit)
  649. elseif not item.reqTarget then
  650. if (GetDistance(unit) - getHitBoxRadius(myHero) - getHitBoxRadius(unit)) < 50 then
  651. CastSpell(item.slot)
  652. end
  653. end
  654. end
  655. end
  656. end
  657. end
  658.  
  659. function getHitBoxRadius(target)
  660. return GetDistance(target.minBBox, target.maxBBox)/2
  661. end
  662.  
  663. function PriorityOnLoad()
  664. if heroManager.iCount < 10 or (TwistedTreeline and heroManager.iCount < 6) then
  665. print("<b><font color=\"#6699FF\">Cassiopeia - Deadly Cadence:</font></b> <font color=\"#FFFFFF\">Too few champions to arrange priority.</font>")
  666. elseif heroManager.iCount == 6 then
  667. arrangePrioritysTT()
  668. else
  669. arrangePrioritys()
  670. end
  671. end
  672.  
  673. function GetJungleMob()
  674. for _, Mob in pairs(JungleFocusMobs) do
  675. if ValidTarget(Mob, SkillR.range) then return Mob end
  676. end
  677. for _, Mob in pairs(JungleMobs) do
  678. if ValidTarget(Mob, SkillR.range) then return Mob end
  679. end
  680. end
  681.  
  682. function OnCreateObj(obj)
  683. if obj.valid then
  684. if FocusJungleNames[obj.name] then
  685. JungleFocusMobs[#JungleFocusMobs+1] = obj
  686. elseif JungleMobNames[obj.name] then
  687. JungleMobs[#JungleMobs+1] = obj
  688. end
  689. end
  690. end
  691.  
  692. function OnDeleteObj(obj)
  693. for i, Mob in pairs(JungleMobs) do
  694. if obj.name == Mob.name then
  695. table.remove(JungleMobs, i)
  696. end
  697. end
  698. for i, Mob in pairs(JungleFocusMobs) do
  699. if obj.name == Mob.name then
  700. table.remove(JungleFocusMobs, i)
  701. end
  702. end
  703. end
  704.  
  705. function TrueRange()
  706. return myHero.range + GetDistance(myHero, myHero.minBBox)
  707. end
  708.  
  709. -- Trees
  710. function GetCustomTarget()
  711. TargetSelector:update()
  712. if _G.MMA_Target and _G.MMA_Target.type == myHero.type then return _G.MMA_Target end
  713. if _G.AutoCarry and _G.AutoCarry.Crosshair and _G.AutoCarry.Attack_Crosshair and _G.AutoCarry.Attack_Crosshair.target and _G.AutoCarry.Attack_Crosshair.target.type == myHero.type then return _G.AutoCarry.Attack_Crosshair.target end
  714. return TargetSelector.target
  715. end
  716.  
  717. function GetBestCircularFarmPosition(range, radius, objects)
  718. local BestPos
  719. local BestHit = 0
  720. for i, object in ipairs(objects) do
  721. local hit = CountObjectsNearPos(object.visionPos or object, range, radius, objects)
  722. if hit > BestHit then
  723. BestHit = hit
  724. BestPos = Vector(object)
  725. if BestHit == #objects then
  726. break
  727. end
  728. end
  729. end
  730. return BestPos, BestHit
  731. end
  732.  
  733. function CountObjectsNearPos(pos, range, radius, objects)
  734. local n = 0
  735. for i, object in ipairs(objects) do
  736. if GetDistance(pos, object) <= radius then
  737. n = n + 1
  738. end
  739. end
  740. return n
  741. end
  742.  
  743. -- Barasia, vadash, viseversa
  744. function DrawCircleNextLvl(x, y, z, radius, width, color, chordlength)
  745. radius = radius or 300
  746. quality = math.max(8,round(180/math.deg((math.asin((chordlength/(2*radius)))))))
  747. quality = 2 * math.pi / quality
  748. radius = radius*.92
  749.  
  750. local points = {}
  751. for theta = 0, 2 * math.pi + quality, quality do
  752. local c = WorldToScreen(D3DXVECTOR3(x + radius * math.cos(theta), y, z - radius * math.sin(theta)))
  753. points[#points + 1] = D3DXVECTOR2(c.x, c.y)
  754. end
  755.  
  756. DrawLines2(points, width or 1, color or 4294967295)
  757. end
  758.  
  759. function round(num)
  760. if num >= 0 then return math.floor(num+.5) else return math.ceil(num-.5) end
  761. end
  762.  
  763. function DrawCircle2(x, y, z, radius, color)
  764. local vPos1 = Vector(x, y, z)
  765. local vPos2 = Vector(cameraPos.x, cameraPos.y, cameraPos.z)
  766. local tPos = vPos1 - (vPos1 - vPos2):normalized() * radius
  767. local sPos = WorldToScreen(D3DXVECTOR3(tPos.x, tPos.y, tPos.z))
  768.  
  769. if OnScreen({ x = sPos.x, y = sPos.y }, { x = sPos.x, y = sPos.y }) then
  770. DrawCircleNextLvl(x, y, z, radius, Settings.drawing.lfc.Width, color, Settings.drawing.lfc.CL)
  771. end
  772. end
  773.  
  774. -- Feez
  775. function isFacing(source, target, lineLength)
  776. local sourceVector = Vector(source.visionPos.x, source.visionPos.z)
  777. local sourcePos = Vector(source.x, source.z)
  778. sourceVector = (sourceVector-sourcePos):normalized()
  779. sourceVector = sourcePos + (sourceVector*(GetDistance(target, source)))
  780. return GetDistanceSqr(target, {x = sourceVector.x, z = sourceVector.y}) <= (lineLength and lineLength^2 or 90000)
  781. end
  782.  
  783. function isBothFacing(source, target, lineLength)
  784. return isFacing(source, target, lineLength) and isFacing(target, source, lineLength)
  785. end
  786.  
  787. function isPoisoned(target)
  788. for i = 1, target.buffCount, 1 do
  789. local tBuff = target:getBuff(i)
  790. if BuffIsValid(tBuff) then
  791. if tBuff.name:lower():find("poison") and (tBuff.endT - (math.max(GetDistance(target), 700)/1800 + 0.200) - GetGameTimer() > 0) then
  792. return true
  793. end
  794. end
  795. end
  796. return false
  797. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement